From a7862bb1ae22ca9f99d16f58cbb3e8c9e0a56789 Mon Sep 17 00:00:00 2001 From: Ana Marin Date: Thu, 25 Jun 2026 12:26:27 +0200 Subject: [PATCH 1/3] Fixing issues/14173 --- .../TableProducer/occupancyTableProducer.cxx | 50 +++++++------------ 1 file changed, 19 insertions(+), 31 deletions(-) diff --git a/Common/TableProducer/occupancyTableProducer.cxx b/Common/TableProducer/occupancyTableProducer.cxx index c3075e01d54..a146133ef45 100644 --- a/Common/TableProducer/occupancyTableProducer.cxx +++ b/Common/TableProducer/occupancyTableProducer.cxx @@ -433,47 +433,39 @@ struct OccupancyTableProducer { template void executeOccProducerProcessing(B const& BCs, C const& collisions, T const& tracks) { - if (tableMode == checkTableMode) { + if constexpr (tableMode == checkTableMode) { if (buildFlag00OccTable) { executeOccProducerProcessing(BCs, collisions, tracks); } else { executeOccProducerProcessing(BCs, collisions, tracks); } - } - if constexpr (tableMode == checkTableMode) { return; } - if (meanTableMode == checkTableMode) { + if constexpr (meanTableMode == checkTableMode) { if (buildFlag01OccMeanTable) { executeOccProducerProcessing(BCs, collisions, tracks); } else { executeOccProducerProcessing(BCs, collisions, tracks); } - } - if constexpr (meanTableMode == checkTableMode) { return; } - if (robustTableMode == checkTableMode) { + if constexpr (robustTableMode == checkTableMode) { if (buildFlag02OccRobustTable) { executeOccProducerProcessing(BCs, collisions, tracks); } else { executeOccProducerProcessing(BCs, collisions, tracks); } - } - if constexpr (robustTableMode == checkTableMode) { return; } - if (meanRobustTableMode == checkTableMode) { + if constexpr (meanRobustTableMode == checkTableMode) { if (buildFlag03OccMeanRobustTable) { executeOccProducerProcessing(BCs, collisions, tracks); } else { executeOccProducerProcessing(BCs, collisions, tracks); } - } - if constexpr (meanRobustTableMode == checkTableMode) { return; } @@ -802,7 +794,7 @@ struct OccupancyTableProducer { auto& vecOccPrimUnfm80 = occPrimUnfm80[i]; float meanOccPrimUnfm80 = TMath::Mean(vecOccPrimUnfm80.size(), vecOccPrimUnfm80.data()); - normalizeVector(vecOccPrimUnfm80, meanOccPrimUnfm80 / meanOccPrimUnfm80); + //normalizeVector(vecOccPrimUnfm80, meanOccPrimUnfm80 / meanOccPrimUnfm80); if constexpr (processMode == kProcessFullOccTableProducer || processMode == kProcessOnlyOccPrim || processMode == kProcessOnlyOccT0V0Prim || processMode == kProcessOnlyOccFDDT0V0Prim || processMode == kProcessOnlyOccNtrackDet || processMode == kProcessOnlyOccMultExtra) { if constexpr (tableMode == fillOccTable) { @@ -1699,20 +1691,22 @@ struct TrackMeanOccTableProducer { { occupancyQA.fill(HIST("occTrackQA/") + HIST(OccDire[occMode]) + HIST(OccNames[occName]), occValue); if (fillQA1) { - occupancyQA.fill(HIST("occTrackQA/LogRatio/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), std::log(std::abs(occValue / occRobustValue))); + float logRatio = std::log(occValue / occRobustValue); + float weighted = logRatio * std::sqrt(occValue + occRobustValue); + occupancyQA.fill(HIST("occTrackQA/LogRatio/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), logRatio); if (fillQA2) { int two = 2, twenty = 20, fifty = 50, twoHundred = 200; if (std::abs(std::log(occValue / occRobustValue)) < two) { // conditional filling start - occupancyQA.fill(HIST("occTrackQA/Condition1/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), (std::log(occValue / occRobustValue)) * std::sqrt(occValue + occRobustValue)); + occupancyQA.fill(HIST("occTrackQA/Condition1/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), weighted); if (std::abs(occRobustValue + occValue) > twoHundred) { - occupancyQA.fill(HIST("occTrackQA/Condition4/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), (std::log(occValue / occRobustValue)) * std::sqrt(occValue + occRobustValue)); - occupancyQA.fill(HIST("occTrackQA/Condition3/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), (std::log(occValue / occRobustValue)) * std::sqrt(occValue + occRobustValue)); - occupancyQA.fill(HIST("occTrackQA/Condition2/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), (std::log(occValue / occRobustValue)) * std::sqrt(occValue + occRobustValue)); + occupancyQA.fill(HIST("occTrackQA/Condition4/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), weighted); + occupancyQA.fill(HIST("occTrackQA/Condition3/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), weighted); + occupancyQA.fill(HIST("occTrackQA/Condition2/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), weighted); } else if (std::abs(occRobustValue + occValue) > fifty) { - occupancyQA.fill(HIST("occTrackQA/Condition3/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), (std::log(occValue / occRobustValue)) * std::sqrt(occValue + occRobustValue)); - occupancyQA.fill(HIST("occTrackQA/Condition2/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), (std::log(occValue / occRobustValue)) * std::sqrt(occValue + occRobustValue)); + occupancyQA.fill(HIST("occTrackQA/Condition3/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), weighted); + occupancyQA.fill(HIST("occTrackQA/Condition2/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), weighted); } else if (std::abs(occRobustValue + occValue) > twenty) { - occupancyQA.fill(HIST("occTrackQA/Condition2/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), (std::log(occValue / occRobustValue)) * std::sqrt(occValue + occRobustValue)); + occupancyQA.fill(HIST("occTrackQA/Condition2/") + HIST(OccDire[occRobustMode]) + HIST(OccDire[occMode]) + HIST(OccNames[occName]), weighted); } } // conditional filling end } @@ -1762,29 +1756,25 @@ struct TrackMeanOccTableProducer { return; } - if (meanTableMode == checkTableMode) { + if constexpr (meanTableMode == checkTableMode) { if (buildFlag00MeanTable) { executeTrackOccProducerProcessing(BCs, collisions, tracks, tracksQA, occsRobustT0V0Prim, occs, executeInThisBlock); } else { executeTrackOccProducerProcessing(BCs, collisions, tracks, tracksQA, occsRobustT0V0Prim, occs, executeInThisBlock); } - } - if constexpr (meanTableMode == checkTableMode) { return; } - if (weightMeanTableMode == checkTableMode) { + if constexpr (weightMeanTableMode == checkTableMode) { if (buildFlag01WeightMeanTable) { executeTrackOccProducerProcessing(BCs, collisions, tracks, tracksQA, occsRobustT0V0Prim, occs, executeInThisBlock); } else { executeTrackOccProducerProcessing(BCs, collisions, tracks, tracksQA, occsRobustT0V0Prim, occs, executeInThisBlock); } - } - if constexpr (weightMeanTableMode == checkTableMode) { return; } - if (qaMode == checkQAMode) { + if constexpr (qaMode == checkQAMode) { if (fillQA1 || fillQA2) { if (occsRobustT0V0Prim.size() == 0) { LOG(error) << "DEBUG :: ERROR ERROR ERROR :: OccsRobustT0V0Prim.size() == 0 :: Check \"occupancy-table-producer\" for \"buildOnlyOccsT0V0Prim == true\" & \"processOnlyOccT0V0PrimUnfm == true\""; @@ -1794,8 +1784,6 @@ struct TrackMeanOccTableProducer { } else { executeTrackOccProducerProcessing(BCs, collisions, tracks, tracksQA, occsRobustT0V0Prim, occs, executeInThisBlock); } - } - if constexpr (qaMode == checkQAMode) { return; } @@ -1972,6 +1960,7 @@ struct TrackMeanOccTableProducer { getTimingInfo(bc, lastRun, nBCsPerTF, bcSOR, time, tfIdThis, bcInTF); } + if (tfIdThis != oldTFid) { oldTFid = tfIdThis; auto occsList = occs.iteratorAt(bc.occId()); @@ -2421,7 +2410,6 @@ struct TrackMeanOccTableProducer { { occupancyQA.fill(HIST("h_DFcount_Lvl0"), kProcessNothing); return; - occupancyQA.fill(HIST("h_DFcount_Lvl1"), kProcessNothing); } PROCESS_SWITCH(TrackMeanOccTableProducer, processNothing, "process Nothing From Track Mean Occ Table Producer", true); From b253950feffa49d0bb774dd79b1878f37a538f7a Mon Sep 17 00:00:00 2001 From: Ana Marin Date: Thu, 25 Jun 2026 15:00:42 +0200 Subject: [PATCH 2/3] fixing issues --- Common/TableProducer/occupancyTableProducer.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Common/TableProducer/occupancyTableProducer.cxx b/Common/TableProducer/occupancyTableProducer.cxx index a146133ef45..3e30b94a950 100644 --- a/Common/TableProducer/occupancyTableProducer.cxx +++ b/Common/TableProducer/occupancyTableProducer.cxx @@ -794,7 +794,7 @@ struct OccupancyTableProducer { auto& vecOccPrimUnfm80 = occPrimUnfm80[i]; float meanOccPrimUnfm80 = TMath::Mean(vecOccPrimUnfm80.size(), vecOccPrimUnfm80.data()); - //normalizeVector(vecOccPrimUnfm80, meanOccPrimUnfm80 / meanOccPrimUnfm80); + // normalizeVector(vecOccPrimUnfm80, meanOccPrimUnfm80 / meanOccPrimUnfm80); if constexpr (processMode == kProcessFullOccTableProducer || processMode == kProcessOnlyOccPrim || processMode == kProcessOnlyOccT0V0Prim || processMode == kProcessOnlyOccFDDT0V0Prim || processMode == kProcessOnlyOccNtrackDet || processMode == kProcessOnlyOccMultExtra) { if constexpr (tableMode == fillOccTable) { @@ -1946,21 +1946,20 @@ struct TrackMeanOccTableProducer { if (doAmbgUpdate) { // sKipping ambiguous tracks for now, will be updated in future continue; } - if (doCollisionUpdate || doAmbgUpdate) { // collision.globalIndex() != oldCollisionIndex){ //don't update if info is same as old collision + if (doCollisionUpdate) { // collision.globalIndex() != oldCollisionIndex){ //don't update if info is same as old collision if (doCollisionUpdate) { oldCollisionIndex = collision.globalIndex(); bc = collision.template bc_as(); } - if (doAmbgUpdate) { + // if (doAmbgUpdate) { // to be updated later // bc = collisions.iteratorAt(2).bc_as(); // bc = ambgTracks.iteratorAt(0).bc_as(); - } + // } // LOG(info)<<" What happens in the case when the collision id is = -1 and it tries to obtain bc" getTimingInfo(bc, lastRun, nBCsPerTF, bcSOR, time, tfIdThis, bcInTF); } - if (tfIdThis != oldTFid) { oldTFid = tfIdThis; auto occsList = occs.iteratorAt(bc.occId()); From 685aa0ce0ab654870ffa997fc9bc136a6297598a Mon Sep 17 00:00:00 2001 From: Ana Marin Date: Thu, 25 Jun 2026 15:10:44 +0200 Subject: [PATCH 3/3] fixing issues --- Common/TableProducer/occupancyTableProducer.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Common/TableProducer/occupancyTableProducer.cxx b/Common/TableProducer/occupancyTableProducer.cxx index 3e30b94a950..2b51331ff11 100644 --- a/Common/TableProducer/occupancyTableProducer.cxx +++ b/Common/TableProducer/occupancyTableProducer.cxx @@ -1952,9 +1952,9 @@ struct TrackMeanOccTableProducer { bc = collision.template bc_as(); } // if (doAmbgUpdate) { - // to be updated later - // bc = collisions.iteratorAt(2).bc_as(); - // bc = ambgTracks.iteratorAt(0).bc_as(); + // to be updated later + // bc = collisions.iteratorAt(2).bc_as(); + // bc = ambgTracks.iteratorAt(0).bc_as(); // } // LOG(info)<<" What happens in the case when the collision id is = -1 and it tries to obtain bc" getTimingInfo(bc, lastRun, nBCsPerTF, bcSOR, time, tfIdThis, bcInTF);