diff --git a/PWGCF/FemtoDream/Core/femtoDreamObjectSelection.h b/PWGCF/FemtoDream/Core/femtoDreamObjectSelection.h index fb3b134e606..f1ce8019547 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamObjectSelection.h +++ b/PWGCF/FemtoDream/Core/femtoDreamObjectSelection.h @@ -24,6 +24,8 @@ #include +#include + #include #include #include @@ -52,7 +54,11 @@ class FemtoDreamObjectSelection void fillSelectionHistogram() { int nBins = mSelections.size(); - mQAHistogramRegistry->add((static_cast(o2::aod::femtodreamparticle::ParticleTypeName[part]) + "/cuthist").c_str(), "; Cut; Value", o2::framework::HistType::kTH1F, {{nBins, 0, static_cast(nBins)}}); + // fmt::format, not std::string + const char*: the longest names here are + // exactly 32 characters, so the concatenation crosses std::string's SSO + // boundary and GCC 14 reports the constant-folded copy as + // -Werror=array-bounds= on a buffer that is never actually used. + mQAHistogramRegistry->add(fmt::format("{}/cuthist", o2::aod::femtodreamparticle::ParticleTypeName[part]).c_str(), "; Cut; Value", o2::framework::HistType::kTH1F, {{nBins, 0, static_cast(nBins)}}); auto hist = mQAHistogramRegistry->get(HIST(o2::aod::femtodreamparticle::ParticleTypeName[part]) + HIST("/cuthist")); for (size_t i = 0; i < mSelections.size(); ++i) { hist->GetXaxis()->SetBinLabel(i + 1, Form("%u", mSelections.at(i).getSelectionVariable())); diff --git a/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h b/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h index ae3e12e9f69..f28116655df 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h +++ b/PWGCF/FemtoDream/Core/femtoDreamParticleHisto.h @@ -28,6 +28,8 @@ #include #include +#include + #include #include #include @@ -340,7 +342,7 @@ class FemtoDreamParticleHisto framework::AxisSpec InvMassAxis = {InvMassBins, "M_{inv} (GeV/#it{c}^{2})"}; framework::AxisSpec InvMassCompetingAxis = {InvMassCompetingBins, "M_{inv} (GeV/#it{c}^{2})"}; - std::string folderName = (static_cast(o2::aod::femtodreamparticle::ParticleTypeName[mParticleType]).c_str() + static_cast(mFolderSuffix[mFolderSuffixType])).c_str(); + std::string folderName = fmt::format("{}{}", o2::aod::femtodreamparticle::ParticleTypeName[mParticleType], mFolderSuffix[mFolderSuffixType]); // Fill here the actual histogramms by calling init_base and init_MC init_base(folderName, tempFitVarAxisTitle, pTAxis, tempFitVarAxis, InvMassAxis, multAxis); diff --git a/PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h b/PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h index 2e4f29a70f4..71d78c0d54d 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h +++ b/PWGCF/FemtoDream/Core/femtoDreamTrackSelection.h @@ -29,6 +29,8 @@ #include #include +#include + #include #include #include @@ -313,7 +315,7 @@ void FemtoDreamTrackSelection::init(o2::framework::HistogramRegistry* QAregistry if (QAregistry && Registry) { mHistogramRegistry = Registry; mQAHistogramRegistry = QAregistry; - std::string folderName = static_cast(o2::aod::femtodreamparticle::ParticleTypeName[part]) + "/" + static_cast(o2::aod::femtodreamparticle::TrackTypeName[tracktype]); + std::string folderName = fmt::format("{}/{}", o2::aod::femtodreamparticle::ParticleTypeName[part], o2::aod::femtodreamparticle::TrackTypeName[tracktype]); /// check whether the number of selection exceeds the bitmap size unsigned int nSelections = getNSelections() - getNSelections(femtoDreamTrackSelection::kPIDnSigmaMax); diff --git a/PWGCF/FemtoDream/Core/femtoDreamV0Selection.h b/PWGCF/FemtoDream/Core/femtoDreamV0Selection.h index 3c7bed428ec..041a1278f0b 100644 --- a/PWGCF/FemtoDream/Core/femtoDreamV0Selection.h +++ b/PWGCF/FemtoDream/Core/femtoDreamV0Selection.h @@ -28,6 +28,8 @@ #include #include +#include + #include #include #include @@ -304,8 +306,8 @@ void FemtoDreamV0Selection::init(o2::framework::HistogramRegistry* QAregistry, o } for (int istage = 0; istage < femtoDreamSelection::kNcutStages; istage++) { std::string folderName = - static_cast(o2::aod::femtodreamparticle::ParticleTypeName[part]) + "/" + - static_cast(femtoDreamSelection::mCutStage[istage]); + fmt::format("{}/{}", o2::aod::femtodreamparticle::ParticleTypeName[part], + femtoDreamSelection::mCutStage[istage]); /// \todo initialize histograms for children tracks of v0s mQAHistogramRegistry->add((folderName + "/hPt").c_str(), "; #it{p}_{T} (GeV/#it{c}); Entries", o2::framework::HistType::kTH1F,