@@ -348,18 +348,19 @@ bool eventSelection(const Tcollision& collision, HistogramRegistry& registry, La
348348template <typename Tcollision>
349349float getCentrality (Tcollision const & collision, const int centralityEstimator)
350350{
351- if constexpr (o2::aod::HasCentrality<Tcollision>) {
352- if (centralityEstimator == centDetectors::kFV0A ) {
353- return collision.centFV0A ();
354- } else if (centralityEstimator == centDetectors::kFT0M ) {
355- return collision.centFT0M ();
356- } else if (centralityEstimator == centDetectors::kFT0A ) {
357- return collision.centFT0A ();
358- } else if (centralityEstimator == centDetectors::kFT0C ) {
359- return collision.centFT0C ();
360- } else {
361- LOG (warning) << " Centrality estimator not valid. Possible values: (FV0A: 0, FT0M: 1, FT0A: 2, FT0C: 3). Centrality set to -1." ;
362- }
351+ if constexpr (!o2::aod::HasCentrality<Tcollision>) {
352+ return -1 .f ;
353+ }
354+ if (centralityEstimator == centDetectors::kFV0A ) {
355+ return collision.centFV0A ();
356+ } else if (centralityEstimator == centDetectors::kFT0M ) {
357+ return collision.centFT0M ();
358+ } else if (centralityEstimator == centDetectors::kFT0A ) {
359+ return collision.centFT0A ();
360+ } else if (centralityEstimator == centDetectors::kFT0C ) {
361+ return collision.centFT0C ();
362+ } else {
363+ LOG (warning) << " Centrality estimator not valid. Possible values: (FV0A: 0, FT0M: 1, FT0A: 2, FT0C: 3). Centrality set to -1." ;
363364 }
364365 return -1 .f ;
365366}
@@ -386,9 +387,9 @@ void createHistogramRegistryNucleus(HistogramRegistry& registry)
386387 registry.add (fmt::format (" {}/hTrackSelections" , cNames[index]).c_str (), (fmt::format (" {} track selections;" , cNames[index]) + std::string (" Selection step; Counts" )).c_str (), HistType::kTH1D , {{trackSelection::kNtrackSelections , -0 .5f , static_cast <float >(trackSelection::kNtrackSelections ) - 0 .5f }});
387388 registry.add (fmt::format (" {}/hPtReconstructed" , cNames[index]).c_str (), (fmt::format (" {} - reconstructed variables;" , cNames[index]) + std::string (" #it{p}_{T} / |#it{Z}| (GeV/#it{c}); Counts" )).c_str (), HistType::kTH1F , {{240 , -6 .0f , 6 .0f }});
388389 registry.add (fmt::format (" {}/h3PtVsEtaVsCentralityReconstructed" , cNames[index]).c_str (), (fmt::format (" {} - reconstructed variables;" , cNames[index]) + std::string (" #it{p}_{T} / |#it{Z}| (GeV/#it{c}); #eta; CentralityFT0C (%)" )).c_str (), HistType::kTH3F , {{240 , -6 .0f , 6 .0f }, {40 , -1 .0f , 1 .f }, {20 , 0 .0f , 100 .0f }});
389- registry.add (fmt::format (" {}/h3PhiVsEtaVsCentralityReconstructed" , cNames[index]).c_str (), (fmt::format (" {} - reconstructed variables;" , cNames[index]) + std::string (" #phi (radians); #eta; CentralityFT0C (%)" )).c_str (), HistType::kTH3F , {{240 , - 6 . 0f , 6 . 0f }, { 40 , 0 . 0f , o2::constants::math::TwoPI}, {20 , 0 .0f , 100 .0f }});
390- registry.add (fmt::format (" {}/h3DCAxyVsPtVsCentrality" , cNames[index]).c_str (), (fmt::format (" ;" , cNames[index]) + std::string (" #it{p}_{T} / |#it{Z}| (GeV/#it{c}); DCA_{xy} (cm); CentralityFT0C (%)" )).c_str (), HistType::kTH3F , {{240 , -6 .0f , 6 .0f }, {200 , -5 . 0f , 5 . 0f }, {20 , 0 .0f , 100 .0f }});
391- registry.add (fmt::format (" {}/h3DCAzVsPtVsCentrality" , cNames[index]).c_str (), (fmt::format (" {};" , cNames[index]) + std::string (" #it{p}_{T} / |#it{Z}| (GeV/#it{c}); DCA_{z} (cm); CentralityFT0C (%)" )).c_str (), HistType::kTH3F , {{240 , -6 .0f , 6 .0f }, {200 , -5 . 0f , 5 . 0f }, {20 , 0 .0f , 100 .0f }});
390+ registry.add (fmt::format (" {}/h3PhiVsEtaVsCentralityReconstructed" , cNames[index]).c_str (), (fmt::format (" {} - reconstructed variables;" , cNames[index]) + std::string (" #phi (radians); #eta; CentralityFT0C (%)" )).c_str (), HistType::kTH3F , {{40 , 0 , o2::constants::math::TwoPI}, { 40 , - 1 . 0f , 1 . f }, {20 , 0 .0f , 100 .0f }});
391+ registry.add (fmt::format (" {}/h3DCAxyVsPtVsCentrality" , cNames[index]).c_str (), (fmt::format (" ;" , cNames[index]) + std::string (" #it{p}_{T} / |#it{Z}| (GeV/#it{c}); DCA_{xy} (cm); CentralityFT0C (%)" )).c_str (), HistType::kTH3F , {{240 , -6 .0f , 6 .0f }, {200 , -0 . 5f , 0 . 5f }, {20 , 0 .0f , 100 .0f }});
392+ registry.add (fmt::format (" {}/h3DCAzVsPtVsCentrality" , cNames[index]).c_str (), (fmt::format (" {};" , cNames[index]) + std::string (" #it{p}_{T} / |#it{Z}| (GeV/#it{c}); DCA_{z} (cm); CentralityFT0C (%)" )).c_str (), HistType::kTH3F , {{240 , -6 .0f , 6 .0f }, {200 , -0 . 5f , 0 . 5f }, {20 , 0 .0f , 100 .0f }});
392393 registry.add (fmt::format (" {}/h3NsigmaTPC_preselectionVsCentrality" , cNames[index]).c_str (), (fmt::format (" Nsigma{} TPC distribution;" , cNames[index]) + std::string (" #it{p}_{T} / |#it{Z}| (GeV/#it{c});" ) + fmt::format (" n#sigma_{{TPC}}({}); CentralityFT0C (%)" , cNames[index])).c_str (), HistType::kTH3F , {{100 , -5 .0f , 5 .0f }, {400 , -10 .0f , 10 .0f }, {20 , 0 .0f , 100 .0f }});
393394 registry.add (fmt::format (" {}/h3NsigmaTPCVsCentrality" , cNames[index]).c_str (), (fmt::format (" Nsigma{} TPC distribution;" , cNames[index]) + std::string (" #it{p}_{T} / |#it{Z}| (GeV/#it{c});" ) + fmt::format (" n#sigma_{{TPC}}({}); Centrality FT0C (%)" , cNames[index])).c_str (), HistType::kTH3F , {{20 , -5 .0f , 5 .0f }, {200 , -5 .0f , 5 .0f }, {20 , 0 .0f , 100 .0f }});
394395 registry.add (fmt::format (" {}/h3NsigmaITS_preselectionVsCentrality" , cNames[index]).c_str (), (fmt::format (" Nsigma{} ITS distribution;" , cNames[index]) + std::string (" signed #it{p}_{T} / |#it{Z}| (GeV/#it{c});" ) + fmt::format (" n#sigma_{{ITS}}({}); Centrality FT0C (%)" , cNames[index])).c_str (), HistType::kTH3F , {{50 , -5 .0f , 5 .0f }, {120 , -3 .0f , 3 .0f }, {20 , 0 .0f , 100 .0f }});
@@ -400,7 +401,7 @@ void createHistogramRegistryNucleus(HistogramRegistry& registry)
400401 registry.add (fmt::format (" {}/h3ClusterSizeVsPtVsCentrality" , cNames[index]).c_str (), (fmt::format (" {};" , cNames[index]) + std::string (" #it{p}_{T} / |#it{Z}| (GeV/#it{c}); Cluster size ITS; CentralityFT0C (%)" )).c_str (), HistType::kTH3F , {{240 , -6 .0f , 6 .0f }, {90 , 0 .f , 15 .f }, {20 , 0 .0f , 100 .0f }});
401402 registry.add (fmt::format (" {}/hPtGenerated" , cNames[index]).c_str (), (fmt::format (" {} - generated variables;" , cNames[index]) + std::string (" #it{p}_{T} / |#it{Z}| (GeV/#it{c}); Counts" )).c_str (), HistType::kTH1F , {{240 , -6 .0f , 6 .0f }});
402403 registry.add (fmt::format (" {}/h3PtVsEtaVsCentralityGenerated" , cNames[index]).c_str (), (fmt::format (" {} - generated variables;" , cNames[index]) + std::string (" #it{p}_{T} / |#it{Z}| (GeV/#it{c}); #eta; CentralityFT0C (%)" )).c_str (), HistType::kTH3F , {{240 , -6 .0f , 6 .0f }, {40 , -1 .0f , 1 .f }, {20 , 0 .0f , 100 .0f }});
403- registry.add (fmt::format (" {}/h3PhiVsEtaVsCentralityGenerated" , cNames[index]).c_str (), (fmt::format (" {} - generated variables;" , cNames[index]) + std::string (" #phi (radians); #eta; CentralityFT0C (%)" )).c_str (), HistType::kTH3F , {{240 , - 6 . 0f , 6 . 0f }, { 40 , 0 . 0f , o2::constants::math::TwoPI}, {20 , 0 .0f , 100 .0f }});
404+ registry.add (fmt::format (" {}/h3PhiVsEtaVsCentralityGenerated" , cNames[index]).c_str (), (fmt::format (" {} - generated variables;" , cNames[index]) + std::string (" #phi (radians); #eta; CentralityFT0C (%)" )).c_str (), HistType::kTH3F , {{40 , 0 , o2::constants::math::TwoPI}, { 40 , - 1 . 0f , 1 . f }, {20 , 0 .0f , 100 .0f }});
404405
405406 for (size_t iSel = 0 ; iSel < trackSelection::kNtrackSelections ; iSel++) {
406407 registry.get <TH1>(HIST (cNames[index]) + HIST (" /hTrackSelections" ))->GetXaxis ()->SetBinLabel (iSel + 1 , trackSelectionLabels[iSel].c_str ());
0 commit comments