@@ -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,16 @@ 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+ }
314+ fillCorrHist<CorrelationContainer::kCFStepReconstructed >(same, triggers, assocs, false , col.zvtx (), multiplicity, 1.0 );
299315 } // process same
300316
301317 template <typename TCollision, typename ... TrackTypes>
@@ -309,7 +325,16 @@ struct LongrangecorrDerived {
309325 } else {
310326 (void )this ;
311327 }
312- return col.multiplicity ();
328+ auto multiplicity = 1 .0f ;
329+ if constexpr (std::experimental::is_detected<HasCent, TCollision>::value) {
330+ if (isUseCentEst)
331+ multiplicity = col.centrality ();
332+ else
333+ multiplicity = col.multiplicity ();
334+ } else {
335+ multiplicity = col.multiplicity ();
336+ }
337+ return multiplicity;
313338 };
314339 using MixedBinning = FlexibleBinningPolicy<std::tuple<decltype (getMultiplicity)>, aod::lrcorrcolltable::Zvtx, decltype (getMultiplicity)>;
315340 MixedBinning binningOnVtxAndMult{{getMultiplicity}, {axisVtxZME, axisMultME}, true };
@@ -325,7 +350,16 @@ struct LongrangecorrDerived {
325350 }
326351 }
327352 float eventweight = 1 .0f / it.currentWindowNeighbours ();
328- fillCorrHist<CorrelationContainer::kCFStepReconstructed >(mixed, tracks1, tracks2, true , col1.zvtx (), col1.multiplicity (), eventweight);
353+ auto multiplicity = 1 .0f ;
354+ if constexpr (std::experimental::is_detected<HasCent, TCollision>::value) {
355+ if (isUseCentEst)
356+ multiplicity = col1.centrality ();
357+ else
358+ multiplicity = col1.multiplicity ();
359+ } else {
360+ multiplicity = col1.multiplicity ();
361+ }
362+ fillCorrHist<CorrelationContainer::kCFStepReconstructed >(mixed, tracks1, tracks2, true , col1.zvtx (), multiplicity, eventweight);
329363 } // pair loop
330364 } // process mixed
331365
0 commit comments