@@ -104,17 +104,6 @@ auto static constexpr kMinFt0cCell = 96;
104104auto static constexpr kMinCharge = 3 .f;
105105AxisSpec axisEvent{10 , 0.5 , 9.5 , " #Event" , " EventAxis" };
106106
107- namespace o2 ::aod
108- {
109- namespace longrangemultclass
110- {
111- DECLARE_SOA_COLUMN (Multiplicity, multiplicity, float ); // ! Centrality/multiplicity value
112- } // namespace longrangemultclass
113- DECLARE_SOA_TABLE (LRMultTables, " AOD" , " LRMULTTABLE" , longrangemultclass::Multiplicity); // ! Transient multiplicity table
114-
115- using LRMultTable = LRMultTables::iterator;
116- } // namespace o2::aod
117-
118107struct LongrangeCorrelation {
119108
120109 struct : ConfigurableGroup {
@@ -159,8 +148,8 @@ struct LongrangeCorrelation {
159148 ConfigurableAxis axisDeltaEta{" axisDeltaEta" , {40 , -6 , -2 }, " delta eta axis for histograms" };
160149 ConfigurableAxis axisPtTrigger{" axisPtTrigger" , {VARIABLE_WIDTH, 0.5 , 1.0 , 1.5 , 2.0 , 3.0 , 4.0 , 6.0 , 10.0 }, " pt trigger axis for histograms" };
161150 ConfigurableAxis axisPtAssoc{" axisPtAssoc" , {VARIABLE_WIDTH, 0.5 , 1.0 , 1.5 , 2.0 , 3.0 , 4.0 , 6.0 , 10.0 }, " pt associated axis for histograms" };
162- ConfigurableAxis axisMultME{" axisMultME" , {VARIABLE_WIDTH, 0 , 5 , 10 , 15 , 20 , 25 , 30 , 35 , 40 , 50 , 60 , 80 , 100 }, " Mixing bins - multiplicity" };
163- ConfigurableAxis axisVtxZME{" axisVtxZME" , {VARIABLE_WIDTH, -10 , -9 , - 8 , -7 , - 6 , -5 , - 4 , -3 , - 2 , - 1 , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 }, " Mixing bins - z-vertex" };
151+ ConfigurableAxis axisMultME{" axisMultME" , {VARIABLE_WIDTH, 0 , 5 , 10 , 20 , 30 , 40 , 50 , 1000 }, " Mixing bins - multiplicity" };
152+ ConfigurableAxis axisVtxZME{" axisVtxZME" , {VARIABLE_WIDTH, -10 , -8 , -6 , -4 , -2 , 0 , 2 , 4 , 6 , 8 , 10 }, " Mixing bins - z-vertex" };
164153 ConfigurableAxis axisVertexEfficiency{" axisVertexEfficiency" , {10 , -10 , 10 }, " vertex axis for efficiency histograms" };
165154 ConfigurableAxis axisEtaEfficiency{" axisEtaEfficiency" , {20 , -1.0 , 1.0 }, " eta axis for efficiency histograms" };
166155 ConfigurableAxis axisPtEfficiency{" axisPtEfficiency" , {VARIABLE_WIDTH, 0.5 , 0.6 , 0.7 , 0.8 , 0.9 , 1.0 , 1.25 , 1.5 , 1.75 , 2.0 , 2.25 , 2.5 , 2.75 , 3.0 , 3.25 , 3.5 , 3.75 , 4.0 , 4.5 , 5.0 , 6.0 , 7.0 , 8.0 }, " pt axis for efficiency histograms" };
@@ -169,14 +158,20 @@ struct LongrangeCorrelation {
169158 ConfigurableAxis axisEtaTrig{" axisEtaTrig" , {40 , -1 ., 1 .}, " #eta trig axis" };
170159 ConfigurableAxis axisEtaAssoc{" axisEtaAssoc" , {96 , 3.5 , 4.9 }, " #eta assoc axis" };
171160 ConfigurableAxis axisSample{" axisSample" , {cfgSampleSize, 0 , cfgSampleSize}, " sample axis for histograms" };
172- ConfigurableAxis axisMultiplicity{" axisMultiplicity" , {VARIABLE_WIDTH, 0 , 5 , 10 , 15 , 20 , 25 , 30 , 35 , 40 , 50 , 60 , 80 , 100 }, " multiplicity / centrality axis for histograms" };
161+ ConfigurableAxis axisMultiplicity{" axisMultiplicity" , {VARIABLE_WIDTH, 0 , 10 , 15 , 25 , 50 , 60 , 1000 }, " multiplicity / centrality axis for histograms" };
173162 ConfigurableAxis amplitudeFt0a{" amplitudeFt0a" , {5000 , 0 , 10000 }, " FT0A amplitude" };
174163 ConfigurableAxis channelFt0aAxis{" channelFt0aAxis" , {96 , 0.0 , 96.0 }, " FT0A channel" };
175164
176- using CollTable = soa::Join<aod::Collisions, aod::EvSels, aod::LRMultTables>;
165+ Configurable<bool > isApplyCentFT0C{" isApplyCentFT0C" , true , " Centrality based on FT0C" };
166+ Configurable<bool > isApplyCentFV0A{" isApplyCentFV0A" , false , " Centrality based on FV0A" };
167+ Configurable<bool > isApplyCentFT0M{" isApplyCentFT0M" , false , " Centrality based on FT0A + FT0C" };
168+ Configurable<bool > isUseCentEst{" isUseCentEst" , false , " Centrality based classification" };
169+ Configurable<float > cfgPtCutMult{" cfgPtCutMult" , 3 .0f , " maximum track pT for multiplicity classification" };
170+
171+ using CollTable = soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs, aod::CentFV0As, aod::CentFT0Ms>;
177172 using TrksTable = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::pidTOFbeta, aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr>>;
178173 using MftTrkTable = soa::Filtered<aod::MFTTracks>;
179- using CollTableMC = soa::SmallGroups<soa::Join<aod::McCollisionLabels, aod::Collisions, aod::EvSels, aod::LRMultTables >>;
174+ using CollTableMC = soa::SmallGroups<soa::Join<aod::McCollisionLabels, aod::Collisions, aod::EvSels, aod::CentFT0Cs, aod::CentFV0As, aod::CentFT0Ms >>;
180175 using TrksTableMC = soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::McTrackLabels, aod::TrackSelection>>;
181176 Preslice<TrksTable> perColGlobal = aod::track::collisionId;
182177 Preslice<TrksTableMC> perColMC = aod::track::collisionId;
@@ -394,6 +389,35 @@ struct LongrangeCorrelation {
394389 }
395390 }
396391
392+ template <typename countTrk>
393+ int countNTracks (countTrk const & tracks)
394+ {
395+ auto nTrk = 0 ;
396+ for (const auto & track : tracks) {
397+ if (track.pt () < cfgPtCutMin || track.pt () > cfgPtCutMult) {
398+ continue ;
399+ }
400+ nTrk++;
401+ }
402+ return nTrk;
403+ }
404+
405+ template <typename CheckColCent>
406+ float selColCent (CheckColCent const & col)
407+ {
408+ auto cent = -1 ;
409+ if (isApplyCentFT0C) {
410+ cent = col.centFT0C ();
411+ }
412+ if (isApplyCentFV0A) {
413+ cent = col.centFV0A ();
414+ }
415+ if (isApplyCentFT0M) {
416+ cent = col.centFT0M ();
417+ }
418+ return cent;
419+ }
420+
397421 void loadEffCorrection (uint64_t timestamp)
398422 {
399423 if (fLoadTrkEffCorr ) {
@@ -785,7 +809,11 @@ struct LongrangeCorrelation {
785809 loadMultCorrection (bc.timestamp ());
786810 fillYieldTpc<kFT0AGLOBAL , kSE >(tracks);
787811 const auto & ft0 = col.foundFT0 ();
788- auto multiplicity = col.multiplicity ();
812+ auto multiplicity = 1 .0f ;
813+ if (isUseCentEst)
814+ multiplicity = selColCent (col);
815+ else
816+ multiplicity = countNTracks (tracks);
789817 float multw = getMultEffCorr (multiplicity);
790818 if (isUseEffCorr)
791819 multiplicity = multiplicity * multw;
@@ -807,7 +835,11 @@ struct LongrangeCorrelation {
807835 loadMultCorrection (bc.timestamp ());
808836 fillYieldTpc<kFT0CGLOBAL , kSE >(tracks);
809837 const auto & ft0 = col.foundFT0 ();
810- auto multiplicity = col.multiplicity ();
838+ auto multiplicity = 1 .0f ;
839+ if (isUseCentEst)
840+ multiplicity = selColCent (col);
841+ else
842+ multiplicity = countNTracks (tracks);
811843 float multw = getMultEffCorr (multiplicity);
812844 if (isUseEffCorr)
813845 multiplicity = multiplicity * multw;
@@ -827,7 +859,11 @@ struct LongrangeCorrelation {
827859 loadEffCorrection (bc.timestamp ());
828860 loadMultCorrection (bc.timestamp ());
829861 fillYieldTpc<kMFTGLOBAL , kSE >(tracks);
830- auto multiplicity = col.multiplicity ();
862+ auto multiplicity = 1 .0f ;
863+ if (isUseCentEst)
864+ multiplicity = selColCent (col);
865+ else
866+ multiplicity = countNTracks (tracks);
831867 float multw = getMultEffCorr (multiplicity);
832868 if (isUseEffCorr)
833869 multiplicity = multiplicity * multw;
@@ -837,7 +873,7 @@ struct LongrangeCorrelation {
837873 fillCorrMftGlobal<CorrelationContainer::kCFStepReconstructed >(sameMftGlobal, tracks, mfttracks, false , col.posZ (), multiplicity);
838874 } // same event
839875
840- void processFt0aMftSE (CollTable::iterator const & col, aod::FT0s const &, MftTrkTable const & mfttracks, aod::BCsWithTimestamps const &)
876+ void processFt0aMftSE (CollTable::iterator const & col, aod::FT0s const &, MftTrkTable const & mfttracks, TrksTable const & tracks, aod::BCsWithTimestamps const &)
841877 {
842878 if (!isEventSelected (col)) {
843879 return ;
@@ -847,7 +883,11 @@ struct LongrangeCorrelation {
847883 auto bc = col.bc_as <aod::BCsWithTimestamps>();
848884 loadMultCorrection (bc.timestamp ());
849885 const auto & ft0 = col.foundFT0 ();
850- auto multiplicity = col.multiplicity ();
886+ auto multiplicity = 1 .0f ;
887+ if (isUseCentEst)
888+ multiplicity = selColCent (col);
889+ else
890+ multiplicity = countNTracks (tracks);
851891 float multw = getMultEffCorr (multiplicity);
852892 if (isUseEffCorr)
853893 multiplicity = multiplicity * multw;
@@ -858,17 +898,21 @@ struct LongrangeCorrelation {
858898 }
859899 } // same event
860900
861- void processFt0aFt0cSE (CollTable::iterator const & col, aod::FT0s const &, aod::BCsWithTimestamps const &)
901+ void processFt0aFt0cSE (CollTable::iterator const & col, aod::FT0s const &, TrksTable const & tracks, aod::BCsWithTimestamps const &)
862902 {
863903 if (!isEventSelected (col)) {
864904 return ;
865905 }
866906 if (col.has_foundFT0 ()) {
867907 auto bc = col.bc_as <aod::BCsWithTimestamps>();
908+ const auto & ft0 = col.foundFT0 ();
868909 loadMultCorrection (bc.timestamp ());
869- auto multiplicity = col.multiplicity ();
910+ auto multiplicity = 1 .0f ;
911+ if (isUseCentEst)
912+ multiplicity = selColCent (col);
913+ else
914+ multiplicity = countNTracks (tracks);
870915 histos.fill (HIST (" Ft0aFt0c/SE/hMult" ), multiplicity);
871- const auto & ft0 = col.foundFT0 ();
872916 float multw = getMultEffCorr (multiplicity);
873917 if (isUseEffCorr)
874918 multiplicity = multiplicity * multw;
@@ -902,7 +946,11 @@ struct LongrangeCorrelation {
902946 auto slicedTriggerTracks = tracks.sliceBy (perColGlobal, col1.globalIndex ());
903947 fillYieldTpc<kFT0AGLOBAL , kME >(slicedTriggerTracks);
904948 const auto & ft0 = col2.foundFT0 ();
905- auto multiplicity = col1.multiplicity ();
949+ auto multiplicity = 1 .0f ;
950+ if (isUseCentEst)
951+ multiplicity = selColCent (col1);
952+ else
953+ multiplicity = countNTracks (slicedTriggerTracks);
906954 float multw = getMultEffCorr (multiplicity);
907955 if (isUseEffCorr)
908956 multiplicity = multiplicity * multw;
@@ -937,7 +985,11 @@ struct LongrangeCorrelation {
937985 auto slicedTriggerTracks = tracks.sliceBy (perColGlobal, col1.globalIndex ());
938986 fillYieldTpc<kFT0CGLOBAL , kME >(slicedTriggerTracks);
939987 const auto & ft0 = col2.foundFT0 ();
940- auto multiplicity = col1.multiplicity ();
988+ auto multiplicity = 1 .0f ;
989+ if (isUseCentEst)
990+ multiplicity = selColCent (col1);
991+ else
992+ multiplicity = countNTracks (slicedTriggerTracks);
941993 float multw = getMultEffCorr (multiplicity);
942994 if (isUseEffCorr)
943995 multiplicity = multiplicity * multw;
@@ -967,7 +1019,11 @@ struct LongrangeCorrelation {
9671019 auto bc = col1.bc_as <aod::BCsWithTimestamps>();
9681020 loadEffCorrection (bc.timestamp ());
9691021 loadMultCorrection (bc.timestamp ());
970- auto multiplicity = col1.multiplicity ();
1022+ auto multiplicity = 1 .0f ;
1023+ if (isUseCentEst)
1024+ multiplicity = selColCent (col1);
1025+ else
1026+ multiplicity = countNTracks (tracks1);
9711027 float multw = getMultEffCorr (multiplicity);
9721028 if (isUseEffCorr)
9731029 multiplicity = multiplicity * multw;
@@ -998,9 +1054,14 @@ struct LongrangeCorrelation {
9981054 auto bc = col1.bc_as <aod::BCsWithTimestamps>();
9991055 loadMultCorrection (bc.timestamp ());
10001056 auto slicedTriggerMftTracks = mfttracks.sliceBy (perColMft, col1.globalIndex ());
1057+ auto slicedTriggerTracks = tracks.sliceBy (perColGlobal, col1.globalIndex ());
10011058 fillYieldMft<kFT0AMFT , kME >(slicedTriggerMftTracks);
10021059 const auto & ft0 = col2.foundFT0 ();
1003- auto multiplicity = col1.multiplicity ();
1060+ auto multiplicity = 1 .0f ;
1061+ if (isUseCentEst)
1062+ multiplicity = selColCent (col1);
1063+ else
1064+ multiplicity = countNTracks (slicedTriggerTracks);
10041065 float multw = getMultEffCorr (multiplicity);
10051066 if (isUseEffCorr)
10061067 multiplicity = multiplicity * multw;
@@ -1031,7 +1092,12 @@ struct LongrangeCorrelation {
10311092 if (col1.has_foundFT0 () && col2.has_foundFT0 ()) {
10321093 auto bc = col1.bc_as <aod::BCsWithTimestamps>();
10331094 loadMultCorrection (bc.timestamp ());
1034- auto multiplicity = col1.multiplicity ();
1095+ auto slicedTriggerTracks = tracks.sliceBy (perColGlobal, col1.globalIndex ());
1096+ auto multiplicity = 1 .0f ;
1097+ if (isUseCentEst)
1098+ multiplicity = selColCent (col1);
1099+ else
1100+ multiplicity = countNTracks (slicedTriggerTracks);
10351101 histos.fill (HIST (" Ft0aFt0c/ME/hMult" ), multiplicity);
10361102 const auto & ft0a = col1.foundFT0 ();
10371103 const auto & ft0c = col2.foundFT0 ();
@@ -1085,7 +1151,12 @@ struct LongrangeCorrelation {
10851151 } else {
10861152 numcontributors = RecCol.numContrib ();
10871153 }
1088- multiplicity = RecCol.multiplicity ();
1154+ if (isUseCentEst)
1155+ multiplicity = selColCent (RecCol);
1156+ else {
1157+ auto recTracksPart = RecTracks.sliceBy (perColMC, RecCol.globalIndex ());
1158+ multiplicity = countNTracks (recTracksPart);
1159+ }
10891160 }
10901161
10911162 for (const auto & particle : GenParticles) {
@@ -1128,89 +1199,8 @@ struct LongrangeCorrelation {
11281199 PROCESS_SWITCH (LongrangeCorrelation, processEff, " Estimate efficiency" , false );
11291200};
11301201
1131- struct MultiplicityClassifier {
1132- Produces<aod::LRMultTables> multvalue;
1133- Configurable<float > cfgEtaCut{" cfgEtaCut" , 0 .8f , " Eta range to consider" };
1134- Configurable<float > dcaZ{" dcaZ" , 0 .2f , " Custom DCA Z cut (ignored if negative)" };
1135- Configurable<float > cfgPtCutMin{" cfgPtCutMin" , 0 .2f , " minimum accepted track pT" };
1136- Configurable<float > cfgPtCutMax{" cfgPtCutMax" , 3 .0f , " maximum accepted track pT" };
1137- HistogramRegistry histos{" histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
1138-
1139- Filter fTrackSelectionITS = ncheckbit(aod::track::v001::detectorMap, (uint8_t )o2::aod::track::ITS) &&
1140- ncheckbit (aod::track::trackCutFlag, TrackSelectionIts);
1141- Filter fTrackSelectionTPC = ifnode(ncheckbit(aod::track::v001::detectorMap, (uint8_t )o2::aod::track::TPC),
1142- ncheckbit (aod::track::trackCutFlag, TrackSelectionTpc), true );
1143- Filter fTrackSelectionDCA = ifnode(dcaZ.node() > 0 .f, nabs(aod::track::dcaZ) <= dcaZ && ncheckbit(aod::track::trackCutFlag, TrackSelectionDcaxyOnly),
1144- ncheckbit (aod::track::trackCutFlag, TrackSelectionDca));
1145- Filter fTracksEta = nabs(aod::track::eta) < cfgEtaCut;
1146- Filter fTracksPt = (aod::track::pt > cfgPtCutMin) && (aod::track::pt < cfgPtCutMax);
1147-
1148- void init (InitContext const &)
1149- {
1150- int enabledFunctions = 0 ;
1151- if (doprocessTracks) {
1152- histos.add (" htrackPt" , " htrackPt" , {HistType::kTH1F , {{10 , 0 ., 10 .}}});
1153- histos.add (" htrackMult" , " htrackMult" , {HistType::kTH1F , {{500 , 0 ., 500 .}}});
1154- enabledFunctions++;
1155- }
1156- if (doprocessFT0C) {
1157- histos.add (" hCentFt0c" , " hCentFt0c" , {HistType::kTH1F , {{100 , 0 ., 100 .}}});
1158- enabledFunctions++;
1159- }
1160- if (doprocessFV0A) {
1161- histos.add (" hCentFv0a" , " hCentFv0a" , {HistType::kTH1F , {{100 , 0 ., 100 .}}});
1162- enabledFunctions++;
1163- }
1164- if (doprocessFT0M) {
1165- histos.add (" hCentFt0m" , " hCentFt0m" , {HistType::kTH1F , {{100 , 0 ., 100 .}}});
1166- enabledFunctions++;
1167- }
1168- if (enabledFunctions != 1 ) {
1169- LOGP (fatal, " {} multiplicity classifier enabled but we need exactly 1." , enabledFunctions);
1170- }
1171- }
1172-
1173- void processTracks (aod::Collision const &, soa::Filtered<soa::Join<aod::Tracks, aod::TracksExtra, aod::TracksDCA, aod::TrackSelection>> const & tracks)
1174- {
1175- multvalue (tracks.size ());
1176- histos.fill (HIST (" htrackMult" ), tracks.size ());
1177- for (auto const & iTrk : tracks)
1178- histos.fill (HIST (" htrackPt" ), iTrk.pt ());
1179- }
1180-
1181- void processFT0C (aod::CentFT0Cs const & centralities)
1182- {
1183- for (auto const & c : centralities) {
1184- multvalue (c.centFT0C ());
1185- histos.fill (HIST (" hCentFt0c" ), c.centFT0C ());
1186- }
1187- }
1188-
1189- void processFV0A (aod::CentFV0As const & centralities)
1190- {
1191- for (auto const & c : centralities) {
1192- multvalue (c.centFV0A ());
1193- histos.fill (HIST (" hCentFv0a" ), c.centFV0A ());
1194- }
1195- }
1196-
1197- void processFT0M (aod::CentFT0Ms const & centralities)
1198- {
1199- for (auto const & c : centralities) {
1200- multvalue (c.centFT0M ());
1201- histos.fill (HIST (" hCentFt0m" ), c.centFT0M ());
1202- }
1203- }
1204-
1205- PROCESS_SWITCH (MultiplicityClassifier, processTracks, " Select track count as multiplicity" , false );
1206- PROCESS_SWITCH (MultiplicityClassifier, processFT0C, " Select FT0C centrality as multiplicity" , false );
1207- PROCESS_SWITCH (MultiplicityClassifier, processFV0A, " Select FV0A centrality as multiplicity" , false );
1208- PROCESS_SWITCH (MultiplicityClassifier, processFT0M, " Select FT0M centrality as multiplicity" , false );
1209- };
1210-
12111202WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
12121203{
12131204 return WorkflowSpec{
1214- adaptAnalysisTask<LongrangeCorrelation>(cfgc),
1215- adaptAnalysisTask<MultiplicityClassifier>(cfgc)};
1205+ adaptAnalysisTask<LongrangeCorrelation>(cfgc)};
12161206}
0 commit comments