@@ -85,6 +85,7 @@ struct CorrelationTask {
8585
8686 O2_DEFINE_CONFIGURABLE (cfgDecayParticleMask, int , 0 , " Selection bitmask for the decay particles: 0 = no selection" )
8787 O2_DEFINE_CONFIGURABLE (cfgMassAxis, int , 0 , " Use invariant mass axis (0 = OFF, 1 = ON)" )
88+ O2_DEFINE_CONFIGURABLE (cfgMcTriggerPDGs, std::vector<int >, {}, " MC PDG codes to use exclusively as trigger particles and exclude from associated particles. Empty = no selection." )
8889
8990 ConfigurableAxis axisVertex{" axisVertex" , {7 , -7 , 7 }, " vertex axis for histograms" };
9091 ConfigurableAxis axisDeltaPhi{" axisDeltaPhi" , {72 , -PIHalf, PIHalf * 3 }, " delta phi axis for histograms" };
@@ -149,7 +150,7 @@ struct CorrelationTask {
149150 registry.add (" etaphiTrigger" , " multiplicity/centrality vs eta vs phi (triggers)" , {HistType::kTH3F , {{100 , 0 , 100 , " multiplicity/centrality" }, {100 , -2 , 2 , " #eta" }, {200 , 0 , 2 * M_PI, " #varphi" }}});
150151 registry.add (" invMass" , " 2-prong invariant mass (GeV/c^2)" , {HistType::kTH3F , {axisInvMassHistogram, axisPtTrigger, axisMultiplicity}});
151152 }
152- registry.add (" multiplicity" , " multiplicity vs track count " , {HistType::kTH1F , {{1000 , 0 , 100 , " /multiplicity/centrality" }}});
153+ registry.add (" multiplicity" , " event multiplicity " , {HistType::kTH1F , {{1000 , 0 , 100 , " /multiplicity/centrality" }}});
153154
154155 const int maxMixBin = AxisSpec (axisMultiplicity).getNbins () * AxisSpec (axisVertex).getNbins ();
155156 registry.add (" eventcount_same" , " bin" , {HistType::kTH1F , {{maxMixBin + 2 , -2.5 , -0.5 + maxMixBin, " bin" }}});
@@ -231,6 +232,8 @@ struct CorrelationTask {
231232
232233 template <class T >
233234 using hasInvMass = decltype (std::declval<T&>().invMass());
235+ template <class T >
236+ using hasPDGCode = decltype (std::declval<T&>().pdgCode());
234237
235238 template <typename TCollision, typename TTracks1, typename TTracks2>
236239 void fillQA (const TCollision& collision, float multiplicity, const TTracks1& tracks1, const TTracks2& tracks2)
@@ -243,6 +246,10 @@ struct CorrelationTask {
243246 }
244247 registry.fill (HIST (" invMass" ), track1.invMass (), track1.pt (), multiplicity);
245248 }
249+ if constexpr (std::experimental::is_detected<hasPDGCode, typename TTracks1::iterator>::value) {
250+ if (!cfgMcTriggerPDGs->empty () && std::find (cfgMcTriggerPDGs->begin (), cfgMcTriggerPDGs->end (), track1->pdgCode ()) == cfgMcTriggerPDGs->end ())
251+ continue ;
252+ }
246253 registry.fill (HIST (" yieldsTrigger" ), multiplicity, track1.pt (), track1.eta ());
247254 registry.fill (HIST (" etaphiTrigger" ), multiplicity, track1.eta (), track1.phi ());
248255 }
@@ -314,6 +321,11 @@ struct CorrelationTask {
314321 continue ;
315322 }
316323
324+ if constexpr (std::experimental::is_detected<hasPDGCode, typename TTracks1::iterator>::value) {
325+ if (!cfgMcTriggerPDGs->empty () && std::find (cfgMcTriggerPDGs->begin (), cfgMcTriggerPDGs->end (), track1.pdgCode ()) == cfgMcTriggerPDGs->end ())
326+ continue ;
327+ }
328+
317329 if constexpr (std::experimental::is_detected<hasSign, typename TTracks1::iterator>::value) {
318330 if (cfgTriggerCharge != 0 && cfgTriggerCharge * track1.sign () < 0 ) {
319331 continue ;
@@ -343,6 +355,11 @@ struct CorrelationTask {
343355 continue ;
344356 }
345357 }
358+ if constexpr (std::experimental::is_detected<hasPDGCode, typename TTracks2::iterator>::value) {
359+ if (!cfgMcTriggerPDGs->empty () && std::find (cfgMcTriggerPDGs->begin (), cfgMcTriggerPDGs->end (), track2.pdgCode ()) != cfgMcTriggerPDGs->end ())
360+ continue ;
361+ }
362+
346363 if constexpr (std::experimental::is_detected<hasProng0Id, typename TTracks1::iterator>::value) {
347364 if (track2.globalIndex () == track1.cfTrackProng0Id ()) // do not correlate daughter tracks of the same event
348365 continue ;
@@ -724,8 +741,11 @@ struct CorrelationTask {
724741 case 2212 : // proton
725742 case -2212 :
726743 return 2 ;
727- default :
744+ case 421 : // D0
745+ case -421 :
728746 return 3 ;
747+ default :
748+ return 4 ;
729749 }
730750 }
731751
0 commit comments