@@ -97,9 +97,9 @@ struct Kstarqa {
9797 Configurable<int > rotationalCut{" rotationalCut" , 10 , " Cut value (Rotation angle pi - pi/cut and pi + pi/cut)" };
9898 Configurable<float > cfgCutPT{" cfgCutPT" , 0 .2f , " PT cut on daughter track" };
9999 Configurable<float > cfgCutEtaMax{" cfgCutEtaMax" , 0 .8f , " Eta cut on daughter track" };
100- Configurable<float > cfgCutEtaMin{" cfgCutEtaMin" , 0 .0f , " Eta cut on daughter track" };
100+ // Configurable<float> cfgCutEtaMin{"cfgCutEtaMin", 0.0f, "Eta cut on daughter track"};
101101 Configurable<float > cfgCutDCAxyMax{" cfgCutDCAxyMax" , 2 .0f , " DCAxy range for tracks" };
102- Configurable<float > cfgCutDCAxyMin{" cfgCutDCAxyMin" , 0 .0f , " DCAxy range for tracks" };
102+ // Configurable<float> cfgCutDCAxyMin{"cfgCutDCAxyMin", 0.0f, "DCAxy range for tracks"};
103103 Configurable<float > cfgCutDCAz{" cfgCutDCAz" , 2 .0f , " DCAz range for tracks" };
104104 Configurable<float > ctrackRapidity{" ctrackRapidity" , 0 .3f , " Cut on track rapidity" };
105105 Configurable<int > cfgNoMixedEvents{" cfgNoMixedEvents" , 5 , " Number of mixed events per event" };
@@ -324,18 +324,20 @@ struct Kstarqa {
324324
325325 std::shared_ptr<TH1> hrecLabel = rEventSelection.get <TH1>(HIST (" recMCparticles" ));
326326 hrecLabel->GetXaxis ()->SetBinLabel (1 , " All tracks" );
327- hrecLabel->GetXaxis ()->SetBinLabel (2 , " Track selection " );
328- hrecLabel->GetXaxis ()->SetBinLabel (3 , " has_MC " );
327+ hrecLabel->GetXaxis ()->SetBinLabel (2 , " has_MC " );
328+ hrecLabel->GetXaxis ()->SetBinLabel (3 , " Track selection " );
329329 hrecLabel->GetXaxis ()->SetBinLabel (4 , " StrictlyUpperIndex" );
330330 hrecLabel->GetXaxis ()->SetBinLabel (5 , " Unlike Sign" );
331331 hrecLabel->GetXaxis ()->SetBinLabel (6 , " Physical Primary" );
332- hrecLabel->GetXaxis ()->SetBinLabel (7 , " PID Cut" );
333- hrecLabel->GetXaxis ()->SetBinLabel (8 , " Rapidity Cut" );
334- hrecLabel->GetXaxis ()->SetBinLabel (9 , " Same mother" );
335- hrecLabel->GetXaxis ()->SetBinLabel (10 , " Generator" );
336- hrecLabel->GetXaxis ()->SetBinLabel (11 , " Rapidity" );
337- hrecLabel->GetXaxis ()->SetBinLabel (12 , " MotherPID313" );
338- hrecLabel->GetXaxis ()->SetBinLabel (13 , " Split track" );
332+ hrecLabel->GetXaxis ()->SetBinLabel (7 , " Track PDG" );
333+ hrecLabel->GetXaxis ()->SetBinLabel (8 , " Global Index" );
334+ hrecLabel->GetXaxis ()->SetBinLabel (9 , " Generator" );
335+ hrecLabel->GetXaxis ()->SetBinLabel (10 , " Mother y" );
336+ hrecLabel->GetXaxis ()->SetBinLabel (11 , " Mother PDG" );
337+ hrecLabel->GetXaxis ()->SetBinLabel (12 , " Track PID" );
338+ hrecLabel->GetXaxis ()->SetBinLabel (13 , " Track MID" );
339+ hrecLabel->GetXaxis ()->SetBinLabel (14 , " Track y" );
340+ hrecLabel->GetXaxis ()->SetBinLabel (15 , " Split tracks" );
339341
340342 std::shared_ptr<TH1> hDataTracks = rEventSelection.get <TH1>(HIST (" tracksCheckData" ));
341343 hDataTracks->GetXaxis ()->SetBinLabel (1 , " All tracks" );
@@ -455,16 +457,18 @@ struct Kstarqa {
455457 return false ;
456458 if (std::abs (candidate.pt ()) < selectionConfig.cfgCutPT )
457459 return false ;
458- if (std::abs (candidate.eta ()) > selectionConfig.cfgCutEtaMax || std::abs (candidate.eta ()) < selectionConfig.cfgCutEtaMin )
460+ // if (std::abs(candidate.eta()) > selectionConfig.cfgCutEtaMax || std::abs(candidate.eta()) < selectionConfig.cfgCutEtaMin)
461+ if (std::abs (candidate.eta ()) > selectionConfig.cfgCutEtaMax )
459462 return false ;
460463 if (!selectionConfig.isApplyPtDepDCAxyCut ) {
461- if (std::abs (candidate.dcaXY ()) > selectionConfig.cfgCutDCAxyMax || std::abs (candidate.dcaXY ()) < selectionConfig.cfgCutDCAxyMin )
464+ // if (std::abs(candidate.dcaXY()) > selectionConfig.cfgCutDCAxyMax || std::abs(candidate.dcaXY()) < selectionConfig.cfgCutDCAxyMin)
465+ if (std::abs (candidate.dcaXY ()) > selectionConfig.cfgCutDCAxyMax )
462466 return false ;
463467 } else {
464468 if (std::abs (candidate.dcaXY ()) > (0.0105 + 0.035 / std::pow (candidate.pt (), 1.1 )))
465469 return false ;
466470 }
467- if (selectionConfig.isGoldenChi2 && candidate.passedGoldenChi2 ())
471+ if (selectionConfig.isGoldenChi2 && ! candidate.passedGoldenChi2 ())
468472 return false ;
469473 if (std::abs (candidate.dcaZ ()) > selectionConfig.cfgCutDCAz )
470474 return false ;
@@ -485,9 +489,11 @@ struct Kstarqa {
485489 } else if (!selectionConfig.isGlobalTracks ) {
486490 if (std::abs (candidate.pt ()) < selectionConfig.cfgCutPT )
487491 return false ;
488- if (std::abs (candidate.eta ()) > selectionConfig.cfgCutEtaMax || std::abs (candidate.eta ()) < selectionConfig.cfgCutEtaMin )
492+ // if (std::abs(candidate.eta()) > selectionConfig.cfgCutEtaMax || std::abs(candidate.eta()) < selectionConfig.cfgCutEtaMin)
493+ if (std::abs (candidate.eta ()) > selectionConfig.cfgCutEtaMax )
489494 return false ;
490- if (std::abs (candidate.dcaXY ()) > selectionConfig.cfgCutDCAxyMax || std::abs (candidate.dcaXY ()) < selectionConfig.cfgCutDCAxyMin )
495+ // if (std::abs(candidate.dcaXY()) > selectionConfig.cfgCutDCAxyMax || std::abs(candidate.dcaXY()) < selectionConfig.cfgCutDCAxyMin)
496+ if (std::abs (candidate.dcaXY ()) > selectionConfig.cfgCutDCAxyMax )
491497 return false ;
492498 if (std::abs (candidate.dcaZ ()) > selectionConfig.cfgCutDCAz )
493499 return false ;
@@ -650,8 +656,10 @@ struct Kstarqa {
650656 // Filter eventFilter = (o2::aod::evsel::sel8 == true);
651657 Filter posZFilter = (nabs(o2::aod::collision::posZ) < selectionConfig.cutzvertex);
652658
653- Filter acceptanceFilter = (nabs(aod::track::eta) < selectionConfig.cfgCutEtaMax && nabs(aod::track::pt) > selectionConfig.cfgCutPT) && (nabs(aod::track::eta) > selectionConfig.cfgCutEtaMin);
654- Filter fDCAcutFilter = (nabs(aod::track::dcaXY) < selectionConfig.cfgCutDCAxyMax) && (nabs(aod::track::dcaZ) < selectionConfig.cfgCutDCAz) && (nabs(aod::track::dcaXY) > selectionConfig.cfgCutDCAxyMin);
659+ // Filter acceptanceFilter = (nabs(aod::track::eta) < selectionConfig.cfgCutEtaMax && nabs(aod::track::pt) > selectionConfig.cfgCutPT) && (nabs(aod::track::eta) > selectionConfig.cfgCutEtaMin);
660+ Filter acceptanceFilter = (nabs(aod::track::eta) < selectionConfig.cfgCutEtaMax && nabs(aod::track::pt) > selectionConfig.cfgCutPT);
661+ // Filter fDCAcutFilter = (nabs(aod::track::dcaXY) < selectionConfig.cfgCutDCAxyMax) && (nabs(aod::track::dcaZ) < selectionConfig.cfgCutDCAz) && (nabs(aod::track::dcaXY) > selectionConfig.cfgCutDCAxyMin);
662+ Filter fDCAcutFilter = (nabs(aod::track::dcaXY) < selectionConfig.cfgCutDCAxyMax) && (nabs(aod::track::dcaZ) < selectionConfig.cfgCutDCAz);
655663
656664 using EventCandidates = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::FT0Mults, aod::MultZeqs, aod::CentFT0Ms, aod::CentFT0Cs, aod::CentFT0As, aod::CentFV0As, aod::PVMults>>; // aod::CentNGlobals, aod::CentNTPVs, aod::CentMFTs
657665 using EventCandidatesMix = soa::Filtered<soa::Join<aod::Collisions, aod::EvSels, aod::FT0Mults, aod::MultZeqs, aod::CentFT0Ms, aod::CentFT0Cs, aod::CentFT0As, aod::CentFV0As>>; // aod::CentNGlobals, aod::CentNTPVs, aod::CentMFTs
@@ -1126,6 +1134,17 @@ struct Kstarqa {
11261134 if (!selectionPID (t1, 1 ) || !selectionPID (t2, 0 ))
11271135 continue ;
11281136
1137+ if (selectionConfig.isApplyParticleMID ) {
1138+ if (selectionPID (t1, 0 )) // Kaon misidentified as pion
1139+ continue ;
1140+ if (selectionPID (t1, 2 )) // Kaon misidentified as proton
1141+ continue ;
1142+ if (selectionPID (t2, 1 )) // Pion misidentified as kaon
1143+ continue ;
1144+ if (selectionPID (t2, 2 )) // Pion misidentified as proton
1145+ continue ;
1146+ }
1147+
11291148 if (!t1.has_mcParticle () || !t2.has_mcParticle ()) {
11301149 continue ; // skip if no MC particle associated
11311150 }
@@ -1282,12 +1301,23 @@ struct Kstarqa {
12821301 continue ;
12831302 rEventSelection.fill (HIST (" tracksCheckData" ), 3.5 );
12841303
1304+ if (selectionConfig.isApplyParticleMID ) {
1305+ if (selectionPID (track1, 0 )) // Kaon misidentified as pion
1306+ continue ;
1307+ if (selectionPID (track1, 2 )) // Kaon misidentified as proton
1308+ continue ;
1309+ if (selectionPID (track2, 1 )) // Pion misidentified as kaon
1310+ continue ;
1311+ if (selectionPID (track2, 2 )) // Pion misidentified as proton
1312+ continue ;
1313+ }
1314+
1315+ rEventSelection.fill (HIST (" tracksCheckData" ), 4.5 );
12851316 if (std::abs (track1.rapidity (o2::track::PID::getMass (o2::track::PID::Kaon))) > selectionConfig.ctrackRapidity )
12861317 continue ;
12871318
12881319 if (std::abs (track2.rapidity (o2::track::PID::getMass (o2::track::PID::Pion))) > selectionConfig.ctrackRapidity )
12891320 continue ;
1290- rEventSelection.fill (HIST (" tracksCheckData" ), 4.5 );
12911321
12921322 // if (cFakeTrack && isFakeTrack(track1, 1)) // Kaon
12931323 // continue;
@@ -1731,22 +1761,14 @@ struct Kstarqa {
17311761 // if (!(track1PDG == PDG_t::kKPlus && track2PDG == PDG_t::kPiPlus)) {
17321762 // continue;
17331763 // }
1734- if (selectionConfig.isPDGCheckMC && (track1PDG != PDG_t::kPiPlus ) && (track1PDG != PDG_t::kKPlus )) {
1764+ if (selectionConfig.isPDGCheckMC && (( track1PDG != PDG_t::kKPlus ) || (track1PDG != PDG_t::kPiPlus ) )) {
17351765 continue ;
17361766 }
1737- if (selectionConfig.isPDGCheckMC && (track2PDG != PDG_t::kPiPlus ) && (track2PDG != PDG_t::kKPlus )) {
1767+ if (selectionConfig.isPDGCheckMC && (( track2PDG != PDG_t::kKPlus ) || (track2PDG != PDG_t::kPiPlus ) )) {
17381768 continue ;
17391769 }
17401770 rEventSelection.fill (HIST (" recMCparticles" ), 6.5 );
17411771
1742- if (std::abs (track1.rapidity (o2::track::PID::getMass (o2::track::PID::Kaon))) > selectionConfig.ctrackRapidity )
1743- continue ;
1744-
1745- if (std::abs (track2.rapidity (o2::track::PID::getMass (o2::track::PID::Pion))) > selectionConfig.ctrackRapidity )
1746- continue ;
1747-
1748- rEventSelection.fill (HIST (" recMCparticles" ), 7.5 );
1749-
17501772 for (const auto & mothertrack1 : mctrack1.mothers_as <aod::McParticles>()) {
17511773 for (const auto & mothertrack2 : mctrack2.mothers_as <aod::McParticles>()) {
17521774 if (selectionConfig.isPDGCheckMC && (mothertrack1.pdgCode () != mothertrack2.pdgCode ())) {
@@ -1756,35 +1778,75 @@ struct Kstarqa {
17561778 if (mothertrack1.globalIndex () != mothertrack2.globalIndex ()) {
17571779 continue ;
17581780 }
1759- rEventSelection.fill (HIST (" recMCparticles" ), 8 .5 );
1781+ rEventSelection.fill (HIST (" recMCparticles" ), 7 .5 );
17601782
17611783 if (!mothertrack1.producedByGenerator ()) {
17621784 continue ;
17631785 }
1764- rEventSelection.fill (HIST (" recMCparticles" ), 9 .5 );
1786+ rEventSelection.fill (HIST (" recMCparticles" ), 8 .5 );
17651787
17661788 if (std::abs (mothertrack1.y ()) >= selectionConfig.rapidityMotherData ) {
17671789 continue ;
17681790 }
1769- rEventSelection.fill (HIST (" recMCparticles" ), 10 .5 );
1791+ rEventSelection.fill (HIST (" recMCparticles" ), 9 .5 );
17701792
17711793 if (selectionConfig.isPDGCheckMC && (std::abs (mothertrack1.pdgCode ()) != o2::constants::physics::kK0Star892 )) {
17721794 continue ;
17731795 }
1774- rEventSelection.fill (HIST (" recMCparticles" ), 11 .5 );
1796+ rEventSelection.fill (HIST (" recMCparticles" ), 10 .5 );
17751797
17761798 if (selectionConfig.isPDGCheckMC && (track1PDG == PDG_t::kPiPlus )) {
17771799 if (!applypTdepPID && !(selectionPID (track1, 0 ) && selectionPID (track2, 1 ))) { // pion and kaon
17781800 continue ;
17791801 } else if (applypTdepPID && !(selectionPIDNew (track1, 0 ) && selectionPIDNew (track2, 1 ))) { // pion and kaon
17801802 continue ;
17811803 }
1782- } else if (selectionConfig.isPDGCheckMC ) {
1804+ rEventSelection.fill (HIST (" recMCparticles" ), 11.5 );
1805+ if (selectionConfig.isApplyParticleMID ) {
1806+ if (selectionPID (track2, 0 )) // Kaon misidentified as pion
1807+ continue ;
1808+ if (selectionPID (track2, 2 )) // Kaon misidentified as proton
1809+ continue ;
1810+ if (selectionPID (track1, 1 )) // Pion misidentified as kaon
1811+ continue ;
1812+ if (selectionPID (track1, 2 )) // Pion misidentified as proton
1813+ continue ;
1814+ }
1815+ rEventSelection.fill (HIST (" recMCparticles" ), 12.5 );
1816+
1817+ if (std::abs (track1.rapidity (o2::track::PID::getMass (o2::track::PID::Pion))) > selectionConfig.ctrackRapidity )
1818+ continue ;
1819+
1820+ if (std::abs (track2.rapidity (o2::track::PID::getMass (o2::track::PID::Kaon))) > selectionConfig.ctrackRapidity )
1821+ continue ;
1822+ rEventSelection.fill (HIST (" recMCparticles" ), 13.5 );
1823+
1824+ } else if (selectionConfig.isPDGCheckMC && (track1PDG == PDG_t::kKPlus )) {
17831825 if (!applypTdepPID && !(selectionPID (track1, 1 ) && selectionPID (track2, 0 ))) { // kaon and pion
17841826 continue ;
17851827 } else if (applypTdepPID && !(selectionPIDNew (track1, 1 ) && selectionPIDNew (track2, 0 ))) { // kaon and pion
17861828 continue ;
17871829 }
1830+ rEventSelection.fill (HIST (" recMCparticles" ), 11.5 );
1831+
1832+ if (selectionConfig.isApplyParticleMID ) {
1833+ if (selectionPID (track1, 0 )) // Kaon misidentified as pion
1834+ continue ;
1835+ if (selectionPID (track1, 2 )) // Kaon misidentified as proton
1836+ continue ;
1837+ if (selectionPID (track2, 1 )) // Pion misidentified as kaon
1838+ continue ;
1839+ if (selectionPID (track2, 2 )) // Pion misidentified as proton
1840+ continue ;
1841+ }
1842+ rEventSelection.fill (HIST (" recMCparticles" ), 12.5 );
1843+
1844+ if (std::abs (track1.rapidity (o2::track::PID::getMass (o2::track::PID::Kaon))) > selectionConfig.ctrackRapidity )
1845+ continue ;
1846+
1847+ if (std::abs (track2.rapidity (o2::track::PID::getMass (o2::track::PID::Pion))) > selectionConfig.ctrackRapidity )
1848+ continue ;
1849+ rEventSelection.fill (HIST (" recMCparticles" ), 13.5 );
17881850 }
17891851
17901852 if (selectionConfig.isApplyCutsOnMother ) {
@@ -1798,7 +1860,7 @@ struct Kstarqa {
17981860 hInvMass.fill (HIST (" h1KSRecsplit" ), mothertrack1.pt ());
17991861 continue ;
18001862 }
1801- rEventSelection.fill (HIST (" recMCparticles" ), 12 .5 );
1863+ rEventSelection.fill (HIST (" recMCparticles" ), 14 .5 );
18021864
18031865 oldindex = mothertrack1.globalIndex ();
18041866 if (track1.sign () * track2.sign () < 0 ) {
0 commit comments