@@ -45,6 +45,9 @@ struct femtoUniversePairTaskTrackCascadeExtended { // o2-linter: disable=name/st
4545 using FemtoFullParticles = soa::Join<aod::FDCascParticles, aod::FDExtParticles>;
4646 Preslice<FemtoFullParticles> perCol = aod::femtouniverseparticle::fdCollisionId;
4747
48+ using FemtoRecoParticles = soa::Join<aod::FDCascParticles, aod::FDExtParticles, aod::FDMCLabels>;
49+ Preslice<FemtoRecoParticles> perColReco = aod::femtouniverseparticle::fdCollisionId;
50+
4851 ConfigurableAxis confChildTempFitVarpTBins{" ConfChildTempFitVarpTBins" , {20 , 0.5 , 4.05 }, " V0 child: pT binning of the pT vs. TempFitVar plot" };
4952 ConfigurableAxis confChildTempFitVarBins{" ConfChildTempFitVarBins" , {300 , -0.15 , 0.15 }, " V0 child: binning of the TempFitVar in the pT vs. TempFitVar plot" };
5053 Configurable<float > confCascInvMassLowLimit{" ConfCascInvMassLowLimit" , 1.315 , " Lower limit of the Casc invariant mass" };
@@ -101,10 +104,12 @@ struct femtoUniversePairTaskTrackCascadeExtended { // o2-linter: disable=name/st
101104 // / Partition for particle 1 (track)
102105 Partition<FemtoFullParticles> partsOne = (aod::femtouniverseparticle::partType == uint8_t (aod::femtouniverseparticle::ParticleType::kTrack )) && (aod::femtouniverseparticle::sign == confChargePart1) && (nabs(aod::femtouniverseparticle::eta) < confEta) && (aod::femtouniverseparticle::pt < confHPtPart1) && (aod::femtouniverseparticle::pt > confLPtPart1);
103106 Partition<FemtoFullParticles> partsOneMCgen = (aod::femtouniverseparticle::partType == uint8_t (aod::femtouniverseparticle::ParticleType::kMCTruthTrack )) && (nabs(aod::femtouniverseparticle::eta) < confEta) && (aod::femtouniverseparticle::pt < confHPtPart1) && (aod::femtouniverseparticle::pt > confLPtPart1);
107+ Partition<FemtoRecoParticles> partsOneMCreco = (aod::femtouniverseparticle::partType == uint8_t (aod::femtouniverseparticle::ParticleType::kTrack )) && (aod::femtouniverseparticle::sign == confChargePart1) && (nabs(aod::femtouniverseparticle::eta) < confEta) && (aod::femtouniverseparticle::pt < confHPtPart1) && (aod::femtouniverseparticle::pt > confLPtPart1);
104108
105109 // / Partition for particle 2 (cascade)
106110 Partition<FemtoFullParticles> partsTwo = (aod::femtouniverseparticle::partType == uint8_t (aod::femtouniverseparticle::ParticleType::kCascade )) && (aod::femtouniverseparticle::pt < confHPtPart2) && (aod::femtouniverseparticle::pt > confLPtPart2);
107111 Partition<FemtoFullParticles> partsTwoMCgen = (aod::femtouniverseparticle::partType == uint8_t (aod::femtouniverseparticle::ParticleType::kMCTruthTrack )) && (aod::femtouniverseparticle::pt < confHPtPart2) && (aod::femtouniverseparticle::pt > confLPtPart2);
112+ Partition<FemtoRecoParticles> partsTwoMCreco = (aod::femtouniverseparticle::partType == uint8_t (aod::femtouniverseparticle::ParticleType::kCascade )) && (aod::femtouniverseparticle::pt < confHPtPart2) && (aod::femtouniverseparticle::pt > confLPtPart2);
108113
109114 // / Partition for cascades
110115 Partition<FemtoFullParticles> cascs = (aod::femtouniverseparticle::partType == uint8_t (aod::femtouniverseparticle::ParticleType::kCascade ));
@@ -131,6 +136,8 @@ struct femtoUniversePairTaskTrackCascadeExtended { // o2-linter: disable=name/st
131136 HistogramRegistry rXiQA{" xi" , {}, OutputObjHandlingPolicy::AnalysisObject, true , true };
132137 HistogramRegistry qaRegistry{" TrackQA" , {}, OutputObjHandlingPolicy::AnalysisObject};
133138 HistogramRegistry resultRegistry{" Correlations" , {}, OutputObjHandlingPolicy::AnalysisObject};
139+ HistogramRegistry registryMCgen{" MCgenHistos" , {}, OutputObjHandlingPolicy::AnalysisObject, false , true };
140+ HistogramRegistry registryMCreco{" MCrecoHistos" , {}, OutputObjHandlingPolicy::AnalysisObject, false , true };
134141
135142 // Table to select cascade daughters
136143 // Charges: = +--, +--, +-+, +-+
@@ -214,6 +221,32 @@ struct femtoUniversePairTaskTrackCascadeExtended { // o2-linter: disable=name/st
214221 qaRegistry.add (" Tracks_neg/nSigmaTPC" , " ; #it{p} (GeV/#it{c}); n#sigma_{TPC}" , kTH2F , {{100 , 0 , 10 }, {200 , -4.975 , 5.025 }});
215222 qaRegistry.add (" Tracks_neg/nSigmaTOF" , " ; #it{p} (GeV/#it{c}); n#sigma_{TOF}" , kTH2F , {{100 , 0 , 10 }, {200 , -4.975 , 5.025 }});
216223
224+ // MC gen
225+ registryMCgen.add (" plus/MCgenCasc" , " MC gen cascades;#it{p}_{T} (GeV/c); #eta" , {HistType::kTH2F , {{500 , 0 , 5 }, {400 , -1.0 , 1.0 }}});
226+ registryMCgen.add (" minus/MCgenCasc" , " MC gen cascades;#it{p}_{T} (GeV/c); #eta" , {HistType::kTH2F , {{500 , 0 , 5 }, {400 , -1.0 , 1.0 }}});
227+
228+ registryMCgen.add (" plus/MCgenAllPt" , " MC gen all;#it{p}_{T} (GeV/c); #eta" , {HistType::kTH1F , {{500 , 0 , 5 }}});
229+ registryMCgen.add (" minus/MCgenAllPt" , " MC gen all;#it{p}_{T} (GeV/c); #eta" , {HistType::kTH1F , {{500 , 0 , 5 }}});
230+
231+ registryMCgen.add (" plus/MCgenPr" , " MC gen protons;#it{p}_{T} (GeV/c); #eta" , {HistType::kTH2F , {{500 , 0 , 5 }, {400 , -1.0 , 1.0 }}});
232+ registryMCgen.add (" minus/MCgenPr" , " MC gen protons;#it{p}_{T} (GeV/c); #eta" , {HistType::kTH2F , {{500 , 0 , 5 }, {400 , -1.0 , 1.0 }}});
233+
234+ registryMCgen.add (" plus/MCgenPrPt" , " MC gen protons;#it{p}_{T} (GeV/c)" , {HistType::kTH1F , {{500 , 0 , 5 }}});
235+ registryMCgen.add (" minus/MCgenPrPt" , " MC gen protons;#it{p}_{T} (GeV/c)" , {HistType::kTH1F , {{500 , 0 , 5 }}});
236+
237+ // MC reco
238+ registryMCreco.add (" plus/MCrecoCascade" , " MC reco Cascades;#it{p}_{T} (GeV/c); #eta" , {HistType::kTH2F , {{500 , 0 , 5 }, {400 , -1.0 , 1.0 }}});
239+ registryMCreco.add (" minus/MCrecoCascade" , " MC reco Cascades;#it{p}_{T} (GeV/c); #eta" , {HistType::kTH2F , {{500 , 0 , 5 }, {400 , -1.0 , 1.0 }}});
240+
241+ registryMCreco.add (" plus/MCrecoAllPt" , " MC reco all;#it{p}_{T} (GeV/c); #eta" , {HistType::kTH1F , {{500 , 0 , 5 }}});
242+ registryMCreco.add (" minus/MCrecoAllPt" , " MC reco all;#it{p}_{T} (GeV/c); #eta" , {HistType::kTH1F , {{500 , 0 , 5 }}});
243+
244+ registryMCreco.add (" plus/MCrecoPr" , " MC reco protons;#it{p}_{T} (GeV/c); #eta" , {HistType::kTH2F , {{500 , 0 , 5 }, {400 , -1.0 , 1.0 }}});
245+ registryMCreco.add (" minus/MCrecoPr" , " MC reco protons;#it{p}_{T} (GeV/c); #eta" , {HistType::kTH2F , {{500 , 0 , 5 }, {400 , -1.0 , 1.0 }}});
246+
247+ registryMCreco.add (" plus/MCrecoPrPt" , " MC reco protons;#it{p}_{T} (GeV/c)" , {HistType::kTH1F , {{500 , 0 , 5 }}});
248+ registryMCreco.add (" minus/MCrecoPrPt" , " MC reco protons;#it{p}_{T} (GeV/c)" , {HistType::kTH1F , {{500 , 0 , 5 }}});
249+
217250 trackHistoPartOnePos.init (&qaRegistry, confTrkTempFitVarpTBins, confTrkTempFitVarBins, confIsMC, confTrkPDGCodePartOne);
218251 trackHistoPartOneNeg.init (&qaRegistry, confTrkTempFitVarpTBins, confTrkTempFitVarBins, confIsMC, confTrkPDGCodePartOne);
219252 posChildHistos.init (&qaRegistry, confChildTempFitVarpTBins, confChildTempFitVarBins, false , 0 , true );
@@ -597,6 +630,95 @@ struct femtoUniversePairTaskTrackCascadeExtended { // o2-linter: disable=name/st
597630 }
598631 }
599632 PROCESS_SWITCH (femtoUniversePairTaskTrackCascadeExtended, processMixedEventMCgen, " Enable processing mixed event MC truth for track - cascade" , false );
633+
634+ // / This function fills MC truth particles from derived MC table
635+ void processMCgen (aod::FDCascParticles const & parts)
636+ {
637+ for (const auto & part : parts) {
638+ if (part.partType () != uint8_t (aod::femtouniverseparticle::ParticleType::kMCTruthTrack ))
639+ continue ;
640+
641+ int pdgCode = static_cast <int >(part.pidCut ());
642+ const auto & pdgParticle = pdgMC->GetParticle (pdgCode);
643+ if (!pdgParticle) {
644+ continue ;
645+ }
646+
647+ if ((confCascType1 == 0 && pdgCode == 3334 ) || (confCascType1 == 1 && pdgCode == 3312 )) {
648+ registryMCgen.fill (HIST (" plus/MCgenCasc" ), part.pt (), part.eta ());
649+ continue ;
650+ } else if ((confCascType1 == 0 && pdgCode == -3334 ) || (confCascType1 == 1 && pdgCode == -3312 )) {
651+ registryMCgen.fill (HIST (" minus/MCgenCasc" ), part.pt (), part.eta ());
652+ continue ;
653+ }
654+
655+ if (pdgParticle->Charge () > 0.0 ) {
656+ registryMCgen.fill (HIST (" plus/MCgenAllPt" ), part.pt ());
657+ }
658+ if (pdgCode == 2212 ) {
659+ registryMCgen.fill (HIST (" plus/MCgenPr" ), part.pt (), part.eta ());
660+ registryMCgen.fill (HIST (" plus/MCgenPrPt" ), part.pt ());
661+ }
662+
663+ if (pdgParticle->Charge () < 0.0 ) {
664+ registryMCgen.fill (HIST (" minus/MCgenAllPt" ), part.pt ());
665+ }
666+ if (pdgCode == -2212 ) {
667+ registryMCgen.fill (HIST (" minus/MCgenPr" ), part.pt (), part.eta ());
668+ registryMCgen.fill (HIST (" minus/MCgenPrPt" ), part.pt ());
669+ }
670+ }
671+ }
672+
673+ PROCESS_SWITCH (femtoUniversePairTaskTrackCascadeExtended, processMCgen, " Process MC truth data for cascades" , false );
674+
675+ void processMCReco (FemtoRecoParticles const & parts, aod::FdMCParticles const & mcparts)
676+ {
677+ for (const auto & part : parts) {
678+ auto mcPartId = part.fdMCParticleId ();
679+ if (mcPartId == -1 )
680+ continue ; // no MC particle
681+ const auto & mcpart = mcparts.iteratorAt (mcPartId);
682+ //
683+ if (part.partType () == aod::femtouniverseparticle::ParticleType::kCascade ) {
684+ if ((confCascType1 == 0 && mcpart.pdgMCTruth () == 3334 ) || (confCascType1 == 1 && mcpart.pdgMCTruth () == 3312 )) {
685+ const auto & posChild = parts.iteratorAt (part.index () - 3 );
686+ const auto & negChild = parts.iteratorAt (part.index () - 2 );
687+ const auto & bachelor = parts.iteratorAt (part.index () - 1 );
688+ // / Daughters that do not pass this condition are not selected
689+ if (isParticleTPC (posChild, CascChildTable[confCascType1][0 ]) && isParticleTPC (negChild, CascChildTable[confCascType1][1 ]) && isParticleTPC (bachelor, CascChildTable[confCascType1][2 ])) {
690+ registryMCreco.fill (HIST (" plus/MCrecoCascade" ), mcpart.pt (), mcpart.eta ());
691+ }
692+ } else if ((confCascType1 == 0 && mcpart.pdgMCTruth () == -3334 ) || (confCascType1 == 1 && mcpart.pdgMCTruth () == -3312 )) {
693+ // / Daughters that do not pass this condition are not selected
694+ const auto & posChild = parts.iteratorAt (part.index () - 3 );
695+ const auto & negChild = parts.iteratorAt (part.index () - 2 );
696+ const auto & bachelor = parts.iteratorAt (part.index () - 1 );
697+ if (isParticleTPC (posChild, CascChildTable[confCascType1 + 2 ][0 ]) && isParticleTPC (negChild, CascChildTable[confCascType1 + 2 ][1 ]) && isParticleTPC (bachelor, CascChildTable[confCascType1 + 2 ][2 ])) {
698+ registryMCreco.fill (HIST (" minus/MCrecoCascade" ), mcpart.pt (), mcpart.eta ());
699+ }
700+ }
701+ } else if (part.partType () == aod::femtouniverseparticle::ParticleType::kTrack ) {
702+ if (part.sign () > 0 ) {
703+ registryMCreco.fill (HIST (" plus/MCrecoAllPt" ), mcpart.pt ());
704+ if (mcpart.pdgMCTruth () == 2212 && isNSigmaCombined (part.p (), unPackInTable<aod::pidtpc_tiny::binning>(part.tpcNSigmaStorePr ()), unPackInTable<aod::pidtof_tiny::binning>(part.tofNSigmaStorePr ()))) {
705+ registryMCreco.fill (HIST (" plus/MCrecoPr" ), mcpart.pt (), mcpart.eta ());
706+ registryMCreco.fill (HIST (" plus/MCrecoPrPt" ), mcpart.pt ());
707+ }
708+ }
709+
710+ if (part.sign () < 0 ) {
711+ registryMCreco.fill (HIST (" minus/MCrecoAllPt" ), mcpart.pt ());
712+ if (mcpart.pdgMCTruth () == -2212 && isNSigmaCombined (part.p (), unPackInTable<aod::pidtpc_tiny::binning>(part.tpcNSigmaStorePr ()), unPackInTable<aod::pidtof_tiny::binning>(part.tofNSigmaStorePr ()))) {
713+ registryMCreco.fill (HIST (" minus/MCrecoPr" ), mcpart.pt (), mcpart.eta ());
714+ registryMCreco.fill (HIST (" minus/MCrecoPrPt" ), mcpart.pt ());
715+ }
716+ }
717+ }
718+ }
719+ }
720+
721+ PROCESS_SWITCH (femtoUniversePairTaskTrackCascadeExtended, processMCReco, " Process MC reco data for cascades" , false );
600722};
601723
602724WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments