@@ -100,13 +100,22 @@ struct FlowDecorrelation {
100100 O2_DEFINE_CONFIGURABLE (cfgLocalEfficiency, bool , false , " Use local efficiency object" )
101101 O2_DEFINE_CONFIGURABLE (cfgUseEventWeights, bool , false , " Use event weights for mixed event" )
102102 O2_DEFINE_CONFIGURABLE (cfgDrawEtaPhiDis, bool , false , " draw eta-phi distribution for detectors in used" )
103- O2_DEFINE_CONFIGURABLE (nClustersMftTrack, int , 5 , " Minimum number of clusters for MFT track" )
104- O2_DEFINE_CONFIGURABLE (cfgCutChi2Mft, float , -1 .0f , " max chi2 of MFT track" )
105- O2_DEFINE_CONFIGURABLE (cfgCutTrackTimeMft, float , -1 .0f , " max deviation of MFT track wrt. bc in ns" )
106- O2_DEFINE_CONFIGURABLE (cfgRejectFT0AInside, bool , false , " Rejection of inner ring channels of the FT0A detector" )
107- O2_DEFINE_CONFIGURABLE (cfgRejectFT0AOutside, bool , false , " Rejection of outer ring channels of the FT0A detector" )
108- O2_DEFINE_CONFIGURABLE (cfgRejectFT0CInside, bool , false , " Rejection of inner ring channels of the FT0C detector" )
109- O2_DEFINE_CONFIGURABLE (cfgRejectFT0COutside, bool , false , " Rejection of outer ring channels of the FT0C detector" )
103+ struct : ConfigurableGroup{
104+ O2_DEFINE_CONFIGURABLE (nClustersMftTrack, int , 5 , " Minimum number of clusters for MFT track" )
105+ O2_DEFINE_CONFIGURABLE (cfgCutChi2Mft, float , -1 .0f , " max chi2 of MFT track" )
106+ O2_DEFINE_CONFIGURABLE (cfgCutTrackTimeMft, float , -1 .0f , " max deviation of MFT track wrt. bc in ns" )} cfgMftCuts;
107+ struct : ConfigurableGroup{
108+ O2_DEFINE_CONFIGURABLE (cfgRejectFT0AInside, bool , false , " Rejection of inner ring channels of the FT0A detector" )
109+ O2_DEFINE_CONFIGURABLE (cfgRejectFT0AOutside, bool , false , " Rejection of outer ring channels of the FT0A detector" )
110+ O2_DEFINE_CONFIGURABLE (cfgRejectFT0CInside, bool , false , " Rejection of inner ring channels of the FT0C detector" )
111+ O2_DEFINE_CONFIGURABLE (cfgRejectFT0COutside, bool , false , " Rejection of outer ring channels of the FT0C detector" )} cfgFt0RingRejections;
112+ struct : ConfigurableGroup {
113+ O2_DEFINE_CONFIGURABLE (cfgEtaTpcCut, float , 0 .8f , " Eta cut of TPC MC particles" )
114+ O2_DEFINE_CONFIGURABLE (cfgMinEtaFt0cCut, float , -3 .4f , " Min eta cut of FT0C MC particles" )
115+ O2_DEFINE_CONFIGURABLE (cfgMaxEtaFt0cCut, float , -2 .0f , " Max eta cut of FT0C MC particles" )
116+ O2_DEFINE_CONFIGURABLE (cfgUseFt0cStructure, bool , true , " Use the true structure of FT0C in MC-true" );
117+ O2_DEFINE_CONFIGURABLE (cfgUseCFStepAll, bool , true , " Use CFStepAll in addition to primry" );
118+ } cfgMcTrue;
110119 struct : ConfigurableGroup {
111120 O2_DEFINE_CONFIGURABLE (cfgMultCentHighCutFunction, std::string, " [0] + [1]*x + [2]*x*x + [3]*x*x*x + [4]*x*x*x*x + 10.*([5] + [6]*x + [7]*x*x + [8]*x*x*x + [9]*x*x*x*x)" , " Functional for multiplicity correlation cut" );
112121 O2_DEFINE_CONFIGURABLE (cfgMultCentLowCutFunction, std::string, " [0] + [1]*x + [2]*x*x + [3]*x*x*x + [4]*x*x*x*x - 3.*([5] + [6]*x + [7]*x*x + [8]*x*x*x + [9]*x*x*x*x)" , " Functional for multiplicity correlation cut" );
@@ -147,8 +156,8 @@ struct FlowDecorrelation {
147156 ConfigurableAxis axisDeltaEtaTpcFt0c{" axisDeltaEtaTpcFt0c" , {32 , 1.2 , 4.2 }, " delta eta axis, 1.2~4.2 for TPC-FT0C" };
148157 ConfigurableAxis axisDeltaEtaFt0aFt0c{" axisDeltaEtaFt0aFt0c" , {32 , 4.2 , 8.2 }, " delta eta axis, 4.2~8.2 for FT0A-FT0C" };
149158 ConfigurableAxis axisDeltaEtaTpcMft{" axisDeltaEtaTpcMft" , {32 , 1.3 , 4.8 }, " delta eta axis, 1.3~4.8 for TPC-MFT" };
150- ConfigurableAxis axisDeltaEtaTpcFv0{" axisDeltaEtaTpcFv0" , {32 , -1.2 , -6.1 }, " delta eta axis for TPC-FV0 histograms" };
151- ConfigurableAxis axisEtaTrigger{" axisEtaTrigger" , {VARIABLE_WIDTH, -3.3 , -2.1 , -0.8 , -0.6 , -0.4 , -0.2 , 0 , 0.2 , 0.4 , 0.6 , 0.8 , 3.5 , 4.9 }, " eta trigger axis for histograms" };
159+ ConfigurableAxis axisDeltaEtaTpcFv0{" axisDeltaEtaTpcFv0" , {32 , -6.1 , -1.2 }, " delta eta axis for TPC-FV0 histograms" };
160+ ConfigurableAxis axisEtaTrigger{" axisEtaTrigger" , {VARIABLE_WIDTH, -3.4 , -2.0 , -0.8 , -0.6 , -0.4 , -0.2 , 0 , 0.2 , 0.4 , 0.6 , 0.8 , 3.5 , 4.9 }, " eta trigger axis for histograms" };
152161 ConfigurableAxis axisEtaAssoc{" axisEtaAssoc" , {VARIABLE_WIDTH, -3.3 , -2.1 , -0.8 , -0.6 , -0.4 , -0.2 , 0 , 0.2 , 0.4 , 0.6 , 0.8 , 3.5 , 4.9 }, " eta associated axis for histograms" };
153162 ConfigurableAxis axisVtxMix{" axisVtxMix" , {VARIABLE_WIDTH, -10 , -9 , -8 , -7 , -6 , -5 , -4 , -3 , -2 , -1 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 }, " vertex axis for mixed event histograms" };
154163 ConfigurableAxis axisMultMix{" axisMultMix" , {VARIABLE_WIDTH, 0 , 10 , 20 , 40 , 60 , 80 , 100 , 120 , 140 , 160 , 180 , 200 , 220 , 240 , 260 }, " multiplicity / centrality axis for mixed event histograms" };
@@ -171,6 +180,17 @@ struct FlowDecorrelation {
171180 using FilteredCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSel, aod::CentFT0Cs, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentFV0As, aod::Mults>>;
172181 using FilteredTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA>>;
173182
183+ Filter particleFilter = (nabs(aod::mcparticle::eta) < cfgMcTrue.cfgEtaTpcCut || ((aod::mcparticle::eta > cfgMcTrue.cfgMinEtaFt0cCut) && (aod::mcparticle::eta < cfgMcTrue.cfgMaxEtaFt0cCut))) && (aod::mcparticle::pt > cfgCutPtMin) && (aod::mcparticle::pt < cfgCutPtMax);
184+ using FilteredMcParticles = soa::Filtered<aod::McParticles>;
185+
186+ // Filter for MCcollisions
187+ Filter mccollisionFilter = nabs(aod::mccollision::posZ) < cfgCutVtxZ;
188+ using FilteredMcCollisions = soa::Filtered<aod::McCollisions>;
189+
190+ using SmallGroupMcCollisions = soa::SmallGroups<soa::Join<aod::McCollisionLabels, aod::Collisions, aod::EvSel, aod::CentFT0Cs, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentFV0As, aod::Mults>>;
191+
192+ PresliceUnsorted<aod::McCollisionLabels> collisionPerMCCollision = aod::mccollisionlabel::mcCollisionId;
193+
174194 // FT0 geometry
175195 o2::ft0::Geometry ft0Det;
176196 o2::fv0::Geometry* fv0Det{};
@@ -243,6 +263,7 @@ struct FlowDecorrelation {
243263 const AxisSpec axisPhi{72 , 0.0 , constants::math::TwoPI, " #varphi" };
244264 const AxisSpec axisEta{40 , -1 ., 1 ., " #eta" };
245265 const AxisSpec axisEtaFull{90 , -4 ., 5 ., " #eta" };
266+ const AxisSpec axisCentrality{20 , 0 ., 100 ., " cent" };
246267
247268 ccdb->setURL (" http://alice-ccdb.cern.ch" );
248269 ccdb->setCaching (true );
@@ -268,7 +289,23 @@ struct FlowDecorrelation {
268289 registry.get <TH1>(HIST (" hEventCountSpecific" ))->GetXaxis ()->SetBinLabel (12 , " MultCorrelation" );
269290 registry.get <TH1>(HIST (" hEventCountSpecific" ))->GetXaxis ()->SetBinLabel (13 , " cfgEvSelV0AT0ACut" );
270291 }
271-
292+ if (doprocessMcSameTpcFt0c) {
293+ registry.add (" MCTrue/MCeventcount" , " MCeventcount" , {HistType::kTH1F , {{5 , 0 , 5 , " bin" }}}); // histogram to see how many events are in the same and mixed event
294+ registry.get <TH1>(HIST (" MCTrue/MCeventcount" ))->GetXaxis ()->SetBinLabel (2 , " same all" );
295+ registry.get <TH1>(HIST (" MCTrue/MCeventcount" ))->GetXaxis ()->SetBinLabel (3 , " same reco" );
296+ registry.get <TH1>(HIST (" MCTrue/MCeventcount" ))->GetXaxis ()->SetBinLabel (4 , " mixed all" );
297+ registry.get <TH1>(HIST (" MCTrue/MCeventcount" ))->GetXaxis ()->SetBinLabel (5 , " mixed reco" );
298+ registry.add (" MCTrue/MCCentrality" , " cent" , {HistType::kTH1D , {axisCentrality}});
299+ registry.add (" MCTrue/MCNch" , " N_{ch}" , {HistType::kTH1D , {axisMultiplicity}});
300+ registry.add (" MCTrue/MCzVtx" , " MCzVtx" , {HistType::kTH1D , {axisVertex}});
301+ registry.add (" MCTrue/MCPhi" , " MCPhi" , {HistType::kTH1D , {axisPhi}});
302+ registry.add (" MCTrue/MCEta" , " MCEta" , {HistType::kTH1D , {axisEtaFull}});
303+ registry.add (" MCTrue/MCEtaTrueShape" , " MCEta" , {HistType::kTH1D , {axisEtaFull}});
304+ registry.add (" MCTrue/MCpT" , " MCpT" , {HistType::kTH1D , {axisPtEfficiency}});
305+ registry.add (" MCTrue/MCTrig_hist" , " " , {HistType::kTHnSparseF , {{axisSample, axisVertex, axisPtEfficiency}}});
306+ registry.add (" MCTrue/MCdeltaEta_deltaPhi_same" , " " , {HistType::kTH2D , {axisDeltaPhi, axisDeltaEtaTpcFt0c}}); // check to see the delta eta and delta phi distribution
307+ registry.add (" MCTrue/MCdeltaEta_deltaPhi_mixed" , " " , {HistType::kTH2D , {axisDeltaPhi, axisDeltaEtaTpcFt0c}});
308+ }
272309 if (cfgEvSelMultCorrelation) {
273310 cfgFuncParas.multT0CCutPars = cfgFuncParas.cfgMultT0CCutPars ;
274311 cfgFuncParas.multPVT0CCutPars = cfgFuncParas.cfgMultPVT0CCutPars ;
@@ -421,20 +458,24 @@ struct FlowDecorrelation {
421458 same.setObject (new CorrelationContainer (" sameEvent_TPC_FV0" , " sameEvent_TPC_FV0" , corrAxisTpcFv0, effAxis, userAxis));
422459 mixed.setObject (new CorrelationContainer (" mixedEvent_TPC_FV0" , " mixedEvent_TPC_FV0" , corrAxisTpcFv0, effAxis, userAxis));
423460 }
461+ if (doprocessMcSameTpcFt0c) {
462+ same.setObject (new CorrelationContainer (" sameEvent_TPC_FV0" , " sameEvent_TPC_FV0" , corrAxisTpcFt0c, effAxis, userAxis));
463+ mixed.setObject (new CorrelationContainer (" mixedEvent_TPC_FV0" , " mixedEvent_TPC_FV0" , corrAxisTpcFt0c, effAxis, userAxis));
464+ }
424465 LOGF (info, " End of init" );
425466 }
426467
427468 template <typename TTrackAssoc>
428469 bool isAcceptedMftTrack (TTrackAssoc const & mftTrack)
429470 {
430471 // cut on the number of clusters of the reconstructed MFT track
431- if (mftTrack.nClusters () < nClustersMftTrack)
472+ if (mftTrack.nClusters () < cfgMftCuts. nClustersMftTrack )
432473 return false ;
433474
434- if (cfgCutChi2Mft > 0 . && mftTrack.chi2 () > cfgCutChi2Mft)
475+ if (cfgMftCuts. cfgCutChi2Mft > 0 . && mftTrack.chi2 () > cfgMftCuts. cfgCutChi2Mft )
435476 return false ;
436477
437- if (cfgCutTrackTimeMft > 0 . && std::abs (mftTrack.trackTime ()) > cfgCutTrackTimeMft)
478+ if (cfgMftCuts. cfgCutTrackTimeMft > 0 . && std::abs (mftTrack.trackTime ()) > cfgMftCuts. cfgCutTrackTimeMft )
438479 return false ;
439480
440481 return true ;
@@ -729,11 +770,11 @@ struct FlowDecorrelation {
729770 float ampl = 0 .;
730771 getChannel (ft0, iCh, chanelid, ampl, corType);
731772 if (corType == kFT0C ) {
732- if ((cfgRejectFT0CInside && (chanelid >= kFT0CInnerRingMin && chanelid <= kFT0CInnerRingMax )) || (cfgRejectFT0COutside && (chanelid >= kFT0COuterRingMin && chanelid <= kFT0COuterRingMax ))) {
773+ if ((cfgFt0RingRejections. cfgRejectFT0CInside && (chanelid >= kFT0CInnerRingMin && chanelid <= kFT0CInnerRingMax )) || (cfgFt0RingRejections. cfgRejectFT0COutside && (chanelid >= kFT0COuterRingMin && chanelid <= kFT0COuterRingMax ))) {
733774 continue ;
734775 }
735776 } else if (corType == kFT0A ) {
736- if ((cfgRejectFT0AInside && (chanelid >= kFT0AInnerRingMin && chanelid <= kFT0AInnerRingMax )) || (cfgRejectFT0AOutside && (chanelid >= kFT0AOuterRingMin && chanelid <= kFT0AOuterRingMax ))) {
777+ if ((cfgFt0RingRejections. cfgRejectFT0AInside && (chanelid >= kFT0AInnerRingMin && chanelid <= kFT0AInnerRingMax )) || (cfgFt0RingRejections. cfgRejectFT0AOutside && (chanelid >= kFT0AOuterRingMin && chanelid <= kFT0AOuterRingMax ))) {
737778 continue ;
738779 }
739780 }
@@ -786,7 +827,7 @@ struct FlowDecorrelation {
786827 int channelIdA = 0 ;
787828 float amplA = 0 .f ;
788829 getChannel (ft0Trig, iChA, channelIdA, amplA, kFT0A );
789- if ((cfgRejectFT0AInside && (channelIdA >= kFT0AInnerRingMin && channelIdA <= kFT0AInnerRingMax )) || (cfgRejectFT0AOutside && (channelIdA >= kFT0AOuterRingMin && channelIdA <= kFT0AOuterRingMax ))) {
830+ if ((cfgFt0RingRejections. cfgRejectFT0AInside && (channelIdA >= kFT0AInnerRingMin && channelIdA <= kFT0AInnerRingMax )) || (cfgFt0RingRejections. cfgRejectFT0AOutside && (channelIdA >= kFT0AOuterRingMin && channelIdA <= kFT0AOuterRingMax ))) {
790831 continue ;
791832 }
792833
@@ -801,7 +842,7 @@ struct FlowDecorrelation {
801842 int channelIdC = 0 ;
802843 float amplC = 0 .f ;
803844 getChannel (ft0Assoc, iChC, channelIdC, amplC, kFT0C );
804- if ((cfgRejectFT0CInside && (channelIdC >= kFT0CInnerRingMin && channelIdC <= kFT0CInnerRingMax )) || (cfgRejectFT0COutside && (channelIdC >= kFT0COuterRingMin && channelIdC <= kFT0COuterRingMax ))) {
845+ if ((cfgFt0RingRejections. cfgRejectFT0CInside && (channelIdC >= kFT0CInnerRingMin && channelIdC <= kFT0CInnerRingMax )) || (cfgFt0RingRejections. cfgRejectFT0COutside && (channelIdC >= kFT0COuterRingMin && channelIdC <= kFT0COuterRingMax ))) {
805846 continue ;
806847 }
807848
@@ -983,6 +1024,24 @@ struct FlowDecorrelation {
9831024 return 1 ;
9841025 }
9851026
1027+ bool ft0cCollisionCourse (float eta, float phi, float vtxZ)
1028+ {
1029+ double theta = 2 * std::atan (std::exp (-eta));
1030+ double vx = std::sin (theta) * std::cos (phi); // veloctiy component along x
1031+ double vy = std::sin (theta) * std::sin (phi); // veloctiy component along y
1032+ double vz = std::cos (theta); // veloctiy component along z
1033+
1034+ double x = vx * ((-83.44 - vtxZ) / vz); // location of particle on x at FT0C distance from vertex
1035+ double y = vy * ((-83.44 - vtxZ) / vz); // location of particle on x at FT0C distance from vertex
1036+
1037+ if (std::abs (x) < 24 && (std::abs (y) > 6.825 && std::abs (y) < 18.25 ))
1038+ return true ;
1039+ else if (std::abs (y) < 24 && (std::abs (x) > 6.675 && std::abs (x) < 18.175 ))
1040+ return true ;
1041+ else
1042+ return false ;
1043+ }
1044+
9861045 void processSameTpcFt0a (FilteredCollisions::iterator const & collision, FilteredTracks const & tracks, aod::FT0s const &, aod::BCsWithTimestamps const &)
9871046 {
9881047 if (!collision.sel8 ())
@@ -1558,6 +1617,148 @@ struct FlowDecorrelation {
15581617 }
15591618 }
15601619 PROCESS_SWITCH (FlowDecorrelation, processMixedTpcFv0, " Process mixed events for TPC-FV0 correlation" , false );
1620+
1621+ template <CorrelationContainer::CFStep step, typename TTracks, typename TTracksAssoc>
1622+ void fillMCCorrelations (TTracks tracks1, TTracksAssoc tracks2, float posZ, int system, float eventWeight) // function to fill the Output functions (sparse) and the delta eta and delta phi histograms
1623+ {
1624+ int fSampleIndex = gRandom ->Uniform (0 , cfgSampleSize);
1625+
1626+ float triggerWeight = 1 .0f ;
1627+ float associatedWeight = 1 .0f ;
1628+ // loop over all FT0C tracks
1629+ for (auto const & track1 : tracks1) {
1630+
1631+ if (!cfgMcTrue.cfgUseFt0cStructure ) {
1632+ if (std::abs (track1.eta ()) < 0.9 )
1633+ continue ;
1634+ } else if (!ft0cCollisionCourse (track1.eta (), track1.phi (), posZ))
1635+ continue ;
1636+
1637+ if (step >= CorrelationContainer::kCFStepTrackedOnlyPrim && !track1.isPhysicalPrimary ())
1638+ continue ;
1639+
1640+ if (step >= CorrelationContainer::kCFStepTrackedOnlyPrim && system == SameEvent)
1641+ registry.fill (HIST (" MCTrue/MCEtaTrueShape" ), track1.eta ());
1642+
1643+ if (system == SameEvent && doprocessMcSameTpcFt0c)
1644+ registry.fill (HIST (" MCTrue/MCTrig_hist" ), fSampleIndex , posZ, track1.pt (), eventWeight * triggerWeight);
1645+
1646+ // loop over all TPC tracks
1647+ for (auto const & track2 : tracks2) {
1648+
1649+ if (std::abs (track2.eta ()) > 0.9 )
1650+ continue ;
1651+
1652+ if (step >= CorrelationContainer::kCFStepTrackedOnlyPrim && !track2.isPhysicalPrimary ())
1653+ continue ;
1654+
1655+ if (track1.globalIndex () == track2.globalIndex ())
1656+ continue ; // For pt-differential correlations, skip if the trigger and associate are the same track
1657+
1658+ float deltaPhi = RecoDecay::constrainAngle (track2.phi () - track1.phi (), -PIHalf);
1659+ float deltaEta = track2.eta () - track1.eta ();
1660+
1661+ // fill the right sparse and histograms
1662+ if (system == SameEvent) {
1663+ same->getPairHist ()->Fill (step, fSampleIndex , posZ, track2.eta (), track1.eta (), deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight);
1664+ registry.fill (HIST (" MCTrue/MCdeltaEta_deltaPhi_same" ), deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight);
1665+ } else if (system == MixedEvent) {
1666+ mixed->getPairHist ()->Fill (step, fSampleIndex , posZ, track2.eta (), track1.eta (), deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight);
1667+ registry.fill (HIST (" MCTrue/MCdeltaEta_deltaPhi_mixed" ), deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight);
1668+ }
1669+ }
1670+ }
1671+ }
1672+
1673+ void processMcSameTpcFt0c (FilteredMcCollisions::iterator const & mcCollision, FilteredMcParticles const & mcParticles, SmallGroupMcCollisions const & collisions)
1674+ {
1675+ float cent = -1 ;
1676+ if (!cfgCentTableUnavailable) {
1677+ for (const auto & collision : collisions) {
1678+ cent = getCentrality (collision);
1679+ }
1680+ }
1681+
1682+ if (cfgSelCollByNch && (mcParticles.size () < cfgCutMultMin || mcParticles.size () >= cfgCutMultMax)) {
1683+ return ;
1684+ }
1685+ if (!cfgSelCollByNch && !cfgCentTableUnavailable && (cent < cfgCutCentMin || cent >= cfgCutCentMax)) {
1686+ return ;
1687+ }
1688+
1689+ registry.fill (HIST (" MCTrue/MCeventcount" ), SameEvent); // because its same event i put it in the 1 bin
1690+ if (!cfgCentTableUnavailable)
1691+ registry.fill (HIST (" MCTrue/MCCentrality" ), cent);
1692+ registry.fill (HIST (" MCTrue/MCNch" ), mcParticles.size ());
1693+ registry.fill (HIST (" MCTrue/MCzVtx" ), mcCollision.posZ ());
1694+ for (const auto & mcParticle : mcParticles) {
1695+ if (mcParticle.isPhysicalPrimary ()) {
1696+ registry.fill (HIST (" MCTrue/MCPhi" ), mcParticle.phi ());
1697+ registry.fill (HIST (" MCTrue/MCEta" ), mcParticle.eta ());
1698+ registry.fill (HIST (" MCTrue/MCpT" ), mcParticle.pt ());
1699+ }
1700+ }
1701+ if (cfgMcTrue.cfgUseCFStepAll ) {
1702+ same->fillEvent (mcParticles.size (), CorrelationContainer::kCFStepAll );
1703+ fillMCCorrelations<CorrelationContainer::kCFStepAll >(mcParticles, mcParticles, mcCollision.posZ (), SameEvent, 1 .0f );
1704+ }
1705+
1706+ registry.fill (HIST (" MCTrue/MCeventcount" ), 2.5 );
1707+ same->fillEvent (mcParticles.size (), CorrelationContainer::kCFStepTrackedOnlyPrim );
1708+ fillMCCorrelations<CorrelationContainer::kCFStepTrackedOnlyPrim >(mcParticles, mcParticles, mcCollision.posZ (), SameEvent, 1 .0f );
1709+ }
1710+ PROCESS_SWITCH (FlowDecorrelation, processMcSameTpcFt0c, " Process MC same event" , false );
1711+
1712+ void processMcMixed (FilteredMcCollisions const & mcCollisions, FilteredMcParticles const & mcParticles, SmallGroupMcCollisions const & collisions)
1713+ {
1714+ auto getTracksSize = [&mcParticles, this ](FilteredMcCollisions::iterator const & mcCollision) {
1715+ auto associatedTracks = mcParticles.sliceByCached (o2::aod::mcparticle::mcCollisionId, mcCollision.globalIndex (), this ->cache );
1716+ auto mult = associatedTracks.size ();
1717+ return mult;
1718+ };
1719+
1720+ using MixedBinning = FlexibleBinningPolicy<std::tuple<decltype (getTracksSize)>, o2::aod::mccollision::PosZ, decltype (getTracksSize)>;
1721+
1722+ MixedBinning binningOnVtxAndMult{{getTracksSize}, {axisVtxMix, axisMultMix}, true };
1723+
1724+ auto tracksTuple = std::make_tuple (mcParticles, mcParticles);
1725+ Pair<FilteredMcCollisions, FilteredMcParticles, FilteredMcParticles, MixedBinning> pairs{binningOnVtxAndMult, cfgMixEventNumMin, -1 , mcCollisions, tracksTuple, &cache}; // -1 is the number of the bin to skip
1726+ for (auto it = pairs.begin (); it != pairs.end (); it++) {
1727+ auto & [collision1, tracks1, collision2, tracks2] = *it;
1728+
1729+ if (cfgSelCollByNch && (tracks1.size () < cfgCutMultMin || tracks1.size () >= cfgCutMultMax))
1730+ continue ;
1731+
1732+ if (cfgSelCollByNch && (tracks2.size () < cfgCutMultMin || tracks2.size () >= cfgCutMultMax))
1733+ continue ;
1734+
1735+ auto groupedCollisions = collisions.sliceBy (collisionPerMCCollision, collision1.globalIndex ());
1736+
1737+ float cent = -1 ;
1738+ if (!cfgCentTableUnavailable) {
1739+ for (const auto & collision : groupedCollisions) {
1740+ cent = getCentrality (collision);
1741+ }
1742+ }
1743+
1744+ if (!cfgSelCollByNch && !cfgCentTableUnavailable && (cent < cfgCutCentMin || cent >= cfgCutCentMax))
1745+ continue ;
1746+
1747+ registry.fill (HIST (" MCTrue/MCeventcount" ), MixedEvent); // fill the mixed event in the 3 bin
1748+ float eventWeight = 1 .0f ;
1749+ if (cfgUseEventWeights) {
1750+ eventWeight = 1 .0f / it.currentWindowNeighbours ();
1751+ }
1752+
1753+ if (cfgMcTrue.cfgUseCFStepAll ) {
1754+ fillMCCorrelations<CorrelationContainer::kCFStepAll >(tracks1, tracks2, collision1.posZ (), MixedEvent, eventWeight);
1755+ }
1756+
1757+ registry.fill (HIST (" MCTrue/MCeventcount" ), 4.5 );
1758+ fillMCCorrelations<CorrelationContainer::kCFStepTrackedOnlyPrim >(tracks1, tracks2, collision1.posZ (), MixedEvent, eventWeight);
1759+ }
1760+ }
1761+ PROCESS_SWITCH (FlowDecorrelation, processMcMixed, " Process MC mixed events" , false );
15611762};
15621763
15631764WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments