@@ -40,54 +40,40 @@ using namespace o2::framework;
4040
4141MetadataHelper metadataInfo; // Metadata helper
4242
43- static constexpr int kRun2V0Ms = 0 ;
44- static constexpr int kRun2V0As = 1 ;
45- static constexpr int kRun2SPDTrks = 2 ;
46- static constexpr int kRun2SPDClss = 3 ;
47- static constexpr int kRun2CL0s = 4 ;
48- static constexpr int kRun2CL1s = 5 ;
49- static constexpr int kFV0As = 6 ;
50- static constexpr int kFT0Ms = 7 ;
51- static constexpr int kFT0As = 8 ;
52- static constexpr int kFT0Cs = 9 ;
53- static constexpr int kFT0CVariant1s = 10 ;
54- static constexpr int kFDDMs = 11 ;
55- static constexpr int kNTPVs = 12 ;
56- static constexpr int kNGlobals = 13 ;
57- static constexpr int kMFTs = 14 ;
43+ static constexpr int kCentRun2V0Ms = 0 ;
44+ static constexpr int kCentRun2V0As = 1 ;
45+ static constexpr int kCentRun2SPDTrks = 2 ;
46+ static constexpr int kCentRun2SPDClss = 3 ;
47+ static constexpr int kCentRun2CL0s = 4 ;
48+ static constexpr int kCentRun2CL1s = 5 ;
49+ static constexpr int kCentFV0As = 6 ;
50+ static constexpr int kCentFT0Ms = 7 ;
51+ static constexpr int kCentFT0As = 8 ;
52+ static constexpr int kCentFT0Cs = 9 ;
53+ static constexpr int kCentFT0CVariant1s = 10 ;
54+ static constexpr int kCentFDDMs = 11 ;
55+ static constexpr int kCentNTPVs = 12 ;
56+ static constexpr int kCentNGlobals = 13 ;
57+ static constexpr int kCentMFTs = 14 ;
5858static constexpr int NTables = 15 ;
59- static constexpr int kNParameters = 1 ;
60- static const std::vector<std::string> tableNamesCentrality {" CentRun2V0Ms" , // 0
61- " CentRun2V0As" , // 1
62- " CentRun2SPDTrks" , // 2
63- " CentRun2SPDClss" , // 3
64- " CentRun2CL0s" , // 4
65- " CentRun2CL1s" , // 5
66- " CentFV0As" , // 6
67- " CentFT0Ms" , // 7
68- " CentFT0As" , // 8
69- " CentFT0Cs" , // 9
70- " CentFT0CVariant1s" , // 10
71- " CentFDDMs" , // 11
72- " CentNTPVs" , // 12
73- " CentNGlobals" , // 13
59+ static constexpr int NParameters = 1 ;
60+ static const std::vector<std::string> tableNames {" CentRun2V0Ms" ,
61+ " CentRun2V0As" ,
62+ " CentRun2SPDTrks" ,
63+ " CentRun2SPDClss" ,
64+ " CentRun2CL0s" ,
65+ " CentRun2CL1s" ,
66+ " CentFV0As" ,
67+ " CentFT0Ms" ,
68+ " CentFT0As" ,
69+ " CentFT0Cs" ,
70+ " CentFT0CVariant1s" ,
71+ " CentFDDMs" ,
72+ " CentNTPVs" ,
73+ " CentNGlobals" ,
7474 " CentMFTs" };
75- static const std::vector<std::string> tableNamesMultiplicity{" FV0Mults" , // 0
76- " FT0Mults" , // 1
77- " FDDMults" , // 2
78- " ZDCMults" , // 3
79- " TrackletMults" , // 4
80- " TPCMults" , // 5
81- " PVMults" , // 6
82- " MultsExtra" , // 7
83- " MultSelections" , // 8
84- " FV0MultZeqs" , // 9
85- " FT0MultZeqs" , // 10
86- " FDDMultZeqs" , // 11
87- " PVMultZeqs" , // 12
88- " MultMCExtras" }; // 13
8975static const std::vector<std::string> parameterNames{" Enable" };
90- static const int defaultParameters[NTables][kNParameters ]{{-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }};
76+ static const int defaultParameters[NTables][NParameters ]{{-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }, {-1 }};
9177
9278struct CentralityTable {
9379 Produces<aod::CentRun2V0Ms> centRun2V0M;
@@ -106,8 +92,8 @@ struct CentralityTable {
10692 Produces<aod::CentNGlobals> centNGlobals;
10793 Produces<aod::CentMFTs> centMFTs;
10894 Service<o2::ccdb::BasicCCDBManager> ccdb;
109- Configurable<LabeledArray<int >> enabledCentralityTables{ " enabledCentralityTables " ,
110- {defaultParameters[0 ], NTables, kNParameters , tableNamesCentrality , parameterNames},
95+ Configurable<LabeledArray<int >> enabledTables{ " enabledTables " ,
96+ {defaultParameters[0 ], NTables, NParameters, tableNames , parameterNames},
11197 " Produce tables depending on needs. Values different than -1 override the automatic setup: the corresponding table can be set off (0) or on (1)" };
11298 struct : ConfigurableGroup {
11399 Configurable<std::string> ccdbUrl{" ccdbUrl" , " http://alice-ccdb.cern.ch" , " The CCDB endpoint url address" };
@@ -218,16 +204,16 @@ struct CentralityTable {
218204
219205 /* Checking the tables which are requested in the workflow and enabling them */
220206 for (int i = 0 ; i < NTables; i++) {
221- int f = enabledCentralityTables ->get (tableNamesCentrality [i].c_str (), " Enable" );
222- enableFlagIfTableRequired (context, tableNamesCentrality [i], f);
207+ int f = enabledTables ->get (tableNames [i].c_str (), " Enable" );
208+ enableFlagIfTableRequired (context, tableNames [i], f);
223209 if (f == 1 ) {
224- if (tableNamesCentrality [i].find (" Run2" ) != std::string::npos) {
210+ if (tableNames [i].find (" Run2" ) != std::string::npos) {
225211 if (doprocessRun3) {
226- LOG (fatal) << " Cannot enable Run2 table `" << tableNamesCentrality [i] << " ` while running in Run3 mode. Please check and disable them." ;
212+ LOG (fatal) << " Cannot enable Run2 table `" << tableNames [i] << " ` while running in Run3 mode. Please check and disable them." ;
227213 }
228214 } else {
229215 if (doprocessRun2) {
230- LOG (fatal) << " Cannot enable Run3 table `" << tableNamesCentrality [i] << " ` while running in Run2 mode. Please check and disable them." ;
216+ LOG (fatal) << " Cannot enable Run3 table `" << tableNames [i] << " ` while running in Run2 mode. Please check and disable them." ;
231217 }
232218 }
233219 isTableEnabled[i] = true ;
@@ -241,7 +227,7 @@ struct CentralityTable {
241227 std::sort (mEnabledTables .begin (), mEnabledTables .end ());
242228
243229 // Check if FT0 is the only centrality needed
244- if (mEnabledTables .size () == 1 && isTableEnabled[kFT0Ms ] == true ) {
230+ if (mEnabledTables .size () == 1 && isTableEnabled[kCentFT0Ms ] == true ) {
245231 LOG (info) << " FT0 only mode is enabled" ;
246232 doprocessRun3FT0.value = true ;
247233 doprocessRun3.value = false ;
@@ -315,7 +301,7 @@ struct CentralityTable {
315301 TFormula* f = reinterpret_cast <TFormula*>(callst->FindObject (ccdbhname));
316302 return f;
317303 };
318- if (isTableEnabled[kRun2V0Ms ]) {
304+ if (isTableEnabled[kCentRun2V0Ms ]) {
319305 LOGF (debug, " Getting new histograms with %d run number for %d run number" , mRunNumber , bc.runNumber ());
320306 Run2V0MInfo.mhVtxAmpCorrV0A = getccdb (" hVtx_fAmplitude_V0A_Normalized" );
321307 Run2V0MInfo.mhVtxAmpCorrV0C = getccdb (" hVtx_fAmplitude_V0C_Normalized" );
@@ -344,7 +330,7 @@ struct CentralityTable {
344330 }
345331 }
346332 }
347- if (isTableEnabled[kRun2V0As ]) {
333+ if (isTableEnabled[kCentRun2V0As ]) {
348334 LOGF (debug, " Getting new histograms with %d run number for %d run number" , mRunNumber , bc.runNumber ());
349335 Run2V0AInfo.mhVtxAmpCorrV0A = getccdb (" hVtx_fAmplitude_V0A_Normalized" );
350336 Run2V0AInfo.mhMultSelCalib = getccdb (" hMultSelCalib_V0A" );
@@ -358,7 +344,7 @@ struct CentralityTable {
358344 }
359345 }
360346 }
361- if (isTableEnabled[kRun2SPDTrks ]) {
347+ if (isTableEnabled[kCentRun2SPDTrks ]) {
362348 LOGF (debug, " Getting new histograms with %d run number for %d run number" , mRunNumber , bc.runNumber ());
363349 Run2SPDTksInfo.mhVtxAmpCorr = getccdb (" hVtx_fnTracklets_Normalized" );
364350 Run2SPDTksInfo.mhMultSelCalib = getccdb (" hMultSelCalib_SPDTracklets" );
@@ -372,7 +358,7 @@ struct CentralityTable {
372358 }
373359 }
374360 }
375- if (isTableEnabled[kRun2SPDClss ]) {
361+ if (isTableEnabled[kCentRun2SPDClss ]) {
376362 LOGF (debug, " Getting new histograms with %d run number for %d run number" , mRunNumber , bc.runNumber ());
377363 Run2SPDClsInfo.mhVtxAmpCorrCL0 = getccdb (" hVtx_fnSPDClusters0_Normalized" );
378364 Run2SPDClsInfo.mhVtxAmpCorrCL1 = getccdb (" hVtx_fnSPDClusters1_Normalized" );
@@ -387,7 +373,7 @@ struct CentralityTable {
387373 }
388374 }
389375 }
390- if (isTableEnabled[kRun2CL0s ]) {
376+ if (isTableEnabled[kCentRun2CL0s ]) {
391377 LOGF (debug, " Getting new histograms with %d run number for %d run number" , mRunNumber , bc.runNumber ());
392378 Run2CL0Info.mhVtxAmpCorr = getccdb (" hVtx_fnSPDClusters0_Normalized" );
393379 Run2CL0Info.mhMultSelCalib = getccdb (" hMultSelCalib_CL0" );
@@ -401,7 +387,7 @@ struct CentralityTable {
401387 }
402388 }
403389 }
404- if (isTableEnabled[kRun2CL1s ]) {
390+ if (isTableEnabled[kCentRun2CL1s ]) {
405391 LOGF (debug, " Getting new histograms with %d run number for %d run number" , mRunNumber , bc.runNumber ());
406392 Run2CL1Info.mhVtxAmpCorr = getccdb (" hVtx_fnSPDClusters1_Normalized" );
407393 Run2CL1Info.mhMultSelCalib = getccdb (" hMultSelCalib_CL1" );
@@ -428,7 +414,7 @@ struct CentralityTable {
428414 return std::pow (((pars[0 ] + pars[1 ] * std::pow (x, pars[2 ])) - pars[3 ]) / pars[4 ], 1 .0f / pars[5 ]);
429415 };
430416
431- if (isTableEnabled[kRun2V0Ms ]) {
417+ if (isTableEnabled[kCentRun2V0Ms ]) {
432418 float cV0M = 105 .0f ;
433419 if (Run2V0MInfo.mCalibrationStored ) {
434420 float v0m;
@@ -445,7 +431,7 @@ struct CentralityTable {
445431 // fill centrality columns
446432 centRun2V0M (cV0M);
447433 }
448- if (isTableEnabled[kRun2V0As ]) {
434+ if (isTableEnabled[kCentRun2V0As ]) {
449435 float cV0A = 105 .0f ;
450436 if (Run2V0AInfo.mCalibrationStored ) {
451437 float v0a = collision.multFV0A () * Run2V0AInfo.mhVtxAmpCorrV0A ->GetBinContent (Run2V0AInfo.mhVtxAmpCorrV0A ->FindFixBin (collision.posZ ()));
@@ -455,7 +441,7 @@ struct CentralityTable {
455441 // fill centrality columns
456442 centRun2V0A (cV0A);
457443 }
458- if (isTableEnabled[kRun2SPDTrks ]) {
444+ if (isTableEnabled[kCentRun2SPDTrks ]) {
459445 float cSPD = 105 .0f ;
460446 if (Run2SPDTksInfo.mCalibrationStored ) {
461447 float spdm = collision.multTracklets () * Run2SPDTksInfo.mhVtxAmpCorr ->GetBinContent (Run2SPDTksInfo.mhVtxAmpCorr ->FindFixBin (collision.posZ ()));
@@ -464,7 +450,7 @@ struct CentralityTable {
464450 LOGF (debug, " centSPDTracklets=%.0f" , cSPD);
465451 centRun2SPDTracklets (cSPD);
466452 }
467- if (isTableEnabled[kRun2SPDClss ]) {
453+ if (isTableEnabled[kCentRun2SPDClss ]) {
468454 float cSPD = 105 .0f ;
469455 if (Run2SPDClsInfo.mCalibrationStored ) {
470456 float spdm = bc.spdClustersL0 () * Run2SPDClsInfo.mhVtxAmpCorrCL0 ->GetBinContent (Run2SPDClsInfo.mhVtxAmpCorrCL0 ->FindFixBin (collision.posZ ())) +
@@ -474,7 +460,7 @@ struct CentralityTable {
474460 LOGF (debug, " centSPDClusters=%.0f" , cSPD);
475461 centRun2SPDClusters (cSPD);
476462 }
477- if (isTableEnabled[kRun2CL0s ]) {
463+ if (isTableEnabled[kCentRun2CL0s ]) {
478464 float cCL0 = 105 .0f ;
479465 if (Run2CL0Info.mCalibrationStored ) {
480466 float cl0m = bc.spdClustersL0 () * Run2CL0Info.mhVtxAmpCorr ->GetBinContent (Run2CL0Info.mhVtxAmpCorr ->FindFixBin (collision.posZ ()));
@@ -483,7 +469,7 @@ struct CentralityTable {
483469 LOGF (debug, " centCL0=%.0f" , cCL0);
484470 centRun2CL0 (cCL0);
485471 }
486- if (isTableEnabled[kRun2CL1s ]) {
472+ if (isTableEnabled[kCentRun2CL1s ]) {
487473 float cCL1 = 105 .0f ;
488474 if (Run2CL1Info.mCalibrationStored ) {
489475 float cl1m = bc.spdClustersL1 () * Run2CL1Info.mhVtxAmpCorr ->GetBinContent (Run2CL1Info.mhVtxAmpCorr ->FindFixBin (collision.posZ ()));
@@ -508,31 +494,31 @@ struct CentralityTable {
508494 // do memory reservation for the relevant tables only, please
509495 for (auto const & table : mEnabledTables ) {
510496 switch (table) {
511- case kFV0As :
497+ case kCentFV0As :
512498 centFV0A.reserve (collisions.size ());
513499 break ;
514- case kFT0Ms :
500+ case kCentFT0Ms :
515501 centFT0M.reserve (collisions.size ());
516502 break ;
517- case kFT0As :
503+ case kCentFT0As :
518504 centFT0A.reserve (collisions.size ());
519505 break ;
520- case kFT0Cs :
506+ case kCentFT0Cs :
521507 centFT0C.reserve (collisions.size ());
522508 break ;
523- case kFT0CVariant1s :
509+ case kCentFT0CVariant1s :
524510 centFT0CVariant1.reserve (collisions.size ());
525511 break ;
526- case kFDDMs :
512+ case kCentFDDMs :
527513 centFDDM.reserve (collisions.size ());
528514 break ;
529- case kNTPVs :
515+ case kCentNTPVs :
530516 centNTPV.reserve (collisions.size ());
531517 break ;
532- case kNGlobals :
518+ case kCentNGlobals :
533519 centNGlobals.reserve (collisions.size ());
534520 break ;
535- case kMFTs :
521+ case kCentMFTs :
536522 centMFTs.reserve (collisions.size ());
537523 break ;
538524 default :
@@ -610,31 +596,31 @@ struct CentralityTable {
610596
611597 for (auto const & table : mEnabledTables ) {
612598 switch (table) {
613- case kFV0As :
599+ case kCentFV0As :
614600 getccdb (fv0aInfo, ccdbConfig.genName );
615601 break ;
616- case kFT0Ms :
602+ case kCentFT0Ms :
617603 getccdb (ft0mInfo, ccdbConfig.genName );
618604 break ;
619- case kFT0As :
605+ case kCentFT0As :
620606 getccdb (ft0aInfo, ccdbConfig.genName );
621607 break ;
622- case kFT0Cs :
608+ case kCentFT0Cs :
623609 getccdb (ft0cInfo, ccdbConfig.genName );
624610 break ;
625- case kFT0CVariant1s :
611+ case kCentFT0CVariant1s :
626612 getccdb (ft0cVariant1Info, ccdbConfig.genName );
627613 break ;
628- case kFDDMs :
614+ case kCentFDDMs :
629615 getccdb (fddmInfo, ccdbConfig.genName );
630616 break ;
631- case kNTPVs :
617+ case kCentNTPVs :
632618 getccdb (ntpvInfo, ccdbConfig.genName );
633619 break ;
634- case kNGlobals :
620+ case kCentNGlobals :
635621 getccdb (nGlobalInfo, ccdbConfig.genName );
636622 break ;
637- case kMFTs :
623+ case kCentMFTs :
638624 getccdb (mftInfo, ccdbConfig.genName );
639625 break ;
640626 default :
@@ -683,12 +669,12 @@ struct CentralityTable {
683669
684670 for (auto const & table : mEnabledTables ) {
685671 switch (table) {
686- case kFV0As :
672+ case kCentFV0As :
687673 if constexpr (enableCentFV0) {
688674 populateTable (centFV0A, fv0aInfo, collision.multZeqFV0A ());
689675 }
690676 break ;
691- case kFT0Ms :
677+ case kCentFT0Ms :
692678 if constexpr (enableCentFT0) {
693679 const float perC = populateTable (centFT0M, ft0mInfo, collision.multZeqFT0A () + collision.multZeqFT0C ());
694680 if (produceHistograms.value ) {
@@ -703,7 +689,7 @@ struct CentralityTable {
703689 }
704690 }
705691 break ;
706- case kFT0As :
692+ case kCentFT0As :
707693 if constexpr (enableCentFT0) {
708694 const float perC = populateTable (centFT0A, ft0aInfo, collision.multZeqFT0A ());
709695 if (produceHistograms.value ) {
@@ -718,7 +704,7 @@ struct CentralityTable {
718704 }
719705 }
720706 break ;
721- case kFT0Cs :
707+ case kCentFT0Cs :
722708 if constexpr (enableCentFT0) {
723709 const float perC = populateTable (centFT0C, ft0cInfo, collision.multZeqFT0C ());
724710 if (produceHistograms.value ) {
@@ -733,27 +719,27 @@ struct CentralityTable {
733719 }
734720 }
735721 break ;
736- case kFT0CVariant1s :
722+ case kCentFT0CVariant1s :
737723 if constexpr (enableCentFT0) {
738724 populateTable (centFT0CVariant1, ft0cVariant1Info, collision.multZeqFT0C ());
739725 }
740726 break ;
741- case kFDDMs :
727+ case kCentFDDMs :
742728 if constexpr (enableCentFDD) {
743729 populateTable (centFDDM, fddmInfo, collision.multZeqFDDA () + collision.multZeqFDDC ());
744730 }
745731 break ;
746- case kNTPVs :
732+ case kCentNTPVs :
747733 if constexpr (enableCentNTPV) {
748734 populateTable (centNTPV, ntpvInfo, collision.multZeqNTracksPV ());
749735 }
750736 break ;
751- case kNGlobals :
737+ case kCentNGlobals :
752738 if constexpr (enableCentNGlobal) {
753739 populateTable (centNGlobals, nGlobalInfo, collision.multNTracksGlobal ());
754740 }
755741 break ;
756- case kMFTs :
742+ case kCentMFTs :
757743 if constexpr (enableCentMFT) {
758744 populateTable (centMFTs, mftInfo, collision.mftNtracks ());
759745 }
0 commit comments