@@ -26,11 +26,13 @@ struct ThreePartCorr {
2626 // Histogram registry
2727 HistogramRegistry MECorrRegistry{" MECorrRegistry" , {}, OutputObjHandlingPolicy::AnalysisObject, false , true };
2828 HistogramRegistry SECorrRegistry{" SECorrRegistry" , {}, OutputObjHandlingPolicy::AnalysisObject, false , true };
29+ HistogramRegistry MCRegistry{" MCRegistry" , {}, OutputObjHandlingPolicy::AnalysisObject, false , true };
2930 HistogramRegistry QARegistry{" QARegistry" , {}, OutputObjHandlingPolicy::AnalysisObject, false , true };
3031
3132 // Collision filters
3233 Filter CollCent = aod::cent::centFT0C > 0 .0f && aod::cent::centFT0C < 90 .0f ;
3334 Filter CollZvtx = nabs(aod::collision::posZ) < 7 .0f ;
35+ Filter MCCollZvtx = nabs(aod::mccollision::posZ) < 7 .0f ;
3436
3537 // V0 filters
3638 Filter V0Pt = aod::v0data::pt > 0 .6f && aod::v0data::pt < 12 .0f ;
@@ -40,14 +42,24 @@ struct ThreePartCorr {
4042 Filter TrackPt = aod::track::pt > 0 .2f && aod::track::pt < 3 .0f ;
4143 Filter TrackEta = nabs(aod::track::eta) < 0 .8f ;
4244
43- // Table aliases
45+ // Particle filters
46+ Filter ParticlePt = aod::mcparticle::pt > 0 .2f && aod::mcparticle::pt < 3 .0f ;
47+ Filter ParticleEta = nabs(aod::mcparticle::eta) < 0 .8f ;
48+
49+ // Table aliases - Data
4450 using MyFilteredCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::CentFT0Cs>>;
4551 using MyFilteredCollision = MyFilteredCollisions::iterator;
4652 using MyFilteredV0s = soa::Filtered<aod::V0Datas>;
4753 using MyFilteredTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra,
4854 aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCPr,
4955 aod::pidTOFPi, aod::pidTOFKa, aod::pidTOFPr, aod::pidTOFbeta>>;
5056
57+ // Table aliases - MC
58+ using MyFilteredMCGenCollision = soa::Filtered<aod::McCollisions>::iterator;
59+ using MyFilteredMCParticles = soa::Filtered<aod::McParticles>;
60+ using MyFilteredMCRecCollision = soa::Filtered<soa::Join<aod::Collisions, aod::McCollisionLabels>>::iterator;
61+ using MyFilteredMCTracks = soa::Filtered<soa::Join<aod::Tracks, aod::McTrackLabels>>;
62+
5163 // Mixed-events binning policy
5264 SliceCache cache;
5365 ConfigurableAxis ConfCentBins{" ConfCentBins" , {VARIABLE_WIDTH, 0 .0f , 10 .0f , 20 .0f , 30 .0f , 40 .0f , 50 .0f , 60 .0f , 70 .0f , 80 .0f , 90 .0f }, " ME Centrality binning" };
@@ -57,6 +69,9 @@ struct ThreePartCorr {
5769 BinningType CollBinning{{ConfCentBins, ConfZvtxBins}, true };
5870 Pair<MyFilteredCollisions, MyFilteredV0s, MyFilteredTracks, BinningType> pair{CollBinning, 5 , -1 , &cache};
5971
72+ // Process configurables
73+ Configurable<bool > FilterSwitch{" FilterSwitch" , false , " Switch for the FakeV0Filter function" };
74+
6075 // Particle masses
6176 Double_t massLambda = 1.115683 ;
6277 Double_t DGaussSigma = 0.0021 ;
@@ -77,7 +92,8 @@ struct ThreePartCorr {
7792 const AxisSpec ZvtxAxis{ConfZvtxBins};
7893 const AxisSpec PhiAxis{36 , (-1 . / 2 ) * M_PI, (3 . / 2 ) * M_PI};
7994 const AxisSpec EtaAxis{32 , -1.52 , 1.52 };
80- const AxisSpec PtAxis{120 , 0 , 12 };
95+ const AxisSpec V0PtAxis{114 , 0.6 , 12 };
96+ const AxisSpec TrackPtAxis{28 , 0.2 , 3 };
8197 const AxisSpec LambdaInvMassAxis{100 , 1.08 , 1.16 };
8298
8399 QARegistry.add (" hTrackPt" , " hTrackPt" , {HistType::kTH1D , {{100 , 0 , 4 }}});
@@ -98,8 +114,21 @@ struct ThreePartCorr {
98114 QARegistry.add (" hNSigmaKaon" , " hNSigmaKaon" , {HistType::kTH2D , {{201 , -5.025 , 5.025 }, {201 , -5.025 , 5.025 }}});
99115 QARegistry.add (" hNSigmaProton" , " hNSigmaProton" , {HistType::kTH2D , {{201 , -5.025 , 5.025 }, {201 , -5.025 , 5.025 }}});
100116
101- QARegistry.add (" hInvMassLambda" , " hInvMassLambda" , {HistType::kTH3D , {{LambdaInvMassAxis}, {PtAxis}, {CentralityAxis}}});
102- QARegistry.add (" hInvMassAntiLambda" , " hInvMassAntiLambda" , {HistType::kTH3D , {{LambdaInvMassAxis}, {PtAxis}, {CentralityAxis}}});
117+ QARegistry.add (" hInvMassLambda" , " hInvMassLambda" , {HistType::kTH3D , {{LambdaInvMassAxis}, {V0PtAxis}, {CentralityAxis}}});
118+ QARegistry.add (" hInvMassAntiLambda" , " hInvMassAntiLambda" , {HistType::kTH3D , {{LambdaInvMassAxis}, {V0PtAxis}, {CentralityAxis}}});
119+
120+ MCRegistry.add (" hGenPionP" , " hGenMomPionP" , {HistType::kTH1D , {TrackPtAxis}});
121+ MCRegistry.add (" hGenPionN" , " hGenMomPionN" , {HistType::kTH1D , {TrackPtAxis}});
122+ MCRegistry.add (" hGenKaonP" , " hGenMomKaonP" , {HistType::kTH1D , {TrackPtAxis}});
123+ MCRegistry.add (" hGenKaonN" , " hGenMomKaonN" , {HistType::kTH1D , {TrackPtAxis}});
124+ MCRegistry.add (" hGenProtonP" , " hGenMomProtonP" , {HistType::kTH1D , {TrackPtAxis}});
125+ MCRegistry.add (" hGenProtonN" , " hGenMomProtonN" , {HistType::kTH1D , {TrackPtAxis}});
126+ MCRegistry.add (" hRecPionP" , " hRecMomPionP" , {HistType::kTH1D , {TrackPtAxis}});
127+ MCRegistry.add (" hRecPionN" , " hRecMomPionN" , {HistType::kTH1D , {TrackPtAxis}});
128+ MCRegistry.add (" hRecKaonP" , " hRecMomKaonP" , {HistType::kTH1D , {TrackPtAxis}});
129+ MCRegistry.add (" hRecKaonN" , " hRecMomKaonN" , {HistType::kTH1D , {TrackPtAxis}});
130+ MCRegistry.add (" hRecProtonP" , " hRecMomProtonP" , {HistType::kTH1D , {TrackPtAxis}});
131+ MCRegistry.add (" hRecProtonN" , " hRecMomProtonN" , {HistType::kTH1D , {TrackPtAxis}});
103132
104133 SECorrRegistry.add (" hSameLambdaPion_SGNL" , " Same-event #Lambda - #pi correlator (SGNL region)" , {HistType::kTHnSparseD , {{PhiAxis}, {EtaAxis}, {CentralityAxis}, {ZvtxAxis}, {2 , -2 , 2 }, {2 , -2 , 2 }}});
105134 SECorrRegistry.add (" hSameLambdaPion_SB" , " Same-event #Lambda - #pi correlator (SB region)" , {HistType::kTHnSparseD , {{PhiAxis}, {EtaAxis}, {CentralityAxis}, {ZvtxAxis}, {2 , -2 , 2 }, {2 , -2 , 2 }}});
@@ -172,19 +201,19 @@ struct ThreePartCorr {
172201 DeltaEta = trigger.eta () - associate.eta ();
173202
174203 if (CandMass >= massLambda - 4 * DGaussSigma && CandMass <= massLambda + 4 * DGaussSigma) {
175- if (A_PID[0 ] == 0 ) { // Pions
204+ if (A_PID[0 ] == 0.0 ) { // Pions
176205 SECorrRegistry.fill (HIST (" hSameLambdaPion_SGNL" ), DeltaPhi, DeltaEta, collision.centFT0C (), collision.posZ (), T_Sign, associate.sign ());
177- } else if (A_PID[0 ] == 1 ) { // Kaons
206+ } else if (A_PID[0 ] == 1.0 ) { // Kaons
178207 SECorrRegistry.fill (HIST (" hSameLambdaKaon_SGNL" ), DeltaPhi, DeltaEta, collision.centFT0C (), collision.posZ (), T_Sign, associate.sign ());
179- } else if (A_PID[0 ] == 2 ) { // Protons
208+ } else if (A_PID[0 ] == 2.0 ) { // Protons
180209 SECorrRegistry.fill (HIST (" hSameLambdaProton_SGNL" ), DeltaPhi, DeltaEta, collision.centFT0C (), collision.posZ (), T_Sign, associate.sign ());
181210 }
182211 } else if (CandMass >= massLambda - 8 * DGaussSigma && CandMass <= massLambda + 8 * DGaussSigma) {
183- if (A_PID[0 ] == 0 ) { // Pions
212+ if (A_PID[0 ] == 0.0 ) { // Pions
184213 SECorrRegistry.fill (HIST (" hSameLambdaPion_SB" ), DeltaPhi, DeltaEta, collision.centFT0C (), collision.posZ (), T_Sign, associate.sign ());
185- } else if (A_PID[0 ] == 1 ) { // Kaons
214+ } else if (A_PID[0 ] == 1.0 ) { // Kaons
186215 SECorrRegistry.fill (HIST (" hSameLambdaKaon_SB" ), DeltaPhi, DeltaEta, collision.centFT0C (), collision.posZ (), T_Sign, associate.sign ());
187- } else if (A_PID[0 ] == 2 ) { // Protons
216+ } else if (A_PID[0 ] == 2.0 ) { // Protons
188217 SECorrRegistry.fill (HIST (" hSameLambdaProton_SB" ), DeltaPhi, DeltaEta, collision.centFT0C (), collision.posZ (), T_Sign, associate.sign ());
189218 }
190219 }
@@ -195,13 +224,10 @@ struct ThreePartCorr {
195224 }
196225 // End of the V0-Track Correlations
197226 }
198- PROCESS_SWITCH (ThreePartCorr, processSame, " Process same-event correlations" , true );
199227
200- void processMixed (MyFilteredCollisions const & collisions , MyFilteredV0s const & v0s , MyFilteredTracks const & tracks )
228+ void processMixed (MyFilteredCollisions const &, MyFilteredV0s const &, MyFilteredTracks const &)
201229 {
202230
203- LOGF (info, " Input data Collisions %d, V0s %d, Tracks %d " , collisions.size (), v0s.size (), tracks.size ());
204-
205231 // Start of the Mixed-events Correlations
206232 for (const auto & [coll_1, v0_1, coll_2, track_2] : pair) {
207233 for (const auto & [trigger, associate] : soa::combinations (soa::CombinationsFullIndexPolicy (v0_1, track_2))) {
@@ -220,19 +246,19 @@ struct ThreePartCorr {
220246 DeltaEta = trigger.eta () - associate.eta ();
221247
222248 if (CandMass >= massLambda - 4 * DGaussSigma && CandMass <= massLambda + 4 * DGaussSigma) {
223- if (A_PID[0 ] == 0 ) { // Pions
249+ if (A_PID[0 ] == 0.0 ) { // Pions
224250 MECorrRegistry.fill (HIST (" hMixLambdaPion_SGNL" ), DeltaPhi, DeltaEta, coll_1.centFT0C (), coll_1.posZ (), T_Sign, associate.sign ());
225- } else if (A_PID[0 ] == 1 ) { // Kaons
251+ } else if (A_PID[0 ] == 1.0 ) { // Kaons
226252 MECorrRegistry.fill (HIST (" hMixLambdaKaon_SGNL" ), DeltaPhi, DeltaEta, coll_1.centFT0C (), coll_1.posZ (), T_Sign, associate.sign ());
227- } else if (A_PID[0 ] == 2 ) { // Protons
253+ } else if (A_PID[0 ] == 2.0 ) { // Protons
228254 MECorrRegistry.fill (HIST (" hMixLambdaProton_SGNL" ), DeltaPhi, DeltaEta, coll_1.centFT0C (), coll_1.posZ (), T_Sign, associate.sign ());
229255 }
230256 } else if (CandMass >= massLambda - 8 * DGaussSigma && CandMass <= massLambda + 8 * DGaussSigma) {
231- if (A_PID[0 ] == 0 ) { // Pions
257+ if (A_PID[0 ] == 0.0 ) { // Pions
232258 MECorrRegistry.fill (HIST (" hMixLambdaPion_SB" ), DeltaPhi, DeltaEta, coll_1.centFT0C (), coll_1.posZ (), T_Sign, associate.sign ());
233- } else if (A_PID[0 ] == 1 ) { // Kaons
259+ } else if (A_PID[0 ] == 1.0 ) { // Kaons
234260 MECorrRegistry.fill (HIST (" hMixLambdaKaon_SB" ), DeltaPhi, DeltaEta, coll_1.centFT0C (), coll_1.posZ (), T_Sign, associate.sign ());
235- } else if (A_PID[0 ] == 2 ) { // Protons
261+ } else if (A_PID[0 ] == 2.0 ) { // Protons
236262 MECorrRegistry.fill (HIST (" hMixLambdaProton_SB" ), DeltaPhi, DeltaEta, coll_1.centFT0C (), coll_1.posZ (), T_Sign, associate.sign ());
237263 }
238264 }
@@ -242,7 +268,70 @@ struct ThreePartCorr {
242268 }
243269 // End of the Mixed-events Correlations
244270 }
271+
272+ void processMCGen (MyFilteredMCGenCollision const &, MyFilteredMCParticles const & particles)
273+ {
274+
275+ // Start of the Monte-Carlo generated QA
276+ for (const auto & particle : particles) {
277+ if (particle.isPhysicalPrimary ()) {
278+
279+ if (particle.pdgCode () == 211 ) { // Pos pions
280+ MCRegistry.fill (HIST (" hGenPionP" ), particle.pt ());
281+ } else if (particle.pdgCode () == -211 ) { // Neg pions
282+ MCRegistry.fill (HIST (" hGenPionN" ), particle.pt ());
283+ } else if (particle.pdgCode () == 310 ) { // Pos kaons
284+ MCRegistry.fill (HIST (" hGenKaonP" ), particle.pt ());
285+ } else if (particle.pdgCode () == -310 ) { // Neg kaons
286+ MCRegistry.fill (HIST (" hGenKaonN" ), particle.pt ());
287+ } else if (particle.pdgCode () == 2212 ) { // Pos protons
288+ MCRegistry.fill (HIST (" hGenProtonP" ), particle.pt ());
289+ } else if (particle.pdgCode () == -2212 ) { // Neg protons
290+ MCRegistry.fill (HIST (" hGenProtonN" ), particle.pt ());
291+ }
292+ }
293+ }
294+ // End of the Monte-Carlo generated QA
295+ }
296+
297+ void processMCRec (MyFilteredMCRecCollision const & collision, MyFilteredMCTracks const & tracks, aod::McCollisions const &, aod::McParticles const &)
298+ {
299+
300+ if (!collision.has_mcCollision ()) {
301+ return ;
302+ }
303+
304+ // Start of the Monte-Carlo reconstructed QA
305+ for (const auto & track : tracks) {
306+ if (!track.has_mcParticle ()) {
307+ continue ;
308+ }
309+
310+ auto particle = track.mcParticle ();
311+ if (particle.isPhysicalPrimary ()) {
312+
313+ if (particle.pdgCode () == 211 ) { // Pos pions
314+ MCRegistry.fill (HIST (" hRecPionP" ), particle.pt ());
315+ } else if (particle.pdgCode () == -211 ) { // Neg pions
316+ MCRegistry.fill (HIST (" hRecPionN" ), particle.pt ());
317+ } else if (particle.pdgCode () == 310 ) { // Pos kaons
318+ MCRegistry.fill (HIST (" hRecKaonP" ), particle.pt ());
319+ } else if (particle.pdgCode () == -310 ) { // Neg kaons
320+ MCRegistry.fill (HIST (" hRecKaonN" ), particle.pt ());
321+ } else if (particle.pdgCode () == 2212 ) { // Pos protons
322+ MCRegistry.fill (HIST (" hRecProtonP" ), particle.pt ());
323+ } else if (particle.pdgCode () == -2212 ) { // Neg protons
324+ MCRegistry.fill (HIST (" hRecProtonN" ), particle.pt ());
325+ }
326+ }
327+ }
328+ // End of the Monte-Carlo reconstructed QA
329+ }
330+
331+ PROCESS_SWITCH (ThreePartCorr, processSame, " Process same-event correlations" , true );
245332 PROCESS_SWITCH (ThreePartCorr, processMixed, " Process mixed-event correlations" , true );
333+ PROCESS_SWITCH (ThreePartCorr, processMCGen, " Process Monte-Carlo, generator level" , false );
334+ PROCESS_SWITCH (ThreePartCorr, processMCRec, " Process Monte-Carlo, reconstructed level" , false );
246335
247336 // ================================================================================================================================================================================================================
248337
@@ -345,29 +434,32 @@ struct ThreePartCorr {
345434 Bool_t FakeV0Filter (const V0Cand& V0, const TrackCand& Track)
346435 {
347436
348- TLorentzVector Daughter, Associate;
349- if (TrackPID (Track)[0 ] == 1.0 ) { // Kaons
350- return kTRUE ;
351- } else if (V0Sign (V0) == 1 && TrackPID (Track)[0 ] == 0 && Track.sign () == -1 ) { // Lambda - Pi_min
352- const auto & dTrack = V0.template posTrack_as <MyFilteredTracks>();
353- Daughter.SetPtEtaPhiM (dTrack.pt (), dTrack.eta (), dTrack.phi (), o2::constants::physics::MassProton);
354- Associate.SetPtEtaPhiM (Track.pt (), Track.eta (), Track.phi (), o2::constants::physics::MassPionCharged);
355- } else if (V0Sign (V0) == -1 && TrackPID (Track)[0 ] == 0 && Track.sign () == 1 ) { // Antilambda - Pi_plus
356- const auto & dTrack = V0.template negTrack_as <MyFilteredTracks>();
357- Daughter.SetPtEtaPhiM (dTrack.pt (), dTrack.eta (), dTrack.phi (), o2::constants::physics::MassProton);
358- Associate.SetPtEtaPhiM (Track.pt (), Track.eta (), Track.phi (), o2::constants::physics::MassPionCharged);
359- } else if (V0Sign (V0) == 1 && TrackPID (Track)[0 ] == 2 && Track.sign () == 1 ) { // Lambda - Proton
360- const auto & dTrack = V0.template negTrack_as <MyFilteredTracks>();
361- Daughter.SetPtEtaPhiM (dTrack.pt (), dTrack.eta (), dTrack.phi (), o2::constants::physics::MassPionCharged);
362- Associate.SetPtEtaPhiM (Track.pt (), Track.eta (), Track.phi (), o2::constants::physics::MassProton);
363- } else if (V0Sign (V0) == -1 && TrackPID (Track)[0 ] == 2 && Track.sign () == -1 ) { // Antilambda - Antiproton
364- const auto & dTrack = V0.template posTrack_as <MyFilteredTracks>();
365- Daughter.SetPtEtaPhiM (dTrack.pt (), dTrack.eta (), dTrack.phi (), o2::constants::physics::MassPionCharged);
366- Associate.SetPtEtaPhiM (Track.pt (), Track.eta (), Track.phi (), o2::constants::physics::MassProton);
367- }
437+ if (FilterSwitch) {
438+
439+ TLorentzVector Daughter, Associate;
440+ if (TrackPID (Track)[0 ] == 1.0 ) { // Kaons
441+ return kTRUE ;
442+ } else if (V0Sign (V0) == 1 && TrackPID (Track)[0 ] == 0.0 && Track.sign () == -1 ) { // Lambda - Pi_min
443+ const auto & dTrack = V0.template posTrack_as <MyFilteredTracks>();
444+ Daughter.SetPtEtaPhiM (dTrack.pt (), dTrack.eta (), dTrack.phi (), o2::constants::physics::MassProton);
445+ Associate.SetPtEtaPhiM (Track.pt (), Track.eta (), Track.phi (), o2::constants::physics::MassPionCharged);
446+ } else if (V0Sign (V0) == -1 && TrackPID (Track)[0 ] == 0.0 && Track.sign () == 1 ) { // Antilambda - Pi_plus
447+ const auto & dTrack = V0.template negTrack_as <MyFilteredTracks>();
448+ Daughter.SetPtEtaPhiM (dTrack.pt (), dTrack.eta (), dTrack.phi (), o2::constants::physics::MassProton);
449+ Associate.SetPtEtaPhiM (Track.pt (), Track.eta (), Track.phi (), o2::constants::physics::MassPionCharged);
450+ } else if (V0Sign (V0) == 1 && TrackPID (Track)[0 ] == 2.0 && Track.sign () == 1 ) { // Lambda - Proton
451+ const auto & dTrack = V0.template negTrack_as <MyFilteredTracks>();
452+ Daughter.SetPtEtaPhiM (dTrack.pt (), dTrack.eta (), dTrack.phi (), o2::constants::physics::MassPionCharged);
453+ Associate.SetPtEtaPhiM (Track.pt (), Track.eta (), Track.phi (), o2::constants::physics::MassProton);
454+ } else if (V0Sign (V0) == -1 && TrackPID (Track)[0 ] == 2.0 && Track.sign () == -1 ) { // Antilambda - Antiproton
455+ const auto & dTrack = V0.template posTrack_as <MyFilteredTracks>();
456+ Daughter.SetPtEtaPhiM (dTrack.pt (), dTrack.eta (), dTrack.phi (), o2::constants::physics::MassPionCharged);
457+ Associate.SetPtEtaPhiM (Track.pt (), Track.eta (), Track.phi (), o2::constants::physics::MassProton);
458+ }
368459
369- if ((Daughter + Associate).M () >= massLambda - 4 * DGaussSigma && (Daughter + Associate).M () <= massLambda + 4 * DGaussSigma) {
370- return kFALSE ;
460+ if ((Daughter + Associate).M () >= massLambda - 4 * DGaussSigma && (Daughter + Associate).M () <= massLambda + 4 * DGaussSigma) {
461+ return kFALSE ;
462+ }
371463 }
372464
373465 return kTRUE ;
0 commit comments