@@ -83,6 +83,15 @@ using V0McCandidates = soa::Join<aod::V0CollRefs, aod::V0Cores, aod::V0Extras, a
8383#define BITSET (var, nbit ) ((var) |= (static_cast <uint64_t >(1 ) << static_cast <uint64_t >(nbit)))
8484#define BITCHECK (var, nbit ) ((var) & (static_cast <uint64_t >(1 ) << static_cast <uint64_t >(nbit)))
8585
86+
87+ enum CentEstimator {
88+ kCentFT0C = 0 ,
89+ kCentFT0M ,
90+ kCentFT0CVariant1 ,
91+ kCentMFT ,
92+ kCentNGlobal
93+ };
94+
8695struct derivedlambdakzeroanalysis {
8796 HistogramRegistry histos{" Histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
8897
@@ -96,6 +105,7 @@ struct derivedlambdakzeroanalysis {
96105
97106 Configurable<bool > doPPAnalysis{" doPPAnalysis" , false , " if in pp, set to true" };
98107 Configurable<std::string> irSource{" irSource" , " T0VTX" , " Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)" };
108+ Configurable<int > centralityEstimator{" centralityEstimator" , kCentFT0C , " Run 3 centrality estimator (0:CentFT0C, 1:CentFT0M, 3:CentFT0CVariant1, 4:CentMFT, 5:CentNGlobal)" };
99109
100110 struct : ConfigurableGroup {
101111 Configurable<bool > requireSel8{" requireSel8" , true , " require sel8 event selection" };
@@ -273,7 +283,7 @@ struct derivedlambdakzeroanalysis {
273283 ConfigurableAxis axisPtCoarse{" axisPtCoarse" , {VARIABLE_WIDTH, 0 .0f , 1 .0f , 2 .0f , 3 .0f , 4 .0f , 5 .0f , 7 .0f , 10 .0f , 15 .0f }, " pt axis for QA" };
274284 ConfigurableAxis axisK0Mass{" axisK0Mass" , {200 , 0 .4f , 0 .6f }, " " };
275285 ConfigurableAxis axisLambdaMass{" axisLambdaMass" , {200 , 1 .101f , 1 .131f }, " " };
276- ConfigurableAxis axisCentrality{" axisCentrality" , {VARIABLE_WIDTH, 0 .0f , 5 .0f , 10 .0f , 20 .0f , 30 .0f , 40 .0f , 50 .0f , 60 .0f , 70 .0f , 80 .0f , 90 .0f }, " Centrality" };
286+ ConfigurableAxis axisCentrality{" axisCentrality" , {VARIABLE_WIDTH, 0 .0f , 5 .0f , 10 .0f , 20 .0f , 30 .0f , 40 .0f , 50 .0f , 60 .0f , 70 .0f , 80 .0f , 90 .0f }, " Centrality (%) " };
277287 ConfigurableAxis axisNch{" axisNch" , {500 , 0 .0f , +5000 .0f }, " Number of charged particles" };
278288 ConfigurableAxis axisIRBinning{" axisIRBinning" , {500 , 0 , 50 }, " Binning for the interaction rate (kHz)" };
279289
@@ -971,6 +981,25 @@ struct derivedlambdakzeroanalysis {
971981 histos.print ();
972982 }
973983
984+ // ______________________________________________________
985+ // Return slicing output
986+ template <typename TCollision>
987+ auto getCentralityRun3 (TCollision const & collision)
988+ {
989+ if (centralityEstimator == kCentFT0C )
990+ return collision.centFT0C ();
991+ else if (centralityEstimator == kCentFT0M )
992+ return collision.centFT0M ();
993+ else if (centralityEstimator == kCentFT0CVariant1 )
994+ return collision.centFT0CVariant1 ();
995+ else if (centralityEstimator == kCentMFT )
996+ return collision.centMFT ();
997+ else if (centralityEstimator == kCentNGlobal )
998+ return collision.centNGlobal ();
999+
1000+ return -1 .f ;
1001+ }
1002+
9741003 // ______________________________________________________
9751004 // Return slicing output
9761005 template <bool run3, typename TCollisions>
@@ -2016,7 +2045,7 @@ struct derivedlambdakzeroanalysis {
20162045 void fillReconstructedEventProperties (TCollision const & collision, float & centrality, float & collisionOccupancy, double & interactionRate, int & gapSide, int & selGapSide)
20172046 {
20182047 if constexpr (requires { collision.centFT0C (); }) { // check if we are in Run 3
2019- centrality = doPPAnalysis ? collision. centFT0M () : collision. centFT0C ( );
2048+ centrality = getCentralityRun3 ( collision);
20202049 collisionOccupancy = eventSelections.useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange () : collision.trackOccupancyInTimeRange ();
20212050 // Fetch interaction rate only if required (in order to limit ccdb calls)
20222051 interactionRate = !irSource.value .empty () ? rateFetcher.fetch (ccdb.service , collision.timestamp (), collision.runNumber (), irSource) * 1 .e -3 : -1 ;
@@ -2098,7 +2127,7 @@ struct derivedlambdakzeroanalysis {
20982127 if constexpr (run3) { // check if we are in Run 3
20992128 if (biggestNContribs < collision.multPVTotalContributors ()) {
21002129 biggestNContribs = collision.multPVTotalContributors ();
2101- centrality = doPPAnalysis ? collision. centFT0M () : collision. centFT0C ( );
2130+ centrality = getCentralityRun3 ( collision);
21022131 }
21032132 } else { // we are in Run 2: there should be only one collision in groupedCollisions
21042133 centrality = eventSelections.useSPDTrackletsCent ? collision.centRun2SPDTracklets () : collision.centRun2V0M ();
@@ -2337,7 +2366,7 @@ struct derivedlambdakzeroanalysis {
23372366 if (listBestCollisionIdx[mcCollision.globalIndex ()] > -1 ) {
23382367 auto collision = collisions.iteratorAt (listBestCollisionIdx[mcCollision.globalIndex ()]);
23392368 if constexpr (requires { collision.centFT0C (); }) { // check if we are in Run 3
2340- centrality = doPPAnalysis ? collision. centFT0M () : collision. centFT0C ( );
2369+ centrality = getCentralityRun3 ( collision);
23412370 } else { // no, we are in Run 2
23422371 centrality = eventSelections.useSPDTrackletsCent ? collision.centRun2SPDTracklets () : collision.centRun2V0M ();
23432372 }
@@ -2402,7 +2431,7 @@ struct derivedlambdakzeroanalysis {
24022431 if (listBestCollisionIdx[mcCollision.globalIndex ()] > -1 ) {
24032432 auto collision = collisions.iteratorAt (listBestCollisionIdx[mcCollision.globalIndex ()]);
24042433 if constexpr (requires { collision.centFT0C (); }) { // check if we are in Run 3
2405- centrality = doPPAnalysis ? collision. centFT0M () : collision. centFT0C ( );
2434+ centrality = getCentralityRun3 ( collision);
24062435 } else { // no, we are in Run 2
24072436 centrality = eventSelections.useSPDTrackletsCent ? collision.centRun2SPDTracklets () : collision.centRun2V0M ();
24082437 }
0 commit comments