@@ -83,6 +83,14 @@ 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+ enum CentEstimator {
87+ kCentFT0C = 0 ,
88+ kCentFT0M ,
89+ kCentFT0CVariant1 ,
90+ kCentMFT ,
91+ kCentNGlobal
92+ };
93+
8694struct derivedlambdakzeroanalysis {
8795 HistogramRegistry histos{" Histos" , {}, OutputObjHandlingPolicy::AnalysisObject};
8896
@@ -96,6 +104,7 @@ struct derivedlambdakzeroanalysis {
96104
97105 Configurable<bool > doPPAnalysis{" doPPAnalysis" , false , " if in pp, set to true" };
98106 Configurable<std::string> irSource{" irSource" , " T0VTX" , " Estimator of the interaction rate (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)" };
107+ Configurable<int > centralityEstimator{" centralityEstimator" , kCentFT0C , " Run 3 centrality estimator (0:CentFT0C, 1:CentFT0M, 3:CentFT0CVariant1, 4:CentMFT, 5:CentNGlobal)" };
99108
100109 struct : ConfigurableGroup {
101110 Configurable<bool > requireSel8{" requireSel8" , true , " require sel8 event selection" };
@@ -273,7 +282,7 @@ struct derivedlambdakzeroanalysis {
273282 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" };
274283 ConfigurableAxis axisK0Mass{" axisK0Mass" , {200 , 0 .4f , 0 .6f }, " " };
275284 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" };
285+ 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 (%) " };
277286 ConfigurableAxis axisNch{" axisNch" , {500 , 0 .0f , +5000 .0f }, " Number of charged particles" };
278287 ConfigurableAxis axisIRBinning{" axisIRBinning" , {500 , 0 , 50 }, " Binning for the interaction rate (kHz)" };
279288
@@ -971,6 +980,25 @@ struct derivedlambdakzeroanalysis {
971980 histos.print ();
972981 }
973982
983+ // ______________________________________________________
984+ // Return slicing output
985+ template <typename TCollision>
986+ auto getCentralityRun3 (TCollision const & collision)
987+ {
988+ if (centralityEstimator == kCentFT0C )
989+ return collision.centFT0C ();
990+ else if (centralityEstimator == kCentFT0M )
991+ return collision.centFT0M ();
992+ else if (centralityEstimator == kCentFT0CVariant1 )
993+ return collision.centFT0CVariant1 ();
994+ else if (centralityEstimator == kCentMFT )
995+ return collision.centMFT ();
996+ else if (centralityEstimator == kCentNGlobal )
997+ return collision.centNGlobal ();
998+
999+ return -1 .f ;
1000+ }
1001+
9741002 // ______________________________________________________
9751003 // Return slicing output
9761004 template <bool run3, typename TCollisions>
@@ -1073,34 +1101,34 @@ struct derivedlambdakzeroanalysis {
10731101
10741102 // TOF PID in DeltaT
10751103 // Positive track
1076- if (std::fabs (v0.posTOFDeltaTLaPr ()) < v0Selections.maxDeltaTimeProton )
1104+ if (!posTrackExtra. hasTOF () || std::fabs (v0.posTOFDeltaTLaPr ()) < v0Selections.maxDeltaTimeProton )
10771105 BITSET (bitMap, selTOFDeltaTPositiveProtonLambda);
1078- if (std::fabs (v0.posTOFDeltaTLaPi ()) < v0Selections.maxDeltaTimePion )
1106+ if (!posTrackExtra. hasTOF () || std::fabs (v0.posTOFDeltaTLaPi ()) < v0Selections.maxDeltaTimePion )
10791107 BITSET (bitMap, selTOFDeltaTPositivePionLambda);
1080- if (std::fabs (v0.posTOFDeltaTK0Pi ()) < v0Selections.maxDeltaTimePion )
1108+ if (!posTrackExtra. hasTOF () || std::fabs (v0.posTOFDeltaTK0Pi ()) < v0Selections.maxDeltaTimePion )
10811109 BITSET (bitMap, selTOFDeltaTPositivePionK0Short);
10821110 // Negative track
1083- if (std::fabs (v0.negTOFDeltaTLaPr ()) < v0Selections.maxDeltaTimeProton )
1111+ if (!negTrackExtra. hasTOF () || std::fabs (v0.negTOFDeltaTLaPr ()) < v0Selections.maxDeltaTimeProton )
10841112 BITSET (bitMap, selTOFDeltaTNegativeProtonLambda);
1085- if (std::fabs (v0.negTOFDeltaTLaPi ()) < v0Selections.maxDeltaTimePion )
1113+ if (!negTrackExtra. hasTOF () || std::fabs (v0.negTOFDeltaTLaPi ()) < v0Selections.maxDeltaTimePion )
10861114 BITSET (bitMap, selTOFDeltaTNegativePionLambda);
1087- if (std::fabs (v0.negTOFDeltaTK0Pi ()) < v0Selections.maxDeltaTimePion )
1115+ if (!negTrackExtra. hasTOF () || std::fabs (v0.negTOFDeltaTK0Pi ()) < v0Selections.maxDeltaTimePion )
10881116 BITSET (bitMap, selTOFDeltaTNegativePionK0Short);
10891117
10901118 // TOF PID in NSigma
10911119 // Positive track
1092- if (std::fabs (v0.tofNSigmaLaPr ()) < v0Selections.tofPidNsigmaCutLaPr )
1120+ if (!posTrackExtra. hasTOF () || std::fabs (v0.tofNSigmaLaPr ()) < v0Selections.tofPidNsigmaCutLaPr )
10931121 BITSET (bitMap, selTOFNSigmaPositiveProtonLambda);
1094- if (std::fabs (v0.tofNSigmaALaPi ()) < v0Selections.tofPidNsigmaCutLaPi )
1122+ if (!posTrackExtra. hasTOF () || std::fabs (v0.tofNSigmaALaPi ()) < v0Selections.tofPidNsigmaCutLaPi )
10951123 BITSET (bitMap, selTOFNSigmaPositivePionLambda);
1096- if (std::fabs (v0.tofNSigmaK0PiPlus ()) < v0Selections.tofPidNsigmaCutK0Pi )
1124+ if (!posTrackExtra. hasTOF () || std::fabs (v0.tofNSigmaK0PiPlus ()) < v0Selections.tofPidNsigmaCutK0Pi )
10971125 BITSET (bitMap, selTOFNSigmaPositivePionK0Short);
10981126 // Negative track
1099- if (std::fabs (v0.tofNSigmaALaPr ()) < v0Selections.tofPidNsigmaCutLaPr )
1127+ if (!negTrackExtra. hasTOF () || std::fabs (v0.tofNSigmaALaPr ()) < v0Selections.tofPidNsigmaCutLaPr )
11001128 BITSET (bitMap, selTOFNSigmaNegativeProtonLambda);
1101- if (std::fabs (v0.tofNSigmaLaPi ()) < v0Selections.tofPidNsigmaCutLaPi )
1129+ if (!negTrackExtra. hasTOF () || std::fabs (v0.tofNSigmaLaPi ()) < v0Selections.tofPidNsigmaCutLaPi )
11021130 BITSET (bitMap, selTOFNSigmaNegativePionLambda);
1103- if (std::fabs (v0.tofNSigmaK0PiMinus ()) < v0Selections.tofPidNsigmaCutK0Pi )
1131+ if (!negTrackExtra. hasTOF () || std::fabs (v0.tofNSigmaK0PiMinus ()) < v0Selections.tofPidNsigmaCutK0Pi )
11041132 BITSET (bitMap, selTOFNSigmaNegativePionK0Short);
11051133
11061134 // ITS only tag
@@ -2016,7 +2044,7 @@ struct derivedlambdakzeroanalysis {
20162044 void fillReconstructedEventProperties (TCollision const & collision, float & centrality, float & collisionOccupancy, double & interactionRate, int & gapSide, int & selGapSide)
20172045 {
20182046 if constexpr (requires { collision.centFT0C (); }) { // check if we are in Run 3
2019- centrality = doPPAnalysis ? collision. centFT0M () : collision. centFT0C ( );
2047+ centrality = getCentralityRun3 ( collision);
20202048 collisionOccupancy = eventSelections.useFT0CbasedOccupancy ? collision.ft0cOccupancyInTimeRange () : collision.trackOccupancyInTimeRange ();
20212049 // Fetch interaction rate only if required (in order to limit ccdb calls)
20222050 interactionRate = !irSource.value .empty () ? rateFetcher.fetch (ccdb.service , collision.timestamp (), collision.runNumber (), irSource) * 1 .e -3 : -1 ;
@@ -2098,7 +2126,7 @@ struct derivedlambdakzeroanalysis {
20982126 if constexpr (run3) { // check if we are in Run 3
20992127 if (biggestNContribs < collision.multPVTotalContributors ()) {
21002128 biggestNContribs = collision.multPVTotalContributors ();
2101- centrality = doPPAnalysis ? collision. centFT0M () : collision. centFT0C ( );
2129+ centrality = getCentralityRun3 ( collision);
21022130 }
21032131 } else { // we are in Run 2: there should be only one collision in groupedCollisions
21042132 centrality = eventSelections.useSPDTrackletsCent ? collision.centRun2SPDTracklets () : collision.centRun2V0M ();
@@ -2337,7 +2365,7 @@ struct derivedlambdakzeroanalysis {
23372365 if (listBestCollisionIdx[mcCollision.globalIndex ()] > -1 ) {
23382366 auto collision = collisions.iteratorAt (listBestCollisionIdx[mcCollision.globalIndex ()]);
23392367 if constexpr (requires { collision.centFT0C (); }) { // check if we are in Run 3
2340- centrality = doPPAnalysis ? collision. centFT0M () : collision. centFT0C ( );
2368+ centrality = getCentralityRun3 ( collision);
23412369 } else { // no, we are in Run 2
23422370 centrality = eventSelections.useSPDTrackletsCent ? collision.centRun2SPDTracklets () : collision.centRun2V0M ();
23432371 }
@@ -2402,7 +2430,7 @@ struct derivedlambdakzeroanalysis {
24022430 if (listBestCollisionIdx[mcCollision.globalIndex ()] > -1 ) {
24032431 auto collision = collisions.iteratorAt (listBestCollisionIdx[mcCollision.globalIndex ()]);
24042432 if constexpr (requires { collision.centFT0C (); }) { // check if we are in Run 3
2405- centrality = doPPAnalysis ? collision. centFT0M () : collision. centFT0C ( );
2433+ centrality = getCentralityRun3 ( collision);
24062434 } else { // no, we are in Run 2
24072435 centrality = eventSelections.useSPDTrackletsCent ? collision.centRun2SPDTracklets () : collision.centRun2V0M ();
24082436 }
0 commit comments