From 15a203902baa5dd8aed5de0a8d16cce930888345 Mon Sep 17 00:00:00 2001 From: cnkoster Date: Thu, 24 Oct 2024 15:32:05 +0200 Subject: [PATCH 1/6] Task to determine q-vectors and recenter them for v1 analysis --- PWGCF/DataModel/SPTableZDC.h | 58 +++ PWGCF/Flow/Tasks/CMakeLists.txt | 5 + PWGCF/Flow/Tasks/flowSPZDC.cxx | 698 ++++++++++++++++++++++++++++++++ 3 files changed, 761 insertions(+) create mode 100644 PWGCF/DataModel/SPTableZDC.h create mode 100644 PWGCF/Flow/Tasks/flowSPZDC.cxx diff --git a/PWGCF/DataModel/SPTableZDC.h b/PWGCF/DataModel/SPTableZDC.h new file mode 100644 index 00000000000..86781d40248 --- /dev/null +++ b/PWGCF/DataModel/SPTableZDC.h @@ -0,0 +1,58 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +/// \file SPTableZDC.h + + +#ifndef PWGCF_DATAMODEL_SPTABLEZDC_H_ +#define PWGCF_DATAMODEL_SPTABLEZDC_H_ + +#include + +#include "Common/DataModel/PIDResponse.h" +#include "Common/Core/RecoDecay.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Framework/AnalysisDataModel.h" + +namespace o2::aod +{ +namespace sptablezdc +{ +DECLARE_SOA_COLUMN(Runnumber, runnumber, int); +DECLARE_SOA_COLUMN(Cent, cent, float); +DECLARE_SOA_COLUMN(Vx, vx, float); +DECLARE_SOA_COLUMN(Vy, vy, float); +DECLARE_SOA_COLUMN(Vz, vz, float); +DECLARE_SOA_COLUMN(QXA, qxA, float); +DECLARE_SOA_COLUMN(QXC, qxC, float); +DECLARE_SOA_COLUMN(QYA, qyA, float); +DECLARE_SOA_COLUMN(QYC, qyC, float); +// keep track of where we are in steps and iterations. +DECLARE_SOA_COLUMN(Iteration, iteration, int); +DECLARE_SOA_COLUMN(Step, step, int); + +} // namespace sptable + +DECLARE_SOA_TABLE(SPTableZDC, "AOD", "SPCALCOLS", + sptablezdc::Runnumber, + sptablezdc::Cent, + sptablezdc::Vx, + sptablezdc::Vy, + sptablezdc::Vz, + sptablezdc::QXA, + sptablezdc::QXC, + sptablezdc::QYA, + sptablezdc::QYC, + sptablezdc::Iteration, + sptablezdc::Step + ); +} // namespace o2::aod +#endif // PWGCF_DATAMODEL_SPTABLE_H_ \ No newline at end of file diff --git a/PWGCF/Flow/Tasks/CMakeLists.txt b/PWGCF/Flow/Tasks/CMakeLists.txt index 6185363ce56..dfa81efa771 100644 --- a/PWGCF/Flow/Tasks/CMakeLists.txt +++ b/PWGCF/Flow/Tasks/CMakeLists.txt @@ -43,3 +43,8 @@ o2physics_add_dpl_workflow(flow-gfw-omegaxi SOURCES flowGFWOmegaXi.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::GFWCore COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(flow-zdc-qvectors + SOURCES flowSPZDC.cxx + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::GFWCore + COMPONENT_NAME Analysis) diff --git a/PWGCF/Flow/Tasks/flowSPZDC.cxx b/PWGCF/Flow/Tasks/flowSPZDC.cxx new file mode 100644 index 00000000000..e5379fd52c2 --- /dev/null +++ b/PWGCF/Flow/Tasks/flowSPZDC.cxx @@ -0,0 +1,698 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// In applying this license CERN does not waive the privileges and immunities +// granted to it by virtue of its status as an Intergovernmental Organization +// or submit itself to any jurisdiction. + +// In this task the energy calibration and recentring of Q-vectors constructed in the ZDCs will be done + +#include +#include +#include +#include +#include +#include + +#include "Common/CCDB/EventSelectionParams.h" +#include "Common/CCDB/TriggerAliases.h" +#include "Common/Core/TrackSelection.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/EventSelection.h" + +#include "Framework/AnalysisTask.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" +#include "Framework/ASoAHelpers.h" +#include "Framework/RunningWorkflowInfo.h" +#include "Framework/StaticFor.h" + +#include "CCDB/BasicCCDBManager.h" +#include "DataFormatsParameters/GRPObject.h" +#include "DataFormatsParameters/GRPMagField.h" +#include "ReconstructionDataFormats/GlobalTrackID.h" +#include "ReconstructionDataFormats/Track.h" + +#include "PWGCF/DataModel/SPTableZDC.h" + +#include "TH1F.h" +#include "TH2F.h" +#include "TProfile.h" +#include "TObjArray.h" +#include "TF1.h" +#include "TFitResult.h" +#include "TCanvas.h" +#include "TSystem.h" +#include "TROOT.h" + +#define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::aod::track; +using namespace o2::aod::evsel; + +// define my..... +using myCollisions = soa::Filtered>; +using BCsRun3 = soa::Join; + +namespace o2::analysis::qvectortask +{ + +int counter = 0; + +// step0 -> Energy calib +std::shared_ptr ZN_Energy[10] = {{nullptr}}; +std::shared_ptr hQx_vs_Qy[6] = {{nullptr}}; + +// and +std::shared_ptr COORD_correlations[6][4] = {{nullptr}}; +std::vector hZN_mean(10, nullptr); // Get from calibration file + +// step1: 4D large bins +std::vector mean_10perCent_v(4, nullptr); // hQXA, hQYA, hQXC, hQYC + +// step2: Small bins 1D +std::vector mean_1perCent_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC +std::vector mean_vx_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC +std::vector mean_vy_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC +std::vector mean_vz_Run(4, nullptr); // hQXA, hQYA, hQXC, hQYC + +// Define histogrm names here to use same names for creating and later uploading and retrieving data from ccdb +// Energy calibration: +std::vector names_Ecal(10, ""); +std::vector> names(5, std::vector()); //(1x 4d 4x 1d) +std::vector 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 ZDC_px = {-1.75, 1.75, -1.75, 1.75}; +std::vector ZDC_py = {-1.75, -1.75, 1.75, 1.75}; +double alphaZDC = 0.395; + +// step 0 tm 5 A&C +std::vector>> q(5, std::vector>(7, std::vector(4, 0.0))); // 5 iterations with 5 steps, each with 4 values + +// 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. +double centrality; +int runnumber; +std::vector v(3); // vx, vy, vz + +} // namespace o2::analysis::qvectortask + +using namespace o2::analysis::qvectortask; + +struct ZDCqvectors { + + Produces SPtableZDC; + + 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 axisVx_big{"axisVx_big", {3, -0.006, -0.006}, "for Pos X of collision"}; + ConfigurableAxis axisVy_big{"axisVy_big", {3, -0.003, 0.003}, "for Pos Y of collision"}; + ConfigurableAxis axisVz_big{"axisVz_big", {3, -10, 10}, "for Pos Z of collision"}; + ConfigurableAxis axisVx{"axisVx", {10, -0.006, -0.006}, "for Pos X of collision"}; + ConfigurableAxis axisVy{"axisVy", {10, -0.003, 0.003}, "for Pos Y of collision"}; + ConfigurableAxis axisVz{"axisVz", {10, -10, 1}, "for vz of collision"}; + ConfigurableAxis axisRun{"axisRun", {1e6, 0, 1e6}, "for runNumber in ThnSparse"}; + + O2_DEFINE_CONFIGURABLE(cfgCutVertex, float, 10.0f, "Accepted z-vertex range") + O2_DEFINE_CONFIGURABLE(cfgCutPtPOIMin, float, 0.2f, "Minimal.q pT for poi tracks") + O2_DEFINE_CONFIGURABLE(cfgCutPtPOIMax, float, 10.0f, "Maximal pT for poi tracks") + O2_DEFINE_CONFIGURABLE(cfgCutPtMin, float, 0.2f, "Minimal pT for ref tracks") + O2_DEFINE_CONFIGURABLE(cfgCutPtMax, float, 3.0f, "Maximal pT for ref tracks") + O2_DEFINE_CONFIGURABLE(cfgCutEta, float, 0.8f, "Eta range for tracks") + O2_DEFINE_CONFIGURABLE(cfgCutChi2prTPCcls, float, 2.5, "Chi2 per TPC clusters") + O2_DEFINE_CONFIGURABLE(cfgMagField, float, 99999, "Configurable magnetic field; default CCDB will be queried") + O2_DEFINE_CONFIGURABLE(cfgEnergyCal, std::string, "", "ccdb path for energy calibration histos") + O2_DEFINE_CONFIGURABLE(cfgMeanv, std::string, "", "ccdb path for mean v histos") + Configurable> cfgRec1{"cfgRec1", {"", "", "", "",""}, "ccdb paths for recentering calibration histos iteration 1"}; + Configurable> cfgRec2{"cfgRec2", {"", "", "", "",""}, "ccdb paths for recentering calibration histos iteration 2"}; + Configurable> cfgRec3{"cfgRec3", {"", "", "", "",""}, "ccdb paths for recentering calibration histos iteration 3"}; + Configurable> cfgRec4{"cfgRec4", {"", "", "", "",""}, "ccdb paths for recentering calibration histos iteration 4"}; + + // Define output + HistogramRegistry registry{"Registry"}; + + // Filters + Filter collisionFilter = nabs(aod::collision::posZ) < cfgCutVertex; + + Service ccdb; + + // keep track of calibration histos for each given step and iteration + struct Calib { + std::vector> calibList = std::vector>(7, std::vector(8, nullptr)); + std::vector> calibfilesLoaded = std::vector>(7, std::vector(8, false)); + int atStep = 0; + int atIteration = 0; + } cal; + + void init(InitContext const&) + { + ccdb->setURL("http://alice-ccdb.cern.ch"); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + + int64_t now = std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(); + ccdb->setCreatedNotAfter(now); + + std::vector sides = {"A", "C"}; + std::vector coords = {"x", "y", "z"}; + std::vector COORDS = {"X", "Y"}; + + // Tower mean energies vs. centrality used for tower gain equalisation + for (int tower = 0; tower < 10; tower++) { + names_Ecal[tower] = TString::Format("hZN%s_mean_t%i_cent", sides[(tower < 5) ? 0 : 1], tower % 5); + ZN_Energy[tower] = registry.add(Form("Energy/%s", names_Ecal[tower].Data()), Form("%s", names_Ecal[tower].Data()), kTProfile2D, {{1, 0, 1}, axisCent}); + } + + // Qx_vs_Qy for each step for ZNA and ZNC + for (int step = 0; step < 6; step++) { + for (const char* side : sides) { + hQx_vs_Qy[step] = registry.add(Form("step%i/hZN%s_Qx_vs_Qy", step, side), Form("hZN%s_Qx_vs_Qy", side), kTH2F, {axisQ, axisQ}); + } + int i = 0; + for (const char* COORD1 : COORDS) { + for (const char* COORD2 : COORDS) { + // Now we get: & vs. Centrality + COORD_correlations[step][i] = registry.add(Form("step%i/QA/hQ%sA_Q%sC_vs_cent", step, COORD1, COORD2), Form("hQ%sA_Q%sC_vs_cent", COORD1, COORD2), kTProfile, {axisCent10}); + i++; + } + } + + // Add histograms for each step in the calibration process. + // Sides is {A,C} and coords is {X,Y} + for (const char* side : sides) { + for (const char* coord : COORDS) { + registry.add(Form("step%i/QA/hQ%s%s_vs_cent", step, coord, side), Form("hQ%s%s_vs_cent", coord, side), {HistType::kTProfile, {axisCent10}}); + registry.add(Form("step%i/QA/hQ%s%s_vs_vx", step, coord, side), Form("hQ%s%s_vs_vx", coord, side), {HistType::kTProfile, {axisVx}}); + registry.add(Form("step%i/QA/hQ%s%s_vs_vy", step, coord, side), Form("hQ%s%s_vs_vy", coord, side), {HistType::kTProfile, {axisVy}}); + registry.add(Form("step%i/QA/hQ%s%s_vs_vz", step, coord, side), Form("hQ%s%s_vs_vz", coord, side), {HistType::kTProfile, {axisVz}}); + + if (step == 1 || step == 5) { + TString name = TString::Format("hQ%s%s_mean_Cent_V_run", coord, side); + registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_Cent_V_run", coord, side), {HistType::kTHnSparseD, {axisRun, axisCent10, axisVx_big, axisVy_big, axisVz_big, axisQ}}); + if(step==1) names[step - 1].push_back(name); + } + if (step == 2) { + TString name = TString::Format("hQ%s%s_mean_1percent_run", coord, side); + registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_1percent_run", coord, side), kTProfile2D, {{1, 0., 1.}, axisCent}); + names[step - 1].push_back(name); + } + if (step == 3) { + TString name = TString::Format("hQ%s%s_mean_vx_run", coord, side); + registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_vx_run", coord, side), kTProfile2D, {{1, 0., 1.}, axisVx}); + names[step - 1].push_back(name); + } + if (step == 4) { + TString name = TString::Format("hQ%s%s_mean_vy_run", coord, side); + registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_vy_run", coord, side), kTProfile2D, {{1, 0., 1.}, axisVy}); + names[step - 1].push_back(name); + } + if (step == 5) { + TString name = TString::Format("hQ%s%s_mean_vz_run", coord, side); + registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_vz_run", coord, side), kTProfile2D, {{1, 0., 1.}, axisVz}); + names[step - 1].push_back(name); + } + } // end of COORDS + } // end of sides + } // end of sum over steps + + + + // recentered q-vectors (to check what steps are finished in the end) + registry.add("hStep", "hStep", {HistType::kTH1D, {{10, 0., 10.}}}); + registry.add("hIteration", "hIteration", {HistType::kTH1D, {{10, 0., 10.}}}); + + // histos with mean v(x/y) per run. + registry.add("vmean/hvertex_vx", "hvertex_vx", kTProfile, {{1, 0., 1.}}, "s"); + registry.add("vmean/hvertex_vy", "hvertex_vy", kTProfile, {{1, 0., 1.}}, "s"); + } + + inline void fillRegistry(int iteration, int step) + { + if (step == 0 && iteration == 1) { + registry.fill(HIST("hIteration"), iteration, 1); + + registry.fill(HIST("step1/hQXA_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[0][step][0]); + registry.fill(HIST("step1/hQYA_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[0][step][1]); + registry.fill(HIST("step1/hQXC_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[0][step][2]); + registry.fill(HIST("step1/hQYC_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[0][step][3]); + registry.fill(HIST("hStep"), step, 1); + } + + if (step == 1) { + registry.get(HIST("step2/hQXA_mean_1percent_run"))->Fill(Form("%d", runnumber), centrality, q[iteration][step][0], 1); + registry.get(HIST("step2/hQYA_mean_1percent_run"))->Fill(Form("%d", runnumber), centrality, q[iteration][step][1], 1); + registry.get(HIST("step2/hQXC_mean_1percent_run"))->Fill(Form("%d", runnumber), centrality, q[iteration][step][2], 1); + registry.get(HIST("step2/hQYC_mean_1percent_run"))->Fill(Form("%d", runnumber), centrality, q[iteration][step][3], 1); + registry.fill(HIST("hStep"), step, 1); + } + + if (step == 2) { + registry.get(HIST("step3/hQXA_mean_vx_run"))->Fill(Form("%d", runnumber), v[0], q[iteration][step][0], 1); + registry.get(HIST("step3/hQYA_mean_vx_run"))->Fill(Form("%d", runnumber), v[0], q[iteration][step][1], 1); + registry.get(HIST("step3/hQXC_mean_vx_run"))->Fill(Form("%d", runnumber), v[0], q[iteration][step][2], 1); + registry.get(HIST("step3/hQYC_mean_vx_run"))->Fill(Form("%d", runnumber), v[0], q[iteration][step][3], 1); + registry.fill(HIST("hStep"), step, 1); + } + + if (step == 3) { + registry.get(HIST("step4/hQXA_mean_vy_run"))->Fill(Form("%d", runnumber), v[1], q[iteration][step][0], 1); + registry.get(HIST("step4/hQYA_mean_vy_run"))->Fill(Form("%d", runnumber), v[1], q[iteration][step][1], 1); + registry.get(HIST("step4/hQXC_mean_vy_run"))->Fill(Form("%d", runnumber), v[1], q[iteration][step][2], 1); + registry.get(HIST("step4/hQYC_mean_vy_run"))->Fill(Form("%d", runnumber), v[1], q[iteration][step][3], 1); + registry.fill(HIST("hStep"), step, 1); + } + + if (step == 4) { + registry.get(HIST("step5/hQXA_mean_vz_run"))->Fill(Form("%d", runnumber), v[2], q[iteration][step][0], 1); + registry.get(HIST("step5/hQYA_mean_vz_run"))->Fill(Form("%d", runnumber), v[2], q[iteration][step][1], 1); + registry.get(HIST("step5/hQXC_mean_vz_run"))->Fill(Form("%d", runnumber), v[2], q[iteration][step][2], 1); + registry.get(HIST("step5/hQYC_mean_vz_run"))->Fill(Form("%d", runnumber), v[2], q[iteration][step][3], 1); + registry.fill(HIST("hStep"), step, 1); + } + + if (step==5){ + registry.fill(HIST("step5/hQXA_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[iteration][step][0]); + registry.fill(HIST("step5/hQYA_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[iteration][step][1]); + registry.fill(HIST("step5/hQXC_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[iteration][step][2]); + registry.fill(HIST("step5/hQYC_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[iteration][step][3]); + registry.fill(HIST("hStep"), step, 1); + } + } + + inline void fillCommonRegistry(int iteration){ + //loop for filling multiple histograms with different naming patterns + // Always fill the uncentered "raw" Q-vector histos! + + registry.fill(HIST("step0/hZNA_Qx_vs_Qy"), q[0][0][0], q[0][0][1]); + registry.fill(HIST("step0/hZNC_Qx_vs_Qy"), q[0][0][2], q[0][0][3]); + + registry.fill(HIST("step0/QA/hQXA_QXC_vs_cent"), centrality, q[0][0][0] * q[0][0][2]); + registry.fill(HIST("step0/QA/hQYA_QYC_vs_cent"), centrality, q[0][0][1] * q[0][0][3]); + registry.fill(HIST("step0/QA/hQYA_QXC_vs_cent"), centrality, q[0][0][1] * q[0][0][2]); + registry.fill(HIST("step0/QA/hQXA_QYC_vs_cent"), centrality, q[0][0][0] * q[0][0][3]); + + registry.fill(HIST("step0/QA/hQXA_vs_cent"), centrality, q[0][0][0]); + registry.fill(HIST("step0/QA/hQYA_vs_cent"), centrality, q[0][0][1]); + registry.fill(HIST("step0/QA/hQXC_vs_cent"), centrality, q[0][0][2]); + registry.fill(HIST("step0/QA/hQYC_vs_cent"), centrality, q[0][0][3]); + + registry.fill(HIST("step0/QA/hQXA_vs_vx"), v[0], q[0][0][0]); + registry.fill(HIST("step0/QA/hQYA_vs_vx"), v[0], q[0][0][1]); + registry.fill(HIST("step0/QA/hQXC_vs_vx"), v[0], q[0][0][2]); + registry.fill(HIST("step0/QA/hQYC_vs_vx"), v[0], q[0][0][3]); + + registry.fill(HIST("step0/QA/hQXA_vs_vy"), v[1], q[0][0][0]); + registry.fill(HIST("step0/QA/hQYA_vs_vy"), v[1], q[0][0][1]); + registry.fill(HIST("step0/QA/hQXC_vs_vy"), v[1], q[0][0][2]); + registry.fill(HIST("step0/QA/hQYC_vs_vy"), v[1], q[0][0][3]); + + registry.fill(HIST("step0/QA/hQXA_vs_vz"), v[2], q[0][0][0]); + registry.fill(HIST("step0/QA/hQYA_vs_vz"), v[2], q[0][0][1]); + registry.fill(HIST("step0/QA/hQXC_vs_vz"), v[2], q[0][0][2]); + registry.fill(HIST("step0/QA/hQYC_vs_vz"), v[2], q[0][0][3]); + + static constexpr std::string_view subdir[] = {"step1/", "step2/", "step3/", "step4/","step5/"}; + static_for<0, 4>([&](auto ind) { + constexpr int index = ind.value; + int index_rt = index + 1; + + registry.fill(HIST(subdir[index]) + HIST("hZNA_Qx_vs_Qy"), q[iteration][index_rt][0], q[iteration][index_rt][1]); + registry.fill(HIST(subdir[index]) + HIST("hZNC_Qx_vs_Qy"), q[iteration][index_rt][2], q[iteration][index_rt][3]); + + registry.fill(HIST(subdir[index]) + HIST("QA/hQXA_QXC_vs_cent"), centrality, q[iteration][index_rt][0] * q[iteration][index_rt][2]); + registry.fill(HIST(subdir[index]) + HIST("QA/hQYA_QYC_vs_cent"), centrality, q[iteration][index_rt][1] * q[iteration][index_rt][3]); + registry.fill(HIST(subdir[index]) + HIST("QA/hQYA_QXC_vs_cent"), centrality, q[iteration][index_rt][1] * q[iteration][index_rt][2]); + registry.fill(HIST(subdir[index]) + HIST("QA/hQXA_QYC_vs_cent"), centrality, q[iteration][index_rt][0] * q[iteration][index_rt][3]); + + registry.fill(HIST(subdir[index]) + HIST("QA/hQXA_vs_cent"), centrality, q[iteration][index_rt][0]); + registry.fill(HIST(subdir[index]) + HIST("QA/hQYA_vs_cent"), centrality, q[iteration][index_rt][1]); + registry.fill(HIST(subdir[index]) + HIST("QA/hQXC_vs_cent"), centrality, q[iteration][index_rt][2]); + registry.fill(HIST(subdir[index]) + HIST("QA/hQYC_vs_cent"), centrality, q[iteration][index_rt][3]); + + registry.fill(HIST(subdir[index]) + HIST("QA/hQXA_vs_vx"), v[0], q[iteration][index_rt][0]); + registry.fill(HIST(subdir[index]) + HIST("QA/hQYA_vs_vx"), v[0], q[iteration][index_rt][1]); + registry.fill(HIST(subdir[index]) + HIST("QA/hQXC_vs_vx"), v[0], q[iteration][index_rt][2]); + registry.fill(HIST(subdir[index]) + HIST("QA/hQYC_vs_vx"), v[0], q[iteration][index_rt][3]); + + registry.fill(HIST(subdir[index]) + HIST("QA/hQXA_vs_vy"), v[1], q[iteration][index_rt][0]); + registry.fill(HIST(subdir[index]) + HIST("QA/hQYA_vs_vy"), v[1], q[iteration][index_rt][1]); + registry.fill(HIST(subdir[index]) + HIST("QA/hQXC_vs_vy"), v[1], q[iteration][index_rt][2]); + registry.fill(HIST(subdir[index]) + HIST("QA/hQYC_vs_vy"), v[1], q[iteration][index_rt][3]); + + registry.fill(HIST(subdir[index]) + HIST("QA/hQXA_vs_vz"), v[2], q[iteration][index_rt][0]); + registry.fill(HIST(subdir[index]) + HIST("QA/hQYA_vs_vz"), v[2], q[iteration][index_rt][1]); + registry.fill(HIST(subdir[index]) + HIST("QA/hQXC_vs_vz"), v[2], q[iteration][index_rt][2]); + registry.fill(HIST(subdir[index]) + HIST("QA/hQYC_vs_vz"), v[2], q[iteration][index_rt][3]); + }); + } + + + void loadCalibrations(int iteration, int step, uint64_t timestamp, std::string ccdb_dir, std::vector names) + { + // iteration = 0 (Energy calibration) -> step 0 only + // iteration 1,2,3,4,5 = recentering -> 5 steps per iteration (1x 4D + 4x 1D) + if (ccdb_dir.empty() == false) { + + cal.calibList[iteration][step] = ccdb->getForTimeStamp(ccdb_dir, timestamp); + + if (cal.calibList[iteration][step]) { + for (int i = 0; i < names.size(); i++) { + TObject* obj = (TObject*)cal.calibList[iteration][step]->FindObject(Form("%s", names[i].Data())); + if (!obj) { + if (counter < 1) { + LOGF(error, "Object %s not found!!", names[i].Data()); + return; + } + } + // Try to cast to TProfile + if (TProfile* profile2D = dynamic_cast(obj)) { + if (profile2D->GetEntries() < 1) { + if (counter < 1) + LOGF(info, "%s (TProfile) is empty! Produce calibration file at given step", names[i].Data()); + cal.calibfilesLoaded[iteration][step] = false; + return; + } + if (counter < 1) + LOGF(info, "Loaded TProfile: %s", names[i].Data()); + } + // Try to cast to TProfile2D + else if (TProfile2D* profile2D = dynamic_cast(obj)) { + if (profile2D->GetEntries() < 1) { + if (counter < 1) + LOGF(info, "%s (TProfile2D) is empty! Produce calibration file at given step", names[i].Data()); + cal.calibfilesLoaded[iteration][step] = false; + return; + } + if (counter < 1) + LOGF(info, "Loaded TProfile2D: %s", names[i].Data()); + } + // Try to cast to THnSparse + else if (THnSparse* sparse = dynamic_cast(obj)) { + if (sparse->GetEntries() < 1) { + if (counter < 1) + LOGF(info, "%s (THnSparse) is empty! Produce calibration file at given step", names[i].Data()); + cal.calibfilesLoaded[iteration][step] = false; + return; + } + if (counter < 1) + LOGF(info, "Loaded THnSparse: %s", names[i].Data()); + } + } // end of for loop + } // end of if (cal.calib[iteration][step]) + else { + // when (cal.calib[iteration][step])=false! + if (counter < 1) + LOGF(warning, "Could not load TList with calibration histos from %s", ccdb_dir.c_str()); + cal.calibfilesLoaded[iteration][step] = false; + return; + } + if (counter < 1) + LOGF(info, "<--------OK----------> Calibrations loaded for iteration %i and step %i", iteration, step+1); + cal.calibfilesLoaded[iteration][step] = true; + cal.atIteration = iteration; + cal.atStep = step; + return; + } // end of ccdb_dir.empty() + else { + if (counter < 1) + LOGF(info, "<--------X-----------> Calibrations not loaded for iteration %i and step %i cfg = empty!", iteration, step+1); + } + } + + template + double getCorrection(int iteration, int step, const char* objName) + { + T* hist = nullptr; + double calibConstant; + + hist = (T*)cal.calibList[iteration][step]->FindObject(Form("%s", objName)); + if (!hist) { + LOGF(fatal, "%s not available.. Abort..", objName); + } + + if (hist->InheritsFrom("TProfile2D")) { + if (counter < 1) + LOGF(info, "correction is TProfile2D %s for q[%i][%i]", objName, iteration,step); + TProfile2D* h = (TProfile2D*)hist; + int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%i", runnumber)); + int bincentrality = h->GetYaxis()->FindBin(centrality); + calibConstant = h->GetBinContent(binrunnumber, bincentrality); + } else if (hist->InheritsFrom("TProfile")) { + if (counter < 1) + LOGF(info, "correction is TProfile %s for q[%i][%i]", objName, iteration,step); + TProfile* h = (TProfile*)hist; + int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%i", runnumber)); + calibConstant = h->GetBinContent(binrunnumber); + } else if (hist->InheritsFrom("THnSparse")) { + if (counter < 1) + LOGF(info, "correction is THnSparse %s for q[%i][%i]", objName, iteration,step); + std::vector sparsePars; + if (counter < 1) + LOGF(info, "correction is THnSparse %s for q[%i][%i]", objName, iteration,step); + THnSparseD* h = (THnSparseD*)hist; + if (step==0 && iteration>0) { + sparsePars.push_back(h->GetAxis(0)->FindBin(runnumber)); + sparsePars.push_back(h->GetAxis(1)->FindBin(centrality)); + sparsePars.push_back(h->GetAxis(2)->FindBin(v[0])); + sparsePars.push_back(h->GetAxis(3)->FindBin(v[1])); + sparsePars.push_back(h->GetAxis(4)->FindBin(v[2])); + } + for (int i = 0; i < sparsePars.size(); i++) { + h->GetAxis(i)->SetRange(sparsePars[i], sparsePars[i]); + } + calibConstant = h->Projection(sparsePars.size())->GetMean(); + + if(h->Projection(sparsePars.size())->GetEntries() < 2) { + LOGF(debug, "1 entry in sparse bin! Not used... (increase binsize)"); + calibConstant = 0; + } + } + return calibConstant; + } + + void fillAllRegistries(int iteration, int step) + { + for (int s = 0; s <= step; s++) + fillRegistry(iteration, s); + fillCommonRegistry(iteration); + } + + void process(myCollisions::iterator const& collision, + BCsRun3 const& /*bcs*/, + aod::Zdcs const& /*zdcs*/) + { + // for Q-vector calculation + // A[0] & C[1] + std::vector sumZN(2, 0.); + std::vector xEnZN(2, 0.); + std::vector yEnZN(2, 0.); + + if (!collision.sel8()) + return; + auto cent = collision.centFT0C(); + if (cent < 0 || cent > 90) + return; + + const auto& foundBC = collision.foundBC_as(); + if (foundBC.has_zdc()) { + + v[0] = collision.posX(); + v[1] = collision.posY(); + v[2] = collision.posZ(); + centrality = cent; + runnumber = foundBC.runNumber(); + + const auto& zdcCol = foundBC.zdc(); + + // Get the raw energies EZN[8] (not the common A,C) + for (int tower = 0; tower < 8; tower++) { + EZN[tower] = (tower < 4) ? zdcCol.energySectorZNA()[tower] : zdcCol.energySectorZNC()[tower % 4]; + } + + // load the calibration histos for iteration 0 step 0 (Energy Calibration) + loadCalibrations(0, 0, foundBC.timestamp(), cfgEnergyCal, names_Ecal); + if (!cal.calibfilesLoaded[0][0]) { + if (counter < 1) { + LOGF(info, " --> No Energy calibration files found.. -> Only Energy calibration will be done. "); + } + } + // load the calibrations for the mean v + loadCalibrations(0, 1, foundBC.timestamp(), cfgMeanv, vnames); + if (!cal.calibfilesLoaded[0][1]) { + if (counter < 1) + LOGF(warning, " --> No mean V found.. -> THis wil lead to wrong axis for vx, vy (will be created in vmean/)"); + registry.get(HIST("vmean/hvertex_vx"))->Fill(Form("%d", runnumber), v[0]); + registry.get(HIST("vmean/hvertex_vy"))->Fill(Form("%d", runnumber), v[1]); + } + + if (counter < 1) + LOGF(info, "=====================> .....Start Energy Calibration..... <====================="); + + bool isZNAhit = true; + bool isZNChit = true; + + for (int i = 0; i < 8; ++i) { + if (i < 4 && EZN[i] <= 0) + isZNAhit = false; + if (i > 3 && EZN[i] <= 0) + isZNChit = false; + } + + if (zdcCol.energyCommonZNA() <= 0) + isZNAhit = false; + if (zdcCol.energyCommonZNC() <= 0) + isZNChit = false; + + // Fill to get mean energy per tower in 1% centrality bins + for (int tower = 0; tower < 5; tower++) { + if (tower == 0) { + if (isZNAhit) + ZN_Energy[tower]->Fill(Form("%d", runnumber), cent, zdcCol.energyCommonZNA(), 1); + if (isZNChit) + ZN_Energy[tower + 5]->Fill(Form("%d", runnumber), cent, zdcCol.energyCommonZNC(), 1); + LOGF(debug, "Common A tower filled with: %i, %.2f, %.2f", runnumber, cent, zdcCol.energyCommonZNA()); + } else { + if (isZNAhit) + ZN_Energy[tower]->Fill(Form("%d", runnumber), cent, EZN[tower - 1], 1); + if (isZNChit) + ZN_Energy[tower + 5]->Fill(Form("%d", runnumber), cent, EZN[tower - 1 + 4], 1); + LOGF(debug, "Tower ZNC[%i] filled with: %i, %.2f, %.2f", tower, runnumber, cent, EZN[tower - 1 + 4]); + } + } + + // if ZNA or ZNC not hit correctly.. do not use event in q-vector calculation + if (!isZNAhit || !isZNChit) { + counter++; + return; + } + + if (cal.calibfilesLoaded[0][0]) { + if (counter < 1) + LOGF(info, "files for step 0 (energy Calibraton) are open!"); + + if (counter < 1) { + LOGF(info, "=====================> .....Start Calculating Q-Vectors..... <====================="); + } + + // Now start gain equalisation! + // Fill the list with calibration constants. + for (int tower = 0; tower < 10; tower++) { + meanEZN[tower] = getCorrection(0, 0, names_Ecal[tower].Data()); + } + + // Use the calibration constants but now only loop over towers 1-4 + int calibtower = 0; + std::vector towers_nocom = {1, 2, 3, 4, 6, 7, 8, 9}; + + for (int tower : towers_nocom) { + if (meanEZN[tower] > 0) { + double ecommon = (tower > 4) ? meanEZN[5] : meanEZN[0]; + e[calibtower] = EZN[calibtower] * (0.25 * ecommon) / meanEZN[tower]; + } + calibtower++; + } + + // Now calculate Q-vector + for (int tower = 0; tower < 8; tower++) { + int side = (tower > 3) ? 1 : 0; + int sector = tower % 4; + double energy = std::pow(e[tower], alphaZDC); + sumZN[side] += energy; + xEnZN[side] += (side == 0) ? ZDC_px[sector] * energy : -1.0 * ZDC_px[sector] * energy; + yEnZN[side] += ZDC_py[sector] * energy; + } + + // "QXA", "QYA", "QXC", "QYC" + for (int i = 0; i < 2; ++i) { + if (sumZN[i] > 0) { + q[0][0][i * 2] = xEnZN[i] / sumZN[i]; // for QXA[0] and QXC[2] + q[0][0][i * 2 + 1] = yEnZN[i] / sumZN[i]; // for QYA[1] and QYC[3] + } + } + + if (cal.calibfilesLoaded[0][1]) { + if(counter<1) LOGF(info, "=====================> Setting v to vmean!"); + v[0] = v[0] - getCorrection(0, 1, vnames[0].Data()); + v[1] = v[1] - getCorrection(0, 1, vnames[1].Data()); + } + + for (int iteration = 1; iteration < 5; iteration++) { + std::vector ccdb_dirs; + if (iteration == 1) + ccdb_dirs = cfgRec1.value; + if (iteration == 2) + ccdb_dirs = cfgRec2.value; + if (iteration == 3) + ccdb_dirs = cfgRec3.value; + if (iteration == 4) + ccdb_dirs = cfgRec4.value; + + for (int step = 0; step < 5; step++) { + loadCalibrations(iteration, step, foundBC.timestamp(), (ccdb_dirs)[step], names[step]); + } + } + + if (cal.atIteration == 0) { + if (counter < 1) + LOGF(warning, "Calibation files missing!!! Output created with q-vectors right after energy gain eq. !!"); + fillAllRegistries(0, 0); + SPtableZDC(runnumber, centrality, v[0], v[1], v[2], q[0][0][0], q[0][0][1], q[0][0][2], q[0][0][3], 0, 0); + counter++; + return; + } else { + for (int iteration = 1; iteration <= cal.atIteration; iteration++) { + for (int step = 0; step < cal.atStep+1; step++) { + if (cal.calibfilesLoaded[iteration][step]) { + for (int i = 0; i < 4; i++) { + if (step == 0) { + if (iteration == 1){ + q[iteration][step+1][i] = q[0][0][i] - getCorrection(iteration, step, names[step][i].Data()); + } else { + q[iteration][step+1][i] = q[iteration - 1][5][i] - getCorrection(iteration, step, names[step][i].Data()); + } + } else { + q[iteration][step+1][i] = q[iteration][step][i] - getCorrection(iteration, step, names[step][i].Data()); + } + } + } else { + if (counter < 1) + LOGF(warning, "Something went wrong in calibration loop! File not loaded but bool set to tue"); + } // end of (cal.calibLoaded) + }// end of step + } // end of iteration + + if (counter < 1) + LOGF(warning, "Calibation files missing!!! Output created with q-vectors at iteration %i and step %i!!!!", cal.atIteration, cal.atStep+1); + fillAllRegistries(cal.atIteration, cal.atStep+1); + SPtableZDC(runnumber, centrality, v[0], v[1], v[2], q[cal.atIteration][cal.atStep][0], q[cal.atIteration][cal.atStep][1], q[cal.atIteration][cal.atStep][2], q[cal.atIteration][cal.atStep][3], cal.atIteration, cal.atStep); + counter++; + return; + } + } // end of cal.calibfilesLoaded[0] + + } // end collision found ZDC + counter++; + } // end of process +}; + + WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) + { + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; + } From d2d82ea59e2409aa9b9da28c2e81c983b22c4ce9 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 24 Oct 2024 13:37:48 +0000 Subject: [PATCH 2/6] Please consider the following formatting changes --- PWGCF/DataModel/SPTableZDC.h | 10 +- PWGCF/Flow/Tasks/flowSPZDC.cxx | 192 ++++++++++++++++----------------- 2 files changed, 100 insertions(+), 102 deletions(-) diff --git a/PWGCF/DataModel/SPTableZDC.h b/PWGCF/DataModel/SPTableZDC.h index 86781d40248..dcf2ce02ebf 100644 --- a/PWGCF/DataModel/SPTableZDC.h +++ b/PWGCF/DataModel/SPTableZDC.h @@ -11,7 +11,6 @@ /// \file SPTableZDC.h - #ifndef PWGCF_DATAMODEL_SPTABLEZDC_H_ #define PWGCF_DATAMODEL_SPTABLEZDC_H_ @@ -35,11 +34,11 @@ DECLARE_SOA_COLUMN(QXA, qxA, float); DECLARE_SOA_COLUMN(QXC, qxC, float); DECLARE_SOA_COLUMN(QYA, qyA, float); DECLARE_SOA_COLUMN(QYC, qyC, float); -// keep track of where we are in steps and iterations. +// keep track of where we are in steps and iterations. DECLARE_SOA_COLUMN(Iteration, iteration, int); DECLARE_SOA_COLUMN(Step, step, int); -} // namespace sptable +} // namespace sptablezdc DECLARE_SOA_TABLE(SPTableZDC, "AOD", "SPCALCOLS", sptablezdc::Runnumber, @@ -52,7 +51,6 @@ DECLARE_SOA_TABLE(SPTableZDC, "AOD", "SPCALCOLS", sptablezdc::QYA, sptablezdc::QYC, sptablezdc::Iteration, - sptablezdc::Step - ); + sptablezdc::Step); } // namespace o2::aod -#endif // PWGCF_DATAMODEL_SPTABLE_H_ \ No newline at end of file +#endif // PWGCF_DATAMODEL_SPTABLE_H_ diff --git a/PWGCF/Flow/Tasks/flowSPZDC.cxx b/PWGCF/Flow/Tasks/flowSPZDC.cxx index e5379fd52c2..6d30f398db5 100644 --- a/PWGCF/Flow/Tasks/flowSPZDC.cxx +++ b/PWGCF/Flow/Tasks/flowSPZDC.cxx @@ -70,12 +70,12 @@ namespace o2::analysis::qvectortask int counter = 0; // step0 -> Energy calib -std::shared_ptr ZN_Energy[10] = {{nullptr}}; -std::shared_ptr hQx_vs_Qy[6] = {{nullptr}}; +std::shared_ptr ZN_Energy[10] = {{nullptr}}; +std::shared_ptr hQx_vs_Qy[6] = {{nullptr}}; -// and -std::shared_ptr COORD_correlations[6][4] = {{nullptr}}; -std::vector hZN_mean(10, nullptr); // Get from calibration file +// and +std::shared_ptr COORD_correlations[6][4] = {{nullptr}}; +std::vector hZN_mean(10, nullptr); // Get from calibration file // step1: 4D large bins std::vector mean_10perCent_v(4, nullptr); // hQXA, hQYA, hQXC, hQYC @@ -139,10 +139,10 @@ struct ZDCqvectors { O2_DEFINE_CONFIGURABLE(cfgMagField, float, 99999, "Configurable magnetic field; default CCDB will be queried") O2_DEFINE_CONFIGURABLE(cfgEnergyCal, std::string, "", "ccdb path for energy calibration histos") O2_DEFINE_CONFIGURABLE(cfgMeanv, std::string, "", "ccdb path for mean v histos") - Configurable> cfgRec1{"cfgRec1", {"", "", "", "",""}, "ccdb paths for recentering calibration histos iteration 1"}; - Configurable> cfgRec2{"cfgRec2", {"", "", "", "",""}, "ccdb paths for recentering calibration histos iteration 2"}; - Configurable> cfgRec3{"cfgRec3", {"", "", "", "",""}, "ccdb paths for recentering calibration histos iteration 3"}; - Configurable> cfgRec4{"cfgRec4", {"", "", "", "",""}, "ccdb paths for recentering calibration histos iteration 4"}; + Configurable> cfgRec1{"cfgRec1", {"", "", "", "", ""}, "ccdb paths for recentering calibration histos iteration 1"}; + Configurable> cfgRec2{"cfgRec2", {"", "", "", "", ""}, "ccdb paths for recentering calibration histos iteration 2"}; + Configurable> cfgRec3{"cfgRec3", {"", "", "", "", ""}, "ccdb paths for recentering calibration histos iteration 3"}; + Configurable> cfgRec4{"cfgRec4", {"", "", "", "", ""}, "ccdb paths for recentering calibration histos iteration 4"}; // Define output HistogramRegistry registry{"Registry"}; @@ -171,7 +171,7 @@ struct ZDCqvectors { std::vector sides = {"A", "C"}; std::vector coords = {"x", "y", "z"}; - std::vector COORDS = {"X", "Y"}; + std::vector COORDS = {"X", "Y"}; // Tower mean energies vs. centrality used for tower gain equalisation for (int tower = 0; tower < 10; tower++) { @@ -205,7 +205,8 @@ struct ZDCqvectors { if (step == 1 || step == 5) { TString name = TString::Format("hQ%s%s_mean_Cent_V_run", coord, side); registry.add(Form("step%i/%s", step, name.Data()), Form("hQ%s%s_mean_Cent_V_run", coord, side), {HistType::kTHnSparseD, {axisRun, axisCent10, axisVx_big, axisVy_big, axisVz_big, axisQ}}); - if(step==1) names[step - 1].push_back(name); + if (step == 1) + names[step - 1].push_back(name); } if (step == 2) { TString name = TString::Format("hQ%s%s_mean_1percent_run", coord, side); @@ -231,27 +232,25 @@ struct ZDCqvectors { } // end of sides } // end of sum over steps - - // recentered q-vectors (to check what steps are finished in the end) registry.add("hStep", "hStep", {HistType::kTH1D, {{10, 0., 10.}}}); registry.add("hIteration", "hIteration", {HistType::kTH1D, {{10, 0., 10.}}}); - // histos with mean v(x/y) per run. + // histos with mean v(x/y) per run. registry.add("vmean/hvertex_vx", "hvertex_vx", kTProfile, {{1, 0., 1.}}, "s"); registry.add("vmean/hvertex_vy", "hvertex_vy", kTProfile, {{1, 0., 1.}}, "s"); } inline void fillRegistry(int iteration, int step) { - if (step == 0 && iteration == 1) { - registry.fill(HIST("hIteration"), iteration, 1); - - registry.fill(HIST("step1/hQXA_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[0][step][0]); - registry.fill(HIST("step1/hQYA_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[0][step][1]); - registry.fill(HIST("step1/hQXC_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[0][step][2]); - registry.fill(HIST("step1/hQYC_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[0][step][3]); - registry.fill(HIST("hStep"), step, 1); + if (step == 0 && iteration == 1) { + registry.fill(HIST("hIteration"), iteration, 1); + + registry.fill(HIST("step1/hQXA_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[0][step][0]); + registry.fill(HIST("step1/hQYA_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[0][step][1]); + registry.fill(HIST("step1/hQXC_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[0][step][2]); + registry.fill(HIST("step1/hQYC_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[0][step][3]); + registry.fill(HIST("hStep"), step, 1); } if (step == 1) { @@ -286,7 +285,7 @@ struct ZDCqvectors { registry.fill(HIST("hStep"), step, 1); } - if (step==5){ + if (step == 5) { registry.fill(HIST("step5/hQXA_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[iteration][step][0]); registry.fill(HIST("step5/hQYA_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[iteration][step][1]); registry.fill(HIST("step5/hQXC_mean_Cent_V_run"), runnumber, centrality, v[0], v[1], v[2], q[iteration][step][2]); @@ -295,42 +294,43 @@ struct ZDCqvectors { } } - inline void fillCommonRegistry(int iteration){ - //loop for filling multiple histograms with different naming patterns - // Always fill the uncentered "raw" Q-vector histos! - - registry.fill(HIST("step0/hZNA_Qx_vs_Qy"), q[0][0][0], q[0][0][1]); - registry.fill(HIST("step0/hZNC_Qx_vs_Qy"), q[0][0][2], q[0][0][3]); - - registry.fill(HIST("step0/QA/hQXA_QXC_vs_cent"), centrality, q[0][0][0] * q[0][0][2]); - registry.fill(HIST("step0/QA/hQYA_QYC_vs_cent"), centrality, q[0][0][1] * q[0][0][3]); - registry.fill(HIST("step0/QA/hQYA_QXC_vs_cent"), centrality, q[0][0][1] * q[0][0][2]); - registry.fill(HIST("step0/QA/hQXA_QYC_vs_cent"), centrality, q[0][0][0] * q[0][0][3]); - - registry.fill(HIST("step0/QA/hQXA_vs_cent"), centrality, q[0][0][0]); - registry.fill(HIST("step0/QA/hQYA_vs_cent"), centrality, q[0][0][1]); - registry.fill(HIST("step0/QA/hQXC_vs_cent"), centrality, q[0][0][2]); - registry.fill(HIST("step0/QA/hQYC_vs_cent"), centrality, q[0][0][3]); - - registry.fill(HIST("step0/QA/hQXA_vs_vx"), v[0], q[0][0][0]); - registry.fill(HIST("step0/QA/hQYA_vs_vx"), v[0], q[0][0][1]); - registry.fill(HIST("step0/QA/hQXC_vs_vx"), v[0], q[0][0][2]); - registry.fill(HIST("step0/QA/hQYC_vs_vx"), v[0], q[0][0][3]); - - registry.fill(HIST("step0/QA/hQXA_vs_vy"), v[1], q[0][0][0]); - registry.fill(HIST("step0/QA/hQYA_vs_vy"), v[1], q[0][0][1]); - registry.fill(HIST("step0/QA/hQXC_vs_vy"), v[1], q[0][0][2]); - registry.fill(HIST("step0/QA/hQYC_vs_vy"), v[1], q[0][0][3]); - - registry.fill(HIST("step0/QA/hQXA_vs_vz"), v[2], q[0][0][0]); - registry.fill(HIST("step0/QA/hQYA_vs_vz"), v[2], q[0][0][1]); - registry.fill(HIST("step0/QA/hQXC_vs_vz"), v[2], q[0][0][2]); - registry.fill(HIST("step0/QA/hQYC_vs_vz"), v[2], q[0][0][3]); - - static constexpr std::string_view subdir[] = {"step1/", "step2/", "step3/", "step4/","step5/"}; + inline void fillCommonRegistry(int iteration) + { + // loop for filling multiple histograms with different naming patterns + // Always fill the uncentered "raw" Q-vector histos! + + registry.fill(HIST("step0/hZNA_Qx_vs_Qy"), q[0][0][0], q[0][0][1]); + registry.fill(HIST("step0/hZNC_Qx_vs_Qy"), q[0][0][2], q[0][0][3]); + + registry.fill(HIST("step0/QA/hQXA_QXC_vs_cent"), centrality, q[0][0][0] * q[0][0][2]); + registry.fill(HIST("step0/QA/hQYA_QYC_vs_cent"), centrality, q[0][0][1] * q[0][0][3]); + registry.fill(HIST("step0/QA/hQYA_QXC_vs_cent"), centrality, q[0][0][1] * q[0][0][2]); + registry.fill(HIST("step0/QA/hQXA_QYC_vs_cent"), centrality, q[0][0][0] * q[0][0][3]); + + registry.fill(HIST("step0/QA/hQXA_vs_cent"), centrality, q[0][0][0]); + registry.fill(HIST("step0/QA/hQYA_vs_cent"), centrality, q[0][0][1]); + registry.fill(HIST("step0/QA/hQXC_vs_cent"), centrality, q[0][0][2]); + registry.fill(HIST("step0/QA/hQYC_vs_cent"), centrality, q[0][0][3]); + + registry.fill(HIST("step0/QA/hQXA_vs_vx"), v[0], q[0][0][0]); + registry.fill(HIST("step0/QA/hQYA_vs_vx"), v[0], q[0][0][1]); + registry.fill(HIST("step0/QA/hQXC_vs_vx"), v[0], q[0][0][2]); + registry.fill(HIST("step0/QA/hQYC_vs_vx"), v[0], q[0][0][3]); + + registry.fill(HIST("step0/QA/hQXA_vs_vy"), v[1], q[0][0][0]); + registry.fill(HIST("step0/QA/hQYA_vs_vy"), v[1], q[0][0][1]); + registry.fill(HIST("step0/QA/hQXC_vs_vy"), v[1], q[0][0][2]); + registry.fill(HIST("step0/QA/hQYC_vs_vy"), v[1], q[0][0][3]); + + registry.fill(HIST("step0/QA/hQXA_vs_vz"), v[2], q[0][0][0]); + registry.fill(HIST("step0/QA/hQYA_vs_vz"), v[2], q[0][0][1]); + registry.fill(HIST("step0/QA/hQXC_vs_vz"), v[2], q[0][0][2]); + registry.fill(HIST("step0/QA/hQYC_vs_vz"), v[2], q[0][0][3]); + + static constexpr std::string_view subdir[] = {"step1/", "step2/", "step3/", "step4/", "step5/"}; static_for<0, 4>([&](auto ind) { - constexpr int index = ind.value; - int index_rt = index + 1; + constexpr int index = ind.value; + int index_rt = index + 1; registry.fill(HIST(subdir[index]) + HIST("hZNA_Qx_vs_Qy"), q[iteration][index_rt][0], q[iteration][index_rt][1]); registry.fill(HIST(subdir[index]) + HIST("hZNC_Qx_vs_Qy"), q[iteration][index_rt][2], q[iteration][index_rt][3]); @@ -362,7 +362,6 @@ struct ZDCqvectors { }); } - void loadCalibrations(int iteration, int step, uint64_t timestamp, std::string ccdb_dir, std::vector names) { // iteration = 0 (Energy calibration) -> step 0 only @@ -423,7 +422,7 @@ struct ZDCqvectors { return; } if (counter < 1) - LOGF(info, "<--------OK----------> Calibrations loaded for iteration %i and step %i", iteration, step+1); + LOGF(info, "<--------OK----------> Calibrations loaded for iteration %i and step %i", iteration, step + 1); cal.calibfilesLoaded[iteration][step] = true; cal.atIteration = iteration; cal.atStep = step; @@ -431,7 +430,7 @@ struct ZDCqvectors { } // end of ccdb_dir.empty() else { if (counter < 1) - LOGF(info, "<--------X-----------> Calibrations not loaded for iteration %i and step %i cfg = empty!", iteration, step+1); + LOGF(info, "<--------X-----------> Calibrations not loaded for iteration %i and step %i cfg = empty!", iteration, step + 1); } } @@ -448,25 +447,25 @@ struct ZDCqvectors { if (hist->InheritsFrom("TProfile2D")) { if (counter < 1) - LOGF(info, "correction is TProfile2D %s for q[%i][%i]", objName, iteration,step); + LOGF(info, "correction is TProfile2D %s for q[%i][%i]", objName, iteration, step); TProfile2D* h = (TProfile2D*)hist; int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%i", runnumber)); int bincentrality = h->GetYaxis()->FindBin(centrality); calibConstant = h->GetBinContent(binrunnumber, bincentrality); } else if (hist->InheritsFrom("TProfile")) { if (counter < 1) - LOGF(info, "correction is TProfile %s for q[%i][%i]", objName, iteration,step); + LOGF(info, "correction is TProfile %s for q[%i][%i]", objName, iteration, step); TProfile* h = (TProfile*)hist; int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%i", runnumber)); calibConstant = h->GetBinContent(binrunnumber); } else if (hist->InheritsFrom("THnSparse")) { if (counter < 1) - LOGF(info, "correction is THnSparse %s for q[%i][%i]", objName, iteration,step); + LOGF(info, "correction is THnSparse %s for q[%i][%i]", objName, iteration, step); std::vector sparsePars; if (counter < 1) - LOGF(info, "correction is THnSparse %s for q[%i][%i]", objName, iteration,step); + LOGF(info, "correction is THnSparse %s for q[%i][%i]", objName, iteration, step); THnSparseD* h = (THnSparseD*)hist; - if (step==0 && iteration>0) { + if (step == 0 && iteration > 0) { sparsePars.push_back(h->GetAxis(0)->FindBin(runnumber)); sparsePars.push_back(h->GetAxis(1)->FindBin(centrality)); sparsePars.push_back(h->GetAxis(2)->FindBin(v[0])); @@ -478,9 +477,9 @@ struct ZDCqvectors { } calibConstant = h->Projection(sparsePars.size())->GetMean(); - if(h->Projection(sparsePars.size())->GetEntries() < 2) { - LOGF(debug, "1 entry in sparse bin! Not used... (increase binsize)"); - calibConstant = 0; + if (h->Projection(sparsePars.size())->GetEntries() < 2) { + LOGF(debug, "1 entry in sparse bin! Not used... (increase binsize)"); + calibConstant = 0; } } return calibConstant; @@ -488,9 +487,9 @@ struct ZDCqvectors { void fillAllRegistries(int iteration, int step) { - for (int s = 0; s <= step; s++) - fillRegistry(iteration, s); - fillCommonRegistry(iteration); + for (int s = 0; s <= step; s++) + fillRegistry(iteration, s); + fillCommonRegistry(iteration); } void process(myCollisions::iterator const& collision, @@ -527,7 +526,7 @@ struct ZDCqvectors { // load the calibration histos for iteration 0 step 0 (Energy Calibration) loadCalibrations(0, 0, foundBC.timestamp(), cfgEnergyCal, names_Ecal); - if (!cal.calibfilesLoaded[0][0]) { + if (!cal.calibfilesLoaded[0][0]) { if (counter < 1) { LOGF(info, " --> No Energy calibration files found.. -> Only Energy calibration will be done. "); } @@ -627,7 +626,8 @@ struct ZDCqvectors { } if (cal.calibfilesLoaded[0][1]) { - if(counter<1) LOGF(info, "=====================> Setting v to vmean!"); + if (counter < 1) + LOGF(info, "=====================> Setting v to vmean!"); v[0] = v[0] - getCorrection(0, 1, vnames[0].Data()); v[1] = v[1] - getCorrection(0, 1, vnames[1].Data()); } @@ -657,42 +657,42 @@ struct ZDCqvectors { return; } else { for (int iteration = 1; iteration <= cal.atIteration; iteration++) { - for (int step = 0; step < cal.atStep+1; step++) { + for (int step = 0; step < cal.atStep + 1; step++) { if (cal.calibfilesLoaded[iteration][step]) { for (int i = 0; i < 4; i++) { if (step == 0) { - if (iteration == 1){ - q[iteration][step+1][i] = q[0][0][i] - getCorrection(iteration, step, names[step][i].Data()); + if (iteration == 1) { + q[iteration][step + 1][i] = q[0][0][i] - getCorrection(iteration, step, names[step][i].Data()); } else { - q[iteration][step+1][i] = q[iteration - 1][5][i] - getCorrection(iteration, step, names[step][i].Data()); + q[iteration][step + 1][i] = q[iteration - 1][5][i] - getCorrection(iteration, step, names[step][i].Data()); } } else { - q[iteration][step+1][i] = q[iteration][step][i] - getCorrection(iteration, step, names[step][i].Data()); + q[iteration][step + 1][i] = q[iteration][step][i] - getCorrection(iteration, step, names[step][i].Data()); } } } else { if (counter < 1) LOGF(warning, "Something went wrong in calibration loop! File not loaded but bool set to tue"); } // end of (cal.calibLoaded) - }// end of step + } // end of step } // end of iteration - if (counter < 1) - LOGF(warning, "Calibation files missing!!! Output created with q-vectors at iteration %i and step %i!!!!", cal.atIteration, cal.atStep+1); - fillAllRegistries(cal.atIteration, cal.atStep+1); - SPtableZDC(runnumber, centrality, v[0], v[1], v[2], q[cal.atIteration][cal.atStep][0], q[cal.atIteration][cal.atStep][1], q[cal.atIteration][cal.atStep][2], q[cal.atIteration][cal.atStep][3], cal.atIteration, cal.atStep); - counter++; - return; - } - } // end of cal.calibfilesLoaded[0] + if (counter < 1) + LOGF(warning, "Calibation files missing!!! Output created with q-vectors at iteration %i and step %i!!!!", cal.atIteration, cal.atStep + 1); + fillAllRegistries(cal.atIteration, cal.atStep + 1); + SPtableZDC(runnumber, centrality, v[0], v[1], v[2], q[cal.atIteration][cal.atStep][0], q[cal.atIteration][cal.atStep][1], q[cal.atIteration][cal.atStep][2], q[cal.atIteration][cal.atStep][3], cal.atIteration, cal.atStep); + counter++; + return; + } + } // end of cal.calibfilesLoaded[0] - } // end collision found ZDC - counter++; - } // end of process + } // end collision found ZDC + counter++; + } // end of process }; - WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) - { - return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; - } +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From a9951baa530b7f79dd0a20cff0cb10278f9d296e Mon Sep 17 00:00:00 2001 From: cnkoster Date: Thu, 24 Oct 2024 15:58:58 +0200 Subject: [PATCH 3/6] add changes megalinter --- PWGCF/DataModel/SPTableZDC.h | 4 ++-- PWGCF/Flow/Tasks/flowSPZDC.cxx | 35 ++++++++++++++-------------------- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/PWGCF/DataModel/SPTableZDC.h b/PWGCF/DataModel/SPTableZDC.h index dcf2ce02ebf..f5495f7f0fe 100644 --- a/PWGCF/DataModel/SPTableZDC.h +++ b/PWGCF/DataModel/SPTableZDC.h @@ -40,7 +40,7 @@ DECLARE_SOA_COLUMN(Step, step, int); } // namespace sptablezdc -DECLARE_SOA_TABLE(SPTableZDC, "AOD", "SPCALCOLS", +DECLARE_SOA_TABLE(SPTableZDC, "AOD", "SPZDC", sptablezdc::Runnumber, sptablezdc::Cent, sptablezdc::Vx, @@ -53,4 +53,4 @@ DECLARE_SOA_TABLE(SPTableZDC, "AOD", "SPCALCOLS", sptablezdc::Iteration, sptablezdc::Step); } // namespace o2::aod -#endif // PWGCF_DATAMODEL_SPTABLE_H_ +#endif // PWGCF_DATAMODEL_SPTABLEZDC_H_ \ No newline at end of file diff --git a/PWGCF/Flow/Tasks/flowSPZDC.cxx b/PWGCF/Flow/Tasks/flowSPZDC.cxx index 6d30f398db5..84df7e78c06 100644 --- a/PWGCF/Flow/Tasks/flowSPZDC.cxx +++ b/PWGCF/Flow/Tasks/flowSPZDC.cxx @@ -11,12 +11,13 @@ // In this task the energy calibration and recentring of Q-vectors constructed in the ZDCs will be done +#include #include #include #include #include -#include #include +#include #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" @@ -34,12 +35,10 @@ #include "Framework/RunningWorkflowInfo.h" #include "Framework/StaticFor.h" -#include "CCDB/BasicCCDBManager.h" #include "DataFormatsParameters/GRPObject.h" #include "DataFormatsParameters/GRPMagField.h" #include "ReconstructionDataFormats/GlobalTrackID.h" #include "ReconstructionDataFormats/Track.h" - #include "PWGCF/DataModel/SPTableZDC.h" #include "TH1F.h" @@ -389,9 +388,7 @@ struct ZDCqvectors { } if (counter < 1) LOGF(info, "Loaded TProfile: %s", names[i].Data()); - } - // Try to cast to TProfile2D - else if (TProfile2D* profile2D = dynamic_cast(obj)) { + } else if (TProfile2D* profile2D = dynamic_cast(obj)) { if (profile2D->GetEntries() < 1) { if (counter < 1) LOGF(info, "%s (TProfile2D) is empty! Produce calibration file at given step", names[i].Data()); @@ -400,9 +397,7 @@ struct ZDCqvectors { } if (counter < 1) LOGF(info, "Loaded TProfile2D: %s", names[i].Data()); - } - // Try to cast to THnSparse - else if (THnSparse* sparse = dynamic_cast(obj)) { + } else if (THnSparse* sparse = dynamic_cast(obj)) { if (sparse->GetEntries() < 1) { if (counter < 1) LOGF(info, "%s (THnSparse) is empty! Produce calibration file at given step", names[i].Data()); @@ -413,8 +408,7 @@ struct ZDCqvectors { LOGF(info, "Loaded THnSparse: %s", names[i].Data()); } } // end of for loop - } // end of if (cal.calib[iteration][step]) - else { + } else { // when (cal.calib[iteration][step])=false! if (counter < 1) LOGF(warning, "Could not load TList with calibration histos from %s", ccdb_dir.c_str()); @@ -427,8 +421,7 @@ struct ZDCqvectors { cal.atIteration = iteration; cal.atStep = step; return; - } // end of ccdb_dir.empty() - else { + } else { if (counter < 1) LOGF(info, "<--------X-----------> Calibrations not loaded for iteration %i and step %i cfg = empty!", iteration, step + 1); } @@ -440,22 +433,22 @@ struct ZDCqvectors { T* hist = nullptr; double calibConstant; - hist = (T*)cal.calibList[iteration][step]->FindObject(Form("%s", objName)); + hist = reinterpret_cast(cal.calibList[iteration][step]->FindObject(Form("%s", objName))); if (!hist) { LOGF(fatal, "%s not available.. Abort..", objName); } if (hist->InheritsFrom("TProfile2D")) { if (counter < 1) - LOGF(info, "correction is TProfile2D %s for q[%i][%i]", objName, iteration, step); - TProfile2D* h = (TProfile2D*)hist; + LOGF(info, "correction is TProfile2D %s for q[%i][%i]", objName, iteration,step); + TProfile2D* h = reinterpret_cast(hist); int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%i", runnumber)); int bincentrality = h->GetYaxis()->FindBin(centrality); calibConstant = h->GetBinContent(binrunnumber, bincentrality); } else if (hist->InheritsFrom("TProfile")) { if (counter < 1) - LOGF(info, "correction is TProfile %s for q[%i][%i]", objName, iteration, step); - TProfile* h = (TProfile*)hist; + LOGF(info, "correction is TProfile %s for q[%i][%i]", objName, iteration,step); + TProfile* h = reinterpret_cast(hist); int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%i", runnumber)); calibConstant = h->GetBinContent(binrunnumber); } else if (hist->InheritsFrom("THnSparse")) { @@ -463,9 +456,9 @@ struct ZDCqvectors { LOGF(info, "correction is THnSparse %s for q[%i][%i]", objName, iteration, step); std::vector sparsePars; if (counter < 1) - LOGF(info, "correction is THnSparse %s for q[%i][%i]", objName, iteration, step); - THnSparseD* h = (THnSparseD*)hist; - if (step == 0 && iteration > 0) { + LOGF(info, "correction is THnSparse %s for q[%i][%i]", objName, iteration,step); + THnSparseD* h = reinterpret_cast(hist); + if (step==0 && iteration>0) { sparsePars.push_back(h->GetAxis(0)->FindBin(runnumber)); sparsePars.push_back(h->GetAxis(1)->FindBin(centrality)); sparsePars.push_back(h->GetAxis(2)->FindBin(v[0])); From 6db7cef8b5e857ddc0558fbc17da6513a6e71d33 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 24 Oct 2024 14:06:12 +0000 Subject: [PATCH 4/6] Please consider the following formatting changes --- PWGCF/DataModel/SPTableZDC.h | 2 +- PWGCF/Flow/Tasks/flowSPZDC.cxx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PWGCF/DataModel/SPTableZDC.h b/PWGCF/DataModel/SPTableZDC.h index f5495f7f0fe..bd8995e2131 100644 --- a/PWGCF/DataModel/SPTableZDC.h +++ b/PWGCF/DataModel/SPTableZDC.h @@ -53,4 +53,4 @@ DECLARE_SOA_TABLE(SPTableZDC, "AOD", "SPZDC", sptablezdc::Iteration, sptablezdc::Step); } // namespace o2::aod -#endif // PWGCF_DATAMODEL_SPTABLEZDC_H_ \ No newline at end of file +#endif // PWGCF_DATAMODEL_SPTABLEZDC_H_ diff --git a/PWGCF/Flow/Tasks/flowSPZDC.cxx b/PWGCF/Flow/Tasks/flowSPZDC.cxx index 84df7e78c06..c78855bdcd1 100644 --- a/PWGCF/Flow/Tasks/flowSPZDC.cxx +++ b/PWGCF/Flow/Tasks/flowSPZDC.cxx @@ -440,14 +440,14 @@ struct ZDCqvectors { if (hist->InheritsFrom("TProfile2D")) { if (counter < 1) - LOGF(info, "correction is TProfile2D %s for q[%i][%i]", objName, iteration,step); + LOGF(info, "correction is TProfile2D %s for q[%i][%i]", objName, iteration, step); TProfile2D* h = reinterpret_cast(hist); int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%i", runnumber)); int bincentrality = h->GetYaxis()->FindBin(centrality); calibConstant = h->GetBinContent(binrunnumber, bincentrality); } else if (hist->InheritsFrom("TProfile")) { if (counter < 1) - LOGF(info, "correction is TProfile %s for q[%i][%i]", objName, iteration,step); + LOGF(info, "correction is TProfile %s for q[%i][%i]", objName, iteration, step); TProfile* h = reinterpret_cast(hist); int binrunnumber = h->GetXaxis()->FindBin(TString::Format("%i", runnumber)); calibConstant = h->GetBinContent(binrunnumber); @@ -456,9 +456,9 @@ struct ZDCqvectors { LOGF(info, "correction is THnSparse %s for q[%i][%i]", objName, iteration, step); std::vector sparsePars; if (counter < 1) - LOGF(info, "correction is THnSparse %s for q[%i][%i]", objName, iteration,step); + LOGF(info, "correction is THnSparse %s for q[%i][%i]", objName, iteration, step); THnSparseD* h = reinterpret_cast(hist); - if (step==0 && iteration>0) { + if (step == 0 && iteration > 0) { sparsePars.push_back(h->GetAxis(0)->FindBin(runnumber)); sparsePars.push_back(h->GetAxis(1)->FindBin(centrality)); sparsePars.push_back(h->GetAxis(2)->FindBin(v[0])); From 80d6faa8e9d06e6c3b2b40c3bab47a94478c3db6 Mon Sep 17 00:00:00 2001 From: cnkoster Date: Thu, 24 Oct 2024 16:15:59 +0200 Subject: [PATCH 5/6] changed order #include --- PWGCF/Flow/Tasks/flowSPZDC.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/PWGCF/Flow/Tasks/flowSPZDC.cxx b/PWGCF/Flow/Tasks/flowSPZDC.cxx index c78855bdcd1..bdff2c23139 100644 --- a/PWGCF/Flow/Tasks/flowSPZDC.cxx +++ b/PWGCF/Flow/Tasks/flowSPZDC.cxx @@ -11,14 +11,15 @@ // In this task the energy calibration and recentring of Q-vectors constructed in the ZDCs will be done -#include + +#include #include #include #include #include #include -#include +#include "CCDB/BasicCCDBManager.h" #include "Common/CCDB/EventSelectionParams.h" #include "Common/CCDB/TriggerAliases.h" #include "Common/Core/TrackSelection.h" From c7a2e5ec3f120538541a73f3e5ccb04db7200f67 Mon Sep 17 00:00:00 2001 From: cnkoster Date: Thu, 24 Oct 2024 16:25:47 +0200 Subject: [PATCH 6/6] added cast --- PWGCF/Flow/Tasks/flowSPZDC.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PWGCF/Flow/Tasks/flowSPZDC.cxx b/PWGCF/Flow/Tasks/flowSPZDC.cxx index bdff2c23139..3ef85353b47 100644 --- a/PWGCF/Flow/Tasks/flowSPZDC.cxx +++ b/PWGCF/Flow/Tasks/flowSPZDC.cxx @@ -11,7 +11,6 @@ // In this task the energy calibration and recentring of Q-vectors constructed in the ZDCs will be done - #include #include #include @@ -372,7 +371,7 @@ struct ZDCqvectors { if (cal.calibList[iteration][step]) { for (int i = 0; i < names.size(); i++) { - TObject* obj = (TObject*)cal.calibList[iteration][step]->FindObject(Form("%s", names[i].Data())); + TObject* obj = reinterpret_cast(cal.calibList[iteration][step]->FindObject(Form("%s", names[i].Data()))); if (!obj) { if (counter < 1) { LOGF(error, "Object %s not found!!", names[i].Data());