@@ -75,6 +75,7 @@ struct CorrelationTask {
7575 O2_DEFINE_CONFIGURABLE (cfgTriggerCharge, int , 0 , " Select on charge of trigger particle: 0 = all; 1 = positive; -1 = negative" );
7676 O2_DEFINE_CONFIGURABLE (cfgAssociatedCharge, int , 0 , " Select on charge of associated particle: 0 = all; 1 = positive; -1 = negative" );
7777 O2_DEFINE_CONFIGURABLE (cfgPairCharge, int , 0 , " Select on charge of particle pair: 0 = all; 1 = like sign; -1 = unlike sign" );
78+ O2_DEFINE_CONFIGURABLE (cfgCorrelateTheSame, int , 0 , " Correlate the d0 with d0 or d0bar with d0bar, 0 = no, 1 = yes" );
7879
7980 O2_DEFINE_CONFIGURABLE (cfgTwoTrackCut, float , -1 , " Two track cut: -1 = off; >0 otherwise distance value (suggested: 0.02)" );
8081 O2_DEFINE_CONFIGURABLE (cfgTwoTrackCutMinRadius, float , 0 .8f , " Two track cut: radius in m from which two track cuts are applied" );
@@ -202,6 +203,8 @@ struct CorrelationTask {
202203 }
203204 if (doprocessSame2Prong2Prong)
204205 userAxis.emplace_back (axisInvMass, " m (GeV/c^2)" );
206+ if (doprocessMixed2Prong2Prong)
207+ userMixingAxis.emplace_back (axisInvMass, " m (GeV/c^2)" );
205208
206209 same.setObject (new CorrelationContainer (" sameEvent" , " sameEvent" , corrAxis, effAxis, userAxis));
207210 mixed.setObject (new CorrelationContainer (" mixedEvent" , " mixedEvent" , corrAxis, effAxis, userMixingAxis));
@@ -265,7 +268,7 @@ struct CorrelationTask {
265268 registry.fill (HIST (" invMass" ), track1.invMass (), track1.pt (), multiplicity);
266269 for (const auto & track2 : tracks2) {
267270 if constexpr (std::experimental::is_detected<HasInvMass, typename TTracks2::iterator>::value && std::experimental::is_detected<HasDecay, typename TTracks2::iterator>::value) {
268- if (doprocessSame2Prong2Prong) {
271+ if (doprocessSame2Prong2Prong || doprocessMixed2Prong2Prong ) {
269272 if (cfgDecayParticleMask != 0 && (cfgDecayParticleMask & (1u << static_cast <uint32_t >(track1.decay ()))) == 0u )
270273 continue ;
271274 if ((track1.decay () != 0 ) || (track2.decay () != 1 )) // D0 in trk1, D0bar in trk2
@@ -410,10 +413,12 @@ struct CorrelationTask {
410413 }
411414
412415 if constexpr (std::experimental::is_detected<HasDecay, typename TTracks1::iterator>::value && std::experimental::is_detected<HasDecay, typename TTracks2::iterator>::value) {
413- if (doprocessSame2Prong2Prong && (track1.decay () == track2.decay () || track1.decay () > 1 || track2.decay () > 1 )) {
414- continue ;
416+ if (cfgCorrelateTheSame == 0 && (doprocessSame2Prong2Prong || doprocessMixed2Prong2Prong) && (track1.decay () == track2.decay () || track1.decay () > 1 || track2.decay () > 1 )) {
417+ continue ; // D0 and anti-D0 selection
418+ } else if (cfgCorrelateTheSame == 1 && (doprocessSame2Prong2Prong || doprocessMixed2Prong2Prong) && (track1.decay () != track2.decay () || track1.decay () > 1 || track2.decay () > 1 )) {
419+ continue ; // the same particle selection
415420 }
416- } // D0 and anti-D0 selection
421+ }
417422
418423 if constexpr (std::experimental::is_detected<HasProng0Id, typename TTracks1::iterator>::value) {
419424 if constexpr (std::experimental::is_detected<HasProng0Id, typename TTracks2::iterator>::value) {
@@ -480,7 +485,7 @@ struct CorrelationTask {
480485 float deltaPhi = RecoDecay::constrainAngle (track1.phi () - track2.phi (), -o2::constants::math::PIHalf);
481486
482487 // last param is the weight
483- if (cfgMassAxis && (doprocessSame2Prong2Prong) && !(doprocessSame2ProngDerived || doprocessMixed2ProngDerived)) {
488+ if (cfgMassAxis && (doprocessSame2Prong2Prong || doprocessMixed2Prong2Prong ) && !(doprocessSame2ProngDerived || doprocessMixed2ProngDerived)) {
484489 if constexpr (std::experimental::is_detected<HasInvMass, typename TTracks1::iterator>::value && std::experimental::is_detected<HasInvMass, typename TTracks2::iterator>::value)
485490 target->getPairHist ()->Fill (step, track1.eta () - track2.eta (), track2.pt (), track1.pt (), multiplicity, deltaPhi, posZ, track2.invMass (), track1.invMass (), associatedWeight);
486491 else
@@ -785,15 +790,13 @@ struct CorrelationTask {
785790
786791 if (it.isNewWindow ()) {
787792 loadEfficiency (collision1.timestamp ());
788-
789793 mixed->fillEvent (collision1.multiplicity (), CorrelationContainer::kCFStepReconstructed );
790794 }
791795
792796 // LOGF(info, "Tracks: %d and %d entries", tracks1.size(), tracks2.size());
793797
794798 registry.fill (HIST (" eventcount_mixed" ), bin);
795799 fillCorrelations<CorrelationContainer::kCFStepReconstructed >(mixed, tracks1, tracks2, collision1.multiplicity (), collision1.posZ (), field, eventWeight);
796-
797800 if (cfg.mEfficiencyAssociated || cfg.mEfficiencyTrigger ) {
798801 if (it.isNewWindow ()) {
799802 mixed->fillEvent (collision1.multiplicity (), CorrelationContainer::kCFStepCorrected );
0 commit comments