From 0f9e95291da6b28942f7738adae6f5c23c6dfd0b Mon Sep 17 00:00:00 2001 From: cnkoster Date: Tue, 11 Aug 2026 22:50:05 +0200 Subject: [PATCH 1/9] Change shifted vertex to cal.v --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 39 ++++++++++++------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index b221a02530f..dca7ac0fbdd 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -186,7 +186,8 @@ struct ZdcQVectors { kEnergyCal, kMeanv, kRec, - kTimestamp + kTimestamp, + nCalibModes }; // Define output @@ -843,7 +844,7 @@ struct ZdcQVectors { if (!foundBC.has_zdc()) { cal.isSelected = false; - spTableZDC(runnumber, cents, v, foundBC.timestamp(), 0, 0, 0, 0, cal.isSelected, 0); + spTableZDC(runnumber, cents, cal.v, foundBC.timestamp(), 0, 0, 0, 0, cal.isSelected, 0); cal.lastRunNumber = runnumber; return; } @@ -882,7 +883,7 @@ struct ZdcQVectors { // if ZNA or ZNC not hit correctly.. do not use event in q-vector calculation if (!isZNAhit || !isZNChit) { cal.isSelected = false; - spTableZDC(runnumber, cents, v, foundBC.timestamp(), 0, 0, 0, 0, cal.isSelected, 0); + spTableZDC(runnumber, cents, cal.v, foundBC.timestamp(), 0, 0, 0, 0, cal.isSelected, 0); cal.lastRunNumber = runnumber; return; } @@ -898,7 +899,7 @@ struct ZdcQVectors { if (cent < EvSel.cfgCentMin || cent > EvSel.cfgCentMax || std::abs(collision.posZ()) > cfgVtxZ || !collision.sel8()) { // event not selected cal.isSelected = false; - spTableZDC(runnumber, cents, v, foundBC.timestamp(), 0, 0, 0, 0, cal.isSelected, eventSelectionFlags); + spTableZDC(runnumber, cents, cal.v, foundBC.timestamp(), 0, 0, 0, 0, cal.isSelected, eventSelectionFlags); cal.lastRunNumber = runnumber; return; } @@ -906,17 +907,17 @@ struct ZdcQVectors { // load new calibrations for new runs only if (runnumber != cal.lastRunNumber) { - cal.calibfilesLoaded[0] = false; - cal.calibList[0] = nullptr; + cal.calibfilesLoaded[kEnergyCal] = false; + cal.calibList[kEnergyCal] = nullptr; - cal.calibfilesLoaded[1] = false; - cal.calibList[1] = nullptr; + cal.calibfilesLoaded[kMeanv] = false; + cal.calibList[kMeanv] = nullptr; - cal.calibfilesLoaded[2] = false; - cal.calibList[2] = nullptr; + cal.calibfilesLoaded[kRec] = false; + cal.calibList[kRec] = nullptr; - cal.calibfilesLoaded[3] = false; - cal.calibList[3] = nullptr; + cal.calibfilesLoaded[kTimestamp] = false; + cal.calibList[kTimestamp] = nullptr; cal.isShiftProfileFound = false; cal.shiftprofileC = nullptr; @@ -1043,8 +1044,8 @@ struct ZdcQVectors { } if (cal.calibfilesLoaded[1]) { - v[0] = v[0] - getCorrection(vnames[0].Data()); - v[1] = v[1] - getCorrection(vnames[1].Data()); + cal.v[0] = v[0] - getCorrection(vnames[0].Data()); + cal.v[1] = v[1] - getCorrection(vnames[1].Data()); } else { LOGF(warning, " --> No mean V found.. -> THis wil lead to wrong axis for vx, vy (will be created in vmean/)"); return; @@ -1060,14 +1061,14 @@ struct ZdcQVectors { if (cal.atIteration == 0) { if (cal.isSelected && cfgFillHistRegistry && isEventSelected) - fillCommonRegistry(q[0], q[1], q[2], q[3], v, cent, rsTimestamp); + fillCommonRegistry(q[0], q[1], q[2], q[3], cal.v, cent, rsTimestamp); - spTableZDC(runnumber, cents, v, foundBC.timestamp(), q[0], q[1], q[2], q[3], cal.isSelected, eventSelectionFlags); + spTableZDC(runnumber, cents, cal.v, foundBC.timestamp(), q[0], q[1], q[2], q[3], cal.isSelected, eventSelectionFlags); cal.lastRunNumber = runnumber; return; } else { if (cfgFillHistRegistry && isEventSelected) - fillCommonRegistry(q[0], q[1], q[2], q[3], v, cent, rsTimestamp); + fillCommonRegistry(q[0], q[1], q[2], q[3], cal.v, cent, rsTimestamp); // vector of 4 std::vector corrQxA; @@ -1222,7 +1223,7 @@ struct ZdcQVectors { double qYcShift = std::hypot(qRec[2], qRec[3]) * std::sin(psiZDCCshift); if (cal.isSelected && cfgFillHistRegistry && !cfgFillNothing && isEventSelected) { - fillCommonRegistry(qXaShift, qYaShift, qXcShift, qYcShift, v, cent, rsTimestamp); + fillCommonRegistry(qXaShift, qYaShift, qXcShift, qYcShift, cal.v, cent, rsTimestamp); registry.fill(HIST("QA/centrality_after"), cent); registry.get(HIST("QA/after/ZNA_Qx"))->Fill(Form("%d", runnumber), qXaShift); registry.get(HIST("QA/after/ZNA_Qy"))->Fill(Form("%d", runnumber), qYaShift); @@ -1230,7 +1231,7 @@ struct ZdcQVectors { registry.get(HIST("QA/after/ZNC_Qy"))->Fill(Form("%d", runnumber), qYcShift); } - spTableZDC(runnumber, cents, v, foundBC.timestamp(), qXaShift, qYaShift, qXcShift, qYcShift, cal.isSelected, eventSelectionFlags); + spTableZDC(runnumber, cents, cal.v, foundBC.timestamp(), qXaShift, qYaShift, qXcShift, qYcShift, cal.isSelected, eventSelectionFlags); qRec = {0, 0, 0, 0}; cal.lastRunNumber = runnumber; From 63c4e97cbb2af66ce2a44ef55ded2e4ba3691b54 Mon Sep 17 00:00:00 2001 From: cnkoster Date: Thu, 13 Aug 2026 00:41:45 +0200 Subject: [PATCH 2/9] Fix build code checker issues --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 67 +++++++++++++----------- 1 file changed, 37 insertions(+), 30 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index dca7ac0fbdd..53b96a4bd98 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -54,7 +54,7 @@ #include #include -#include +#include #define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; @@ -68,7 +68,7 @@ using namespace o2::constants::math; namespace o2::analysis::qvectortask { -int counter = 0; + // Define histogrm names here to use same names for creating and later uploading and retrieving data from ccdb // Energy calibration: @@ -415,7 +415,7 @@ struct ZdcQVectors { } template - inline void fillCutAnalysis(TCollision collision, TZdc zdcBC, int evSel) + inline void fillCutAnalysis(const TCollision& collision, const TZdc& zdcBC, int evSel) { registry.fill(HIST("hEventCount"), evSel); // FT0C is the default centrality estimator @@ -466,10 +466,10 @@ struct ZdcQVectors { } template - uint16_t eventSelected(TCollision collision, TBunchCrossing bunchCrossing, bool& isEventSelected, const int& multTrk) + uint16_t eventSelected(const TCollision& collision, const TBunchCrossing& bunchCrossing, bool& isEventSelected, const int& multTrk) { uint16_t selectionBits = 0; - bool selected; + bool selected = false; // Define selection criteria // If event is selected (passed the cut), set the corresponding bit in the selectionBits variable @@ -578,16 +578,21 @@ struct ZdcQVectors { auto multNTracksPV = collision.multNTracksPV(); selected = true; - if (vtxz > cfgVtxZ || vtxz < -cfgVtxZ) + if (vtxz > cfgVtxZ || vtxz < -cfgVtxZ){ selected = false; - if (multNTracksPV < fMultPVCutLow->Eval(collision.centFT0C())) + } + if (multNTracksPV < fMultPVCutLow->Eval(collision.centFT0C())){ selected = false; - if (multNTracksPV > fMultPVCutHigh->Eval(collision.centFT0C())) + } + if (multNTracksPV > fMultPVCutHigh->Eval(collision.centFT0C())){ selected = false; - if (multTrk < fMultCutLow->Eval(collision.centFT0C())) + } + if (multTrk < fMultCutLow->Eval(collision.centFT0C())){ selected = false; - if (multTrk > fMultCutHigh->Eval(collision.centFT0C())) + } + if (multTrk > fMultCutHigh->Eval(collision.centFT0C())){ selected = false; + } if (selected) { selectionBits |= static_cast(0x1u << evSel_MultCut); @@ -606,9 +611,10 @@ struct ZdcQVectors { { // loop for filling multiple histograms with different naming patterns // Always fill the uncentered "raw" Q-vector histos! - if (cfgFillNothing) + if (cfgFillNothing){ return; - static constexpr std::string_view Time[] = {"before", "after"}; + } + static constexpr std::array Time = {"before", "after"}; //todo move to struct like in flowSP registry.fill(HIST("recentering/") + HIST(Time[ft]) + HIST("/hZNA_Qx_vs_Qy"), qxa, qya); registry.fill(HIST("recentering/") + HIST(Time[ft]) + HIST("/hZNC_Qx_vs_Qy"), qxc, qyc); @@ -678,7 +684,7 @@ struct ZdcQVectors { } template - void loadCalibrations(std::string ccdb_dir, uint64_t timestamp) + void loadCalibrations(const std::string &ccdb_dir, uint64_t timestamp) { // iteration = 0 (Energy calibration) -> step 0 only // iteration 1,2,3,4,5 = recentering -> 5 steps per iteration (1x 4D + 4x 1D) @@ -687,7 +693,7 @@ struct ZdcQVectors { return; } - if (ccdb_dir.empty() == false) { + if (!ccdb_dir.empty()) { cal.calibList[cm] = ccdb->getForTimeStamp(ccdb_dir, timestamp); cal.calibfilesLoaded[cm] = true; LOGF(info, "Loaded calibration histos from %s", ccdb_dir.c_str()); @@ -706,16 +712,16 @@ struct ZdcQVectors { if (cm == kEnergyCal || cm == kMeanv) { TList* list = cal.calibList[cm]; - hist = reinterpret_cast(list->FindObject(Form("%s", objName))); + hist = dynamic_cast(list->FindObject(Form("%s", objName))); } else if (cm == kTimestamp) { - auto list = reinterpret_cast(cal.calibList[cm]->FindObject(Form("it%i_step%i", iteration, step))); - hist = reinterpret_cast(list->FindObject(Form("%s", objName))); + auto list = dynamic_cast(cal.calibList[cm]->FindObject(Form("it%i_step%i", iteration, step))); + hist = dynamic_cast(list->FindObject(Form("%s", objName))); } else if (cm == kRec) { - auto list = reinterpret_cast(cal.calibList[cm]->FindObject(Form("it%i_step%i", iteration, step))); + auto list = dynamic_cast(cal.calibList[cm]->FindObject(Form("it%i_step%i", iteration, step))); if (!list) { LOGF(fatal, "No calibration list for iteration %i and step %i", iteration, step); } - hist = reinterpret_cast(list->FindObject(Form("%s", objName))); + hist = dynamic_cast(list->FindObject(Form("%s", objName))); if (!hist) { LOGF(fatal, "No calibration histo for iteration %i and step %i -> %s", iteration, step, objName); } @@ -728,13 +734,13 @@ struct ZdcQVectors { if (hist->InheritsFrom("TProfile2D")) { // needed for energy calibration! - auto h = reinterpret_cast(hist); + auto h = dynamic_cast(hist); TString name = h->GetName(); int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%d", cal.runnumber)); int bin = h->GetYaxis()->FindBin(cal.centrality); calibConstant = h->GetBinContent(binrunnumber, bin); } else if (hist->InheritsFrom("TProfile")) { - auto h = reinterpret_cast(hist); + auto h = dynamic_cast(hist); TString name = h->GetName(); int bin{}; if (name.Contains("mean_vx")) { @@ -758,7 +764,7 @@ struct ZdcQVectors { calibConstant = h->GetBinContent(bin); } else if (hist->InheritsFrom("THnSparse")) { std::vector sparsePars; - auto h = reinterpret_cast(hist); + auto h = dynamic_cast(hist); sparsePars.push_back(h->GetAxis(0)->FindBin(cal.centrality)); sparsePars.push_back(h->GetAxis(1)->FindBin(cal.v[0])); sparsePars.push_back(h->GetAxis(2)->FindBin(cal.v[1])); @@ -857,9 +863,9 @@ struct ZdcQVectors { int nTowersPerSide = 4; // for energy calibration - std::array eZN; // uncalibrated energy for the 2x4 towers (a1, a2, a3, a4, c1, c2, c3, c4) - std::array meanEZN; // mean energies from calibration histos (common A, t1-4 A,common C, t1-4C) - std::array e; // calibrated energies (a1, a2, a3, a4, c1, c2, c3, c4)) + std::array eZN{}; // uncalibrated energy for the 2x4 towers (a1, a2, a3, a4, c1, c2, c3, c4) + std::array meanEZN{}; // mean energies from calibration histos (common A, t1-4 A,common C, t1-4C) + std::array e{}; // calibrated energies (a1, a2, a3, a4, c1, c2, c3, c4)) for (int tower = 0; tower < nTowers; tower++) { eZN[tower] = (tower < nTowersPerSide) ? zdcCol.energySectorZNA()[tower] : zdcCol.energySectorZNC()[tower % nTowersPerSide]; @@ -1066,7 +1072,8 @@ struct ZdcQVectors { spTableZDC(runnumber, cents, cal.v, foundBC.timestamp(), q[0], q[1], q[2], q[3], cal.isSelected, eventSelectionFlags); cal.lastRunNumber = runnumber; return; - } else { + } + if (cfgFillHistRegistry && isEventSelected) fillCommonRegistry(q[0], q[1], q[2], q[3], cal.v, cent, rsTimestamp); @@ -1149,11 +1156,11 @@ struct ZdcQVectors { double deltaPsiZDCA = 0; double deltaPsiZDCC = 0; - if (!cfgCCDBdir_Shift.value.empty() && cal.isShiftProfileFound == false) { + if (!cfgCCDBdir_Shift.value.empty() && !cal.isShiftProfileFound) { LOGF(info, "Getting shift profile from CCDB for runnumber: %d", runnumber); TList* hcorrList = ccdb->getForTimeStamp(cfgCCDBdir_Shift.value, foundBC.timestamp()); - cal.shiftprofileC = reinterpret_cast(hcorrList->FindObject("ShiftZDCC")); - cal.shiftprofileA = reinterpret_cast(hcorrList->FindObject("ShiftZDCA")); + cal.shiftprofileC = dynamic_cast(hcorrList->FindObject("ShiftZDCC")); + cal.shiftprofileA = dynamic_cast(hcorrList->FindObject("ShiftZDCA")); if (!cal.shiftprofileC || !cal.shiftprofileA) { LOGF(error, "Shift profile not found in CCDB for runnumber: %d", runnumber); cal.isShiftProfileFound = false; @@ -1236,7 +1243,7 @@ struct ZdcQVectors { cal.lastRunNumber = runnumber; return; - } + LOGF(warning, "We return without saving table... -> THis is a problem"); cal.lastRunNumber = runnumber; } // end of process From 05163ce8c07cff6a225c90be256a798cc5b9aba8 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 12 Aug 2026 22:42:22 +0000 Subject: [PATCH 3/9] Please consider the following formatting changes --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index 53b96a4bd98..d82e83b052c 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -48,14 +48,13 @@ #include #include #include +#include #include #include #include #include #include -#include - #define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; using namespace o2; @@ -69,7 +68,6 @@ using namespace o2::constants::math; namespace o2::analysis::qvectortask { - // Define histogrm names here to use same names for creating and later uploading and retrieving data from ccdb // Energy calibration: const std::array namesEcal = {{"hZNA_mean_t0_cent", "hZNA_mean_t1_cent", "hZNA_mean_t2_cent", "hZNA_mean_t3_cent", "hZNA_mean_t4_cent", @@ -578,19 +576,19 @@ struct ZdcQVectors { auto multNTracksPV = collision.multNTracksPV(); selected = true; - if (vtxz > cfgVtxZ || vtxz < -cfgVtxZ){ + if (vtxz > cfgVtxZ || vtxz < -cfgVtxZ) { selected = false; } - if (multNTracksPV < fMultPVCutLow->Eval(collision.centFT0C())){ + if (multNTracksPV < fMultPVCutLow->Eval(collision.centFT0C())) { selected = false; } - if (multNTracksPV > fMultPVCutHigh->Eval(collision.centFT0C())){ + if (multNTracksPV > fMultPVCutHigh->Eval(collision.centFT0C())) { selected = false; } - if (multTrk < fMultCutLow->Eval(collision.centFT0C())){ + if (multTrk < fMultCutLow->Eval(collision.centFT0C())) { selected = false; } - if (multTrk > fMultCutHigh->Eval(collision.centFT0C())){ + if (multTrk > fMultCutHigh->Eval(collision.centFT0C())) { selected = false; } @@ -611,10 +609,10 @@ struct ZdcQVectors { { // loop for filling multiple histograms with different naming patterns // Always fill the uncentered "raw" Q-vector histos! - if (cfgFillNothing){ + if (cfgFillNothing) { return; } - static constexpr std::array Time = {"before", "after"}; //todo move to struct like in flowSP + static constexpr std::array Time = {"before", "after"}; // todo move to struct like in flowSP registry.fill(HIST("recentering/") + HIST(Time[ft]) + HIST("/hZNA_Qx_vs_Qy"), qxa, qya); registry.fill(HIST("recentering/") + HIST(Time[ft]) + HIST("/hZNC_Qx_vs_Qy"), qxc, qyc); @@ -684,7 +682,7 @@ struct ZdcQVectors { } template - void loadCalibrations(const std::string &ccdb_dir, uint64_t timestamp) + void loadCalibrations(const std::string& ccdb_dir, uint64_t timestamp) { // iteration = 0 (Energy calibration) -> step 0 only // iteration 1,2,3,4,5 = recentering -> 5 steps per iteration (1x 4D + 4x 1D) From efae2f50bc250af3975c55e9f8e686e064348ed5 Mon Sep 17 00:00:00 2001 From: cnkoster Date: Thu, 13 Aug 2026 16:12:22 +0200 Subject: [PATCH 4/9] Fix more linter issues --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 26 ++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index d82e83b052c..cfc6ba9ebb2 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -55,7 +55,7 @@ #include #include -#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; +#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, (DEFAULT), (HELP)}; using namespace o2; using namespace o2::framework; @@ -200,7 +200,7 @@ struct ZdcQVectors { std::unique_ptr fMultCutHigh = nullptr; std::unique_ptr fMultMultPVCut = nullptr; - Service ccdb; + Service ccdb{}; // keep track of calibration histos for each given step and iteration struct Calib { @@ -713,7 +713,13 @@ struct ZdcQVectors { hist = dynamic_cast(list->FindObject(Form("%s", objName))); } else if (cm == kTimestamp) { auto list = dynamic_cast(cal.calibList[cm]->FindObject(Form("it%i_step%i", iteration, step))); + if (!list) { + LOGF(fatal, "No calibration list for iteration %i and step %i", iteration, step); + } hist = dynamic_cast(list->FindObject(Form("%s", objName))); + if (!hist) { + LOGF(fatal, "No calibration histo for iteration %i and step %i -> %s", iteration, step, objName); + } } else if (cm == kRec) { auto list = dynamic_cast(cal.calibList[cm]->FindObject(Form("it%i_step%i", iteration, step))); if (!list) { @@ -733,12 +739,15 @@ struct ZdcQVectors { if (hist->InheritsFrom("TProfile2D")) { // needed for energy calibration! auto h = dynamic_cast(hist); + if(h){ TString name = h->GetName(); int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%d", cal.runnumber)); int bin = h->GetYaxis()->FindBin(cal.centrality); calibConstant = h->GetBinContent(binrunnumber, bin); + } } else if (hist->InheritsFrom("TProfile")) { auto h = dynamic_cast(hist); + if(h){ TString name = h->GetName(); int bin{}; if (name.Contains("mean_vx")) { @@ -760,9 +769,11 @@ struct ZdcQVectors { bin = h->GetXaxis()->FindBin(cal.timestamp); } calibConstant = h->GetBinContent(bin); + } } else if (hist->InheritsFrom("THnSparse")) { std::vector sparsePars; auto h = dynamic_cast(hist); + if(h){ sparsePars.push_back(h->GetAxis(0)->FindBin(cal.centrality)); sparsePars.push_back(h->GetAxis(1)->FindBin(cal.v[0])); sparsePars.push_back(h->GetAxis(2)->FindBin(cal.v[1])); @@ -783,6 +794,7 @@ struct ZdcQVectors { delete tempProj; } + } return calibConstant; } @@ -1157,8 +1169,14 @@ struct ZdcQVectors { if (!cfgCCDBdir_Shift.value.empty() && !cal.isShiftProfileFound) { LOGF(info, "Getting shift profile from CCDB for runnumber: %d", runnumber); TList* hcorrList = ccdb->getForTimeStamp(cfgCCDBdir_Shift.value, foundBC.timestamp()); - cal.shiftprofileC = dynamic_cast(hcorrList->FindObject("ShiftZDCC")); - cal.shiftprofileA = dynamic_cast(hcorrList->FindObject("ShiftZDCA")); + auto shiftProfileC = dynamic_cast(hcorrList->FindObject("ShiftZDCC")); + if(shiftProfileC) { + cal.shiftprofileC = shiftProfileC; + } + auto shiftProfileA = dynamic_cast(hcorrList->FindObject("ShiftZDCA")); + if(shiftProfileA) { + cal.shiftprofileA = shiftProfileA; + } if (!cal.shiftprofileC || !cal.shiftprofileA) { LOGF(error, "Shift profile not found in CCDB for runnumber: %d", runnumber); cal.isShiftProfileFound = false; From 19b7a88655c7e83438685859aa2c110e5f4e4170 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 13 Aug 2026 14:13:08 +0000 Subject: [PATCH 5/9] Please consider the following formatting changes --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 94 ++++++++++++------------ 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index cfc6ba9ebb2..8bfc52a1d3a 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -739,61 +739,61 @@ struct ZdcQVectors { if (hist->InheritsFrom("TProfile2D")) { // needed for energy calibration! auto h = dynamic_cast(hist); - if(h){ - TString name = h->GetName(); - int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%d", cal.runnumber)); - int bin = h->GetYaxis()->FindBin(cal.centrality); - calibConstant = h->GetBinContent(binrunnumber, bin); + if (h) { + TString name = h->GetName(); + int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%d", cal.runnumber)); + int bin = h->GetYaxis()->FindBin(cal.centrality); + calibConstant = h->GetBinContent(binrunnumber, bin); } } else if (hist->InheritsFrom("TProfile")) { auto h = dynamic_cast(hist); - if(h){ - TString name = h->GetName(); - int bin{}; - if (name.Contains("mean_vx")) { - bin = h->GetXaxis()->FindBin(cal.v[0]); - } - if (name.Contains("mean_vy")) { - bin = h->GetXaxis()->FindBin(cal.v[1]); - } - if (name.Contains("mean_vz")) { - bin = h->GetXaxis()->FindBin(cal.v[2]); - } - if (name.Contains("mean_cent")) { - bin = h->GetXaxis()->FindBin(cal.centrality); - } - if (name.Contains("vertex")) { - bin = h->GetXaxis()->FindBin(TString::Format("%i", cal.runnumber)); - } - if (name.Contains("timestamp")) { - bin = h->GetXaxis()->FindBin(cal.timestamp); + if (h) { + TString name = h->GetName(); + int bin{}; + if (name.Contains("mean_vx")) { + bin = h->GetXaxis()->FindBin(cal.v[0]); + } + if (name.Contains("mean_vy")) { + bin = h->GetXaxis()->FindBin(cal.v[1]); + } + if (name.Contains("mean_vz")) { + bin = h->GetXaxis()->FindBin(cal.v[2]); + } + if (name.Contains("mean_cent")) { + bin = h->GetXaxis()->FindBin(cal.centrality); + } + if (name.Contains("vertex")) { + bin = h->GetXaxis()->FindBin(TString::Format("%i", cal.runnumber)); + } + if (name.Contains("timestamp")) { + bin = h->GetXaxis()->FindBin(cal.timestamp); + } + calibConstant = h->GetBinContent(bin); } - calibConstant = h->GetBinContent(bin); - } } else if (hist->InheritsFrom("THnSparse")) { std::vector sparsePars; auto h = dynamic_cast(hist); - if(h){ - sparsePars.push_back(h->GetAxis(0)->FindBin(cal.centrality)); - sparsePars.push_back(h->GetAxis(1)->FindBin(cal.v[0])); - sparsePars.push_back(h->GetAxis(2)->FindBin(cal.v[1])); - sparsePars.push_back(h->GetAxis(3)->FindBin(cal.v[2])); - - for (std::size_t i = 0; i < sparsePars.size(); i++) { - h->GetAxis(i)->SetRange(sparsePars[i], sparsePars[i]); - } + if (h) { + sparsePars.push_back(h->GetAxis(0)->FindBin(cal.centrality)); + sparsePars.push_back(h->GetAxis(1)->FindBin(cal.v[0])); + sparsePars.push_back(h->GetAxis(2)->FindBin(cal.v[1])); + sparsePars.push_back(h->GetAxis(3)->FindBin(cal.v[2])); + + for (std::size_t i = 0; i < sparsePars.size(); i++) { + h->GetAxis(i)->SetRange(sparsePars[i], sparsePars[i]); + } - auto tempProj = h->Projection(4); - calibConstant = tempProj->GetMean(); + auto tempProj = h->Projection(4); + calibConstant = tempProj->GetMean(); - if (tempProj->GetEntries() < cfgMinEntriesSparseBin) { - LOGF(debug, "1 entry in sparse bin! Not used... (increase binsize)"); - calibConstant = 0; - cal.isSelected = false; - } + if (tempProj->GetEntries() < cfgMinEntriesSparseBin) { + LOGF(debug, "1 entry in sparse bin! Not used... (increase binsize)"); + calibConstant = 0; + cal.isSelected = false; + } - delete tempProj; - } + delete tempProj; + } } return calibConstant; @@ -1170,11 +1170,11 @@ struct ZdcQVectors { LOGF(info, "Getting shift profile from CCDB for runnumber: %d", runnumber); TList* hcorrList = ccdb->getForTimeStamp(cfgCCDBdir_Shift.value, foundBC.timestamp()); auto shiftProfileC = dynamic_cast(hcorrList->FindObject("ShiftZDCC")); - if(shiftProfileC) { + if (shiftProfileC) { cal.shiftprofileC = shiftProfileC; } auto shiftProfileA = dynamic_cast(hcorrList->FindObject("ShiftZDCA")); - if(shiftProfileA) { + if (shiftProfileA) { cal.shiftprofileA = shiftProfileA; } if (!cal.shiftprofileC || !cal.shiftprofileA) { From 28e2f4d69b7e4c83855132bfba8d0b706daac0d2 Mon Sep 17 00:00:00 2001 From: cnkoster Date: Thu, 13 Aug 2026 16:52:34 +0200 Subject: [PATCH 6/9] change comment to redo checks --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index 8bfc52a1d3a..10a50f7ab2e 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -352,7 +352,7 @@ struct ZdcQVectors { registry.add("QA/ZNC_pm4_vs_Centrality", "ZNC_pm4_vs_Centrality", kTH2D, {{100, 0, 100}, {100, 0, 1}}); } - // Tower mean energies vs. centrality used for tower gain equalisation + // 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}); } From 305c71ae54cfe80cd72d70434acb92e0e5905206 Mon Sep 17 00:00:00 2001 From: cnkoster Date: Thu, 13 Aug 2026 20:35:38 +0200 Subject: [PATCH 7/9] Fix last 2 errors for code linter --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index 10a50f7ab2e..759447dbe03 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -55,7 +55,7 @@ #include #include -#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, (DEFAULT), (HELP)}; +#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; // NOLINT(bugprone-macro-parentheses) using namespace o2; using namespace o2::framework; @@ -1168,7 +1168,7 @@ struct ZdcQVectors { if (!cfgCCDBdir_Shift.value.empty() && !cal.isShiftProfileFound) { LOGF(info, "Getting shift profile from CCDB for runnumber: %d", runnumber); - TList* hcorrList = ccdb->getForTimeStamp(cfgCCDBdir_Shift.value, foundBC.timestamp()); + auto hcorrList = ccdb->getForTimeStamp(cfgCCDBdir_Shift.value, foundBC.timestamp()); auto shiftProfileC = dynamic_cast(hcorrList->FindObject("ShiftZDCC")); if (shiftProfileC) { cal.shiftprofileC = shiftProfileC; From ef63e6af68b23439e4dbee3b22d07511ae535ea4 Mon Sep 17 00:00:00 2001 From: cnkoster Date: Thu, 13 Aug 2026 20:39:30 +0200 Subject: [PATCH 8/9] Also fix all: (warning) statement should be inside braces --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 36 ++++++++++++++++-------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index 759447dbe03..3d608ab10cf 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -418,8 +418,9 @@ struct ZdcQVectors { registry.fill(HIST("hEventCount"), evSel); // FT0C is the default centrality estimator - if (!cfgFillCutAnalysis || cfgFillNothing) + if (!cfgFillCutAnalysis || cfgFillNothing){ return; + } // Add default with different centrality estimators as well // 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", cal.runnumber), evSel, collision.posX()); @@ -569,8 +570,9 @@ struct ZdcQVectors { float zRes = std::sqrt(collision.covZZ()); float minzRes = 0.25; int maxNumContrib = 20; - if (zRes > minzRes && collision.numContrib() < maxNumContrib) + if (zRes > minzRes && collision.numContrib() < maxNumContrib){ vtxz = -999; + } } auto multNTracksPV = collision.multNTracksPV(); @@ -820,23 +822,27 @@ struct ZdcQVectors { if (cfgFT0Cvariant1) { cents.push_back(collision.centFT0CVariant1()); - if (cfgUseSecondCent) + if (cfgUseSecondCent){ cent = collision.centFT0CVariant1(); + } } if (cfgFT0M) { cents.push_back(collision.centFT0M()); - if (cfgUseSecondCent) + if (cfgUseSecondCent){ cent = collision.centFT0M(); + } } if (cfgFV0A) { cents.push_back(collision.centFV0A()); - if (cfgUseSecondCent) + if (cfgUseSecondCent){ cent = collision.centFV0A(); + } } if (cfgNGlobal) { cents.push_back(collision.centNGlobal()); - if (cfgUseSecondCent) + if (cfgUseSecondCent){ cent = collision.centNGlobal(); + } } std::vector v = {collision.posX(), collision.posY(), collision.posZ()}; @@ -941,8 +947,9 @@ struct ZdcQVectors { } // load the calibration histos for iteration 0 step 0 (Energy Calibration) - if (!cfgNoGain) + if (!cfgNoGain){ loadCalibrations(cfgEnergyCal.value, timestamp); + } // load the calibrations for the mean v loadCalibrations(cfgMeanv.value, timestamp); @@ -1084,8 +1091,9 @@ struct ZdcQVectors { return; } - if (cfgFillHistRegistry && isEventSelected) + if (cfgFillHistRegistry && isEventSelected){ fillCommonRegistry(q[0], q[1], q[2], q[3], cal.v, cent, rsTimestamp); + } // vector of 4 std::vector corrQxA; @@ -1207,14 +1215,18 @@ struct ZdcQVectors { int binshiftxZDCA = cal.shiftprofileA->FindBin(cent, 0.5, ishift - 0.5); int binshiftyZDCA = cal.shiftprofileA->FindBin(cent, 1.5, ishift - 0.5); - if (binshiftxZDCC > 0) + if (binshiftxZDCC > 0){ coeffshiftxZDCC = cal.shiftprofileC->GetBinContent(binshiftxZDCC); - if (binshiftyZDCC > 0) + } + if (binshiftyZDCC > 0){ coeffshiftyZDCC = cal.shiftprofileC->GetBinContent(binshiftyZDCC); - if (binshiftxZDCA > 0) + } + if (binshiftxZDCA > 0){ coeffshiftxZDCA = cal.shiftprofileA->GetBinContent(binshiftxZDCA); - if (binshiftyZDCA > 0) + } + if (binshiftyZDCA > 0){ coeffshiftyZDCA = cal.shiftprofileA->GetBinContent(binshiftyZDCA); + } deltaPsiZDCC += ((2 / (1.0 * ishift)) * (-1.0 * coeffshiftxZDCC * std::cos(ishift * 1.0 * psiZDCC) + coeffshiftyZDCC * std::sin(ishift * 1.0 * psiZDCC))); deltaPsiZDCA += ((2 / (1.0 * ishift)) * (-1.0 * coeffshiftxZDCA * std::cos(ishift * 1.0 * psiZDCA) + coeffshiftyZDCA * std::sin(ishift * 1.0 * psiZDCA))); From 86399142100db16a430ec859b0be7ea24660572d Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 13 Aug 2026 18:40:13 +0000 Subject: [PATCH 9/9] Please consider the following formatting changes --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 28 ++++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index 3d608ab10cf..9c1cce63a0b 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -418,7 +418,7 @@ struct ZdcQVectors { registry.fill(HIST("hEventCount"), evSel); // FT0C is the default centrality estimator - if (!cfgFillCutAnalysis || cfgFillNothing){ + if (!cfgFillCutAnalysis || cfgFillNothing) { return; } // Add default with different centrality estimators as well @@ -570,7 +570,7 @@ struct ZdcQVectors { float zRes = std::sqrt(collision.covZZ()); float minzRes = 0.25; int maxNumContrib = 20; - if (zRes > minzRes && collision.numContrib() < maxNumContrib){ + if (zRes > minzRes && collision.numContrib() < maxNumContrib) { vtxz = -999; } } @@ -822,25 +822,25 @@ struct ZdcQVectors { if (cfgFT0Cvariant1) { cents.push_back(collision.centFT0CVariant1()); - if (cfgUseSecondCent){ + if (cfgUseSecondCent) { cent = collision.centFT0CVariant1(); } } if (cfgFT0M) { cents.push_back(collision.centFT0M()); - if (cfgUseSecondCent){ + if (cfgUseSecondCent) { cent = collision.centFT0M(); } } if (cfgFV0A) { cents.push_back(collision.centFV0A()); - if (cfgUseSecondCent){ + if (cfgUseSecondCent) { cent = collision.centFV0A(); } } if (cfgNGlobal) { cents.push_back(collision.centNGlobal()); - if (cfgUseSecondCent){ + if (cfgUseSecondCent) { cent = collision.centNGlobal(); } } @@ -947,7 +947,7 @@ struct ZdcQVectors { } // load the calibration histos for iteration 0 step 0 (Energy Calibration) - if (!cfgNoGain){ + if (!cfgNoGain) { loadCalibrations(cfgEnergyCal.value, timestamp); } @@ -1091,9 +1091,9 @@ struct ZdcQVectors { return; } - if (cfgFillHistRegistry && isEventSelected){ - fillCommonRegistry(q[0], q[1], q[2], q[3], cal.v, cent, rsTimestamp); - } + if (cfgFillHistRegistry && isEventSelected) { + fillCommonRegistry(q[0], q[1], q[2], q[3], cal.v, cent, rsTimestamp); + } // vector of 4 std::vector corrQxA; @@ -1215,16 +1215,16 @@ struct ZdcQVectors { int binshiftxZDCA = cal.shiftprofileA->FindBin(cent, 0.5, ishift - 0.5); int binshiftyZDCA = cal.shiftprofileA->FindBin(cent, 1.5, ishift - 0.5); - if (binshiftxZDCC > 0){ + if (binshiftxZDCC > 0) { coeffshiftxZDCC = cal.shiftprofileC->GetBinContent(binshiftxZDCC); } - if (binshiftyZDCC > 0){ + if (binshiftyZDCC > 0) { coeffshiftyZDCC = cal.shiftprofileC->GetBinContent(binshiftyZDCC); } - if (binshiftxZDCA > 0){ + if (binshiftxZDCA > 0) { coeffshiftxZDCA = cal.shiftprofileA->GetBinContent(binshiftxZDCA); } - if (binshiftyZDCA > 0){ + if (binshiftyZDCA > 0) { coeffshiftyZDCA = cal.shiftprofileA->GetBinContent(binshiftyZDCA); }