@@ -84,6 +84,7 @@ struct LongrangecorrDerived {
8484 Configurable<int > cfgPidMask{" cfgPidMask" , 0 , " Selection bitmask for the TPC particle" };
8585 Configurable<int > cfgV0Mask{" cfgV0Mask" , 0 , " Selection bitmask for the V0 particle" };
8686 Configurable<float > cfgVtxCut{" cfgVtxCut" , 10 .0f , " Vertex Z range to consider" };
87+ Configurable<bool > isUseCentEst{" isUseCentEst" , false , " Centrality based classification" };
8788
8889 Configurable<float > cfgFv0Cut{" cfgFv0Cut" , 50 .0f , " FV0A threshold" };
8990 Configurable<float > cfgFt0aCut{" cfgFt0aCut" , 100 .0f , " FT0A threshold" };
@@ -163,6 +164,7 @@ struct LongrangecorrDerived {
163164 mixed.setObject (new CorrelationContainer (" mixedEvent" , " mixedEvent" , corrAxis, effAxis, userAxis));
164165
165166 histos.add (" hMultiplicity" , " hMultiplicity" , kTH1D , {axisMultiplicity});
167+ histos.add (" hCentrality" , " hCentrality" , kTH1D , {axisMultiplicity});
166168 histos.add (" hVertexZ" , " hVertexZ" , kTH1D , {axisVtxZ});
167169
168170 histos.add (" hGapSide" , " hGapSide" , kTH1I , {{5 , -0.5 , 4.5 }});
@@ -190,6 +192,9 @@ struct LongrangecorrDerived {
190192 void fillCollQA (TCollision const & col)
191193 {
192194 histos.fill (HIST (" hMultiplicity" ), col.multiplicity ());
195+ if constexpr (std::experimental::is_detected<HasCent, TCollision>::value) {
196+ histos.fill (HIST (" hCentrality" ), col.centrality ());
197+ }
193198 histos.fill (HIST (" hVertexZ" ), col.zvtx ());
194199 }
195200
@@ -246,6 +251,8 @@ struct LongrangecorrDerived {
246251 using HasUpc = decltype (std::declval<T&>().gapSide());
247252 template <class T >
248253 using HasFt0 = decltype (std::declval<T&>().channelID());
254+ template <class T >
255+ using HasCent = decltype (std::declval<T&>().centrality());
249256
250257 template <CorrelationContainer::CFStep step, typename TTarget, typename TTriggers, typename TAssocs>
251258 void fillCorrHist (TTarget target, TTriggers const & triggers, TAssocs const & assocs, bool mixing, float vz, float multiplicity, float eventWeight)
@@ -295,7 +302,15 @@ struct LongrangecorrDerived {
295302 return ;
296303 }
297304 fillCollQA (col);
298- fillCorrHist<CorrelationContainer::kCFStepReconstructed >(same, triggers, assocs, false , col.zvtx (), col.multiplicity (), 1.0 );
305+ auto multiplicity = 1 .0f ;
306+ if constexpr (std::experimental::is_detected<HasCent, TCollision>::value) {
307+ if (isUseCentEst)
308+ multiplicity = col.centrality ();
309+ else
310+ multiplicity = col.multiplicity ();
311+ } else
312+ multiplicity = col.multiplicity ();
313+ fillCorrHist<CorrelationContainer::kCFStepReconstructed >(same, triggers, assocs, false , col.zvtx (), multiplicity, 1.0 );
299314 } // process same
300315
301316 template <typename TCollision, typename ... TrackTypes>
@@ -309,7 +324,15 @@ struct LongrangecorrDerived {
309324 } else {
310325 (void )this ;
311326 }
312- return col.multiplicity ();
327+ auto multiplicity = 1 .0f ;
328+ if constexpr (std::experimental::is_detected<HasCent, TCollision>::value) {
329+ if (isUseCentEst)
330+ multiplicity = col.centrality ();
331+ else
332+ multiplicity = col.multiplicity ();
333+ } else
334+ multiplicity = col.multiplicity ();
335+ return multiplicity;
313336 };
314337 using MixedBinning = FlexibleBinningPolicy<std::tuple<decltype (getMultiplicity)>, aod::lrcorrcolltable::Zvtx, decltype (getMultiplicity)>;
315338 MixedBinning binningOnVtxAndMult{{getMultiplicity}, {axisVtxZME, axisMultME}, true };
@@ -325,7 +348,15 @@ struct LongrangecorrDerived {
325348 }
326349 }
327350 float eventweight = 1 .0f / it.currentWindowNeighbours ();
328- fillCorrHist<CorrelationContainer::kCFStepReconstructed >(mixed, tracks1, tracks2, true , col1.zvtx (), col1.multiplicity (), eventweight);
351+ auto multiplicity = 1 .0f ;
352+ if constexpr (std::experimental::is_detected<HasCent, TCollision>::value) {
353+ if (isUseCentEst)
354+ multiplicity = col1.centrality ();
355+ else
356+ multiplicity = col1.multiplicity ();
357+ } else
358+ multiplicity = col1.multiplicity ();
359+ fillCorrHist<CorrelationContainer::kCFStepReconstructed >(mixed, tracks1, tracks2, true , col1.zvtx (), multiplicity, eventweight);
329360 } // pair loop
330361 } // process mixed
331362
0 commit comments