@@ -88,9 +88,11 @@ struct Phik0shortanalysis {
8888 Configurable<float > v0SettingDCAV0Dau{" v0SettingDCAV0Dau" , 1 , " DCA V0 Daughters" };
8989 Configurable<float > v0SettingDCAPosToPV{" v0SettingDCAPosToPV" , 0.06 , " DCA Pos To PV" };
9090 Configurable<float > v0SettingDCANegToPV{" v0SettingDCANegToPV" , 0.06 , " DCA Neg To PV" };
91+
92+ Configurable<bool > cfgisV0ForData{" cfgisV0ForData" , true , " isV0ForData" };
9193 Configurable<float > nSigmaCutTPCPion{" nSigmaCutTPCPion" , 4.0 , " Value of the TPC Nsigma cut for Pions" };
9294
93- Configurable<bool > cfgFurtherV0Selection{" cfgFurtherV0Selection" , true , " Further V0 selection" };
95+ Configurable<bool > cfgFurtherV0Selection{" cfgFurtherV0Selection" , false , " Further V0 selection" };
9496 Configurable<float > ctauK0s{" ctauK0s" , 20 .0f , " C tau K0s(cm)" };
9597 Configurable<float > paramArmenterosCut{" paramArmenterosCut" , 0.2 , " parameter Armenteros Cut" };
9698 Configurable<float > v0rejK0s{" v0rejK0s" , 0.005 , " V0 rej K0s" };
@@ -242,22 +244,25 @@ struct Phik0shortanalysis {
242244 mcEventHist.add (" hRecMCVertexZ" , " hRecMCVertexZ" , kTH1F , {vertexZAxis});
243245 mcEventHist.add (" hRecMCMultiplicityPercent" , " RecMC Multiplicity Percentile" , kTH1F , {multAxis});
244246 mcEventHist.add (" hRecMCGenMultiplicityPercent" , " RecMC Gen Multiplicity Percentile" , kTH1F , {binnedmultAxis});
247+ mcEventHist.add (" hRecMCGenMultiplicityPercentWithPhi" , " RecMC Gen Multiplicity Percentile in Events with a Phi Candidate" , kTH1F , {binnedmultAxis});
245248
246249 mcEventHist.add (" hGenMCVertexZ" , " hGenMCVertexZ" , kTH1F , {vertexZAxis});
247250 mcEventHist.add (" hGenMCMultiplicityPercent" , " GenMC Multiplicity Percentile" , kTH1F , {binnedmultAxis});
248251
249252 // Phi tpological/PID cuts
253+ candPhiHist.add (" hDCAxyPreCut" , " Dcaxy distribution vs pt before DCAxy cut" , kTH2F , {{100 , 0.0 , 5.0 , " #it{p}_{T} (GeV/#it{c})" }, {2000 , -0.05 , 0.05 , " DCA_{xy} (cm)" }});
254+ candPhiHist.add (" hDCAzPreCut" , " Dcaz distribution vs pt before DCAxy cut" , kTH2F , {{100 , 0.0 , 5.0 , " #it{p}_{T} (GeV/#it{c})" }, {2000 , -0.05 , 0.05 , " DCA_{xy} (cm)" }});
255+ candPhiHist.add (" hDCAxyPostCut" , " Dcaxy distribution vs pt after DCAxy cut" , kTH2F , {{100 , 0.0 , 5.0 , " #it{p}_{T} (GeV/#it{c})" }, {2000 , -0.05 , 0.05 , " DCA_{xy} (cm)" }});
256+ candPhiHist.add (" hDCAzPostCut" , " Dcaz distribution vs pt after DCAxy cut" , kTH2F , {{100 , 0.0 , 5.0 , " #it{p}_{T} (GeV/#it{c})" }, {2000 , -0.05 , 0.05 , " DCA_{xy} (cm)" }});
250257 candPhiHist.add (" hEta" , " Eta distribution" , kTH1F , {{200 , -1 .0f , 1 .0f }});
251- candPhiHist.add (" hDcaxy" , " Dcaxy distribution" , kTH1F , {{200 , -1 .0f , 1 .0f }});
252- candPhiHist.add (" hDcaz" , " Dcaz distribution" , kTH1F , {{200 , -1 .0f , 1 .0f }});
253- candPhiHist.add (" hNsigmaKaonTPC" , " NsigmaKaon TPC distribution" , kTH2F , {ptK0SAxis, {100 , -10 .0f , 10 .0f }});
254- candPhiHist.add (" hNsigmaKaonTOF" , " NsigmaKaon TOF distribution" , kTH2F , {ptK0SAxis, {100 , -10 .0f , 10 .0f }});
258+ candPhiHist.add (" hNsigmaKaonTPC" , " NsigmaKaon TPC distribution" , kTH2F , {{100 , 0.0 , 5.0 , " #it{p} (GeV/#it{c})" }, {100 , -10 .0f , 10 .0f }});
259+ candPhiHist.add (" hNsigmaKaonTOF" , " NsigmaKaon TOF distribution" , kTH2F , {{100 , 0.0 , 5.0 , " #it{p} (GeV/#it{c})" }, {100 , -10 .0f , 10 .0f }});
255260
256261 // K0S topological/PID cuts
257262 candK0SHist.add (" hDCAV0Daughters" , " hDCAV0Daughters" , kTH1F , {{55 , 0 .0f , 2 .2f }});
258263 candK0SHist.add (" hV0CosPA" , " hV0CosPA" , kTH1F , {{100 , 0 .95f , 1 .f }});
259- candK0SHist.add (" hNSigmaPosPionFromK0S" , " hNSigmaPosPionFromK0Short" , kTH2F , {ptK0SAxis, { 100 , -5 . f , 5 . f }});
260- candK0SHist.add (" hNSigmaNegPionFromK0S" , " hNSigmaNegPionFromK0Short" , kTH2F , {ptK0SAxis, { 100 , -5 . f , 5 . f }});
264+ candK0SHist.add (" hNSigmaPosPionFromK0S" , " hNSigmaPosPionFromK0Short" , kTH2F , {{ 100 , 0.0 , 5.0 , " #it{p} (GeV/#it{c}) " }, { 100 , -10 . 0f , 10 . 0f }});
265+ candK0SHist.add (" hNSigmaNegPionFromK0S" , " hNSigmaNegPionFromK0Short" , kTH2F , {{ 100 , 0.0 , 5.0 , " #it{p} (GeV/#it{c}) " }, { 100 , -10 . 0f , 10 . 0f }});
261266
262267 // Phi invariant mass for computing purities and normalisation
263268 dataPhiHist.add (" h2PhipurInvMass" , " Invariant mass of Phi for Purity (no K0S/Pi)" , kTH2F , {binnedmultAxis, massPhiAxis});
@@ -479,10 +484,12 @@ struct Phik0shortanalysis {
479484 if (v0.v0radius () < v0SettingRadius)
480485 return false ;
481486
482- if (std::abs (daughter1.tpcNSigmaPi ()) > nSigmaCutTPCPion)
483- return false ;
484- if (std::abs (daughter2.tpcNSigmaPi ()) > nSigmaCutTPCPion)
485- return false ;
487+ if (cfgisV0ForData) {
488+ if (std::abs (daughter1.tpcNSigmaPi ()) > nSigmaCutTPCPion)
489+ return false ;
490+ if (std::abs (daughter2.tpcNSigmaPi ()) > nSigmaCutTPCPion)
491+ return false ;
492+ }
486493 return true ;
487494 }
488495
@@ -501,7 +508,7 @@ struct Phik0shortanalysis {
501508
502509 // Topological track selection
503510 template <typename T>
504- bool selectionTrackResonance (const T& track)
511+ bool selectionTrackResonance (const T& track, bool isQA )
505512 {
506513 if (cfgPrimaryTrack && !track.isPrimaryTrack ())
507514 return false ;
@@ -510,16 +517,25 @@ struct Phik0shortanalysis {
510517 if (cfgPVContributor && !track.isPVContributor ())
511518 return false ;
512519
520+ if (track.tpcNClsFound () < minTPCnClsFound)
521+ return false ;
522+
513523 if (track.pt () < cMinKaonPtcut)
514524 return false ;
515525 if (std::abs (track.eta ()) > etaMax)
516526 return false ;
517527
518- if (std::abs (track.dcaZ ()) > cMaxDCAzToPVcut)
519- return false ;
528+ if (isQA) {
529+ candPhiHist.fill (HIST (" hDCAxyPreCut" ), track.pt (), track.dcaXY ());
530+ candPhiHist.fill (HIST (" hDCAzPreCut" ), track.pt (), track.dcaZ ());
531+ }
520532 if (std::abs (track.dcaXY ()) > cMaxDCArToPV1 + (cMaxDCArToPV2 / std::pow (track.pt (), cMaxDCArToPV3)))
521533 return false ;
522- if (track.tpcNClsFound () < minTPCnClsFound)
534+ if (isQA) {
535+ candPhiHist.fill (HIST (" hDCAxyPostCut" ), track.pt (), track.dcaXY ());
536+ candPhiHist.fill (HIST (" hDCAzPostCut" ), track.pt (), track.dcaZ ());
537+ }
538+ if (std::abs (track.dcaZ ()) > cMaxDCAzToPVcut)
523539 return false ;
524540 return true ;
525541 }
@@ -667,20 +683,18 @@ struct Phik0shortanalysis {
667683
668684 // Loop over all positive tracks
669685 for (const auto & track1 : posThisColl) {
670- if (!selectionTrackResonance (track1) || !selectionPIDKaonpTdependent (track1))
686+ if (!selectionTrackResonance (track1, true ) || !selectionPIDKaonpTdependent (track1))
671687 continue ; // topological and PID selection
672688
673689 candPhiHist.fill (HIST (" hEta" ), track1.eta ());
674- candPhiHist.fill (HIST (" hDcaxy" ), track1.dcaXY ());
675- candPhiHist.fill (HIST (" hDcaz" ), track1.dcaZ ());
676690 candPhiHist.fill (HIST (" hNsigmaKaonTPC" ), track1.tpcInnerParam (), track1.tpcNSigmaKa ());
677691 candPhiHist.fill (HIST (" hNsigmaKaonTOF" ), track1.tpcInnerParam (), track1.tofNSigmaKa ());
678692
679693 auto track1ID = track1.globalIndex ();
680694
681695 // Loop over all negative tracks
682696 for (const auto & track2 : negThisColl) {
683- if (!selectionTrackResonance (track2) || !selectionPIDKaonpTdependent (track2))
697+ if (!selectionTrackResonance (track2, true ) || !selectionPIDKaonpTdependent (track2))
684698 continue ; // topological and PID selection
685699
686700 auto track2ID = track2.globalIndex ();
@@ -811,14 +825,14 @@ struct Phik0shortanalysis {
811825 // Phi reconstruction
812826 // Loop over positive tracks
813827 for (const auto & track1 : posThisColl) {
814- if (!selectionTrackResonance (track1) || !selectionPIDKaonpTdependent (track1))
828+ if (!selectionTrackResonance (track1, false ) || !selectionPIDKaonpTdependent (track1))
815829 continue ; // topological and PID selection
816830
817831 auto track1ID = track1.globalIndex ();
818832
819833 // Loop over all negative tracks
820834 for (const auto & track2 : negThisColl) {
821- if (!selectionTrackResonance (track2) || !selectionPIDKaonpTdependent (track2))
835+ if (!selectionTrackResonance (track2, false ) || !selectionPIDKaonpTdependent (track2))
822836 continue ; // topological and PID selection
823837
824838 auto track2ID = track2.globalIndex ();
@@ -884,14 +898,14 @@ struct Phik0shortanalysis {
884898 // Phi reconstruction
885899 // Loop over positive tracks
886900 for (const auto & track1 : posThisColl) { // loop over all selected tracks
887- if (!selectionTrackResonance (track1) || !selectionPIDKaonpTdependent (track1))
901+ if (!selectionTrackResonance (track1, false ) || !selectionPIDKaonpTdependent (track1))
888902 continue ; // topological and PID selection
889903
890904 auto track1ID = track1.globalIndex ();
891905
892906 // Loop over all negative tracks
893907 for (const auto & track2 : negThisColl) {
894- if (!selectionTrackResonance (track2) || !selectionPIDKaonpTdependent (track2))
908+ if (!selectionTrackResonance (track2, false ) || !selectionPIDKaonpTdependent (track2))
895909 continue ; // topological and PID selection
896910
897911 auto track2ID = track2.globalIndex ();
@@ -951,7 +965,7 @@ struct Phik0shortanalysis {
951965
952966 // Loop over all positive tracks
953967 for (const auto & track1 : posThisColl) {
954- if (!selectionTrackResonance (track1) || !selectionPIDKaonpTdependent (track1))
968+ if (!selectionTrackResonance (track1, false ) || !selectionPIDKaonpTdependent (track1))
955969 continue ; // topological and PID selection
956970
957971 auto track1ID = track1.globalIndex ();
@@ -964,7 +978,7 @@ struct Phik0shortanalysis {
964978
965979 // Loop over all negative tracks
966980 for (const auto & track2 : negThisColl) {
967- if (!selectionTrackResonance (track2) || !selectionPIDKaonpTdependent (track2))
981+ if (!selectionTrackResonance (track2, false ) || !selectionPIDKaonpTdependent (track2))
968982 continue ; // topological and PID selection
969983
970984 auto track2ID = track2.globalIndex ();
@@ -1258,7 +1272,7 @@ struct Phik0shortanalysis {
12581272
12591273 PROCESS_SWITCH (Phik0shortanalysis, processRecMCPhiPion, " Process RecMC for Phi-Pion Analysis" , false );
12601274
1261- void processRecMCClosurePhiQA (SimCollisions::iterator const & collision, FullMCTracks const & fullMCTracks, FullV0s const & V0s, V0DauMCTracks const &, MCCollisions const &)
1275+ void processRecMCClosurePhiQA (SimCollisions::iterator const & collision, FullMCTracks const & fullMCTracks, FullMCV0s const & V0s, V0DauMCTracks const &, MCCollisions const &, aod::McParticles const &)
12621276 {
12631277 if (!acceptEventQA<true >(collision, true ))
12641278 return ;
@@ -1279,14 +1293,14 @@ struct Phik0shortanalysis {
12791293
12801294 // Loop over all positive tracks
12811295 for (const auto & track1 : posThisColl) {
1282- if (!selectionTrackResonance (track1) || !selectionPIDKaonpTdependent (track1))
1296+ if (!selectionTrackResonance (track1, true ) || !selectionPIDKaonpTdependent (track1))
12831297 continue ; // topological and PID selection
12841298
12851299 auto track1ID = track1.globalIndex ();
12861300
12871301 // Loop over all negative tracks
12881302 for (const auto & track2 : negThisColl) {
1289- if (!selectionTrackResonance (track2) || !selectionPIDKaonpTdependent (track2))
1303+ if (!selectionTrackResonance (track2, true ) || !selectionPIDKaonpTdependent (track2))
12901304 continue ; // topological and PID selection
12911305
12921306 auto track2ID = track2.globalIndex ();
@@ -1299,6 +1313,7 @@ struct Phik0shortanalysis {
12991313
13001314 if (!isCountedPhi) {
13011315 mcEventHist.fill (HIST (" hRecMCEventSelection" ), 7 ); // at least a Phi in the event
1316+ mcEventHist.fill (HIST (" hRecMCGenMultiplicityPercentWithPhi" ), genmultiplicity);
13021317 isCountedPhi = true ;
13031318 }
13041319
@@ -1308,6 +1323,14 @@ struct Phik0shortanalysis {
13081323
13091324 // V0 already reconstructed by the builder
13101325 for (const auto & v0 : V0s) {
1326+ if (cfgisRecMCWPDGForClosure1) {
1327+ if (!v0.has_mcParticle ())
1328+ continue ;
1329+ auto v0mcparticle = v0.mcParticle ();
1330+ if (v0mcparticle.pdgCode () != 310 || !v0mcparticle.isPhysicalPrimary ())
1331+ continue ;
1332+ }
1333+
13111334 const auto & posDaughterTrack = v0.posTrack_as <V0DauMCTracks>();
13121335 const auto & negDaughterTrack = v0.negTrack_as <V0DauMCTracks>();
13131336
@@ -1341,6 +1364,13 @@ struct Phik0shortanalysis {
13411364
13421365 // Loop over all primary pion candidates
13431366 for (const auto & track : fullMCTracks) {
1367+ if (cfgisRecMCWPDGForClosure1) {
1368+ if (!track.has_mcParticle ())
1369+ continue ;
1370+ auto mcTrack = track.mcParticle_as <aod::McParticles>();
1371+ if (std::abs (mcTrack.pdgCode ()) != 211 || !mcTrack.isPhysicalPrimary ())
1372+ continue ;
1373+ }
13441374
13451375 if (!selectionPion<true >(track))
13461376 continue ;
@@ -1371,7 +1401,7 @@ struct Phik0shortanalysis {
13711401
13721402 PROCESS_SWITCH (Phik0shortanalysis, processRecMCClosurePhiQA, " Process for ReCMCQA and Phi in RecMCClosure" , false );
13731403
1374- void processRecMCClosurePhiK0S (SimCollisions::iterator const & collision, FullMCTracks const &, FullMCV0s const & V0s, V0DauMCTracks const &, MCCollisions const &)
1404+ void processRecMCClosurePhiK0S (SimCollisions::iterator const & collision, FullMCTracks const &, FullMCV0s const & V0s, V0DauMCTracks const &, MCCollisions const &, aod::McParticles const & )
13751405 {
13761406 if (!acceptEventQA<true >(collision, false ))
13771407 return ;
@@ -1412,13 +1442,13 @@ struct Phik0shortanalysis {
14121442
14131443 // Phi reconstruction
14141444 for (const auto & track1 : posThisColl) { // loop over all selected tracks
1415- if (!selectionTrackResonance (track1) || !selectionPIDKaonpTdependent (track1))
1445+ if (!selectionTrackResonance (track1, false ) || !selectionPIDKaonpTdependent (track1))
14161446 continue ; // topological and PID selection
14171447
14181448 auto track1ID = track1.globalIndex ();
14191449
14201450 for (const auto & track2 : negThisColl) {
1421- if (!selectionTrackResonance (track2) || !selectionPIDKaonpTdependent (track2))
1451+ if (!selectionTrackResonance (track2, false ) || !selectionPIDKaonpTdependent (track2))
14221452 continue ; // topological and PID selection
14231453
14241454 auto track2ID = track2.globalIndex ();
@@ -1483,7 +1513,7 @@ struct Phik0shortanalysis {
14831513
14841514 PROCESS_SWITCH (Phik0shortanalysis, processRecMCClosurePhiK0S, " Process RecMC for MCClosure Phi-K0S Analysis" , false );
14851515
1486- void processRecMCClosurePhiPion (SimCollisions::iterator const & collision, FullMCTracks const & fullMCTracks, MCCollisions const &)
1516+ void processRecMCClosurePhiPion (SimCollisions::iterator const & collision, FullMCTracks const & fullMCTracks, MCCollisions const &, aod::McParticles const & )
14871517 {
14881518 if (!acceptEventQA<true >(collision, false ))
14891519 return ;
@@ -1520,13 +1550,13 @@ struct Phik0shortanalysis {
15201550
15211551 // Phi reconstruction
15221552 for (const auto & track1 : posThisColl) { // loop over all selected tracks
1523- if (!selectionTrackResonance (track1) || !selectionPIDKaonpTdependent (track1))
1553+ if (!selectionTrackResonance (track1, false ) || !selectionPIDKaonpTdependent (track1))
15241554 continue ; // topological and PID selection
15251555
15261556 auto track1ID = track1.globalIndex ();
15271557
15281558 for (const auto & track2 : negThisColl) {
1529- if (!selectionTrackResonance (track2) || !selectionPIDKaonpTdependent (track2))
1559+ if (!selectionTrackResonance (track2, false ) || !selectionPIDKaonpTdependent (track2))
15301560 continue ; // topological and PID selection
15311561
15321562 auto track2ID = track2.globalIndex ();
0 commit comments