From d90b91b92aec65a702512166eddcd9bb59b4de1e Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Wed, 1 Jul 2026 18:22:00 +0200 Subject: [PATCH 01/24] [PWGDQ] Fixing reserved size for assocs tables in tableMaker --- PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx | 6 +++--- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index ab35ad8b31f..449ea177cc0 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -1368,7 +1368,7 @@ struct TableMakerMC { trackBarrel.reserve(tracksBarrel.size()); trackBarrelCov.reserve(tracksBarrel.size()); trackBarrelPID.reserve(tracksBarrel.size()); - trackBarrelAssoc.reserve(tracksBarrel.size()); + trackBarrelAssoc.reserve(trackAssocs.size()); trackBarrelLabels.reserve(tracksBarrel.size()); } @@ -1378,7 +1378,7 @@ struct TableMakerMC { map_mfttrackcovs.clear(); mftTrack.reserve(mftTracks.size()); mftTrackExtra.reserve(mftTracks.size()); - mftAssoc.reserve(mftTracks.size()); + mftAssoc.reserve(mftAssocs.size()); mftLabels.reserve(mftTracks.size()); } @@ -1390,7 +1390,7 @@ struct TableMakerMC { muonBasic.reserve(muons.size()); muonExtra.reserve(muons.size()); muonCov.reserve(muons.size()); - muonAssoc.reserve(muons.size()); + muonAssoc.reserve(fwdTrackAssocs.size()); muonLabels.reserve(muons.size()); } diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 4ef5b7313ca..9f1ea91a9fb 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -1766,7 +1766,7 @@ struct TableMaker { outTables.trackBarrel.reserve(tracksBarrel.size()); outTables.trackBarrelCov.reserve(tracksBarrel.size()); outTables.trackBarrelPID.reserve(tracksBarrel.size()); - outTables.trackBarrelAssoc.reserve(tracksBarrel.size()); + outTables.trackBarrelAssoc.reserve(trackAssocs.size()); } if constexpr (static_cast(TMFTFillMap)) { @@ -1774,7 +1774,7 @@ struct TableMaker { map_mfttrackcovs.clear(); outTables.mftTrack.reserve(mftTracks.size()); outTables.mftTrackExtra.reserve(mftTracks.size()); - outTables.mftAssoc.reserve(mftTracks.size()); + outTables.mftAssoc.reserve(mftAssocs.size()); } if constexpr (static_cast(TMuonFillMap)) { @@ -1785,7 +1785,7 @@ struct TableMaker { outTables.muonExtra.reserve(muons.size()); outTables.muonInfo.reserve(muons.size()); outTables.muonCov.reserve(muons.size()); - outTables.muonAssoc.reserve(muons.size()); + outTables.muonAssoc.reserve(fwdTrackAssocs.size()); } if constexpr (static_cast(TMFTFillMap & VarManager::ObjTypes::MFTCov)) { From c5524aa7902e696eefcfebddbbe94467a78a23bc Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Thu, 2 Jul 2026 10:56:52 +0200 Subject: [PATCH 02/24] modernize-use-auto --- PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index 449ea177cc0..b8a756b0308 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -549,7 +549,7 @@ struct TableMakerMC { fLabelsMapReversed.clear(); fMCFlags.clear(); - uint16_t mcflags = static_cast(0); // flags which will hold the decisions for each MC signal + auto mcflags = static_cast(0); // flags which will hold the decisions for each MC signal int trackCounter = 0; for (auto& mctrack : mcTracks) { @@ -728,7 +728,7 @@ struct TableMakerMC { auto bc = collision.template bc_as(); // store the selection decisions - uint64_t tag = static_cast(0); + auto tag = static_cast(0); // store some more information in the tag // if the BC found by event selection does not coincide with the collision.bc(), toggle the first bit auto bcEvSel = collision.template foundBC_as(); @@ -836,9 +836,9 @@ struct TableMakerMC { // so in case of multiple associations, the variables depending on the collision association (e.g. DCA, secondary vertexing, etc) // have to be recomputed at analysis time for each association. - uint64_t trackFilteringTag = static_cast(0); - uint32_t trackTempFilterMap = static_cast(0); - uint16_t mcflags = static_cast(0); + auto trackFilteringTag = static_cast(0); + auto trackTempFilterMap = static_cast(0); + auto mcflags = static_cast(0); int trackCounter = fLabelsMap.size(); // Loop over associations @@ -979,7 +979,7 @@ struct TableMakerMC { { // Skim MFT tracks // So far no cuts are applied here - uint16_t mcflags = static_cast(0); + auto mcflags = static_cast(0); int trackCounter = fLabelsMap.size(); for (const auto& assoc : mftAssocs) { @@ -1096,10 +1096,10 @@ struct TableMakerMC { // Loop over the collision-track associations, recompute track properties depending on the collision assigned, and apply track cuts for selection // Muons are written only once, even if they constribute to more than one association, // which means that in the case of multiple associations, the track parameters are wrong and should be computed again at analysis time. - uint8_t trackFilteringTag = static_cast(0); - uint8_t trackTempFilterMap = static_cast(0); + auto trackFilteringTag = static_cast(0); + auto trackTempFilterMap = static_cast(0); fFwdTrackIndexMapReversed.clear(); - uint16_t mcflags = static_cast(0); + auto mcflags = static_cast(0); int trackCounter = fLabelsMap.size(); uint32_t offset = muonBasic.lastIndex(); From 4899e1eafe9406de55be9a9077fd311312dba594 Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Thu, 2 Jul 2026 10:59:35 +0200 Subject: [PATCH 03/24] modernize-use-auto --- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 9f1ea91a9fb..936368479d5 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -1274,8 +1274,8 @@ struct TableMaker { // One can apply here cuts which depend on the association (e.g. DCA), which will discard (hopefully most) wrong associations. // Tracks are written only once, even if they constribute to more than one association - uint64_t trackFilteringTag = static_cast(0); - uint32_t trackTempFilterMap = static_cast(0); + auto trackFilteringTag = static_cast(0); + auto trackTempFilterMap = static_cast(0); // material correction for track propagation // TODO: Do we need a configurable to switch between different material correction options? @@ -1520,8 +1520,8 @@ struct TableMaker { // TODO: Currently, the TMFTFillMap is not used in this function. Is it needed ? - uint8_t trackFilteringTag = static_cast(0); - uint8_t trackTempFilterMap = static_cast(0); + auto trackFilteringTag = static_cast(0); + auto trackTempFilterMap = static_cast(0); fFwdTrackIndexMapReversed.clear(); uint32_t offset = outTables.muonBasic.lastIndex(); From 53c306a0454b96fccb47db54becf883bb8b2814f Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Thu, 2 Jul 2026 13:55:12 +0200 Subject: [PATCH 04/24] cppcoreguidelines-pro-type-member-init --- PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx | 10 +++++----- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index b8a756b0308..0241b27b82e 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -177,7 +177,7 @@ struct TableMakerMC { OutputObj fOutputList{"output"}; OutputObj fStatsList{"Statistics"}; //! skimming statistics - HistogramManager* fHistMan; + HistogramManager* fHistMan = nullptr; Configurable fIsRun2{"cfgIsRun2", false, "Whether we analyze Run-2 or Run-3 data"}; @@ -250,18 +250,18 @@ struct TableMakerMC { Configurable> fModelNames{"cfgModelNames", std::vector{"model.onnx"}, "ONNX file names for each pT bin (if not from CCDB full path)"}; } fConfigVariousOptions; - Service fCCDB; + Service fCCDB{}; o2::ccdb::CcdbApi fCCDBApi; o2::parameters::GRPObject* fGrpMagRun2 = nullptr; // for run 2, we access the GRPObject from GLO/GRP/GRP o2::parameters::GRPMagField* fGrpMag = nullptr; // for run 3, we access GRPMagField from GLO/Config/GRPMagField - AnalysisCompositeCut* fEventCut; //! Event selection cut + AnalysisCompositeCut* fEventCut = nullptr; //! Event selection cut std::vector fTrackCuts; //! Barrel track cuts std::vector fMuonCuts; //! Muon track cuts bool fDoDetailedQA = false; // Bool to set detailed QA true, if QA is set true - int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc. + int fCurrentRun = -1; // needed to detect if the run changed and trigger update of calibrations etc. // list of MCsignal objects std::vector fMCSignals; @@ -280,7 +280,7 @@ struct TableMakerMC { o2::analysis::MlResponseMFTMuonMatch matchingMlResponse; std::vector binsPtMl; - std::array cutValues; + std::array cutValues{}; std::vector cutDirMl; // RCT flag checker diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 936368479d5..2a497ff1136 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -215,7 +215,7 @@ struct TableMaker { OutputObj fOutputList{"output"}; //! the histogram manager output list OutputObj fStatsList{"Statistics"}; //! skimming statistics - HistogramManager* fHistMan; + HistogramManager* fHistMan = nullptr; // Event and track AnalysisCut configurables struct : ConfigurableGroup { @@ -320,18 +320,18 @@ struct TableMaker { Configurable fExcludeShort{"cfgTPCExcludeShort", true, "Exclude short term from long term occupancy (micro-seconds)"}; } fConfigVariousOptions; - Service fCCDB; + Service fCCDB{}; o2::ccdb::CcdbApi fCCDBApi; o2::parameters::GRPObject* fGrpMagRun2 = nullptr; // for run 2, we access the GRPObject from GLO/GRP/GRP o2::parameters::GRPMagField* fGrpMag = nullptr; // for run 3, we access GRPMagField from GLO/Config/GRPMagField - AnalysisCompositeCut* fEventCut; //! Event selection cut + AnalysisCompositeCut* fEventCut = nullptr; //! Event selection cut std::vector fTrackCuts; //! Barrel track cuts std::vector fMuonCuts; //! Muon track cuts bool fDoDetailedQA = false; // Bool to set detailed QA true, if QA is set true - int fCurrentRun; // needed to detect if the run changed and trigger update of calibrations etc. + int fCurrentRun = -1; // needed to detect if the run changed and trigger update of calibrations etc. // maps used to store index info; NOTE: std::map are sorted in ascending order by default (needed for track to collision indices) std::map fCollIndexMap; // key: old collision index, value: skimmed collision index @@ -346,7 +346,7 @@ struct TableMaker { o2::analysis::MlResponseMFTMuonMatch matchingMlResponse; std::vector binsPtMl; - std::array cutValues; + std::array cutValues{}; std::vector cutDirMl; // RCT flag checker From 67b624845bd683443169f6fd0976925d567a31e5 Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Thu, 2 Jul 2026 14:04:41 +0200 Subject: [PATCH 05/24] cppcoreguidelines-pro-bounds-array-to-pointer-decay --- .../TableProducer/tableMakerMC_withAssoc.cxx | 39 +++++++++++-------- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 39 +++++++++++-------- 2 files changed, 46 insertions(+), 32 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index 0241b27b82e..5fa092c36f4 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -134,6 +134,13 @@ constexpr static uint32_t gkMuonRealignFillMapWithCov = VarManager::ObjTypes::Mu constexpr static uint32_t gkMFTFillMap = VarManager::ObjTypes::TrackMFT; constexpr static uint32_t gkMFTCovFillMap = VarManager::ObjTypes::TrackMFT | VarManager::ObjTypes::MFTCov; +namespace dqtablemakermc_helpers +{ +inline float* varValues() { return static_cast(VarManager::fgValues); } +inline TString* varNames() { return static_cast(VarManager::fgVariableNames); } +inline TString* varUnits() { return static_cast(VarManager::fgVariableUnits); } +} // namespace dqtablemakermc_helpers + template void PrintBitMap(TMap map, int nbits) { @@ -334,7 +341,7 @@ struct TableMakerMC { fHistMan = new HistogramManager("analysisHistos", "aa", VarManager::kNVars); fHistMan->SetUseDefaultVariableNames(kTRUE); - fHistMan->SetDefaultVarNames(VarManager::fgVariableNames, VarManager::fgVariableUnits); + fHistMan->SetDefaultVarNames(dqtablemakermc_helpers::varNames(), dqtablemakermc_helpers::varUnits()); // Only use detailed QA when QA is set true if (fConfigHistOutput.fConfigQA && fConfigHistOutput.fConfigDetailedQA) { @@ -529,7 +536,7 @@ struct TableMakerMC { // Get MC collision information into the VarManager VarManager::FillEvent(mcCollision); // Fill histograms - fHistMan->FillHistClass("Event_MCTruth", VarManager::fgValues); + fHistMan->FillHistClass("Event_MCTruth", dqtablemakermc_helpers::varValues()); // Create the skimmed table entry for this collision eventMC(mcCollision.generatorsID(), mcCollision.posX(), mcCollision.posY(), mcCollision.posZ(), mcCollision.t(), mcCollision.weight(), mcCollision.impactParameter(), mcCollision.bestCollisionCentFT0C(), @@ -619,7 +626,7 @@ struct TableMakerMC { int j = 0; for (auto signal = fMCSignals.begin(); signal != fMCSignals.end(); signal++, j++) { if (mcflags & (static_cast(1) << j)) { - fHistMan->FillHistClass(Form("MCTruth_%s", (*signal)->GetName()), VarManager::fgValues); + fHistMan->FillHistClass(Form("MCTruth_%s", (*signal)->GetName()), dqtablemakermc_helpers::varValues()); } } } @@ -749,7 +756,7 @@ struct TableMakerMC { VarManager::FillEvent(mcCollision); } if (fDoDetailedQA) { - fHistMan->FillHistClass("Event_BeforeCuts", VarManager::fgValues); + fHistMan->FillHistClass("Event_BeforeCuts", dqtablemakermc_helpers::varValues()); } // fill stats information, before selections @@ -761,7 +768,7 @@ struct TableMakerMC { (reinterpret_cast(fStatsList->At(0)))->Fill(2.0, static_cast(o2::aod::evsel::kNsel)); // Apply the user specified event selection - if (!fEventCut->IsSelected(VarManager::fgValues) || (fConfigRCT.fConfigUseRCT.value && !(rctChecker(collision)))) { + if (!fEventCut->IsSelected(dqtablemakermc_helpers::varValues()) || (fConfigRCT.fConfigUseRCT.value && !(rctChecker(collision)))) { continue; } @@ -774,7 +781,7 @@ struct TableMakerMC { (reinterpret_cast(fStatsList->At(0)))->Fill(3.0, static_cast(o2::aod::evsel::kNsel)); // Fill historams after event cuts - fHistMan->FillHistClass("Event_AfterCuts", VarManager::fgValues); + fHistMan->FillHistClass("Event_AfterCuts", dqtablemakermc_helpers::varValues()); // create the event tables event(tag, bc.runNumber(), collision.posX(), collision.posY(), collision.posZ(), collision.numContrib(), collision.collisionTime(), collision.collisionTimeRes()); @@ -861,16 +868,16 @@ struct TableMakerMC { VarManager::FillTrackCollision(track, collision); } if (fDoDetailedQA) { - fHistMan->FillHistClass("TrackBarrel_BeforeCuts", VarManager::fgValues); + fHistMan->FillHistClass("TrackBarrel_BeforeCuts", dqtablemakermc_helpers::varValues()); } // apply track cuts and fill histograms int i = 0; for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); cut++, i++) { - if ((*cut)->IsSelected(VarManager::fgValues)) { + if ((*cut)->IsSelected(dqtablemakermc_helpers::varValues())) { trackTempFilterMap |= (static_cast(1) << i); if (fConfigHistOutput.fConfigQA) { - fHistMan->FillHistClass(Form("TrackBarrel_%s", (*cut)->GetName()), VarManager::fgValues); + fHistMan->FillHistClass(Form("TrackBarrel_%s", (*cut)->GetName()), dqtablemakermc_helpers::varValues()); } (reinterpret_cast(fStatsList->At(1)))->Fill(static_cast(i)); } @@ -950,7 +957,7 @@ struct TableMakerMC { j = 0; for (auto& cut : fTrackCuts) { if (trackTempFilterMap & (uint8_t(1) << j)) { - fHistMan->FillHistClass(Form("TrackBarrel_%s_%s", cut->GetName(), sig->GetName()), VarManager::fgValues); // fill the reconstructed truth + fHistMan->FillHistClass(Form("TrackBarrel_%s_%s", cut->GetName(), sig->GetName()), dqtablemakermc_helpers::varValues()); // fill the reconstructed truth } j++; } @@ -987,7 +994,7 @@ struct TableMakerMC { if (fConfigHistOutput.fConfigQA) { VarManager::FillTrack(track); - fHistMan->FillHistClass("MftTracks", VarManager::fgValues); + fHistMan->FillHistClass("MftTracks", dqtablemakermc_helpers::varValues()); } // write the MFT track global index in the map for skimming (to make sure we have it just once) @@ -1012,7 +1019,7 @@ struct TableMakerMC { mcflags |= (static_cast(1) << i); // If detailed QA is on, fill histograms for each MC signal and track cut combination if (fDoDetailedQA) { - fHistMan->FillHistClass(Form("MFTTrack_%s", sig->GetName()), VarManager::fgValues); // fill the reconstructed truth + fHistMan->FillHistClass(Form("MFTTrack_%s", sig->GetName()), dqtablemakermc_helpers::varValues()); // fill the reconstructed truth } } i++; @@ -1148,15 +1155,15 @@ struct TableMakerMC { } if (fDoDetailedQA) { - fHistMan->FillHistClass("Muons_BeforeCuts", VarManager::fgValues); + fHistMan->FillHistClass("Muons_BeforeCuts", dqtablemakermc_helpers::varValues()); } // check the cuts and fill histograms for each fulfilled cut int i = 0; for (auto cut = fMuonCuts.begin(); cut != fMuonCuts.end(); cut++, i++) { - if ((*cut)->IsSelected(VarManager::fgValues)) { + if ((*cut)->IsSelected(dqtablemakermc_helpers::varValues())) { trackTempFilterMap |= (uint8_t(1) << i); if (fConfigHistOutput.fConfigQA) { - fHistMan->FillHistClass(Form("Muons_%s", (*cut)->GetName()), VarManager::fgValues); + fHistMan->FillHistClass(Form("Muons_%s", (*cut)->GetName()), dqtablemakermc_helpers::varValues()); } (reinterpret_cast(fStatsList->At(2)))->Fill(static_cast(i)); } @@ -1196,7 +1203,7 @@ struct TableMakerMC { j = 0; for (auto& cut : fMuonCuts) { if (trackTempFilterMap & (uint8_t(1) << j)) { - fHistMan->FillHistClass(Form("Muons_%s_%s", cut->GetName(), sig->GetName()), VarManager::fgValues); // fill the reconstructed truth + fHistMan->FillHistClass(Form("Muons_%s_%s", cut->GetName(), sig->GetName()), dqtablemakermc_helpers::varValues()); // fill the reconstructed truth } j++; } diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 2a497ff1136..34b60c242d1 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -181,6 +181,13 @@ enum SkimStatsHists { kStatsZorroSel }; +namespace dqtablemaker_helpers +{ +inline float* varValues() { return static_cast(VarManager::fgValues); } +inline TString* varNames() { return static_cast(VarManager::fgVariableNames); } +inline TString* varUnits() { return static_cast(VarManager::fgVariableUnits); } +} // namespace dqtablemaker_helpers + struct TableMaker { struct : ProducesGroup { @@ -454,7 +461,7 @@ struct TableMaker { // Initialize the histogram manager fHistMan = new HistogramManager("analysisHistos", "aa", VarManager::kNVars); fHistMan->SetUseDefaultVariableNames(kTRUE); - fHistMan->SetDefaultVarNames(VarManager::fgVariableNames, VarManager::fgVariableUnits); + fHistMan->SetDefaultVarNames(dqtablemaker_helpers::varNames(), dqtablemaker_helpers::varUnits()); // Only use detailed QA when QA is set true if (fConfigHistOutput.fConfigQA && fConfigHistOutput.fConfigDetailedQA) { @@ -1117,7 +1124,7 @@ struct TableMaker { } if (fDoDetailedQA) { - fHistMan->FillHistClass("Event_BeforeCuts", VarManager::fgValues); + fHistMan->FillHistClass("Event_BeforeCuts", dqtablemaker_helpers::varValues()); } // fill stats information, before selections @@ -1134,7 +1141,7 @@ struct TableMaker { zorro.initCCDB(fCCDB.service, fCurrentRun, bc.timestamp(), fConfigZorro.fConfigZorroTrigMask.value); zorro.populateExternalHists(fCurrentRun, reinterpret_cast(fStatsList->At(kStatsZorroInfo)), reinterpret_cast(fStatsList->At(kStatsZorroSel))); - if (!fEventCut->IsSelected(VarManager::fgValues) || (fConfigRCT.fConfigUseRCT.value && !rctChecker(collision))) { + if (!fEventCut->IsSelected(dqtablemaker_helpers::varValues()) || (fConfigRCT.fConfigUseRCT.value && !rctChecker(collision))) { continue; } @@ -1146,7 +1153,7 @@ struct TableMaker { continue; } } else { - if (!fEventCut->IsSelected(VarManager::fgValues) || (fConfigRCT.fConfigUseRCT.value && !rctChecker(collision))) { + if (!fEventCut->IsSelected(dqtablemaker_helpers::varValues()) || (fConfigRCT.fConfigUseRCT.value && !rctChecker(collision))) { continue; } } @@ -1159,7 +1166,7 @@ struct TableMaker { } (reinterpret_cast(fStatsList->At(kStatsEvent)))->Fill(3.0, static_cast(o2::aod::evsel::kNsel)); - fHistMan->FillHistClass("Event_AfterCuts", VarManager::fgValues); + fHistMan->FillHistClass("Event_AfterCuts", dqtablemaker_helpers::varValues()); // create the event tables outTables.event(tag, bc.runNumber(), collision.posX(), collision.posY(), collision.posZ(), collision.numContrib(), collision.collisionTime(), collision.collisionTimeRes()); @@ -1303,18 +1310,18 @@ struct TableMaker { } if (fDoDetailedQA) { - fHistMan->FillHistClass("TrackBarrel_BeforeCuts", VarManager::fgValues); + fHistMan->FillHistClass("TrackBarrel_BeforeCuts", dqtablemaker_helpers::varValues()); } // apply track cuts and fill stats histogram int i = 0; for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); cut++, i++) { - if ((*cut)->IsSelected(VarManager::fgValues)) { + if ((*cut)->IsSelected(dqtablemaker_helpers::varValues())) { trackTempFilterMap |= (static_cast(1) << i); // NOTE: the QA is filled here just for the first occurence of this track. // So if there are histograms of quantities which depend on the collision association, these will not be accurate if (fConfigHistOutput.fConfigQA && (fTrackIndexMap.find(track.globalIndex()) == fTrackIndexMap.end())) { - fHistMan->FillHistClass(Form("TrackBarrel_%s", (*cut)->GetName()), VarManager::fgValues); + fHistMan->FillHistClass(Form("TrackBarrel_%s", (*cut)->GetName()), dqtablemaker_helpers::varValues()); } (reinterpret_cast(fStatsList->At(kStatsTracks)))->Fill(static_cast(i)); } @@ -1341,16 +1348,16 @@ struct TableMaker { // TODO: this part should be removed since the calibration histogram can be filled as any other histogram if (fConfigPostCalibTPC.fConfigIsOnlyforMaps) { if (trackFilteringTag & (static_cast(1) << VarManager::kIsConversionLeg)) { // for electron - fHistMan->FillHistClass("TrackBarrel_PostCalibElectron", VarManager::fgValues); + fHistMan->FillHistClass("TrackBarrel_PostCalibElectron", dqtablemaker_helpers::varValues()); } if (trackFilteringTag & (static_cast(1) << VarManager::kIsK0sLeg)) { // for pion - fHistMan->FillHistClass("TrackBarrel_PostCalibPion", VarManager::fgValues); + fHistMan->FillHistClass("TrackBarrel_PostCalibPion", dqtablemaker_helpers::varValues()); } if ((static_cast(trackFilteringTag & (static_cast(1) << VarManager::kIsLambdaLeg)) * (track.sign()) > 0)) { // for proton from Lambda - fHistMan->FillHistClass("TrackBarrel_PostCalibProton", VarManager::fgValues); + fHistMan->FillHistClass("TrackBarrel_PostCalibProton", dqtablemaker_helpers::varValues()); } if ((static_cast(trackFilteringTag & (static_cast(1) << VarManager::kIsALambdaLeg)) * (track.sign()) < 0)) { // for proton from AntiLambda - fHistMan->FillHistClass("TrackBarrel_PostCalibProton", VarManager::fgValues); + fHistMan->FillHistClass("TrackBarrel_PostCalibProton", dqtablemaker_helpers::varValues()); } } if (fConfigPostCalibTPC.fConfigSaveElectronSample) { // only save electron sample @@ -1438,7 +1445,7 @@ struct TableMaker { if (fConfigHistOutput.fConfigQA) { VarManager::FillTrack(track); - fHistMan->FillHistClass("MftTracks", VarManager::fgValues); + fHistMan->FillHistClass("MftTracks", dqtablemaker_helpers::varValues()); } // write the MFT track global index in the map for skimming (to make sure we have it just once) @@ -1573,18 +1580,18 @@ struct TableMaker { } if (fDoDetailedQA) { - fHistMan->FillHistClass("Muons_BeforeCuts", VarManager::fgValues); + fHistMan->FillHistClass("Muons_BeforeCuts", dqtablemaker_helpers::varValues()); } // check the cuts and filters int i = 0; for (auto cut = fMuonCuts.begin(); cut != fMuonCuts.end(); cut++, i++) { - if ((*cut)->IsSelected(VarManager::fgValues)) { + if ((*cut)->IsSelected(dqtablemaker_helpers::varValues())) { trackTempFilterMap |= (static_cast(1) << i); // NOTE: the QA is filled here just for the first occurence of this muon, which means the current association // will be skipped from histograms if this muon was already filled in the skimming map. // So if there are histograms of quantities which depend on the collision association, these histograms will not be completely accurate if (fConfigHistOutput.fConfigQA && (fFwdTrackIndexMap.find(muon.globalIndex()) == fFwdTrackIndexMap.end())) { - fHistMan->FillHistClass(Form("Muons_%s", (*cut)->GetName()), VarManager::fgValues); + fHistMan->FillHistClass(Form("Muons_%s", (*cut)->GetName()), dqtablemaker_helpers::varValues()); } (reinterpret_cast(fStatsList->At(kStatsMuons)))->Fill(static_cast(i)); } From 801481f0fead32a8cf36a5153b43654fa3554259 Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Thu, 2 Jul 2026 14:16:42 +0200 Subject: [PATCH 06/24] cppcoreguidelines-pro-type-reinterpret-cast --- .../TableProducer/tableMakerMC_withAssoc.cxx | 30 ++++++------ PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 48 +++++++++---------- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index 5fa092c36f4..44439c90463 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -494,7 +494,7 @@ struct TableMakerMC { if (addTrackCutsStr != "") { std::vector addTrackCuts = dqcuts::GetCutsFromJSON(addTrackCutsStr.Data()); for (auto& t : addTrackCuts) { - fTrackCuts.push_back(reinterpret_cast(t)); + fTrackCuts.push_back(static_cast(t)); } } @@ -511,7 +511,7 @@ struct TableMakerMC { if (addMuonCutsStr != "") { std::vector addMuonCuts = dqcuts::GetCutsFromJSON(addMuonCutsStr.Data()); for (auto& t : addMuonCuts) { - fMuonCuts.push_back(reinterpret_cast(t)); + fMuonCuts.push_back(static_cast(t)); } } @@ -728,10 +728,10 @@ struct TableMakerMC { // Fill the stats event histogram with the event selection bits for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (collision.selection_bit(i)) { - (reinterpret_cast(fStatsList->At(0)))->Fill(1.0, static_cast(i)); + (static_cast(fStatsList->At(0)))->Fill(1.0, static_cast(i)); } } - (reinterpret_cast(fStatsList->At(0)))->Fill(1.0, static_cast(o2::aod::evsel::kNsel)); + (static_cast(fStatsList->At(0)))->Fill(1.0, static_cast(o2::aod::evsel::kNsel)); auto bc = collision.template bc_as(); // store the selection decisions @@ -762,10 +762,10 @@ struct TableMakerMC { // fill stats information, before selections for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (collision.selection_bit(i)) { - (reinterpret_cast(fStatsList->At(0)))->Fill(2.0, static_cast(i)); + (static_cast(fStatsList->At(0)))->Fill(2.0, static_cast(i)); } } - (reinterpret_cast(fStatsList->At(0)))->Fill(2.0, static_cast(o2::aod::evsel::kNsel)); + (static_cast(fStatsList->At(0)))->Fill(2.0, static_cast(o2::aod::evsel::kNsel)); // Apply the user specified event selection if (!fEventCut->IsSelected(dqtablemakermc_helpers::varValues()) || (fConfigRCT.fConfigUseRCT.value && !(rctChecker(collision)))) { @@ -775,10 +775,10 @@ struct TableMakerMC { // fill stats information, after selections for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (collision.selection_bit(i)) { - (reinterpret_cast(fStatsList->At(0)))->Fill(3.0, static_cast(i)); + (static_cast(fStatsList->At(0)))->Fill(3.0, static_cast(i)); } } - (reinterpret_cast(fStatsList->At(0)))->Fill(3.0, static_cast(o2::aod::evsel::kNsel)); + (static_cast(fStatsList->At(0)))->Fill(3.0, static_cast(o2::aod::evsel::kNsel)); // Fill historams after event cuts fHistMan->FillHistClass("Event_AfterCuts", dqtablemakermc_helpers::varValues()); @@ -879,7 +879,7 @@ struct TableMakerMC { if (fConfigHistOutput.fConfigQA) { fHistMan->FillHistClass(Form("TrackBarrel_%s", (*cut)->GetName()), dqtablemakermc_helpers::varValues()); } - (reinterpret_cast(fStatsList->At(1)))->Fill(static_cast(i)); + (static_cast(fStatsList->At(1)))->Fill(static_cast(i)); } } if (!trackTempFilterMap) { @@ -898,7 +898,7 @@ struct TableMakerMC { trackFilteringTag |= static_cast(track.pidbit()); for (int iv0 = 0; iv0 < 5; iv0++) { if (track.pidbit() & (uint8_t(1) << iv0)) { - (reinterpret_cast(fStatsList->At(1)))->Fill(fTrackCuts.size() + static_cast(iv0)); + (static_cast(fStatsList->At(1)))->Fill(fTrackCuts.size() + static_cast(iv0)); } } } // end if V0Bits @@ -1165,7 +1165,7 @@ struct TableMakerMC { if (fConfigHistOutput.fConfigQA) { fHistMan->FillHistClass(Form("Muons_%s", (*cut)->GetName()), dqtablemakermc_helpers::varValues()); } - (reinterpret_cast(fStatsList->At(2)))->Fill(static_cast(i)); + (static_cast(fStatsList->At(2)))->Fill(static_cast(i)); } } @@ -1494,11 +1494,11 @@ struct TableMakerMC { mctrack.vx(), mctrack.vy(), mctrack.vz(), mctrack.vt(), mcflags); for (unsigned int isig = 0; isig < fMCSignals.size(); isig++) { if (mcflags & (static_cast(1) << isig)) { - (reinterpret_cast(fStatsList->At(3)))->Fill(static_cast(isig)); + (static_cast(fStatsList->At(3)))->Fill(static_cast(isig)); } } if (mcflags == 0) { - (reinterpret_cast(fStatsList->At(3)))->Fill(static_cast(fMCSignals.size())); + (static_cast(fStatsList->At(3)))->Fill(static_cast(fMCSignals.size())); } } // end loop over labels } @@ -1692,10 +1692,10 @@ struct TableMakerMC { { for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (bc.alias_bit(i) > 0) { - (reinterpret_cast(fStatsList->At(0)))->Fill(0.0, static_cast(i)); + (static_cast(fStatsList->At(0)))->Fill(0.0, static_cast(i)); } } - (reinterpret_cast(fStatsList->At(0)))->Fill(0.0, static_cast(o2::aod::evsel::kNsel)); + (static_cast(fStatsList->At(0)))->Fill(0.0, static_cast(o2::aod::evsel::kNsel)); } PROCESS_SWITCH(TableMakerMC, processPP, "Produce both barrel and muon skims, pp settings", false); diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 34b60c242d1..7183c2feafd 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -580,7 +580,7 @@ struct TableMaker { if (addTrackCutsStr != "") { std::vector addTrackCuts = dqcuts::GetCutsFromJSON(addTrackCutsStr.Data()); for (auto& t : addTrackCuts) { - fTrackCuts.push_back(reinterpret_cast(t)); + fTrackCuts.push_back(static_cast(t)); } } @@ -597,7 +597,7 @@ struct TableMaker { if (addMuonCutsStr != "") { std::vector addMuonCuts = dqcuts::GetCutsFromJSON(addMuonCutsStr.Data()); for (auto& t : addMuonCuts) { - fMuonCuts.push_back(reinterpret_cast(t)); + fMuonCuts.push_back(static_cast(t)); } } @@ -1018,22 +1018,22 @@ struct TableMaker { bool isTriggerZNA = bc.selection_bit(aod::evsel::kIsBBZNA); bool isTriggerZNC = bc.selection_bit(aod::evsel::kIsBBZNC); - (reinterpret_cast(fStatsList->At(kStatsBcs)))->Fill(0.0, muTVX); + (static_cast(fStatsList->At(kStatsBcs)))->Fill(0.0, muTVX); if (isTvx) { - (reinterpret_cast(fStatsList->At(kStatsBcs)))->Fill(1.0, muTVX); + (static_cast(fStatsList->At(kStatsBcs)))->Fill(1.0, muTVX); if (noBorder) { - (reinterpret_cast(fStatsList->At(kStatsBcs)))->Fill(2.0, muTVX); + (static_cast(fStatsList->At(kStatsBcs)))->Fill(2.0, muTVX); if (isCentral) { - (reinterpret_cast(fStatsList->At(kStatsBcs)))->Fill(3.0, muTVX); + (static_cast(fStatsList->At(kStatsBcs)))->Fill(3.0, muTVX); } if (isSemiCentral) { - (reinterpret_cast(fStatsList->At(kStatsBcs)))->Fill(4.0, muTVX); + (static_cast(fStatsList->At(kStatsBcs)))->Fill(4.0, muTVX); } if (isCentral || isSemiCentral) { - (reinterpret_cast(fStatsList->At(kStatsBcs)))->Fill(5.0, muTVX); + (static_cast(fStatsList->At(kStatsBcs)))->Fill(5.0, muTVX); } if (isTriggerZNA && isTriggerZNC) { - (reinterpret_cast(fStatsList->At(kStatsBcs)))->Fill(6.0, muTVX); + (static_cast(fStatsList->At(kStatsBcs)))->Fill(6.0, muTVX); } } } @@ -1045,10 +1045,10 @@ struct TableMaker { for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (collision.selection_bit(i)) { - (reinterpret_cast(fStatsList->At(kStatsEvent)))->Fill(1.0, static_cast(i)); + (static_cast(fStatsList->At(kStatsEvent)))->Fill(1.0, static_cast(i)); } } - (reinterpret_cast(fStatsList->At(kStatsEvent)))->Fill(1.0, static_cast(o2::aod::evsel::kNsel)); + (static_cast(fStatsList->At(kStatsEvent)))->Fill(1.0, static_cast(o2::aod::evsel::kNsel)); // apply the event filter computed by filter-PP if constexpr ((TEventFillMap & VarManager::ObjTypes::EventFilter) > 0) { @@ -1130,22 +1130,22 @@ struct TableMaker { // fill stats information, before selections for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (collision.selection_bit(i)) { - (reinterpret_cast(fStatsList->At(kStatsEvent)))->Fill(2.0, static_cast(i)); + (static_cast(fStatsList->At(kStatsEvent)))->Fill(2.0, static_cast(i)); } } - (reinterpret_cast(fStatsList->At(kStatsEvent)))->Fill(2.0, static_cast(o2::aod::evsel::kNsel)); + (static_cast(fStatsList->At(kStatsEvent)))->Fill(2.0, static_cast(o2::aod::evsel::kNsel)); if (fConfigZorro.fConfigRunZorro) { zorro.setBaseCCDBPath(fConfigCCDB.fConfigCcdbPathZorro.value); zorro.setBCtolerance(fConfigZorro.fBcTolerance); zorro.initCCDB(fCCDB.service, fCurrentRun, bc.timestamp(), fConfigZorro.fConfigZorroTrigMask.value); - zorro.populateExternalHists(fCurrentRun, reinterpret_cast(fStatsList->At(kStatsZorroInfo)), reinterpret_cast(fStatsList->At(kStatsZorroSel))); + zorro.populateExternalHists(fCurrentRun, static_cast(fStatsList->At(kStatsZorroInfo)), static_cast(fStatsList->At(kStatsZorroSel))); if (!fEventCut->IsSelected(dqtablemaker_helpers::varValues()) || (fConfigRCT.fConfigUseRCT.value && !rctChecker(collision))) { continue; } - bool zorroSel = zorro.isSelected(bc.globalBC(), fConfigZorro.fBcTolerance, reinterpret_cast(fStatsList->At(kStatsZorroSel))); + bool zorroSel = zorro.isSelected(bc.globalBC(), fConfigZorro.fBcTolerance, static_cast(fStatsList->At(kStatsZorroSel))); if (zorroSel) { tag |= (static_cast(true) << 56); // the same bit is used for this zorro selections from ccdb } @@ -1161,10 +1161,10 @@ struct TableMaker { // fill stats information, after selections for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (collision.selection_bit(i)) { - (reinterpret_cast(fStatsList->At(kStatsEvent)))->Fill(3.0, static_cast(i)); + (static_cast(fStatsList->At(kStatsEvent)))->Fill(3.0, static_cast(i)); } } - (reinterpret_cast(fStatsList->At(kStatsEvent)))->Fill(3.0, static_cast(o2::aod::evsel::kNsel)); + (static_cast(fStatsList->At(kStatsEvent)))->Fill(3.0, static_cast(o2::aod::evsel::kNsel)); fHistMan->FillHistClass("Event_AfterCuts", dqtablemaker_helpers::varValues()); @@ -1323,7 +1323,7 @@ struct TableMaker { if (fConfigHistOutput.fConfigQA && (fTrackIndexMap.find(track.globalIndex()) == fTrackIndexMap.end())) { fHistMan->FillHistClass(Form("TrackBarrel_%s", (*cut)->GetName()), dqtablemaker_helpers::varValues()); } - (reinterpret_cast(fStatsList->At(kStatsTracks)))->Fill(static_cast(i)); + (static_cast(fStatsList->At(kStatsTracks)))->Fill(static_cast(i)); } } if (!trackTempFilterMap) { @@ -1342,7 +1342,7 @@ struct TableMaker { trackFilteringTag |= static_cast(track.pidbit()); for (int iv0 = 0; iv0 < 5; iv0++) { if (track.pidbit() & (uint8_t(1) << iv0)) { - (reinterpret_cast(fStatsList->At(kStatsTracks)))->Fill(fTrackCuts.size() + static_cast(iv0)); + (static_cast(fStatsList->At(kStatsTracks)))->Fill(fTrackCuts.size() + static_cast(iv0)); } } // TODO: this part should be removed since the calibration histogram can be filled as any other histogram @@ -1379,9 +1379,9 @@ struct TableMaker { // Calculating the percentage of orphan tracks i.e., tracks which have no collisions associated to it if (!track.has_collision()) { - (reinterpret_cast(fStatsList->At(kStatsOrphanTracks)))->Fill(static_cast(-1)); + (static_cast(fStatsList->At(kStatsOrphanTracks)))->Fill(static_cast(-1)); } else { - (reinterpret_cast(fStatsList->At(kStatsOrphanTracks)))->Fill(0.9); + (static_cast(fStatsList->At(kStatsOrphanTracks)))->Fill(0.9); } // NOTE: The collision ID written in the table is the one of the original collision assigned in the AO2D. @@ -1593,7 +1593,7 @@ struct TableMaker { if (fConfigHistOutput.fConfigQA && (fFwdTrackIndexMap.find(muon.globalIndex()) == fFwdTrackIndexMap.end())) { fHistMan->FillHistClass(Form("Muons_%s", (*cut)->GetName()), dqtablemaker_helpers::varValues()); } - (reinterpret_cast(fStatsList->At(kStatsMuons)))->Fill(static_cast(i)); + (static_cast(fStatsList->At(kStatsMuons)))->Fill(static_cast(i)); } } @@ -2044,10 +2044,10 @@ struct TableMaker { { for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (bc.selection_bit(i) > 0) { - (reinterpret_cast(fStatsList->At(kStatsEvent)))->Fill(0.0, static_cast(i)); + (static_cast(fStatsList->At(kStatsEvent)))->Fill(0.0, static_cast(i)); } } - (reinterpret_cast(fStatsList->At(kStatsEvent)))->Fill(0.0, static_cast(o2::aod::evsel::kNsel)); + (static_cast(fStatsList->At(kStatsEvent)))->Fill(0.0, static_cast(o2::aod::evsel::kNsel)); } PROCESS_SWITCH(TableMaker, processPP, "Build full DQ skimmed data model for pp/p-Pb w/o event filtering (use Zorro)", false); From 7b6eb97eae40ef04bf9ece2e7a6313b2ffc7c4a1 Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Thu, 2 Jul 2026 14:28:50 +0200 Subject: [PATCH 07/24] readability-container-contains --- PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx | 6 +++--- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index 44439c90463..dcb2a66f70b 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -612,7 +612,7 @@ struct TableMakerMC { } // If this MC track was not already added to the map, add it now - if (fLabelsMap.find(mctrack.globalIndex()) == fLabelsMap.end()) { + if (!fLabelsMap.contains(mctrack.globalIndex())) { fLabelsMap[mctrack.globalIndex()] = trackCounter; fLabelsMapReversed[trackCounter] = mctrack.globalIndex(); fMCFlags[mctrack.globalIndex()] = mcflags; @@ -1454,7 +1454,7 @@ struct TableMakerMC { if (mctrack.has_mothers()) { for (auto& m : mctrack.mothersIds()) { if (m < mcParticles.size()) { // protect against bad mother indices - if (fLabelsMap.find(m) != fLabelsMap.end()) { + if (fLabelsMap.contains(m)) { mothers.push_back(fLabelsMap.find(m)->second); } } else { @@ -1471,7 +1471,7 @@ struct TableMakerMC { for (int d = mctrack.daughtersIds()[0]; d <= mctrack.daughtersIds()[1]; ++d) { // TODO: remove this check as soon as issues with MC production are fixed if (d < mcParticles.size()) { // protect against bad daughter indices - if (fLabelsMap.find(d) != fLabelsMap.end()) { + if (fLabelsMap.contains(d)) { daughters.push_back(fLabelsMap.find(d)->second); } } else { diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 7183c2feafd..ee4644f9337 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -757,7 +757,7 @@ struct TableMaker { oVtxZ[collision.globalIndex()] = collision.posZ(); // if more than one collision per bunch, add that collision to the list for that bunch - if (oBCreversed.find(bc) == oBCreversed.end()) { + if (!oBCreversed.contains(bc)) { std::vector evs = {collision.globalIndex()}; oBCreversed[bc] = evs; } else { @@ -1449,7 +1449,7 @@ struct TableMaker { } // write the MFT track global index in the map for skimming (to make sure we have it just once) - if (fMftIndexMap.find(track.globalIndex()) == fMftIndexMap.end()) { + if (!fMftIndexMap.contains(track.globalIndex())) { uint32_t reducedEventIdx = fCollIndexMap[collision.globalIndex()]; outTables.mftTrack(reducedEventIdx, static_cast(0), track.pt(), track.eta(), track.phi()); // TODO: We are not writing the DCA at the moment, because this depend on the collision association From 68e8fa0428f55e24f13eaa1a674dd85ee43ef125 Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Thu, 2 Jul 2026 14:34:25 +0200 Subject: [PATCH 08/24] readability-implicit-bool-conversion --- PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx | 8 ++++---- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index dcb2a66f70b..77ebb002c09 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -393,7 +393,7 @@ struct TableMakerMC { // loop over MC signals and add them to the signals array for (int isig = 0; isig < objArray->GetEntries(); ++isig) { MCSignal* sig = o2::aod::dqmcsignals::GetMCSignal(objArray->At(isig)->GetName()); - if (sig) { + if (sig != nullptr) { fMCSignals.push_back(sig); } } @@ -403,7 +403,7 @@ struct TableMakerMC { if (addMCSignalsStr != "") { std::vector addMCSignals = dqmcsignals::GetMCSignalsFromJSON(addMCSignalsStr.Data()); for (auto& mcIt : addMCSignals) { - if (mcIt) { + if (mcIt != nullptr) { fMCSignals.push_back(mcIt); } } @@ -625,7 +625,7 @@ struct TableMakerMC { VarManager::FillEvent(mcCollision); int j = 0; for (auto signal = fMCSignals.begin(); signal != fMCSignals.end(); signal++, j++) { - if (mcflags & (static_cast(1) << j)) { + if ((mcflags & (static_cast(1) << j)) != 0) { fHistMan->FillHistClass(Form("MCTruth_%s", (*signal)->GetName()), dqtablemakermc_helpers::varValues()); } } @@ -1691,7 +1691,7 @@ struct TableMakerMC { void processOnlyBCs(soa::Join::iterator const& bc) { for (int i = 0; i < o2::aod::evsel::kNsel; i++) { - if (bc.alias_bit(i) > 0) { + if (static_cast(bc.alias_bit(i)) > 0) { (static_cast(fStatsList->At(0)))->Fill(0.0, static_cast(i)); } } diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index ee4644f9337..f065434d6af 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -2043,7 +2043,7 @@ struct TableMaker { void processOnlyBCs(soa::Join::iterator const& bc) { for (int i = 0; i < o2::aod::evsel::kNsel; i++) { - if (bc.selection_bit(i) > 0) { + if (static_cast(bc.selection_bit(i)) > 0) { (static_cast(fStatsList->At(kStatsEvent)))->Fill(0.0, static_cast(i)); } } From a7681344df270e5ff96c348ce92b0cc5b4ad154d Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Thu, 2 Jul 2026 14:37:33 +0200 Subject: [PATCH 09/24] readability-simplify-boolean-expr --- PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx | 2 +- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index 77ebb002c09..927514f6ae5 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -1312,7 +1312,7 @@ struct TableMakerMC { { // Check whether the run changed and update CCDB if it did if (bcs.size() > 0 && fCurrentRun != bcs.begin().runNumber()) { - if (fIsRun2 == true) { + if (fIsRun2) { fGrpMagRun2 = fCCDB->getForTimeStamp(fConfigCCDB.fGrpMagPathRun2, bcs.begin().timestamp()); if (fGrpMagRun2 != nullptr) { o2::base::Propagator::initFieldFromGRP(fGrpMagRun2); diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index f065434d6af..d4cf361c1db 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -1719,7 +1719,7 @@ struct TableMaker { } VarManager::SetCalibrationType(fConfigPostCalibTPC.fConfigTPCpostCalibType, fConfigPostCalibTPC.fConfigTPCuseInterpolatedCalib); } - if (fIsRun2 == true) { + if (fIsRun2) { fGrpMagRun2 = fCCDB->getForTimeStamp(fConfigCCDB.fConfigGrpMagPathRun2, bcs.begin().timestamp()); if (fGrpMagRun2 != nullptr) { o2::base::Propagator::initFieldFromGRP(fGrpMagRun2); From 720124435d3c525e44b75252df29b81503797eb1 Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Thu, 2 Jul 2026 14:41:20 +0200 Subject: [PATCH 10/24] readability-container-size-empty --- PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx | 6 +++--- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index 927514f6ae5..ffa29682dab 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -1357,7 +1357,7 @@ struct TableMakerMC { eventMClabels.reserve(collisions.size()); eventInfo.reserve(collisions.size()); skimCollisions(collisions, bcs); - if (fCollIndexMap.size() == 0) { + if (fCollIndexMap.empty()) { return; } @@ -1408,7 +1408,7 @@ struct TableMakerMC { } // loop over selected collisions and select the tracks and fwd tracks to be skimmed - if (fCollIndexMap.size() > 0) { + if (!fCollIndexMap.empty()) { for (auto const& [origIdx, skimIdx] : fCollIndexMap) { auto collision = collisions.rawIteratorAt(origIdx); // group the tracks and muons for this collision @@ -1481,7 +1481,7 @@ struct TableMakerMC { } } int daughterRange[2] = {-1, -1}; - if (daughters.size() > 0) { + if (!daughters.empty()) { daughterRange[0] = daughters[0]; daughterRange[1] = daughters[daughters.size() - 1]; } diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index d4cf361c1db..c95b8c03f40 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -847,7 +847,7 @@ struct TableMaker { // iterate over the time maps to obtain the median time fOccup.oMedianTimeLongA[collision] = 0.0; float sumMult = 0.0; - if (oTimeMapLongA.size() > 0) { + if (!oTimeMapLongA.empty()) { for (auto& [dt, mult] : oTimeMapLongA) { sumMult += mult; if (sumMult > fOccup.oContribLongA[collision] / 2.0) { @@ -858,7 +858,7 @@ struct TableMaker { } fOccup.oMedianTimeLongC[collision] = 0.0; sumMult = 0.0; - if (oTimeMapLongC.size() > 0) { + if (!oTimeMapLongC.empty()) { for (auto& [dt, mult] : oTimeMapLongC) { sumMult += mult; if (sumMult > fOccup.oContribLongC[collision] / 2.0) { @@ -869,7 +869,7 @@ struct TableMaker { } fOccup.oMedianTimeShortA[collision] = 0.0; sumMult = 0.0; - if (oTimeMapShortA.size() > 0) { + if (!oTimeMapShortA.empty()) { for (auto& [dt, mult] : oTimeMapShortA) { sumMult += mult; if (sumMult > fOccup.oContribShortA[collision] / 2.0) { @@ -880,7 +880,7 @@ struct TableMaker { } fOccup.oMedianTimeShortC[collision] = 0.0; sumMult = 0.0; - if (oTimeMapShortC.size() > 0) { + if (!oTimeMapShortC.empty()) { for (auto& [dt, mult] : oTimeMapShortC) { sumMult += mult; if (sumMult > fOccup.oContribShortC[collision] / 2.0) { @@ -1762,7 +1762,7 @@ struct TableMaker { outTables.eventVtxCov.reserve(collisions.size()); skimCollisions(collisions, bcs, zdcs, ft0s, fv0as, fdds); - if (fCollIndexMap.size() == 0) { + if (fCollIndexMap.empty()) { return; } From c06df5b7e473eecd9c281465ce1018580475af8f Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Thu, 2 Jul 2026 14:45:48 +0200 Subject: [PATCH 11/24] modernize-avoid-c-arrays --- PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx | 5 +++-- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index ffa29682dab..56f1795ce33 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -64,6 +64,7 @@ #include +#include #include #include #include @@ -1480,7 +1481,7 @@ struct TableMakerMC { } } } - int daughterRange[2] = {-1, -1}; + std::array daughterRange{-1, -1}; if (!daughters.empty()) { daughterRange[0] = daughters[0]; daughterRange[1] = daughters[daughters.size() - 1]; @@ -1564,7 +1565,7 @@ struct TableMakerMC { for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); cut++, ib++) { histTracks->GetXaxis()->SetBinLabel(ib, (*cut)->GetName()); } - const char* v0TagNames[5] = {"Photon conversion", "K^{0}_{s}", "#Lambda", "#bar{#Lambda}", "#Omega"}; + constexpr std::array v0TagNames = {"Photon conversion", "K^{0}_{s}", "#Lambda", "#bar{#Lambda}", "#Omega"}; for (int ib = 0; ib < 5; ib++) { histTracks->GetXaxis()->SetBinLabel(fTrackCuts.size() + 1 + ib, v0TagNames[ib]); } diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index c95b8c03f40..9a13605caee 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -692,7 +692,7 @@ struct TableMaker { for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); cut++, ib++) { histTracks->GetXaxis()->SetBinLabel(ib, (*cut)->GetName()); } - const char* v0TagNames[5] = {"Photon conversion", "K^{0}_{s}", "#Lambda", "#bar{#Lambda}", "#Omega"}; + constexpr std::array v0TagNames = {"Photon conversion", "K^{0}_{s}", "#Lambda", "#bar{#Lambda}", "#Omega"}; for (ib = 0; ib < 5; ib++) { histTracks->GetXaxis()->SetBinLabel(fTrackCuts.size() + 1 + ib, v0TagNames[ib]); } From 953cdc1dd2f406d19339d34b6214aa5c8d1f0a2d Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Thu, 2 Jul 2026 16:13:22 +0200 Subject: [PATCH 12/24] fixing bug --- PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index 56f1795ce33..c81df5f32f3 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -1490,7 +1490,7 @@ struct TableMakerMC { // NOTE: Here we assume that MC collisions are not filtered, so there is no new vs old index map for translation auto mcCollision = mctrack.template mcCollision_as(); trackMC(mcCollision.globalIndex(), mctrack.pdgCode(), mctrack.statusCode(), mctrack.flags(), - mothers, daughterRange, + mothers, daughterRange.data(), mctrack.weight(), mctrack.pt(), mctrack.eta(), mctrack.phi(), mctrack.e(), mctrack.vx(), mctrack.vy(), mctrack.vz(), mctrack.vt(), mcflags); for (unsigned int isig = 0; isig < fMCSignals.size(); isig++) { From a942332bd39bcb6261117f78738a526c8a6d7887 Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Thu, 2 Jul 2026 17:31:51 +0200 Subject: [PATCH 13/24] performance-unnecessary-value-param --- PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx | 2 +- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index c81df5f32f3..4326302dca2 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -1504,7 +1504,7 @@ struct TableMakerMC { } // end loop over labels } - void DefineHistograms(TString histClasses) + void DefineHistograms(const TString& histClasses) { std::unique_ptr objArray(histClasses.Tokenize(";")); for (Int_t iclass = 0; iclass < objArray->GetEntries(); ++iclass) { diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 9a13605caee..07d79e4fa41 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -604,7 +604,7 @@ struct TableMaker { VarManager::SetUseVars(AnalysisCut::fgUsedVars); // provide the list of required variables so that VarManager knows what to fill } - void DefineHistograms(TString histClasses) + void DefineHistograms(const TString& histClasses) { // Create histograms via HistogramManager std::unique_ptr objArray(histClasses.Tokenize(";")); @@ -2075,7 +2075,7 @@ struct TableMaker { PROCESS_SWITCH(TableMaker, processOnlyBCs, "Analyze the BCs to store sampled lumi", false); }; -void DefineHistograms(HistogramManager* histMan, TString histClasses, Configurable configVar) +void DefineHistograms(HistogramManager* histMan, const TString& histClasses, const Configurable& configVar) { // // Define here the histograms for all the classes required in analysis. From 033b88cb7bb839a28a0395c03b485403734d064b Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Fri, 3 Jul 2026 09:42:58 +0200 Subject: [PATCH 14/24] clang format --- PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx | 4 ++-- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index 4326302dca2..741bef72dc5 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -264,12 +264,12 @@ struct TableMakerMC { o2::parameters::GRPObject* fGrpMagRun2 = nullptr; // for run 2, we access the GRPObject from GLO/GRP/GRP o2::parameters::GRPMagField* fGrpMag = nullptr; // for run 3, we access GRPMagField from GLO/Config/GRPMagField - AnalysisCompositeCut* fEventCut = nullptr; //! Event selection cut + AnalysisCompositeCut* fEventCut = nullptr; //! Event selection cut std::vector fTrackCuts; //! Barrel track cuts std::vector fMuonCuts; //! Muon track cuts bool fDoDetailedQA = false; // Bool to set detailed QA true, if QA is set true - int fCurrentRun = -1; // needed to detect if the run changed and trigger update of calibrations etc. + int fCurrentRun = -1; // needed to detect if the run changed and trigger update of calibrations etc. // list of MCsignal objects std::vector fMCSignals; diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 07d79e4fa41..d0069dab2ab 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -333,12 +333,12 @@ struct TableMaker { o2::parameters::GRPObject* fGrpMagRun2 = nullptr; // for run 2, we access the GRPObject from GLO/GRP/GRP o2::parameters::GRPMagField* fGrpMag = nullptr; // for run 3, we access GRPMagField from GLO/Config/GRPMagField - AnalysisCompositeCut* fEventCut = nullptr; //! Event selection cut + AnalysisCompositeCut* fEventCut = nullptr; //! Event selection cut std::vector fTrackCuts; //! Barrel track cuts std::vector fMuonCuts; //! Muon track cuts bool fDoDetailedQA = false; // Bool to set detailed QA true, if QA is set true - int fCurrentRun = -1; // needed to detect if the run changed and trigger update of calibrations etc. + int fCurrentRun = -1; // needed to detect if the run changed and trigger update of calibrations etc. // maps used to store index info; NOTE: std::map are sorted in ascending order by default (needed for track to collision indices) std::map fCollIndexMap; // key: old collision index, value: skimmed collision index From 09c8d2f8e88236ca51cc11f7ab1940b1fdeb5180 Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Fri, 3 Jul 2026 10:01:39 +0200 Subject: [PATCH 15/24] using O2 LOG instead of cout --- PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index 741bef72dc5..f3715a84758 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -67,7 +68,6 @@ #include #include #include -#include #include #include #include @@ -75,9 +75,6 @@ #include #include -using std::cout; -using std::endl; - using namespace o2; using namespace o2::framework; using namespace o2::framework::expressions; @@ -142,6 +139,7 @@ inline TString* varNames() { return static_cast(VarManager::fgVariable inline TString* varUnits() { return static_cast(VarManager::fgVariableUnits); } } // namespace dqtablemakermc_helpers +/* template void PrintBitMap(TMap map, int nbits) { @@ -149,6 +147,7 @@ void PrintBitMap(TMap map, int nbits) cout << ((map & (TMap(1) << i)) > 0 ? "1" : "0"); } } +*/ struct TableMakerMC { @@ -1459,8 +1458,8 @@ struct TableMakerMC { mothers.push_back(fLabelsMap.find(m)->second); } } else { - cout << "Mother label (" << m << ") exceeds the McParticles size (" << mcParticles.size() << ")" << endl; - cout << " Check the MC generator" << endl; + LOG(warn) << "Mother label (" << m << ") exceeds the McParticles size (" << mcParticles.size() << ")"; + LOG(warn) << "Check the MC generator"; } } } @@ -1476,8 +1475,8 @@ struct TableMakerMC { daughters.push_back(fLabelsMap.find(d)->second); } } else { - cout << "Daughter label (" << d << ") exceeds the McParticles size (" << mcParticles.size() << ")" << endl; - cout << " Check the MC generator" << endl; + LOG(warn) << "Daughter label (" << d << ") exceeds the McParticles size (" << mcParticles.size() << ")"; + LOG(warn) << "Check the MC generator"; } } } @@ -1507,7 +1506,7 @@ struct TableMakerMC { void DefineHistograms(const TString& histClasses) { std::unique_ptr objArray(histClasses.Tokenize(";")); - for (Int_t iclass = 0; iclass < objArray->GetEntries(); ++iclass) { + for (int iclass = 0; iclass < objArray->GetEntries(); ++iclass) { TString classStr = objArray->At(iclass)->GetName(); if (fConfigHistOutput.fConfigQA) { fHistMan->AddHistClass(classStr.Data()); From 32d62ad46ca33ccc76a9febb39e2e0b224f4aa14 Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Fri, 3 Jul 2026 10:18:34 +0200 Subject: [PATCH 16/24] const-ref-in-for-loop (MC) --- .../TableProducer/tableMakerMC_withAssoc.cxx | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index f3715a84758..450a7145fd6 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -367,7 +367,7 @@ struct TableMakerMC { } // Barrel track histograms after cuts; one directory per cut if (fConfigHistOutput.fConfigQA) { - for (auto& cut : fTrackCuts) { + for (const auto& cut : fTrackCuts) { histClasses += Form("TrackBarrel_%s;", cut->GetName()); } } @@ -380,7 +380,7 @@ struct TableMakerMC { } // Muon track histograms after cuts; one directory per cut if (fConfigHistOutput.fConfigQA) { - for (auto& muonCut : fMuonCuts) { + for (const auto& muonCut : fMuonCuts) { histClasses += Form("Muons_%s;", muonCut->GetName()); } } @@ -402,27 +402,27 @@ struct TableMakerMC { TString addMCSignalsStr = fConfigMCSignalsJSON.value; if (addMCSignalsStr != "") { std::vector addMCSignals = dqmcsignals::GetMCSignalsFromJSON(addMCSignalsStr.Data()); - for (auto& mcIt : addMCSignals) { + for (const auto& mcIt : addMCSignals) { if (mcIt != nullptr) { fMCSignals.push_back(mcIt); } } } - for (auto& mcIt : fMCSignals) { + for (const auto& mcIt : fMCSignals) { if (fConfigHistOutput.fConfigQA) { histClasses += Form("MCTruth_%s;", mcIt->GetName()); } if (fDoDetailedQA) { if (isBarrelEnabled) { // in case of detailed QA, setup histogram directories for each combination of reconstructed track cuts and MC signals - for (auto& cut : fTrackCuts) { + for (const auto& cut : fTrackCuts) { histClasses += Form("TrackBarrel_%s_%s;", cut->GetName(), mcIt->GetName()); } } if (isMuonEnabled) { // in case of detailed QA, setup histogram directories for each combination of reconstructed muon cuts and MC signals - for (auto& cut : fMuonCuts) { + for (const auto& cut : fMuonCuts) { histClasses += Form("Muons_%s_%s;", cut->GetName(), mcIt->GetName()); } } @@ -476,7 +476,7 @@ struct TableMakerMC { TString addEvCutsStr = fConfigCuts.fConfigEventCutsJSON.value; if (addEvCutsStr != "") { std::vector addEvCuts = dqcuts::GetCutsFromJSON(addEvCutsStr.Data()); - for (auto& cutIt : addEvCuts) { + for (const auto& cutIt : addEvCuts) { fEventCut->AddCut(cutIt); } } @@ -493,7 +493,7 @@ struct TableMakerMC { TString addTrackCutsStr = fConfigCuts.fConfigTrackCutsJSON.value; if (addTrackCutsStr != "") { std::vector addTrackCuts = dqcuts::GetCutsFromJSON(addTrackCutsStr.Data()); - for (auto& t : addTrackCuts) { + for (const auto& t : addTrackCuts) { fTrackCuts.push_back(static_cast(t)); } } @@ -510,7 +510,7 @@ struct TableMakerMC { TString addMuonCutsStr = fConfigCuts.fConfigMuonCutsJSON.value; if (addMuonCutsStr != "") { std::vector addMuonCuts = dqcuts::GetCutsFromJSON(addMuonCutsStr.Data()); - for (auto& t : addMuonCuts) { + for (const auto& t : addMuonCuts) { fMuonCuts.push_back(static_cast(t)); } } @@ -532,7 +532,7 @@ struct TableMakerMC { VarManager::ResetValues(0, VarManager::kNVars); // Loop over MC collisions - for (auto& mcCollision : mcCollisions) { + for (const auto& mcCollision : mcCollisions) { // Get MC collision information into the VarManager VarManager::FillEvent(mcCollision); // Fill histograms @@ -559,11 +559,11 @@ struct TableMakerMC { auto mcflags = static_cast(0); // flags which will hold the decisions for each MC signal int trackCounter = 0; - for (auto& mctrack : mcTracks) { + for (const auto& mctrack : mcTracks) { // check all the requested MC signals and fill the decision bit map mcflags = 0; int i = 0; - for (auto& sig : fMCSignals) { + for (const auto& sig : fMCSignals) { bool checked = false; if constexpr (soa::is_soa_filtered_v) { auto mctrack_raw = mcTracks.rawIteratorAt(mctrack.globalIndex()); @@ -587,7 +587,7 @@ struct TableMakerMC { PrintBitMap(mcflags, 16); cout << endl; if (mctrack.has_mothers()) { - for (auto& m : mctrack.mothersIds()) { + for (const auto& m : mctrack.mothersIds()) { if (m < mcTracks.size()) { // protect against bad mother indices auto aMother = mcTracks.rawIteratorAt(m); cout << "<<<<<< mother idx / pdg: " << m << " / " << aMother.pdgCode() << endl; @@ -949,13 +949,13 @@ struct TableMakerMC { int i = 0; // runs over the MC signals int j = 0; // runs over the track cuts // check all the specified signals and fill histograms for MC truth matched tracks - for (auto& sig : fMCSignals) { + for (const auto& sig : fMCSignals) { if (sig->CheckSignal(true, mctrack)) { mcflags |= (static_cast(1) << i); // If detailed QA is on, fill histograms for each MC signal and track cut combination if (fDoDetailedQA) { j = 0; - for (auto& cut : fTrackCuts) { + for (const auto& cut : fTrackCuts) { if (trackTempFilterMap & (uint8_t(1) << j)) { fHistMan->FillHistClass(Form("TrackBarrel_%s_%s", cut->GetName(), sig->GetName()), dqtablemakermc_helpers::varValues()); // fill the reconstructed truth } @@ -1014,7 +1014,7 @@ struct TableMakerMC { mcflags = 0; int i = 0; // runs over the MC signals // check all the specified signals and fill histograms for MC truth matched tracks - for (auto& sig : fMCSignals) { + for (const auto& sig : fMCSignals) { if (sig->CheckSignal(true, mctrack)) { mcflags |= (static_cast(1) << i); // If detailed QA is on, fill histograms for each MC signal and track cut combination @@ -1057,7 +1057,7 @@ struct TableMakerMC { } } } - for (auto& pairCand : mCandidates) { + for (const auto& pairCand : mCandidates) { fBestMatch[pairCand.second.second] = true; } } @@ -1091,7 +1091,7 @@ struct TableMakerMC { } } } - for (auto& pairCand : mCandidates) { + for (const auto& pairCand : mCandidates) { fBestMatch[pairCand.second.second] = true; } } @@ -1196,12 +1196,12 @@ struct TableMakerMC { int i = 0; // runs over the MC signals int j = 0; // runs over the track cuts // check all the specified signals and fill histograms for MC truth matched tracks - for (auto& sig : fMCSignals) { + for (const auto& sig : fMCSignals) { if (sig->CheckSignal(true, mctrack)) { mcflags |= (static_cast(1) << i); if (fDoDetailedQA) { j = 0; - for (auto& cut : fMuonCuts) { + for (const auto& cut : fMuonCuts) { if (trackTempFilterMap & (uint8_t(1) << j)) { fHistMan->FillHistClass(Form("Muons_%s_%s", cut->GetName(), sig->GetName()), dqtablemakermc_helpers::varValues()); // fill the reconstructed truth } @@ -1402,7 +1402,7 @@ struct TableMakerMC { } if constexpr (static_cast(TMFTFillMap & VarManager::ObjTypes::MFTCov)) { - for (auto& mfttrackConv : mftCovs) { + for (const auto& mfttrackConv : mftCovs) { map_mfttrackcovs[mfttrackConv.matchMFTTrackId()] = mfttrackConv.globalIndex(); } } @@ -1452,7 +1452,7 @@ struct TableMakerMC { std::vector mothers; if (mctrack.has_mothers()) { - for (auto& m : mctrack.mothersIds()) { + for (const auto& m : mctrack.mothersIds()) { if (m < mcParticles.size()) { // protect against bad mother indices if (fLabelsMap.contains(m)) { mothers.push_back(fLabelsMap.find(m)->second); @@ -1662,7 +1662,7 @@ struct TableMakerMC { { fullSkimming(collisions, bcs, nullptr, tracksMuon, mftTracks, nullptr, fwdTrackAssocs, mftAssocs, mcCollisions, mcParticles, nullptr); /*LOGP(info, "---------------------------"); - for (auto& mcCollision : mcCollisions) { + for (const auto& mcCollision : mcCollisions) { LOGP(info, "Gen. FT0C centrality = {}", mcCollision.bestCollisionCentFT0C()); //LOGP(info, "Gen. FT0C centrality = {}", mcCollision.posZ()); } From f60e74e26777ec25e7d8c1ad642219e823519d14 Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Fri, 3 Jul 2026 10:20:45 +0200 Subject: [PATCH 17/24] const-ref-in-for-loop --- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 30 ++++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index d0069dab2ab..f3f92f5f5b3 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -497,7 +497,7 @@ struct TableMaker { } if (fConfigHistOutput.fConfigQA) { // Barrel track histograms after selections; one histogram directory for each user specified selection - for (auto& cut : fTrackCuts) { + for (const auto& cut : fTrackCuts) { histClasses += Form("TrackBarrel_%s;", cut->GetName()); } } @@ -516,7 +516,7 @@ struct TableMaker { } if (fConfigHistOutput.fConfigQA) { // Muon tracks after selections; one directory per selection - for (auto& muonCut : fMuonCuts) { + for (const auto& muonCut : fMuonCuts) { histClasses += Form("Muons_%s;", muonCut->GetName()); } } @@ -562,7 +562,7 @@ struct TableMaker { TString addEvCutsStr = fConfigCuts.fConfigEventCutsJSON.value; if (addEvCutsStr != "") { std::vector addEvCuts = dqcuts::GetCutsFromJSON(addEvCutsStr.Data()); - for (auto& cutIt : addEvCuts) { + for (const auto& cutIt : addEvCuts) { fEventCut->AddCut(cutIt); } } @@ -579,7 +579,7 @@ struct TableMaker { TString addTrackCutsStr = fConfigCuts.fConfigTrackCutsJSON.value; if (addTrackCutsStr != "") { std::vector addTrackCuts = dqcuts::GetCutsFromJSON(addTrackCutsStr.Data()); - for (auto& t : addTrackCuts) { + for (const auto& t : addTrackCuts) { fTrackCuts.push_back(static_cast(t)); } } @@ -596,7 +596,7 @@ struct TableMaker { TString addMuonCutsStr = fConfigCuts.fConfigMuonCutsJSON.value; if (addMuonCutsStr != "") { std::vector addMuonCuts = dqcuts::GetCutsFromJSON(addMuonCutsStr.Data()); - for (auto& t : addMuonCuts) { + for (const auto& t : addMuonCuts) { fMuonCuts.push_back(static_cast(t)); } } @@ -608,7 +608,7 @@ struct TableMaker { { // Create histograms via HistogramManager std::unique_ptr objArray(histClasses.Tokenize(";")); - for (Int_t iclass = 0; iclass < objArray->GetEntries(); ++iclass) { + for (int iclass = 0; iclass < objArray->GetEntries(); ++iclass) { TString classStr = objArray->At(iclass)->GetName(); if (fConfigHistOutput.fConfigQA) { fHistMan->AddHistClass(classStr.Data()); @@ -801,7 +801,7 @@ struct TableMaker { // check if this collision is also within the short time range bool isShort = (thisBC >= pastShortBC && thisBC < futureShortBC); // loop over all collisions in this BC - for (auto& thisColl : colls) { + for (const auto& thisColl : colls) { // skip if this is the same collision if (thisColl == collision) { continue; @@ -848,7 +848,7 @@ struct TableMaker { fOccup.oMedianTimeLongA[collision] = 0.0; float sumMult = 0.0; if (!oTimeMapLongA.empty()) { - for (auto& [dt, mult] : oTimeMapLongA) { + for (const auto& [dt, mult] : oTimeMapLongA) { sumMult += mult; if (sumMult > fOccup.oContribLongA[collision] / 2.0) { fOccup.oMedianTimeLongA[collision] = dt; @@ -859,7 +859,7 @@ struct TableMaker { fOccup.oMedianTimeLongC[collision] = 0.0; sumMult = 0.0; if (!oTimeMapLongC.empty()) { - for (auto& [dt, mult] : oTimeMapLongC) { + for (const auto& [dt, mult] : oTimeMapLongC) { sumMult += mult; if (sumMult > fOccup.oContribLongC[collision] / 2.0) { fOccup.oMedianTimeLongC[collision] = dt; @@ -870,7 +870,7 @@ struct TableMaker { fOccup.oMedianTimeShortA[collision] = 0.0; sumMult = 0.0; if (!oTimeMapShortA.empty()) { - for (auto& [dt, mult] : oTimeMapShortA) { + for (const auto& [dt, mult] : oTimeMapShortA) { sumMult += mult; if (sumMult > fOccup.oContribShortA[collision] / 2.0) { fOccup.oMedianTimeShortA[collision] = dt; @@ -881,7 +881,7 @@ struct TableMaker { fOccup.oMedianTimeShortC[collision] = 0.0; sumMult = 0.0; if (!oTimeMapShortC.empty()) { - for (auto& [dt, mult] : oTimeMapShortC) { + for (const auto& [dt, mult] : oTimeMapShortC) { sumMult += mult; if (sumMult > fOccup.oContribShortC[collision] / 2.0) { fOccup.oMedianTimeShortC[collision] = dt; @@ -1478,7 +1478,7 @@ struct TableMaker { } } } - for (auto& pairCand : mCandidates) { + for (const auto& pairCand : mCandidates) { fBestMatch[pairCand.second.second] = true; } } @@ -1512,7 +1512,7 @@ struct TableMaker { } } } - for (auto& pairCand : mCandidates) { + for (const auto& pairCand : mCandidates) { fBestMatch[pairCand.second.second] = true; } } @@ -1796,7 +1796,7 @@ struct TableMaker { } if constexpr (static_cast(TMFTFillMap & VarManager::ObjTypes::MFTCov)) { - for (auto& mfttrackConv : mftCovs) { + for (const auto& mfttrackConv : mftCovs) { map_mfttrackcovs[mfttrackConv.matchMFTTrackId()] = mfttrackConv.globalIndex(); } } @@ -2083,7 +2083,7 @@ void DefineHistograms(HistogramManager* histMan, const TString& histClasses, con // The histogram classes and their components histograms are defined below depending on the name of the histogram class // std::unique_ptr objArray(histClasses.Tokenize(";")); - for (Int_t iclass = 0; iclass < objArray->GetEntries(); ++iclass) { + for (int iclass = 0; iclass < objArray->GetEntries(); ++iclass) { TString classStr = objArray->At(iclass)->GetName(); histMan->AddHistClass(classStr.Data()); From 469c7599870b807c00a16e70d226a4bcd11117ca Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Fri, 3 Jul 2026 10:24:54 +0200 Subject: [PATCH 18/24] const-ref-in-process --- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 26 ++++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index f3f92f5f5b3..5a43afcf07e 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -1865,7 +1865,7 @@ struct TableMaker { } // produce the barrel-only DQ skimmed data model typically for pp/p-Pb or UPC Pb-Pb (no centrality), subscribe to the DQ event filter (filter-pp or filter-PbPb) - void processPPWithFilterBarrelOnly(MyEventsWithMultsAndFilter const& collisions, MyBCs const& bcs, aod::Zdcs& zdcs, + void processPPWithFilterBarrelOnly(MyEventsWithMultsAndFilter const& collisions, MyBCs const& bcs, aod::Zdcs const& zdcs, MyBarrelTracksWithCov const& tracksBarrel, TrackAssoc const& trackAssocs) { @@ -1888,7 +1888,7 @@ struct TableMaker { } // produce the barrel-only DQ skimmed data model typically for pp/p-Pb or UPC Pb-Pb (no centrality), meant to run on skimmed data - void processPPBarrelOnly(MyEventsWithMults const& collisions, MyBCs const& bcs, aod::Zdcs& zdcs, + void processPPBarrelOnly(MyEventsWithMults const& collisions, MyBCs const& bcs, aod::Zdcs const& zdcs, MyBarrelTracksWithCov const& tracksBarrel, TrackAssoc const& trackAssocs) { @@ -1938,7 +1938,7 @@ struct TableMaker { MyBarrelTracksWithCov const& tracksBarrel, MyMuonsWithCov const& muons, MFTTracks const& mftTracks, TrackAssoc const& trackAssocs, FwdTrackAssoc const& fwdTrackAssocs, - MFTTrackAssoc const& mftAssocs, aod::FT0s& ft0s, aod::FV0As& fv0as, aod::FDDs& fdds) + MFTTrackAssoc const& mftAssocs, aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds) { fullSkimming(collisions, bcs, nullptr, tracksBarrel, muons, mftTracks, trackAssocs, fwdTrackAssocs, mftAssocs, nullptr, ft0s, fv0as, fdds); } @@ -1946,7 +1946,7 @@ struct TableMaker { // produce the barrel only DQ skimmed data model typically for Pb-Pb (with centrality), no subscribtion to the DQ event filter void processPbPbBarrelOnly(MyEventsWithCentAndMultsQvect const& collisions, MyBCs const& bcs, MyBarrelTracksWithCov const& tracksBarrel, - TrackAssoc const& trackAssocs, aod::FT0s& ft0s, aod::FV0As& fv0as, aod::FDDs& fdds) + TrackAssoc const& trackAssocs, aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds) { computeOccupancyEstimators(collisions, tracksPosWithCov, tracksNegWithCov, presliceWithCov, bcs); computeCollMergingTag(collisions, tracksBarrel, presliceWithCov); @@ -1956,7 +1956,7 @@ struct TableMaker { // produce the barrel only DQ skimmed data model typically for Pb-Pb (with centrality), no TOF void processPbPbBarrelOnlyNoTOF(MyEventsWithCentAndMultsQvect const& collisions, MyBCs const& bcs, MyBarrelTracksWithCovNoTOF const& tracksBarrel, - TrackAssoc const& trackAssocs, aod::FT0s& ft0s, aod::FV0As& fv0as, aod::FDDs& fdds) + TrackAssoc const& trackAssocs, aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds) { computeOccupancyEstimators(collisions, tracksPosWithCovNoTOF, tracksNegWithCovNoTOF, presliceWithCovNoTOF, bcs); computeCollMergingTag(collisions, tracksBarrel, presliceWithCovNoTOF); @@ -1964,9 +1964,9 @@ struct TableMaker { } // produce the barrel-only DQ skimmed data model typically for UPC Pb-Pb (no centrality), subscribe to the DQ rapidity gap event filter (filter-PbPb) - void processPbPbWithFilterBarrelOnly(MyEventsWithMultsAndRapidityGapFilter const& collisions, MyBCs const& bcs, aod::Zdcs& zdcs, + void processPbPbWithFilterBarrelOnly(MyEventsWithMultsAndRapidityGapFilter const& collisions, MyBCs const& bcs, aod::Zdcs const& zdcs, MyBarrelTracksWithCov const& tracksBarrel, - TrackAssoc const& trackAssocs, aod::FT0s& ft0s, aod::FV0As& fv0as, aod::FDDs& fdds) + TrackAssoc const& trackAssocs, aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds) { computeOccupancyEstimators(collisions, tracksPosWithCov, tracksNegWithCov, presliceWithCov, bcs); computeCollMergingTag(collisions, tracksBarrel, presliceWithCov); @@ -1976,7 +1976,7 @@ struct TableMaker { // produce the barrel only DQ skimmed data model typically for Pb-Pb (with centrality), no subscribtion to the DQ event filter void processPbPbBarrelOnlyWithV0Bits(MyEventsWithCentAndMultsQvect const& collisions, MyBCs const& bcs, MyBarrelTracksWithV0Bits const& tracksBarrel, - TrackAssoc const& trackAssocs, aod::FT0s& ft0s, aod::FV0As& fv0as, aod::FDDs& fdds) + TrackAssoc const& trackAssocs, aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds) { computeOccupancyEstimators(collisions, tracksPos, tracksNeg, preslice, bcs); computeCollMergingTag(collisions, tracksBarrel, preslice); @@ -1986,7 +1986,7 @@ struct TableMaker { // produce the barrel only DQ skimmed data model typically for Pb-Pb (with centrality), no subscribtion to the DQ event filter void processPbPbBarrelOnlyWithV0BitsNoTOF(MyEventsWithCentAndMultsQvect const& collisions, MyBCs const& bcs, MyBarrelTracksWithV0BitsNoTOF const& tracksBarrel, - TrackAssoc const& trackAssocs, aod::FT0s& ft0s, aod::FV0As& fv0as, aod::FDDs& fdds) + TrackAssoc const& trackAssocs, aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds) { computeOccupancyEstimators(collisions, tracksPosNoTOF, tracksNegNoTOF, presliceNoTOF, bcs); computeCollMergingTag(collisions, tracksBarrel, presliceNoTOF); @@ -1995,14 +1995,14 @@ struct TableMaker { // produce the muon only DQ skimmed data model typically for Pb-Pb (with centrality), no subscribtion to the DQ event filter void processPbPbMuonOnly(MyEventsWithCentAndMults const& collisions, MyBCs const& bcs, - MyMuonsWithCov const& muons, FwdTrackAssoc const& fwdTrackAssocs, aod::FT0s& ft0s, aod::FV0As& fv0as, aod::FDDs& fdds) + MyMuonsWithCov const& muons, FwdTrackAssoc const& fwdTrackAssocs, aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds) { fullSkimming(collisions, bcs, nullptr, nullptr, muons, nullptr, nullptr, fwdTrackAssocs, nullptr, nullptr, ft0s, fv0as, fdds); } // produce the muon-only DQ skimmed data model typically for UPC Pb-Pb (no centrality), subscribe to the DQ rapidity gap event filter (filter-PbPb) - void processPbPbWithFilterMuonOnly(MyEventsWithMultsAndRapidityGapFilter const& collisions, MyBCs const& bcs, aod::Zdcs& zdcs, - MyMuonsWithCov const& muons, FwdTrackAssoc const& fwdTrackAssocs, aod::FT0s& ft0s, aod::FV0As& fv0as, aod::FDDs& fdds) + void processPbPbWithFilterMuonOnly(MyEventsWithMultsAndRapidityGapFilter const& collisions, MyBCs const& bcs, aod::Zdcs const& zdcs, + MyMuonsWithCov const& muons, FwdTrackAssoc const& fwdTrackAssocs, aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds) { fullSkimming(collisions, bcs, zdcs, nullptr, muons, nullptr, nullptr, fwdTrackAssocs, nullptr, nullptr, ft0s, fv0as, fdds); } @@ -2010,7 +2010,7 @@ struct TableMaker { // produce the muon only DQ skimmed data model typically for Pb-Pb (with centrality and flow), no subscribtion to the DQ event filter // no DCA table filled by the FwdTracExtension to optimize the memory consumption void processPbPbStreamMuonOnly(MyEventsWithCentAndMultsQvect const& collisions, MyBCs const& bcs, - MyMuonsNoDca const& muons, FwdTrackAssoc const& fwdTrackAssocs, aod::FT0s& ft0s, aod::FV0As& fv0as, aod::FDDs& fdds) + MyMuonsNoDca const& muons, FwdTrackAssoc const& fwdTrackAssocs, aod::FT0s const& ft0s, aod::FV0As const& fv0as, aod::FDDs const& fdds) { fullSkimming(collisions, bcs, nullptr, nullptr, muons, nullptr, nullptr, fwdTrackAssocs, nullptr, nullptr, ft0s, fv0as, fdds); } From f3d4459ed02a96bd60ef8e36a99eef7f717d5709 Mon Sep 17 00:00:00 2001 From: mcoquet642 <74600025+mcoquet642@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:22:05 +0200 Subject: [PATCH 19/24] Apply suggestion from @vkucera MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vít Kučera <26327373+vkucera@users.noreply.github.com> --- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 5a43afcf07e..9d399b4e504 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -580,7 +580,7 @@ struct TableMaker { if (addTrackCutsStr != "") { std::vector addTrackCuts = dqcuts::GetCutsFromJSON(addTrackCutsStr.Data()); for (const auto& t : addTrackCuts) { - fTrackCuts.push_back(static_cast(t)); + fTrackCuts.push_back(dynamic_cast(t)); } } From cb98dec3f4de07b42af16baa936636067497b39d Mon Sep 17 00:00:00 2001 From: mcoquet642 <74600025+mcoquet642@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:22:25 +0200 Subject: [PATCH 20/24] Apply suggestion from @vkucera MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vít Kučera <26327373+vkucera@users.noreply.github.com> --- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 9d399b4e504..75b80a0fea8 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -692,8 +692,8 @@ struct TableMaker { for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); cut++, ib++) { histTracks->GetXaxis()->SetBinLabel(ib, (*cut)->GetName()); } - constexpr std::array v0TagNames = {"Photon conversion", "K^{0}_{s}", "#Lambda", "#bar{#Lambda}", "#Omega"}; - for (ib = 0; ib < 5; ib++) { + constexpr std::array v0TagNames{"Photon conversion", "K^{0}_{s}", "#Lambda", "#bar{#Lambda}", "#Omega"}; + for (ib = 0; ib < v0TagNames.size(); ib++) { histTracks->GetXaxis()->SetBinLabel(fTrackCuts.size() + 1 + ib, v0TagNames[ib]); } fStatsList->AddAt(histTracks, kStatsTracks); From a8a09b901b771ee9b17391347f1825e5da94386b Mon Sep 17 00:00:00 2001 From: mcoquet642 <74600025+mcoquet642@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:22:37 +0200 Subject: [PATCH 21/24] Apply suggestion from @vkucera MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vít Kučera <26327373+vkucera@users.noreply.github.com> --- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 75b80a0fea8..6e1c716f020 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -1018,7 +1018,7 @@ struct TableMaker { bool isTriggerZNA = bc.selection_bit(aod::evsel::kIsBBZNA); bool isTriggerZNC = bc.selection_bit(aod::evsel::kIsBBZNC); - (static_cast(fStatsList->At(kStatsBcs)))->Fill(0.0, muTVX); + (dynamic_cast(fStatsList->At(kStatsBcs)))->Fill(0.0, muTVX); if (isTvx) { (static_cast(fStatsList->At(kStatsBcs)))->Fill(1.0, muTVX); if (noBorder) { From 0108fc47d0b93335ce7dd58b091d2ad3c6888179 Mon Sep 17 00:00:00 2001 From: mcoquet642 <74600025+mcoquet642@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:22:48 +0200 Subject: [PATCH 22/24] Apply suggestion from @vkucera MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vít Kučera <26327373+vkucera@users.noreply.github.com> --- PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index 450a7145fd6..23faeee7fc0 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -843,9 +843,9 @@ struct TableMakerMC { // so in case of multiple associations, the variables depending on the collision association (e.g. DCA, secondary vertexing, etc) // have to be recomputed at analysis time for each association. - auto trackFilteringTag = static_cast(0); - auto trackTempFilterMap = static_cast(0); - auto mcflags = static_cast(0); + uint64_t trackFilteringTag{0}; + uint32_t trackTempFilterMap{0}; + uint16_t mcflags{0}; int trackCounter = fLabelsMap.size(); // Loop over associations From 21672ae0b4fb81274a8b7721076b50585ba477b3 Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Fri, 3 Jul 2026 18:33:23 +0200 Subject: [PATCH 23/24] fixing casts --- .../TableProducer/tableMakerMC_withAssoc.cxx | 30 ++++++------- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 44 +++++++++---------- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index 23faeee7fc0..bbef3cb17ce 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -494,7 +494,7 @@ struct TableMakerMC { if (addTrackCutsStr != "") { std::vector addTrackCuts = dqcuts::GetCutsFromJSON(addTrackCutsStr.Data()); for (const auto& t : addTrackCuts) { - fTrackCuts.push_back(static_cast(t)); + fTrackCuts.push_back(dynamic_cast(t)); } } @@ -511,7 +511,7 @@ struct TableMakerMC { if (addMuonCutsStr != "") { std::vector addMuonCuts = dqcuts::GetCutsFromJSON(addMuonCutsStr.Data()); for (const auto& t : addMuonCuts) { - fMuonCuts.push_back(static_cast(t)); + fMuonCuts.push_back(dynamic_cast(t)); } } @@ -728,10 +728,10 @@ struct TableMakerMC { // Fill the stats event histogram with the event selection bits for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (collision.selection_bit(i)) { - (static_cast(fStatsList->At(0)))->Fill(1.0, static_cast(i)); + (dynamic_cast(fStatsList->At(0)))->Fill(1.0, static_cast(i)); } } - (static_cast(fStatsList->At(0)))->Fill(1.0, static_cast(o2::aod::evsel::kNsel)); + (dynamic_cast(fStatsList->At(0)))->Fill(1.0, static_cast(o2::aod::evsel::kNsel)); auto bc = collision.template bc_as(); // store the selection decisions @@ -762,10 +762,10 @@ struct TableMakerMC { // fill stats information, before selections for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (collision.selection_bit(i)) { - (static_cast(fStatsList->At(0)))->Fill(2.0, static_cast(i)); + (dynamic_cast(fStatsList->At(0)))->Fill(2.0, static_cast(i)); } } - (static_cast(fStatsList->At(0)))->Fill(2.0, static_cast(o2::aod::evsel::kNsel)); + (dynamic_cast(fStatsList->At(0)))->Fill(2.0, static_cast(o2::aod::evsel::kNsel)); // Apply the user specified event selection if (!fEventCut->IsSelected(dqtablemakermc_helpers::varValues()) || (fConfigRCT.fConfigUseRCT.value && !(rctChecker(collision)))) { @@ -775,10 +775,10 @@ struct TableMakerMC { // fill stats information, after selections for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (collision.selection_bit(i)) { - (static_cast(fStatsList->At(0)))->Fill(3.0, static_cast(i)); + (dynamic_cast(fStatsList->At(0)))->Fill(3.0, static_cast(i)); } } - (static_cast(fStatsList->At(0)))->Fill(3.0, static_cast(o2::aod::evsel::kNsel)); + (dynamic_cast(fStatsList->At(0)))->Fill(3.0, static_cast(o2::aod::evsel::kNsel)); // Fill historams after event cuts fHistMan->FillHistClass("Event_AfterCuts", dqtablemakermc_helpers::varValues()); @@ -879,7 +879,7 @@ struct TableMakerMC { if (fConfigHistOutput.fConfigQA) { fHistMan->FillHistClass(Form("TrackBarrel_%s", (*cut)->GetName()), dqtablemakermc_helpers::varValues()); } - (static_cast(fStatsList->At(1)))->Fill(static_cast(i)); + (dynamic_cast(fStatsList->At(1)))->Fill(static_cast(i)); } } if (!trackTempFilterMap) { @@ -898,7 +898,7 @@ struct TableMakerMC { trackFilteringTag |= static_cast(track.pidbit()); for (int iv0 = 0; iv0 < 5; iv0++) { if (track.pidbit() & (uint8_t(1) << iv0)) { - (static_cast(fStatsList->At(1)))->Fill(fTrackCuts.size() + static_cast(iv0)); + (dynamic_cast(fStatsList->At(1)))->Fill(fTrackCuts.size() + static_cast(iv0)); } } } // end if V0Bits @@ -1165,7 +1165,7 @@ struct TableMakerMC { if (fConfigHistOutput.fConfigQA) { fHistMan->FillHistClass(Form("Muons_%s", (*cut)->GetName()), dqtablemakermc_helpers::varValues()); } - (static_cast(fStatsList->At(2)))->Fill(static_cast(i)); + (dynamic_cast(fStatsList->At(2)))->Fill(static_cast(i)); } } @@ -1494,11 +1494,11 @@ struct TableMakerMC { mctrack.vx(), mctrack.vy(), mctrack.vz(), mctrack.vt(), mcflags); for (unsigned int isig = 0; isig < fMCSignals.size(); isig++) { if (mcflags & (static_cast(1) << isig)) { - (static_cast(fStatsList->At(3)))->Fill(static_cast(isig)); + (dynamic_cast(fStatsList->At(3)))->Fill(static_cast(isig)); } } if (mcflags == 0) { - (static_cast(fStatsList->At(3)))->Fill(static_cast(fMCSignals.size())); + (dynamic_cast(fStatsList->At(3)))->Fill(static_cast(fMCSignals.size())); } } // end loop over labels } @@ -1692,10 +1692,10 @@ struct TableMakerMC { { for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (static_cast(bc.alias_bit(i)) > 0) { - (static_cast(fStatsList->At(0)))->Fill(0.0, static_cast(i)); + (dynamic_cast(fStatsList->At(0)))->Fill(0.0, static_cast(i)); } } - (static_cast(fStatsList->At(0)))->Fill(0.0, static_cast(o2::aod::evsel::kNsel)); + (dynamic_cast(fStatsList->At(0)))->Fill(0.0, static_cast(o2::aod::evsel::kNsel)); } PROCESS_SWITCH(TableMakerMC, processPP, "Produce both barrel and muon skims, pp settings", false); diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 6e1c716f020..599c04dbc8a 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -597,7 +597,7 @@ struct TableMaker { if (addMuonCutsStr != "") { std::vector addMuonCuts = dqcuts::GetCutsFromJSON(addMuonCutsStr.Data()); for (const auto& t : addMuonCuts) { - fMuonCuts.push_back(static_cast(t)); + fMuonCuts.push_back(dynamic_cast(t)); } } @@ -1020,20 +1020,20 @@ struct TableMaker { (dynamic_cast(fStatsList->At(kStatsBcs)))->Fill(0.0, muTVX); if (isTvx) { - (static_cast(fStatsList->At(kStatsBcs)))->Fill(1.0, muTVX); + (dynamic_cast(fStatsList->At(kStatsBcs)))->Fill(1.0, muTVX); if (noBorder) { - (static_cast(fStatsList->At(kStatsBcs)))->Fill(2.0, muTVX); + (dynamic_cast(fStatsList->At(kStatsBcs)))->Fill(2.0, muTVX); if (isCentral) { - (static_cast(fStatsList->At(kStatsBcs)))->Fill(3.0, muTVX); + (dynamic_cast(fStatsList->At(kStatsBcs)))->Fill(3.0, muTVX); } if (isSemiCentral) { - (static_cast(fStatsList->At(kStatsBcs)))->Fill(4.0, muTVX); + (dynamic_cast(fStatsList->At(kStatsBcs)))->Fill(4.0, muTVX); } if (isCentral || isSemiCentral) { - (static_cast(fStatsList->At(kStatsBcs)))->Fill(5.0, muTVX); + (dynamic_cast(fStatsList->At(kStatsBcs)))->Fill(5.0, muTVX); } if (isTriggerZNA && isTriggerZNC) { - (static_cast(fStatsList->At(kStatsBcs)))->Fill(6.0, muTVX); + (dynamic_cast(fStatsList->At(kStatsBcs)))->Fill(6.0, muTVX); } } } @@ -1045,10 +1045,10 @@ struct TableMaker { for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (collision.selection_bit(i)) { - (static_cast(fStatsList->At(kStatsEvent)))->Fill(1.0, static_cast(i)); + (dynamic_cast(fStatsList->At(kStatsEvent)))->Fill(1.0, static_cast(i)); } } - (static_cast(fStatsList->At(kStatsEvent)))->Fill(1.0, static_cast(o2::aod::evsel::kNsel)); + (dynamic_cast(fStatsList->At(kStatsEvent)))->Fill(1.0, static_cast(o2::aod::evsel::kNsel)); // apply the event filter computed by filter-PP if constexpr ((TEventFillMap & VarManager::ObjTypes::EventFilter) > 0) { @@ -1130,22 +1130,22 @@ struct TableMaker { // fill stats information, before selections for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (collision.selection_bit(i)) { - (static_cast(fStatsList->At(kStatsEvent)))->Fill(2.0, static_cast(i)); + (dynamic_cast(fStatsList->At(kStatsEvent)))->Fill(2.0, static_cast(i)); } } - (static_cast(fStatsList->At(kStatsEvent)))->Fill(2.0, static_cast(o2::aod::evsel::kNsel)); + (dynamic_cast(fStatsList->At(kStatsEvent)))->Fill(2.0, static_cast(o2::aod::evsel::kNsel)); if (fConfigZorro.fConfigRunZorro) { zorro.setBaseCCDBPath(fConfigCCDB.fConfigCcdbPathZorro.value); zorro.setBCtolerance(fConfigZorro.fBcTolerance); zorro.initCCDB(fCCDB.service, fCurrentRun, bc.timestamp(), fConfigZorro.fConfigZorroTrigMask.value); - zorro.populateExternalHists(fCurrentRun, static_cast(fStatsList->At(kStatsZorroInfo)), static_cast(fStatsList->At(kStatsZorroSel))); + zorro.populateExternalHists(fCurrentRun, dynamic_cast(fStatsList->At(kStatsZorroInfo)), dynamic_cast(fStatsList->At(kStatsZorroSel))); if (!fEventCut->IsSelected(dqtablemaker_helpers::varValues()) || (fConfigRCT.fConfigUseRCT.value && !rctChecker(collision))) { continue; } - bool zorroSel = zorro.isSelected(bc.globalBC(), fConfigZorro.fBcTolerance, static_cast(fStatsList->At(kStatsZorroSel))); + bool zorroSel = zorro.isSelected(bc.globalBC(), fConfigZorro.fBcTolerance, dynamic_cast(fStatsList->At(kStatsZorroSel))); if (zorroSel) { tag |= (static_cast(true) << 56); // the same bit is used for this zorro selections from ccdb } @@ -1161,10 +1161,10 @@ struct TableMaker { // fill stats information, after selections for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (collision.selection_bit(i)) { - (static_cast(fStatsList->At(kStatsEvent)))->Fill(3.0, static_cast(i)); + (dynamic_cast(fStatsList->At(kStatsEvent)))->Fill(3.0, static_cast(i)); } } - (static_cast(fStatsList->At(kStatsEvent)))->Fill(3.0, static_cast(o2::aod::evsel::kNsel)); + (dynamic_cast(fStatsList->At(kStatsEvent)))->Fill(3.0, static_cast(o2::aod::evsel::kNsel)); fHistMan->FillHistClass("Event_AfterCuts", dqtablemaker_helpers::varValues()); @@ -1323,7 +1323,7 @@ struct TableMaker { if (fConfigHistOutput.fConfigQA && (fTrackIndexMap.find(track.globalIndex()) == fTrackIndexMap.end())) { fHistMan->FillHistClass(Form("TrackBarrel_%s", (*cut)->GetName()), dqtablemaker_helpers::varValues()); } - (static_cast(fStatsList->At(kStatsTracks)))->Fill(static_cast(i)); + (dynamic_cast(fStatsList->At(kStatsTracks)))->Fill(static_cast(i)); } } if (!trackTempFilterMap) { @@ -1342,7 +1342,7 @@ struct TableMaker { trackFilteringTag |= static_cast(track.pidbit()); for (int iv0 = 0; iv0 < 5; iv0++) { if (track.pidbit() & (uint8_t(1) << iv0)) { - (static_cast(fStatsList->At(kStatsTracks)))->Fill(fTrackCuts.size() + static_cast(iv0)); + (dynamic_cast(fStatsList->At(kStatsTracks)))->Fill(fTrackCuts.size() + static_cast(iv0)); } } // TODO: this part should be removed since the calibration histogram can be filled as any other histogram @@ -1379,9 +1379,9 @@ struct TableMaker { // Calculating the percentage of orphan tracks i.e., tracks which have no collisions associated to it if (!track.has_collision()) { - (static_cast(fStatsList->At(kStatsOrphanTracks)))->Fill(static_cast(-1)); + (dynamic_cast(fStatsList->At(kStatsOrphanTracks)))->Fill(static_cast(-1)); } else { - (static_cast(fStatsList->At(kStatsOrphanTracks)))->Fill(0.9); + (dynamic_cast(fStatsList->At(kStatsOrphanTracks)))->Fill(0.9); } // NOTE: The collision ID written in the table is the one of the original collision assigned in the AO2D. @@ -1593,7 +1593,7 @@ struct TableMaker { if (fConfigHistOutput.fConfigQA && (fFwdTrackIndexMap.find(muon.globalIndex()) == fFwdTrackIndexMap.end())) { fHistMan->FillHistClass(Form("Muons_%s", (*cut)->GetName()), dqtablemaker_helpers::varValues()); } - (static_cast(fStatsList->At(kStatsMuons)))->Fill(static_cast(i)); + (dynamic_cast(fStatsList->At(kStatsMuons)))->Fill(static_cast(i)); } } @@ -2044,10 +2044,10 @@ struct TableMaker { { for (int i = 0; i < o2::aod::evsel::kNsel; i++) { if (static_cast(bc.selection_bit(i)) > 0) { - (static_cast(fStatsList->At(kStatsEvent)))->Fill(0.0, static_cast(i)); + (dynamic_cast(fStatsList->At(kStatsEvent)))->Fill(0.0, static_cast(i)); } } - (static_cast(fStatsList->At(kStatsEvent)))->Fill(0.0, static_cast(o2::aod::evsel::kNsel)); + (dynamic_cast(fStatsList->At(kStatsEvent)))->Fill(0.0, static_cast(o2::aod::evsel::kNsel)); } PROCESS_SWITCH(TableMaker, processPP, "Build full DQ skimmed data model for pp/p-Pb w/o event filtering (use Zorro)", false); From e6251ad86474e970d66af08ec6d376b813f42bf6 Mon Sep 17 00:00:00 2001 From: Maurice Coquet Date: Fri, 3 Jul 2026 18:39:46 +0200 Subject: [PATCH 24/24] extra fixes --- PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx | 2 +- PWGDQ/TableProducer/tableMaker_withAssoc.cxx | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx index bbef3cb17ce..98818bd1a80 100644 --- a/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMakerMC_withAssoc.cxx @@ -1559,7 +1559,7 @@ struct TableMakerMC { fStatsList->Add(histEvents); // Track statistics: one bin for each track selection and 5 bins for V0 tags (gamma, K0s, Lambda, anti-Lambda, Omega) - TH1I* histTracks = new TH1I("TrackStats", "Track statistics", fTrackCuts.size() + 5.0, -0.5, fTrackCuts.size() - 0.5 + 5.0); + TH1I* histTracks = new TH1I("TrackStats", "Track statistics", fTrackCuts.size() + 5, -0.5, fTrackCuts.size() - 0.5 + 5.0); ib = 1; for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); cut++, ib++) { histTracks->GetXaxis()->SetBinLabel(ib, (*cut)->GetName()); diff --git a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx index 599c04dbc8a..48abbd5dc04 100644 --- a/PWGDQ/TableProducer/tableMaker_withAssoc.cxx +++ b/PWGDQ/TableProducer/tableMaker_withAssoc.cxx @@ -92,8 +92,6 @@ using namespace o2::framework::expressions; using namespace o2::aod; using namespace o2::aod::rctsel; -Zorro zorro; - // Declaration of various Joins used in the different process functions // TODO: Since DCA depends on which collision the track is associated to, we should remove writing and subscribing to DCA tables, to optimize on CPU / memory using MyBarrelTracks = soa::Join tracksNegWithCov = (((aod::track::flags & static_cast(o2::aod::track::PVContributor)) == static_cast(o2::aod::track::PVContributor)) && (aod::track::tgl < static_cast(-0.05))); ctpRateFetcher mRateFetcher; + Zorro zorro; parameters::GRPLHCIFData* mLHCIFdata = nullptr; struct { @@ -687,13 +686,13 @@ struct TableMaker { fStatsList->AddAt(histBcs, kStatsBcs); // Track statistics: one bin for each track selection and 5 bins for V0 tags (gamma, K0s, Lambda, anti-Lambda, Omega) - TH1D* histTracks = new TH1D("TrackStats", "Track statistics", fTrackCuts.size() + 5.0, -0.5, fTrackCuts.size() - 0.5 + 5.0); + TH1D* histTracks = new TH1D("TrackStats", "Track statistics", fTrackCuts.size() + 5, -0.5, fTrackCuts.size() - 0.5 + 5.0); ib = 1; for (auto cut = fTrackCuts.begin(); cut != fTrackCuts.end(); cut++, ib++) { histTracks->GetXaxis()->SetBinLabel(ib, (*cut)->GetName()); } constexpr std::array v0TagNames{"Photon conversion", "K^{0}_{s}", "#Lambda", "#bar{#Lambda}", "#Omega"}; - for (ib = 0; ib < v0TagNames.size(); ib++) { + for (ib = 0; ib < static_cast(v0TagNames.size()); ib++) { histTracks->GetXaxis()->SetBinLabel(fTrackCuts.size() + 1 + ib, v0TagNames[ib]); } fStatsList->AddAt(histTracks, kStatsTracks); @@ -899,12 +898,9 @@ struct TableMaker { auto bfilling = mLHCIFdata->getBunchFilling(); double nbc = bfilling.getFilledBCs().size(); - double tvxRate; - if (fConfigHistOutput.fConfigIrEstimator.value.empty()) { - tvxRate = mRateFetcher.fetch(fCCDB.service, timeStamp, bc.runNumber(), "T0VTX"); - } else { - tvxRate = mRateFetcher.fetch(fCCDB.service, timeStamp, bc.runNumber(), fConfigHistOutput.fConfigIrEstimator.value); - } + const double tvxRate = fConfigHistOutput.fConfigIrEstimator.value.empty() + ? mRateFetcher.fetch(fCCDB.service, timeStamp, bc.runNumber(), "T0VTX") + : mRateFetcher.fetch(fCCDB.service, timeStamp, bc.runNumber(), fConfigHistOutput.fConfigIrEstimator.value); double nTriggersPerFilledBC = tvxRate / nbc / o2::constants::lhc::LHCRevFreq; double mu = -std::log(1 - nTriggersPerFilledBC);