@@ -60,7 +60,7 @@ const double ptDAxisMin = 0.;
6060const double ptDAxisMax = 36 .;
6161
6262// definition of ME variables
63- using BinningType = ColumnBinningPolicy<aod::collision::PosZ, aod::mult::MultFV0M <aod::mult::MultFV0A , aod::mult::MultFV0C >>;
63+ using BinningType = ColumnBinningPolicy<aod::collision::PosZ, aod::mult::MultFT0M <aod::mult::MultFT0A , aod::mult::MultFT0C >>;
6464
6565// Code to select a Dmeson in a collision
6666struct HfCorrelatorDplusHadronsDplusSelection {
@@ -77,7 +77,7 @@ struct HfCorrelatorDplusHadronsDplusSelection {
7777 Partition<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi, aod::HfCand3ProngMcRec>> selectedDplusCandidatesMc = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlagDplus;
7878
7979 void processDplusSelectionData (aod::Collision const & collision,
80- soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi> const &)
80+ soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi> const & candidates )
8181 {
8282 bool isDplusFound = 0 ;
8383 if (selectedDplusCandidates.size () > 0 ) {
@@ -99,7 +99,7 @@ struct HfCorrelatorDplusHadronsDplusSelection {
9999 PROCESS_SWITCH (HfCorrelatorDplusHadronsDplusSelection, processDplusSelectionData, " Process Dplus Selection Data" , false );
100100
101101 void processDplusSelectionMcRec (aod::Collision const & collision,
102- soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi, aod::HfCand3ProngMcRec> const &)
102+ soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi, aod::HfCand3ProngMcRec> const & candidates )
103103 {
104104 bool isDplusFound = 0 ;
105105 if (selectedDplusCandidatesMc.size () > 0 ) {
@@ -123,15 +123,15 @@ struct HfCorrelatorDplusHadronsDplusSelection {
123123 }
124124 PROCESS_SWITCH (HfCorrelatorDplusHadronsDplusSelection, processDplusSelectionMcRec, " Process Dplus Selection MCRec" , false );
125125
126- void processDplusSelectionMcGen (aod::McCollision const &,
126+ void processDplusSelectionMcGen (aod::McCollision const & mcCollision ,
127127 aod::McParticles const & mcParticles)
128128 {
129129 bool isDplusFound = 0 ;
130130 for (const auto & particle1 : mcParticles) {
131131 if (std::abs (particle1.pdgCode ()) != Pdg::kDPlus ) {
132132 continue ;
133133 }
134- double yD = RecoDecay::y (particle1.pVector () , MassDPlus);
134+ double yD = RecoDecay::y (std::array{ particle1.px (), particle1. py (), particle1. pz ()} , MassDPlus);
135135 if (yCandMax >= 0 . && std::abs (yD) > yCandMax) {
136136 continue ;
137137 }
@@ -161,7 +161,7 @@ struct HfCorrelatorDplusHadrons {
161161 Configurable<float > dcaZTrackMax{" dcaZTrackMax" , 1 ., " max. DCA_z of tracks" };
162162 Configurable<float > ptCandMin{" ptCandMin" , 1 ., " min. cand. pT" };
163163 Configurable<float > ptTrackMin{" ptTrackMin" , 0.3 , " min. track pT" };
164- Configurable<float > ptTrackMax{" ptTrackMax" , 50 ., " max. track pT" };
164+ Configurable<float > ptTrackMax{" ptTrackMax" , 100 ., " max. track pT" };
165165 Configurable<float > multMin{" multMin" , 0 ., " minimum multiplicity accepted" };
166166 Configurable<float > multMax{" multMax" , 10000 ., " maximum multiplicity accepted" };
167167 Configurable<std::vector<double >> binsPt{" binsPt" , std::vector<double >{o2::analysis::hf_cuts_dplus_to_pi_k_pi::vecBinsPt}, " pT bin limits for candidate mass plots and efficiency" };
@@ -175,11 +175,11 @@ struct HfCorrelatorDplusHadrons {
175175 BinningType corrBinning{{binsZVtx, binsMultiplicity}, true };
176176
177177 // Event Mixing for the Data Mode
178- using MySelCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::Mults, aod::DmesonSelection>>;
179- using MyTracks = soa::Filtered<aod::TracksWDca>;
180- using MyCandidatesData = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi>>;
178+ using SelCollisionsWithDplus = soa::Filtered<soa::Join<aod::Collisions, aod::Mults, aod::DmesonSelection>>;
179+ using TracksWithDca = soa::Filtered<soa::Join< aod::TracksWDca, aod::TrackSelection>>; // track Selection applied
180+ using CandidatesDplusData = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi>>;
181181 // Event Mixing for the MCRec Mode
182- using MyCandidatesMcRec = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi, aod::HfCand3ProngMcRec>>;
182+ using CandidatesDplusMcRec = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi, aod::HfCand3ProngMcRec>>;
183183 // Event Mixing for the MCGen Mode
184184 using McCollisionsSel = soa::Filtered<soa::Join<aod::McCollisions, aod::DmesonSelection>>;
185185 using McParticlesSel = soa::Filtered<aod::McParticles>;
@@ -221,7 +221,7 @@ struct HfCorrelatorDplusHadrons {
221221 {" hcountDplusHadronPerEvent" , " Dplus,Hadron particles - MC gen;Number per event;entries" , {HistType::kTH1F , {{20 , 0 ., 20 .}}}},
222222 {" hMultiplicityPreSelection" , " multiplicity prior to selection;multiplicity;entries" , {HistType::kTH1F , {{10000 , 0 ., 10000 .}}}},
223223 {" hMultiplicity" , " multiplicity;multiplicity;entries" , {HistType::kTH1F , {{10000 , 0 ., 10000 .}}}},
224- {" hMultV0M " , " multiplicity;multiplicity;entries" , {HistType::kTH1F , {{10000 , 0 ., 10000 .}}}},
224+ {" hMultFT0M " , " multiplicity;multiplicity;entries" , {HistType::kTH1F , {{10000 , 0 ., 10000 .}}}},
225225 {" hZvtx" , " z vertex;z vertex;entries" , {HistType::kTH1F , {{200 , -20 ., 20 .}}}},
226226 {" hDplusBin" , " Dplus selected in pool Bin;pool Bin;entries" , {HistType::kTH1F , {{9 , 0 ., 9 .}}}},
227227 {" hTracksBin" , " Tracks selected in pool Bin;pool Bin;entries" , {HistType::kTH1F , {{9 , 0 ., 9 .}}}}}};
@@ -239,15 +239,15 @@ struct HfCorrelatorDplusHadrons {
239239 }
240240
241241 // / Dplus-hadron correlation pair builder - for real data and data-like analysis (i.e. reco-level w/o matching request via MC truth)
242- void processData (soa::Join<aod::Collisions, aod::Mults> ::iterator const & collision,
243- aod::TracksWDca const & tracks,
244- soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi> const &, aod::BCsWithTimestamps const &)
242+ void processData (SelCollisionsWithDplus ::iterator const & collision,
243+ TracksWithDca const & tracks,
244+ CandidatesDplusData const & candidates , aod::BCsWithTimestamps const &)
245245 {
246246 auto bc = collision.bc_as <aod::BCsWithTimestamps>();
247247 int gCollisionId = collision.globalIndex ();
248248 int64_t timeStamp = bc.timestamp ();
249249 if (selectedDplusCandidates.size () > 0 ) {
250- int poolBin = corrBinning.getBin (std::make_tuple (collision.posZ (), collision.multFV0M ()));
250+ int poolBin = corrBinning.getBin (std::make_tuple (collision.posZ (), collision.multFT0M ()));
251251 int nTracks = 0 ;
252252 if (collision.numContrib () > 1 ) {
253253 for (const auto & track : tracks) {
@@ -304,6 +304,9 @@ struct HfCorrelatorDplusHadrons {
304304 // Dplus-Hadron correlation dedicated section
305305 // if the candidate is a Dplus, search for Hadrons and evaluate correlations
306306 for (const auto & track : tracks) {
307+ if (!track.isGlobalTrackWoDCA ()) {
308+ continue ;
309+ }
307310 if (std::abs (track.eta ()) > etaTrackMax) {
308311 continue ;
309312 }
@@ -328,18 +331,18 @@ struct HfCorrelatorDplusHadrons {
328331 cntDplus++;
329332 } // end outer Dplus loop
330333 registry.fill (HIST (" hZvtx" ), collision.posZ ());
331- registry.fill (HIST (" hMultV0M " ), collision.multFV0M ());
334+ registry.fill (HIST (" hMultFT0M " ), collision.multFT0M ());
332335 }
333336 }
334337 PROCESS_SWITCH (HfCorrelatorDplusHadrons, processData, " Process data" , false );
335338
336339 // / Dplus-Hadron correlation pair builder - for MC reco-level analysis (candidates matched to true signal only, but also the various bkg sources are studied)
337- void processMcRec (soa::Join<aod::Collisions, aod::Mults> ::iterator const & collision,
338- aod::TracksWDca const & tracks,
339- soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi, aod::HfCand3ProngMcRec> const &)
340+ void processMcRec (SelCollisionsWithDplus ::iterator const & collision,
341+ TracksWithDca const & tracks,
342+ CandidatesDplusMcRec const & candidates )
340343 {
341344 if (selectedDplusCandidatesMc.size () > 0 ) {
342- int poolBin = corrBinning.getBin (std::make_tuple (collision.posZ (), collision.multFV0M ()));
345+ int poolBin = corrBinning.getBin (std::make_tuple (collision.posZ (), collision.multFT0M ()));
343346 int nTracks = 0 ;
344347 if (collision.numContrib () > 1 ) {
345348 for (const auto & track : tracks) {
@@ -404,6 +407,9 @@ struct HfCorrelatorDplusHadrons {
404407 // if the candidate is selected as Dplus, search for Hadron and evaluate correlations
405408 flagDplusSignal = candidate1.flagMcMatchRec () == 1 << aod::hf_cand_3prong::DecayType::DplusToPiKPi;
406409 for (const auto & track : tracks) {
410+ if (!track.isGlobalTrackWoDCA ()) {
411+ continue ;
412+ }
407413 if (std::abs (track.eta ()) > etaTrackMax) {
408414 continue ;
409415 }
@@ -426,7 +432,7 @@ struct HfCorrelatorDplusHadrons {
426432
427433 } // end outer Dplus loop
428434 registry.fill (HIST (" hZvtx" ), collision.posZ ());
429- registry.fill (HIST (" hMultV0M " ), collision.multFV0M ());
435+ registry.fill (HIST (" hMultFT0M " ), collision.multFT0M ());
430436 }
431437 }
432438 PROCESS_SWITCH (HfCorrelatorDplusHadrons, processMcRec, " Process MC Reco mode" , true );
@@ -438,7 +444,7 @@ struct HfCorrelatorDplusHadrons {
438444 int counterDplusHadron = 0 ;
439445 registry.fill (HIST (" hMCEvtCount" ), 0 );
440446
441- auto getTracksSize = [&mcParticles](aod::McCollision const & /* collision*/ ) {
447+ auto getTracksSize = [&mcParticles](aod::McCollision const & collision) {
442448 int nTracks = 0 ;
443449 for (const auto & track : mcParticles) {
444450 if (track.isPhysicalPrimary () && std::abs (track.eta ()) < 1.0 ) {
@@ -456,7 +462,7 @@ struct HfCorrelatorDplusHadrons {
456462 if (std::abs (particle1.pdgCode ()) != Pdg::kDPlus ) {
457463 continue ;
458464 }
459- double yD = RecoDecay::y (particle1.pVector () , MassDPlus);
465+ double yD = RecoDecay::y (std::array{ particle1.px (), particle1. py (), particle1. pz ()} , MassDPlus);
460466 if (yCandMax >= 0 . && std::abs (yD) > yCandMax) {
461467 continue ;
462468 }
@@ -511,44 +517,50 @@ struct HfCorrelatorDplusHadrons {
511517 }
512518 PROCESS_SWITCH (HfCorrelatorDplusHadrons, processMcGen, " Process MC Gen mode" , false );
513519
514- void processDataMixedEvent (MySelCollisions const & collisions,
515- MyCandidatesData const & candidates,
516- MyTracks const & tracks)
520+ void processDataMixedEvent (SelCollisionsWithDplus const & collisions,
521+ CandidatesDplusData const & candidates,
522+ TracksWithDca const & tracks)
517523 {
518524 auto tracksTuple = std::make_tuple (candidates, tracks);
519- Pair<MySelCollisions, MyCandidatesData, MyTracks , BinningType> pairData{corrBinning, 5 , -1 , collisions, tracksTuple, &cache};
525+ Pair<SelCollisionsWithDplus, CandidatesDplusData, TracksWithDca , BinningType> pairData{corrBinning, 5 , -1 , collisions, tracksTuple, &cache};
520526
521527 for (const auto & [c1, tracks1, c2, tracks2] : pairData) {
522- // LOGF(info, "Mixed event collisions: Index = (%d, %d), tracks Size: (%d, %d), Z Vertex: (%f, %f), Pool Bin: (%d, %d)", c1.globalIndex(), c2.globalIndex(), tracks1.size(), tracks2.size(), c1.posZ(), c2.posZ(), corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFV0M ())),corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFV0M ()))); // For debug
523- int poolBin = corrBinning.getBin (std::make_tuple (c2.posZ (), c2.multFV0M ()));
524- for (const auto & [t1, t2 ] : o2::soa::combinations (o2::soa::CombinationsFullIndexPolicy (tracks1, tracks2))) {
528+ // LOGF(info, "Mixed event collisions: Index = (%d, %d), tracks Size: (%d, %d), Z Vertex: (%f, %f), Pool Bin: (%d, %d)", c1.globalIndex(), c2.globalIndex(), tracks1.size(), tracks2.size(), c1.posZ(), c2.posZ(), corrBinning.getBin(std::make_tuple(c1.posZ(), c1.multFT0M ())),corrBinning.getBin(std::make_tuple(c2.posZ(), c2.multFT0M ()))); // For debug
529+ int poolBin = corrBinning.getBin (std::make_tuple (c2.posZ (), c2.multFT0M ()));
530+ for (const auto & [trigDplus, assocParticle ] : o2::soa::combinations (o2::soa::CombinationsFullIndexPolicy (tracks1, tracks2))) {
525531
526- if (yCandMax >= 0 . && std::abs (hfHelper.yDplus (t1 )) > yCandMax) {
532+ if (yCandMax >= 0 . && std::abs (hfHelper.yDplus (trigDplus )) > yCandMax) {
527533 continue ;
528534 }
529- entryDplusHadronPair (getDeltaPhi (t1.phi (), t2.phi ()), t1.eta () - t2.eta (), t1.pt (), t2.pt (), poolBin);
530- entryDplusHadronRecoInfo (hfHelper.invMassDplusToPiKPi (t1), 0 );
535+ if (!assocParticle.isGlobalTrackWoDCA ()) {
536+ continue ;
537+ }
538+ entryDplusHadronPair (getDeltaPhi (trigDplus.phi (), assocParticle.phi ()), trigDplus.eta () - assocParticle.eta (), trigDplus.pt (), assocParticle.pt (), poolBin);
539+ entryDplusHadronRecoInfo (hfHelper.invMassDplusToPiKPi (trigDplus), 0 );
531540 }
532541 }
533542 }
534543 PROCESS_SWITCH (HfCorrelatorDplusHadrons, processDataMixedEvent, " Process Mixed Event Data" , false );
535544
536- void processMcRecMixedEvent (MySelCollisions const & collisions,
537- MyCandidatesMcRec const & candidates,
538- MyTracks const & tracks)
545+ void processMcRecMixedEvent (SelCollisionsWithDplus const & collisions,
546+ CandidatesDplusMcRec const & candidates,
547+ TracksWithDca const & tracks)
539548 {
540549 auto tracksTuple = std::make_tuple (candidates, tracks);
541- Pair<MySelCollisions, MyCandidatesMcRec, MyTracks , BinningType> pairMcRec{corrBinning, 5 , -1 , collisions, tracksTuple, &cache};
550+ Pair<SelCollisionsWithDplus, CandidatesDplusMcRec, TracksWithDca , BinningType> pairMcRec{corrBinning, 5 , -1 , collisions, tracksTuple, &cache};
542551
543552 for (const auto & [c1, tracks1, c2, tracks2] : pairMcRec) {
544- int poolBin = corrBinning.getBin (std::make_tuple (c2.posZ (), c2.multFV0M ()));
545- for (const auto & [t1, t2 ] : o2::soa::combinations (o2::soa::CombinationsFullIndexPolicy (tracks1, tracks2))) {
553+ int poolBin = corrBinning.getBin (std::make_tuple (c2.posZ (), c2.multFT0M ()));
554+ for (const auto & [trigDplus, assocParticle ] : o2::soa::combinations (o2::soa::CombinationsFullIndexPolicy (tracks1, tracks2))) {
546555
547- if (yCandMax >= 0 . && std::abs (hfHelper.yDplus (t1)) > yCandMax) {
556+ if (yCandMax >= 0 . && std::abs (hfHelper.yDplus (trigDplus)) > yCandMax) {
557+ continue ;
558+ }
559+ if (!assocParticle.isGlobalTrackWoDCA ()) {
548560 continue ;
549561 }
550- entryDplusHadronPair (getDeltaPhi (t1 .phi (), t2 .phi ()), t1 .eta () - t2 .eta (), t1 .pt (), t2 .pt (), poolBin);
551- entryDplusHadronRecoInfo (hfHelper.invMassDplusToPiKPi (t1 ), 0 );
562+ entryDplusHadronPair (getDeltaPhi (trigDplus .phi (), assocParticle .phi ()), trigDplus .eta () - assocParticle .eta (), trigDplus .pt (), assocParticle .pt (), poolBin);
563+ entryDplusHadronRecoInfo (hfHelper.invMassDplusToPiKPi (trigDplus ), 0 );
552564 }
553565 }
554566 }
@@ -576,30 +588,30 @@ struct HfCorrelatorDplusHadrons {
576588 Pair<McCollisionsSel, McParticlesSel, McParticlesSel, BinningTypeMcGen> pairMcGen{corrBinningMcGen, 5 , -1 , collisions, tracksTuple, &cache};
577589
578590 for (const auto & [c1, tracks1, c2, tracks2] : pairMcGen) {
579- for (const auto & [t1, t2 ] : o2::soa::combinations (o2::soa::CombinationsFullIndexPolicy (tracks1, tracks2))) {
591+ for (const auto & [trigDplus, assocParticle ] : o2::soa::combinations (o2::soa::CombinationsFullIndexPolicy (tracks1, tracks2))) {
580592
581- // Check track t1 is Dplus
582- if (std::abs (t1 .pdgCode ()) != Pdg::kDPlus ) {
593+ // Check track trigDplus is Dplus
594+ if (std::abs (trigDplus .pdgCode ()) != Pdg::kDPlus ) {
583595 continue ;
584596 }
585597
586- double yD = RecoDecay::y (t1 .pVector (), MassDPlus);
598+ double yD = RecoDecay::y (trigDplus .pVector (), MassDPlus);
587599 if (yCandMax >= 0 . && std::abs (yD) > yCandMax) {
588600 continue ;
589601 }
590- if (ptCandMin >= 0 . && t1 .pt () < ptCandMin) {
602+ if (ptCandMin >= 0 . && trigDplus .pt () < ptCandMin) {
591603 continue ;
592604 }
593605
594- if (std::abs (t2 .eta ()) > etaTrackMax) {
606+ if (std::abs (assocParticle .eta ()) > etaTrackMax) {
595607 continue ;
596608 }
597- if (t2 .pt () < ptTrackMin) {
609+ if (assocParticle .pt () < ptTrackMin) {
598610 continue ;
599611 }
600612 int poolBin = corrBinningMcGen.getBin (std::make_tuple (c2.posZ (), getTracksSize (c2)));
601613 // LOGF(info, "Mixed event collisions: Index = (%d,%d), tracks Size: (%d,%d), Z Vertex: (%f), Pool Bin: (%d)", c1.globalIndex(), c2.globalIndex(), getTracksSize(c1), getTracksSize(c2), c2.posZ(), poolBin); // For debug
602- entryDplusHadronPair (getDeltaPhi (t2 .phi (), t1 .phi ()), t2 .eta () - t1 .eta (), t1 .pt (), t2 .pt (), poolBin);
614+ entryDplusHadronPair (getDeltaPhi (assocParticle .phi (), trigDplus .phi ()), assocParticle .eta () - trigDplus .eta (), trigDplus .pt (), assocParticle .pt (), poolBin);
603615 }
604616 }
605617 }
0 commit comments