From 4bd1e70202af1d2b71ac1155636b45f77bab8e9d Mon Sep 17 00:00:00 2001 From: Uliana Dmitrieva Date: Mon, 16 Mar 2026 15:40:11 +0100 Subject: [PATCH 1/8] Duplicate variable removed Duplicate variable for the number of ZDC towers was removed. --- Common/TableProducer/zdcExtraTableProducer.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Common/TableProducer/zdcExtraTableProducer.cxx b/Common/TableProducer/zdcExtraTableProducer.cxx index 500854b196b..95e284397ef 100644 --- a/Common/TableProducer/zdcExtraTableProducer.cxx +++ b/Common/TableProducer/zdcExtraTableProducer.cxx @@ -176,7 +176,7 @@ struct ZdcExtraTableProducer { void process(ColEvSels const& cols, BCsRun3 const& /*bcs*/, aod::Zdcs const& /*zdcs*/) { // collision-based event selection - int nTowers = 4; // number of ZDC towers + constexpr int kNTowers = 4; // number of ZDC towers for (auto const& collision : cols) { const auto& foundBC = collision.foundBC_as(); @@ -219,7 +219,7 @@ struct ZdcExtraTableProducer { double pmqZNA[4] = {}; // if (isZNChit) { - for (int it = 0; it < nTowers; it++) { + for (int it = 0; it < kNTowers; it++) { pmqZNC[it] = (zdc.energySectorZNC())[it]; sumZNC += pmqZNC[it]; } @@ -231,7 +231,7 @@ struct ZdcExtraTableProducer { registry.get(HIST("ZNCsumq"))->Fill(sumZNC); } if (isZNAhit) { - for (int it = 0; it < nTowers; it++) { + for (int it = 0; it < kNTowers; it++) { pmqZNA[it] = (zdc.energySectorZNA())[it]; sumZNA += pmqZNA[it]; } @@ -257,7 +257,6 @@ struct ZdcExtraTableProducer { float numXZNA = 0., numYZNA = 0., denZNA = 0.; // Calculate weighted sums of the x and y coordinates - constexpr int kNTowers = 4; // number of ZDC towers for (int i = 0; i < kNTowers; i++) { if (pmqZNC[i] > 0.) { float wZNC = std::pow(pmqZNC[i], kAlpha); From 04aafb91f83729bcc3b43f0974e017cc3fd0bb38 Mon Sep 17 00:00:00 2001 From: Uliana Dmitrieva Date: Mon, 16 Mar 2026 17:15:18 +0100 Subject: [PATCH 2/8] Add QA histogram saving option and update registry Added a flag cfgSaveQaHistos to control saving QA histograms and updated histogram registration accordingly. --- .../TableProducer/zdcExtraTableProducer.cxx | 67 ++++++++++++------- 1 file changed, 44 insertions(+), 23 deletions(-) diff --git a/Common/TableProducer/zdcExtraTableProducer.cxx b/Common/TableProducer/zdcExtraTableProducer.cxx index 95e284397ef..9b7d853cc33 100644 --- a/Common/TableProducer/zdcExtraTableProducer.cxx +++ b/Common/TableProducer/zdcExtraTableProducer.cxx @@ -67,8 +67,9 @@ struct ZdcExtraTableProducer { Configurable cfgEvSelsIsGoodITSLayersAll{"cfgEvSelsIsGoodITSLayersAll", true, "Event selection: is good ITS layers all"}; // Calibration settings Configurable cfgCalibrationDownscaling{"cfgCalibrationDownscaling", 1.f, "Percentage of events to be saved to derived table"}; - - HistogramRegistry registry{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + // Output settings + Configurable cfgSaveQaHistos{"cfgSaveQaHistos", false, "Flag to save QA histograms"}; enum SelectionCriteria { evSel_zvtx, @@ -83,8 +84,27 @@ struct ZdcExtraTableProducer { nEventSelections }; + HistogramRegistry registry{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + void init(InitContext const&) { + + registry.add("hEventCount", "Number of Event; Cut; #Events Passed Cut", {HistType::kTH1D, {{nEventSelections, 0, nEventSelections}}}); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_allEvents + 1, "All events"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_zvtx + 1, "vtxZ"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_sel8 + 1, "Sel8"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_occupancy + 1, "kOccupancy"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kNoSameBunchPileup + 1, "kNoSameBunchPileup"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsGoodZvtxFT0vsPV + 1, "kIsGoodZvtxFT0vsPV"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kNoCollInTimeRangeStandard + 1, "kNoCollInTimeRangeStandard"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsVertexITSTPC + 1, "kIsVertexITSTPC"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsGoodITSLayersAll + 1, "kIsGoodITSLayersAll"); + + // Skip histogram registration if QA flag is false + if (!cfgSaveQaHistos) { + return;} + + registry.add("ZNApmc", "ZNApmc; ZNA PMC; Entries", {HistType::kTH1F, {{nBins, -0.5, maxZN}}}); registry.add("ZNCpmc", "ZNCpmc; ZNC PMC; Entries", {HistType::kTH1F, {{nBins, -0.5, maxZN}}}); registry.add("ZNApm1", "ZNApm1; ZNA PM1; Entries", {HistType::kTH1F, {{nBins, -0.5, maxZN}}}); @@ -101,16 +121,6 @@ struct ZdcExtraTableProducer { registry.add("ZNACentroid", "ZNA Centroid; X; Y", {HistType::kTH2F, {{50, -1.5, 1.5}, {50, -1.5, 1.5}}}); registry.add("ZNCCentroid", "ZNC Centroid; X; Y", {HistType::kTH2F, {{50, -1.5, 1.5}, {50, -1.5, 1.5}}}); - registry.add("hEventCount", "Number of Event; Cut; #Events Passed Cut", {HistType::kTH1D, {{nEventSelections, 0, nEventSelections}}}); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_allEvents + 1, "All events"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_zvtx + 1, "vtxZ"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_sel8 + 1, "Sel8"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_occupancy + 1, "kOccupancy"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kNoSameBunchPileup + 1, "kNoSameBunchPileup"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsGoodZvtxFT0vsPV + 1, "kIsGoodZvtxFT0vsPV"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kNoCollInTimeRangeStandard + 1, "kNoCollInTimeRangeStandard"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsVertexITSTPC + 1, "kIsVertexITSTPC"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsGoodITSLayersAll + 1, "kIsGoodITSLayersAll"); } template @@ -119,7 +129,7 @@ struct ZdcExtraTableProducer { uint8_t selectionBits = 0; bool selected; - registry.fill(HIST("hEventCount"), evSel_allEvents); + registry.fill(HIST("hEventCount"), evSel_allEvents); selected = std::fabs(collision.posZ()) < cfgEvSelVtxZ; if (selected) { @@ -130,44 +140,44 @@ struct ZdcExtraTableProducer { selected = collision.sel8(); if (selected) { selectionBits |= (uint8_t)(0x1u << evSel_sel8); - registry.fill(HIST("hEventCount"), evSel_sel8); + registry.fill(HIST("hEventCount"), evSel_sel8); } auto occupancy = collision.trackOccupancyInTimeRange(); selected = occupancy <= cfgEvSelsMaxOccupancy; if (selected) { selectionBits |= (uint8_t)(0x1u << evSel_occupancy); - registry.fill(HIST("hEventCount"), evSel_occupancy); + registry.fill(HIST("hEventCount"), evSel_occupancy); } selected = collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup); if (selected) { selectionBits |= (uint8_t)(0x1u << evSel_kNoSameBunchPileup); - registry.fill(HIST("hEventCount"), evSel_kNoSameBunchPileup); + registry.fill(HIST("hEventCount"), evSel_kNoSameBunchPileup); } selected = collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV); if (selected) { selectionBits |= (uint8_t)(0x1u << evSel_kIsGoodZvtxFT0vsPV); - registry.fill(HIST("hEventCount"), evSel_kIsGoodZvtxFT0vsPV); + registry.fill(HIST("hEventCount"), evSel_kIsGoodZvtxFT0vsPV); } selected = collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard); if (selected) { selectionBits |= (uint8_t)(0x1u << evSel_kNoCollInTimeRangeStandard); - registry.fill(HIST("hEventCount"), evSel_kNoCollInTimeRangeStandard); + registry.fill(HIST("hEventCount"), evSel_kNoCollInTimeRangeStandard); } selected = collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC); if (selected) { selectionBits |= (uint8_t)(0x1u << evSel_kIsVertexITSTPC); - registry.fill(HIST("hEventCount"), evSel_kIsVertexITSTPC); + registry.fill(HIST("hEventCount"), evSel_kIsVertexITSTPC); } selected = collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll); if (selected) { selectionBits |= (uint8_t)(0x1u << evSel_kIsGoodITSLayersAll); - registry.fill(HIST("hEventCount"), evSel_kIsGoodITSLayersAll); + registry.fill(HIST("hEventCount"), evSel_kIsGoodITSLayersAll); } return selectionBits; @@ -196,12 +206,13 @@ struct ZdcExtraTableProducer { // double tdcZNC = zdc.timeZNC(); double tdcZNA = zdc.timeZNA(); + // OR we can select a narrow window in both ZN TDCs using the configurable parameters if (tdcCut) { // a narrow TDC window is set - if ((tdcZNC >= tdcZNmincut) && (tdcZNC <= tdcZNmaxcut)) { + if ((tdcZNC >= tdcZNmincut) && (tdcZNC <= tdcZNmaxcut) ) { isZNChit = true; } - if ((tdcZNA >= tdcZNmincut) && (tdcZNA <= tdcZNmaxcut)) { + if ((tdcZNA >= tdcZNmincut) && (tdcZNA <= tdcZNmaxcut) ) { isZNAhit = true; } } else { // if no window on TDC is set @@ -223,19 +234,25 @@ struct ZdcExtraTableProducer { pmqZNC[it] = (zdc.energySectorZNC())[it]; sumZNC += pmqZNC[it]; } - registry.get(HIST("ZNCpmc"))->Fill(pmcZNC); + + if (cfgSaveQaHistos) + { + registry.get(HIST("ZNCpmc"))->Fill(pmcZNC); registry.get(HIST("ZNCpm1"))->Fill(pmqZNC[0]); registry.get(HIST("ZNCpm2"))->Fill(pmqZNC[1]); registry.get(HIST("ZNCpm3"))->Fill(pmqZNC[2]); registry.get(HIST("ZNCpm4"))->Fill(pmqZNC[3]); registry.get(HIST("ZNCsumq"))->Fill(sumZNC); } + } if (isZNAhit) { for (int it = 0; it < kNTowers; it++) { pmqZNA[it] = (zdc.energySectorZNA())[it]; sumZNA += pmqZNA[it]; } // + if (cfgSaveQaHistos) + { registry.get(HIST("ZNApmc"))->Fill(pmcZNA); registry.get(HIST("ZNApm1"))->Fill(pmqZNA[0]); registry.get(HIST("ZNApm2"))->Fill(pmqZNA[1]); @@ -243,6 +260,7 @@ struct ZdcExtraTableProducer { registry.get(HIST("ZNApm4"))->Fill(pmqZNA[3]); registry.get(HIST("ZNAsumq"))->Fill(sumZNA); } + } // Q-vectors (centroid) calculation // kBeamEne -- LHC Run 3 Pb-Pb collision energy (5.36 TeV per nucleon pair) @@ -306,8 +324,11 @@ struct ZdcExtraTableProducer { centroidZNA[0] = 999.; centroidZNA[1] = 999.; } + if (cfgSaveQaHistos) + { registry.get(HIST("ZNCCentroid"))->Fill(centroidZNC[0], centroidZNC[1]); registry.get(HIST("ZNACentroid"))->Fill(centroidZNA[0], centroidZNA[1]); + } auto vz = collision.posZ(); auto vx = collision.posX(); From ad1fe18d9a8ce3309e27c011c40a03d249881789 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Mon, 16 Mar 2026 16:18:19 +0000 Subject: [PATCH 3/8] Please consider the following formatting changes --- .../TableProducer/zdcExtraTableProducer.cxx | 70 +++++++++---------- 1 file changed, 33 insertions(+), 37 deletions(-) diff --git a/Common/TableProducer/zdcExtraTableProducer.cxx b/Common/TableProducer/zdcExtraTableProducer.cxx index 9b7d853cc33..b734ed065ef 100644 --- a/Common/TableProducer/zdcExtraTableProducer.cxx +++ b/Common/TableProducer/zdcExtraTableProducer.cxx @@ -67,7 +67,7 @@ struct ZdcExtraTableProducer { Configurable cfgEvSelsIsGoodITSLayersAll{"cfgEvSelsIsGoodITSLayersAll", true, "Event selection: is good ITS layers all"}; // Calibration settings Configurable cfgCalibrationDownscaling{"cfgCalibrationDownscaling", 1.f, "Percentage of events to be saved to derived table"}; - + // Output settings Configurable cfgSaveQaHistos{"cfgSaveQaHistos", false, "Flag to save QA histograms"}; @@ -102,9 +102,9 @@ struct ZdcExtraTableProducer { // Skip histogram registration if QA flag is false if (!cfgSaveQaHistos) { - return;} - - + return; + } + registry.add("ZNApmc", "ZNApmc; ZNA PMC; Entries", {HistType::kTH1F, {{nBins, -0.5, maxZN}}}); registry.add("ZNCpmc", "ZNCpmc; ZNC PMC; Entries", {HistType::kTH1F, {{nBins, -0.5, maxZN}}}); registry.add("ZNApm1", "ZNApm1; ZNA PM1; Entries", {HistType::kTH1F, {{nBins, -0.5, maxZN}}}); @@ -120,7 +120,6 @@ struct ZdcExtraTableProducer { registry.add("ZNACentroid", "ZNA Centroid; X; Y", {HistType::kTH2F, {{50, -1.5, 1.5}, {50, -1.5, 1.5}}}); registry.add("ZNCCentroid", "ZNC Centroid; X; Y", {HistType::kTH2F, {{50, -1.5, 1.5}, {50, -1.5, 1.5}}}); - } template @@ -129,7 +128,7 @@ struct ZdcExtraTableProducer { uint8_t selectionBits = 0; bool selected; - registry.fill(HIST("hEventCount"), evSel_allEvents); + registry.fill(HIST("hEventCount"), evSel_allEvents); selected = std::fabs(collision.posZ()) < cfgEvSelVtxZ; if (selected) { @@ -140,44 +139,44 @@ struct ZdcExtraTableProducer { selected = collision.sel8(); if (selected) { selectionBits |= (uint8_t)(0x1u << evSel_sel8); - registry.fill(HIST("hEventCount"), evSel_sel8); + registry.fill(HIST("hEventCount"), evSel_sel8); } auto occupancy = collision.trackOccupancyInTimeRange(); selected = occupancy <= cfgEvSelsMaxOccupancy; if (selected) { selectionBits |= (uint8_t)(0x1u << evSel_occupancy); - registry.fill(HIST("hEventCount"), evSel_occupancy); + registry.fill(HIST("hEventCount"), evSel_occupancy); } selected = collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup); if (selected) { selectionBits |= (uint8_t)(0x1u << evSel_kNoSameBunchPileup); - registry.fill(HIST("hEventCount"), evSel_kNoSameBunchPileup); + registry.fill(HIST("hEventCount"), evSel_kNoSameBunchPileup); } selected = collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV); if (selected) { selectionBits |= (uint8_t)(0x1u << evSel_kIsGoodZvtxFT0vsPV); - registry.fill(HIST("hEventCount"), evSel_kIsGoodZvtxFT0vsPV); + registry.fill(HIST("hEventCount"), evSel_kIsGoodZvtxFT0vsPV); } selected = collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard); if (selected) { selectionBits |= (uint8_t)(0x1u << evSel_kNoCollInTimeRangeStandard); - registry.fill(HIST("hEventCount"), evSel_kNoCollInTimeRangeStandard); + registry.fill(HIST("hEventCount"), evSel_kNoCollInTimeRangeStandard); } selected = collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC); if (selected) { selectionBits |= (uint8_t)(0x1u << evSel_kIsVertexITSTPC); - registry.fill(HIST("hEventCount"), evSel_kIsVertexITSTPC); + registry.fill(HIST("hEventCount"), evSel_kIsVertexITSTPC); } selected = collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll); if (selected) { selectionBits |= (uint8_t)(0x1u << evSel_kIsGoodITSLayersAll); - registry.fill(HIST("hEventCount"), evSel_kIsGoodITSLayersAll); + registry.fill(HIST("hEventCount"), evSel_kIsGoodITSLayersAll); } return selectionBits; @@ -209,10 +208,10 @@ struct ZdcExtraTableProducer { // OR we can select a narrow window in both ZN TDCs using the configurable parameters if (tdcCut) { // a narrow TDC window is set - if ((tdcZNC >= tdcZNmincut) && (tdcZNC <= tdcZNmaxcut) ) { + if ((tdcZNC >= tdcZNmincut) && (tdcZNC <= tdcZNmaxcut)) { isZNChit = true; } - if ((tdcZNA >= tdcZNmincut) && (tdcZNA <= tdcZNmaxcut) ) { + if ((tdcZNA >= tdcZNmincut) && (tdcZNA <= tdcZNmaxcut)) { isZNAhit = true; } } else { // if no window on TDC is set @@ -235,15 +234,14 @@ struct ZdcExtraTableProducer { sumZNC += pmqZNC[it]; } - if (cfgSaveQaHistos) - { + if (cfgSaveQaHistos) { registry.get(HIST("ZNCpmc"))->Fill(pmcZNC); - registry.get(HIST("ZNCpm1"))->Fill(pmqZNC[0]); - registry.get(HIST("ZNCpm2"))->Fill(pmqZNC[1]); - registry.get(HIST("ZNCpm3"))->Fill(pmqZNC[2]); - registry.get(HIST("ZNCpm4"))->Fill(pmqZNC[3]); - registry.get(HIST("ZNCsumq"))->Fill(sumZNC); - } + registry.get(HIST("ZNCpm1"))->Fill(pmqZNC[0]); + registry.get(HIST("ZNCpm2"))->Fill(pmqZNC[1]); + registry.get(HIST("ZNCpm3"))->Fill(pmqZNC[2]); + registry.get(HIST("ZNCpm4"))->Fill(pmqZNC[3]); + registry.get(HIST("ZNCsumq"))->Fill(sumZNC); + } } if (isZNAhit) { for (int it = 0; it < kNTowers; it++) { @@ -251,15 +249,14 @@ struct ZdcExtraTableProducer { sumZNA += pmqZNA[it]; } // - if (cfgSaveQaHistos) - { - registry.get(HIST("ZNApmc"))->Fill(pmcZNA); - registry.get(HIST("ZNApm1"))->Fill(pmqZNA[0]); - registry.get(HIST("ZNApm2"))->Fill(pmqZNA[1]); - registry.get(HIST("ZNApm3"))->Fill(pmqZNA[2]); - registry.get(HIST("ZNApm4"))->Fill(pmqZNA[3]); - registry.get(HIST("ZNAsumq"))->Fill(sumZNA); - } + if (cfgSaveQaHistos) { + registry.get(HIST("ZNApmc"))->Fill(pmcZNA); + registry.get(HIST("ZNApm1"))->Fill(pmqZNA[0]); + registry.get(HIST("ZNApm2"))->Fill(pmqZNA[1]); + registry.get(HIST("ZNApm3"))->Fill(pmqZNA[2]); + registry.get(HIST("ZNApm4"))->Fill(pmqZNA[3]); + registry.get(HIST("ZNAsumq"))->Fill(sumZNA); + } } // Q-vectors (centroid) calculation @@ -324,11 +321,10 @@ struct ZdcExtraTableProducer { centroidZNA[0] = 999.; centroidZNA[1] = 999.; } - if (cfgSaveQaHistos) - { - registry.get(HIST("ZNCCentroid"))->Fill(centroidZNC[0], centroidZNC[1]); - registry.get(HIST("ZNACentroid"))->Fill(centroidZNA[0], centroidZNA[1]); - } + if (cfgSaveQaHistos) { + registry.get(HIST("ZNCCentroid"))->Fill(centroidZNC[0], centroidZNC[1]); + registry.get(HIST("ZNACentroid"))->Fill(centroidZNA[0], centroidZNA[1]); + } auto vz = collision.posZ(); auto vx = collision.posX(); From d0d89dea7a725d0ab601355d59a29a43b90c0a85 Mon Sep 17 00:00:00 2001 From: Uliana Dmitrieva Date: Tue, 17 Mar 2026 11:13:22 +0100 Subject: [PATCH 4/8] Rename constant kNTowers to NTowers Rename constant kNTowers to NTowers as suggested by Vit Kucera --- Common/TableProducer/zdcExtraTableProducer.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Common/TableProducer/zdcExtraTableProducer.cxx b/Common/TableProducer/zdcExtraTableProducer.cxx index b734ed065ef..8608e8e7676 100644 --- a/Common/TableProducer/zdcExtraTableProducer.cxx +++ b/Common/TableProducer/zdcExtraTableProducer.cxx @@ -185,7 +185,7 @@ struct ZdcExtraTableProducer { void process(ColEvSels const& cols, BCsRun3 const& /*bcs*/, aod::Zdcs const& /*zdcs*/) { // collision-based event selection - constexpr int kNTowers = 4; // number of ZDC towers + constexpr int NTowers = 4; // number of ZDC towers for (auto const& collision : cols) { const auto& foundBC = collision.foundBC_as(); @@ -229,7 +229,7 @@ struct ZdcExtraTableProducer { double pmqZNA[4] = {}; // if (isZNChit) { - for (int it = 0; it < kNTowers; it++) { + for (int it = 0; it < NTowers; it++) { pmqZNC[it] = (zdc.energySectorZNC())[it]; sumZNC += pmqZNC[it]; } @@ -244,7 +244,7 @@ struct ZdcExtraTableProducer { } } if (isZNAhit) { - for (int it = 0; it < kNTowers; it++) { + for (int it = 0; it < NTowers; it++) { pmqZNA[it] = (zdc.energySectorZNA())[it]; sumZNA += pmqZNA[it]; } @@ -272,7 +272,7 @@ struct ZdcExtraTableProducer { float numXZNA = 0., numYZNA = 0., denZNA = 0.; // Calculate weighted sums of the x and y coordinates - for (int i = 0; i < kNTowers; i++) { + for (int i = 0; i < NTowers; i++) { if (pmqZNC[i] > 0.) { float wZNC = std::pow(pmqZNC[i], kAlpha); numXZNC -= X[i] * wZNC; // numerator x (minus sign due to opposite orientation of ZNC) From 02196e50a62d3e1cd5a8585dd3906d6db816e94e Mon Sep 17 00:00:00 2001 From: Uliana Dmitrieva Date: Tue, 17 Mar 2026 14:29:21 +0100 Subject: [PATCH 5/8] Conditional filling of ZNC and ZNA centroids Add checks isZN*Hit before filling Centroid histograms --- Common/TableProducer/zdcExtraTableProducer.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Common/TableProducer/zdcExtraTableProducer.cxx b/Common/TableProducer/zdcExtraTableProducer.cxx index 8608e8e7676..693adb3021e 100644 --- a/Common/TableProducer/zdcExtraTableProducer.cxx +++ b/Common/TableProducer/zdcExtraTableProducer.cxx @@ -322,8 +322,12 @@ struct ZdcExtraTableProducer { centroidZNA[1] = 999.; } if (cfgSaveQaHistos) { - registry.get(HIST("ZNCCentroid"))->Fill(centroidZNC[0], centroidZNC[1]); - registry.get(HIST("ZNACentroid"))->Fill(centroidZNA[0], centroidZNA[1]); + if (isZNChit) { + registry.get(HIST("ZNCCentroid"))->Fill(centroidZNC[0], centroidZNC[1]); + } + if (isZNAhit) { + registry.get(HIST("ZNACentroid"))->Fill(centroidZNA[0], centroidZNA[1]); + } } auto vz = collision.posZ(); From d1606e08b8e1b7f350fe3c3720749e1f13e2b792 Mon Sep 17 00:00:00 2001 From: Uliana Dmitrieva Date: Tue, 17 Mar 2026 14:34:49 +0100 Subject: [PATCH 6/8] Add event selection settings Add event selection with Configurables. Change default values for event selection configurations --- .../TableProducer/zdcExtraTableProducer.cxx | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Common/TableProducer/zdcExtraTableProducer.cxx b/Common/TableProducer/zdcExtraTableProducer.cxx index 693adb3021e..ac8feb43d7f 100644 --- a/Common/TableProducer/zdcExtraTableProducer.cxx +++ b/Common/TableProducer/zdcExtraTableProducer.cxx @@ -58,13 +58,13 @@ struct ZdcExtraTableProducer { // Event selections Configurable cfgEvSelSel8{"cfgEvSelSel8", true, "Event selection: sel8"}; Configurable cfgEvSelVtxZ{"cfgEvSelVtxZ", 10, "Event selection: zVtx"}; - Configurable cfgEvSelsDoOccupancySel{"cfgEvSelsDoOccupancySel", true, "Event selection: do occupancy selection"}; + Configurable cfgEvSelsDoOccupancySel{"cfgEvSelsDoOccupancySel", false, "Event selection: do occupancy selection"}; Configurable cfgEvSelsMaxOccupancy{"cfgEvSelsMaxOccupancy", 10000, "Event selection: set max occupancy"}; - Configurable cfgEvSelsNoSameBunchPileupCut{"cfgEvSelsNoSameBunchPileupCut", true, "Event selection: no same bunch pileup cut"}; - Configurable cfgEvSelsIsGoodZvtxFT0vsPV{"cfgEvSelsIsGoodZvtxFT0vsPV", true, "Event selection: is good ZVTX FT0 vs PV"}; - Configurable cfgEvSelsNoCollInTimeRangeStandard{"cfgEvSelsNoCollInTimeRangeStandard", true, "Event selection: no collision in time range standard"}; - Configurable cfgEvSelsIsVertexITSTPC{"cfgEvSelsIsVertexITSTPC", true, "Event selection: is vertex ITSTPC"}; - Configurable cfgEvSelsIsGoodITSLayersAll{"cfgEvSelsIsGoodITSLayersAll", true, "Event selection: is good ITS layers all"}; + Configurable cfgEvSelsNoSameBunchPileupCut{"cfgEvSelsNoSameBunchPileupCut", false, "Event selection: no same bunch pileup cut"}; + Configurable cfgEvSelsIsGoodZvtxFT0vsPV{"cfgEvSelsIsGoodZvtxFT0vsPV", false, "Event selection: is good ZVTX FT0 vs PV"}; + Configurable cfgEvSelsNoCollInTimeRangeStandard{"cfgEvSelsNoCollInTimeRangeStandard", false, "Event selection: no collision in time range standard"}; + Configurable cfgEvSelsIsVertexITSTPC{"cfgEvSelsIsVertexITSTPC", false, "Event selection: is vertex ITSTPC"}; + Configurable cfgEvSelsIsGoodITSLayersAll{"cfgEvSelsIsGoodITSLayersAll", false, "Event selection: is good ITS layers all"}; // Calibration settings Configurable cfgCalibrationDownscaling{"cfgCalibrationDownscaling", 1.f, "Percentage of events to be saved to derived table"}; @@ -194,6 +194,16 @@ struct ZdcExtraTableProducer { uint8_t evSelection = eventSelected(collision); + //add event selection + if (cfgEvSelSel8 && !(evSelection & (1 << evSel_sel8))) continue; + if (std::fabs(collision.posZ()) > cfgEvSelVtxZ) continue; + if (cfgEvSelsDoOccupancySel && !(evSelection & (1 << evSel_occupancy))) continue; + if (cfgEvSelsNoSameBunchPileupCut && !(evSelection & (1 << evSel_kNoSameBunchPileup))) continue; + if (cfgEvSelsIsGoodZvtxFT0vsPV && !(evSelection & (1 << evSel_kIsGoodZvtxFT0vsPV))) continue; + if (cfgEvSelsNoCollInTimeRangeStandard && !(evSelection & (1 << evSel_kNoCollInTimeRangeStandard))) continue; + if (cfgEvSelsIsVertexITSTPC && !(evSelection & (1 << evSel_kIsVertexITSTPC))) continue; + if (cfgEvSelsIsGoodITSLayersAll && !(evSelection & (1 << evSel_kIsGoodITSLayersAll))) continue; + float centrality = collision.centFT0C(); // To assure that ZN have a genuine signal (tagged by the relative TDC) From b6395e8373f8c7779fcde924eaa6f3a6f0c57c37 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 17 Mar 2026 13:35:33 +0000 Subject: [PATCH 7/8] Please consider the following formatting changes --- .../TableProducer/zdcExtraTableProducer.cxx | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/Common/TableProducer/zdcExtraTableProducer.cxx b/Common/TableProducer/zdcExtraTableProducer.cxx index ac8feb43d7f..4c1271ffbb7 100644 --- a/Common/TableProducer/zdcExtraTableProducer.cxx +++ b/Common/TableProducer/zdcExtraTableProducer.cxx @@ -194,15 +194,23 @@ struct ZdcExtraTableProducer { uint8_t evSelection = eventSelected(collision); - //add event selection - if (cfgEvSelSel8 && !(evSelection & (1 << evSel_sel8))) continue; - if (std::fabs(collision.posZ()) > cfgEvSelVtxZ) continue; - if (cfgEvSelsDoOccupancySel && !(evSelection & (1 << evSel_occupancy))) continue; - if (cfgEvSelsNoSameBunchPileupCut && !(evSelection & (1 << evSel_kNoSameBunchPileup))) continue; - if (cfgEvSelsIsGoodZvtxFT0vsPV && !(evSelection & (1 << evSel_kIsGoodZvtxFT0vsPV))) continue; - if (cfgEvSelsNoCollInTimeRangeStandard && !(evSelection & (1 << evSel_kNoCollInTimeRangeStandard))) continue; - if (cfgEvSelsIsVertexITSTPC && !(evSelection & (1 << evSel_kIsVertexITSTPC))) continue; - if (cfgEvSelsIsGoodITSLayersAll && !(evSelection & (1 << evSel_kIsGoodITSLayersAll))) continue; + // add event selection + if (cfgEvSelSel8 && !(evSelection & (1 << evSel_sel8))) + continue; + if (std::fabs(collision.posZ()) > cfgEvSelVtxZ) + continue; + if (cfgEvSelsDoOccupancySel && !(evSelection & (1 << evSel_occupancy))) + continue; + if (cfgEvSelsNoSameBunchPileupCut && !(evSelection & (1 << evSel_kNoSameBunchPileup))) + continue; + if (cfgEvSelsIsGoodZvtxFT0vsPV && !(evSelection & (1 << evSel_kIsGoodZvtxFT0vsPV))) + continue; + if (cfgEvSelsNoCollInTimeRangeStandard && !(evSelection & (1 << evSel_kNoCollInTimeRangeStandard))) + continue; + if (cfgEvSelsIsVertexITSTPC && !(evSelection & (1 << evSel_kIsVertexITSTPC))) + continue; + if (cfgEvSelsIsGoodITSLayersAll && !(evSelection & (1 << evSel_kIsGoodITSLayersAll))) + continue; float centrality = collision.centFT0C(); From c7eb99aa167c23b329622ce04de144a00a00d23e Mon Sep 17 00:00:00 2001 From: Uliana Dmitrieva Date: Tue, 17 Mar 2026 15:28:41 +0100 Subject: [PATCH 8/8] Refactor event selection condition for posZ check Exclude secondary check of z-vertex position, reuse calculated bits --- Common/TableProducer/zdcExtraTableProducer.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/TableProducer/zdcExtraTableProducer.cxx b/Common/TableProducer/zdcExtraTableProducer.cxx index 4c1271ffbb7..24e34f058df 100644 --- a/Common/TableProducer/zdcExtraTableProducer.cxx +++ b/Common/TableProducer/zdcExtraTableProducer.cxx @@ -197,7 +197,7 @@ struct ZdcExtraTableProducer { // add event selection if (cfgEvSelSel8 && !(evSelection & (1 << evSel_sel8))) continue; - if (std::fabs(collision.posZ()) > cfgEvSelVtxZ) + if (!(evSelection & (1 << evSel_zvtx))) continue; if (cfgEvSelsDoOccupancySel && !(evSelection & (1 << evSel_occupancy))) continue;