From 4f7dc3ba73779422f32259880e7d397be545f16d Mon Sep 17 00:00:00 2001 From: cnkoster Date: Wed, 22 Jul 2026 16:23:05 +0200 Subject: [PATCH 1/9] New PR fix previous new build errors # Conflicts: # PWGCF/Flow/TableProducer/zdcQVectors.cxx --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 304 +++++++++++------------ 1 file changed, 149 insertions(+), 155 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index c646b410b5e..cad5d671f60 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -41,6 +41,7 @@ #include #include +#include #include #include #include @@ -68,35 +69,24 @@ int counter = 0; // Define histogrm names here to use same names for creating and later uploading and retrieving data from ccdb // Energy calibration: -std::vector namesEcal(10, ""); -std::vector> names(5, std::vector()); //(1x 4d 4x 1d) -std::vector namesTS; // for timestamo recentering -std::vector vnames = {"hvertex_vx", "hvertex_vy"}; +const std::array namesEcal = {{"hZNA_mean_t0_cent", "hZNA_mean_t1_cent", "hZNA_mean_t2_cent", "hZNA_mean_t3_cent", "hZNA_mean_t4_cent", + "hZNC_mean_t0_cent", "hZNC_mean_t1_cent", "hZNC_mean_t2_cent", "hZNC_mean_t3_cent", "hZNC_mean_t4_cent"}}; +const std::array, 5> names = {{ + {{"hQXA_mean_Cent_V_run", "hQYA_mean_Cent_V_run", "hQXC_mean_Cent_V_run", "hQYC_mean_Cent_V_run"}}, + {{"hQXA_mean_cent_run", "hQYA_mean_cent_run", "hQXC_mean_cent_run", "hQYC_mean_cent_run"}}, + {{"hQXA_mean_vx_run", "hQYA_mean_vx_run", "hQXC_mean_vx_run", "hQYC_mean_vx_run"}}, + {{"hQXA_mean_vy_run", "hQYA_mean_vy_run", "hQXC_mean_vy_run", "hQYC_mean_vy_run"}}, + {{"hQXA_mean_vz_run", "hQYA_mean_vz_run", "hQXC_mean_vz_run", "hQYC_mean_vz_run"}} +}}; +const std::array namesTS = {{"hQXA_mean_timestamp_run", "hQYA_mean_timestamp_run", "hQXC_mean_timestamp_run", "hQYC_mean_timestamp_run"}}; // for timestamp recentering +const std::array vnames = {"hvertex_vx", "hvertex_vy"}; // https://alice-notes.web.cern.ch/system/files/notes/analysis/620/017-May-31-analysis_note-ALICE_analysis_note_v2.pdf -std::vector pxZDC = {-1.75, 1.75, -1.75, 1.75}; -std::vector pyZDC = {-1.75, -1.75, 1.75, 1.75}; -double alphaZDC = 0.395; - -// q-vectors before (q) and after (qRec) recentering. -std::vector q(4); // start values of [QxA, QyA, QxC, QyC] -std::vector qNoEq(4); // start values of [QxA, QyA, QxC, QyC] - -// for energy calibration -std::vector eZN(8); // uncalibrated energy for the 2x4 towers (a1, a2, a3, a4, c1, c2, c3, c4) -std::vector meanEZN(10); // mean energies from calibration histos (common A, t1-4 A,common C, t1-4C) -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; -int runnumber = 0; -int lastRunNumber = 0; -std::vector v(3, 0); // vx, vy, vz -bool isSelected = true; -std::vector cents; // centrality estimaters -uint64_t timestamp = 0; -double rsTimestamp = 0; +const std::array pxZDC = {-1.75, 1.75, -1.75, 1.75}; +const std::array pyZDC = {-1.75, -1.75, 1.75, 1.75}; +const double alphaZDC = 0.395; +const int totalTowers = 10; } // namespace o2::analysis::qvectortask using namespace o2::analysis::qvectortask; @@ -129,9 +119,9 @@ struct ZdcQVectors { 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"}; - ConfigurableAxis axisVxBig{"axisVxBig", {3, -0.01, 0.01}, "for Pos X of collision"}; - ConfigurableAxis axisVyBig{"axisVyBig", {3, -0.01, 0.01}, "for Pos Y of collision"}; - ConfigurableAxis axisVzBig{"axisVzBig", {3, -10, 10}, "for Pos Z of collision"}; + ConfigurableAxis axisVxBig{"axisVxBig", {100, -0.01, 0.01}, "for Pos X of collision"}; + ConfigurableAxis axisVyBig{"axisVyBig", {100, -0.01, 0.01}, "for Pos Y of collision"}; + ConfigurableAxis axisVzBig{"axisVzBig", {100, -10, 10}, "for Pos Z of collision"}; ConfigurableAxis axisVx{"axisVx", {100, -0.01, 0.01}, "for Pos X of collision"}; ConfigurableAxis axisVy{"axisVy", {100, -0.01, 0.01}, "for Pos Y of collision"}; ConfigurableAxis axisVz{"axisVz", {100, -10, 10}, "for vz of collision"}; @@ -148,12 +138,18 @@ struct ZdcQVectors { O2_DEFINE_CONFIGURABLE(cfgMagField, float, 99999, "Configurable magnetic field; default CCDB will be queried") O2_DEFINE_CONFIGURABLE(cfgEnergyCal, std::string, "Users/c/ckoster/ZDC/LHC23_PbPb_pass5/Energy", "ccdb path for energy calibration histos") 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(cfgMinEntriesSparseBin, int, 1000, "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(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(cfgNoGain, bool, false, "Do not apply gain correction to ZDC energy calibration"); + O2_DEFINE_CONFIGURABLE(cfgNoGain, bool, true, "Do not apply gain correction to ZDC energy calibration"); + + O2_DEFINE_CONFIGURABLE(cfgTrackSelsDCAxy, float, 0.2, "Cut on DCA in the transverse direction (cm)"); + O2_DEFINE_CONFIGURABLE(cfgTrackSelsDCAz, float, 0.2, "Cut on DCA in the longitudinal direction (cm)"); + O2_DEFINE_CONFIGURABLE(cfgTrackSelsPtmin, float, 0.2, "minimum pt (GeV/c)"); + O2_DEFINE_CONFIGURABLE(cfgTrackSelsPtmax, float, 10, "maximum pt (GeV/c)"); + O2_DEFINE_CONFIGURABLE(cfgTrackSelsEta, float, 0.8, "eta cut"); O2_DEFINE_CONFIGURABLE(cfgCCDBdir_Shift, std::string, "Users/c/ckoster/ZDC/LHC23_PbPb_pass5/Shift", "CCDB directory for Shift ZDC"); @@ -204,6 +200,13 @@ struct ZdcQVectors { TProfile3D* shiftprofileA = nullptr; bool isShiftProfileFound = false; + int lastRunNumber = 0; + int runnumber = 0; + float centrality = 0; + double rsTimestamp = 0; + uint64_t timestamp = 0; + std::vector v = {0, 0, 0}; + bool isSelected = 0; } cal; enum FillType { @@ -248,23 +251,6 @@ struct ZdcQVectors { 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)); - namesTS.push_back(TString::Format("hQ%s%s_mean_timestamp_run", coord, side)); - } // end of capCOORDS - } - if (!cfgFillNothing) { if (cfgFillHistRegistry) { registry.add(Form("QA/before/hSPplaneA"), "hSPplaneA", kTH2D, {axisPsiA, axisCent10}); @@ -401,20 +387,20 @@ struct ZdcQVectors { 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", 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(centrality, evSel, zdcBC.energyCommonZNA(), 1); - registry.get(HIST("CutAnalysis/hZNA_mean_t1_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNA()[0], 1); - registry.get(HIST("CutAnalysis/hZNA_mean_t2_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNA()[1], 1); - registry.get(HIST("CutAnalysis/hZNA_mean_t3_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNA()[2], 1); - registry.get(HIST("CutAnalysis/hZNA_mean_t4_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNA()[3], 1); - registry.get(HIST("CutAnalysis/hZNC_mean_t0_cent"))->Fill(centrality, evSel, zdcBC.energyCommonZNC(), 1); - registry.get(HIST("CutAnalysis/hZNC_mean_t1_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNC()[0], 1); - registry.get(HIST("CutAnalysis/hZNC_mean_t2_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNC()[1], 1); - registry.get(HIST("CutAnalysis/hZNC_mean_t3_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNC()[2], 1); - registry.get(HIST("CutAnalysis/hZNC_mean_t4_cent"))->Fill(centrality, evSel, zdcBC.energySectorZNC()[3], 1); + registry.get(HIST("CutAnalysis/hvertex_vx"))->Fill(Form("%d", cal.runnumber), evSel, collision.posX()); + registry.get(HIST("CutAnalysis/hvertex_vy"))->Fill(Form("%d", cal.runnumber), evSel, collision.posY()); + registry.get(HIST("CutAnalysis/hvertex_vz"))->Fill(Form("%d", cal.runnumber), evSel, collision.posZ()); + + registry.get(HIST("CutAnalysis/hZNA_mean_t0_cent"))->Fill(cal.centrality, evSel, zdcBC.energyCommonZNA(), 1); + registry.get(HIST("CutAnalysis/hZNA_mean_t1_cent"))->Fill(cal.centrality, evSel, zdcBC.energySectorZNA()[0], 1); + registry.get(HIST("CutAnalysis/hZNA_mean_t2_cent"))->Fill(cal.centrality, evSel, zdcBC.energySectorZNA()[1], 1); + registry.get(HIST("CutAnalysis/hZNA_mean_t3_cent"))->Fill(cal.centrality, evSel, zdcBC.energySectorZNA()[2], 1); + registry.get(HIST("CutAnalysis/hZNA_mean_t4_cent"))->Fill(cal.centrality, evSel, zdcBC.energySectorZNA()[3], 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t0_cent"))->Fill(cal.centrality, evSel, zdcBC.energyCommonZNC(), 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t1_cent"))->Fill(cal.centrality, evSel, zdcBC.energySectorZNC()[0], 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t2_cent"))->Fill(cal.centrality, evSel, zdcBC.energySectorZNC()[1], 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t3_cent"))->Fill(cal.centrality, evSel, zdcBC.energySectorZNC()[2], 1); + registry.get(HIST("CutAnalysis/hZNC_mean_t4_cent"))->Fill(cal.centrality, evSel, zdcBC.energySectorZNC()[3], 1); if (evSel == nEventSelections) { int centCounter = 0; @@ -527,7 +513,7 @@ struct ZdcQVectors { } template - inline void fillCommonRegistry(double qxa, double qya, double qxc, double qyc, std::vector v, double centrality, double rsTimestamp) + inline void fillCommonRegistry(double qxa, double qya, double qxc, double qyc, std::vector v, double centrality, double rsTimestamp) { // loop for filling multiple histograms with different naming patterns // Always fill the uncentered "raw" Q-vector histos! @@ -603,7 +589,7 @@ struct ZdcQVectors { } template - void loadCalibrations(std::string ccdb_dir) + void loadCalibrations(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) @@ -633,10 +619,10 @@ struct ZdcQVectors { TList* list = cal.calibList[cm]; hist = reinterpret_cast(list->FindObject(Form("%s", objName))); } else if (cm == kTimestamp) { - TList* list = reinterpret_cast(cal.calibList[cm]->FindObject(Form("it%i_step%i", iteration, step))); + auto list = reinterpret_cast(cal.calibList[cm]->FindObject(Form("it%i_step%i", iteration, step))); hist = reinterpret_cast(list->FindObject(Form("%s", objName))); } else if (cm == kRec) { - TList* list = reinterpret_cast(cal.calibList[cm]->FindObject(Form("it%i_step%i", iteration, step))); + auto list = reinterpret_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); } @@ -653,53 +639,53 @@ struct ZdcQVectors { if (hist->InheritsFrom("TProfile2D")) { // needed for energy calibration! - TProfile2D* h = reinterpret_cast(hist); + auto h = reinterpret_cast(hist); TString name = h->GetName(); - int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%d", runnumber)); - int bin = h->GetYaxis()->FindBin(centrality); + 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")) { - TProfile* h = reinterpret_cast(hist); + auto h = reinterpret_cast(hist); TString name = h->GetName(); int bin{}; if (name.Contains("mean_vx")) { - bin = h->GetXaxis()->FindBin(v[0]); + bin = h->GetXaxis()->FindBin(cal.v[0]); } if (name.Contains("mean_vy")) { - bin = h->GetXaxis()->FindBin(v[1]); + bin = h->GetXaxis()->FindBin(cal.v[1]); } if (name.Contains("mean_vz")) { - bin = h->GetXaxis()->FindBin(v[2]); + bin = h->GetXaxis()->FindBin(cal.v[2]); } if (name.Contains("mean_cent")) { - bin = h->GetXaxis()->FindBin(centrality); + bin = h->GetXaxis()->FindBin(cal.centrality); } if (name.Contains("vertex")) { - bin = h->GetXaxis()->FindBin(TString::Format("%i", runnumber)); + bin = h->GetXaxis()->FindBin(TString::Format("%i", cal.runnumber)); } if (name.Contains("timestamp")) { - bin = h->GetXaxis()->FindBin(rsTimestamp); + bin = h->GetXaxis()->FindBin(cal.timestamp); } calibConstant = h->GetBinContent(bin); } else if (hist->InheritsFrom("THnSparse")) { std::vector sparsePars; - THnSparseD* h = reinterpret_cast(hist); - sparsePars.push_back(h->GetAxis(0)->FindBin(centrality)); - sparsePars.push_back(h->GetAxis(1)->FindBin(v[0])); - sparsePars.push_back(h->GetAxis(2)->FindBin(v[1])); - sparsePars.push_back(h->GetAxis(3)->FindBin(v[2])); + auto h = reinterpret_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])); + 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]); } - TH1D* tempProj = h->Projection(4); + 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; - isSelected = false; + cal.isSelected = false; } delete tempProj; @@ -718,41 +704,43 @@ struct ZdcQVectors { std::vector xEnZN(2, 0.), xEnZN_noEq(2, 0.); std::vector yEnZN(2, 0.), yEnZN_noEq(2, 0.); - isSelected = true; + cal.isSelected = true; - std::vector centralities; + std::vector cents; auto cent = collision.centFT0C(); - centralities.push_back(collision.centFT0C()); + cents.push_back(collision.centFT0C()); if (cfgFT0Cvariant1) { - centralities.push_back(collision.centFT0CVariant1()); + cents.push_back(collision.centFT0CVariant1()); if (cfgUseSecondCent) cent = collision.centFT0CVariant1(); } if (cfgFT0M) { - centralities.push_back(collision.centFT0M()); + cents.push_back(collision.centFT0M()); if (cfgUseSecondCent) cent = collision.centFT0M(); } if (cfgFV0A) { - centralities.push_back(collision.centFV0A()); + cents.push_back(collision.centFV0A()); if (cfgUseSecondCent) cent = collision.centFV0A(); } if (cfgNGlobal) { - centralities.push_back(collision.centNGlobal()); + cents.push_back(collision.centNGlobal()); if (cfgUseSecondCent) cent = collision.centNGlobal(); } - v = {collision.posX(), collision.posY(), collision.posZ()}; - cents = centralities; - centrality = cent; + std::vector v = {collision.posX(), collision.posY(), collision.posZ()}; + cal.v = v; + const auto& foundBC = collision.foundBC_as(); - runnumber = foundBC.runNumber(); + auto runnumber = foundBC.runNumber(); + cal.runnumber = runnumber; + cal.centrality = cent; if (cfgFillHistRegistry && !cfgFillNothing) { registry.fill(HIST("QA/centrality_before"), cent); @@ -760,14 +748,15 @@ struct ZdcQVectors { registry.fill(HIST("hEventCount"), evSel_FilteredEvent); - timestamp = foundBC.timestamp(); - rsTimestamp = rescaleTimestamp(timestamp, runnumber); + uint64_t timestamp = foundBC.timestamp(); + auto rsTimestamp = rescaleTimestamp(timestamp, runnumber); + cal.timestamp = timestamp; + cal.rsTimestamp = rsTimestamp; if (!foundBC.has_zdc()) { - isSelected = false; - spTableZDC(runnumber, cents, v, foundBC.timestamp(), 0, 0, 0, 0, isSelected, 0); - counter++; - lastRunNumber = runnumber; + cal.isSelected = false; + spTableZDC(runnumber, cents, v, foundBC.timestamp(), 0, 0, 0, 0, cal.isSelected, 0); + cal.lastRunNumber = runnumber; return; } registry.fill(HIST("hEventCount"), evSel_BCHasZDC); @@ -778,6 +767,12 @@ struct ZdcQVectors { int nTowers = 8; 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)) + + for (int tower = 0; tower < nTowers; tower++) { eZN[tower] = (tower < nTowersPerSide) ? zdcCol.energySectorZNA()[tower] : zdcCol.energySectorZNC()[tower % nTowersPerSide]; } @@ -799,10 +794,9 @@ struct ZdcQVectors { // 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; + cal.isSelected = false; + spTableZDC(runnumber, cents, v, foundBC.timestamp(), 0, 0, 0, 0, cal.isSelected, 0); + cal.lastRunNumber = runnumber; return; } registry.fill(HIST("hEventCount"), evSel_isSelectedZDC); @@ -812,16 +806,15 @@ struct ZdcQVectors { // 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, cents, v, foundBC.timestamp(), 0, 0, 0, 0, isSelected, eventSelectionFlags); - counter++; - lastRunNumber = runnumber; + cal.isSelected = false; + spTableZDC(runnumber, cents, v, foundBC.timestamp(), 0, 0, 0, 0, cal.isSelected, eventSelectionFlags); + cal.lastRunNumber = runnumber; return; } registry.fill(HIST("hEventCount"), evSel_CentCuts); // load new calibrations for new runs only - if (runnumber != lastRunNumber) { + if (runnumber != cal.lastRunNumber) { cal.calibfilesLoaded[0] = false; cal.calibList[0] = nullptr; @@ -841,9 +834,10 @@ struct ZdcQVectors { // load the calibration histos for iteration 0 step 0 (Energy Calibration) if (!cfgNoGain) - loadCalibrations(cfgEnergyCal.value); + loadCalibrations(cfgEnergyCal.value, timestamp); + // load the calibrations for the mean v - loadCalibrations(cfgMeanv.value); + loadCalibrations(cfgMeanv.value, timestamp); if (!cfgFillNothing) { registry.get(HIST("vmean/hvertex_vx"))->Fill(Form("%d", runnumber), v[0]); @@ -913,21 +907,21 @@ struct ZdcQVectors { double sumZNA = e[0] + e[1] + e[2] + e[3]; double sumZNC = e[4] + e[5] + e[6] + e[7]; - registry.fill(HIST("QA/ZNA_pmC_vs_Centrality"), centrality, zdcCol.energyCommonZNA()); - registry.fill(HIST("QA/ZNA_pmSUM_vs_Centrality"), centrality, sumZNA); + registry.fill(HIST("QA/ZNA_pmC_vs_Centrality"), cent, zdcCol.energyCommonZNA()); + registry.fill(HIST("QA/ZNA_pmSUM_vs_Centrality"), cent, sumZNA); - registry.fill(HIST("QA/ZNC_pmC_vs_Centrality"), centrality, zdcCol.energyCommonZNC()); - registry.fill(HIST("QA/ZNC_pmSUM_vs_Centrality"), centrality, sumZNC); + registry.fill(HIST("QA/ZNC_pmC_vs_Centrality"), cent, zdcCol.energyCommonZNC()); + registry.fill(HIST("QA/ZNC_pmSUM_vs_Centrality"), cent, sumZNC); - registry.fill(HIST("QA/ZNA_pm1_vs_Centrality"), centrality, e[0] / sumZNA); - registry.fill(HIST("QA/ZNA_pm2_vs_Centrality"), centrality, e[1] / sumZNA); - registry.fill(HIST("QA/ZNA_pm3_vs_Centrality"), centrality, e[2] / sumZNA); - registry.fill(HIST("QA/ZNA_pm4_vs_Centrality"), centrality, e[3] / sumZNA); + registry.fill(HIST("QA/ZNA_pm1_vs_Centrality"), cent, e[0] / sumZNA); + registry.fill(HIST("QA/ZNA_pm2_vs_Centrality"), cent, e[1] / sumZNA); + registry.fill(HIST("QA/ZNA_pm3_vs_Centrality"), cent, e[2] / sumZNA); + registry.fill(HIST("QA/ZNA_pm4_vs_Centrality"), cent, e[3] / sumZNA); - registry.fill(HIST("QA/ZNC_pm1_vs_Centrality"), centrality, e[4] / sumZNC); - registry.fill(HIST("QA/ZNC_pm2_vs_Centrality"), centrality, e[5] / sumZNC); - registry.fill(HIST("QA/ZNC_pm3_vs_Centrality"), centrality, e[6] / sumZNC); - registry.fill(HIST("QA/ZNC_pm4_vs_Centrality"), centrality, e[7] / sumZNC); + registry.fill(HIST("QA/ZNC_pm1_vs_Centrality"), cent, e[4] / sumZNC); + registry.fill(HIST("QA/ZNC_pm2_vs_Centrality"), cent, e[5] / sumZNC); + registry.fill(HIST("QA/ZNC_pm3_vs_Centrality"), cent, e[6] / sumZNC); + registry.fill(HIST("QA/ZNC_pm4_vs_Centrality"), cent, e[7] / sumZNC); } } @@ -942,6 +936,8 @@ struct ZdcQVectors { } // "QXA", "QYA", "QXC", "QYC" + std::array q = {0, 0, 0, 0}; + int sides = 2; for (int i = 0; i < sides; ++i) { if (sumZN[i] > 0) { @@ -965,25 +961,24 @@ struct ZdcQVectors { return; } - loadCalibrations(cfgRec.value); + loadCalibrations(cfgRec.value, timestamp); if (extraTS.cfgRecenterForTimestamp) { - loadCalibrations(extraTS.cfgCCDBdir_Timestamp.value); + loadCalibrations(extraTS.cfgCCDBdir_Timestamp.value, timestamp); } - std::vector qRec(q); + std::array qRec(q); if (cal.atIteration == 0) { - if (isSelected && cfgFillHistRegistry) - fillCommonRegistry(q[0], q[1], q[2], q[3], v, centrality, rsTimestamp); + if (cal.isSelected && cfgFillHistRegistry && isEventSelected) + fillCommonRegistry(q[0], q[1], q[2], q[3], v, cent, rsTimestamp); - spTableZDC(runnumber, cents, v, foundBC.timestamp(), q[0], q[1], q[2], q[3], isSelected, eventSelectionFlags); - counter++; - lastRunNumber = runnumber; + spTableZDC(runnumber, cents, v, foundBC.timestamp(), q[0], q[1], q[2], q[3], cal.isSelected, eventSelectionFlags); + cal.lastRunNumber = runnumber; return; } else { - if (cfgFillHistRegistry) - fillCommonRegistry(q[0], q[1], q[2], q[3], v, centrality, rsTimestamp); + if (cfgFillHistRegistry && isEventSelected) + fillCommonRegistry(q[0], q[1], q[2], q[3], v, cent, rsTimestamp); // vector of 4 std::vector corrQxA; @@ -1079,11 +1074,11 @@ struct ZdcQVectors { } for (int ishift = 1; ishift <= nshift; ishift++) { - 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)); + if (!cfgFillNothing && isEventSelected) { + registry.fill(HIST("shift/ShiftZDCC"), cent, 0.5, ishift - 0.5, std::sin(ishift * 1.0 * psiZDCC)); + registry.fill(HIST("shift/ShiftZDCC"), cent, 1.5, ishift - 0.5, std::cos(ishift * 1.0 * psiZDCC)); + registry.fill(HIST("shift/ShiftZDCA"), cent, 0.5, ishift - 0.5, std::sin(ishift * 1.0 * psiZDCA)); + registry.fill(HIST("shift/ShiftZDCA"), cent, 1.5, ishift - 0.5, std::cos(ishift * 1.0 * psiZDCA)); } } @@ -1094,10 +1089,10 @@ struct ZdcQVectors { if (cal.isShiftProfileFound) { for (int ishift = 1; ishift <= nshift; ishift++) { - int binshiftxZDCC = cal.shiftprofileC->FindBin(centrality, 0.5, ishift - 0.5); // bin 0.5 - int binshiftyZDCC = cal.shiftprofileC->FindBin(centrality, 1.5, ishift - 0.5); - int binshiftxZDCA = cal.shiftprofileA->FindBin(centrality, 0.5, ishift - 0.5); - int binshiftyZDCA = cal.shiftprofileA->FindBin(centrality, 1.5, ishift - 0.5); + int binshiftxZDCC = cal.shiftprofileC->FindBin(cent, 0.5, ishift - 0.5); // bin 0.5 + int binshiftyZDCC = cal.shiftprofileC->FindBin(cent, 1.5, ishift - 0.5); + 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) coeffshiftxZDCC = cal.shiftprofileC->GetBinContent(binshiftxZDCC); @@ -1120,12 +1115,12 @@ struct ZdcQVectors { psiZDCCshift = std::atan2(std::sin(psiZDCCshift), std::cos(psiZDCCshift)); psiZDCAshift = std::atan2(std::sin(psiZDCAshift), std::cos(psiZDCAshift)); - if (cfgFillHistRegistry && !cfgFillNothing) { - registry.fill(HIST("QA/shift/psiZDCA"), psiZDCA, centrality); - registry.fill(HIST("QA/shift/psiZDCC"), psiZDCC, centrality); + if (cfgFillHistRegistry && !cfgFillNothing && isEventSelected) { + registry.fill(HIST("QA/shift/psiZDCA"), psiZDCA, cent); + registry.fill(HIST("QA/shift/psiZDCC"), psiZDCC, cent); registry.fill(HIST("QA/shift/psiZDCAC"), psiZDCA, psiZDCC); - registry.fill(HIST("QA/shift/psiZDCA_shift"), psiZDCAshift, centrality); - registry.fill(HIST("QA/shift/psiZDCC_shift"), psiZDCCshift, centrality); + registry.fill(HIST("QA/shift/psiZDCA_shift"), psiZDCAshift, cent); + registry.fill(HIST("QA/shift/psiZDCC_shift"), psiZDCCshift, cent); registry.fill(HIST("QA/shift/psiZDCAC_shift"), psiZDCAshift, psiZDCCshift); registry.fill(HIST("QA/shift/DeltaPsiZDCA"), psiZDCAshift, psiZDCA); registry.fill(HIST("QA/shift/DeltaPsiZDCC"), psiZDCCshift, psiZDCC); @@ -1137,24 +1132,23 @@ struct ZdcQVectors { double qXcShift = std::hypot(qRec[2], qRec[3]) * std::cos(psiZDCCshift); double qYcShift = std::hypot(qRec[2], qRec[3]) * std::sin(psiZDCCshift); - if (isSelected && cfgFillHistRegistry && !cfgFillNothing) { - fillCommonRegistry(qXaShift, qYaShift, qXcShift, qYcShift, v, centrality, rsTimestamp); - registry.fill(HIST("QA/centrality_after"), centrality); + if (cal.isSelected && cfgFillHistRegistry && !cfgFillNothing && isEventSelected) { + fillCommonRegistry(qXaShift, qYaShift, qXcShift, qYcShift, 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); registry.get(HIST("QA/after/ZNC_Qx"))->Fill(Form("%d", runnumber), qXcShift); registry.get(HIST("QA/after/ZNC_Qy"))->Fill(Form("%d", runnumber), qYcShift); } - spTableZDC(runnumber, cents, v, foundBC.timestamp(), qXaShift, qYaShift, qXcShift, qYcShift, isSelected, eventSelectionFlags); - qRec.clear(); + spTableZDC(runnumber, cents, v, foundBC.timestamp(), qXaShift, qYaShift, qXcShift, qYcShift, cal.isSelected, eventSelectionFlags); + qRec = {0,0,0,0}; - counter++; - lastRunNumber = runnumber; + cal.lastRunNumber = runnumber; return; } LOGF(warning, "We return without saving table... -> THis is a problem"); - lastRunNumber = runnumber; + cal.lastRunNumber = runnumber; } // end of process }; From 91ed68873deadd4321c68f4392f79973b9833192 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 22 Jul 2026 14:29:10 +0000 Subject: [PATCH 2/9] Please consider the following formatting changes --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 34 +++++++++++------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index cad5d671f60..22964780194 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -71,13 +71,11 @@ int counter = 0; // 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", "hZNC_mean_t0_cent", "hZNC_mean_t1_cent", "hZNC_mean_t2_cent", "hZNC_mean_t3_cent", "hZNC_mean_t4_cent"}}; -const std::array, 5> names = {{ - {{"hQXA_mean_Cent_V_run", "hQYA_mean_Cent_V_run", "hQXC_mean_Cent_V_run", "hQYC_mean_Cent_V_run"}}, - {{"hQXA_mean_cent_run", "hQYA_mean_cent_run", "hQXC_mean_cent_run", "hQYC_mean_cent_run"}}, - {{"hQXA_mean_vx_run", "hQYA_mean_vx_run", "hQXC_mean_vx_run", "hQYC_mean_vx_run"}}, - {{"hQXA_mean_vy_run", "hQYA_mean_vy_run", "hQXC_mean_vy_run", "hQYC_mean_vy_run"}}, - {{"hQXA_mean_vz_run", "hQYA_mean_vz_run", "hQXC_mean_vz_run", "hQYC_mean_vz_run"}} -}}; +const std::array, 5> names = {{{{"hQXA_mean_Cent_V_run", "hQYA_mean_Cent_V_run", "hQXC_mean_Cent_V_run", "hQYC_mean_Cent_V_run"}}, + {{"hQXA_mean_cent_run", "hQYA_mean_cent_run", "hQXC_mean_cent_run", "hQYC_mean_cent_run"}}, + {{"hQXA_mean_vx_run", "hQYA_mean_vx_run", "hQXC_mean_vx_run", "hQYC_mean_vx_run"}}, + {{"hQXA_mean_vy_run", "hQYA_mean_vy_run", "hQXC_mean_vy_run", "hQYC_mean_vy_run"}}, + {{"hQXA_mean_vz_run", "hQYA_mean_vz_run", "hQXC_mean_vz_run", "hQYC_mean_vz_run"}}}}; const std::array namesTS = {{"hQXA_mean_timestamp_run", "hQYA_mean_timestamp_run", "hQXC_mean_timestamp_run", "hQYC_mean_timestamp_run"}}; // for timestamp recentering const std::array vnames = {"hvertex_vx", "hvertex_vy"}; @@ -200,13 +198,13 @@ struct ZdcQVectors { TProfile3D* shiftprofileA = nullptr; bool isShiftProfileFound = false; - int lastRunNumber = 0; - int runnumber = 0; + int lastRunNumber = 0; + int runnumber = 0; float centrality = 0; double rsTimestamp = 0; - uint64_t timestamp = 0; + uint64_t timestamp = 0; std::vector v = {0, 0, 0}; - bool isSelected = 0; + bool isSelected = 0; } cal; enum FillType { @@ -513,7 +511,7 @@ struct ZdcQVectors { } template - inline void fillCommonRegistry(double qxa, double qya, double qxc, double qyc, std::vector v, double centrality, double rsTimestamp) + inline void fillCommonRegistry(double qxa, double qya, double qxc, double qyc, std::vector v, double centrality, double rsTimestamp) { // loop for filling multiple histograms with different naming patterns // Always fill the uncentered "raw" Q-vector histos! @@ -736,11 +734,10 @@ struct ZdcQVectors { std::vector v = {collision.posX(), collision.posY(), collision.posZ()}; cal.v = v; - const auto& foundBC = collision.foundBC_as(); auto runnumber = foundBC.runNumber(); cal.runnumber = runnumber; - cal.centrality = cent; + cal.centrality = cent; if (cfgFillHistRegistry && !cfgFillNothing) { registry.fill(HIST("QA/centrality_before"), cent); @@ -767,11 +764,10 @@ struct ZdcQVectors { int nTowers = 8; int nTowersPerSide = 4; - // for energy calibration + // 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 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]; @@ -967,7 +963,7 @@ struct ZdcQVectors { loadCalibrations(extraTS.cfgCCDBdir_Timestamp.value, timestamp); } - std::array qRec(q); + std::array qRec(q); if (cal.atIteration == 0) { if (cal.isSelected && cfgFillHistRegistry && isEventSelected) @@ -1142,7 +1138,7 @@ struct ZdcQVectors { } spTableZDC(runnumber, cents, v, foundBC.timestamp(), qXaShift, qYaShift, qXcShift, qYcShift, cal.isSelected, eventSelectionFlags); - qRec = {0,0,0,0}; + qRec = {0, 0, 0, 0}; cal.lastRunNumber = runnumber; return; From ddc53640607f2f934806c52832e3dfb28feab619 Mon Sep 17 00:00:00 2001 From: cnkoster Date: Wed, 22 Jul 2026 16:42:36 +0200 Subject: [PATCH 3/9] fix linter errors --- PWGCF/Flow/Tasks/flowSP.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGCF/Flow/Tasks/flowSP.cxx b/PWGCF/Flow/Tasks/flowSP.cxx index 3f11c04a52e..1d65e1a52af 100644 --- a/PWGCF/Flow/Tasks/flowSP.cxx +++ b/PWGCF/Flow/Tasks/flowSP.cxx @@ -101,7 +101,6 @@ struct FlowSP { O2_DEFINE_CONFIGURABLE(cFillQABefore, bool, false, "Fill QA histograms before cuts, only for processData"); O2_DEFINE_CONFIGURABLE(cFillMeanPT, bool, false, "Fill histograms for mean PX/PT"); O2_DEFINE_CONFIGURABLE(cFillMeanPTextra, bool, false, "Fill histograms for mean PX/PT extra"); - O2_DEFINE_CONFIGURABLE(cUseCentAveragePt, bool, false, "Use in 1% centrality intervals and not cent average"); O2_DEFINE_CONFIGURABLE(cFillWithMCParticle, bool, false, "Fill histograms with MCParticle instead of Track"); // Flags to make and fill histograms O2_DEFINE_CONFIGURABLE(cFillGeneralV1Histos, bool, true, "Fill histograms for vn analysis"); From 4419b30537305a9bb8f27db6665ee444545edcdf Mon Sep 17 00:00:00 2001 From: cnkoster Date: Wed, 22 Jul 2026 16:54:07 +0200 Subject: [PATCH 4/9] fix linter issues --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 30 +++++++++++------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index 22964780194..c6616796e00 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -368,8 +368,8 @@ struct ZdcQVectors { double rescaleTimestamp(uint64_t timestamp, int runnumber) { - auto& ccdb = o2::ccdb::BasicCCDBManager::instance(); - auto duration = ccdb.getRunDuration(runnumber); + auto& cc = o2::ccdb::BasicCCDBManager::instance(); + auto duration = cc.getRunDuration(runnumber); double ts = (static_cast(timestamp - duration.first) / static_cast(duration.second - duration.first)) * 100.0; return ts; @@ -841,20 +841,18 @@ struct ZdcQVectors { 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.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); + + 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); } // Now start gain equalisation! From 7c99a1b6d8df0701f1422149cb904d950168dcc2 Mon Sep 17 00:00:00 2001 From: cnkoster Date: Wed, 22 Jul 2026 17:28:38 +0200 Subject: [PATCH 5/9] fix linter issues --- PWGCF/Flow/Tasks/flowSP.cxx | 40 +++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/PWGCF/Flow/Tasks/flowSP.cxx b/PWGCF/Flow/Tasks/flowSP.cxx index 1d65e1a52af..bdfe749d603 100644 --- a/PWGCF/Flow/Tasks/flowSP.cxx +++ b/PWGCF/Flow/Tasks/flowSP.cxx @@ -101,6 +101,7 @@ struct FlowSP { O2_DEFINE_CONFIGURABLE(cFillQABefore, bool, false, "Fill QA histograms before cuts, only for processData"); O2_DEFINE_CONFIGURABLE(cFillMeanPT, bool, false, "Fill histograms for mean PX/PT"); O2_DEFINE_CONFIGURABLE(cFillMeanPTextra, bool, false, "Fill histograms for mean PX/PT extra"); + O2_DEFINE_CONFIGURABLE(cUseCentAveragePt, bool, false, "Use in 1% centrality intervals and not cent average"); O2_DEFINE_CONFIGURABLE(cFillWithMCParticle, bool, false, "Fill histograms with MCParticle instead of Track"); // Flags to make and fill histograms O2_DEFINE_CONFIGURABLE(cFillGeneralV1Histos, bool, true, "Fill histograms for vn analysis"); @@ -1141,23 +1142,21 @@ struct FlowSP { if (!cfg.cFillEventQA) return; - static constexpr std::string_view Time[] = {"before", "after"}; - - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/hCentFT0C"), collision.centFT0C(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/hCentNGlobal"), collision.centNGlobal(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/hCentFT0M"), collision.centFT0M(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/hCentFV0A"), collision.centFV0A(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/globalTracks_centT0C"), collision.centFT0C(), tracks.size(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/PVTracks_centT0C"), collision.centFT0C(), collision.multNTracksPV(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/globalTracks_PVTracks"), collision.multNTracksPV(), tracks.size(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/globalTracks_multT0A"), collision.multFT0A(), tracks.size(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/globalTracks_multV0A"), collision.multFV0A(), tracks.size(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/multV0A_multT0A"), collision.multFT0A(), collision.multFV0A(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/multT0C_centT0C"), collision.centFT0C(), collision.multFT0C(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/CentFT0C_vs_CentFT0Cvariant1"), collision.centFT0C(), collision.centFT0CVariant1(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/CentFT0C_vs_CentFT0M"), collision.centFT0C(), collision.centFT0M(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/CentFT0C_vs_CentFV0A"), collision.centFT0C(), collision.centFV0A(), spm.centWeight); - histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("/CentFT0C_vs_CentNGlobal"), collision.centFT0C(), collision.centNGlobal(), spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("hCentFT0C"), collision.centFT0C(), spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("hCentNGlobal"), collision.centNGlobal(), spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("hCentFT0M"), collision.centFT0M(), spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("hCentFV0A"), collision.centFV0A(), spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("globalTracks_centT0C"), collision.centFT0C(), tracks.size(), spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("PVTracks_centT0C"), collision.centFT0C(), collision.multNTracksPV(), spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("globalTracks_PVTracks"), collision.multNTracksPV(), tracks.size(), spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("globalTracks_multT0A"), collision.multFT0A(), tracks.size(), spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("globalTracks_multV0A"), collision.multFV0A(), tracks.size(), spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("multV0A_multT0A"), collision.multFT0A(), collision.multFV0A(), spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("multT0C_centT0C"), collision.centFT0C(), collision.multFT0C(), spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("CentFT0C_vs_CentFT0Cvariant1"), collision.centFT0C(), collision.centFT0CVariant1(), spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("CentFT0C_vs_CentFT0M"), collision.centFT0C(), collision.centFT0M(), spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("CentFT0C_vs_CentFV0A"), collision.centFT0C(), collision.centFV0A(), spm.centWeight); + histos.fill(HIST("QA/") + HIST(Time[ft]) + HIST("CentFT0C_vs_CentNGlobal"), collision.centFT0C(), collision.centNGlobal(), spm.centWeight); if (cfg.cFillEventPlaneQA) { if constexpr (o2::framework::has_type_v) { @@ -1259,7 +1258,6 @@ struct FlowSP { double weight = spm.wacc[ct][par] * spm.weff[ct][par] * spm.centWeight; - static constexpr std::string_view Time[] = {"before/", "after/"}; // NOTE: species[kUnidentified] = "" (when nocfg.cTrackSelDo) { if (cfg.cTrackSelDoTrackQAvsCent) { histos.fill(HIST(Charge[ct]) + HIST(Species[par]) + HIST("QA/") + HIST(Time[ft]) + HIST("hPt_Eta"), track.pt(), track.eta(), spm.centrality, weight); @@ -1301,7 +1299,6 @@ struct FlowSP { template inline void fillMCPtHistos(TrackObject track, int pdgCode) { - static constexpr std::string_view Time[] = {"before/", "after/"}; static constexpr std::string_view Mode[] = {"Gen/", "Reco/"}; registry.fill(HIST("trackMC") + HIST(Mode[md]) + HIST(Time[ft]) + HIST("incl/hPt_hadron"), track.pt(), track.eta(), spm.centrality); @@ -1338,12 +1335,11 @@ struct FlowSP { template inline void fillPrimaryHistos(McParticleObject mcparticle) { - static constexpr std::string_view Time[] = {"/before", "/after"}; if (!mcparticle.isPhysicalPrimary()) { - registry.fill(HIST("trackMCReco") + HIST(Time[ft]) + HIST("/") + HIST(Charge[ct]) + HIST("hIsPhysicalPrimary"), 0, spm.centrality, mcparticle.pt()); + registry.fill(HIST("trackMCReco/") + HIST(Time[ft]) + HIST(Charge[ct]) + HIST("hIsPhysicalPrimary"), 0, spm.centrality, mcparticle.pt()); } else { - registry.fill(HIST("trackMCReco") + HIST(Time[ft]) + HIST("/") + HIST(Charge[ct]) + HIST("hIsPhysicalPrimary"), 1, spm.centrality, mcparticle.pt()); + registry.fill(HIST("trackMCReco/") + HIST(Time[ft]) + HIST(Charge[ct]) + HIST("hIsPhysicalPrimary"), 1, spm.centrality, mcparticle.pt()); } } From c12cb3089448b406adde0f3a184f45b7e3f86bf9 Mon Sep 17 00:00:00 2001 From: cnkoster Date: Wed, 22 Jul 2026 17:29:00 +0200 Subject: [PATCH 6/9] Add changes to plot with evsels --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 125 ++++++++++++++++++++--- 1 file changed, 112 insertions(+), 13 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index c6616796e00..b453cd45c77 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -150,11 +150,20 @@ struct ZdcQVectors { O2_DEFINE_CONFIGURABLE(cfgTrackSelsEta, float, 0.8, "eta cut"); O2_DEFINE_CONFIGURABLE(cfgCCDBdir_Shift, std::string, "Users/c/ckoster/ZDC/LHC23_PbPb_pass5/Shift", "CCDB directory for Shift ZDC"); + Configurable> cfgSelVec{"cfgSelVec", std::vector{1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1}, "Put 1 for every event selection from SelectionCriteria that is used in flowSP"}; + Configurable> cfgEvSelsMultPv{"cfgEvSelsMultPv", std::vector{2223.49, -75.1444, 0.963572, -0.00570399, 1.34877e-05, 3790.99, -137.064, 2.13044, -0.017122, 5.82834e-05}, "Multiplicity cuts (PV) first 5 parameters cutLOW last 5 cutHIGH (Default is +-2sigma pass5) "}; + Configurable> cfgEvSelsMult{"cfgEvSelsMult", std::vector{1301.56, -41.4615, 0.478224, -0.00239449, 4.46966e-06, 2967.6, -102.927, 1.47488, -0.0106534, 3.28622e-05}, "Multiplicity cuts (Global) first 5 parameters cutLOW last 5 cutHIGH (Default is +-2sigma pass5) "}; + // define my..... // Filter collisionFilter = nabs(aod::collision::posZ) <; - using UsedCollisions = soa::Join; + + using UsedCollisions = soa::Join; using BCsRun3 = soa::Join; + Filter trackFilter = nabs(aod::track::eta) < cfgTrackSelsEta && aod::track::pt > cfgTrackSelsPtmin&& aod::track::pt < cfgTrackSelsPtmax && ((requireGlobalTrackInFilter()) || (aod::track::isGlobalTrackSDD == (uint8_t)true)) && nabs(aod::track::dcaXY) < cfgTrackSelsDCAxy&& nabs(aod::track::dcaZ) < cfgTrackSelsDCAz; + using UnfilteredTracks = soa::Join; + using UsedTracks = soa::Filtered; + enum SelectionCriteria { evSel_FilteredEvent, @@ -172,6 +181,7 @@ struct ZdcQVectors { evSel_kIsGoodITSLayer0123, evSel_RCTFlagsZDC, evSel_CentCuts, + evSel_MultCut, nEventSelections }; @@ -185,6 +195,15 @@ struct ZdcQVectors { // Define output HistogramRegistry registry{"Registry"}; + // Event selection cuts + std::unique_ptr fPhiCutLow = nullptr; + std::unique_ptr fPhiCutHigh = nullptr; + std::unique_ptr fMultPVCutLow = nullptr; + std::unique_ptr fMultPVCutHigh = nullptr; + std::unique_ptr fMultCutLow = nullptr; + std::unique_ptr fMultCutHigh = nullptr; + std::unique_ptr fMultMultPVCut = nullptr; + Service ccdb; // keep track of calibration histos for each given step and iteration @@ -247,6 +266,7 @@ struct ZdcQVectors { registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_CentCuts + 1, "Cenrality range"); 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_MultCut + 1, "Mult & MultPV"); registry.get(HIST("hEventCount"))->GetXaxis()->SetBinLabel(evSel_isSelectedZDC + 1, "isSelected"); if (!cfgFillNothing) { @@ -364,6 +384,28 @@ struct ZdcQVectors { registry.addClone("recentering/before/", "recentering/after/"); registry.addClone("QA/before/", "QA/after/"); } + + fMultPVCutLow = std::make_unique("fMultPVCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100); + fMultPVCutHigh = std::make_unique("fMultPVCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100); + fMultCutLow = std::make_unique("fMultCutLow", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100); + fMultCutHigh = std::make_unique("fMultCutHigh", "[0]+[1]*x+[2]*x*x+[3]*x*x*x+[4]*x*x*x*x", 0, 100); + + std::vector paramsMultPVCut = cfgEvSelsMultPv; + std::vector paramsMultCut = cfgEvSelsMult; + + uint64_t nParams = 10; + + if (paramsMultPVCut.size() < nParams) { + LOGF(fatal, "cfg.cEvSelsMultPv not set properly.. size = %d (should be 10) --> Check your config files!", paramsMultPVCut.size()); + } else if (paramsMultCut.size() < nParams) { + LOGF(fatal, "cfg.cEvSelsMult not set properly.. size = %d (should be 10) --> Check your config files!", paramsMultCut.size()); + } else { + fMultPVCutLow->SetParameters(paramsMultPVCut[0], paramsMultPVCut[1], paramsMultPVCut[2], paramsMultPVCut[3], paramsMultPVCut[4]); + fMultPVCutHigh->SetParameters(paramsMultPVCut[5], paramsMultPVCut[6], paramsMultPVCut[7], paramsMultPVCut[8], paramsMultPVCut[9]); + fMultCutLow->SetParameters(paramsMultCut[0], paramsMultCut[1], paramsMultCut[2], paramsMultCut[3], paramsMultCut[4]); + fMultCutHigh->SetParameters(paramsMultCut[5], paramsMultCut[6], paramsMultCut[7], paramsMultCut[8], paramsMultCut[9]); + } + } double rescaleTimestamp(uint64_t timestamp, int runnumber) @@ -426,8 +468,8 @@ struct ZdcQVectors { } } - template - uint16_t eventSelected(TCollision collision, TBunchCrossing bunchCrossing) + template + uint16_t eventSelected(TCollision collision, TBunchCrossing bunchCrossing, bool& isEventSelected, const int& multTrk) { uint16_t selectionBits = 0; bool selected; @@ -441,12 +483,16 @@ struct ZdcQVectors { if (selected) { selectionBits |= static_cast(0x1u << evSel_Zvtx); fillCutAnalysis(collision, bunchCrossing, evSel_Zvtx); + } else if (cfgSelVec.value[evSel_Zvtx]) { + isEventSelected = false; } selected = collision.sel8(); if (selected) { selectionBits |= static_cast(0x1u << evSel_sel8); fillCutAnalysis(collision, bunchCrossing, evSel_sel8); + } else if (cfgSelVec.value[evSel_sel8]) { + isEventSelected = false; } auto occupancy = collision.trackOccupancyInTimeRange(); @@ -454,59 +500,107 @@ struct ZdcQVectors { if (selected) { selectionBits |= static_cast(0x1u << evSel_occupancy); fillCutAnalysis(collision, bunchCrossing, evSel_occupancy); + } else if (cfgSelVec.value[evSel_occupancy]) { + isEventSelected = false; } selected = collision.selection_bit(o2::aod::evsel::kNoSameBunchPileup); if (selected) { selectionBits |= static_cast(0x1u << evSel_kNoSameBunchPileup); fillCutAnalysis(collision, bunchCrossing, evSel_kNoSameBunchPileup); + } else if (cfgSelVec.value[evSel_kNoSameBunchPileup]) { + isEventSelected = false; } selected = collision.selection_bit(o2::aod::evsel::kIsGoodZvtxFT0vsPV); if (selected) { selectionBits |= static_cast(0x1u << evSel_kIsGoodZvtxFT0vsPV); fillCutAnalysis(collision, bunchCrossing, evSel_kIsGoodZvtxFT0vsPV); + } else if (cfgSelVec.value[evSel_kIsGoodZvtxFT0vsPV]) { + isEventSelected = false; } selected = collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeStandard); if (selected) { selectionBits |= static_cast(0x1u << evSel_kNoCollInTimeRangeStandard); fillCutAnalysis(collision, bunchCrossing, evSel_kNoCollInTimeRangeStandard); + } else if (cfgSelVec.value[evSel_kNoCollInTimeRangeStandard]) { + isEventSelected = false; } selected = collision.selection_bit(o2::aod::evsel::kNoCollInTimeRangeNarrow); if (selected) { selectionBits |= static_cast(0x1u << evSel_kNoCollInTimeRangeNarrow); fillCutAnalysis(collision, bunchCrossing, evSel_kNoCollInTimeRangeNarrow); + } else if (cfgSelVec.value[evSel_kNoCollInTimeRangeNarrow]) { + isEventSelected = false; } selected = collision.selection_bit(o2::aod::evsel::kIsVertexITSTPC); if (selected) { selectionBits |= static_cast(0x1u << evSel_kIsVertexITSTPC); fillCutAnalysis(collision, bunchCrossing, evSel_kIsVertexITSTPC); + } else if (cfgSelVec.value[evSel_kIsVertexITSTPC]) { + isEventSelected = false; } selected = collision.selection_bit(o2::aod::evsel::kIsGoodITSLayersAll); if (selected) { selectionBits |= static_cast(0x1u << evSel_kIsGoodITSLayersAll); fillCutAnalysis(collision, bunchCrossing, evSel_kIsGoodITSLayersAll); + } else if (cfgSelVec.value[evSel_kIsGoodITSLayersAll]) { + isEventSelected = false; } selected = collision.selection_bit(o2::aod::evsel::kIsGoodITSLayer0123); if (selected) { selectionBits |= static_cast(0x1u << evSel_kIsGoodITSLayer0123); fillCutAnalysis(collision, bunchCrossing, evSel_kIsGoodITSLayer0123); + } else if (cfgSelVec.value[evSel_kIsGoodITSLayer0123]) { + isEventSelected = false; } selected = rctChecker(collision); if (selected) { selectionBits |= static_cast(0x1u << evSel_RCTFlagsZDC); fillCutAnalysis(collision, bunchCrossing, evSel_RCTFlagsZDC); + } else if (cfgSelVec.value[evSel_RCTFlagsZDC]) { + isEventSelected = false; + } + + float vtxz = -999; + if (collision.numContrib() > 1) { + vtxz = collision.posZ(); + float zRes = std::sqrt(collision.covZZ()); + float minzRes = 0.25; + int maxNumContrib = 20; + if (zRes > minzRes && collision.numContrib() < maxNumContrib) + vtxz = -999; + } + + auto multNTracksPV = collision.multNTracksPV(); + selected = true; + + if (vtxz > cfgVtxZ || vtxz < -cfgVtxZ) + selected = false; + if (multNTracksPV < fMultPVCutLow->Eval(collision.centFT0C())) + selected = false; + if (multNTracksPV > fMultPVCutHigh->Eval(collision.centFT0C())) + selected = false; + if (multTrk < fMultCutLow->Eval(collision.centFT0C())) + selected = false; + if (multTrk > fMultCutHigh->Eval(collision.centFT0C())) + selected = false; + + if (selected) { + selectionBits |= static_cast(0x1u << evSel_MultCut); + fillCutAnalysis(collision, bunchCrossing, evSel_MultCut); + } else if (cfgSelVec.value[evSel_MultCut]) { + isEventSelected = false; } // Fill for centrality estimators! fillCutAnalysis(collision, bunchCrossing, nEventSelections); - return selectionBits; } @@ -694,7 +788,8 @@ struct ZdcQVectors { void process(UsedCollisions::iterator const& collision, BCsRun3 const& /*bcs*/, - aod::Zdcs const& /*zdcs*/) + aod::Zdcs const& /*zdcs*/, + UsedTracks const& tracks) { // for Q-vector calculation // A[0] & C[1] @@ -797,10 +892,14 @@ struct ZdcQVectors { } registry.fill(HIST("hEventCount"), evSel_isSelectedZDC); - uint16_t eventSelectionFlags = eventSelected(collision, foundBC.zdc()); + // Use this bool to check for given set of event selections of Q-vectors would be selected + // Enable plotting only if event would be selected + bool isEventSelected = true; + + uint16_t eventSelectionFlags = eventSelected(collision, foundBC.zdc(), isEventSelected, tracks.size()); // ALWAYS use these event selections - if (cent < EvSel.cfgCentMin || cent > EvSel.cfgCentMax || !collision.sel8() || std::abs(collision.posZ()) > cfgVtxZ) { + 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); @@ -835,7 +934,7 @@ struct ZdcQVectors { // load the calibrations for the mean v loadCalibrations(cfgMeanv.value, timestamp); - if (!cfgFillNothing) { + if (!cfgFillNothing && isEventSelected) { 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]); @@ -879,7 +978,7 @@ struct ZdcQVectors { calibtower++; } - if (cfgFillHistRegistry && !cfgFillNothing) { + if (cfgFillHistRegistry && !cfgFillNothing && isEventSelected) { for (int i = 0; i < nTowersPerSide; i++) { float bincenter = i + .5; registry.fill(HIST("QA/ZNA_Energy"), bincenter, eZN[i]); @@ -940,7 +1039,7 @@ struct ZdcQVectors { } } - if (cfgFillHistRegistry && !cfgFillNothing) { + if (cfgFillHistRegistry && !cfgFillNothing && isEventSelected) { 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]); @@ -991,7 +1090,7 @@ struct ZdcQVectors { corrQxC.push_back(getCorrection(names[0][2].Data(), it, 1)); corrQyC.push_back(getCorrection(names[0][3].Data(), it, 1)); - if (cfgFillHistRegistry && !cfgFillNothing) { + if (cfgFillHistRegistry && !cfgFillNothing && isEventSelected) { registry.get(HIST("recentering/QXA_vs_iteration"))->Fill(pb + 1, q[0] - std::accumulate(corrQxA.begin(), corrQxA.end(), 0.0)); registry.get(HIST("recentering/QYA_vs_iteration"))->Fill(pb + 1, q[1] - std::accumulate(corrQyA.begin(), corrQyA.end(), 0.0)); registry.get(HIST("recentering/QXC_vs_iteration"))->Fill(pb + 1, q[2] - std::accumulate(corrQxC.begin(), corrQxC.end(), 0.0)); @@ -1005,7 +1104,7 @@ struct ZdcQVectors { corrQxC.push_back(getCorrection(names[step - 1][2].Data(), it, step)); corrQyC.push_back(getCorrection(names[step - 1][3].Data(), it, step)); - if (cfgFillHistRegistry && !cfgFillNothing) { + if (cfgFillHistRegistry && !cfgFillNothing && isEventSelected) { registry.get(HIST("recentering/QXA_vs_iteration"))->Fill(pb + 1, q[0] - std::accumulate(corrQxA.begin(), corrQxA.end(), 0.0)); registry.get(HIST("recentering/QYA_vs_iteration"))->Fill(pb + 1, q[1] - std::accumulate(corrQyA.begin(), corrQyA.end(), 0.0)); registry.get(HIST("recentering/QXC_vs_iteration"))->Fill(pb + 1, q[2] - std::accumulate(corrQxC.begin(), corrQxC.end(), 0.0)); @@ -1021,7 +1120,7 @@ struct ZdcQVectors { corrQxC.push_back(getCorrection(namesTS[2].Data(), it, 6)); corrQyC.push_back(getCorrection(namesTS[3].Data(), it, 6)); - if (cfgFillHistRegistry && !cfgFillNothing) { + if (cfgFillHistRegistry && !cfgFillNothing && isEventSelected) { registry.get(HIST("recentering/QXA_vs_iteration"))->Fill(pb + 1, q[0] - std::accumulate(corrQxA.begin(), corrQxA.end(), 0.0)); registry.get(HIST("recentering/QYA_vs_iteration"))->Fill(pb + 1, q[1] - std::accumulate(corrQyA.begin(), corrQyA.end(), 0.0)); registry.get(HIST("recentering/QXC_vs_iteration"))->Fill(pb + 1, q[2] - std::accumulate(corrQxC.begin(), corrQxC.end(), 0.0)); From fd889127226b301746f8552101488941f123bf8a Mon Sep 17 00:00:00 2001 From: cnkoster Date: Wed, 22 Jul 2026 18:34:30 +0200 Subject: [PATCH 7/9] work on linter issues --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 3 +++ PWGCF/Flow/Tasks/flowSP.cxx | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index b453cd45c77..5d6d27c7857 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -20,6 +20,8 @@ #include "Common/CCDB/RCTSelectionFlags.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/TrackSelectionTables.h" #include #include @@ -41,6 +43,7 @@ #include #include +#include #include #include #include diff --git a/PWGCF/Flow/Tasks/flowSP.cxx b/PWGCF/Flow/Tasks/flowSP.cxx index bdfe749d603..33e6969ef60 100644 --- a/PWGCF/Flow/Tasks/flowSP.cxx +++ b/PWGCF/Flow/Tasks/flowSP.cxx @@ -1164,18 +1164,18 @@ struct FlowSP { double psiC = 1.0 * std::atan2(collision.qyC(), collision.qxC()); double psiFull = 1.0 * std::atan2(collision.qyA() + collision.qyC(), collision.qxA() + collision.qxC()); - 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.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); + 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.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); } } return; From 34431d57ec79c01273e9a2fe255ab85a1bc5ccdb Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 22 Jul 2026 16:35:10 +0000 Subject: [PATCH 8/9] Please consider the following formatting changes --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index 5d6d27c7857..4d6ce2cc1fd 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -43,12 +43,12 @@ #include #include -#include #include #include #include #include #include +#include #include #include #include @@ -157,7 +157,6 @@ struct ZdcQVectors { Configurable> cfgEvSelsMultPv{"cfgEvSelsMultPv", std::vector{2223.49, -75.1444, 0.963572, -0.00570399, 1.34877e-05, 3790.99, -137.064, 2.13044, -0.017122, 5.82834e-05}, "Multiplicity cuts (PV) first 5 parameters cutLOW last 5 cutHIGH (Default is +-2sigma pass5) "}; Configurable> cfgEvSelsMult{"cfgEvSelsMult", std::vector{1301.56, -41.4615, 0.478224, -0.00239449, 4.46966e-06, 2967.6, -102.927, 1.47488, -0.0106534, 3.28622e-05}, "Multiplicity cuts (Global) first 5 parameters cutLOW last 5 cutHIGH (Default is +-2sigma pass5) "}; - // define my..... // Filter collisionFilter = nabs(aod::collision::posZ) <; @@ -167,7 +166,6 @@ struct ZdcQVectors { using UnfilteredTracks = soa::Join; using UsedTracks = soa::Filtered; - enum SelectionCriteria { evSel_FilteredEvent, evSel_BCHasZDC, @@ -408,7 +406,6 @@ struct ZdcQVectors { fMultCutLow->SetParameters(paramsMultCut[0], paramsMultCut[1], paramsMultCut[2], paramsMultCut[3], paramsMultCut[4]); fMultCutHigh->SetParameters(paramsMultCut[5], paramsMultCut[6], paramsMultCut[7], paramsMultCut[8], paramsMultCut[9]); } - } double rescaleTimestamp(uint64_t timestamp, int runnumber) @@ -471,7 +468,7 @@ struct ZdcQVectors { } } - template + template uint16_t eventSelected(TCollision collision, TBunchCrossing bunchCrossing, bool& isEventSelected, const int& multTrk) { uint16_t selectionBits = 0; @@ -943,13 +940,13 @@ struct ZdcQVectors { registry.get(HIST("vmean/hvertex_vz"))->Fill(Form("%d", runnumber), v[2]); // Fill to get mean energy per tower in 1% centrality bins - + 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); - + 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); From be7da466d90157b342abd2610de46347a54cdd6d Mon Sep 17 00:00:00 2001 From: cnkoster Date: Thu, 23 Jul 2026 09:50:15 +0200 Subject: [PATCH 9/9] remove unused axis --- PWGCF/Flow/TableProducer/zdcQVectors.cxx | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/PWGCF/Flow/TableProducer/zdcQVectors.cxx b/PWGCF/Flow/TableProducer/zdcQVectors.cxx index 4d6ce2cc1fd..b221a02530f 100644 --- a/PWGCF/Flow/TableProducer/zdcQVectors.cxx +++ b/PWGCF/Flow/TableProducer/zdcQVectors.cxx @@ -118,11 +118,7 @@ struct ZdcQVectors { } extraTS; 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"}; - ConfigurableAxis axisVxBig{"axisVxBig", {100, -0.01, 0.01}, "for Pos X of collision"}; - ConfigurableAxis axisVyBig{"axisVyBig", {100, -0.01, 0.01}, "for Pos Y of collision"}; - ConfigurableAxis axisVzBig{"axisVzBig", {100, -10, 10}, "for Pos Z of collision"}; ConfigurableAxis axisVx{"axisVx", {100, -0.01, 0.01}, "for Pos X of collision"}; ConfigurableAxis axisVy{"axisVy", {100, -0.01, 0.01}, "for Pos Y of collision"}; ConfigurableAxis axisVz{"axisVz", {100, -10, 10}, "for vz of collision"}; @@ -272,9 +268,9 @@ struct ZdcQVectors { 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, -PI, PI}, axisCent10}); + registry.add(Form("QA/before/hSPplaneA"), "hSPplaneA", kTH2D, {axisPsiA, axisCent}); + registry.add(Form("QA/before/hSPplaneC"), "hSPplaneC", kTH2D, {axisPsiC, axisCent}); + registry.add(Form("QA/before/hSPplaneFull"), "hSPplaneFull", kTH2D, {{100, -PI, PI}, axisCent}); for (const auto& side : sides) { registry.add(Form("recentering/before/hZN%s_Qx_vs_Qy", side), Form("hZN%s_Qx_vs_Qy", side), kTH2F, {axisQ, axisQ}); } @@ -294,7 +290,7 @@ struct ZdcQVectors { // Sides is {A,C} and capcoords is {X,Y} for (const auto& side : sides) { for (const auto& coord : capCOORDS) { - registry.add(Form("recentering/before/hQ%s%s_vs_cent", coord, side), Form("hQ%s%s_vs_cent", coord, side), {HistType::kTProfile, {axisCent10}}); + registry.add(Form("recentering/before/hQ%s%s_vs_cent", coord, side), Form("hQ%s%s_vs_cent", coord, side), {HistType::kTProfile, {axisCent}}); registry.add(Form("recentering/before/hQ%s%s_vs_vx", coord, side), Form("hQ%s%s_vs_vx", coord, side), {HistType::kTProfile, {axisVx}}); registry.add(Form("recentering/before/hQ%s%s_vs_vy", coord, side), Form("hQ%s%s_vs_vy", coord, side), {HistType::kTProfile, {axisVy}}); registry.add(Form("recentering/before/hQ%s%s_vs_vz", coord, side), Form("hQ%s%s_vs_vz", coord, side), {HistType::kTProfile, {axisVz}});