@@ -100,13 +100,24 @@ 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" );
107+ } cfgMftCuts;
108+ struct : ConfigurableGroup {
109+ O2_DEFINE_CONFIGURABLE (cfgRejectFT0AInside, bool , false , " Rejection of inner ring channels of the FT0A detector" )
110+ O2_DEFINE_CONFIGURABLE (cfgRejectFT0AOutside, bool , false , " Rejection of outer ring channels of the FT0A detector" )
111+ O2_DEFINE_CONFIGURABLE (cfgRejectFT0CInside, bool , false , " Rejection of inner ring channels of the FT0C detector" )
112+ O2_DEFINE_CONFIGURABLE (cfgRejectFT0COutside, bool , false , " Rejection of outer ring channels of the FT0C detector" );
113+ } cfgFt0RingRejections;
114+ struct : ConfigurableGroup {
115+ O2_DEFINE_CONFIGURABLE (cfgEtaTpcCut, float , 0 .8f , " Eta cut of TPC MC particles" )
116+ O2_DEFINE_CONFIGURABLE (cfgMinEtaFt0cCut, float , -3 .4f , " Min eta cut of FT0C MC particles" )
117+ O2_DEFINE_CONFIGURABLE (cfgMaxEtaFt0cCut, float , -2 .0f , " Max eta cut of FT0C MC particles" )
118+ O2_DEFINE_CONFIGURABLE (cfgUseFt0cStructure, bool , true , " Use the true structure of FT0C in MC-true" );
119+ O2_DEFINE_CONFIGURABLE (cfgUseCFStepAll, bool , true , " Use CFStepAll in addition to primry" );
120+ } cfgMcTrue;
110121 struct : ConfigurableGroup {
111122 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" );
112123 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 +158,8 @@ struct FlowDecorrelation {
147158 ConfigurableAxis axisDeltaEtaTpcFt0c{" axisDeltaEtaTpcFt0c" , {32 , 1.2 , 4.2 }, " delta eta axis, 1.2~4.2 for TPC-FT0C" };
148159 ConfigurableAxis axisDeltaEtaFt0aFt0c{" axisDeltaEtaFt0aFt0c" , {32 , 4.2 , 8.2 }, " delta eta axis, 4.2~8.2 for FT0A-FT0C" };
149160 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" };
161+ ConfigurableAxis axisDeltaEtaTpcFv0{" axisDeltaEtaTpcFv0" , {32 , -6.1 , -1.2 }, " delta eta axis for TPC-FV0 histograms" };
162+ 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" };
152163 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" };
153164 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" };
154165 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 +182,17 @@ struct FlowDecorrelation {
171182 using FilteredCollisions = soa::Filtered<soa::Join<aod::Collisions, aod::EvSel, aod::CentFT0Cs, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentFV0As, aod::Mults>>;
172183 using FilteredTracks = soa::Filtered<soa::Join<aod::Tracks, aod::TrackSelection, aod::TracksExtra, aod::TracksDCA>>;
173184
185+ 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);
186+ using FilteredMcParticles = soa::Filtered<aod::McParticles>;
187+
188+ // Filter for MCcollisions
189+ Filter mccollisionFilter = nabs(aod::mccollision::posZ) < cfgCutVtxZ;
190+ using FilteredMcCollisions = soa::Filtered<aod::McCollisions>;
191+
192+ using SmallGroupMcCollisions = soa::SmallGroups<soa::Join<aod::McCollisionLabels, aod::Collisions, aod::EvSel, aod::CentFT0Cs, aod::CentFT0CVariant1s, aod::CentFT0Ms, aod::CentFV0As, aod::Mults>>;
193+
194+ PresliceUnsorted<aod::McCollisionLabels> collisionPerMCCollision = aod::mccollisionlabel::mcCollisionId;
195+
174196 // FT0 geometry
175197 o2::ft0::Geometry ft0Det;
176198 o2::fv0::Geometry* fv0Det{};
@@ -243,6 +265,7 @@ struct FlowDecorrelation {
243265 const AxisSpec axisPhi{72 , 0.0 , constants::math::TwoPI, " #varphi" };
244266 const AxisSpec axisEta{40 , -1 ., 1 ., " #eta" };
245267 const AxisSpec axisEtaFull{90 , -4 ., 5 ., " #eta" };
268+ const AxisSpec axisCentrality{20 , 0 ., 100 ., " cent" };
246269
247270 ccdb->setURL (" http://alice-ccdb.cern.ch" );
248271 ccdb->setCaching (true );
@@ -268,7 +291,23 @@ struct FlowDecorrelation {
268291 registry.get <TH1>(HIST (" hEventCountSpecific" ))->GetXaxis ()->SetBinLabel (12 , " MultCorrelation" );
269292 registry.get <TH1>(HIST (" hEventCountSpecific" ))->GetXaxis ()->SetBinLabel (13 , " cfgEvSelV0AT0ACut" );
270293 }
271-
294+ if (doprocessMcSameTpcFt0c) {
295+ registry.add (" MCTrue/MCeventcount" , " MCeventcount" , {HistType::kTH1F , {{5 , 0 , 5 , " bin" }}}); // histogram to see how many events are in the same and mixed event
296+ registry.get <TH1>(HIST (" MCTrue/MCeventcount" ))->GetXaxis ()->SetBinLabel (2 , " same all" );
297+ registry.get <TH1>(HIST (" MCTrue/MCeventcount" ))->GetXaxis ()->SetBinLabel (3 , " same reco" );
298+ registry.get <TH1>(HIST (" MCTrue/MCeventcount" ))->GetXaxis ()->SetBinLabel (4 , " mixed all" );
299+ registry.get <TH1>(HIST (" MCTrue/MCeventcount" ))->GetXaxis ()->SetBinLabel (5 , " mixed reco" );
300+ registry.add (" MCTrue/MCCentrality" , " cent" , {HistType::kTH1D , {axisCentrality}});
301+ registry.add (" MCTrue/MCNch" , " N_{ch}" , {HistType::kTH1D , {axisMultiplicity}});
302+ registry.add (" MCTrue/MCzVtx" , " MCzVtx" , {HistType::kTH1D , {axisVertex}});
303+ registry.add (" MCTrue/MCPhi" , " MCPhi" , {HistType::kTH1D , {axisPhi}});
304+ registry.add (" MCTrue/MCEta" , " MCEta" , {HistType::kTH1D , {axisEtaFull}});
305+ registry.add (" MCTrue/MCEtaTrueShape" , " MCEta" , {HistType::kTH1D , {axisEtaFull}});
306+ registry.add (" MCTrue/MCpT" , " MCpT" , {HistType::kTH1D , {axisPtEfficiency}});
307+ registry.add (" MCTrue/MCTrig_hist" , " " , {HistType::kTHnSparseF , {{axisSample, axisVertex, axisPtEfficiency}}});
308+ registry.add (" MCTrue/MCdeltaEta_deltaPhi_same" , " " , {HistType::kTH2D , {axisDeltaPhi, axisDeltaEtaTpcFt0c}}); // check to see the delta eta and delta phi distribution
309+ registry.add (" MCTrue/MCdeltaEta_deltaPhi_mixed" , " " , {HistType::kTH2D , {axisDeltaPhi, axisDeltaEtaTpcFt0c}});
310+ }
272311 if (cfgEvSelMultCorrelation) {
273312 cfgFuncParas.multT0CCutPars = cfgFuncParas.cfgMultT0CCutPars ;
274313 cfgFuncParas.multPVT0CCutPars = cfgFuncParas.cfgMultPVT0CCutPars ;
@@ -421,20 +460,24 @@ struct FlowDecorrelation {
421460 same.setObject (new CorrelationContainer (" sameEvent_TPC_FV0" , " sameEvent_TPC_FV0" , corrAxisTpcFv0, effAxis, userAxis));
422461 mixed.setObject (new CorrelationContainer (" mixedEvent_TPC_FV0" , " mixedEvent_TPC_FV0" , corrAxisTpcFv0, effAxis, userAxis));
423462 }
463+ if (doprocessMcSameTpcFt0c) {
464+ same.setObject (new CorrelationContainer (" sameEvent_TPC_FV0" , " sameEvent_TPC_FV0" , corrAxisTpcFt0c, effAxis, userAxis));
465+ mixed.setObject (new CorrelationContainer (" mixedEvent_TPC_FV0" , " mixedEvent_TPC_FV0" , corrAxisTpcFt0c, effAxis, userAxis));
466+ }
424467 LOGF (info, " End of init" );
425468 }
426469
427470 template <typename TTrackAssoc>
428471 bool isAcceptedMftTrack (TTrackAssoc const & mftTrack)
429472 {
430473 // cut on the number of clusters of the reconstructed MFT track
431- if (mftTrack.nClusters () < nClustersMftTrack)
474+ if (mftTrack.nClusters () < cfgMftCuts. nClustersMftTrack )
432475 return false ;
433476
434- if (cfgCutChi2Mft > 0 . && mftTrack.chi2 () > cfgCutChi2Mft)
477+ if (cfgMftCuts. cfgCutChi2Mft > 0 . && mftTrack.chi2 () > cfgMftCuts. cfgCutChi2Mft )
435478 return false ;
436479
437- if (cfgCutTrackTimeMft > 0 . && std::abs (mftTrack.trackTime ()) > cfgCutTrackTimeMft)
480+ if (cfgMftCuts. cfgCutTrackTimeMft > 0 . && std::abs (mftTrack.trackTime ()) > cfgMftCuts. cfgCutTrackTimeMft )
438481 return false ;
439482
440483 return true ;
@@ -729,11 +772,11 @@ struct FlowDecorrelation {
729772 float ampl = 0 .;
730773 getChannel (ft0, iCh, chanelid, ampl, corType);
731774 if (corType == kFT0C ) {
732- if ((cfgRejectFT0CInside && (chanelid >= kFT0CInnerRingMin && chanelid <= kFT0CInnerRingMax )) || (cfgRejectFT0COutside && (chanelid >= kFT0COuterRingMin && chanelid <= kFT0COuterRingMax ))) {
775+ if ((cfgFt0RingRejections. cfgRejectFT0CInside && (chanelid >= kFT0CInnerRingMin && chanelid <= kFT0CInnerRingMax )) || (cfgFt0RingRejections. cfgRejectFT0COutside && (chanelid >= kFT0COuterRingMin && chanelid <= kFT0COuterRingMax ))) {
733776 continue ;
734777 }
735778 } else if (corType == kFT0A ) {
736- if ((cfgRejectFT0AInside && (chanelid >= kFT0AInnerRingMin && chanelid <= kFT0AInnerRingMax )) || (cfgRejectFT0AOutside && (chanelid >= kFT0AOuterRingMin && chanelid <= kFT0AOuterRingMax ))) {
779+ if ((cfgFt0RingRejections. cfgRejectFT0AInside && (chanelid >= kFT0AInnerRingMin && chanelid <= kFT0AInnerRingMax )) || (cfgFt0RingRejections. cfgRejectFT0AOutside && (chanelid >= kFT0AOuterRingMin && chanelid <= kFT0AOuterRingMax ))) {
737780 continue ;
738781 }
739782 }
@@ -786,7 +829,7 @@ struct FlowDecorrelation {
786829 int channelIdA = 0 ;
787830 float amplA = 0 .f ;
788831 getChannel (ft0Trig, iChA, channelIdA, amplA, kFT0A );
789- if ((cfgRejectFT0AInside && (channelIdA >= kFT0AInnerRingMin && channelIdA <= kFT0AInnerRingMax )) || (cfgRejectFT0AOutside && (channelIdA >= kFT0AOuterRingMin && channelIdA <= kFT0AOuterRingMax ))) {
832+ if ((cfgFt0RingRejections. cfgRejectFT0AInside && (channelIdA >= kFT0AInnerRingMin && channelIdA <= kFT0AInnerRingMax )) || (cfgFt0RingRejections. cfgRejectFT0AOutside && (channelIdA >= kFT0AOuterRingMin && channelIdA <= kFT0AOuterRingMax ))) {
790833 continue ;
791834 }
792835
@@ -801,7 +844,7 @@ struct FlowDecorrelation {
801844 int channelIdC = 0 ;
802845 float amplC = 0 .f ;
803846 getChannel (ft0Assoc, iChC, channelIdC, amplC, kFT0C );
804- if ((cfgRejectFT0CInside && (channelIdC >= kFT0CInnerRingMin && channelIdC <= kFT0CInnerRingMax )) || (cfgRejectFT0COutside && (channelIdC >= kFT0COuterRingMin && channelIdC <= kFT0COuterRingMax ))) {
847+ if ((cfgFt0RingRejections. cfgRejectFT0CInside && (channelIdC >= kFT0CInnerRingMin && channelIdC <= kFT0CInnerRingMax )) || (cfgFt0RingRejections. cfgRejectFT0COutside && (channelIdC >= kFT0COuterRingMin && channelIdC <= kFT0COuterRingMax ))) {
805848 continue ;
806849 }
807850
@@ -983,6 +1026,24 @@ struct FlowDecorrelation {
9831026 return 1 ;
9841027 }
9851028
1029+ bool ft0cCollisionCourse (float eta, float phi, float vtxZ)
1030+ {
1031+ double theta = 2 * std::atan (std::exp (-eta));
1032+ double vx = std::sin (theta) * std::cos (phi); // veloctiy component along x
1033+ double vy = std::sin (theta) * std::sin (phi); // veloctiy component along y
1034+ double vz = std::cos (theta); // veloctiy component along z
1035+
1036+ double x = vx * ((-83.44 - vtxZ) / vz); // location of particle on x at FT0C distance from vertex
1037+ double y = vy * ((-83.44 - vtxZ) / vz); // location of particle on x at FT0C distance from vertex
1038+
1039+ if (std::abs (x) < 24 && (std::abs (y) > 6.825 && std::abs (y) < 18.25 ))
1040+ return true ;
1041+ else if (std::abs (y) < 24 && (std::abs (x) > 6.675 && std::abs (x) < 18.175 ))
1042+ return true ;
1043+ else
1044+ return false ;
1045+ }
1046+
9861047 void processSameTpcFt0a (FilteredCollisions::iterator const & collision, FilteredTracks const & tracks, aod::FT0s const &, aod::BCsWithTimestamps const &)
9871048 {
9881049 if (!collision.sel8 ())
@@ -1558,6 +1619,149 @@ struct FlowDecorrelation {
15581619 }
15591620 }
15601621 PROCESS_SWITCH (FlowDecorrelation, processMixedTpcFv0, " Process mixed events for TPC-FV0 correlation" , false );
1622+
1623+ template <CorrelationContainer::CFStep step, typename TTracks, typename TTracksAssoc>
1624+ 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
1625+ {
1626+ int fSampleIndex = gRandom ->Uniform (0 , cfgSampleSize);
1627+
1628+ float triggerWeight = 1 .0f ;
1629+ float associatedWeight = 1 .0f ;
1630+ // loop over all FT0C tracks
1631+ for (auto const & track1 : tracks1) {
1632+
1633+ if (!cfgMcTrue.cfgUseFt0cStructure ) {
1634+ if (std::abs (track1.eta ()) < 0.9 )
1635+ continue ;
1636+ } else if (!ft0cCollisionCourse (track1.eta (), track1.phi (), posZ)) {
1637+ continue ;
1638+ }
1639+
1640+ if (step >= CorrelationContainer::kCFStepTrackedOnlyPrim && !track1.isPhysicalPrimary ())
1641+ continue ;
1642+
1643+ if (step >= CorrelationContainer::kCFStepTrackedOnlyPrim && system == SameEvent)
1644+ registry.fill (HIST (" MCTrue/MCEtaTrueShape" ), track1.eta ());
1645+
1646+ if (system == SameEvent && doprocessMcSameTpcFt0c)
1647+ registry.fill (HIST (" MCTrue/MCTrig_hist" ), fSampleIndex , posZ, track1.pt (), eventWeight * triggerWeight);
1648+
1649+ // loop over all TPC tracks
1650+ for (auto const & track2 : tracks2) {
1651+
1652+ if (std::abs (track2.eta ()) > 0.9 )
1653+ continue ;
1654+
1655+ if (step >= CorrelationContainer::kCFStepTrackedOnlyPrim && !track2.isPhysicalPrimary ())
1656+ continue ;
1657+
1658+ if (track1.globalIndex () == track2.globalIndex ())
1659+ continue ; // For pt-differential correlations, skip if the trigger and associate are the same track
1660+
1661+ float deltaPhi = RecoDecay::constrainAngle (track2.phi () - track1.phi (), -PIHalf);
1662+ float deltaEta = track2.eta () - track1.eta ();
1663+
1664+ // fill the right sparse and histograms
1665+ if (system == SameEvent) {
1666+ same->getPairHist ()->Fill (step, fSampleIndex , posZ, track2.eta (), track1.eta (), deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight);
1667+ registry.fill (HIST (" MCTrue/MCdeltaEta_deltaPhi_same" ), deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight);
1668+ } else if (system == MixedEvent) {
1669+ mixed->getPairHist ()->Fill (step, fSampleIndex , posZ, track2.eta (), track1.eta (), deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight);
1670+ registry.fill (HIST (" MCTrue/MCdeltaEta_deltaPhi_mixed" ), deltaPhi, deltaEta, eventWeight * triggerWeight * associatedWeight);
1671+ }
1672+ }
1673+ }
1674+ }
1675+
1676+ void processMcSameTpcFt0c (FilteredMcCollisions::iterator const & mcCollision, FilteredMcParticles const & mcParticles, SmallGroupMcCollisions const & collisions)
1677+ {
1678+ float cent = -1 ;
1679+ if (!cfgCentTableUnavailable) {
1680+ for (const auto & collision : collisions) {
1681+ cent = getCentrality (collision);
1682+ }
1683+ }
1684+
1685+ if (cfgSelCollByNch && (mcParticles.size () < cfgCutMultMin || mcParticles.size () >= cfgCutMultMax)) {
1686+ return ;
1687+ }
1688+ if (!cfgSelCollByNch && !cfgCentTableUnavailable && (cent < cfgCutCentMin || cent >= cfgCutCentMax)) {
1689+ return ;
1690+ }
1691+
1692+ registry.fill (HIST (" MCTrue/MCeventcount" ), SameEvent); // because its same event i put it in the 1 bin
1693+ if (!cfgCentTableUnavailable)
1694+ registry.fill (HIST (" MCTrue/MCCentrality" ), cent);
1695+ registry.fill (HIST (" MCTrue/MCNch" ), mcParticles.size ());
1696+ registry.fill (HIST (" MCTrue/MCzVtx" ), mcCollision.posZ ());
1697+ for (const auto & mcParticle : mcParticles) {
1698+ if (mcParticle.isPhysicalPrimary ()) {
1699+ registry.fill (HIST (" MCTrue/MCPhi" ), mcParticle.phi ());
1700+ registry.fill (HIST (" MCTrue/MCEta" ), mcParticle.eta ());
1701+ registry.fill (HIST (" MCTrue/MCpT" ), mcParticle.pt ());
1702+ }
1703+ }
1704+ if (cfgMcTrue.cfgUseCFStepAll ) {
1705+ same->fillEvent (mcParticles.size (), CorrelationContainer::kCFStepAll );
1706+ fillMCCorrelations<CorrelationContainer::kCFStepAll >(mcParticles, mcParticles, mcCollision.posZ (), SameEvent, 1 .0f );
1707+ }
1708+
1709+ registry.fill (HIST (" MCTrue/MCeventcount" ), 2.5 );
1710+ same->fillEvent (mcParticles.size (), CorrelationContainer::kCFStepTrackedOnlyPrim );
1711+ fillMCCorrelations<CorrelationContainer::kCFStepTrackedOnlyPrim >(mcParticles, mcParticles, mcCollision.posZ (), SameEvent, 1 .0f );
1712+ }
1713+ PROCESS_SWITCH (FlowDecorrelation, processMcSameTpcFt0c, " Process MC same event" , false );
1714+
1715+ void processMcMixed (FilteredMcCollisions const & mcCollisions, FilteredMcParticles const & mcParticles, SmallGroupMcCollisions const & collisions)
1716+ {
1717+ auto getTracksSize = [&mcParticles, this ](FilteredMcCollisions::iterator const & mcCollision) {
1718+ auto associatedTracks = mcParticles.sliceByCached (o2::aod::mcparticle::mcCollisionId, mcCollision.globalIndex (), this ->cache );
1719+ auto mult = associatedTracks.size ();
1720+ return mult;
1721+ };
1722+
1723+ using MixedBinning = FlexibleBinningPolicy<std::tuple<decltype (getTracksSize)>, o2::aod::mccollision::PosZ, decltype (getTracksSize)>;
1724+
1725+ MixedBinning binningOnVtxAndMult{{getTracksSize}, {axisVtxMix, axisMultMix}, true };
1726+
1727+ auto tracksTuple = std::make_tuple (mcParticles, mcParticles);
1728+ Pair<FilteredMcCollisions, FilteredMcParticles, FilteredMcParticles, MixedBinning> pairs{binningOnVtxAndMult, cfgMixEventNumMin, -1 , mcCollisions, tracksTuple, &cache}; // -1 is the number of the bin to skip
1729+ for (auto it = pairs.begin (); it != pairs.end (); it++) {
1730+ auto & [collision1, tracks1, collision2, tracks2] = *it;
1731+
1732+ if (cfgSelCollByNch && (tracks1.size () < cfgCutMultMin || tracks1.size () >= cfgCutMultMax))
1733+ continue ;
1734+
1735+ if (cfgSelCollByNch && (tracks2.size () < cfgCutMultMin || tracks2.size () >= cfgCutMultMax))
1736+ continue ;
1737+
1738+ auto groupedCollisions = collisions.sliceBy (collisionPerMCCollision, collision1.globalIndex ());
1739+
1740+ float cent = -1 ;
1741+ if (!cfgCentTableUnavailable) {
1742+ for (const auto & collision : groupedCollisions) {
1743+ cent = getCentrality (collision);
1744+ }
1745+ }
1746+
1747+ if (!cfgSelCollByNch && !cfgCentTableUnavailable && (cent < cfgCutCentMin || cent >= cfgCutCentMax))
1748+ continue ;
1749+
1750+ registry.fill (HIST (" MCTrue/MCeventcount" ), MixedEvent); // fill the mixed event in the 3 bin
1751+ float eventWeight = 1 .0f ;
1752+ if (cfgUseEventWeights) {
1753+ eventWeight = 1 .0f / it.currentWindowNeighbours ();
1754+ }
1755+
1756+ if (cfgMcTrue.cfgUseCFStepAll ) {
1757+ fillMCCorrelations<CorrelationContainer::kCFStepAll >(tracks1, tracks2, collision1.posZ (), MixedEvent, eventWeight);
1758+ }
1759+
1760+ registry.fill (HIST (" MCTrue/MCeventcount" ), 4.5 );
1761+ fillMCCorrelations<CorrelationContainer::kCFStepTrackedOnlyPrim >(tracks1, tracks2, collision1.posZ (), MixedEvent, eventWeight);
1762+ }
1763+ }
1764+ PROCESS_SWITCH (FlowDecorrelation, processMcMixed, " Process MC mixed events" , false );
15611765};
15621766
15631767WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
0 commit comments