@@ -168,6 +168,7 @@ struct HfCorrelatorLcHadrons {
168168 Produces<aod::TrkRecInfoLc> entryTrackRecoInfo;
169169 Produces<aod::Lc> entryLc;
170170 Produces<aod::Hadron> entryHadron;
171+ Produces<aod::LcHadronTrkPID> entryTrkPID;
171172
172173 Configurable<int > selectionFlagLc{" selectionFlagLc" , 1 , " Selection Flag for Lc" };
173174 Configurable<int > numberEventsMixed{" numberEventsMixed" , 5 , " number of events mixed in ME process" };
@@ -190,13 +191,16 @@ struct HfCorrelatorLcHadrons {
190191 Configurable<std::vector<double >> efficiencyLc{" efficiencyLc" , {1 ., 1 ., 1 ., 1 ., 1 ., 1 .}, " efficiency values for Lc" };
191192 Configurable<bool > storeAutoCorrelationFlag{" storeAutoCorrelationFlag" , false , " Store flag that indicates if the track is paired to its Lc mother instead of skipping it" };
192193 Configurable<bool > correlateLcWithLeadingParticle{" correlateLcWithLeadingParticle" , false , " Switch for correlation of Lc baryons with leading particle only" };
193- Configurable<std::vector<int >> trkPIDspecies{" trkPIDspecies" , std::vector<int >{o2::track::PID::Proton, o2::track::PID::Pion, o2::track::PID::Kaon}, " Trk sel: Particles species for PID, proton, pion, kaon" };
194194 Configurable<bool > pidTrkApplied{" pidTrkApplied" , false , " Apply PID selection for associated tracks" };
195+ Configurable<std::vector<int >> trkPIDspecies{" trkPIDspecies" , std::vector<int >{o2::track::PID::Proton, o2::track::PID::Pion, o2::track::PID::Kaon}, " Trk sel: Particles species for PID, proton, pion, kaon" };
195196 Configurable<std::vector<float >> pidTPCMax{" pidTPCMax" , std::vector<float >{3 ., 0 ., 0 .}, " maximum nSigma TPC" };
196197 Configurable<std::vector<float >> pidTOFMax{" pidTOFMax" , std::vector<float >{3 ., 0 ., 0 .}, " maximum nSigma TOF" };
197- Configurable<float > tofPIDThreshold{" tofPIDThreshold" , 0.80 , " minimum pT after which TOF PID is applicable" };
198+ Configurable<float > tofPIDThreshold{" tofPIDThreshold" , 0.75 , " minimum pT after which TOF PID is applicable" };
198199 Configurable<bool > fillTrkPID{" fillTrkPID" , false , " fill PID information for associated tracks" };
199200 Configurable<bool > forceTOF{" forceTOF" , false , " fill PID information for associated tracks" };
201+ Configurable<bool > calTrkEff{" calTrkEff" , false , " fill histograms to calculate efficiency" };
202+ Configurable<bool > isRecTrkPhyPrimary{" isRecTrkPhyPrimary" , true , " Calculate the efficiency of reconstructed primary physical tracks" };
203+ Configurable<bool > calEffLcEvent{" calEffLcEvent" , true , " Calculate the efficiency of Lc candidate" };
200204
201205 HfHelper hfHelper;
202206 SliceCache cache;
@@ -249,6 +253,7 @@ struct HfCorrelatorLcHadrons {
249253 AxisSpec axisBdtScore = {binsBdtScore, " Bdt score" };
250254 AxisSpec axisPoolBin = {binsPoolBin, " PoolBin" };
251255 AxisSpec axisRapidity = {100 , -2 , 2 , " Rapidity" };
256+ AxisSpec axisSign = {2 , -1 , 1 , " Sign" };
252257
253258 registry.add (" hPtCand" , " Lc,Hadron candidates;candidate #it{p}_{T} (GeV/#it{c});entries" , {HistType::kTH1F , {axisPtLc}});
254259 registry.add (" hPtProng0" , " Lc,Hadron candidates;prong 0 #it{p}_{T} (GeV/#it{c});entries" , {HistType::kTH1F , {axisPtLc}});
@@ -293,6 +298,9 @@ struct HfCorrelatorLcHadrons {
293298 registry.add (" hYMcRecBkg" , " Lc,Hadron candidates - MC reco;candidate #it{#y};entries" , {HistType::kTH1F , {axisRapidity}});
294299 registry.add (" hFakeTracksMcRec" , " Fake tracks - MC Rec" , {HistType::kTH1F , {axisPtHadron}});
295300 registry.add (" hPtParticleAssocVsCandMcRec" , " Associated Particle - MC Rec" , {HistType::kTH2F , {{axisPtHadron}, {axisPtLc}}});
301+ registry.add (" hPtTracksVsSignRec" , " Associated Particle - MC Rec" , {HistType::kTH2F , {{axisPtHadron}, {axisSign}}});
302+ registry.add (" hPtTracksVsSignRecTrue" , " Associated Particle - MC Rec (True)" , {HistType::kTH2F , {{axisPtHadron}, {axisSign}}});
303+ registry.add (" hPtTracksVsSignGen" , " Associated Particle - MC Gen" , {HistType::kTH2F , {{axisPtHadron}, {axisSign}}});
296304 registry.add (" hPtPrimaryParticleAssocVsCandMcRec" , " Associated Particle - MC Rec" , {HistType::kTH2F , {{axisPtHadron}, {axisPtLc}}});
297305 registry.add (" hPtVsMultiplicityMcRecPrompt" , " Multiplicity FT0M - MC Rec Prompt" , {HistType::kTH2F , {{axisPtLc}, {axisMultFT0M}}});
298306 registry.add (" hPtVsMultiplicityMcRecNonPrompt" , " Multiplicity FT0M - MC Rec Non Prompt" , {HistType::kTH2F , {{axisPtLc}, {axisMultFT0M}}});
@@ -343,7 +351,7 @@ struct HfCorrelatorLcHadrons {
343351 }
344352 registry.fill (HIST (" hMultiplicity" ), nTracks);
345353
346- int cntLc = 0 ;
354+ int countLc = 0 ;
347355 std::vector<float > outputMl = {-1 ., -1 ., -1 .};
348356
349357 for (const auto & candidate : candidates) {
@@ -438,12 +446,15 @@ struct HfCorrelatorLcHadrons {
438446 entryLcHadronPairTrkPID (track.tpcNSigmaPr (), track.tpcNSigmaKa (), track.tpcNSigmaPi (), track.tofNSigmaPr (), track.tofNSigmaKa (), track.tofNSigmaPi ());
439447 }
440448 }
441- if (cntLc == 0 ) {
442- entryHadron (track.phi (), track.eta (), track.pt (), poolBin, gCollisionId , timeStamp);
449+ if (countLc == 0 ) {
450+ entryHadron (track.phi (), track.eta (), track.pt () * track.sign (), poolBin, gCollisionId , timeStamp);
451+ if (fillTrkPID) {
452+ entryTrkPID (track.tpcNSigmaPr (), track.tpcNSigmaKa (), track.tpcNSigmaPi (), track.tofNSigmaPr (), track.tofNSigmaKa (), track.tofNSigmaPi ());
453+ }
443454 registry.fill (HIST (" hTracksBin" ), poolBin);
444455 }
445456 } // Hadron Tracks loop
446- cntLc ++;
457+ countLc ++;
447458 } // end outer Lc loop
448459 registry.fill (HIST (" hZvtx" ), collision.posZ ());
449460 registry.fill (HIST (" hMultFT0M" ), collision.multFT0M ());
@@ -486,6 +497,7 @@ struct HfCorrelatorLcHadrons {
486497 bool isLcPrompt = false ;
487498 bool isLcNonPrompt = false ;
488499 bool isLcSignal = false ;
500+ int countLc = 1 ;
489501 for (const auto & candidate : candidates) {
490502 // check decay channel flag for candidate
491503 if (std::abs (hfHelper.yLc (candidate)) > yCandMax || candidate.pt () < ptCandMin || candidate.pt () > ptCandMax) {
@@ -574,6 +586,31 @@ struct HfCorrelatorLcHadrons {
574586 }
575587 registry.fill (HIST (" hLcBin" ), poolBin);
576588
589+ if (calTrkEff && !isLcSignal && calEffLcEvent)
590+ continue ;
591+
592+ if (calTrkEff && countLc == 1 ) {
593+ // genrated tracks
594+ for (const auto & track : mcParticles) {
595+ if (std::abs (track.eta ()) > etaTrackMax || track.pt () < ptTrackMin || track.pt () > ptTrackMax) {
596+ continue ;
597+ }
598+ if ((std::abs (track.pdgCode ()) != kElectron ) && (std::abs (track.pdgCode ()) != kMuonMinus ) && (std::abs (track.pdgCode ()) != kPiPlus ) && (std::abs (track.pdgCode ()) != kKPlus ) && (std::abs (track.pdgCode ()) != kProton )) {
599+ continue ;
600+ }
601+
602+ if (pidTrkApplied && (std::abs (track.pdgCode ()) != kProton ))
603+ continue ; // proton PID
604+
605+ if (!track.isPhysicalPrimary ()) {
606+ continue ;
607+ }
608+
609+ int8_t chargeTrack = pdg->GetParticle (track.pdgCode ())->Charge (); // Retrieve charge
610+ registry.fill (HIST (" hPtTracksVsSignGen" ), track.pt (), chargeTrack);
611+ }
612+ }
613+
577614 // Lc-Hadron correlation dedicated section
578615 // if the candidate is selected as Lc, search for Hadron ad evaluate correlations
579616 for (const auto & track : tracks) {
@@ -587,6 +624,17 @@ struct HfCorrelatorLcHadrons {
587624 if (!passPIDSelection (track, trkPIDspecies, pidTPCMax, pidTOFMax, tofPIDThreshold, forceTOF))
588625 continue ;
589626 }
627+
628+ if (calTrkEff && countLc == 1 && track.has_mcParticle ()) {
629+ auto mcParticle = track.template mcParticle_as <aod::McParticles>();
630+ if (!mcParticle.isPhysicalPrimary () && isRecTrkPhyPrimary)
631+ continue ;
632+
633+ registry.fill (HIST (" hPtTracksVsSignRec" ), track.pt (), track.sign ());
634+ if (std::abs (mcParticle.pdgCode ()) == kProton )
635+ registry.fill (HIST (" hPtTracksVsSignRecTrue" ), track.pt (), track.sign ());
636+ }
637+
590638 // Removing Lc daughters by checking track indices
591639 if ((candidate.prong0Id () == track.globalIndex ()) || (candidate.prong1Id () == track.globalIndex ()) || (candidate.prong2Id () == track.globalIndex ())) {
592640 if (!storeAutoCorrelationFlag) {
@@ -659,6 +707,7 @@ struct HfCorrelatorLcHadrons {
659707 entryTrackRecoInfo (track.dcaXY (), track.dcaZ (), track.tpcNClsCrossedRows ());
660708 }
661709 } // end inner loop (Tracks)
710+ countLc++;
662711 } // end outer Lc loop
663712 registry.fill (HIST (" hZvtx" ), collision.posZ ());
664713 registry.fill (HIST (" hMultFT0M" ), collision.multFT0M ());
0 commit comments