Skip to content

Commit 4337dfa

Browse files
authored
Refactor string initialization for centrality labels
1 parent d0c8f2e commit 4337dfa

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎PWGCF/EbyEFluctuations/Tasks/meanPtFlucId.cxx‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <Framework/AnalysisHelpers.h>
3232
#include <Framework/AnalysisTask.h>
3333
#include <Framework/Configurable.h>
34+
#include <Framework/DataTypes.h>
3435
#include <Framework/HistogramRegistry.h>
3536
#include <Framework/HistogramSpec.h>
3637
#include <Framework/InitContext.h>
@@ -328,6 +329,9 @@ struct MeanPtFlucId {
328329
case 5:
329330
selectedTracks.SetRequireHitsInITSLayers(2, {0, 1, 2});
330331
break;
332+
default:
333+
LOGF(fatal, "Invalid custom ITS matching mode: %d", cuts.cfgCustomITSMatching.value);
334+
break;
331335
}
332336
selectedTracks.SetRequireITSRefit(cuts.cfgCustomRequireITS.value);
333337
selectedTracks.SetRequireTPCRefit(cuts.cfgCustomRequireTPC.value);
@@ -428,7 +432,7 @@ struct MeanPtFlucId {
428432
const AxisSpec axisMultMC{multMCBins, "N_{Gen} "};
429433
const AxisSpec axisMultFT0M{multFT0MBins, "N_{FT0M}"};
430434
// Match the estimator precedence used by getConfiguredCentrality().
431-
const std::string centralityLabel = eventCuts.cfgCentFT0C ? "FT0C (%)" : (eventCuts.cfgCentFV0A ? "FV0A (%)" : "FT0M (%)");
435+
const std::string centralityLabel = eventCuts.cfgCentFT0C ? std::string{"FT0C (%)"} : (eventCuts.cfgCentFV0A ? std::string{"FV0A (%)"} : std::string{"FT0M (%)"});
432436
const AxisSpec axisCentFT0M{101, 0, 101, centralityLabel};
433437
const AxisSpec axisCent{centBins, centralityLabel};
434438
const AxisSpec axisVtxZ{80, -20., 20., "V_{Z} (cm)"};
@@ -675,7 +679,7 @@ struct MeanPtFlucId {
675679
if (genConfig.cfgGenCutPosZ && (!std::isfinite(genConfig.cfgGenMaxPosZ.value) || genConfig.cfgGenMaxPosZ <= 0.f)) {
676680
LOGF(fatal, "cfgGenMaxPosZ must be finite and positive");
677681
}
678-
const std::string estimator = eventCuts.cfgCentFT0C ? "FT0C" : (eventCuts.cfgCentFV0A ? "FV0A" : "FT0M");
682+
const std::string estimator = eventCuts.cfgCentFT0C ? std::string{"FT0C"} : (eventCuts.cfgCentFV0A ? std::string{"FV0A"} : std::string{"FT0M"});
679683
constexpr size_t MinimumCentralityLookupEntries = 2;
680684
constexpr double MinimumCentralityPercentile = 0.;
681685
constexpr double MaximumCentralityPercentile = 100.;

0 commit comments

Comments
 (0)