@@ -136,6 +136,8 @@ struct PidDiHadron {
136136 Configurable<std::vector<std::string>> cfgTrackCutsDCAxy{" cfgTrackCutsDCAxy" , std::vector<std::string>{" [0]*(0.0026+0.005/(x^1.01))" , " [0]*(0.0026+0.005/(x^1.01))" }, " Functional form of pt-dependent DCAxy cut" };
137137 Configurable<std::vector<std::string>> cfgTrackCutsDCAz{" cfgTrackCutsDCAz" , std::vector<std::string>{" " , " " }, " Functional form of pt-dependent DCAz cut" };
138138 Configurable<LabeledArray<float >> cfgTrackCuts{" cfgTrackCuts" , {LongArrayFloat.front ().data (), 10 , 2 , {" PtMin" , " PtMax" , " EtaCut" , " Chi2PrTpcCls" , " TpcCluster" , " TpcCrossedRows" , " ItsCluster" , " DCAz" , " DCAzNsigma" , " DCAxyNsigma" }, {" General" , " SelNch" }}, " Labeled array for track selections" };
139+ O2_DEFINE_CONFIGURABLE (cfgMCTrigIsPhysPrim, bool , false , " Switch for using only physical primary trigger particles in MC correlations" );
140+ O2_DEFINE_CONFIGURABLE (cfgMCAsscIsPhysPrim, bool , false , " Switch for using only physical primary associated particles in MC correlations" );
139141 } cfgTrkSel;
140142
141143 struct : ConfigurableGroup {
@@ -148,6 +150,8 @@ struct PidDiHadron {
148150 O2_DEFINE_CONFIGURABLE (cfgPIDUseOnlyTpc, bool , true , " Use only TPC PID for daughter selection" )
149151 O2_DEFINE_CONFIGURABLE (cfgPIDParticle, int , 0 , " 1 = pion, 2 = kaon, 3 = proton, 4 = kshort, 5 = lambda, 0 for no PID" )
150152 O2_DEFINE_CONFIGURABLE (cfgPIDUseReso, bool , false , " Switch to turn on resonance analysis" )
153+ O2_DEFINE_CONFIGURABLE (cfgPIDNclsPIDCut, int , 70 , " Number of clusters used for PID selection" )
154+ O2_DEFINE_CONFIGURABLE (cfgPIDUseNclsPID, bool , false , " Switch for using cfgPIDNclsPIDCut" )
151155 Configurable<LabeledArray<float >> cfgPIDnSigmas{" cfgPIDnSigmas" , {LongArrayFloat.front ().data (), 6 , 3 , {" UpCut_pi" , " UpCut_ka" , " UpCut_pr" , " LowCut_pi" , " LowCut_ka" , " LowCut_pr" }, {" TPC" , " TOF" , " ITS" }}, " Labeled array for n-sigma values for TPC, TOF, ITS for pions, kaons, protons (positive and negative)" };
152156 Configurable<LabeledArray<float >> cfgPIDResoCuts{" cfgPIDResoCuts" , {LongArrayFloat.front ().data (), 15 , 2 , {" cos_PAs" , " massMin" , " massMax" , " PosTrackPt" , " NegTrackPt" , " DCAPosToPVMin" , " DCANegToPVMin" , " Lifetime" , " RadiusMin" , " RadiusMax" , " RapidityMin" , " RapidityMax" , " ArmPodMinVal" , " DCABetDaug" , " CompMassRej" }, {" K0" , " Lambda" }}, " Labeled array (float) for various cuts on resonances" };
153157 Configurable<LabeledArray<int >> cfgPIDResoSwitches{" cfgPIDResoSwitches" , {LongArrayInt.front ().data (), 7 , 2 , {" UseCosPA" , " NMassBins" , " UseDCABetDaug" , " UseProperLifetime" , " UseV0Radius" , " UseArmPodCut" , " UseCompMassRej" }, {" K0" , " Lambda" }}, " Labeled array (int) for various cuts on resonances" };
@@ -216,17 +220,22 @@ struct PidDiHadron {
216220
217221 // make the filters and cuts.
218222 Filter collisionFilter = (nabs(aod::collision::posZ) < cfgEvSel.cfgGlobalCutVertex);
223+ Filter mcCollisionFilter = (nabs(aod::mccollision::posZ) < cfgEvSel.cfgGlobalCutVertex);
219224 Filter trackFilter = (nabs(aod::track::eta) < cfgTrkSel.cfgGlobalEta) && (aod::track::pt > cfgTrkSel.cfgGlobalPtMin) && (aod::track::pt < cfgTrkSel.cfgGlobalPtMax) && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t )true )) && (aod::track::tpcChi2NCl < cfgTrkSel.cfgGlobalChi2prTPCcls) && (nabs(aod::track::dcaZ) < cfgTrkSel.cfgGlobalDCAz);
225+ Filter mcTrackFilter = (nabs(aod::mcparticle::eta) < cfgTrkSel.cfgGlobalEta) && (aod::mcparticle::pt > cfgTrkSel.cfgGlobalPtMin) && (aod::mcparticle::pt < cfgTrkSel.cfgGlobalPtMax);
220226
221227 using FilteredCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSel, aod::CentFT0Cs, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentFV0As, aod::Mults>>;
222228 using FilteredTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::pidTOFbeta, aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr>>;
223- using FilteredMcTracks = soa::Filtered<soa::Join<aod::Tracks, aod::McTrackLabels, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::pidTOFbeta, aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr>>;
229+ using FilteredTracksMcLabels = soa::Filtered<soa::Join<aod::Tracks, aod::McTrackLabels, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::pidTOFbeta, aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr>>;
224230 using V0TrackCandidate = aod::V0Datas;
231+ using FilteredMcCollisions = soa::Filtered<aod::McCollisions>;
232+ using FilteredMcTracks = soa::Filtered<aod::McParticles>;
233+ using SmallGroupMcCollisions = soa::SmallGroups<soa::Join<aod::McCollisionLabels, aod::Collisions, aod::EvSel, aod::CentFT0Cs, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentFV0As, aod::Mults>>;
225234
226235 Partition<FilteredTracks> asscTracks = (aod::track::pt > cfgGeneral.cfgAsscPtMin) && (aod::track::pt < cfgGeneral.cfgAsscPtMax);
236+ Partition<FilteredMcTracks> asscTracksMC = (aod::mcparticle::pt > cfgGeneral.cfgAsscPtMin) && (aod::mcparticle::pt < cfgGeneral.cfgAsscPtMax);
227237
228- Preslice<aod::Tracks> perCollision = aod::track::collisionId;
229- Preslice<aod::V0Datas> perCollisionV0 = aod::v0::collisionId;
238+ PresliceUnsorted<aod::McCollisionLabels> collisionPerMCCollision = aod::mccollisionlabel::mcCollisionId;
230239
231240 // Corrections
232241 TH3D * mEfficiency = nullptr ;
@@ -427,7 +436,7 @@ struct PidDiHadron {
427436 }
428437
429438 // Event Counter
430- if ((doprocessSame || doprocessSameReso || doprocessMC ) && cfgEvSel.cfgUseAdditionalEventCut ) {
439+ if ((doprocessSame || doprocessSameReso || doprocessMCPID ) && cfgEvSel.cfgUseAdditionalEventCut ) {
431440 histos.add (" hEventCount" , " Number of Events;; Count" , {HistType::kTH1D , {{15 , -0.5 , 14.5 }}});
432441 histos.get <TH1 >(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (FilteredEvents + 1 , " Filtered events" );
433442 histos.get <TH1 >(HIST (" hEventCount" ))->GetXaxis ()->SetBinLabel (AfterSel8 + 1 , " After sel8" );
@@ -454,6 +463,7 @@ struct PidDiHadron {
454463 histos.add (" hK0Eta" , " " , {HistType::kTH1D , {axisEta}});
455464
456465 histos.add (" hK0Count" , " Number of K0;; Count" , {HistType::kTH1D , {{12 , -0.5 , 11.5 }}});
466+ histos.get <TH1 >(HIST (" hK0Count" ))->GetYaxis ()->SetTitle (" Counts" );
457467 histos.get <TH1 >(HIST (" hK0Count" ))->GetXaxis ()->SetBinLabel (FillCandidate + 1 , " K0 candidates" );
458468 histos.get <TH1 >(HIST (" hK0Count" ))->GetXaxis ()->SetBinLabel (FillDaughterPt + 1 , " Daughter pt" );
459469 histos.get <TH1 >(HIST (" hK0Count" ))->GetXaxis ()->SetBinLabel (FillMassCut + 1 , " Mass cut" );
@@ -476,6 +486,7 @@ struct PidDiHadron {
476486 histos.add (" hLambdaEta" , " " , {HistType::kTH1D , {axisEta}});
477487
478488 histos.add (" hLambdaCount" , " Number of Lambda;; Count" , {HistType::kTH1D , {{12 , -0.5 , 11.5 }}});
489+ histos.get <TH1 >(HIST (" hLambdaCount" ))->GetYaxis ()->SetTitle (" Counts" );
479490 histos.get <TH1 >(HIST (" hLambdaCount" ))->GetXaxis ()->SetBinLabel (FillCandidate + 1 , " Lambda candidates" );
480491 histos.get <TH1 >(HIST (" hLambdaCount" ))->GetXaxis ()->SetBinLabel (FillDaughterPt + 1 , " Daughter pt" );
481492 histos.get <TH1 >(HIST (" hLambdaCount" ))->GetXaxis ()->SetBinLabel (FillMassCut + 1 , " Mass cut" );
@@ -591,16 +602,31 @@ struct PidDiHadron {
591602 histos.add (" Trig_hist" , " " , {HistType::kTHnSparseF , {{axisSample, axisVertex, axisEventClass, axisPtTrigger, axisParticle}}});
592603 }
593604
605+ if (doprocessSameMC) {
606+ histos.add (" Nch" , " N_{ch}" , {HistType::kTH1D , {axisMultiplicity}});
607+ histos.add (" Centrality" , hCentTitle.c_str (), {HistType::kTH1D , {axisCentrality}});
608+ histos.add (" zVtx" , " zVtx" , {HistType::kTH1D , {axisVertex}});
609+ histos.add (" deltaEta_deltaPhi_same" , " " , {HistType::kTH2D , {axisDeltaPhi, axisDeltaEta}}); // check to see the delta eta and delta phi distribution
610+
611+ if (cfgGeneral.cfgQABasic ) {
612+ histos.add (" Phi" , " Phi" , {HistType::kTH2D , {axisPhi, axisParticle}});
613+ histos.add (" Eta" , " Eta" , {HistType::kTH2D , {axisEta, axisParticle}});
614+ histos.add (" pTFiner" , " pTFiner" , {HistType::kTHnSparseF , {axisPt, axisParticle, axisEventClass}});
615+ }
616+ histos.add (" Trig_hist" , " " , {HistType::kTHnSparseF , {{axisSample, axisVertex, axisEventClass, axisPtTrigger, axisParticle}}});
617+ }
618+
594619 if (doprocessSameReso) {
595620 if (cfgPIDConfigs.cfgPIDParticle == UseK0 || cfgPIDConfigs.cfgPIDParticle == UseLambda) {
596621 histos.add (" Trig_histReso" , " " , {HistType::kTHnSparseF , {{axisSample, axisVertex, axisEventClass, axisPtTrigger, axisInvMass}}});
597622 }
598623 }
599624
600- if (doprocessMixed || doprocessMixedReso) {
625+ if (doprocessMixed || doprocessMixedReso || doprocessMixedMC ) {
601626 histos.add (" deltaEta_deltaPhi_mixed" , " " , {HistType::kTH2D , {axisDeltaPhi, axisDeltaEta}});
602627 }
603- if (doprocessMC) {
628+
629+ if (doprocessMCPID) {
604630 histos.add (" hNsigmaPionTruePositives" , " hNsigmaPionTruePositives" , {HistType::kTH1D , {axisPtTrigger}}); // Fraction of particles that are pions and selected as pions
605631 histos.add (" hNsigmaKaonTruePositives" , " hNsigmaKaonTruePositives" , {HistType::kTH1D , {axisPtTrigger}}); // Fraction of particles that are kaons and selected as kaons
606632 histos.add (" hNsigmaProtonTruePositives" , " hNsigmaProtonTruePositives" , {HistType::kTH1D , {axisPtTrigger}}); // Fraction of particles that are protons and selected as protons
@@ -775,6 +801,10 @@ struct PidDiHadron {
775801 template <typename TTrack>
776802 int getNsigmaPID (const TTrack& track)
777803 {
804+ if (cfgPIDConfigs.cfgPIDUseNclsPID && track.tpcNClsPID () < cfgPIDConfigs.cfgPIDNclsPIDCut ) {
805+ return -1 ;
806+ }
807+
778808 // Computing Nsigma arrays for pion, kaon, and protons
779809 std::array<float , 3 > nSigmaTPC = {track.tpcNSigmaPi (), track.tpcNSigmaKa (), track.tpcNSigmaPr ()};
780810 std::array<float , 3 > nSigmaTOF = {track.tofNSigmaPi (), track.tofNSigmaKa (), track.tofNSigmaPr ()};
@@ -1292,6 +1322,91 @@ struct PidDiHadron {
12921322 }
12931323 }
12941324
1325+ template <typename TTracks, typename TTracksAssoc>
1326+ void fillCorrelationsMC (const TTracks& triggers, const TTracksAssoc& assocs, float posZ, int system, double eventClass, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms for MC truth
1327+ {
1328+ int fSampleIndex = static_cast <int >(fRandom .Uniform (0.0 , cfgGeneral.cfgSampleSize ));
1329+
1330+ float triggerWeight = 1 .0f ;
1331+ float associatedWeight = 1 .0f ;
1332+
1333+ // loop over all tracks
1334+ for (auto const & trig : triggers) {
1335+
1336+ if (cfgTrkSel.cfgMCTrigIsPhysPrim && !trig.isPhysicalPrimary ()) {
1337+ continue ;
1338+ }
1339+
1340+ auto getPIDcode = [](int x) {
1341+ int pid = -1 ;
1342+ switch (x) {
1343+ case PDG_t::kPiPlus :
1344+ pid = UsePions;
1345+ break ;
1346+ case PDG_t::kKPlus :
1347+ pid = UseKaons;
1348+ break ;
1349+ case PDG_t::kProton :
1350+ pid = UseProtons;
1351+ break ;
1352+ default :
1353+ return pid;
1354+ } // end of switch
1355+ return pid;
1356+ };
1357+
1358+ int pidIndex = getPIDcode (trig.pdgCode ());
1359+
1360+ if (system == SameEvent) {
1361+ histos.fill (HIST (" Phi" ), RecoDecay::constrainAngle (trig.phi (), 0.0 ), UseCharged);
1362+ histos.fill (HIST (" Eta" ), trig.eta (), UseCharged);
1363+ histos.fill (HIST (" pTFiner" ), trig.pt (), UseCharged, eventClass);
1364+ histos.fill (HIST (" Trig_hist" ), fSampleIndex , posZ, eventClass, trig.pt (), UseCharged, eventWeight * triggerWeight);
1365+ if (pidIndex > UseCharged) {
1366+ histos.fill (HIST (" Phi" ), RecoDecay::constrainAngle (trig.phi (), 0.0 ), pidIndex);
1367+ histos.fill (HIST (" Eta" ), trig.eta (), pidIndex);
1368+ histos.fill (HIST (" pTFiner" ), trig.pt (), pidIndex, eventClass);
1369+ histos.fill (HIST (" Trig_hist" ), fSampleIndex , posZ, eventClass, trig.pt (), pidIndex, eventWeight * triggerWeight);
1370+ }
1371+ }
1372+
1373+ for (auto const & assc : assocs) {
1374+
1375+ if (cfgTrkSel.cfgMCAsscIsPhysPrim && !assc.isPhysicalPrimary ()) {
1376+ continue ;
1377+ }
1378+
1379+ if (!cfgGeneral.cfgUsePtOrder && trig.globalIndex () == assc.globalIndex ()) {
1380+ continue ; // For pt-differential correlations, skip if the trigger and associate are the same track
1381+ }
1382+ if (cfgGeneral.cfgUsePtOrder && system == SameEvent && trig.pt () <= assc.pt ()) {
1383+ continue ; // Without pt-differential correlations, skip if the trigger pt is less than the associate pt
1384+ }
1385+ if (cfgGeneral.cfgUsePtOrder && system == MixedEvent && cfgGeneral.cfgUsePtOrderInMixEvent && trig.pt () <= assc.pt ()) {
1386+ continue ; // For pt-differential correlations in mixed events, skip if the trigger pt is less than the associate pt
1387+ }
1388+
1389+ float deltaPhi = RecoDecay::constrainAngle (trig.phi () - assc.phi (), -PIHalf);
1390+ float deltaEta = trig.eta () - assc.eta ();
1391+
1392+ // fill the right sparse and histograms
1393+ if (system == SameEvent) {
1394+ same->getCorrHist ()->Fill (0 , fSampleIndex , posZ, eventClass, trig.pt (), UseCharged, deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight);
1395+ if (pidIndex > UseCharged) {
1396+ same->getCorrHist ()->Fill (0 , fSampleIndex , posZ, eventClass, trig.pt (), pidIndex, deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight);
1397+ }
1398+ histos.fill (HIST (" deltaEta_deltaPhi_same" ), deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight);
1399+ } else if (system == MixedEvent) {
1400+ mixed->getCorrHist ()->Fill (0 , fSampleIndex , posZ, eventClass, trig.pt (), UseCharged, deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight);
1401+ if (pidIndex > UseCharged) {
1402+ mixed->getCorrHist ()->Fill (0 , fSampleIndex , posZ, eventClass, trig.pt (), pidIndex, deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight);
1403+ }
1404+ histos.fill (HIST (" deltaEta_deltaPhi_mixed" ), deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight);
1405+ }
1406+ }
1407+ }
1408+ }
1409+
12951410 template <typename TCollision>
12961411 bool selectionEvent (TCollision const & collision, const int mult, const double cent, const bool fillCounter)
12971412 {
@@ -1929,7 +2044,101 @@ struct PidDiHadron {
19292044 }
19302045 PROCESS_SWITCH (PidDiHadron, processMixedReso, " Process mixed events" , true );
19312046
1932- void processMC (FilteredCollisions::iterator const & collision, FilteredMcTracks const & tracksmc, aod::BCsWithTimestamps const &, aod::McParticles const &)
2047+ void processSameMC (FilteredMcCollisions::iterator const & mcCollision, FilteredMcTracks const & mcTracks, SmallGroupMcCollisions const & collisions)
2048+ {
2049+ float cent = -1 .f ;
2050+ if (!cfgEvSel.cfgCentTableUnavailable ) {
2051+ for (const auto & collision : collisions) {
2052+ cent = getCentrality (collision);
2053+ }
2054+ histos.fill (HIST (" Centrality" ), cent);
2055+ }
2056+ auto multiplicity = static_cast <double >(mcTracks.size ());
2057+ histos.fill (HIST (" Nch" ), multiplicity);
2058+ histos.fill (HIST (" zVtx" ), mcCollision.posZ ());
2059+
2060+ if (cfgEvSel.cfgSelCollByNch && (multiplicity < cfgEvSel.cfgCutMultMin || multiplicity >= cfgEvSel.cfgCutMultMax )) {
2061+ return ;
2062+ }
2063+ if (!cfgEvSel.cfgSelCollByNch && !cfgEvSel.cfgCentTableUnavailable && (cent < cfgEvSel.cfgCutCentMin || cent >= cfgEvSel.cfgCutCentMax )) {
2064+ return ;
2065+ }
2066+ histos.fill (HIST (" eventcount" ), SameEvent);
2067+
2068+ float eventWeight = 1 .0f ;
2069+ auto eventClass = (cfgEvSel.cfgSelCollByNch ) ? multiplicity : cent;
2070+
2071+ auto mcAssocs = asscTracksMC->sliceByCached (aod::mcparticle::mcCollisionId, mcCollision.globalIndex (), cache);
2072+
2073+ fillCorrelationsMC (mcTracks, mcAssocs, mcCollision.posZ (), SameEvent, eventClass, eventWeight);
2074+
2075+ } // end of processSameMC
2076+ PROCESS_SWITCH (PidDiHadron, processSameMC, " Process Monte Carlo for same event correlations" , true );
2077+
2078+ void processMixedMC (FilteredMcCollisions const & mcCollisions, FilteredMcTracks const & mcTracks, SmallGroupMcCollisions const & collisions)
2079+ {
2080+ auto getTracksSize = [&mcTracks, this ](FilteredMcCollisions::iterator const & mcCollision) {
2081+ auto associatedTracks = mcTracks.sliceByCached (o2::aod::mcparticle::mcCollisionId, mcCollision.globalIndex (), this ->cache );
2082+ auto mult = associatedTracks.size ();
2083+ return mult;
2084+ };
2085+
2086+ using MixedBinning = FlexibleBinningPolicy<std::tuple<decltype (getTracksSize)>, aod::mccollision::PosZ, decltype (getTracksSize)>;
2087+
2088+ MixedBinning binningOnVtxAndMult{{getTracksSize}, {axisVtxMix, axisMultMix}};
2089+
2090+ auto tracksTuple = std::make_tuple (mcTracks, mcTracks);
2091+ Pair<FilteredMcCollisions, FilteredMcTracks, FilteredMcTracks, MixedBinning> pairs{binningOnVtxAndMult, cfgGeneral.cfgMixEventNumMin , -1 , mcCollisions, tracksTuple, &cache}; // -1 is the number of the bin to skip
2092+ for (auto it = pairs.begin (); it != pairs.end (); it++) {
2093+ auto & [mcCollision1, mcTracks1, mcCollision2, mcTracks2] = *it;
2094+
2095+ auto groupedCollisions1 = collisions.sliceBy (collisionPerMCCollision, mcCollision1.globalIndex ());
2096+ auto groupedCollisions2 = collisions.sliceBy (collisionPerMCCollision, mcCollision2.globalIndex ());
2097+
2098+ float cent1 = -1 .f ;
2099+ float cent2 = -1 .f ;
2100+
2101+ if (!cfgEvSel.cfgCentTableUnavailable ) {
2102+ for (const auto & collision : groupedCollisions1) {
2103+ cent1 = getCentrality (collision);
2104+ }
2105+ for (const auto & collision : groupedCollisions2) {
2106+ cent2 = getCentrality (collision);
2107+ }
2108+ }
2109+
2110+ if (!cfgEvSel.cfgSelCollByNch && !cfgEvSel.cfgCentTableUnavailable && (cent1 < cfgEvSel.cfgCutCentMin || cent1 >= cfgEvSel.cfgCutCentMax )) {
2111+ continue ;
2112+ }
2113+
2114+ if (!cfgEvSel.cfgSelCollByNch && !cfgEvSel.cfgCentTableUnavailable && (cent2 < cfgEvSel.cfgCutCentMin || cent2 >= cfgEvSel.cfgCutCentMax )) {
2115+ continue ;
2116+ }
2117+
2118+ auto multiplicity1 = static_cast <double >(mcTracks1.size ());
2119+ auto multiplicity2 = static_cast <double >(mcTracks2.size ());
2120+
2121+ if (cfgEvSel.cfgSelCollByNch && (multiplicity1 < cfgEvSel.cfgCutMultMin || multiplicity1 >= cfgEvSel.cfgCutMultMax )) {
2122+ continue ;
2123+ }
2124+
2125+ if (cfgEvSel.cfgSelCollByNch && (multiplicity2 < cfgEvSel.cfgCutMultMin || multiplicity2 >= cfgEvSel.cfgCutMultMax )) {
2126+ continue ;
2127+ }
2128+
2129+ histos.fill (HIST (" eventcount" ), MixedEvent);
2130+
2131+ float eventWeight = (cfgEffWeights.cfgUseEventWeights ) ? (1 .0f / it.currentWindowNeighbours ()) : 1 .0f ;
2132+ auto eventClass = (cfgEvSel.cfgSelCollByNch ) ? multiplicity1 : cent1;
2133+
2134+ auto mcAssocs = asscTracksMC->sliceByCached (aod::mcparticle::mcCollisionId, mcCollision2.globalIndex (), cache);
2135+
2136+ fillCorrelationsMC (mcTracks1, mcAssocs, mcCollision1.posZ (), MixedEvent, eventClass, eventWeight);
2137+ }
2138+ }
2139+ PROCESS_SWITCH (PidDiHadron, processMixedMC, " Process Monte Carlo for mixed event correlations" , true );
2140+
2141+ void processMCPID (FilteredCollisions::iterator const & collision, FilteredTracksMcLabels const & tracksmc, aod::BCsWithTimestamps const &, aod::McParticles const &)
19332142 {
19342143 float cent = -1 .;
19352144 if (!cfgEvSel.cfgCentTableUnavailable ) {
@@ -2024,8 +2233,8 @@ struct PidDiHadron {
20242233 }
20252234 } // Proton condition
20262235 } // end of tracks MC loop
2027- } // end of process MC
2028- PROCESS_SWITCH (PidDiHadron, processMC , " Process Monte Carlo" , true );
2236+ } // end of process MCPID
2237+ PROCESS_SWITCH (PidDiHadron, processMCPID , " Process Monte Carlo for PID " , true );
20292238};
20302239
20312240WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments