4646#include " Framework/AnalysisTask.h"
4747#include " Framework/HistogramRegistry.h"
4848#include " Framework/O2DatabasePDGPlugin.h"
49+ #include " Framework/RunningWorkflowInfo.h"
4950#include " Framework/StepTHn.h"
5051#include " Framework/runDataProcessing.h"
5152#include " ReconstructionDataFormats/PID.h"
5859
5960#include < chrono>
6061#include < cstdio>
62+ #include < experimental/type_traits>
63+ #include < memory>
6164#include < string>
65+ #include < tuple>
6266#include < utility>
6367#include < vector>
6468
@@ -74,7 +78,6 @@ struct LongrangecorrDerived {
7478
7579 SliceCache cache;
7680 HistogramRegistry histos{" histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
77- Configurable<double > cfgSampleSize{" cfgSampleSize" , 10 , " Sample size for mixed event" };
7881 Configurable<int > cfgNmixedevent{" cfgNmixedevent" , 5 , " how many events are mixed" };
7982 Configurable<int > cfgPidMask{" cfgPidMask" , 0 , " Selection bitmask for the TPC particle" };
8083 Configurable<int > cfgV0Mask{" cfgV0Mask" , 0 , " Selection bitmask for the V0 particle" };
@@ -85,10 +88,7 @@ struct LongrangecorrDerived {
8588 ConfigurableAxis axisEtaTrig{" axisEtaTrig" , {40 , -1 ., 1 .}, " #eta trig axis" };
8689 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" };
8790 ConfigurableAxis axisPtAssoc{" axisPtAssoc" , {VARIABLE_WIDTH, 0.5 , 1.0 , 1.5 , 2.0 , 3.0 , 4.0 , 6.0 , 10.0 }, " pt assoc axis for histograms" };
88- ConfigurableAxis axisSample{" axisSample" , {cfgSampleSize, 0 , cfgSampleSize}, " sample axis for histograms" };
8991 ConfigurableAxis axisVtxZ{" axisVtxZ" , {40 , -20 , 20 }, " vertex axis" };
90- ConfigurableAxis channelFt0aAxis{" channelFt0aAxis" , {96 , 0.0 , 96.0 }, " FT0A channel" };
91- ConfigurableAxis amplitudeFt0a{" amplitudeFt0a" , {5000 , 0 , 10000 }, " FT0A amplitude" };
9292 ConfigurableAxis axisEtaAssoc{" axisEtaAssoc" , {96 , 3.5 , 4.9 }, " #eta assoc axis" };
9393 ConfigurableAxis axisDeltaPhi{" axisDeltaPhi" , {72 , -PIHalf, PIHalf * 3 }, " delta phi axis for histograms" };
9494 ConfigurableAxis axisDeltaEta{" axisDeltaEta" , {40 , -6 , -2 }, " delta eta axis for histograms" };
@@ -103,19 +103,33 @@ struct LongrangecorrDerived {
103103 OutputObj<CorrelationContainer> same{" sameEvent" };
104104 OutputObj<CorrelationContainer> mixed{" mixedEvent" };
105105
106+ using CollsTable = aod::CollLRTables;
107+ using TrksTable = aod::TrkLRTables;
108+ using MftTrksTable = aod::MftTrkLRTables;
109+ using Ft0aTrksTable = aod::Ft0aLRTables;
110+ using Ft0cTrksTable = aod::Ft0cLRTables;
111+ using MftbestTrksTable = aod::MftBestTrkLRTables;
112+ using V0TrksTable = aod::V0TrkLRTables;
113+
114+ Preslice<TrksTable> perColTpc = aod::lrcorrtrktable::collLRTableId;
115+ Preslice<MftTrksTable> perColMft = aod::lrcorrtrktable::collLRTableId;
116+ Preslice<MftbestTrksTable> perColMftbest = aod::lrcorrtrktable::collLRTableId;
117+ Preslice<Ft0aTrksTable> perColFt0a = aod::lrcorrtrktable::collLRTableId;
118+ Preslice<Ft0cTrksTable> perColFt0c = aod::lrcorrtrktable::collLRTableId;
119+ Preslice<V0TrksTable> perColV0 = aod::lrcorrtrktable::collLRTableId;
120+
106121 void init (InitContext const &)
107122 {
108- std::vector<AxisSpec> corrAxis = {{axisSample , " Sample " },
109- {axisVtxZ , " z-vtx (cm) " },
123+ std::vector<AxisSpec> corrAxis = {{axisVtxZ , " z-vtx (cm) " },
124+ {axisMultiplicity , " multiplicity " },
110125 {axisPtTrigger, " p_{T} (GeV/c)" },
111126 {axisPtAssoc, " p_{T} (GeV/c)" },
112127 {axisDeltaPhi, " #Delta#varphi (rad)" },
113128 {axisDeltaEta, " #Delta#eta" }};
114129 std::vector<AxisSpec> effAxis = {{axisVertexEfficiency, " z-vtx (cm)" },
115130 {axisPtEfficiency, " p_{T} (GeV/c)" },
116131 {axisEtaEfficiency, " #eta" }};
117- std::vector<AxisSpec> userAxis = {{axisMultiplicity, " multiplicity" },
118- {axisInvMass, " m (GeV/c^2)" }};
132+ std::vector<AxisSpec> userAxis = {{axisInvMass, " m (GeV/c^2)" }};
119133
120134 same.setObject (new CorrelationContainer (" sameEvent" , " sameEvent" , corrAxis, effAxis, userAxis));
121135 mixed.setObject (new CorrelationContainer (" mixedEvent" , " mixedEvent" , corrAxis, effAxis, userAxis));
@@ -128,7 +142,7 @@ struct LongrangecorrDerived {
128142 histos.add (" Trig_phi" , " Trig_phi" , kTH1D , {axisPhi});
129143 histos.add (" Trig_etavsphi" , " Trig_etavsphi" , kTH2D , {axisPhi, axisEtaTrig});
130144 histos.add (" Trig_pt" , " Trig_pt" , kTH1D , {axisPtTrigger});
131- histos.add (" Trig_hist" , " Trig_hist" , kTHnSparseF , {axisSample, axisVtxZ, axisPtTrigger, axisMultiplicity , axisInvMass});
145+ histos.add (" Trig_hist" , " Trig_hist" , kTHnSparseF , {axisVtxZ, axisMultiplicity, axisPtTrigger , axisInvMass});
132146
133147 histos.add (" Assoc_eta" , " Assoc_eta" , kTH1D , {axisEtaAssoc});
134148 histos.add (" Assoc_phi" , " Assoc_phi" , kTH1D , {axisPhi});
@@ -174,7 +188,6 @@ struct LongrangecorrDerived {
174188 template <CorrelationContainer::CFStep step, typename TTarget, typename TTriggers, typename TAssocs>
175189 void fillCorrHist (TTarget target, TTriggers const & triggers, TAssocs const & assocs, bool mixing, float vz, float multiplicity, float eventWeight)
176190 {
177- int fSampleIndex = gRandom ->Uniform (0 , cfgSampleSize);
178191 for (auto const & triggerTrack : triggers) {
179192 if constexpr (std::experimental::is_detected<HasTpcTrack, typename TTriggers::iterator>::value) {
180193 if (cfgPidMask != 0 && (cfgPidMask & (1u << static_cast <uint32_t >(triggerTrack.trackType ()))) == 0u )
@@ -186,9 +199,9 @@ struct LongrangecorrDerived {
186199 if (!mixing) {
187200 fillTrigTrackQA (triggerTrack);
188201 if constexpr (std::experimental::is_detected<HasInvMass, typename TTriggers::iterator>::value) {
189- histos.fill (HIST (" Trig_hist" ), fSampleIndex , vz , triggerTrack.pt (), multiplicity , triggerTrack.invMass (), eventWeight);
202+ histos.fill (HIST (" Trig_hist" ), vz, multiplicity , triggerTrack.pt (), triggerTrack.invMass (), eventWeight);
190203 } else {
191- histos.fill (HIST (" Trig_hist" ), fSampleIndex , vz , triggerTrack.pt (), multiplicity , 1.0 , eventWeight);
204+ histos.fill (HIST (" Trig_hist" ), vz, multiplicity , triggerTrack.pt (), 1.0 , eventWeight);
192205 }
193206 }
194207 for (auto const & assoTrack : assocs) {
@@ -201,9 +214,9 @@ struct LongrangecorrDerived {
201214 histos.fill (HIST (" deltaEta_deltaPhi_mixed" ), deltaPhi, deltaEta);
202215 }
203216 if constexpr (std::experimental::is_detected<HasInvMass, typename TTriggers::iterator>::value) {
204- target->getPairHist ()->Fill (step, fSampleIndex , vz , triggerTrack.pt (), triggerTrack.pt (), deltaPhi, deltaEta, multiplicity , triggerTrack.invMass (), eventWeight);
217+ target->getPairHist ()->Fill (step, vz, multiplicity , triggerTrack.pt (), triggerTrack.pt (), deltaPhi, deltaEta, triggerTrack.invMass (), eventWeight);
205218 } else {
206- target->getPairHist ()->Fill (step, fSampleIndex , vz , triggerTrack.pt (), triggerTrack.pt (), deltaPhi, deltaEta, multiplicity, 0 . , eventWeight);
219+ target->getPairHist ()->Fill (step, vz, multiplicity , triggerTrack.pt (), triggerTrack.pt (), deltaPhi, deltaEta, 1.0 , eventWeight);
207220 }
208221 } // associated tracks
209222 } // trigger tracks
@@ -239,94 +252,94 @@ struct LongrangecorrDerived {
239252 } // pair loop
240253 } // process mixed
241254
242- void processTpcft0aSE (aod::CollLRTables:: iterator const & col, aod::TrkLRTables const & tracks, aod::Ft0aLRTables const & ft0as)
255+ void processTpcft0aSE (CollsTable:: iterator const & col, TrksTable const & tracks, Ft0aTrksTable const & ft0as)
243256 {
244257 processSame (col, tracks, ft0as);
245258 }
246259
247- void processTpcft0cSE (aod::CollLRTables:: iterator const & col, aod::TrkLRTables const & tracks, aod::Ft0cLRTables const & ft0cs)
260+ void processTpcft0cSE (CollsTable:: iterator const & col, TrksTable const & tracks, Ft0cTrksTable const & ft0cs)
248261 {
249262 processSame (col, tracks, ft0cs);
250263 }
251264
252- void processTpcmftSE (aod::CollLRTables:: iterator const & col, aod::TrkLRTables const & tracks, aod::MftTrkLRTables const & mfts)
265+ void processTpcmftSE (CollsTable:: iterator const & col, TrksTable const & tracks, MftTrksTable const & mfts)
253266 {
254267 processSame (col, tracks, mfts);
255268 }
256269
257- void processMftft0aSE (aod::CollLRTables:: iterator const & col, aod::MftTrkLRTables const & mfts, aod::Ft0aLRTables const & ft0as)
270+ void processMftft0aSE (CollsTable:: iterator const & col, MftTrksTable const & mfts, Ft0aTrksTable const & ft0as)
258271 {
259272 processSame (col, mfts, ft0as);
260273 }
261274
262- void processV0ft0aSE (aod::CollLRTables:: iterator const & col, aod::V0TrkLRTables const & tracks, aod::Ft0aLRTables const & ft0as)
275+ void processV0ft0aSE (CollsTable:: iterator const & col, V0TrksTable const & tracks, Ft0aTrksTable const & ft0as)
263276 {
264277 processSame (col, tracks, ft0as);
265278 }
266279
267- void processV0mftSE (aod::CollLRTables:: iterator const & col, aod::V0TrkLRTables const & tracks, aod::MftTrkLRTables const & mfts)
280+ void processV0mftSE (CollsTable:: iterator const & col, V0TrksTable const & tracks, MftTrksTable const & mfts)
268281 {
269282 processSame (col, tracks, mfts);
270283 }
271284
272- void processTpcmftbestSE (aod::CollLRTables:: iterator const & col, aod::TrkLRTables const & tracks, aod::MftBestTrkLRTables const & mfts)
285+ void processTpcmftbestSE (CollsTable:: iterator const & col, TrksTable const & tracks, MftbestTrksTable const & mfts)
273286 {
274287 processSame (col, tracks, mfts);
275288 }
276289
277- void processMftbestft0aSE (aod::CollLRTables:: iterator const & col, aod::MftBestTrkLRTables const & mfts, aod::Ft0aLRTables const & ft0as)
290+ void processMftbestft0aSE (CollsTable:: iterator const & col, MftbestTrksTable const & mfts, Ft0aTrksTable const & ft0as)
278291 {
279292 processSame (col, mfts, ft0as);
280293 }
281294
282- void processV0mftbestSE (aod::CollLRTables:: iterator const & col, aod::V0TrkLRTables const & tracks, aod::MftBestTrkLRTables const & mfts)
295+ void processV0mftbestSE (CollsTable:: iterator const & col, V0TrksTable const & tracks, MftbestTrksTable const & mfts)
283296 {
284297 processSame (col, tracks, mfts);
285298 }
286299
287- void processTpcft0aME (aod::CollLRTables const & col, aod::TrkLRTables const & tracks, aod::Ft0aLRTables const & ft0as)
300+ void processTpcft0aME (CollsTable const & cols, TrksTable const & tracks, Ft0aTrksTable const & ft0as)
288301 {
289- processMixed (col , tracks, ft0as);
302+ processMixed (cols , tracks, ft0as);
290303 }
291304
292- void processTpcft0cME (aod::CollLRTables const & col, aod::TrkLRTables const & tracks, aod::Ft0cLRTables const & ft0cs)
305+ void processTpcft0cME (CollsTable const & cols, TrksTable const & tracks, Ft0cTrksTable const & ft0cs)
293306 {
294- processMixed (col , tracks, ft0cs);
307+ processMixed (cols , tracks, ft0cs);
295308 }
296309
297- void processTpcmftME (aod::CollLRTables const & col, aod::TrkLRTables const & tracks, aod::MftTrkLRTables const & mfts)
310+ void processTpcmftME (CollsTable const & cols, TrksTable const & tracks, MftTrksTable const & mfts)
298311 {
299- processMixed (col , tracks, mfts);
312+ processMixed (cols , tracks, mfts);
300313 }
301314
302- void processMftft0aME (aod::CollLRTables const & col, aod::MftTrkLRTables const & mfts, aod::Ft0aLRTables const & ft0as)
315+ void processMftft0aME (CollsTable const & cols, MftTrksTable const & mfts, Ft0aTrksTable const & ft0as)
303316 {
304- processMixed (col , mfts, ft0as);
317+ processMixed (cols , mfts, ft0as);
305318 }
306319
307- void processV0ft0aME (aod::CollLRTables const & col, aod::V0TrkLRTables const & tracks, aod::Ft0aLRTables const & ft0as)
320+ void processV0ft0aME (CollsTable const & cols, V0TrksTable const & tracks, Ft0aTrksTable const & ft0as)
308321 {
309- processMixed (col , tracks, ft0as);
322+ processMixed (cols , tracks, ft0as);
310323 }
311324
312- void processV0mftME (aod::CollLRTables const & col, aod::V0TrkLRTables const & tracks, aod::MftTrkLRTables const & mfts)
325+ void processV0mftME (CollsTable const & cols, V0TrksTable const & tracks, MftTrksTable const & mfts)
313326 {
314- processMixed (col , tracks, mfts);
327+ processMixed (cols , tracks, mfts);
315328 }
316329
317- void processTpcmftbestME (aod::CollLRTables const & col, aod::TrkLRTables const & tracks, aod::MftBestTrkLRTables const & mfts)
330+ void processTpcmftbestME (CollsTable const & cols, TrksTable const & tracks, MftbestTrksTable const & mfts)
318331 {
319- processMixed (col , tracks, mfts);
332+ processMixed (cols , tracks, mfts);
320333 }
321334
322- void processMftbestft0aME (aod::CollLRTables const & col, aod::MftBestTrkLRTables const & mfts, aod::Ft0aLRTables const & ft0as)
335+ void processMftbestft0aME (CollsTable const & cols, MftbestTrksTable const & mfts, Ft0aTrksTable const & ft0as)
323336 {
324- processMixed (col , mfts, ft0as);
337+ processMixed (cols , mfts, ft0as);
325338 }
326339
327- void processV0mftbestME (aod::CollLRTables const & col, aod::V0TrkLRTables const & tracks, aod::MftBestTrkLRTables const & mfts)
340+ void processV0mftbestME (CollsTable const & cols, V0TrksTable const & tracks, MftbestTrksTable const & mfts)
328341 {
329- processMixed (col , tracks, mfts);
342+ processMixed (cols , tracks, mfts);
330343 }
331344
332345 PROCESS_SWITCH (LongrangecorrDerived, processTpcft0aSE, " same event TPC vs FT0A" , false );
0 commit comments