From 8d06967a5d379129a038cfb6711ba8f17627a22b Mon Sep 17 00:00:00 2001 From: cnkoster Date: Wed, 5 Nov 2025 17:32:21 +0100 Subject: [PATCH 1/8] Add timestamp and uint to hold event selections and multiple centrality estimators --- PWGCF/DataModel/SPTableZDC.h | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/PWGCF/DataModel/SPTableZDC.h b/PWGCF/DataModel/SPTableZDC.h index fcafff23c90..0c6e9124cd1 100644 --- a/PWGCF/DataModel/SPTableZDC.h +++ b/PWGCF/DataModel/SPTableZDC.h @@ -15,6 +15,7 @@ #define PWGCF_DATAMODEL_SPTABLEZDC_H_ #include +#include #include "Common/DataModel/PIDResponse.h" #include "Common/Core/RecoDecay.h" @@ -26,32 +27,28 @@ namespace o2::aod namespace sptablezdc { DECLARE_SOA_COLUMN(Runnumber, runnumber, int); -DECLARE_SOA_COLUMN(Cent, cent, float); -DECLARE_SOA_COLUMN(Vx, vx, float); -DECLARE_SOA_COLUMN(Vy, vy, float); -DECLARE_SOA_COLUMN(Vz, vz, float); +DECLARE_SOA_COLUMN(Cents, cents, std::vector); +DECLARE_SOA_COLUMN(Vertex, vertex, std::vector); +DECLARE_SOA_COLUMN(Timestamp, timestamp, int64_t); DECLARE_SOA_COLUMN(QXA, qxA, float); DECLARE_SOA_COLUMN(QYA, qyA, float); DECLARE_SOA_COLUMN(QXC, qxC, float); DECLARE_SOA_COLUMN(QYC, qyC, float); DECLARE_SOA_COLUMN(IsSelected, isSelected, bool); -DECLARE_SOA_COLUMN(Iteration, iteration, int); -DECLARE_SOA_COLUMN(Step, step, int); +DECLARE_SOA_COLUMN(EventSelectionFlags, eventSelectionFlags, uint16_t); } // namespace sptablezdc DECLARE_SOA_TABLE(SPTableZDC, "AOD", "SPZDC", sptablezdc::Runnumber, - sptablezdc::Cent, - sptablezdc::Vx, - sptablezdc::Vy, - sptablezdc::Vz, + sptablezdc::Cents, + sptablezdc::Vertex, + sptablezdc::Timestamp, sptablezdc::QXA, sptablezdc::QYA, sptablezdc::QXC, sptablezdc::QYC, sptablezdc::IsSelected, - sptablezdc::Iteration, - sptablezdc::Step); + sptablezdc::EventSelectionFlags); } // namespace o2::aod #endif // PWGCF_DATAMODEL_SPTABLEZDC_H_ From bcbd286490e25b29d734d6ce7edda4b083184997 Mon Sep 17 00:00:00 2001 From: cnkoster Date: Wed, 5 Nov 2025 17:33:20 +0100 Subject: [PATCH 2/8] Implement new table and add some new event selections --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 770 +++++++++++++---------- 1 file changed, 437 insertions(+), 333 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index a69de55ff13..f1d3241a632 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -90,11 +90,12 @@ std::vector meanEZN(10); // mean energies from calibration histos (commo std::vector e(8, 0.); // calibrated energies (a1, a2, a3, a4, c1, c2, c3, c4)) // Define variables needed to do the recentring steps. -double centrality = 0; +float centrality = 0; int runnumber = 0; int lastRunNumber = 0; -std::vector v(3, 0); // vx, vy, vz +std::vector v(3, 0); // vx, vy, vz bool isSelected = true; +std::vector cents; // centrality estimaters } // namespace o2::analysis::qvectortask @@ -113,6 +114,14 @@ struct ZdcQVectors { RCTFlagsChecker rctChecker; + struct : ConfigurableGroup { + // Additional event selections + O2_DEFINE_CONFIGURABLE(cfgMaxOccupancy, int, 10000, "Maximum occupancy of selected events"); + O2_DEFINE_CONFIGURABLE(cfgCentMin, float, 0, "Minimum cenrality for selected events"); + O2_DEFINE_CONFIGURABLE(cfgCentMax, float, 90, "Maximum cenrality for selected events"); + } EvSel; + + ConfigurableAxis axisCent{"axisCent", {90, 0, 90}, "Centrality axis in 1% bins"}; ConfigurableAxis axisCent10{"axisCent10", {9, 0, 90}, "Centrality axis in 10% bins"}; ConfigurableAxis axisQ{"axisQ", {100, -2, 2}, "Q vector (xy) in ZDC"}; @@ -128,6 +137,7 @@ struct ZdcQVectors { O2_DEFINE_CONFIGURABLE(cfgFT0M, bool, false, "Set centrality estimator to cfgFT0M"); O2_DEFINE_CONFIGURABLE(cfgFV0A, bool, false, "Set centrality estimator to cfgFV0A"); O2_DEFINE_CONFIGURABLE(cfgNGlobal, bool, false, "Set centrality estimator to cfgNGlobal"); + O2_DEFINE_CONFIGURABLE(cfgUseSecondCent, bool, false, "Use second centrality estimator"); O2_DEFINE_CONFIGURABLE(cfgVtxZ, float, 10.0f, "Accepted z-vertex range") O2_DEFINE_CONFIGURABLE(cfgMagField, float, 99999, "Configurable magnetic field; default CCDB will be queried") @@ -135,39 +145,33 @@ struct ZdcQVectors { O2_DEFINE_CONFIGURABLE(cfgMeanv, std::string, "Users/c/ckoster/ZDC/LHC23_PbPb_pass5/vmean", "ccdb path for mean v histos") O2_DEFINE_CONFIGURABLE(cfgMinEntriesSparseBin, int, 100, "Minimal number of entries allowed in 4D recentering histogram to use for recentering.") O2_DEFINE_CONFIGURABLE(cfgRec, std::string, "Users/c/ckoster/ZDC/LHC23_PbPb_pass5", "ccdb path for recentering histos"); - O2_DEFINE_CONFIGURABLE(cfgFillCommonRegistry, bool, true, "Fill common registry with histograms"); - - // Additional event selections - O2_DEFINE_CONFIGURABLE(cfgEvSelsMaxOccupancy, int, 10000, "Maximum occupancy of selected events"); - O2_DEFINE_CONFIGURABLE(cfgEvSelsNoSameBunchPileupCut, bool, true, "kNoSameBunchPileupCut"); - O2_DEFINE_CONFIGURABLE(cfgEvSelsIsGoodZvtxFT0vsPV, bool, true, "kIsGoodZvtxFT0vsPV"); - O2_DEFINE_CONFIGURABLE(cfgEvSelsNoCollInTimeRangeStandard, bool, true, "kNoCollInTimeRangeStandard"); - O2_DEFINE_CONFIGURABLE(cfgEvSelsDoOccupancySel, bool, true, "Bool for event selection on detector occupancy"); - O2_DEFINE_CONFIGURABLE(cfgEvSelsIsVertexITSTPC, bool, true, "Selects collisions with at least one ITS-TPC track"); - O2_DEFINE_CONFIGURABLE(cfgEvSelsIsGoodITSLayersAll, bool, true, "Cut time intervals with dead ITS staves"); - O2_DEFINE_CONFIGURABLE(cfgEvSelsCentMin, float, 0, "Minimum cenrality for selected events"); - O2_DEFINE_CONFIGURABLE(cfgEvSelsCentMax, float, 90, "Maximum cenrality for selected events"); + O2_DEFINE_CONFIGURABLE(cfgFillHistRegistry, bool, true, "Fill common registry with histograms"); + O2_DEFINE_CONFIGURABLE(cfgFillCutAnalysis, bool, true, "Fill cut analysis with histograms"); + O2_DEFINE_CONFIGURABLE(cfgFillNothing, bool, false, "Disable ALL Histograms -> ONLY use to reduce memory"); O2_DEFINE_CONFIGURABLE(cfgCCDBdir_Shift, std::string, "Users/c/ckoster/ZDC/LHC23_PbPb_pass5/Shift", "CCDB directory for Shift ZDC"); // define my..... - // Filter collisionFilter = nabs(aod::collision::posZ) < cfgVtxZ; + // Filter collisionFilter = nabs(aod::collision::posZ) <; using UsedCollisions = soa::Join; using BCsRun3 = soa::Join; enum SelectionCriteria { evSel_FilteredEvent, - evSel_RCTFlagsZDC, + evSel_BCHasZDC, + evSel_isSelectedZDC, evSel_Zvtx, evSel_sel8, evSel_occupancy, evSel_kNoSameBunchPileup, evSel_kIsGoodZvtxFT0vsPV, evSel_kNoCollInTimeRangeStandard, + evSel_kNoCollInTimeRangeNarrow, evSel_kIsVertexITSTPC, - evSel_CentCuts, evSel_kIsGoodITSLayersAll, - evSel_isSelectedZDC, + evSel_kIsGoodITSLayer0123, + evSel_RCTFlagsZDC, + evSel_CentCuts, nEventSelections }; @@ -214,115 +218,13 @@ struct ZdcQVectors { std::vector sides = {"A", "C"}; std::vector capCOORDS = {"X", "Y"}; - if (cfgFillCommonRegistry) { - registry.add(Form("QA/before/hSPplaneA"), "hSPplaneA", kTH2D, {{100, -4, 4}, axisCent10}); - registry.add(Form("QA/before/hSPplaneC"), "hSPplaneC", kTH2D, {{100, -4, 4}, axisCent10}); - registry.add(Form("QA/before/hSPplaneFull"), "hSPplaneFull", kTH2D, {{100, -4, 4}, axisCent10}); - for (const auto& side : sides) { - registry.add(Form("QA/before/hZN%s_Qx_vs_Qy", side), Form("hZN%s_Qx_vs_Qy", side), kTH2F, {axisQ, axisQ}); - } - - for (const auto& COORD1 : capCOORDS) { - for (const auto& COORD2 : capCOORDS) { - // Now we get: & vs. Centrality - registry.add(Form("QA/before/hQ%sA_Q%sC_vs_cent", COORD1, COORD2), Form("hQ%sA_Q%sC_vs_cent", COORD1, COORD2), kTProfile, {axisCent}); - registry.add(Form("QA/before/hQ%sA_Q%sC_vs_vx", COORD1, COORD2), Form("hQ%sA_Q%sC_vs_vx", COORD1, COORD2), kTProfile, {axisVx}); - registry.add(Form("QA/before/hQ%sA_Q%sC_vs_vy", COORD1, COORD2), Form("hQ%sA_Q%sC_vs_vy", COORD1, COORD2), kTProfile, {axisVy}); - registry.add(Form("QA/before/hQ%sA_Q%sC_vs_vz", COORD1, COORD2), Form("hQ%sA_Q%sC_vs_vz", COORD1, COORD2), kTProfile, {axisVz}); - } - } - - // Add histograms for each step in the calibration process. - // Sides is {A,C} and capcoords is {X,Y} - for (const auto& side : sides) { - for (const auto& coord : capCOORDS) { - registry.add(Form("QA/before/hQ%s%s_vs_cent", coord, side), Form("hQ%s%s_vs_cent", coord, side), {HistType::kTProfile, {axisCent10}}); - registry.add(Form("QA/before/hQ%s%s_vs_vx", coord, side), Form("hQ%s%s_vs_vx", coord, side), {HistType::kTProfile, {axisVx}}); - registry.add(Form("QA/before/hQ%s%s_vs_vy", coord, side), Form("hQ%s%s_vs_vy", coord, side), {HistType::kTProfile, {axisVy}}); - registry.add(Form("QA/before/hQ%s%s_vs_vz", coord, side), Form("hQ%s%s_vs_vz", coord, side), {HistType::kTProfile, {axisVz}}); - registry.add(Form("QA/Q%s%s_vs_iteration", coord, side), Form("hQ%s%s_vs_iteration", coord, side), {HistType::kTH2D, {{25, 0, 25}, axisQ}}); - - names[0].push_back(TString::Format("hQ%s%s_mean_Cent_V_run", coord, side)); - names[1].push_back(TString::Format("hQ%s%s_mean_cent_run", coord, side)); - names[2].push_back(TString::Format("hQ%s%s_mean_vx_run", coord, side)); - names[3].push_back(TString::Format("hQ%s%s_mean_vy_run", coord, side)); - names[4].push_back(TString::Format("hQ%s%s_mean_vz_run", coord, side)); - } // end of capCOORDS - } // end of sides - - registry.add("QA/centrality_before", "centrality_before", kTH1D, {{100, 0, 100}}); - registry.add("QA/centrality_after", "centrality_after", kTH1D, {{100, 0, 100}}); - - registry.add("QA/ZNA_Energy", "ZNA_Energy", kTProfile, {{8, 0, 8}}); - registry.add("QA/ZNC_Energy", "ZNC_Energy", kTProfile, {{8, 0, 8}}); - - registry.add("QA/psiZDCA", "psiZDCA", kTH2D, {{100, -4, 4}, {100, 0, 100}}); - registry.add("QA/psiZDCA_shift", "psiZDCA_shift", kTH2D, {{100, -4, 4}, {100, 0, 100}}); - registry.add("QA/psiZDCC", "psiZDCC", kTH2D, {{100, -4, 4}, {100, 0, 100}}); - registry.add("QA/psiZDCC_shift", "psiZDCC_shift", kTH2D, {{100, -4, 4}, {100, 0, 100}}); - - registry.add("QA/before/ZNA_pmC", "ZNA_pmC", kTProfile, {{1, 0, 1.}}); - registry.add("QA/before/ZNA_pm1", "ZNA_pm1", kTProfile, {{1, 0, 1.}}); - registry.add("QA/before/ZNA_pm2", "ZNA_pm2", kTProfile, {{1, 0, 1.}}); - registry.add("QA/before/ZNA_pm3", "ZNA_pm3", kTProfile, {{1, 0, 1.}}); - registry.add("QA/before/ZNA_pm4", "ZNA_pm4", kTProfile, {{1, 0, 1.}}); - - registry.add("QA/before/ZNC_pmC", "ZNC_pmC", kTProfile, {{1, 0, 1.}}); - registry.add("QA/before/ZNC_pm1", "ZNC_pm1", kTProfile, {{1, 0, 1.}}); - registry.add("QA/before/ZNC_pm2", "ZNC_pm2", kTProfile, {{1, 0, 1.}}); - registry.add("QA/before/ZNC_pm3", "ZNC_pm3", kTProfile, {{1, 0, 1.}}); - registry.add("QA/before/ZNC_pm4", "ZNC_pm4", kTProfile, {{1, 0, 1.}}); - - registry.add("QA/before/ZNA_Qx", "ZNA_Qx", kTProfile, {{1, 0, 1.}}); - registry.add("QA/before/ZNA_Qy", "ZNA_Qy", kTProfile, {{1, 0, 1.}}); - registry.add("QA/before/ZNC_Qx", "ZNC_Qx", kTProfile, {{1, 0, 1.}}); - registry.add("QA/before/ZNC_Qy", "ZNC_Qy", kTProfile, {{1, 0, 1.}}); - - registry.add("QA/before/ZNA_Qx_vs_Centrality", "ZNA_Qx_vs_Centrality", kTH2D, {{100, 0, 100}, {200, -2, 2}}); - registry.add("QA/before/ZNA_Qy_vs_Centrality", "ZNA_Qy_vs_Centrality", kTH2D, {{100, 0, 100}, {200, -2, 2}}); - registry.add("QA/before/ZNC_Qx_vs_Centrality", "ZNC_Qx_vs_Centrality", kTH2D, {{100, 0, 100}, {200, -2, 2}}); - registry.add("QA/before/ZNC_Qy_vs_Centrality", "ZNC_Qy_vs_Centrality", kTH2D, {{100, 0, 100}, {200, -2, 2}}); - - registry.add("QA/before/ZNA_pmC_vs_Centrality", "ZNA_pmC_vs_Centrality", kTH2D, {{100, 0, 100}, {300, 0, 300}}); - registry.add("QA/before/ZNA_pmSUM_vs_Centrality", "ZNA_pmSUM_vs_Centrality", kTH2D, {{100, 0, 100}, {300, 0, 300}}); - registry.add("QA/before/ZNA_pm1_vs_Centrality", "ZNA_pm1_vs_Centrality", kTH2D, {{100, 0, 100}, {100, 0, 1}}); - registry.add("QA/before/ZNA_pm2_vs_Centrality", "ZNA_pm2_vs_Centrality", kTH2D, {{100, 0, 100}, {100, 0, 1}}); - registry.add("QA/before/ZNA_pm3_vs_Centrality", "ZNA_pm3_vs_Centrality", kTH2D, {{100, 0, 100}, {100, 0, 1}}); - registry.add("QA/before/ZNA_pm4_vs_Centrality", "ZNA_pm4_vs_Centrality", kTH2D, {{100, 0, 100}, {100, 0, 1}}); - - registry.add("QA/before/ZNC_pmC_vs_Centrality", "ZNC_pmC_vs_Centrality", kTH2D, {{100, 0, 100}, {300, 0, 300}}); - registry.add("QA/before/ZNC_pmSUM_vs_Centrality", "ZNC_pmSUM_vs_Centrality", kTH2D, {{100, 0, 100}, {300, 0, 300}}); - registry.add("QA/before/ZNC_pm1_vs_Centrality", "ZNC_pm1_vs_Centrality", kTH2D, {{100, 0, 100}, {100, 0, 1}}); - registry.add("QA/before/ZNC_pm2_vs_Centrality", "ZNC_pm2_vs_Centrality", kTH2D, {{100, 0, 100}, {100, 0, 1}}); - registry.add("QA/before/ZNC_pm3_vs_Centrality", "ZNC_pm3_vs_Centrality", kTH2D, {{100, 0, 100}, {100, 0, 1}}); - registry.add("QA/before/ZNC_pm4_vs_Centrality", "ZNC_pm4_vs_Centrality", kTH2D, {{100, 0, 100}, {100, 0, 1}}); - - registry.addClone("QA/before/", "QA/after/"); - - registry.add("QA/before/ZNA_Qx_noEq", "ZNA_Qx_noEq", kTProfile, {{1, 0, 1.}}); - registry.add("QA/before/ZNA_Qy_noEq", "ZNA_Qy_noEq", kTProfile, {{1, 0, 1.}}); - registry.add("QA/before/ZNC_Qx_noEq", "ZNC_Qx_noEq", kTProfile, {{1, 0, 1.}}); - registry.add("QA/before/ZNC_Qy_noEq", "ZNC_Qy_noEq", kTProfile, {{1, 0, 1.}}); - } - - // Tower mean energies vs. centrality used for tower gain equalisation - int totalTowers = 10; - int totalTowersPerSide = 5; - for (int tower = 0; tower < totalTowers; tower++) { - namesEcal[tower] = TString::Format("hZN%s_mean_t%i_cent", sides[(tower < totalTowersPerSide) ? 0 : 1], tower % 5); - registry.add(Form("Energy/%s", namesEcal[tower].Data()), Form("%s", namesEcal[tower].Data()), kTProfile2D, {{1, 0, 1}, axisCent}); - } - - // recentered q-vectors (to check what steps are finished in the end) - registry.add("vmean/hvertex_vx", "hvertex_vx", kTProfile, {{1, 0., 1.}}); - registry.add("vmean/hvertex_vy", "hvertex_vy", kTProfile, {{1, 0., 1.}}); - registry.add("vmean/hvertex_vz", "hvertex_vz", kTProfile, {{1, 0., 1.}}); - - registry.add("shift/ShiftZDCC", "ShiftZDCC", kTProfile3D, {{100, 0, 100}, {2, 0, 2}, {10, 0, 10}}); - registry.add("shift/ShiftZDCA", "ShiftZDCA", kTProfile3D, {{100, 0, 100}, {2, 0, 2}, {10, 0, 10}}); + AxisSpec axisPsiA = {100, -M_PI, M_PI, "#Psi_{1} ZNA"}; + AxisSpec axisPsiC = {100, -M_PI, M_PI, "#Psi_{1} ZNC"}; + // This is the only histogram that is AL~WA~YS filled. registry.add("hEventCount", "Number of Event; Cut; #Events Passed Cut", {HistType::kTH1D, {{nEventSelections, 0, nEventSelections}}}); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_FilteredEvent + 1, "Filtered events"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_BCHasZDC + 1, "BCHasZDC"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_RCTFlagsZDC + 1, "RCT Flags ZDC"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_Zvtx + 1, "Z vertex cut event"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_sel8 + 1, "Sel8"); @@ -330,85 +232,281 @@ struct ZdcQVectors { 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_kNoCollInTimeRangeNarrow + 1, "kNoCollInTimeRangeNarrow"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsVertexITSTPC + 1, "kIsVertexITSTPC"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_CentCuts + 1, "Cenrality range"); - registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsGoodITSLayersAll + 1, "kkIsGoodITSLayersAll"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsGoodITSLayersAll + 1, "kIsGoodITSLayersAll"); + registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsGoodITSLayer0123 + 1, "kIsGoodITSLayer0123"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_isSelectedZDC + 1, "isSelected"); + + int totalTowers = 10; + int totalTowersPerSide = 5; + for (int tower = 0; tower < totalTowers; tower++) { + namesEcal[tower] = TString::Format("hZN%s_mean_t%i_cent", sides[(tower < totalTowersPerSide) ? 0 : 1], tower % 5); + } + + for (const auto& side : sides) { + for (const auto& coord : capCOORDS) { + names[0].push_back(TString::Format("hQ%s%s_mean_Cent_V_run", coord, side)); + names[1].push_back(TString::Format("hQ%s%s_mean_cent_run", coord, side)); + names[2].push_back(TString::Format("hQ%s%s_mean_vx_run", coord, side)); + names[3].push_back(TString::Format("hQ%s%s_mean_vy_run", coord, side)); + names[4].push_back(TString::Format("hQ%s%s_mean_vz_run", coord, side)); + } // end of capCOORDS + } + + + if(!cfgFillNothing){ + if (cfgFillHistRegistry) { + registry.add(Form("QA/before/hSPplaneA"), "hSPplaneA", kTH2D, {axisPsiA, axisCent10}); + registry.add(Form("QA/before/hSPplaneC"), "hSPplaneC", kTH2D, {axisPsiC, axisCent10}); + registry.add(Form("QA/before/hSPplaneFull"), "hSPplaneFull", kTH2D, {{100, -M_PI, M_PI}, axisCent10}); + for (const auto& side : sides) { + registry.add(Form("QA/before/hZN%s_Qx_vs_Qy", side), Form("hZN%s_Qx_vs_Qy", side), kTH2F, {axisQ, axisQ}); + } + + for (const auto& COORD1 : capCOORDS) { + for (const auto& COORD2 : capCOORDS) { + // Now we get: & vs. Centrality + registry.add(Form("QA/before/hQ%sA_Q%sC_vs_cent", COORD1, COORD2), Form("hQ%sA_Q%sC_vs_cent", COORD1, COORD2), kTProfile, {axisCent}); + registry.add(Form("QA/before/hQ%sA_Q%sC_vs_vx", COORD1, COORD2), Form("hQ%sA_Q%sC_vs_vx", COORD1, COORD2), kTProfile, {axisVx}); + registry.add(Form("QA/before/hQ%sA_Q%sC_vs_vy", COORD1, COORD2), Form("hQ%sA_Q%sC_vs_vy", COORD1, COORD2), kTProfile, {axisVy}); + registry.add(Form("QA/before/hQ%sA_Q%sC_vs_vz", COORD1, COORD2), Form("hQ%sA_Q%sC_vs_vz", COORD1, COORD2), kTProfile, {axisVz}); + } + } + + // Add histograms for each step in the calibration process. + // Sides is {A,C} and capcoords is {X,Y} + for (const auto& side : sides) { + for (const auto& coord : capCOORDS) { + registry.add(Form("QA/before/hQ%s%s_vs_cent", coord, side), Form("hQ%s%s_vs_cent", coord, side), {HistType::kTProfile, {axisCent10}}); + registry.add(Form("QA/before/hQ%s%s_vs_vx", coord, side), Form("hQ%s%s_vs_vx", coord, side), {HistType::kTProfile, {axisVx}}); + registry.add(Form("QA/before/hQ%s%s_vs_vy", coord, side), Form("hQ%s%s_vs_vy", coord, side), {HistType::kTProfile, {axisVy}}); + registry.add(Form("QA/before/hQ%s%s_vs_vz", coord, side), Form("hQ%s%s_vs_vz", coord, side), {HistType::kTProfile, {axisVz}}); + registry.add(Form("QA/Q%s%s_vs_iteration", coord, side), Form("hQ%s%s_vs_iteration", coord, side), {HistType::kTH2D, {{25, 0, 25}, axisQ}}); + } // end of capCOORDS + } // end of sides + + registry.add("QA/centrality_before", "centrality_before", kTH1D, {{100, 0, 100}}); + registry.add("QA/centrality_after", "centrality_after", kTH1D, {{100, 0, 100}}); + + registry.add("QA/ZNA_Energy", "ZNA_Energy", kTProfile, {{8, 0, 8}}); + registry.add("QA/ZNC_Energy", "ZNC_Energy", kTProfile, {{8, 0, 8}}); + + registry.add("QA/psiZDCA", "psiZDCA", kTH2D, {axisPsiA, {100, 0, 100}}); + registry.add("QA/psiZDCA_shift", "psiZDCA_shift", kTH2D, {axisPsiA, {100, 0, 100}}); + registry.add("QA/psiZDCC", "psiZDCC", kTH2D, {axisPsiC, {100, 0, 100}}); + registry.add("QA/psiZDCC_shift", "psiZDCC_shift", kTH2D, {axisPsiC, {100, 0, 100}}); + registry.add("QA/psiZDCAC", "psiZDCAC", kTH2D, {axisPsiA, axisPsiC}); + registry.add("QA/psiZDCAC_shift", "psiZDCAC_shift", kTH2D, {axisPsiA, axisPsiC}); + + registry.add("QA/before/ZNA_pmC", "ZNA_pmC", kTProfile, {{1, 0, 1.}}); + registry.add("QA/before/ZNA_pm1", "ZNA_pm1", kTProfile, {{1, 0, 1.}}); + registry.add("QA/before/ZNA_pm2", "ZNA_pm2", kTProfile, {{1, 0, 1.}}); + registry.add("QA/before/ZNA_pm3", "ZNA_pm3", kTProfile, {{1, 0, 1.}}); + registry.add("QA/before/ZNA_pm4", "ZNA_pm4", kTProfile, {{1, 0, 1.}}); + + registry.add("QA/before/ZNC_pmC", "ZNC_pmC", kTProfile, {{1, 0, 1.}}); + registry.add("QA/before/ZNC_pm1", "ZNC_pm1", kTProfile, {{1, 0, 1.}}); + registry.add("QA/before/ZNC_pm2", "ZNC_pm2", kTProfile, {{1, 0, 1.}}); + registry.add("QA/before/ZNC_pm3", "ZNC_pm3", kTProfile, {{1, 0, 1.}}); + registry.add("QA/before/ZNC_pm4", "ZNC_pm4", kTProfile, {{1, 0, 1.}}); + + registry.add("QA/before/ZNA_Qx", "ZNA_Qx", kTProfile, {{1, 0, 1.}}); + registry.add("QA/before/ZNA_Qy", "ZNA_Qy", kTProfile, {{1, 0, 1.}}); + registry.add("QA/before/ZNC_Qx", "ZNC_Qx", kTProfile, {{1, 0, 1.}}); + registry.add("QA/before/ZNC_Qy", "ZNC_Qy", kTProfile, {{1, 0, 1.}}); + + registry.add("QA/before/ZNA_Qx_vs_Centrality", "ZNA_Qx_vs_Centrality", kTH2D, {{100, 0, 100}, {200, -2, 2}}); + registry.add("QA/before/ZNA_Qy_vs_Centrality", "ZNA_Qy_vs_Centrality", kTH2D, {{100, 0, 100}, {200, -2, 2}}); + registry.add("QA/before/ZNC_Qx_vs_Centrality", "ZNC_Qx_vs_Centrality", kTH2D, {{100, 0, 100}, {200, -2, 2}}); + registry.add("QA/before/ZNC_Qy_vs_Centrality", "ZNC_Qy_vs_Centrality", kTH2D, {{100, 0, 100}, {200, -2, 2}}); + + registry.add("QA/before/ZNA_pmC_vs_Centrality", "ZNA_pmC_vs_Centrality", kTH2D, {{100, 0, 100}, {300, 0, 300}}); + registry.add("QA/before/ZNA_pmSUM_vs_Centrality", "ZNA_pmSUM_vs_Centrality", kTH2D, {{100, 0, 100}, {300, 0, 300}}); + registry.add("QA/before/ZNA_pm1_vs_Centrality", "ZNA_pm1_vs_Centrality", kTH2D, {{100, 0, 100}, {100, 0, 1}}); + registry.add("QA/before/ZNA_pm2_vs_Centrality", "ZNA_pm2_vs_Centrality", kTH2D, {{100, 0, 100}, {100, 0, 1}}); + registry.add("QA/before/ZNA_pm3_vs_Centrality", "ZNA_pm3_vs_Centrality", kTH2D, {{100, 0, 100}, {100, 0, 1}}); + registry.add("QA/before/ZNA_pm4_vs_Centrality", "ZNA_pm4_vs_Centrality", kTH2D, {{100, 0, 100}, {100, 0, 1}}); + + registry.add("QA/before/ZNC_pmC_vs_Centrality", "ZNC_pmC_vs_Centrality", kTH2D, {{100, 0, 100}, {300, 0, 300}}); + registry.add("QA/before/ZNC_pmSUM_vs_Centrality", "ZNC_pmSUM_vs_Centrality", kTH2D, {{100, 0, 100}, {300, 0, 300}}); + registry.add("QA/before/ZNC_pm1_vs_Centrality", "ZNC_pm1_vs_Centrality", kTH2D, {{100, 0, 100}, {100, 0, 1}}); + registry.add("QA/before/ZNC_pm2_vs_Centrality", "ZNC_pm2_vs_Centrality", kTH2D, {{100, 0, 100}, {100, 0, 1}}); + registry.add("QA/before/ZNC_pm3_vs_Centrality", "ZNC_pm3_vs_Centrality", kTH2D, {{100, 0, 100}, {100, 0, 1}}); + registry.add("QA/before/ZNC_pm4_vs_Centrality", "ZNC_pm4_vs_Centrality", kTH2D, {{100, 0, 100}, {100, 0, 1}}); + + registry.addClone("QA/before/", "QA/after/"); + + registry.add("QA/before/ZNA_Qx_noEq", "ZNA_Qx_noEq", kTProfile, {{1, 0, 1.}}); + registry.add("QA/before/ZNA_Qy_noEq", "ZNA_Qy_noEq", kTProfile, {{1, 0, 1.}}); + registry.add("QA/before/ZNC_Qx_noEq", "ZNC_Qx_noEq", kTProfile, {{1, 0, 1.}}); + registry.add("QA/before/ZNC_Qy_noEq", "ZNC_Qy_noEq", kTProfile, {{1, 0, 1.}}); + } + + // Tower mean energies vs. centrality used for tower gain equalisation + for (int tower = 0; tower < totalTowers; tower++) { + registry.add(Form("Energy/%s", namesEcal[tower].Data()), Form("%s", namesEcal[tower].Data()), kTProfile2D, {{1, 0, 1}, axisCent}); + } + + // recentered q-vectors (to check what steps are finished in the end) + + registry.add("vmean/hvertex_vx", "hvertex_vx", kTProfile, {{1, 0., 1.}}); + registry.add("vmean/hvertex_vy", "hvertex_vy", kTProfile, {{1, 0., 1.}}); + registry.add("vmean/hvertex_vz", "hvertex_vz", kTProfile, {{1, 0., 1.}}); + + + registry.add("shift/ShiftZDCC", "ShiftZDCC", kTProfile3D, {{100, 0, 100}, {2, 0, 2}, {10, 0, 10}}); + registry.add("shift/ShiftZDCA", "ShiftZDCA", kTProfile3D, {{100, 0, 100}, {2, 0, 2}, {10, 0, 10}}); + + + if(cfgFillCutAnalysis) { + // Tower mean energies vs. centrality used for tower gain equalisation + int totalTowers = 10; + int totalTowersPerSide = 5; + for (int tower = 0; tower < totalTowers; tower++) { + registry.add(Form("CutAnalysis/%s", namesEcal[tower].Data()), Form("%s", namesEcal[tower].Data()), kTProfile2D, {axisCent, {nEventSelections, 0, nEventSelections}}); + } + // recentered q-vectors (to check what steps are finished in the end) + registry.add("CutAnalysis/hvertex_vx", "hvertex_vx", kTProfile2D, {{1, 0., 1.}, {nEventSelections, 0, nEventSelections}}); + registry.add("CutAnalysis/hvertex_vy", "hvertex_vy", kTProfile2D, {{1, 0., 1.}, {nEventSelections, 0, nEventSelections}}); + registry.add("CutAnalysis/hvertex_vz", "hvertex_vz", kTProfile2D, {{1, 0., 1.}, {nEventSelections, 0, nEventSelections}}); + } + } } - template - bool eventSelected(TCollision collision, const float& centrality) + template + inline void fillCutAnalysis(TCollision collision, TZdc zdcBC, int evSel) { - if (std::fabs(collision.posZ()) > cfgVtxZ) - return 0; - registry.fill(HIST("hEventCount"), evSel_Zvtx); - - if (!collision.sel8()) - return 0; - registry.fill(HIST("hEventCount"), evSel_sel8); - - // Occupancy - if (cfgEvSelsDoOccupancySel) { - auto occupancy = collision.trackOccupancyInTimeRange(); - if (occupancy > cfgEvSelsMaxOccupancy) { - return 0; - } - registry.fill(HIST("hEventCount"), evSel_occupancy); + registry.fill(HIST("hEventCount"), evSel); + // FT0C is the default centrality estimator + auto cent = collision.centFT0C(); + cents.push_back(collision.centFT0C()); + + if (cfgFT0Cvariant1){ + if(cfgUseSecondCent) cent = collision.centFT0CVariant1(); + cents.push_back(collision.centFT0CVariant1()); } + if (cfgFT0M){ + if(cfgUseSecondCent) cent = collision.centFT0M(); + cents.push_back(collision.centFT0M()); + } + if (cfgFV0A){ + if(cfgUseSecondCent) cent = collision.centFV0A(); + cents.push_back(collision.centFV0A()); + } + if (cfgNGlobal){ + if(cfgUseSecondCent) cent = collision.centNGlobal(); + cents.push_back(collision.centNGlobal()); + } + centrality = cent; + + if(!cfgFillCutAnalysis || cfgFillNothing) return; + // Here we fill the Energy and mean vx, vy vz histograms with an extra dimension for all the event selections used. + registry.get(HIST("CutAnalysis/hvertex_vx"))->Fill(Form("%d", runnumber), evSel, collision.posX()); + registry.get(HIST("CutAnalysis/hvertex_vy"))->Fill(Form("%d", runnumber), evSel, collision.posY()); + registry.get(HIST("CutAnalysis/hvertex_vz"))->Fill(Form("%d", runnumber), evSel, collision.posZ()); + + registry.get(HIST("CutAnalysis/hZNA_mean_t0_cent"))->Fill(cent, evSel, zdcBC.energyCommonZNA(), 1); + registry.get(HIST("CutAnalysis/hZNA_mean_t1_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[0], 1); + registry.get(HIST("CutAnalysis/hZNA_mean_t2_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[1], 1); + registry.get(HIST("CutAnalysis/hZNA_mean_t3_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[2], 1); + registry.get(HIST("CutAnalysis/hZNA_mean_t4_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[3], 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t0_cent"))->Fill(cent, evSel, zdcBC.energyCommonZNC(), 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t1_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[0], 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t2_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[1], 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t3_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[2], 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t4_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[3], 1); + } - if (cfgEvSelsNoSameBunchPileupCut) { - if (!collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { - // rejects collisions which are associated with the same "found-by-T0" bunch crossing - // https://indico.cern.ch/event/1396220/#1-event-selection-with-its-rof - return 0; - } - registry.fill(HIST("hEventCount"), evSel_kNoSameBunchPileup); + + template + uint16_t eventSelected(TCollision collision, TBunchCrossing bunchCrossing) + { + uint16_t selectionBits = 0; + bool selected; + + // Define selection criteria + // If event is selected (passed the cut), set the corresponding bit in the selectionBits variable + // bit 0 is for filterd events, so it will stay 0 + // uint16_t is 16 bits, so we have room for 15 selection criteria here + + selected = std::fabs(collision.posZ()) < cfgVtxZ; + if (selected) { + selectionBits |= (uint16_t)(0x1u << evSel_Zvtx); + fillCutAnalysis(collision, bunchCrossing, evSel_Zvtx); } - if (cfgEvSelsIsGoodZvtxFT0vsPV) { - if (!collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV)) { - // removes collisions with large differences between z of PV by tracks and z of PV from FT0 A-C time difference - // use this cut at low multiplicities with caution - return 0; - } - registry.fill(HIST("hEventCount"), evSel_kIsGoodZvtxFT0vsPV); + + selected = collision.sel8(); + if (selected) { + selectionBits |= (uint16_t)(0x1u << evSel_sel8); + fillCutAnalysis(collision, bunchCrossing, evSel_sel8); } - if (cfgEvSelsNoCollInTimeRangeStandard) { - if (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard)) { - // Rejection of the collisions which have other events nearby - return 0; - } - registry.fill(HIST("hEventCount"), evSel_kNoCollInTimeRangeStandard); + + auto occupancy = collision.trackOccupancyInTimeRange(); + selected = occupancy <= EvSel.cfgMaxOccupancy; + if (selected) { + selectionBits |= (uint16_t)(0x1u << evSel_occupancy); + fillCutAnalysis(collision, bunchCrossing, evSel_occupancy); } - if (cfgEvSelsIsVertexITSTPC) { - if (!collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { - // selects collisions with at least one ITS-TPC track, and thus rejects vertices built from ITS-only tracks - return 0; - } - registry.fill(HIST("hEventCount"), evSel_kIsVertexITSTPC); + selected = collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup); + if (selected) { + selectionBits |= (uint16_t)(0x1u << evSel_kNoSameBunchPileup); + fillCutAnalysis(collision, bunchCrossing, evSel_kNoSameBunchPileup); } - if (centrality > cfgEvSelsCentMax || centrality < cfgEvSelsCentMin) - return 0; - registry.fill(HIST("hEventCount"), evSel_CentCuts); + selected = collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV); + if (selected) { + selectionBits |= (uint16_t)(0x1u << evSel_kIsGoodZvtxFT0vsPV); + fillCutAnalysis(collision, bunchCrossing, evSel_kIsGoodZvtxFT0vsPV); + } - if (cfgEvSelsIsGoodITSLayersAll) { - if (!collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) { - // New event selection bits to cut time intervals with dead ITS staves - // https://indico.cern.ch/event/1493023/ (09-01-2025) - return 0; - } - registry.fill(HIST("hEventCount"), evSel_kIsGoodITSLayersAll); + selected = collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard); + if (selected) { + selectionBits |= (uint16_t)(0x1u << evSel_kNoCollInTimeRangeStandard); + fillCutAnalysis(collision, bunchCrossing, evSel_kNoCollInTimeRangeStandard); + } + + selected = collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow); + if (selected) { + selectionBits |= (uint16_t)(0x1u << evSel_kNoCollInTimeRangeNarrow); + fillCutAnalysis(collision, bunchCrossing, evSel_kNoCollInTimeRangeNarrow); + } + + selected = collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC); + if (selected) { + selectionBits |= (uint16_t)(0x1u << evSel_kIsVertexITSTPC); + fillCutAnalysis(collision, bunchCrossing, evSel_kIsVertexITSTPC); + } + + selected = collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll); + if (selected) { + selectionBits |= (uint16_t)(0x1u << evSel_kIsGoodITSLayersAll); + fillCutAnalysis(collision, bunchCrossing, evSel_kIsGoodITSLayersAll); + } + + selected = collision.selection_bit(o2::aod::evsel::kIsGoodITSLayer0123); + if (selected) { + selectionBits |= (uint16_t)(0x1u << evSel_kIsGoodITSLayer0123); + fillCutAnalysis(collision, bunchCrossing, evSel_kIsGoodITSLayer0123); } - return 1; + selected = rctChecker(collision); + if (selected){ + selectionBits |= (uint16_t)(0x1u << evSel_RCTFlagsZDC); + fillCutAnalysis(collision, bunchCrossing, evSel_RCTFlagsZDC); + } + + return selectionBits; } template - inline void fillCommonRegistry(double qxa, double qya, double qxc, double qyc, std::vector v, double centrality) + inline void fillCommonRegistry(double qxa, double qya, double qxc, double qyc, std::vector v, double centrality) { // loop for filling multiple histograms with different naming patterns // Always fill the uncentered "raw" Q-vector histos! + if(cfgFillNothing) return; static constexpr std::string_view Time[] = {"before", "after"}; registry.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/hZNA_Qx_vs_Qy"), qxa, qya); @@ -589,45 +687,74 @@ struct ZdcQVectors { if (cfgNGlobal) cent = collision.centNGlobal(); - v[0] = collision.posX(); - v[1] = collision.posY(); - v[2] = collision.posZ(); - centrality = cent; + v = {collision.posX(), collision.posY(), collision.posZ()}; const auto& foundBC = collision.foundBC_as(); runnumber = foundBC.runNumber(); - if (cfgFillCommonRegistry) + if (cfgFillHistRegistry && !cfgFillNothing) registry.fill(HIST("QA/centrality_before"), cent); registry.fill(HIST("hEventCount"), evSel_FilteredEvent); - if (rctFlags.cfgEvtUseRCTFlagChecker && !rctChecker(collision)) { - // event not selected + if (!foundBC.has_zdc()) { isSelected = false; - spTableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, isSelected, 0, 0); + spTableZDC(runnumber, cents, v, foundBC.timestamp(), 0, 0, 0, 0, isSelected, 0); counter++; lastRunNumber = runnumber; return; } - registry.fill(HIST("hEventCount"), evSel_RCTFlagsZDC); + registry.fill(HIST("hEventCount"), evSel_BCHasZDC); - if (!eventSelected(collision, cent)) { - // event not selected - isSelected = false; - spTableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, isSelected, 0, 0); + const auto& zdcCol = foundBC.zdc(); + + // Get the raw energies eZN[8] (not the common A,C) + int nTowers = 8; + int nTowersPerSide = 4; + + for (int tower = 0; tower < nTowers; tower++) { + eZN[tower] = (tower < nTowersPerSide) ? zdcCol.energySectorZNA()[tower] : zdcCol.energySectorZNC()[tower % nTowersPerSide]; + } + + bool isZNAhit = true; + bool isZNChit = true; + + for (int i = 0; i < nTowers; ++i) { + if (i < nTowersPerSide && eZN[i] <= 0) + isZNAhit = false; + if (i >= nTowersPerSide && eZN[i] <= 0) + isZNChit = false; + } + + if (zdcCol.energyCommonZNA() <= 0) + isZNAhit = false; + if (zdcCol.energyCommonZNC() <= 0) + isZNChit = false; + + // if ZNA or ZNC not hit correctly.. do not use event in q-vector calculation + if (!isZNAhit || !isZNChit) { counter++; + isSelected = false; + spTableZDC(runnumber, cents, v, foundBC.timestamp(), 0, 0, 0, 0, isSelected, 0); lastRunNumber = runnumber; return; } + registry.fill(HIST("hEventCount"), evSel_isSelectedZDC); - if (!foundBC.has_zdc()) { + + + uint16_t eventSelectionFlags = eventSelected(collision, foundBC.zdc()); + + // ALWAYS use these event selections + if (cent < EvSel.cfgCentMin || cent > EvSel.cfgCentMax || !collision.sel8() || std::abs(collision.posZ()) > cfgVtxZ) { + // event not selected isSelected = false; - spTableZDC(runnumber, cent, v[0], v[1], v[2], 0, 0, 0, 0, isSelected, 0, 0); + spTableZDC(runnumber, cents, v, foundBC.timestamp(), 0, 0, 0, 0, isSelected, eventSelectionFlags); counter++; lastRunNumber = runnumber; return; } + registry.fill(HIST("hEventCount"), evSel_CentCuts); // load new calibrations for new runs only if (runnumber != lastRunNumber) { @@ -645,15 +772,6 @@ struct ZdcQVectors { cal.shiftprofileA = nullptr; } - const auto& zdcCol = foundBC.zdc(); - - // Get the raw energies eZN[8] (not the common A,C) - int nTowers = 8; - int nTowersPerSide = 4; - - for (int tower = 0; tower < nTowers; tower++) { - eZN[tower] = (tower < nTowersPerSide) ? zdcCol.energySectorZNA()[tower] : zdcCol.energySectorZNC()[tower % nTowersPerSide]; - } // load the calibration histos for iteration 0 step 0 (Energy Calibration) loadCalibrations(foundBC.timestamp(), cfgEnergyCal.value); @@ -666,57 +784,33 @@ struct ZdcQVectors { // load the calibrations for the mean v loadCalibrations(foundBC.timestamp(), cfgMeanv.value); - registry.get(HIST("vmean/hvertex_vx"))->Fill(Form("%d", runnumber), v[0]); - registry.get(HIST("vmean/hvertex_vy"))->Fill(Form("%d", runnumber), v[1]); - registry.get(HIST("vmean/hvertex_vz"))->Fill(Form("%d", runnumber), v[2]); - - bool isZNAhit = true; - bool isZNChit = true; - - for (int i = 0; i < nTowers; ++i) { - if (i < nTowersPerSide && eZN[i] <= 0) - isZNAhit = false; - if (i >= nTowersPerSide && eZN[i] <= 0) - isZNChit = false; - } - - if (zdcCol.energyCommonZNA() <= 0) - isZNAhit = false; - if (zdcCol.energyCommonZNC() <= 0) - isZNChit = false; - - // Fill to get mean energy per tower in 1% centrality bins - if (isZNAhit) { - registry.get(HIST("Energy/hZNA_mean_t0_cent"))->Fill(Form("%d", runnumber), cent, zdcCol.energyCommonZNA(), 1); - registry.get(HIST("Energy/hZNA_mean_t1_cent"))->Fill(Form("%d", runnumber), cent, eZN[0], 1); - registry.get(HIST("Energy/hZNA_mean_t2_cent"))->Fill(Form("%d", runnumber), cent, eZN[1], 1); - registry.get(HIST("Energy/hZNA_mean_t3_cent"))->Fill(Form("%d", runnumber), cent, eZN[2], 1); - registry.get(HIST("Energy/hZNA_mean_t4_cent"))->Fill(Form("%d", runnumber), cent, eZN[3], 1); - } - if (isZNChit) { - registry.get(HIST("Energy/hZNC_mean_t0_cent"))->Fill(Form("%d", runnumber), cent, zdcCol.energyCommonZNC(), 1); - registry.get(HIST("Energy/hZNC_mean_t1_cent"))->Fill(Form("%d", runnumber), cent, eZN[4], 1); - registry.get(HIST("Energy/hZNC_mean_t2_cent"))->Fill(Form("%d", runnumber), cent, eZN[5], 1); - registry.get(HIST("Energy/hZNC_mean_t3_cent"))->Fill(Form("%d", runnumber), cent, eZN[6], 1); - registry.get(HIST("Energy/hZNC_mean_t4_cent"))->Fill(Form("%d", runnumber), cent, eZN[7], 1); - } - - // if ZNA or ZNC not hit correctly.. do not use event in q-vector calculation - if (!isZNAhit || !isZNChit) { - counter++; - isSelected = false; - spTableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, isSelected, 0, 0); - lastRunNumber = runnumber; - return; + if(!cfgFillNothing){ + registry.get(HIST("vmean/hvertex_vx"))->Fill(Form("%d", runnumber), v[0]); + registry.get(HIST("vmean/hvertex_vy"))->Fill(Form("%d", runnumber), v[1]); + registry.get(HIST("vmean/hvertex_vz"))->Fill(Form("%d", runnumber), v[2]); + + // Fill to get mean energy per tower in 1% centrality bins + if (isZNAhit) { + registry.get(HIST("Energy/hZNA_mean_t0_cent"))->Fill(Form("%d", runnumber), cent, zdcCol.energyCommonZNA(), 1); + registry.get(HIST("Energy/hZNA_mean_t1_cent"))->Fill(Form("%d", runnumber), cent, eZN[0], 1); + registry.get(HIST("Energy/hZNA_mean_t2_cent"))->Fill(Form("%d", runnumber), cent, eZN[1], 1); + registry.get(HIST("Energy/hZNA_mean_t3_cent"))->Fill(Form("%d", runnumber), cent, eZN[2], 1); + registry.get(HIST("Energy/hZNA_mean_t4_cent"))->Fill(Form("%d", runnumber), cent, eZN[3], 1); + } + if (isZNChit) { + registry.get(HIST("Energy/hZNC_mean_t0_cent"))->Fill(Form("%d", runnumber), cent, zdcCol.energyCommonZNC(), 1); + registry.get(HIST("Energy/hZNC_mean_t1_cent"))->Fill(Form("%d", runnumber), cent, eZN[4], 1); + registry.get(HIST("Energy/hZNC_mean_t2_cent"))->Fill(Form("%d", runnumber), cent, eZN[5], 1); + registry.get(HIST("Energy/hZNC_mean_t3_cent"))->Fill(Form("%d", runnumber), cent, eZN[6], 1); + registry.get(HIST("Energy/hZNC_mean_t4_cent"))->Fill(Form("%d", runnumber), cent, eZN[7], 1); + } } - registry.fill(HIST("hEventCount"), evSel_isSelectedZDC); - // Do not continue if Energy calibration is not loaded if (!cal.calibfilesLoaded[0]) { counter++; isSelected = false; - spTableZDC(runnumber, centrality, v[0], v[1], v[2], 0, 0, 0, 0, isSelected, 0, 0); + spTableZDC(runnumber, cents, v, foundBC.timestamp(), 0, 0, 0, 0, isSelected, eventSelectionFlags); lastRunNumber = runnumber; return; } @@ -739,68 +833,70 @@ struct ZdcQVectors { calibtower++; } - for (int i = 0; i < nTowersPerSide; i++) { - float bincenter = i + .5; - registry.fill(HIST("QA/ZNA_Energy"), bincenter, eZN[i]); - registry.fill(HIST("QA/ZNA_Energy"), bincenter + 4, e[i]); - registry.fill(HIST("QA/ZNC_Energy"), bincenter, eZN[i + 4]); - registry.fill(HIST("QA/ZNC_Energy"), bincenter + 4, e[i + 4]); - - registry.get(HIST("QA/before/ZNA_pmC"))->Fill(Form("%d", runnumber), meanEZN[0]); - registry.get(HIST("QA/before/ZNA_pm1"))->Fill(Form("%d", runnumber), eZN[0]); - registry.get(HIST("QA/before/ZNA_pm2"))->Fill(Form("%d", runnumber), eZN[1]); - registry.get(HIST("QA/before/ZNA_pm3"))->Fill(Form("%d", runnumber), eZN[2]); - registry.get(HIST("QA/before/ZNA_pm4"))->Fill(Form("%d", runnumber), eZN[3]); - - registry.get(HIST("QA/before/ZNC_pmC"))->Fill(Form("%d", runnumber), meanEZN[5]); - registry.get(HIST("QA/before/ZNC_pm1"))->Fill(Form("%d", runnumber), eZN[4]); - registry.get(HIST("QA/before/ZNC_pm2"))->Fill(Form("%d", runnumber), eZN[5]); - registry.get(HIST("QA/before/ZNC_pm3"))->Fill(Form("%d", runnumber), eZN[6]); - registry.get(HIST("QA/before/ZNC_pm4"))->Fill(Form("%d", runnumber), eZN[7]); - - registry.get(HIST("QA/after/ZNA_pm1"))->Fill(Form("%d", runnumber), e[0]); - registry.get(HIST("QA/after/ZNA_pm2"))->Fill(Form("%d", runnumber), e[1]); - registry.get(HIST("QA/after/ZNA_pm3"))->Fill(Form("%d", runnumber), e[2]); - registry.get(HIST("QA/after/ZNA_pm4"))->Fill(Form("%d", runnumber), e[3]); - registry.get(HIST("QA/after/ZNC_pm1"))->Fill(Form("%d", runnumber), e[4]); - registry.get(HIST("QA/after/ZNC_pm2"))->Fill(Form("%d", runnumber), e[5]); - registry.get(HIST("QA/after/ZNC_pm3"))->Fill(Form("%d", runnumber), e[6]); - registry.get(HIST("QA/after/ZNC_pm4"))->Fill(Form("%d", runnumber), e[7]); - - double sumZNAbefore = eZN[0] + eZN[1] + eZN[2] + eZN[3]; - double sumZNAafter = e[0] + e[1] + e[2] + e[3]; - - double sumZNCbefore = eZN[4] + eZN[5] + eZN[6] + eZN[7]; - double sumZNCafter = e[4] + e[5] + e[6] + e[7]; - - registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNA_pmC_vs_Centrality"), centrality, zdcCol.energyCommonZNA()); - registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNA_pmSUM_vs_Centrality"), centrality, sumZNAbefore); - registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNA_pm1_vs_Centrality"), centrality, eZN[0] / sumZNAbefore); - registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNA_pm2_vs_Centrality"), centrality, eZN[1] / sumZNAbefore); - registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNA_pm3_vs_Centrality"), centrality, eZN[2] / sumZNAbefore); - registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNA_pm4_vs_Centrality"), centrality, eZN[3] / sumZNAbefore); - - registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNC_pmC_vs_Centrality"), centrality, zdcCol.energyCommonZNC()); - registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNC_pmSUM_vs_Centrality"), centrality, sumZNCbefore); - registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNC_pm1_vs_Centrality"), centrality, eZN[4] / sumZNCbefore); - registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNC_pm2_vs_Centrality"), centrality, eZN[5] / sumZNCbefore); - registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNC_pm3_vs_Centrality"), centrality, eZN[6] / sumZNCbefore); - registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNC_pm4_vs_Centrality"), centrality, eZN[7] / sumZNCbefore); - - registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNA_pmC_vs_Centrality"), centrality, zdcCol.energyCommonZNA()); - registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNA_pmSUM_vs_Centrality"), centrality, sumZNAafter); - registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNA_pm1_vs_Centrality"), centrality, e[0] / sumZNAafter); - registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNA_pm2_vs_Centrality"), centrality, e[1] / sumZNAafter); - registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNA_pm3_vs_Centrality"), centrality, e[2] / sumZNAafter); - registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNA_pm4_vs_Centrality"), centrality, e[3] / sumZNAafter); - - registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNC_pmC_vs_Centrality"), centrality, zdcCol.energyCommonZNC()); - registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNC_pmSUM_vs_Centrality"), centrality, sumZNCafter); - registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNC_pm1_vs_Centrality"), centrality, e[4] / sumZNCafter); - registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNC_pm2_vs_Centrality"), centrality, e[5] / sumZNCafter); - registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNC_pm3_vs_Centrality"), centrality, e[6] / sumZNCafter); - registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNC_pm4_vs_Centrality"), centrality, e[7] / sumZNCafter); - } + if(cfgFillHistRegistry && !cfgFillNothing) { + for (int i = 0; i < nTowersPerSide; i++) { + float bincenter = i + .5; + registry.fill(HIST("QA/ZNA_Energy"), bincenter, eZN[i]); + registry.fill(HIST("QA/ZNA_Energy"), bincenter + 4, e[i]); + registry.fill(HIST("QA/ZNC_Energy"), bincenter, eZN[i + 4]); + registry.fill(HIST("QA/ZNC_Energy"), bincenter + 4, e[i + 4]); + + registry.get(HIST("QA/before/ZNA_pmC"))->Fill(Form("%d", runnumber), meanEZN[0]); + registry.get(HIST("QA/before/ZNA_pm1"))->Fill(Form("%d", runnumber), eZN[0]); + registry.get(HIST("QA/before/ZNA_pm2"))->Fill(Form("%d", runnumber), eZN[1]); + registry.get(HIST("QA/before/ZNA_pm3"))->Fill(Form("%d", runnumber), eZN[2]); + registry.get(HIST("QA/before/ZNA_pm4"))->Fill(Form("%d", runnumber), eZN[3]); + + registry.get(HIST("QA/before/ZNC_pmC"))->Fill(Form("%d", runnumber), meanEZN[5]); + registry.get(HIST("QA/before/ZNC_pm1"))->Fill(Form("%d", runnumber), eZN[4]); + registry.get(HIST("QA/before/ZNC_pm2"))->Fill(Form("%d", runnumber), eZN[5]); + registry.get(HIST("QA/before/ZNC_pm3"))->Fill(Form("%d", runnumber), eZN[6]); + registry.get(HIST("QA/before/ZNC_pm4"))->Fill(Form("%d", runnumber), eZN[7]); + + registry.get(HIST("QA/after/ZNA_pm1"))->Fill(Form("%d", runnumber), e[0]); + registry.get(HIST("QA/after/ZNA_pm2"))->Fill(Form("%d", runnumber), e[1]); + registry.get(HIST("QA/after/ZNA_pm3"))->Fill(Form("%d", runnumber), e[2]); + registry.get(HIST("QA/after/ZNA_pm4"))->Fill(Form("%d", runnumber), e[3]); + registry.get(HIST("QA/after/ZNC_pm1"))->Fill(Form("%d", runnumber), e[4]); + registry.get(HIST("QA/after/ZNC_pm2"))->Fill(Form("%d", runnumber), e[5]); + registry.get(HIST("QA/after/ZNC_pm3"))->Fill(Form("%d", runnumber), e[6]); + registry.get(HIST("QA/after/ZNC_pm4"))->Fill(Form("%d", runnumber), e[7]); + + double sumZNAbefore = eZN[0] + eZN[1] + eZN[2] + eZN[3]; + double sumZNAafter = e[0] + e[1] + e[2] + e[3]; + + double sumZNCbefore = eZN[4] + eZN[5] + eZN[6] + eZN[7]; + double sumZNCafter = e[4] + e[5] + e[6] + e[7]; + + registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNA_pmC_vs_Centrality"), centrality, zdcCol.energyCommonZNA()); + registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNA_pmSUM_vs_Centrality"), centrality, sumZNAbefore); + registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNA_pm1_vs_Centrality"), centrality, eZN[0] / sumZNAbefore); + registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNA_pm2_vs_Centrality"), centrality, eZN[1] / sumZNAbefore); + registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNA_pm3_vs_Centrality"), centrality, eZN[2] / sumZNAbefore); + registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNA_pm4_vs_Centrality"), centrality, eZN[3] / sumZNAbefore); + + registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNC_pmC_vs_Centrality"), centrality, zdcCol.energyCommonZNC()); + registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNC_pmSUM_vs_Centrality"), centrality, sumZNCbefore); + registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNC_pm1_vs_Centrality"), centrality, eZN[4] / sumZNCbefore); + registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNC_pm2_vs_Centrality"), centrality, eZN[5] / sumZNCbefore); + registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNC_pm3_vs_Centrality"), centrality, eZN[6] / sumZNCbefore); + registry.fill(HIST("QA/") + HIST("before") + HIST("/ZNC_pm4_vs_Centrality"), centrality, eZN[7] / sumZNCbefore); + + registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNA_pmC_vs_Centrality"), centrality, zdcCol.energyCommonZNA()); + registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNA_pmSUM_vs_Centrality"), centrality, sumZNAafter); + registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNA_pm1_vs_Centrality"), centrality, e[0] / sumZNAafter); + registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNA_pm2_vs_Centrality"), centrality, e[1] / sumZNAafter); + registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNA_pm3_vs_Centrality"), centrality, e[2] / sumZNAafter); + registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNA_pm4_vs_Centrality"), centrality, e[3] / sumZNAafter); + + registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNC_pmC_vs_Centrality"), centrality, zdcCol.energyCommonZNC()); + registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNC_pmSUM_vs_Centrality"), centrality, sumZNCafter); + registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNC_pm1_vs_Centrality"), centrality, e[4] / sumZNCafter); + registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNC_pm2_vs_Centrality"), centrality, e[5] / sumZNCafter); + registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNC_pm3_vs_Centrality"), centrality, e[6] / sumZNCafter); + registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNC_pm4_vs_Centrality"), centrality, e[7] / sumZNCafter); + } + } // Now calculate Q-vector for (int tower = 0; tower < nTowers; tower++) { @@ -843,26 +939,28 @@ struct ZdcQVectors { std::vector qRec(q); - registry.get(HIST("QA/before/ZNA_Qx"))->Fill(Form("%d", runnumber), q[0]); - registry.get(HIST("QA/before/ZNA_Qy"))->Fill(Form("%d", runnumber), q[1]); - registry.get(HIST("QA/before/ZNC_Qx"))->Fill(Form("%d", runnumber), q[2]); - registry.get(HIST("QA/before/ZNC_Qy"))->Fill(Form("%d", runnumber), q[3]); + if(cfgFillHistRegistry && !cfgFillNothing) { + registry.get(HIST("QA/before/ZNA_Qx"))->Fill(Form("%d", runnumber), q[0]); + registry.get(HIST("QA/before/ZNA_Qy"))->Fill(Form("%d", runnumber), q[1]); + registry.get(HIST("QA/before/ZNC_Qx"))->Fill(Form("%d", runnumber), q[2]); + registry.get(HIST("QA/before/ZNC_Qy"))->Fill(Form("%d", runnumber), q[3]); - registry.get(HIST("QA/before/ZNA_Qx_noEq"))->Fill(Form("%d", runnumber), qNoEq[0]); - registry.get(HIST("QA/before/ZNA_Qy_noEq"))->Fill(Form("%d", runnumber), qNoEq[1]); - registry.get(HIST("QA/before/ZNC_Qx_noEq"))->Fill(Form("%d", runnumber), qNoEq[2]); - registry.get(HIST("QA/before/ZNC_Qy_noEq"))->Fill(Form("%d", runnumber), qNoEq[3]); + registry.get(HIST("QA/before/ZNA_Qx_noEq"))->Fill(Form("%d", runnumber), qNoEq[0]); + registry.get(HIST("QA/before/ZNA_Qy_noEq"))->Fill(Form("%d", runnumber), qNoEq[1]); + registry.get(HIST("QA/before/ZNC_Qx_noEq"))->Fill(Form("%d", runnumber), qNoEq[2]); + registry.get(HIST("QA/before/ZNC_Qy_noEq"))->Fill(Form("%d", runnumber), qNoEq[3]); + } if (cal.atIteration == 0) { - if (isSelected && cfgFillCommonRegistry) + if (isSelected && cfgFillHistRegistry) fillCommonRegistry(q[0], q[1], q[2], q[3], v, centrality); - spTableZDC(runnumber, centrality, v[0], v[1], v[2], q[0], q[1], q[2], q[3], isSelected, 0, 0); + spTableZDC(runnumber, cents, v, foundBC.timestamp(), q[0], q[1], q[2], q[3], isSelected, eventSelectionFlags); counter++; lastRunNumber = runnumber; return; } else { - if (cfgFillCommonRegistry) + if (cfgFillHistRegistry) fillCommonRegistry(q[0], q[1], q[2], q[3], v, centrality); // vector of 4 @@ -898,13 +996,15 @@ struct ZdcQVectors { qRec[2] -= corrQxC[cor]; qRec[3] -= corrQyC[cor]; - registry.get(HIST("QA/QXA_vs_iteration"))->Fill(cor, qRec[0]); - registry.get(HIST("QA/QYA_vs_iteration"))->Fill(cor, qRec[1]); - registry.get(HIST("QA/QXC_vs_iteration"))->Fill(cor, qRec[2]); - registry.get(HIST("QA/QYC_vs_iteration"))->Fill(cor, qRec[3]); + if(cfgFillHistRegistry && !cfgFillNothing) { + registry.get(HIST("QA/QXA_vs_iteration"))->Fill(cor, qRec[0]); + registry.get(HIST("QA/QYA_vs_iteration"))->Fill(cor, qRec[1]); + registry.get(HIST("QA/QXC_vs_iteration"))->Fill(cor, qRec[2]); + registry.get(HIST("QA/QYC_vs_iteration"))->Fill(cor, qRec[3]); + } } - if (isSelected && cfgFillCommonRegistry) { + if (isSelected && cfgFillHistRegistry && !cfgFillNothing) { fillCommonRegistry(qRec[0], qRec[1], qRec[2], qRec[3], v, centrality); registry.fill(HIST("QA/centrality_after"), centrality); registry.get(HIST("QA/after/ZNA_Qx"))->Fill(Form("%d", runnumber), qRec[0]); @@ -940,10 +1040,12 @@ struct ZdcQVectors { } for (int ishift = 1; ishift <= nshift; ishift++) { - registry.fill(HIST("shift/ShiftZDCC"), centrality, 0.5, ishift - 0.5, std::sin(ishift * 1.0 * psiZDCC)); - registry.fill(HIST("shift/ShiftZDCC"), centrality, 1.5, ishift - 0.5, std::cos(ishift * 1.0 * psiZDCC)); - registry.fill(HIST("shift/ShiftZDCA"), centrality, 0.5, ishift - 0.5, std::sin(ishift * 1.0 * psiZDCA)); - registry.fill(HIST("shift/ShiftZDCA"), centrality, 1.5, ishift - 0.5, std::cos(ishift * 1.0 * psiZDCA)); + if(!cfgFillNothing){ + registry.fill(HIST("shift/ShiftZDCC"), centrality, 0.5, ishift - 0.5, std::sin(ishift * 1.0 * psiZDCC)); + registry.fill(HIST("shift/ShiftZDCC"), centrality, 1.5, ishift - 0.5, std::cos(ishift * 1.0 * psiZDCC)); + registry.fill(HIST("shift/ShiftZDCA"), centrality, 0.5, ishift - 0.5, std::sin(ishift * 1.0 * psiZDCA)); + registry.fill(HIST("shift/ShiftZDCA"), centrality, 1.5, ishift - 0.5, std::cos(ishift * 1.0 * psiZDCA)); + } } float coeffshiftxZDCC = 0.0; @@ -979,11 +1081,13 @@ struct ZdcQVectors { psiZDCCshift = std::atan2(std::sin(psiZDCCshift), std::cos(psiZDCCshift)); psiZDCAshift = std::atan2(std::sin(psiZDCAshift), std::cos(psiZDCAshift)); - if (cfgFillCommonRegistry) { + if (cfgFillHistRegistry && !cfgFillNothing) { registry.fill(HIST("QA/psiZDCA"), psiZDCA, centrality); registry.fill(HIST("QA/psiZDCC"), psiZDCC, centrality); + registry.fill(HIST("QA/psiZDCAC"), psiZDCA, psiZDCC); registry.fill(HIST("QA/psiZDCA_shift"), psiZDCAshift, centrality); registry.fill(HIST("QA/psiZDCC_shift"), psiZDCCshift, centrality); + registry.fill(HIST("QA/psiZDCAC_shift"), psiZDCAshift, psiZDCCshift); } double qXaShift = std::hypot(qRec[1], qRec[0]) * std::cos(psiZDCAshift); @@ -991,7 +1095,7 @@ struct ZdcQVectors { double qXcShift = std::hypot(qRec[2], qRec[3]) * std::cos(psiZDCCshift); double qYcShift = std::hypot(qRec[2], qRec[3]) * std::sin(psiZDCCshift); - spTableZDC(runnumber, centrality, v[0], v[1], v[2], qXaShift, qYaShift, qXcShift, qYcShift, isSelected, cal.atIteration, cal.atStep); + spTableZDC(runnumber, cents, v, foundBC.timestamp(), qXaShift, qYaShift, qXcShift, qYcShift, isSelected, eventSelectionFlags); qRec.clear(); counter++; From 7254b69b7168dc0fcbf40f6d12a94ce4fd4fd191 Mon Sep 17 00:00:00 2001 From: cnkoster Date: Wed, 5 Nov 2025 17:35:01 +0100 Subject: [PATCH 3/8] Add 2D efficiency option and add extra event selections + adapt for updated table --- PWGCF/Flow/Tasks/flowSP.cxx | 137 +++++++++++++++++++++++------------- 1 file changed, 88 insertions(+), 49 deletions(-) diff --git a/PWGCF/Flow/Tasks/flowSP.cxx b/PWGCF/Flow/Tasks/flowSP.cxx index 71de4920a93..0fcccd3f0bb 100644 --- a/PWGCF/Flow/Tasks/flowSP.cxx +++ b/PWGCF/Flow/Tasks/flowSP.cxx @@ -69,6 +69,20 @@ struct FlowSP { O2_DEFINE_CONFIGURABLE(cfgEvtRCTFlagCheckerLimitAcceptAsBad, bool, false, "Evt sel: RCT flag checker treat Limited Acceptance As Bad"); } rctFlags; + // struct : ConfigurableGroup { // <-- change all to evsels.Selection + // event selection configurable group + O2_DEFINE_CONFIGURABLE(cfgEvSelsUseAdditionalEventCut, bool, true, "Bool to enable Additional Event Cut"); + O2_DEFINE_CONFIGURABLE(cfgEvSelsMaxOccupancy, int, 10000, "Maximum occupancy of selected events"); + O2_DEFINE_CONFIGURABLE(cfgEvSelsNoSameBunchPileupCut, bool, true, "kNoSameBunchPileupCut"); + O2_DEFINE_CONFIGURABLE(cfgEvSelsIsGoodZvtxFT0vsPV, bool, true, "kIsGoodZvtxFT0vsPV"); + O2_DEFINE_CONFIGURABLE(cfgEvSelsNoCollInTimeRangeStandard, bool, true, "kNoCollInTimeRangeStandard"); + O2_DEFINE_CONFIGURABLE(cfgEvSelsNoCollInTimeRangeNarrow, bool, true, "kNoCollInTimeRangeNarrow"); + O2_DEFINE_CONFIGURABLE(cfgEvSelsDoOccupancySel, bool, true, "Bool for event selection on detector occupancy"); + O2_DEFINE_CONFIGURABLE(cfgEvSelsIsVertexITSTPC, bool, true, "Selects collisions with at least one ITS-TPC track"); + O2_DEFINE_CONFIGURABLE(cfgEvSelsIsGoodITSLayersAll, bool, true, "Cut time intervals with dead ITS staves"); + O2_DEFINE_CONFIGURABLE(cfgEvSelsIsGoodITSLayer0123, bool, true, "Cut time intervals with dead ITS staves"); + // } evSels; + // QA Plots O2_DEFINE_CONFIGURABLE(cfgFillEventQA, bool, false, "Fill histograms for event QA"); O2_DEFINE_CONFIGURABLE(cfgFillTrackQA, bool, false, "Fill histograms for track QA"); @@ -107,6 +121,7 @@ struct FlowSP { O2_DEFINE_CONFIGURABLE(cfgFillWeightsNEG, bool, true, "Fill NUA weights only for negative charges"); O2_DEFINE_CONFIGURABLE(cfguseNUA1D, bool, false, "Use 1D NUA weights (only phi)"); O2_DEFINE_CONFIGURABLE(cfguseNUA2D, bool, true, "Use 2D NUA weights (phi and eta)"); + O2_DEFINE_CONFIGURABLE(cfguseNUE2D, bool, true, "Use 2D NUE weights (pt and eta)"); // Additional track Selections O2_DEFINE_CONFIGURABLE(cfgTrackSelsUseAdditionalTrackCut, bool, false, "Bool to enable Additional Track Cut"); O2_DEFINE_CONFIGURABLE(cfgTrackSelsDoDCApt, bool, false, "Apply Pt dependent DCAz cut"); @@ -114,16 +129,6 @@ struct FlowSP { O2_DEFINE_CONFIGURABLE(cfgTrackSelsDCApt2, float, 0.035, "DcaZ < a * b / pt^1.1 -> this sets b"); O2_DEFINE_CONFIGURABLE(cfgTrackSelsPIDNsigma, float, 2.0, "nSigma cut for PID"); O2_DEFINE_CONFIGURABLE(cfgTrackSelDoTrackQAvsCent, bool, true, "Do track selection QA plots as function of centrality"); - // Additional event selections - O2_DEFINE_CONFIGURABLE(cfgEvSelsUseAdditionalEventCut, bool, true, "Bool to enable Additional Event Cut"); - O2_DEFINE_CONFIGURABLE(cfgEvSelsMaxOccupancy, int, 10000, "Maximum occupancy of selected events"); - O2_DEFINE_CONFIGURABLE(cfgEvSelsNoSameBunchPileupCut, bool, true, "kNoSameBunchPileupCut"); - O2_DEFINE_CONFIGURABLE(cfgEvSelsIsGoodZvtxFT0vsPV, bool, true, "kIsGoodZvtxFT0vsPV"); - O2_DEFINE_CONFIGURABLE(cfgEvSelsNoCollInTimeRangeStandard, bool, true, "kNoCollInTimeRangeStandard"); - O2_DEFINE_CONFIGURABLE(cfgEvSelsDoOccupancySel, bool, true, "Bool for event selection on detector occupancy"); - O2_DEFINE_CONFIGURABLE(cfgEvSelsTVXinTRD, bool, false, "Use kTVXinTRD (reject TRD triggered events)"); - O2_DEFINE_CONFIGURABLE(cfgEvSelsIsVertexITSTPC, bool, true, "Selects collisions with at least one ITS-TPC track"); - O2_DEFINE_CONFIGURABLE(cfgEvSelsIsGoodITSLayersAll, bool, true, "Cut time intervals with dead ITS staves"); // harmonics for v coefficients O2_DEFINE_CONFIGURABLE(cfgHarm, int, 1, "Flow harmonic n for ux and uy: (Cos(n*phi), Sin(n*phi))"); O2_DEFINE_CONFIGURABLE(cfgHarmMixed, int, 2, "Flow harmonic n for ux and uy in mixed harmonics (MH): (Cos(n*phi), Sin(n*phi))"); @@ -131,7 +136,8 @@ struct FlowSP { O2_DEFINE_CONFIGURABLE(cfgCCDBdir_QQ, std::string, "Users/c/ckoster/ZDC/LHC23_PbPb_pass5/meanQQ/Default", "ccdb dir for average QQ values in 1% centrality bins"); O2_DEFINE_CONFIGURABLE(cfgCCDBdir_SP, std::string, "", "ccdb dir for average event plane resolution in 1% centrality bins"); O2_DEFINE_CONFIGURABLE(cfgCCDB_NUA, std::string, "Users/c/ckoster/flowSP/LHC23_PbPb_pass5/Default", "ccdb dir for NUA corrections"); - O2_DEFINE_CONFIGURABLE(cfgCCDB_NUE, std::string, "Users/c/ckoster/flowSP/LHC23_PbPb_pass5/NUE/Default", "ccdb dir for NUE corrections"); + O2_DEFINE_CONFIGURABLE(cfgCCDB_NUE, std::string, "Users/c/ckoster/flowSP/LHC23_PbPb_pass5/NUE/Default", "ccdb dir for NUE corrections (pt)"); + O2_DEFINE_CONFIGURABLE(cfgCCDB_NUE2D, std::string, "Users/c/ckoster/flowSP/LHC23_PbPb_pass5/NUE/2D", "ccdb dir for NUE 2D corrections (eta, pt)"); O2_DEFINE_CONFIGURABLE(cfgCCDBdir_centrality, std::string, "", "ccdb dir for Centrality corrections"); // Confogirable axis ConfigurableAxis axisCentrality{"axisCentrality", {20, 0, 100}, "Centrality bins for vn "}; @@ -170,6 +176,7 @@ struct FlowSP { // struct to hold the correction histos/ struct Config { std::vector mEfficiency = {}; + std::vector mEfficiency2D = {}; std::vector mAcceptance = {}; std::vector mAcceptance2D = {}; bool correctionsLoaded = false; @@ -234,13 +241,14 @@ struct FlowSP { evSel_sel8, evSel_RCTFlagsZDC, evSel_occupancy, - evSel_kTVXinTRD, evSel_kNoSameBunchPileup, evSel_kIsGoodZvtxFT0vsPV, evSel_kNoCollInTimeRangeStandard, + evSel_kNoCollInTimeRangeNarrow, evSel_kIsVertexITSTPC, - evSel_MultCuts, evSel_kIsGoodITSLayersAll, + evSel_kIsGoodITSLayer0123, + evSel_MultCuts, evSel_isSelectedZDC, evSel_CentCuts, nEventSelections @@ -329,19 +337,20 @@ struct FlowSP { rctChecker.init(rctFlags.cfgEvtRCTFlagCheckerLabel, rctFlags.cfgEvtRCTFlagCheckerZDCCheck, rctFlags.cfgEvtRCTFlagCheckerLimitAcceptAsBad); histos.add("hEventCount", "Number of Event; Cut; #Events Passed Cut", {HistType::kTH1D, {{nEventSelections, 0, nEventSelections}}}); - histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_FilteredEvent + 1, "Filtered event"); + histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_FilteredEvent + 1, "Filtered events"); + histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_RCTFlagsZDC + 1, "RCT Flags ZDC"); histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_sel8 + 1, "Sel8"); - histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_RCTFlagsZDC + 1, "RCTFlags (ZDC CBT LimAcc"); histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_occupancy + 1, "kOccupancy"); - histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kTVXinTRD + 1, "kTVXinTRD"); histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kNoSameBunchPileup + 1, "kNoSameBunchPileup"); histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsGoodZvtxFT0vsPV + 1, "kIsGoodZvtxFT0vsPV"); histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kNoCollInTimeRangeStandard + 1, "kNoCollInTimeRangeStandard"); + histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kNoCollInTimeRangeNarrow + 1, "kNoCollInTimeRangeNarrow"); histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsVertexITSTPC + 1, "kIsVertexITSTPC"); - histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_MultCuts + 1, "Multiplicity cuts"); - histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsGoodITSLayersAll + 1, "kkIsGoodITSLayersAll"); - histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_isSelectedZDC + 1, "isSelected ZDC"); histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_CentCuts + 1, "Cenrality range"); + histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsGoodITSLayersAll + 1, "kkIsGoodITSLayersAll"); + histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_kIsGoodITSLayer0123 + 1, "kkIsGoodITSLayer0123"); + histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_MultCuts + 1, "Multiplicity Cuts Pilup"); + histos.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_isSelectedZDC + 1, "isSelected"); histos.add("hTrackCount", "Number of Tracks; Cut; #Tracks Passed Cut", {HistType::kTH1D, {{nTrackSelections, 0, nTrackSelections}}}); histos.get(HIST("hTrackCount"))->GetXaxis()->SetBinLabel(trackSel_Eta + 1, "Eta"); @@ -742,6 +751,20 @@ struct FlowSP { } else { LOGF(info, "cfgCCDB_NUE empty! No corrections loaded"); } + // Get Efficiency correction + if (cfgCCDB_NUE2D.value.empty() == false) { + TList* listCorrections = ccdb->getForTimeStamp(cfgCCDB_NUE2D, timestamp); + cfg.mEfficiency2D.push_back(reinterpret_cast(listCorrections->FindObject("Efficiency2D"))); + cfg.mEfficiency2D.push_back(reinterpret_cast(listCorrections->FindObject("Efficiency2D_pos"))); + cfg.mEfficiency2D.push_back(reinterpret_cast(listCorrections->FindObject("Efficiency2D_neg"))); + int sizeEff = cfg.mEfficiency2D.size(); + if (sizeEff < nWeights) + LOGF(fatal, "Could not load efficiency histogram for trigger particles from %s", cfgCCDB_NUE.value.c_str()); + else + LOGF(info, "Loaded efficiency histogram from %s", cfgCCDB_NUE.value.c_str()); + } else { + LOGF(info, "cfgCCDB_NUE2 empty! No corrections loaded"); + } cfg.correctionsLoaded = true; } @@ -750,10 +773,17 @@ struct FlowSP { { float eff = 1.; int sizeEff = cfg.mEfficiency.size(); - if (sizeEff > pID) - eff = cfg.mEfficiency[pID]->GetBinContent(cfg.mEfficiency[pID]->FindBin(pt)); - else + if (sizeEff > pID) { + if(cfguseNUE2D) { + int binx = cfg.mEfficiency2D[pID]->GetXaxis()->FindBin(eta); + int biny = cfg.mEfficiency2D[pID]->GetYaxis()->FindBin(pt); + eff = cfg.mEfficiency2D[pID]->GetBinContent(binx, biny); + } else { + eff = cfg.mEfficiency[pID]->GetBinContent(cfg.mEfficiency[pID]->FindBin(pt)); + } + } else { eff = 1.0; + } if (eff == 0) return false; @@ -796,15 +826,6 @@ struct FlowSP { histos.fill(HIST("hEventCount"), evSel_occupancy); } - if (cfgEvSelsTVXinTRD) { - if (collision.alias_bit(kTVXinTRD)) { - // TRD triggered - // "CMTVX-B-NOPF-TRD,minbias_TVX" - return 0; - } - histos.fill(HIST("hEventCount"), evSel_kTVXinTRD); - } - if (cfgEvSelsNoSameBunchPileupCut) { if (!collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup)) { // rejects collisions which are associated with the same "found-by-T0" bunch crossing @@ -828,7 +849,13 @@ struct FlowSP { } histos.fill(HIST("hEventCount"), evSel_kNoCollInTimeRangeStandard); } - + if (cfgEvSelsNoCollInTimeRangeNarrow) { + if (!collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow)) { + // Rejection of the collisions which have other events nearby + return 0; + } + histos.fill(HIST("hEventCount"), evSel_kNoCollInTimeRangeNarrow); + } if (cfgEvSelsIsVertexITSTPC) { if (!collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC)) { // selects collisions with at least one ITS-TPC track, and thus rejects vertices built from ITS-only tracks @@ -837,6 +864,21 @@ struct FlowSP { histos.fill(HIST("hEventCount"), evSel_kIsVertexITSTPC); } + if (cfgEvSelsIsGoodITSLayersAll) { + if (!collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) { + // New event selection bits to cut time intervals with dead ITS staves + // https://indico.cern.ch/event/1493023/ (09-01-2025) + return 0; + } + histos.fill(HIST("hEventCount"), evSel_kIsGoodITSLayersAll); + } + if (cfgEvSelsIsGoodITSLayer0123) { + if (!collision.selection_bit(o2::aod::evsel::kIsGoodITSLayer0123)) { + return 0; + } + histos.fill(HIST("hEventCount"), evSel_kIsGoodITSLayer0123); + } + if (cfgEvSelsUseAdditionalEventCut) { float vtxz = -999; if (collision.numContrib() > 1) { @@ -864,15 +906,6 @@ struct FlowSP { histos.fill(HIST("hEventCount"), evSel_MultCuts); } - if (cfgEvSelsIsGoodITSLayersAll) { - if (!collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll)) { - // New event selection bits to cut time intervals with dead ITS staves - // https://indico.cern.ch/event/1493023/ (09-01-2025) - return 0; - } - histos.fill(HIST("hEventCount"), evSel_kIsGoodITSLayersAll); - } - return 1; } @@ -957,7 +990,7 @@ struct FlowSP { histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/CentFT0C_vs_CentNGlobal"), collision.centFT0C(), collision.centNGlobal(), spm.centWeight); if (cfgFillEventPlaneQA) { - if constexpr (o2::framework::has_type_v) { + if constexpr (o2::framework::has_type_v) { double psiA = 1.0 * std::atan2(collision.qyA(), collision.qxA()); double psiC = 1.0 * std::atan2(collision.qyC(), collision.qxC()); double psiFull = 1.0 * std::atan2(collision.qyA() + collision.qyC(), collision.qxA() + collision.qxC()); @@ -965,12 +998,12 @@ struct FlowSP { histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiA_vs_Cent"), psiA, collision.centFT0C(), spm.centWeight); histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiC_vs_Cent"), psiC, collision.centFT0C(), spm.centWeight); histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiFull_vs_Cent"), psiFull, collision.centFT0C(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiA_vs_Vx"), psiA, collision.vx(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiC_vs_Vx"), psiC, collision.vx(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiFull_vs_Vx"), psiFull, collision.vx(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiA_vs_Vy"), psiA, collision.vy(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiC_vs_Vy"), psiC, collision.vy(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiFull_vs_Vy"), psiFull, collision.vy(), spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiA_vs_Vx"), psiA, collision.vertex()[0], spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiC_vs_Vx"), psiC, collision.vertex()[0], spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiFull_vs_Vx"), psiFull, collision.vertex()[0], spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiA_vs_Vy"), psiA, collision.vertex()[1], spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiC_vs_Vy"), psiC, collision.vertex()[1], spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiFull_vs_Vy"), psiFull, collision.vertex()[1], spm.centWeight); histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiA_vs_Vz"), psiA, collision.posZ(), spm.centWeight); histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiC_vs_Vz"), psiC, collision.posZ(), spm.centWeight); histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PsiFull_vs_Vz"), psiFull, collision.posZ(), spm.centWeight); @@ -1158,11 +1191,12 @@ struct FlowSP { if (!eventSelected(collision, tracks.size())) return; - + if (!collision.isSelected()) // selected by ZDCQVectors task (checks signal in ZDC) --> only possible in data not MC return; histos.fill(HIST("hEventCount"), evSel_isSelectedZDC); + spm.qxA = collision.qxA(); spm.qyA = collision.qyA(); spm.qxC = collision.qxC(); @@ -1458,6 +1492,11 @@ struct FlowSP { spm.charge = (track.sign() > 0) ? kPositive : kNegative; + int minVal = 100; + if (cfgFilterLeptons && std::abs(mcParticle.pdgCode()) < minVal) { + continue; + } + // This neglects PID (for now) later use getPID like in data. if (cfgFillQABefore) { fillAllQA(track); From 1ca1413c9f093875e8174ec4826bdb114f192ad5 Mon Sep 17 00:00:00 2001 From: cnkoster Date: Wed, 5 Nov 2025 17:40:18 +0100 Subject: [PATCH 4/8] change q-vector component names --- PWGCF/DataModel/SPTableZDC.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGCF/DataModel/SPTableZDC.h b/PWGCF/DataModel/SPTableZDC.h index 0c6e9124cd1..4ee40a7a992 100644 --- a/PWGCF/DataModel/SPTableZDC.h +++ b/PWGCF/DataModel/SPTableZDC.h @@ -30,10 +30,10 @@ DECLARE_SOA_COLUMN(Runnumber, runnumber, int); DECLARE_SOA_COLUMN(Cents, cents, std::vector); DECLARE_SOA_COLUMN(Vertex, vertex, std::vector); DECLARE_SOA_COLUMN(Timestamp, timestamp, int64_t); -DECLARE_SOA_COLUMN(QXA, qxA, float); -DECLARE_SOA_COLUMN(QYA, qyA, float); -DECLARE_SOA_COLUMN(QXC, qxC, float); -DECLARE_SOA_COLUMN(QYC, qyC, float); +DECLARE_SOA_COLUMN(QxA, qxA, float); +DECLARE_SOA_COLUMN(QyA, qyA, float); +DECLARE_SOA_COLUMN(QxC, qxC, float); +DECLARE_SOA_COLUMN(QyC, qyC, float); DECLARE_SOA_COLUMN(IsSelected, isSelected, bool); DECLARE_SOA_COLUMN(EventSelectionFlags, eventSelectionFlags, uint16_t); From 58121bf870bdeeef7da7993fbf04e3f5832930fc Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 5 Nov 2025 16:40:58 +0000 Subject: [PATCH 5/8] Please consider the following formatting changes --- PWGCF/DataModel/SPTableZDC.h | 9 +- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 110 +++++++++++------------ PWGCF/Flow/Tasks/flowSP.cxx | 11 ++- 3 files changed, 64 insertions(+), 66 deletions(-) diff --git a/PWGCF/DataModel/SPTableZDC.h b/PWGCF/DataModel/SPTableZDC.h index 4ee40a7a992..a11372cd927 100644 --- a/PWGCF/DataModel/SPTableZDC.h +++ b/PWGCF/DataModel/SPTableZDC.h @@ -14,14 +14,15 @@ #ifndef PWGCF_DATAMODEL_SPTABLEZDC_H_ #define PWGCF_DATAMODEL_SPTABLEZDC_H_ -#include -#include - -#include "Common/DataModel/PIDResponse.h" #include "Common/Core/RecoDecay.h" +#include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/TrackSelectionTables.h" + #include "Framework/AnalysisDataModel.h" +#include +#include + namespace o2::aod { namespace sptablezdc diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index f1d3241a632..02664f24d55 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -90,7 +90,7 @@ std::vector meanEZN(10); // mean energies from calibration histos (commo std::vector e(8, 0.); // calibrated energies (a1, a2, a3, a4, c1, c2, c3, c4)) // Define variables needed to do the recentring steps. -float centrality = 0; +float centrality = 0; int runnumber = 0; int lastRunNumber = 0; std::vector v(3, 0); // vx, vy, vz @@ -115,12 +115,11 @@ struct ZdcQVectors { RCTFlagsChecker rctChecker; struct : ConfigurableGroup { - // Additional event selections + // Additional event selections O2_DEFINE_CONFIGURABLE(cfgMaxOccupancy, int, 10000, "Maximum occupancy of selected events"); O2_DEFINE_CONFIGURABLE(cfgCentMin, float, 0, "Minimum cenrality for selected events"); O2_DEFINE_CONFIGURABLE(cfgCentMax, float, 90, "Maximum cenrality for selected events"); - } EvSel; - + } EvSel; ConfigurableAxis axisCent{"axisCent", {90, 0, 90}, "Centrality axis in 1% bins"}; ConfigurableAxis axisCent10{"axisCent10", {9, 0, 90}, "Centrality axis in 10% bins"}; @@ -221,7 +220,7 @@ struct ZdcQVectors { AxisSpec axisPsiA = {100, -M_PI, M_PI, "#Psi_{1} ZNA"}; AxisSpec axisPsiC = {100, -M_PI, M_PI, "#Psi_{1} ZNC"}; - // This is the only histogram that is AL~WA~YS filled. + // This is the only histogram that is AL~WA~YS filled. registry.add("hEventCount", "Number of Event; Cut; #Events Passed Cut", {HistType::kTH1D, {{nEventSelections, 0, nEventSelections}}}); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_FilteredEvent + 1, "Filtered events"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_BCHasZDC + 1, "BCHasZDC"); @@ -242,8 +241,8 @@ struct ZdcQVectors { int totalTowers = 10; int totalTowersPerSide = 5; for (int tower = 0; tower < totalTowers; tower++) { - namesEcal[tower] = TString::Format("hZN%s_mean_t%i_cent", sides[(tower < totalTowersPerSide) ? 0 : 1], tower % 5); - } + namesEcal[tower] = TString::Format("hZN%s_mean_t%i_cent", sides[(tower < totalTowersPerSide) ? 0 : 1], tower % 5); + } for (const auto& side : sides) { for (const auto& coord : capCOORDS) { @@ -254,9 +253,8 @@ struct ZdcQVectors { names[4].push_back(TString::Format("hQ%s%s_mean_vz_run", coord, side)); } // end of capCOORDS } - - if(!cfgFillNothing){ + if (!cfgFillNothing) { if (cfgFillHistRegistry) { registry.add(Form("QA/before/hSPplaneA"), "hSPplaneA", kTH2D, {axisPsiA, axisCent10}); registry.add(Form("QA/before/hSPplaneC"), "hSPplaneC", kTH2D, {axisPsiC, axisCent10}); @@ -350,18 +348,16 @@ struct ZdcQVectors { } // recentered q-vectors (to check what steps are finished in the end) - + registry.add("vmean/hvertex_vx", "hvertex_vx", kTProfile, {{1, 0., 1.}}); registry.add("vmean/hvertex_vy", "hvertex_vy", kTProfile, {{1, 0., 1.}}); registry.add("vmean/hvertex_vz", "hvertex_vz", kTProfile, {{1, 0., 1.}}); - registry.add("shift/ShiftZDCC", "ShiftZDCC", kTProfile3D, {{100, 0, 100}, {2, 0, 2}, {10, 0, 10}}); registry.add("shift/ShiftZDCA", "ShiftZDCA", kTProfile3D, {{100, 0, 100}, {2, 0, 2}, {10, 0, 10}}); - - if(cfgFillCutAnalysis) { - // Tower mean energies vs. centrality used for tower gain equalisation + if (cfgFillCutAnalysis) { + // Tower mean energies vs. centrality used for tower gain equalisation int totalTowers = 10; int totalTowersPerSide = 5; for (int tower = 0; tower < totalTowers; tower++) { @@ -376,49 +372,53 @@ struct ZdcQVectors { } template - inline void fillCutAnalysis(TCollision collision, TZdc zdcBC, int evSel) + inline void fillCutAnalysis(TCollision collision, TZdc zdcBC, int evSel) { registry.fill(HIST("hEventCount"), evSel); // FT0C is the default centrality estimator auto cent = collision.centFT0C(); cents.push_back(collision.centFT0C()); - if (cfgFT0Cvariant1){ - if(cfgUseSecondCent) cent = collision.centFT0CVariant1(); + if (cfgFT0Cvariant1) { + if (cfgUseSecondCent) + cent = collision.centFT0CVariant1(); cents.push_back(collision.centFT0CVariant1()); } - if (cfgFT0M){ - if(cfgUseSecondCent) cent = collision.centFT0M(); + if (cfgFT0M) { + if (cfgUseSecondCent) + cent = collision.centFT0M(); cents.push_back(collision.centFT0M()); } - if (cfgFV0A){ - if(cfgUseSecondCent) cent = collision.centFV0A(); + if (cfgFV0A) { + if (cfgUseSecondCent) + cent = collision.centFV0A(); cents.push_back(collision.centFV0A()); } - if (cfgNGlobal){ - if(cfgUseSecondCent) cent = collision.centNGlobal(); + if (cfgNGlobal) { + if (cfgUseSecondCent) + cent = collision.centNGlobal(); cents.push_back(collision.centNGlobal()); } - centrality = cent; - - if(!cfgFillCutAnalysis || cfgFillNothing) return; - // Here we fill the Energy and mean vx, vy vz histograms with an extra dimension for all the event selections used. - registry.get(HIST("CutAnalysis/hvertex_vx"))->Fill(Form("%d", runnumber), evSel, collision.posX()); - registry.get(HIST("CutAnalysis/hvertex_vy"))->Fill(Form("%d", runnumber), evSel, collision.posY()); - registry.get(HIST("CutAnalysis/hvertex_vz"))->Fill(Form("%d", runnumber), evSel, collision.posZ()); - - registry.get(HIST("CutAnalysis/hZNA_mean_t0_cent"))->Fill(cent, evSel, zdcBC.energyCommonZNA(), 1); - registry.get(HIST("CutAnalysis/hZNA_mean_t1_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[0], 1); - registry.get(HIST("CutAnalysis/hZNA_mean_t2_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[1], 1); - registry.get(HIST("CutAnalysis/hZNA_mean_t3_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[2], 1); - registry.get(HIST("CutAnalysis/hZNA_mean_t4_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[3], 1); - registry.get(HIST("CutAnalysis/hZNC_mean_t0_cent"))->Fill(cent, evSel, zdcBC.energyCommonZNC(), 1); - registry.get(HIST("CutAnalysis/hZNC_mean_t1_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[0], 1); - registry.get(HIST("CutAnalysis/hZNC_mean_t2_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[1], 1); - registry.get(HIST("CutAnalysis/hZNC_mean_t3_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[2], 1); - registry.get(HIST("CutAnalysis/hZNC_mean_t4_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[3], 1); - } + centrality = cent; + if (!cfgFillCutAnalysis || cfgFillNothing) + return; + // Here we fill the Energy and mean vx, vy vz histograms with an extra dimension for all the event selections used. + registry.get(HIST("CutAnalysis/hvertex_vx"))->Fill(Form("%d", runnumber), evSel, collision.posX()); + registry.get(HIST("CutAnalysis/hvertex_vy"))->Fill(Form("%d", runnumber), evSel, collision.posY()); + registry.get(HIST("CutAnalysis/hvertex_vz"))->Fill(Form("%d", runnumber), evSel, collision.posZ()); + + registry.get(HIST("CutAnalysis/hZNA_mean_t0_cent"))->Fill(cent, evSel, zdcBC.energyCommonZNA(), 1); + registry.get(HIST("CutAnalysis/hZNA_mean_t1_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[0], 1); + registry.get(HIST("CutAnalysis/hZNA_mean_t2_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[1], 1); + registry.get(HIST("CutAnalysis/hZNA_mean_t3_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[2], 1); + registry.get(HIST("CutAnalysis/hZNA_mean_t4_cent"))->Fill(cent, evSel, zdcBC.energySectorZNA()[3], 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t0_cent"))->Fill(cent, evSel, zdcBC.energyCommonZNC(), 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t1_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[0], 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t2_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[1], 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t3_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[2], 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t4_cent"))->Fill(cent, evSel, zdcBC.energySectorZNC()[3], 1); + } template uint16_t eventSelected(TCollision collision, TBunchCrossing bunchCrossing) @@ -426,10 +426,10 @@ struct ZdcQVectors { uint16_t selectionBits = 0; bool selected; - // Define selection criteria + // Define selection criteria // If event is selected (passed the cut), set the corresponding bit in the selectionBits variable // bit 0 is for filterd events, so it will stay 0 - // uint16_t is 16 bits, so we have room for 15 selection criteria here + // uint16_t is 16 bits, so we have room for 15 selection criteria here selected = std::fabs(collision.posZ()) < cfgVtxZ; if (selected) { @@ -492,8 +492,8 @@ struct ZdcQVectors { fillCutAnalysis(collision, bunchCrossing, evSel_kIsGoodITSLayer0123); } - selected = rctChecker(collision); - if (selected){ + selected = rctChecker(collision); + if (selected) { selectionBits |= (uint16_t)(0x1u << evSel_RCTFlagsZDC); fillCutAnalysis(collision, bunchCrossing, evSel_RCTFlagsZDC); } @@ -506,7 +506,8 @@ struct ZdcQVectors { { // loop for filling multiple histograms with different naming patterns // Always fill the uncentered "raw" Q-vector histos! - if(cfgFillNothing) return; + if (cfgFillNothing) + return; static constexpr std::string_view Time[] = {"before", "after"}; registry.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/hZNA_Qx_vs_Qy"), qxa, qya); @@ -741,8 +742,6 @@ struct ZdcQVectors { } registry.fill(HIST("hEventCount"), evSel_isSelectedZDC); - - uint16_t eventSelectionFlags = eventSelected(collision, foundBC.zdc()); // ALWAYS use these event selections @@ -772,7 +771,6 @@ struct ZdcQVectors { cal.shiftprofileA = nullptr; } - // load the calibration histos for iteration 0 step 0 (Energy Calibration) loadCalibrations(foundBC.timestamp(), cfgEnergyCal.value); @@ -784,7 +782,7 @@ struct ZdcQVectors { // load the calibrations for the mean v loadCalibrations(foundBC.timestamp(), cfgMeanv.value); - if(!cfgFillNothing){ + if (!cfgFillNothing) { registry.get(HIST("vmean/hvertex_vx"))->Fill(Form("%d", runnumber), v[0]); registry.get(HIST("vmean/hvertex_vy"))->Fill(Form("%d", runnumber), v[1]); registry.get(HIST("vmean/hvertex_vz"))->Fill(Form("%d", runnumber), v[2]); @@ -833,7 +831,7 @@ struct ZdcQVectors { calibtower++; } - if(cfgFillHistRegistry && !cfgFillNothing) { + if (cfgFillHistRegistry && !cfgFillNothing) { for (int i = 0; i < nTowersPerSide; i++) { float bincenter = i + .5; registry.fill(HIST("QA/ZNA_Energy"), bincenter, eZN[i]); @@ -896,7 +894,7 @@ struct ZdcQVectors { registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNC_pm3_vs_Centrality"), centrality, e[6] / sumZNCafter); registry.fill(HIST("QA/") + HIST("after") + HIST("/ZNC_pm4_vs_Centrality"), centrality, e[7] / sumZNCafter); } - } + } // Now calculate Q-vector for (int tower = 0; tower < nTowers; tower++) { @@ -939,7 +937,7 @@ struct ZdcQVectors { std::vector qRec(q); - if(cfgFillHistRegistry && !cfgFillNothing) { + if (cfgFillHistRegistry && !cfgFillNothing) { registry.get(HIST("QA/before/ZNA_Qx"))->Fill(Form("%d", runnumber), q[0]); registry.get(HIST("QA/before/ZNA_Qy"))->Fill(Form("%d", runnumber), q[1]); registry.get(HIST("QA/before/ZNC_Qx"))->Fill(Form("%d", runnumber), q[2]); @@ -996,7 +994,7 @@ struct ZdcQVectors { qRec[2] -= corrQxC[cor]; qRec[3] -= corrQyC[cor]; - if(cfgFillHistRegistry && !cfgFillNothing) { + if (cfgFillHistRegistry && !cfgFillNothing) { registry.get(HIST("QA/QXA_vs_iteration"))->Fill(cor, qRec[0]); registry.get(HIST("QA/QYA_vs_iteration"))->Fill(cor, qRec[1]); registry.get(HIST("QA/QXC_vs_iteration"))->Fill(cor, qRec[2]); @@ -1040,7 +1038,7 @@ struct ZdcQVectors { } for (int ishift = 1; ishift <= nshift; ishift++) { - if(!cfgFillNothing){ + if (!cfgFillNothing) { registry.fill(HIST("shift/ShiftZDCC"), centrality, 0.5, ishift - 0.5, std::sin(ishift * 1.0 * psiZDCC)); registry.fill(HIST("shift/ShiftZDCC"), centrality, 1.5, ishift - 0.5, std::cos(ishift * 1.0 * psiZDCC)); registry.fill(HIST("shift/ShiftZDCA"), centrality, 0.5, ishift - 0.5, std::sin(ishift * 1.0 * psiZDCA)); diff --git a/PWGCF/Flow/Tasks/flowSP.cxx b/PWGCF/Flow/Tasks/flowSP.cxx index 0fcccd3f0bb..4ea5937776d 100644 --- a/PWGCF/Flow/Tasks/flowSP.cxx +++ b/PWGCF/Flow/Tasks/flowSP.cxx @@ -70,7 +70,7 @@ struct FlowSP { } rctFlags; // struct : ConfigurableGroup { // <-- change all to evsels.Selection - // event selection configurable group + // event selection configurable group O2_DEFINE_CONFIGURABLE(cfgEvSelsUseAdditionalEventCut, bool, true, "Bool to enable Additional Event Cut"); O2_DEFINE_CONFIGURABLE(cfgEvSelsMaxOccupancy, int, 10000, "Maximum occupancy of selected events"); O2_DEFINE_CONFIGURABLE(cfgEvSelsNoSameBunchPileupCut, bool, true, "kNoSameBunchPileupCut"); @@ -774,9 +774,9 @@ struct FlowSP { float eff = 1.; int sizeEff = cfg.mEfficiency.size(); if (sizeEff > pID) { - if(cfguseNUE2D) { - int binx = cfg.mEfficiency2D[pID]->GetXaxis()->FindBin(eta); - int biny = cfg.mEfficiency2D[pID]->GetYaxis()->FindBin(pt); + if (cfguseNUE2D) { + int binx = cfg.mEfficiency2D[pID]->GetXaxis()->FindBin(eta); + int biny = cfg.mEfficiency2D[pID]->GetYaxis()->FindBin(pt); eff = cfg.mEfficiency2D[pID]->GetBinContent(binx, biny); } else { eff = cfg.mEfficiency[pID]->GetBinContent(cfg.mEfficiency[pID]->FindBin(pt)); @@ -1191,12 +1191,11 @@ struct FlowSP { if (!eventSelected(collision, tracks.size())) return; - + if (!collision.isSelected()) // selected by ZDCQVectors task (checks signal in ZDC) --> only possible in data not MC return; histos.fill(HIST("hEventCount"), evSel_isSelectedZDC); - spm.qxA = collision.qxA(); spm.qyA = collision.qyA(); spm.qxC = collision.qxC(); From e43b1ed1ea3e3419f35442ca8c42f0e36afe5243 Mon Sep 17 00:00:00 2001 From: cnkoster Date: Wed, 5 Nov 2025 22:25:08 +0100 Subject: [PATCH 6/8] fix q-vec names --- PWGCF/DataModel/SPTableZDC.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGCF/DataModel/SPTableZDC.h b/PWGCF/DataModel/SPTableZDC.h index a11372cd927..a6bbae827c6 100644 --- a/PWGCF/DataModel/SPTableZDC.h +++ b/PWGCF/DataModel/SPTableZDC.h @@ -45,10 +45,10 @@ DECLARE_SOA_TABLE(SPTableZDC, "AOD", "SPZDC", sptablezdc::Cents, sptablezdc::Vertex, sptablezdc::Timestamp, - sptablezdc::QXA, - sptablezdc::QYA, - sptablezdc::QXC, - sptablezdc::QYC, + sptablezdc::QxA, + sptablezdc::QyA, + sptablezdc::QxC, + sptablezdc::QyC, sptablezdc::IsSelected, sptablezdc::EventSelectionFlags); } // namespace o2::aod From 145c5f2e039350b7b051e3e3b94eb847bbbcc904 Mon Sep 17 00:00:00 2001 From: cnkoster Date: Wed, 5 Nov 2025 22:25:32 +0100 Subject: [PATCH 7/8] use static_cast --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index 02664f24d55..892ef20edb2 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -433,68 +433,68 @@ struct ZdcQVectors { selected = std::fabs(collision.posZ()) < cfgVtxZ; if (selected) { - selectionBits |= (uint16_t)(0x1u << evSel_Zvtx); + selectionBits |= static_cast(0x1u << evSel_Zvtx); fillCutAnalysis(collision, bunchCrossing, evSel_Zvtx); } selected = collision.sel8(); if (selected) { - selectionBits |= (uint16_t)(0x1u << evSel_sel8); + selectionBits |= static_cast(0x1u << evSel_sel8); fillCutAnalysis(collision, bunchCrossing, evSel_sel8); } auto occupancy = collision.trackOccupancyInTimeRange(); selected = occupancy <= EvSel.cfgMaxOccupancy; if (selected) { - selectionBits |= (uint16_t)(0x1u << evSel_occupancy); + selectionBits |= static_cast(0x1u << evSel_occupancy); fillCutAnalysis(collision, bunchCrossing, evSel_occupancy); } selected = collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup); if (selected) { - selectionBits |= (uint16_t)(0x1u << evSel_kNoSameBunchPileup); + selectionBits |= static_cast(0x1u << evSel_kNoSameBunchPileup); fillCutAnalysis(collision, bunchCrossing, evSel_kNoSameBunchPileup); } selected = collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV); if (selected) { - selectionBits |= (uint16_t)(0x1u << evSel_kIsGoodZvtxFT0vsPV); + selectionBits |= static_cast(0x1u << evSel_kIsGoodZvtxFT0vsPV); fillCutAnalysis(collision, bunchCrossing, evSel_kIsGoodZvtxFT0vsPV); } selected = collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard); if (selected) { - selectionBits |= (uint16_t)(0x1u << evSel_kNoCollInTimeRangeStandard); + selectionBits |= static_cast(0x1u << evSel_kNoCollInTimeRangeStandard); fillCutAnalysis(collision, bunchCrossing, evSel_kNoCollInTimeRangeStandard); } selected = collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow); if (selected) { - selectionBits |= (uint16_t)(0x1u << evSel_kNoCollInTimeRangeNarrow); + selectionBits |= static_cast(0x1u << evSel_kNoCollInTimeRangeNarrow); fillCutAnalysis(collision, bunchCrossing, evSel_kNoCollInTimeRangeNarrow); } selected = collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC); if (selected) { - selectionBits |= (uint16_t)(0x1u << evSel_kIsVertexITSTPC); + selectionBits |= static_cast(0x1u << evSel_kIsVertexITSTPC); fillCutAnalysis(collision, bunchCrossing, evSel_kIsVertexITSTPC); } selected = collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll); if (selected) { - selectionBits |= (uint16_t)(0x1u << evSel_kIsGoodITSLayersAll); + selectionBits |= static_cast(0x1u << evSel_kIsGoodITSLayersAll); fillCutAnalysis(collision, bunchCrossing, evSel_kIsGoodITSLayersAll); } selected = collision.selection_bit(o2::aod::evsel::kIsGoodITSLayer0123); if (selected) { - selectionBits |= (uint16_t)(0x1u << evSel_kIsGoodITSLayer0123); + selectionBits |= static_cast(0x1u << evSel_kIsGoodITSLayer0123); fillCutAnalysis(collision, bunchCrossing, evSel_kIsGoodITSLayer0123); } selected = rctChecker(collision); if (selected) { - selectionBits |= (uint16_t)(0x1u << evSel_RCTFlagsZDC); + selectionBits |= static_cast(0x1u << evSel_RCTFlagsZDC); fillCutAnalysis(collision, bunchCrossing, evSel_RCTFlagsZDC); } From 442dfe2f025d34e26d2c703cddfba4efade83a75 Mon Sep 17 00:00:00 2001 From: cnkoster Date: Thu, 6 Nov 2025 09:23:36 +0100 Subject: [PATCH 8/8] remove unuesd variable --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index 892ef20edb2..dbba6da0ece 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -359,7 +359,6 @@ struct ZdcQVectors { if (cfgFillCutAnalysis) { // Tower mean energies vs. centrality used for tower gain equalisation int totalTowers = 10; - int totalTowersPerSide = 5; for (int tower = 0; tower < totalTowers; tower++) { registry.add(Form("CutAnalysis/%s", namesEcal[tower].Data()), Form("%s", namesEcal[tower].Data()), kTProfile2D, {axisCent, {nEventSelections, 0, nEventSelections}}); }