From beb2ddeef35fcd302db8371ce613ebd6aee26a64 Mon Sep 17 00:00:00 2001 From: Prottay Das Date: Sun, 14 Dec 2025 12:28:42 +0100 Subject: [PATCH 1/5] simplified derived data model with task to speed up the calibration of zdc --- PWGLF/DataModel/ZDCCalTables.h | 68 +++ PWGLF/TableProducer/Common/CMakeLists.txt | 5 + PWGLF/TableProducer/Common/zdcvector.cxx | 331 +++++++++++ PWGLF/Tasks/Strangeness/CMakeLists.txt | 5 + PWGLF/Tasks/Strangeness/zdccalderived.cxx | 649 ++++++++++++++++++++++ 5 files changed, 1058 insertions(+) create mode 100644 PWGLF/DataModel/ZDCCalTables.h create mode 100644 PWGLF/TableProducer/Common/zdcvector.cxx create mode 100644 PWGLF/Tasks/Strangeness/zdccalderived.cxx diff --git a/PWGLF/DataModel/ZDCCalTables.h b/PWGLF/DataModel/ZDCCalTables.h new file mode 100644 index 00000000000..7313a049366 --- /dev/null +++ b/PWGLF/DataModel/ZDCCalTables.h @@ -0,0 +1,68 @@ +// 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 ZDCCalTables.h +/// +/// author: prottay das 07/09/2024 +/// email: prottay.das@cern.ch + +#ifndef PWGLF_DATAMODEL_ZDCCALTABLES_H_ +#define PWGLF_DATAMODEL_ZDCCALTABLES_H_ + +#include "Common/Core/RecoDecay.h" +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include "Framework/AnalysisDataModel.h" + +#include + +namespace o2::aod +{ +namespace zdccaltable +{ +DECLARE_SOA_COLUMN(TriggerEventZDC, triggereventzdc, bool); +DECLARE_SOA_COLUMN(TriggerEventRunNo, triggereventrunno, 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(ZNAC, znaC, float); +DECLARE_SOA_COLUMN(ZNCC, zncC, float); +DECLARE_SOA_COLUMN(ZNAE0, znaE0, float); +DECLARE_SOA_COLUMN(ZNAE1, znaE1, float); +DECLARE_SOA_COLUMN(ZNAE2, znaE2, float); +DECLARE_SOA_COLUMN(ZNAE3, znaE3, float); +DECLARE_SOA_COLUMN(ZNCE0, zncE0, float); +DECLARE_SOA_COLUMN(ZNCE1, zncE1, float); +DECLARE_SOA_COLUMN(ZNCE2, zncE2, float); +DECLARE_SOA_COLUMN(ZNCE3, zncE3, float); +} // namespace zdccaltable +DECLARE_SOA_TABLE(ZDCCalTables, "AOD", "ZDCCALTABLE", + zdccaltable::TriggerEventZDC, + zdccaltable::TriggerEventRunNo, + zdccaltable::Cent, + zdccaltable::Vx, + zdccaltable::Vy, + zdccaltable::Vz, + zdccaltable::ZNAC, + zdccaltable::ZNCC, + zdccaltable::ZNAE0, + zdccaltable::ZNAE1, + zdccaltable::ZNAE2, + zdccaltable::ZNAE3, + zdccaltable::ZNCE0, + zdccaltable::ZNCE1, + zdccaltable::ZNCE2, + zdccaltable::ZNCE3); +using ZDCCalTable = ZDCCalTables::iterator; +} // namespace o2::aod +#endif // PWGLF_DATAMODEL_ZDCCALTABLES_H_ diff --git a/PWGLF/TableProducer/Common/CMakeLists.txt b/PWGLF/TableProducer/Common/CMakeLists.txt index 5f1df4b5202..19a1105dc3a 100644 --- a/PWGLF/TableProducer/Common/CMakeLists.txt +++ b/PWGLF/TableProducer/Common/CMakeLists.txt @@ -20,6 +20,11 @@ o2physics_add_dpl_workflow(spvector PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsVertexing COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(zdcvector + SOURCES zdcvector.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore O2::DetectorsVertexing + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(tpcpid SOURCES lfTPCPID.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore diff --git a/PWGLF/TableProducer/Common/zdcvector.cxx b/PWGLF/TableProducer/Common/zdcvector.cxx new file mode 100644 index 00000000000..32ceb15500b --- /dev/null +++ b/PWGLF/TableProducer/Common/zdcvector.cxx @@ -0,0 +1,331 @@ +// 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. +// +// \author: prottay das 23/12/2024 +// \email: prottay.das@cern.ch + +#include "PWGLF/DataModel/ZDCCalTables.h" + +#include "Common/CCDB/ctpRateFetcher.h" +#include "Common/Core/EventPlaneHelper.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/FT0Corrected.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/Qvectors.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::constants::physics; +using namespace o2::aod::rctsel; + +using BCsRun3 = soa::Join; + +struct zdcvector { + + Produces zdccaltable; + + // Configurables. + struct : ConfigurableGroup { + Configurable cfgURL{"cfgURL", "http://alice-ccdb.cern.ch", "Address of the CCDB to browse"}; + Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "Latest acceptable timestamp of creation for the object"}; + } cfgCcdbParam; + + // Enable access to the CCDB for the offset and correction constants and save them in dedicated variables. + Service ccdb; + o2::ccdb::CcdbApi ccdbApi; + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; + Configurable cfgCutCentralityMax{"cfgCutCentralityMax", 80.0f, "Centrality cut Max"}; + Configurable cfgCutCentralityMin{"cfgCutCentralityMin", 0.0f, "Centrality cut Min"}; + Configurable additionalEvSel{"additionalEvSel", false, "additionalEvSel"}; + Configurable usemem{"usemem", true, "usemem"}; + + struct : ConfigurableGroup { + Configurable VzfineNbins{"VzfineNbins", 20, "Number of bins in Vz fine histograms"}; + Configurable lfinebinVz{"lfinebinVz", -10.0, "lower bin value in Vz fine histograms"}; + Configurable hfinebinVz{"hfinebinVz", 10.0, "higher bin value in Vz fine histograms"}; + Configurable CentfineNbins{"CentfineNbins", 16, "Number of bins in cent fine histograms"}; + Configurable lfinebinCent{"lfinebinCent", 0.0, "lower bin value in cent fine histograms"}; + Configurable hfinebinCent{"hfinebinCent", 80.0, "higher bin value in cent fine histograms"}; + } configbins; + + Configurable followpub{"followpub", true, "flag to use alphaZDC"}; + Configurable useGainCallib{"useGainCallib", false, "use gain calibration"}; + Configurable useCallibvertex{"useCallibvertex", false, "use calibration for vxy"}; + Configurable ConfGainPath{"ConfGainPath", "Users/p/prottay/My/Object/NewPbPbpass4_10092024/gaincallib", "Path to gain calibration"}; + Configurable ConfGainPathvxy{"ConfGainPathvxy", "Users/p/prottay/My/Object/swapcoords/PbPbpass4_20112024/recentervert", "Path to gain calibration for vxy"}; + + struct : ConfigurableGroup { + Configurable requireRCTFlagChecker{"requireRCTFlagChecker", true, "Check event quality in run condition table"}; + Configurable cfgEvtRCTFlagCheckerLabel{"cfgEvtRCTFlagCheckerLabel", "CBT_hadronPID", "Evt sel: RCT flag checker label"}; + Configurable cfgEvtRCTFlagCheckerZDCCheck{"cfgEvtRCTFlagCheckerZDCCheck", true, "Evt sel: RCT flag checker ZDC check"}; + Configurable cfgEvtRCTFlagCheckerLimitAcceptAsBad{"cfgEvtRCTFlagCheckerLimitAcceptAsBad", false, "Evt sel: RCT flag checker treat Limited Acceptance As Bad"}; + } rctCut; + + RCTFlagsChecker rctChecker; + + void init(o2::framework::InitContext&) + { + + rctChecker.init(rctCut.cfgEvtRCTFlagCheckerLabel, rctCut.cfgEvtRCTFlagCheckerZDCCheck, rctCut.cfgEvtRCTFlagCheckerLimitAcceptAsBad); + + AxisSpec channelZDCAxis = {8, 0.0, 8.0, "ZDC tower"}; + AxisSpec vzfineAxis = {configbins.VzfineNbins, configbins.lfinebinVz, configbins.hfinebinVz, "vzfine"}; + AxisSpec centfineAxis = {configbins.CentfineNbins, configbins.lfinebinCent, configbins.hfinebinCent, "V0M (%) fine"}; + AxisSpec VxyAxis = {2, 0, 2, "Vxy"}; + + histos.add("htpcnsigmapi", "htpcnsigmapi", kTH1F, {{50, -10, 10.0}}); + histos.add("hEvtSelInfo", "hEvtSelInfo", kTH1F, {{10, 0, 10.0}}); + histos.add("hCentrality", "hCentrality", kTH1F, {{centfineAxis}}); + histos.add("Vz", "Vz", kTH1F, {vzfineAxis}); + + histos.add("ZDCAmp", "ZDCAmp", kTProfile2D, {channelZDCAxis, vzfineAxis}); + histos.add("ZDCAmpCommon", "ZDCAmpCommon", kTProfile2D, {{2, 0.0, 2.0}, vzfineAxis}); + histos.add("AvgVxy", "AvgVxy", kTProfile, {VxyAxis}); + + ccdb->setURL(cfgCcdbParam.cfgURL); + ccdbApi.init("http://alice-ccdb.cern.ch"); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); + } + + int currentRunNumber = -999; + int lastRunNumber = -999; + TH2D* gainprofile; + TProfile* gainprofilevxy; + + using MyCollisions = soa::Join; + using AllTrackCandidates = soa::Join; + + void process(MyCollisions::iterator const& collision, aod::FT0s const& /*ft0s*/, aod::FV0As const& /*fv0s*/, BCsRun3 const& bcs, aod::Zdcs const&, AllTrackCandidates const& tracks) + { + + if (usemem) { + for (const auto& track : tracks) { + histos.fill(HIST("htpcnsigmapi"), track.tpcNSigmaPi()); + } + } + + histos.fill(HIST("hEvtSelInfo"), 0.5); + auto centrality = collision.centFT0C(); + bool triggerevent = false; + + if (bcs.size() != 0) { + gRandom->SetSeed(bcs.iteratorAt(0).globalBC()); + } + + currentRunNumber = collision.foundBC_as().runNumber(); + auto vz = collision.posZ(); + auto vx = collision.posX(); + auto vy = collision.posY(); + auto qxZDCA = 0.0; + auto qxZDCC = 0.0; + auto qyZDCA = 0.0; + auto qyZDCC = 0.0; + auto sumA = 0.0; + auto sumC = 0.0; + + auto bc = collision.foundBC_as(); + + if (!bc.has_zdc()) { + triggerevent = false; + zdccaltable(triggerevent, currentRunNumber, centrality, vx, vy, vz, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); + return; + } + + histos.fill(HIST("hEvtSelInfo"), 1.5); + + auto zdc = bc.zdc(); + auto zncEnergy = zdc.energySectorZNC(); + auto znaEnergy = zdc.energySectorZNA(); + auto zncEnergycommon = zdc.energyCommonZNC(); + auto znaEnergycommon = zdc.energyCommonZNA(); + + if (znaEnergycommon <= 0.0 || zncEnergycommon <= 0.0) { + triggerevent = false; + zdccaltable(triggerevent, currentRunNumber, centrality, vx, vy, vz, znaEnergycommon, zncEnergycommon, znaEnergy[0], znaEnergy[1], znaEnergy[2], znaEnergy[3], zncEnergy[0], zncEnergy[1], zncEnergy[2], zncEnergy[3]); + return; + } + + histos.fill(HIST("hEvtSelInfo"), 2.5); + + if (znaEnergy[0] <= 0.0 || znaEnergy[1] <= 0.0 || znaEnergy[2] <= 0.0 || znaEnergy[3] <= 0.0) { + triggerevent = false; + zdccaltable(triggerevent, currentRunNumber, centrality, vx, vy, vz, znaEnergycommon, zncEnergycommon, znaEnergy[0], znaEnergy[1], znaEnergy[2], znaEnergy[3], zncEnergy[0], zncEnergy[1], zncEnergy[2], zncEnergy[3]); + return; + } + histos.fill(HIST("hEvtSelInfo"), 3.5); + + if (zncEnergy[0] <= 0.0 || zncEnergy[1] <= 0.0 || zncEnergy[2] <= 0.0 || zncEnergy[3] <= 0.0) { + triggerevent = false; + zdccaltable(triggerevent, currentRunNumber, centrality, vx, vy, vz, znaEnergycommon, zncEnergycommon, znaEnergy[0], znaEnergy[1], znaEnergy[2], znaEnergy[3], zncEnergy[0], zncEnergy[1], zncEnergy[2], zncEnergy[3]); + return; + } + + histos.fill(HIST("hEvtSelInfo"), 4.5); + + if (rctCut.requireRCTFlagChecker && !rctChecker(collision)) { + triggerevent = false; + zdccaltable(triggerevent, currentRunNumber, centrality, vx, vy, vz, znaEnergycommon, zncEnergycommon, znaEnergy[0], znaEnergy[1], znaEnergy[2], znaEnergy[3], zncEnergy[0], zncEnergy[1], zncEnergy[2], zncEnergy[3]); + return; + } + + histos.fill(HIST("hEvtSelInfo"), 5.5); + + if (additionalEvSel && (!collision.selection_bit(aod::evsel::kIsGoodZvtxFT0vsPV))) { + triggerevent = false; + zdccaltable(triggerevent, currentRunNumber, centrality, vx, vy, vz, znaEnergycommon, zncEnergycommon, znaEnergy[0], znaEnergy[1], znaEnergy[2], znaEnergy[3], zncEnergy[0], zncEnergy[1], zncEnergy[2], zncEnergy[3]); + return; + } + + histos.fill(HIST("hEvtSelInfo"), 6.5); + + if (collision.sel8() && centrality > cfgCutCentralityMin && centrality < cfgCutCentralityMax && TMath::Abs(vz) < cfgCutVertex && collision.has_foundFT0() && collision.selection_bit(aod::evsel::kNoTimeFrameBorder) && collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { + triggerevent = true; + if (useGainCallib && (currentRunNumber != lastRunNumber)) { + gainprofile = ccdb->getForTimeStamp(ConfGainPath.value, bc.timestamp()); + } + + histos.fill(HIST("hEvtSelInfo"), 7.5); + + auto gainequal = 1.0; + auto alphaZDC = 0.395; + constexpr double x[4] = {-1.75, 1.75, -1.75, 1.75}; + constexpr double y[4] = {-1.75, -1.75, 1.75, 1.75}; + + histos.fill(HIST("ZDCAmpCommon"), 0.5, vz, znaEnergycommon); + histos.fill(HIST("ZDCAmpCommon"), 1.5, vz, zncEnergycommon); + + for (std::size_t iChA = 0; iChA < 8; iChA++) { + auto chanelid = iChA; + if (useGainCallib && gainprofile) { + gainequal = gainprofile->GetBinContent(gainprofile->FindBin(vz + 0.00001, chanelid + 0.5)); + } + + if (iChA < 4) { + + if (znaEnergy[iChA] <= 0.0) { + triggerevent = false; + zdccaltable(triggerevent, currentRunNumber, centrality, vx, vy, vz, znaEnergycommon, zncEnergycommon, znaEnergy[0], znaEnergy[1], znaEnergy[2], znaEnergy[3], zncEnergy[0], zncEnergy[1], zncEnergy[2], zncEnergy[3]); + return; + } else { + double ampl = gainequal * znaEnergy[iChA]; + if (followpub) { + ampl = TMath::Power(ampl, alphaZDC); + } + qxZDCA = qxZDCA - ampl * x[iChA]; + qyZDCA = qyZDCA + ampl * y[iChA]; + sumA = sumA + ampl; + histos.fill(HIST("ZDCAmp"), chanelid + 0.5, vz, ampl); + } + } else { + if (zncEnergy[iChA - 4] <= 0.0) { + triggerevent = false; + zdccaltable(triggerevent, currentRunNumber, centrality, vx, vy, vz, znaEnergycommon, zncEnergycommon, znaEnergy[0], znaEnergy[1], znaEnergy[2], znaEnergy[3], zncEnergy[0], zncEnergy[1], zncEnergy[2], zncEnergy[3]); + return; + } else { + double ampl = gainequal * zncEnergy[iChA - 4]; + if (followpub) { + ampl = TMath::Power(ampl, alphaZDC); + } + qxZDCC = qxZDCC + ampl * x[iChA - 4]; + qyZDCC = qyZDCC + ampl * y[iChA - 4]; + sumC = sumC + ampl; + histos.fill(HIST("ZDCAmp"), chanelid + 0.5, vz, ampl); + } + } + } + + if (sumA > 0) { + qxZDCA = qxZDCA / sumA; + qyZDCA = qyZDCA / sumA; + } + if (sumC > 0) { + qxZDCC = qxZDCC / sumC; + qyZDCC = qyZDCC / sumC; + } + + if (sumA <= 1e-4 || sumC <= 1e-4) { + qxZDCA = 0.0; + qxZDCC = 0.0; + qyZDCA = 0.0; + qyZDCC = 0.0; + triggerevent = false; + zdccaltable(triggerevent, currentRunNumber, centrality, vx, vy, vz, znaEnergycommon, zncEnergycommon, znaEnergy[0], znaEnergy[1], znaEnergy[2], znaEnergy[3], zncEnergy[0], zncEnergy[1], zncEnergy[2], zncEnergy[3]); + return; + } + + histos.fill(HIST("hEvtSelInfo"), 8.5); + histos.fill(HIST("hCentrality"), centrality); + histos.fill(HIST("Vz"), vz); + + histos.fill(HIST("AvgVxy"), 0.5, vx); + histos.fill(HIST("AvgVxy"), 1.5, vy); + + if (useCallibvertex && (currentRunNumber != lastRunNumber)) { + gainprofilevxy = ccdb->getForTimeStamp(ConfGainPathvxy.value, bc.timestamp()); + } + + if (useCallibvertex) { + vx = vx - gainprofilevxy->GetBinContent(1); + vy = vy - gainprofilevxy->GetBinContent(2); + } + + lastRunNumber = currentRunNumber; + } + zdccaltable(triggerevent, currentRunNumber, centrality, vx, vy, vz, znaEnergycommon, zncEnergycommon, znaEnergy[0], znaEnergy[1], znaEnergy[2], znaEnergy[3], zncEnergy[0], zncEnergy[1], zncEnergy[2], zncEnergy[3]); + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/PWGLF/Tasks/Strangeness/CMakeLists.txt b/PWGLF/Tasks/Strangeness/CMakeLists.txt index 333e2600d08..fdcd5037945 100644 --- a/PWGLF/Tasks/Strangeness/CMakeLists.txt +++ b/PWGLF/Tasks/Strangeness/CMakeLists.txt @@ -185,3 +185,8 @@ o2physics_add_dpl_workflow(strange-casc-track SOURCES strangeCascTrack.cxx PUBLIC_LINK_LIBRARIES O2::Framework O2::DetectorsBase O2Physics::AnalysisCore O2Physics::EventFilteringUtils COMPONENT_NAME Analysis) + +o2physics_add_dpl_workflow(zdccalderived + SOURCES zdccalderived.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/Strangeness/zdccalderived.cxx b/PWGLF/Tasks/Strangeness/zdccalderived.cxx new file mode 100644 index 00000000000..d9a8cc0a1ff --- /dev/null +++ b/PWGLF/Tasks/Strangeness/zdccalderived.cxx @@ -0,0 +1,649 @@ +// 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. +// +// \author: prottay das 23/12/2024 +// \email: prottay.das@cern.ch + +#include "PWGLF/DataModel/ZDCCalTables.h" + +#include "Common/CCDB/ctpRateFetcher.h" +#include "Common/Core/EventPlaneHelper.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/trackUtilities.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/FT0Corrected.h" +#include "Common/DataModel/Multiplicity.h" +#include "Common/DataModel/Qvectors.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +using namespace o2; +using namespace o2::framework; +using namespace o2::framework::expressions; +using namespace o2::constants::physics; +using namespace o2::aod::rctsel; + +// using BCsRun3 = soa::Join; + +struct zdccalderived { + + // Configurables. + struct : ConfigurableGroup { + Configurable cfgURL{"cfgURL", "http://alice-ccdb.cern.ch", "Address of the CCDB to browse"}; + Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "Latest acceptable timestamp of creation for the object"}; + } cfgCcdbParam; + + // Enable access to the CCDB for the offset and correction constants and save them in dedicated variables. + Service ccdb; + o2::ccdb::CcdbApi ccdbApi; + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + Configurable cfgCutVertex{"cfgCutVertex", 10.0f, "Accepted z-vertex range"}; + Configurable cfgCutCentralityMax{"cfgCutCentralityMax", 80.0f, "Centrality cut Max"}; + Configurable cfgCutCentralityMin{"cfgCutCentralityMin", 0.0f, "Centrality cut Min"}; + Configurable additionalEvSel{"additionalEvSel", false, "additionalEvSel"}; + + struct : ConfigurableGroup { + Configurable QxyNbins{"QxyNbins", 100, "Number of bins in QxQy histograms"}; + Configurable PhiNbins{"PhiNbins", 100, "Number of bins in phi histogram"}; + Configurable lbinQxy{"lbinQxy", -5.0, "lower bin value in QxQy histograms"}; + Configurable hbinQxy{"hbinQxy", 5.0, "higher bin value in QxQy histograms"}; + Configurable VxNbins{"VxNbins", 25, "Number of bins in Vx histograms"}; + Configurable lbinVx{"lbinVx", -0.05, "lower bin value in Vx histograms"}; + Configurable hbinVx{"hbinVx", 0.0, "higher bin value in Vx histograms"}; + Configurable VyNbins{"VyNbins", 25, "Number of bins in Vy histograms"}; + Configurable lbinVy{"lbinVy", -0.02, "lower bin value in Vy histograms"}; + Configurable hbinVy{"hbinVy", 0.02, "higher bin value in Vy histograms"}; + Configurable VzNbins{"VzNbins", 20, "Number of bins in Vz histograms"}; + Configurable lbinVz{"lbinVz", -10.0, "lower bin value in Vz histograms"}; + Configurable hbinVz{"hbinVz", 10.0, "higher bin value in Vz histograms"}; + Configurable CentNbins{"CentNbins", 16, "Number of bins in cent histograms"}; + Configurable lbinCent{"lbinCent", 0.0, "lower bin value in cent histograms"}; + Configurable hbinCent{"hbinCent", 80.0, "higher bin value in cent histograms"}; + Configurable VxfineNbins{"VxfineNbins", 25, "Number of bins in Vx fine histograms"}; + Configurable lfinebinVx{"lfinebinVx", -0.05, "lower bin value in Vx fine histograms"}; + Configurable hfinebinVx{"hfinebinVx", 0.0, "higher bin value in Vx fine histograms"}; + Configurable VyfineNbins{"VyfineNbins", 25, "Number of bins in Vy fine histograms"}; + Configurable lfinebinVy{"lfinebinVy", -0.02, "lower bin value in Vy fine histograms"}; + Configurable hfinebinVy{"hfinebinVy", 0.02, "higher bin value in Vy fine histograms"}; + Configurable VzfineNbins{"VzfineNbins", 20, "Number of bins in Vz fine histograms"}; + Configurable lfinebinVz{"lfinebinVz", -10.0, "lower bin value in Vz fine histograms"}; + Configurable hfinebinVz{"hfinebinVz", 10.0, "higher bin value in Vz fine histograms"}; + Configurable CentfineNbins{"CentfineNbins", 16, "Number of bins in cent fine histograms"}; + Configurable lfinebinCent{"lfinebinCent", 0.0, "lower bin value in cent fine histograms"}; + Configurable hfinebinCent{"hfinebinCent", 80.0, "higher bin value in cent fine histograms"}; + } configbins; + + Configurable useShift{"useShift", false, "shift histograms"}; + Configurable ispolarization{"ispolarization", false, "Flag to check polarization"}; + Configurable followpub{"followpub", true, "flag to use alphaZDC"}; + Configurable useGainCallib{"useGainCallib", false, "use gain calibration"}; + Configurable useCallibvertex{"useCallibvertex", false, "use calibration for vxy"}; + Configurable coarse1{"coarse1", false, "RE1"}; + Configurable fine1{"fine1", false, "REfine1"}; + Configurable coarse2{"coarse2", false, "RE2"}; + Configurable fine2{"fine2", false, "REfine2"}; + Configurable coarse3{"coarse3", false, "RE3"}; + Configurable fine3{"fine3", false, "REfine3"}; + Configurable coarse4{"coarse4", false, "RE4"}; + Configurable fine4{"fine4", false, "REfine4"}; + Configurable coarse5{"coarse5", false, "RE5"}; + Configurable fine5{"fine5", false, "REfine5"}; + Configurable coarse6{"coarse6", false, "RE6"}; + Configurable fine6{"fine6", false, "REfine6"}; + Configurable useRecentereSp{"useRecentereSp", false, "use Recentering with Sparse or THn"}; + Configurable useRecenterefineSp{"useRecenterefineSp", false, "use fine Recentering with THn"}; + Configurable ConfGainPath{"ConfGainPath", "Users/p/prottay/My/Object/NewPbPbpass4_10092024/gaincallib", "Path to gain calibration"}; + Configurable ConfGainPathvxy{"ConfGainPathvxy", "Users/p/prottay/My/Object/swapcoords/PbPbpass4_20112024/recentervert", "Path to gain calibration for vxy"}; + Configurable ConfRecentereSp{"ConfRecentereSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recentere"}; + Configurable ConfRecentereSp2{"ConfRecentereSp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recentere2"}; + Configurable ConfRecentereSp3{"ConfRecentereSp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recentere3"}; + Configurable ConfRecentereSp4{"ConfRecentereSp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recentere4"}; + Configurable ConfRecentereSp5{"ConfRecentereSp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recentere5"}; + Configurable ConfRecentereSp6{"ConfRecentereSp6", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recentere6"}; + Configurable ConfRecenterecentSp{"ConfRecenterecentSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for cent recentere"}; + Configurable ConfRecenterevxSp{"ConfRecenterevxSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vx recentere"}; + Configurable ConfRecenterevySp{"ConfRecenterevySp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere"}; + Configurable ConfRecenterevzSp{"ConfRecenterevzSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere"}; + Configurable ConfRecenterecentSp2{"ConfRecenterecentSp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for cent recentere2"}; + Configurable ConfRecenterevxSp2{"ConfRecenterevxSp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vx recentere2"}; + Configurable ConfRecenterevySp2{"ConfRecenterevySp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere2"}; + Configurable ConfRecenterevzSp2{"ConfRecenterevzSp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere2"}; + Configurable ConfRecenterecentSp3{"ConfRecenterecentSp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for cent recentere3"}; + Configurable ConfRecenterevxSp3{"ConfRecenterevxSp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vx recentere3"}; + Configurable ConfRecenterevySp3{"ConfRecenterevySp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere3"}; + Configurable ConfRecenterevzSp3{"ConfRecenterevzSp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere3"}; + Configurable ConfRecenterecentSp4{"ConfRecenterecentSp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for cent recentere4"}; + Configurable ConfRecenterevxSp4{"ConfRecenterevxSp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vx recentere4"}; + Configurable ConfRecenterevySp4{"ConfRecenterevySp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere4"}; + Configurable ConfRecenterevzSp4{"ConfRecenterevzSp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere4"}; + Configurable ConfRecenterecentSp5{"ConfRecenterecentSp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for cent recentere5"}; + Configurable ConfRecenterevxSp5{"ConfRecenterevxSp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vx recentere5"}; + Configurable ConfRecenterevySp5{"ConfRecenterevySp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere5"}; + Configurable ConfRecenterevzSp5{"ConfRecenterevzSp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere5"}; + Configurable ConfRecenterecentSp6{"ConfRecenterecentSp6", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for cent recentere6"}; + Configurable ConfRecenterevxSp6{"ConfRecenterevxSp6", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vx recentere6"}; + Configurable ConfRecenterevySp6{"ConfRecenterevySp6", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere6"}; + Configurable ConfRecenterevzSp6{"ConfRecenterevzSp6", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere6"}; + Configurable ConfShiftC{"ConfShiftC", "Users/p/prottay/My/Object/Testinglocaltree/shiftcallib2", "Path to shift C"}; + Configurable ConfShiftA{"ConfShiftA", "Users/p/prottay/My/Object/Testinglocaltree/shiftcallib2", "Path to shift A"}; + + struct : ConfigurableGroup { + Configurable requireRCTFlagChecker{"requireRCTFlagChecker", true, "Check event quality in run condition table"}; + Configurable cfgEvtRCTFlagCheckerLabel{"cfgEvtRCTFlagCheckerLabel", "CBT_hadronPID", "Evt sel: RCT flag checker label"}; + Configurable cfgEvtRCTFlagCheckerZDCCheck{"cfgEvtRCTFlagCheckerZDCCheck", true, "Evt sel: RCT flag checker ZDC check"}; + Configurable cfgEvtRCTFlagCheckerLimitAcceptAsBad{"cfgEvtRCTFlagCheckerLimitAcceptAsBad", false, "Evt sel: RCT flag checker treat Limited Acceptance As Bad"}; + } rctCut; + + // RCTFlagsChecker rctChecker; + + void init(o2::framework::InitContext&) + { + + // rctChecker.init(rctCut.cfgEvtRCTFlagCheckerLabel, rctCut.cfgEvtRCTFlagCheckerZDCCheck, rctCut.cfgEvtRCTFlagCheckerLimitAcceptAsBad); + + AxisSpec channelZDCAxis = {8, 0.0, 8.0, "ZDC tower"}; + AxisSpec qxZDCAxis = {configbins.QxyNbins, configbins.lbinQxy, configbins.hbinQxy, "Qx"}; + AxisSpec phiAxis = {configbins.PhiNbins, -6.28, 6.28, "phi"}; + AxisSpec vzAxis = {configbins.VzNbins, configbins.lbinVz, configbins.hbinVz, "vz"}; + AxisSpec vxAxis = {configbins.VxNbins, configbins.lbinVx, configbins.hbinVx, "vx"}; + AxisSpec vyAxis = {configbins.VyNbins, configbins.lbinVy, configbins.hbinVy, "vy"}; + AxisSpec centAxis = {configbins.CentNbins, configbins.lbinCent, configbins.hbinCent, "V0M (%)"}; + AxisSpec vzfineAxis = {configbins.VzfineNbins, configbins.lfinebinVz, configbins.hfinebinVz, "vzfine"}; + AxisSpec vxfineAxis = {configbins.VxfineNbins, configbins.lfinebinVx, configbins.hfinebinVx, "vxfine"}; + AxisSpec vyfineAxis = {configbins.VyfineNbins, configbins.lfinebinVy, configbins.hfinebinVy, "vyfine"}; + AxisSpec centfineAxis = {configbins.CentfineNbins, configbins.lfinebinCent, configbins.hfinebinCent, "V0M (%) fine"}; + AxisSpec shiftAxis = {10, 0, 10, "shift"}; + AxisSpec basisAxis = {2, 0, 2, "basis"}; + AxisSpec VxyAxis = {2, 0, 2, "Vxy"}; + + histos.add("hEvtSelInfo", "hEvtSelInfo", kTH1F, {{10, 0, 10.0}}); + histos.add("hCentrality", "hCentrality", kTH1F, {{centfineAxis}}); + histos.add("Vz", "Vz", kTH1F, {vzfineAxis}); + histos.add("hpQxZDCAC", "hpQxZDCAC", kTProfile, {centfineAxis}); + histos.add("hpQyZDCAC", "hpQyZDCAC", kTProfile, {centfineAxis}); + histos.add("hpQxZDCAQyZDCC", "hpQxZDCAQyZDCC", kTProfile, {centfineAxis}); + histos.add("hpQxZDCCQyZDCA", "hpQxZDCCQyZDCA", kTProfile, {centfineAxis}); + + if (!ispolarization) { + histos.add("hnQxZDCA", "hnQxZDCA", kTHnF, {{centAxis}, {vxAxis}, {vyAxis}, {vzAxis}, {qxZDCAxis}}); + histos.add("hnQyZDCA", "hnQyZDCA", kTHnF, {{centAxis}, {vxAxis}, {vyAxis}, {vzAxis}, {qxZDCAxis}}); + histos.add("hnQxZDCC", "hnQxZDCC", kTHnF, {{centAxis}, {vxAxis}, {vyAxis}, {vzAxis}, {qxZDCAxis}}); + histos.add("hnQyZDCC", "hnQyZDCC", kTHnF, {{centAxis}, {vxAxis}, {vyAxis}, {vzAxis}, {qxZDCAxis}}); + + histos.add("hcentQxZDCA", "hcentQxZDCA", kTH2F, {{centfineAxis}, {qxZDCAxis}}); + histos.add("hcentQyZDCA", "hcentQyZDCA", kTH2F, {{centfineAxis}, {qxZDCAxis}}); + histos.add("hcentQxZDCC", "hcentQxZDCC", kTH2F, {{centfineAxis}, {qxZDCAxis}}); + histos.add("hcentQyZDCC", "hcentQyZDCC", kTH2F, {{centfineAxis}, {qxZDCAxis}}); + + histos.add("hvxQxZDCA", "hvxQxZDCA", kTH2F, {{vxfineAxis}, {qxZDCAxis}}); + histos.add("hvxQyZDCA", "hvxQyZDCA", kTH2F, {{vxfineAxis}, {qxZDCAxis}}); + histos.add("hvxQxZDCC", "hvxQxZDCC", kTH2F, {{vxfineAxis}, {qxZDCAxis}}); + histos.add("hvxQyZDCC", "hvxQyZDCC", kTH2F, {{vxfineAxis}, {qxZDCAxis}}); + + histos.add("hvyQxZDCA", "hvyQxZDCA", kTH2F, {{vyfineAxis}, {qxZDCAxis}}); + histos.add("hvyQyZDCA", "hvyQyZDCA", kTH2F, {{vyfineAxis}, {qxZDCAxis}}); + histos.add("hvyQxZDCC", "hvyQxZDCC", kTH2F, {{vyfineAxis}, {qxZDCAxis}}); + histos.add("hvyQyZDCC", "hvyQyZDCC", kTH2F, {{vyfineAxis}, {qxZDCAxis}}); + + histos.add("hvzQxZDCA", "hvzQxZDCA", kTH2F, {{vzfineAxis}, {qxZDCAxis}}); + histos.add("hvzQyZDCA", "hvzQyZDCA", kTH2F, {{vzfineAxis}, {qxZDCAxis}}); + histos.add("hvzQxZDCC", "hvzQxZDCC", kTH2F, {{vzfineAxis}, {qxZDCAxis}}); + histos.add("hvzQyZDCC", "hvzQyZDCC", kTH2F, {{vzfineAxis}, {qxZDCAxis}}); + } + + histos.add("PsiZDCC", "PsiZDCC", kTH2F, {centfineAxis, phiAxis}); + histos.add("PsiZDCA", "PsiZDCA", kTH2F, {centfineAxis, phiAxis}); + histos.add("ZDCAmp", "ZDCAmp", kTProfile2D, {channelZDCAxis, vzfineAxis}); + histos.add("ZDCAmpCommon", "ZDCAmpCommon", kTProfile2D, {{2, 0.0, 2.0}, vzfineAxis}); + histos.add("ShiftZDCC", "ShiftZDCC", kTProfile3D, {centfineAxis, basisAxis, shiftAxis}); + histos.add("ShiftZDCA", "ShiftZDCA", kTProfile3D, {centfineAxis, basisAxis, shiftAxis}); + histos.add("hpCosPsiAPsiC", "hpCosPsiAPsiC", kTProfile, {centfineAxis}); + histos.add("hpSinPsiAPsiC", "hpSinPsiAPsiC", kTProfile, {centfineAxis}); + histos.add("AvgVxy", "AvgVxy", kTProfile, {VxyAxis}); + + // Event selection cut additional - Alex + ccdb->setURL(cfgCcdbParam.cfgURL); + ccdbApi.init("http://alice-ccdb.cern.ch"); + ccdb->setCaching(true); + ccdb->setLocalObjectValidityChecking(); + ccdb->setCreatedNotAfter(std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count()); + } + + int currentRunNumber = -999; + int lastRunNumber = -999; + TH2D* gainprofile; + TProfile* gainprofilevxy; + std::array hrecentereSpA; // Array of 6 histograms + std::array hrecenterecentSpA; // Array of 5 histograms + std::array hrecenterevxSpA; // Array of 5 histograms + std::array hrecenterevySpA; // Array of 5 histograms + std::array hrecenterevzSpA; // Array of 5 histograms + TProfile3D* shiftprofileA; + TProfile3D* shiftprofileC; + + Bool_t Correctcoarse(const THnF* hrecentereSp, auto centrality, auto vx, auto vy, auto vz, auto& qxZDCA, auto& qyZDCA, auto& qxZDCC, auto& qyZDCC) + { + + int binCoords[5]; + + // Get axes of the THnSparse + TAxis* centralityAxis = hrecentereSp->GetAxis(0); // Axis 0: centrality + TAxis* vxAxis = hrecentereSp->GetAxis(1); // Axis 1: vx + TAxis* vyAxis = hrecentereSp->GetAxis(2); // Axis 2: vy + TAxis* vzAxis = hrecentereSp->GetAxis(3); // Axis 3: vz + TAxis* channelAxis = hrecentereSp->GetAxis(4); // Axis 4: channel + + // Find bin indices for centrality, vx, vy, vz, and channel (for meanxA, 0.5) + binCoords[0] = centralityAxis->FindBin(centrality + 0.00001); // Centrality + binCoords[1] = vxAxis->FindBin(vx + 0.00001); // vx + binCoords[2] = vyAxis->FindBin(vy + 0.00001); // vy + binCoords[3] = vzAxis->FindBin(vz + 0.00001); // vz + binCoords[4] = channelAxis->FindBin(0.5); // Channel for meanxA + + // Get the global bin for meanxA + int globalBinMeanxA = hrecentereSp->GetBin(binCoords); + float meanxA = hrecentereSp->GetBinContent(globalBinMeanxA); + + // Repeat for other channels (meanyA, meanxC, meanyC) + binCoords[4] = channelAxis->FindBin(1.5); // Channel for meanyA + int globalBinMeanyA = hrecentereSp->GetBin(binCoords); + float meanyA = hrecentereSp->GetBinContent(globalBinMeanyA); + + binCoords[4] = channelAxis->FindBin(2.5); // Channel for meanxC + int globalBinMeanxC = hrecentereSp->GetBin(binCoords); + float meanxC = hrecentereSp->GetBinContent(globalBinMeanxC); + + binCoords[4] = channelAxis->FindBin(3.5); // Channel for meanyC + int globalBinMeanyC = hrecentereSp->GetBin(binCoords); + float meanyC = hrecentereSp->GetBinContent(globalBinMeanyC); + + qxZDCA = qxZDCA - meanxA; + qyZDCA = qyZDCA - meanyA; + qxZDCC = qxZDCC - meanxC; + qyZDCC = qyZDCC - meanyC; + + return kTRUE; + } + + Bool_t Correctfine(TH2F* hrecenterecentSp, TH2F* hrecenterevxSp, TH2F* hrecenterevySp, TH2F* hrecenterevzSp, auto centrality, auto vx, auto vy, auto vz, auto& qxZDCA, auto& qyZDCA, auto& qxZDCC, auto& qyZDCC) + { + + if (!hrecenterecentSp || !hrecenterevxSp || !hrecenterevySp || !hrecenterevzSp) { + std::cerr << "Error: One or more histograms are null." << std::endl; + return false; + } + + double meanxAcent = hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality + 0.00001, 0.5)); + double meanyAcent = hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality + 0.00001, 1.5)); + double meanxCcent = hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality + 0.00001, 2.5)); + double meanyCcent = hrecenterecentSp->GetBinContent(hrecenterecentSp->FindBin(centrality + 0.00001, 3.5)); + + double meanxAvx = hrecenterevxSp->GetBinContent(hrecenterevxSp->FindBin(vx + 0.00001, 0.5)); + double meanyAvx = hrecenterevxSp->GetBinContent(hrecenterevxSp->FindBin(vx + 0.00001, 1.5)); + double meanxCvx = hrecenterevxSp->GetBinContent(hrecenterevxSp->FindBin(vx + 0.00001, 2.5)); + double meanyCvx = hrecenterevxSp->GetBinContent(hrecenterevxSp->FindBin(vx + 0.00001, 3.5)); + + double meanxAvy = hrecenterevySp->GetBinContent(hrecenterevySp->FindBin(vy + 0.00001, 0.5)); + double meanyAvy = hrecenterevySp->GetBinContent(hrecenterevySp->FindBin(vy + 0.00001, 1.5)); + double meanxCvy = hrecenterevySp->GetBinContent(hrecenterevySp->FindBin(vy + 0.00001, 2.5)); + double meanyCvy = hrecenterevySp->GetBinContent(hrecenterevySp->FindBin(vy + 0.00001, 3.5)); + + double meanxAvz = hrecenterevzSp->GetBinContent(hrecenterevzSp->FindBin(vz + 0.00001, 0.5)); + double meanyAvz = hrecenterevzSp->GetBinContent(hrecenterevzSp->FindBin(vz + 0.00001, 1.5)); + double meanxCvz = hrecenterevzSp->GetBinContent(hrecenterevzSp->FindBin(vz + 0.00001, 2.5)); + double meanyCvz = hrecenterevzSp->GetBinContent(hrecenterevzSp->FindBin(vz + 0.00001, 3.5)); + + qxZDCA = qxZDCA - meanxAcent - meanxAvx - meanxAvy - meanxAvz; + qyZDCA = qyZDCA - meanyAcent - meanyAvx - meanyAvy - meanyAvz; + qxZDCC = qxZDCC - meanxCcent - meanxCvx - meanxCvy - meanxCvz; + qyZDCC = qyZDCC - meanyCcent - meanyCvx - meanyCvy - meanyCvz; + + return kTRUE; + } + + using EventCandidates = aod::ZDCCalTables; + void process(EventCandidates::iterator const& collision) + { + + if (collision.triggereventzdc()) { + auto centrality = collision.cent(); + currentRunNumber = collision.triggereventrunno(); + + auto vz = collision.vz(); + auto vx = collision.vx(); + auto vy = collision.vy(); + + float psiZDCC = -99; + float psiZDCA = -99; + auto qxZDCA = 0.0; + auto qxZDCC = 0.0; + auto qyZDCA = 0.0; + auto qyZDCC = 0.0; + auto sumA = 0.0; + auto sumC = 0.0; + + auto timestamps = ccdb->getRunDuration(currentRunNumber, true); /// fatalise if timestamps are not found + int64_t sorTimestamp = timestamps.first; // timestamp of the SOR/SOX/STF in ms + int64_t eorTimestamp = timestamps.second; // timestamp of the EOR/EOX/ETF in ms + int64_t ts = eorTimestamp / 2 + sorTimestamp / 2; // timestamp of the middle of the run + + std::array znaEnergy = { + collision.znaE0(), + collision.znaE1(), + collision.znaE2(), + collision.znaE3()}; + + std::array zncEnergy = { + collision.zncE0(), + collision.zncE1(), + collision.zncE2(), + collision.zncE3()}; + + auto znaEnergycommon = collision.znaC(); + auto zncEnergycommon = collision.zncC(); + + histos.fill(HIST("hEvtSelInfo"), 7.5); + + if (useGainCallib && (currentRunNumber != lastRunNumber)) { + gainprofile = ccdb->getForTimeStamp(ConfGainPath.value, ts); + } + + auto gainequal = 1.0; + auto alphaZDC = 0.395; + constexpr double x[4] = {-1.75, 1.75, -1.75, 1.75}; + constexpr double y[4] = {-1.75, -1.75, 1.75, 1.75}; + + histos.fill(HIST("ZDCAmpCommon"), 0.5, vz, znaEnergycommon); + histos.fill(HIST("ZDCAmpCommon"), 1.5, vz, zncEnergycommon); + + for (std::size_t iChA = 0; iChA < 8; iChA++) { + auto chanelid = iChA; + if (useGainCallib && gainprofile) { + gainequal = gainprofile->GetBinContent(gainprofile->FindBin(vz + 0.00001, chanelid + 0.5)); + } + + if (iChA < 4) { + + double ampl = gainequal * znaEnergy[iChA]; + if (followpub) { + ampl = TMath::Power(ampl, alphaZDC); + } + qxZDCA = qxZDCA - ampl * x[iChA]; + qyZDCA = qyZDCA + ampl * y[iChA]; + sumA = sumA + ampl; + histos.fill(HIST("ZDCAmp"), chanelid + 0.5, vz, ampl); + } else { + double ampl = gainequal * zncEnergy[iChA - 4]; + if (followpub) { + ampl = TMath::Power(ampl, alphaZDC); + } + qxZDCC = qxZDCC + ampl * x[iChA - 4]; + qyZDCC = qyZDCC + ampl * y[iChA - 4]; + sumC = sumC + ampl; + histos.fill(HIST("ZDCAmp"), chanelid + 0.5, vz, ampl); + } + } + + if (sumA > 0) { + qxZDCA = qxZDCA / sumA; + qyZDCA = qyZDCA / sumA; + } + if (sumC > 0) { + qxZDCC = qxZDCC / sumC; + qyZDCC = qyZDCC / sumC; + } + + if (sumA <= 1e-4 || sumC <= 1e-4) { + qxZDCA = 0.0; + qxZDCC = 0.0; + qyZDCA = 0.0; + qyZDCC = 0.0; + return; + } + + histos.fill(HIST("hEvtSelInfo"), 8.5); + histos.fill(HIST("hCentrality"), centrality); + histos.fill(HIST("Vz"), vz); + + histos.fill(HIST("AvgVxy"), 0.5, vx); + histos.fill(HIST("AvgVxy"), 1.5, vy); + + if (useCallibvertex && (currentRunNumber != lastRunNumber)) { + gainprofilevxy = ccdb->getForTimeStamp(ConfGainPathvxy.value, ts); + } + + if (useCallibvertex) { + vx = vx - gainprofilevxy->GetBinContent(1); + vy = vy - gainprofilevxy->GetBinContent(2); + } + + Bool_t res = 0; + Bool_t resfine = 0; + Int_t check = 1; + + if (coarse1) { + if (useRecentereSp && (currentRunNumber != lastRunNumber)) { + hrecentereSpA[0] = ccdb->getForTimeStamp(ConfRecentereSp.value, ts); + } + res = Correctcoarse(hrecentereSpA[0], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); + } + + if (fine1) { + + if (useRecenterefineSp && (currentRunNumber != lastRunNumber)) { + hrecenterecentSpA[0] = ccdb->getForTimeStamp(ConfRecenterecentSp.value, ts); + hrecenterevxSpA[0] = ccdb->getForTimeStamp(ConfRecenterevxSp.value, ts); + hrecenterevySpA[0] = ccdb->getForTimeStamp(ConfRecenterevySp.value, ts); + hrecenterevzSpA[0] = ccdb->getForTimeStamp(ConfRecenterevzSp.value, ts); + } + resfine = Correctfine(hrecenterecentSpA[0], hrecenterevxSpA[0], hrecenterevySpA[0], hrecenterevzSpA[0], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); + } + + if (coarse2) { + if (useRecentereSp && (currentRunNumber != lastRunNumber)) { + hrecentereSpA[1] = ccdb->getForTimeStamp(ConfRecentereSp2.value, ts); + } + res = Correctcoarse(hrecentereSpA[1], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); + } + + if (fine2) { + if (useRecenterefineSp && (currentRunNumber != lastRunNumber)) { + hrecenterecentSpA[1] = ccdb->getForTimeStamp(ConfRecenterecentSp2.value, ts); + hrecenterevxSpA[1] = ccdb->getForTimeStamp(ConfRecenterevxSp2.value, ts); + hrecenterevySpA[1] = ccdb->getForTimeStamp(ConfRecenterevySp2.value, ts); + hrecenterevzSpA[1] = ccdb->getForTimeStamp(ConfRecenterevzSp2.value, ts); + } + resfine = Correctfine(hrecenterecentSpA[1], hrecenterevxSpA[1], hrecenterevySpA[1], hrecenterevzSpA[1], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); + } + + if (coarse3) { + if (useRecentereSp && (currentRunNumber != lastRunNumber)) { + hrecentereSpA[2] = ccdb->getForTimeStamp(ConfRecentereSp3.value, ts); + } + res = Correctcoarse(hrecentereSpA[2], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); + } + + if (fine3) { + if (useRecenterefineSp && (currentRunNumber != lastRunNumber)) { + hrecenterecentSpA[2] = ccdb->getForTimeStamp(ConfRecenterecentSp3.value, ts); + hrecenterevxSpA[2] = ccdb->getForTimeStamp(ConfRecenterevxSp3.value, ts); + hrecenterevySpA[2] = ccdb->getForTimeStamp(ConfRecenterevySp3.value, ts); + hrecenterevzSpA[2] = ccdb->getForTimeStamp(ConfRecenterevzSp3.value, ts); + } + resfine = Correctfine(hrecenterecentSpA[2], hrecenterevxSpA[2], hrecenterevySpA[2], hrecenterevzSpA[2], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); + } + + if (coarse4) { + if (useRecentereSp && (currentRunNumber != lastRunNumber)) { + hrecentereSpA[3] = ccdb->getForTimeStamp(ConfRecentereSp4.value, ts); + } + res = Correctcoarse(hrecentereSpA[3], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); + } + + if (fine4) { + if (useRecenterefineSp && (currentRunNumber != lastRunNumber)) { + hrecenterecentSpA[3] = ccdb->getForTimeStamp(ConfRecenterecentSp4.value, ts); + hrecenterevxSpA[3] = ccdb->getForTimeStamp(ConfRecenterevxSp4.value, ts); + hrecenterevySpA[3] = ccdb->getForTimeStamp(ConfRecenterevySp4.value, ts); + hrecenterevzSpA[3] = ccdb->getForTimeStamp(ConfRecenterevzSp4.value, ts); + } + resfine = Correctfine(hrecenterecentSpA[3], hrecenterevxSpA[3], hrecenterevySpA[3], hrecenterevzSpA[3], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); + } + + if (coarse5) { + if (useRecentereSp && (currentRunNumber != lastRunNumber)) { + hrecentereSpA[4] = ccdb->getForTimeStamp(ConfRecentereSp5.value, ts); + } + res = Correctcoarse(hrecentereSpA[4], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); + } + + if (fine5) { + if (useRecenterefineSp && (currentRunNumber != lastRunNumber)) { + hrecenterecentSpA[4] = ccdb->getForTimeStamp(ConfRecenterecentSp5.value, ts); + hrecenterevxSpA[4] = ccdb->getForTimeStamp(ConfRecenterevxSp5.value, ts); + hrecenterevySpA[4] = ccdb->getForTimeStamp(ConfRecenterevySp5.value, ts); + hrecenterevzSpA[4] = ccdb->getForTimeStamp(ConfRecenterevzSp5.value, ts); + } + resfine = Correctfine(hrecenterecentSpA[4], hrecenterevxSpA[4], hrecenterevySpA[4], hrecenterevzSpA[4], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); + } + + if (coarse6) { + if (useRecentereSp && (currentRunNumber != lastRunNumber)) { + hrecentereSpA[5] = ccdb->getForTimeStamp(ConfRecentereSp6.value, ts); + } + res = Correctcoarse(hrecentereSpA[5], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); + } + + if (fine6) { + if (useRecenterefineSp && (currentRunNumber != lastRunNumber)) { + hrecenterecentSpA[5] = ccdb->getForTimeStamp(ConfRecenterecentSp6.value, ts); + hrecenterevxSpA[5] = ccdb->getForTimeStamp(ConfRecenterevxSp6.value, ts); + hrecenterevySpA[5] = ccdb->getForTimeStamp(ConfRecenterevySp6.value, ts); + hrecenterevzSpA[5] = ccdb->getForTimeStamp(ConfRecenterevzSp6.value, ts); + } + resfine = Correctfine(hrecenterecentSpA[5], hrecenterevxSpA[5], hrecenterevySpA[5], hrecenterevzSpA[5], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); + } + + if (res == 0 && resfine == 0 && check == 0) { + LOG(info) << "Histograms are null"; + } + psiZDCC = 1.0 * TMath::ATan2(qyZDCC, qxZDCC); + psiZDCA = 1.0 * TMath::ATan2(qyZDCA, qxZDCA); + + int nshift = 10; // no. of iterations + + if (useShift && (currentRunNumber != lastRunNumber)) { + shiftprofileC = ccdb->getForTimeStamp(ConfShiftC.value, ts); + shiftprofileA = ccdb->getForTimeStamp(ConfShiftA.value, ts); + } + + if (useShift) { + auto deltapsiZDCC = 0.0; + auto deltapsiZDCA = 0.0; + for (int ishift = 1; ishift <= nshift; ishift++) { + auto coeffshiftxZDCC = shiftprofileC->GetBinContent(shiftprofileC->FindBin(centrality, 0.5, ishift - 0.5)); + auto coeffshiftyZDCC = shiftprofileC->GetBinContent(shiftprofileC->FindBin(centrality, 1.5, ishift - 0.5)); + auto coeffshiftxZDCA = shiftprofileA->GetBinContent(shiftprofileA->FindBin(centrality, 0.5, ishift - 0.5)); + auto coeffshiftyZDCA = shiftprofileA->GetBinContent(shiftprofileA->FindBin(centrality, 1.5, ishift - 0.5)); + deltapsiZDCC = deltapsiZDCC + ((2 / (1.0 * ishift)) * (-coeffshiftxZDCC * TMath::Cos(ishift * 1.0 * psiZDCC) + coeffshiftyZDCC * TMath::Sin(ishift * 1.0 * psiZDCC))); + deltapsiZDCA = deltapsiZDCA + ((2 / (1.0 * ishift)) * (-coeffshiftxZDCA * TMath::Cos(ishift * 1.0 * psiZDCA) + coeffshiftyZDCA * TMath::Sin(ishift * 1.0 * psiZDCA))); + } + psiZDCC = psiZDCC + deltapsiZDCC; + psiZDCA = psiZDCA + deltapsiZDCA; + } + + for (int ishift = 1; ishift <= nshift; ishift++) { + histos.fill(HIST("ShiftZDCC"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 1.0 * psiZDCC)); + histos.fill(HIST("ShiftZDCC"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 1.0 * psiZDCC)); + histos.fill(HIST("ShiftZDCA"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 1.0 * psiZDCA)); + histos.fill(HIST("ShiftZDCA"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 1.0 * psiZDCA)); + } + + histos.fill(HIST("hpQxZDCAC"), centrality, (qxZDCA * qxZDCC)); + histos.fill(HIST("hpQyZDCAC"), centrality, (qyZDCA * qyZDCC)); + histos.fill(HIST("hpQxZDCAQyZDCC"), centrality, (qxZDCA * qyZDCC)); + histos.fill(HIST("hpQxZDCCQyZDCA"), centrality, (qxZDCC * qyZDCA)); + + if (!ispolarization) { + histos.fill(HIST("hnQxZDCA"), centrality, vx, vy, vz, qxZDCA); + histos.fill(HIST("hnQyZDCA"), centrality, vx, vy, vz, qyZDCA); + histos.fill(HIST("hnQxZDCC"), centrality, vx, vy, vz, qxZDCC); + histos.fill(HIST("hnQyZDCC"), centrality, vx, vy, vz, qyZDCC); + + histos.fill(HIST("hcentQxZDCA"), centrality, qxZDCA); + histos.fill(HIST("hcentQyZDCA"), centrality, qyZDCA); + histos.fill(HIST("hcentQxZDCC"), centrality, qxZDCC); + histos.fill(HIST("hcentQyZDCC"), centrality, qyZDCC); + + histos.fill(HIST("hvxQxZDCA"), vx, qxZDCA); + histos.fill(HIST("hvxQyZDCA"), vx, qyZDCA); + histos.fill(HIST("hvxQxZDCC"), vx, qxZDCC); + histos.fill(HIST("hvxQyZDCC"), vx, qyZDCC); + + histos.fill(HIST("hvyQxZDCA"), vy, qxZDCA); + histos.fill(HIST("hvyQyZDCA"), vy, qyZDCA); + histos.fill(HIST("hvyQxZDCC"), vy, qxZDCC); + histos.fill(HIST("hvyQyZDCC"), vy, qyZDCC); + + histos.fill(HIST("hvzQxZDCA"), vz, qxZDCA); + histos.fill(HIST("hvzQyZDCA"), vz, qyZDCA); + histos.fill(HIST("hvzQxZDCC"), vz, qxZDCC); + histos.fill(HIST("hvzQyZDCC"), vz, qyZDCC); + } + + histos.fill(HIST("hpCosPsiAPsiC"), centrality, (TMath::Cos(psiZDCA - psiZDCC))); + histos.fill(HIST("hpSinPsiAPsiC"), centrality, (TMath::Sin(psiZDCA - psiZDCC))); + histos.fill(HIST("PsiZDCA"), centrality, psiZDCA); + histos.fill(HIST("PsiZDCC"), centrality, psiZDCC); + + lastRunNumber = currentRunNumber; + } + } +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From 65e7acf75e0240e678e6e0aeb09454db9920f60f Mon Sep 17 00:00:00 2001 From: Prottay Das Date: Tue, 16 Dec 2025 17:54:00 +0100 Subject: [PATCH 2/5] updated --- PWGLF/DataModel/ZDCCalTables.h | 44 ++--- PWGLF/TableProducer/Common/zdcvector.cxx | 28 +-- PWGLF/Tasks/Strangeness/zdccalderived.cxx | 223 +++++++++++----------- 3 files changed, 149 insertions(+), 146 deletions(-) diff --git a/PWGLF/DataModel/ZDCCalTables.h b/PWGLF/DataModel/ZDCCalTables.h index 7313a049366..0f2c4e0afb6 100644 --- a/PWGLF/DataModel/ZDCCalTables.h +++ b/PWGLF/DataModel/ZDCCalTables.h @@ -29,22 +29,22 @@ namespace o2::aod { namespace zdccaltable { -DECLARE_SOA_COLUMN(TriggerEventZDC, triggereventzdc, bool); -DECLARE_SOA_COLUMN(TriggerEventRunNo, triggereventrunno, int); +DECLARE_SOA_COLUMN(TriggerEventZDC, triggerEventZDC, bool); +DECLARE_SOA_COLUMN(TriggerEventRunNo, triggerEventRunNo, 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(ZNAC, znaC, float); -DECLARE_SOA_COLUMN(ZNCC, zncC, float); -DECLARE_SOA_COLUMN(ZNAE0, znaE0, float); -DECLARE_SOA_COLUMN(ZNAE1, znaE1, float); -DECLARE_SOA_COLUMN(ZNAE2, znaE2, float); -DECLARE_SOA_COLUMN(ZNAE3, znaE3, float); -DECLARE_SOA_COLUMN(ZNCE0, zncE0, float); -DECLARE_SOA_COLUMN(ZNCE1, zncE1, float); -DECLARE_SOA_COLUMN(ZNCE2, zncE2, float); -DECLARE_SOA_COLUMN(ZNCE3, zncE3, float); +DECLARE_SOA_COLUMN(ZnaC, znaC, float); +DECLARE_SOA_COLUMN(ZncC, zncC, float); +DECLARE_SOA_COLUMN(ZnaE0, znaE0, float); +DECLARE_SOA_COLUMN(ZnaE1, znaE1, float); +DECLARE_SOA_COLUMN(ZnaE2, znaE2, float); +DECLARE_SOA_COLUMN(ZnaE3, znaE3, float); +DECLARE_SOA_COLUMN(ZncE0, zncE0, float); +DECLARE_SOA_COLUMN(ZncE1, zncE1, float); +DECLARE_SOA_COLUMN(ZncE2, zncE2, float); +DECLARE_SOA_COLUMN(ZncE3, zncE3, float); } // namespace zdccaltable DECLARE_SOA_TABLE(ZDCCalTables, "AOD", "ZDCCALTABLE", zdccaltable::TriggerEventZDC, @@ -53,16 +53,16 @@ DECLARE_SOA_TABLE(ZDCCalTables, "AOD", "ZDCCALTABLE", zdccaltable::Vx, zdccaltable::Vy, zdccaltable::Vz, - zdccaltable::ZNAC, - zdccaltable::ZNCC, - zdccaltable::ZNAE0, - zdccaltable::ZNAE1, - zdccaltable::ZNAE2, - zdccaltable::ZNAE3, - zdccaltable::ZNCE0, - zdccaltable::ZNCE1, - zdccaltable::ZNCE2, - zdccaltable::ZNCE3); + zdccaltable::ZnaC, + zdccaltable::ZncC, + zdccaltable::ZnaE0, + zdccaltable::ZnaE1, + zdccaltable::ZnaE2, + zdccaltable::ZnaE3, + zdccaltable::ZncE0, + zdccaltable::ZncE1, + zdccaltable::ZncE2, + zdccaltable::ZncE3); using ZDCCalTable = ZDCCalTables::iterator; } // namespace o2::aod #endif // PWGLF_DATAMODEL_ZDCCALTABLES_H_ diff --git a/PWGLF/TableProducer/Common/zdcvector.cxx b/PWGLF/TableProducer/Common/zdcvector.cxx index 32ceb15500b..3d3aeace007 100644 --- a/PWGLF/TableProducer/Common/zdcvector.cxx +++ b/PWGLF/TableProducer/Common/zdcvector.cxx @@ -25,6 +25,7 @@ #include "Common/DataModel/Qvectors.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "Framework/Logger.h" #include #include #include @@ -53,7 +54,6 @@ #include #include #include -#include #include #include @@ -72,7 +72,6 @@ struct zdcvector { // Configurables. struct : ConfigurableGroup { Configurable cfgURL{"cfgURL", "http://alice-ccdb.cern.ch", "Address of the CCDB to browse"}; - Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "Latest acceptable timestamp of creation for the object"}; } cfgCcdbParam; // Enable access to the CCDB for the offset and correction constants and save them in dedicated variables. @@ -87,10 +86,10 @@ struct zdcvector { Configurable usemem{"usemem", true, "usemem"}; struct : ConfigurableGroup { - Configurable VzfineNbins{"VzfineNbins", 20, "Number of bins in Vz fine histograms"}; + Configurable vzFineNbins{"vzFineNbins", 20, "Number of bins in Vz fine histograms"}; Configurable lfinebinVz{"lfinebinVz", -10.0, "lower bin value in Vz fine histograms"}; Configurable hfinebinVz{"hfinebinVz", 10.0, "higher bin value in Vz fine histograms"}; - Configurable CentfineNbins{"CentfineNbins", 16, "Number of bins in cent fine histograms"}; + Configurable centFineNbins{"centFineNbins", 16, "Number of bins in cent fine histograms"}; Configurable lfinebinCent{"lfinebinCent", 0.0, "lower bin value in cent fine histograms"}; Configurable hfinebinCent{"hfinebinCent", 80.0, "higher bin value in cent fine histograms"}; } configbins; @@ -98,8 +97,8 @@ struct zdcvector { Configurable followpub{"followpub", true, "flag to use alphaZDC"}; Configurable useGainCallib{"useGainCallib", false, "use gain calibration"}; Configurable useCallibvertex{"useCallibvertex", false, "use calibration for vxy"}; - Configurable ConfGainPath{"ConfGainPath", "Users/p/prottay/My/Object/NewPbPbpass4_10092024/gaincallib", "Path to gain calibration"}; - Configurable ConfGainPathvxy{"ConfGainPathvxy", "Users/p/prottay/My/Object/swapcoords/PbPbpass4_20112024/recentervert", "Path to gain calibration for vxy"}; + Configurable confGainPath{"confGainPath", "Users/p/prottay/My/Object/NewPbPbpass4_10092024/gaincallib", "Path to gain calibration"}; + Configurable confGainPathVxy{"confGainPathVxy", "Users/p/prottay/My/Object/swapcoords/PbPbpass4_20112024/recentervert", "Path to gain calibration for vxy"}; struct : ConfigurableGroup { Configurable requireRCTFlagChecker{"requireRCTFlagChecker", true, "Check event quality in run condition table"}; @@ -116,8 +115,8 @@ struct zdcvector { rctChecker.init(rctCut.cfgEvtRCTFlagCheckerLabel, rctCut.cfgEvtRCTFlagCheckerZDCCheck, rctCut.cfgEvtRCTFlagCheckerLimitAcceptAsBad); AxisSpec channelZDCAxis = {8, 0.0, 8.0, "ZDC tower"}; - AxisSpec vzfineAxis = {configbins.VzfineNbins, configbins.lfinebinVz, configbins.hfinebinVz, "vzfine"}; - AxisSpec centfineAxis = {configbins.CentfineNbins, configbins.lfinebinCent, configbins.hfinebinCent, "V0M (%) fine"}; + AxisSpec vzfineAxis = {configbins.vzFineNbins, configbins.lfinebinVz, configbins.hfinebinVz, "vzfine"}; + AxisSpec centfineAxis = {configbins.centFineNbins, configbins.lfinebinCent, configbins.hfinebinCent, "V0M (%) fine"}; AxisSpec VxyAxis = {2, 0, 2, "Vxy"}; histos.add("htpcnsigmapi", "htpcnsigmapi", kTH1F, {{50, -10, 10.0}}); @@ -227,10 +226,10 @@ struct zdcvector { histos.fill(HIST("hEvtSelInfo"), 6.5); - if (collision.sel8() && centrality > cfgCutCentralityMin && centrality < cfgCutCentralityMax && TMath::Abs(vz) < cfgCutVertex && collision.has_foundFT0() && collision.selection_bit(aod::evsel::kNoTimeFrameBorder) && collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { + if (collision.sel8() && centrality > cfgCutCentralityMin && centrality < cfgCutCentralityMax && std::abs(vz) < cfgCutVertex && collision.has_foundFT0() && collision.selection_bit(aod::evsel::kNoTimeFrameBorder) && collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) { triggerevent = true; if (useGainCallib && (currentRunNumber != lastRunNumber)) { - gainprofile = ccdb->getForTimeStamp(ConfGainPath.value, bc.timestamp()); + gainprofile = ccdb->getForTimeStamp(confGainPath.value, bc.timestamp()); } histos.fill(HIST("hEvtSelInfo"), 7.5); @@ -243,7 +242,8 @@ struct zdcvector { histos.fill(HIST("ZDCAmpCommon"), 0.5, vz, znaEnergycommon); histos.fill(HIST("ZDCAmpCommon"), 1.5, vz, zncEnergycommon); - for (std::size_t iChA = 0; iChA < 8; iChA++) { + int ntow = 8; + for (std::size_t iChA = 0; iChA < ntow; iChA++) { auto chanelid = iChA; if (useGainCallib && gainprofile) { gainequal = gainprofile->GetBinContent(gainprofile->FindBin(vz + 0.00001, chanelid + 0.5)); @@ -258,7 +258,7 @@ struct zdcvector { } else { double ampl = gainequal * znaEnergy[iChA]; if (followpub) { - ampl = TMath::Power(ampl, alphaZDC); + ampl = std::pow(ampl, alphaZDC); } qxZDCA = qxZDCA - ampl * x[iChA]; qyZDCA = qyZDCA + ampl * y[iChA]; @@ -273,7 +273,7 @@ struct zdcvector { } else { double ampl = gainequal * zncEnergy[iChA - 4]; if (followpub) { - ampl = TMath::Power(ampl, alphaZDC); + ampl = std::pow(ampl, alphaZDC); } qxZDCC = qxZDCC + ampl * x[iChA - 4]; qyZDCC = qyZDCC + ampl * y[iChA - 4]; @@ -310,7 +310,7 @@ struct zdcvector { histos.fill(HIST("AvgVxy"), 1.5, vy); if (useCallibvertex && (currentRunNumber != lastRunNumber)) { - gainprofilevxy = ccdb->getForTimeStamp(ConfGainPathvxy.value, bc.timestamp()); + gainprofilevxy = ccdb->getForTimeStamp(confGainPathVxy.value, bc.timestamp()); } if (useCallibvertex) { diff --git a/PWGLF/Tasks/Strangeness/zdccalderived.cxx b/PWGLF/Tasks/Strangeness/zdccalderived.cxx index d9a8cc0a1ff..d403c272b3a 100644 --- a/PWGLF/Tasks/Strangeness/zdccalderived.cxx +++ b/PWGLF/Tasks/Strangeness/zdccalderived.cxx @@ -53,7 +53,9 @@ #include #include #include -#include +// #include +#include "Framework/Logger.h" + #include #include @@ -70,7 +72,6 @@ struct zdccalderived { // Configurables. struct : ConfigurableGroup { Configurable cfgURL{"cfgURL", "http://alice-ccdb.cern.ch", "Address of the CCDB to browse"}; - Configurable nolaterthan{"ccdb-no-later-than", std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(), "Latest acceptable timestamp of creation for the object"}; } cfgCcdbParam; // Enable access to the CCDB for the offset and correction constants and save them in dedicated variables. @@ -84,32 +85,32 @@ struct zdccalderived { Configurable additionalEvSel{"additionalEvSel", false, "additionalEvSel"}; struct : ConfigurableGroup { - Configurable QxyNbins{"QxyNbins", 100, "Number of bins in QxQy histograms"}; - Configurable PhiNbins{"PhiNbins", 100, "Number of bins in phi histogram"}; + Configurable qxyNbins{"qxyNbins", 100, "Number of bins in QxQy histograms"}; + Configurable phiNbins{"phiNbins", 100, "Number of bins in phi histogram"}; Configurable lbinQxy{"lbinQxy", -5.0, "lower bin value in QxQy histograms"}; Configurable hbinQxy{"hbinQxy", 5.0, "higher bin value in QxQy histograms"}; - Configurable VxNbins{"VxNbins", 25, "Number of bins in Vx histograms"}; + Configurable vxNbins{"vxNbins", 25, "Number of bins in Vx histograms"}; Configurable lbinVx{"lbinVx", -0.05, "lower bin value in Vx histograms"}; Configurable hbinVx{"hbinVx", 0.0, "higher bin value in Vx histograms"}; - Configurable VyNbins{"VyNbins", 25, "Number of bins in Vy histograms"}; + Configurable vyNbins{"vyNbins", 25, "Number of bins in Vy histograms"}; Configurable lbinVy{"lbinVy", -0.02, "lower bin value in Vy histograms"}; Configurable hbinVy{"hbinVy", 0.02, "higher bin value in Vy histograms"}; - Configurable VzNbins{"VzNbins", 20, "Number of bins in Vz histograms"}; + Configurable vzNbins{"vzNbins", 20, "Number of bins in Vz histograms"}; Configurable lbinVz{"lbinVz", -10.0, "lower bin value in Vz histograms"}; Configurable hbinVz{"hbinVz", 10.0, "higher bin value in Vz histograms"}; - Configurable CentNbins{"CentNbins", 16, "Number of bins in cent histograms"}; + Configurable centNbins{"centNbins", 16, "Number of bins in cent histograms"}; Configurable lbinCent{"lbinCent", 0.0, "lower bin value in cent histograms"}; Configurable hbinCent{"hbinCent", 80.0, "higher bin value in cent histograms"}; - Configurable VxfineNbins{"VxfineNbins", 25, "Number of bins in Vx fine histograms"}; + Configurable vxFineNbins{"vxFineNbins", 25, "Number of bins in Vx fine histograms"}; Configurable lfinebinVx{"lfinebinVx", -0.05, "lower bin value in Vx fine histograms"}; Configurable hfinebinVx{"hfinebinVx", 0.0, "higher bin value in Vx fine histograms"}; - Configurable VyfineNbins{"VyfineNbins", 25, "Number of bins in Vy fine histograms"}; + Configurable vyFineNbins{"vyFineNbins", 25, "Number of bins in Vy fine histograms"}; Configurable lfinebinVy{"lfinebinVy", -0.02, "lower bin value in Vy fine histograms"}; Configurable hfinebinVy{"hfinebinVy", 0.02, "higher bin value in Vy fine histograms"}; - Configurable VzfineNbins{"VzfineNbins", 20, "Number of bins in Vz fine histograms"}; + Configurable vzFineNbins{"vzFineNbins", 20, "Number of bins in Vz fine histograms"}; Configurable lfinebinVz{"lfinebinVz", -10.0, "lower bin value in Vz fine histograms"}; Configurable hfinebinVz{"hfinebinVz", 10.0, "higher bin value in Vz fine histograms"}; - Configurable CentfineNbins{"CentfineNbins", 16, "Number of bins in cent fine histograms"}; + Configurable centFineNbins{"centFineNbins", 16, "Number of bins in cent fine histograms"}; Configurable lfinebinCent{"lfinebinCent", 0.0, "lower bin value in cent fine histograms"}; Configurable hfinebinCent{"hfinebinCent", 80.0, "higher bin value in cent fine histograms"}; } configbins; @@ -133,40 +134,41 @@ struct zdccalderived { Configurable fine6{"fine6", false, "REfine6"}; Configurable useRecentereSp{"useRecentereSp", false, "use Recentering with Sparse or THn"}; Configurable useRecenterefineSp{"useRecenterefineSp", false, "use fine Recentering with THn"}; - Configurable ConfGainPath{"ConfGainPath", "Users/p/prottay/My/Object/NewPbPbpass4_10092024/gaincallib", "Path to gain calibration"}; - Configurable ConfGainPathvxy{"ConfGainPathvxy", "Users/p/prottay/My/Object/swapcoords/PbPbpass4_20112024/recentervert", "Path to gain calibration for vxy"}; - Configurable ConfRecentereSp{"ConfRecentereSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recentere"}; - Configurable ConfRecentereSp2{"ConfRecentereSp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recentere2"}; - Configurable ConfRecentereSp3{"ConfRecentereSp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recentere3"}; - Configurable ConfRecentereSp4{"ConfRecentereSp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recentere4"}; - Configurable ConfRecentereSp5{"ConfRecentereSp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recentere5"}; - Configurable ConfRecentereSp6{"ConfRecentereSp6", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for recentere6"}; - Configurable ConfRecenterecentSp{"ConfRecenterecentSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for cent recentere"}; - Configurable ConfRecenterevxSp{"ConfRecenterevxSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vx recentere"}; - Configurable ConfRecenterevySp{"ConfRecenterevySp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere"}; - Configurable ConfRecenterevzSp{"ConfRecenterevzSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere"}; - Configurable ConfRecenterecentSp2{"ConfRecenterecentSp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for cent recentere2"}; - Configurable ConfRecenterevxSp2{"ConfRecenterevxSp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vx recentere2"}; - Configurable ConfRecenterevySp2{"ConfRecenterevySp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere2"}; - Configurable ConfRecenterevzSp2{"ConfRecenterevzSp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere2"}; - Configurable ConfRecenterecentSp3{"ConfRecenterecentSp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for cent recentere3"}; - Configurable ConfRecenterevxSp3{"ConfRecenterevxSp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vx recentere3"}; - Configurable ConfRecenterevySp3{"ConfRecenterevySp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere3"}; - Configurable ConfRecenterevzSp3{"ConfRecenterevzSp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere3"}; - Configurable ConfRecenterecentSp4{"ConfRecenterecentSp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for cent recentere4"}; - Configurable ConfRecenterevxSp4{"ConfRecenterevxSp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vx recentere4"}; - Configurable ConfRecenterevySp4{"ConfRecenterevySp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere4"}; - Configurable ConfRecenterevzSp4{"ConfRecenterevzSp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere4"}; - Configurable ConfRecenterecentSp5{"ConfRecenterecentSp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for cent recentere5"}; - Configurable ConfRecenterevxSp5{"ConfRecenterevxSp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vx recentere5"}; - Configurable ConfRecenterevySp5{"ConfRecenterevySp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere5"}; - Configurable ConfRecenterevzSp5{"ConfRecenterevzSp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere5"}; - Configurable ConfRecenterecentSp6{"ConfRecenterecentSp6", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for cent recentere6"}; - Configurable ConfRecenterevxSp6{"ConfRecenterevxSp6", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vx recentere6"}; - Configurable ConfRecenterevySp6{"ConfRecenterevySp6", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vy recentere6"}; - Configurable ConfRecenterevzSp6{"ConfRecenterevzSp6", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn Path for vz recentere6"}; - Configurable ConfShiftC{"ConfShiftC", "Users/p/prottay/My/Object/Testinglocaltree/shiftcallib2", "Path to shift C"}; - Configurable ConfShiftA{"ConfShiftA", "Users/p/prottay/My/Object/Testinglocaltree/shiftcallib2", "Path to shift A"}; + + Configurable confGainPath{"confGainPath", "Users/p/prottay/My/Object/NewPbPbpass4_10092024/gaincallib", "Path to gain calibration"}; + Configurable confGainPathVxy{"confGainPathVxy", "Users/p/prottay/My/Object/swapcoords/PbPbpass4_20112024/recentervert", "Path to gain calibration for vxy"}; + Configurable confRecentereSp{"confRecentereSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for recentering"}; + Configurable confRecentereSp2{"confRecentereSp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for recentering 2"}; + Configurable confRecentereSp3{"confRecentereSp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for recentering 3"}; + Configurable confRecentereSp4{"confRecentereSp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for recentering 4"}; + Configurable confRecentereSp5{"confRecentereSp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for recentering 5"}; + Configurable confRecentereSp6{"confRecentereSp6", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for recentering 6"}; + Configurable confRecentereCentSp{"confRecentereCentSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for cent recentering"}; + Configurable confRecentereVxSp{"confRecentereVxSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for vx recentering"}; + Configurable confRecentereVySp{"confRecentereVySp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for vy recentering"}; + Configurable confRecentereVzSp{"confRecentereVzSp", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for vz recentering"}; + Configurable confRecentereCentSp2{"confRecentereCentSp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for cent recentering 2"}; + Configurable confRecentereVxSp2{"confRecentereVxSp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for vx recentering 2"}; + Configurable confRecentereVySp2{"confRecentereVySp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for vy recentering 2"}; + Configurable confRecentereVzSp2{"confRecentereVzSp2", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for vz recentering 2"}; + Configurable confRecentereCentSp3{"confRecentereCentSp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for cent recentering 3"}; + Configurable confRecentereVxSp3{"confRecentereVxSp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for vx recentering 3"}; + Configurable confRecentereVySp3{"confRecentereVySp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for vy recentering 3"}; + Configurable confRecentereVzSp3{"confRecentereVzSp3", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for vz recentering 3"}; + Configurable confRecentereCentSp4{"confRecentereCentSp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for cent recentering 4"}; + Configurable confRecentereVxSp4{"confRecentereVxSp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for vx recentering 4"}; + Configurable confRecentereVySp4{"confRecentereVySp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for vy recentering 4"}; + Configurable confRecentereVzSp4{"confRecentereVzSp4", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for vz recentering 4"}; + Configurable confRecentereCentSp5{"confRecentereCentSp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for cent recentering 5"}; + Configurable confRecentereVxSp5{"confRecentereVxSp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for vx recentering 5"}; + Configurable confRecentereVySp5{"confRecentereVySp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for vy recentering 5"}; + Configurable confRecentereVzSp5{"confRecentereVzSp5", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for vz recentering 5"}; + Configurable confRecentereCentSp6{"confRecentereCentSp6", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for cent recentering 6"}; + Configurable confRecentereVxSp6{"confRecentereVxSp6", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for vx recentering 6"}; + Configurable confRecentereVySp6{"confRecentereVySp6", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for vy recentering 6"}; + Configurable confRecentereVzSp6{"confRecentereVzSp6", "Users/p/prottay/My/Object/Testingwithsparse/NewPbPbpass4_17092024/recenter", "Sparse or THn path for vz recentering 6"}; + Configurable confShiftC{"confShiftC", "Users/p/prottay/My/Object/Testinglocaltree/shiftcallib2", "Path to shift C"}; + Configurable confShiftA{"confShiftA", "Users/p/prottay/My/Object/Testinglocaltree/shiftcallib2", "Path to shift A"}; struct : ConfigurableGroup { Configurable requireRCTFlagChecker{"requireRCTFlagChecker", true, "Check event quality in run condition table"}; @@ -183,16 +185,16 @@ struct zdccalderived { // rctChecker.init(rctCut.cfgEvtRCTFlagCheckerLabel, rctCut.cfgEvtRCTFlagCheckerZDCCheck, rctCut.cfgEvtRCTFlagCheckerLimitAcceptAsBad); AxisSpec channelZDCAxis = {8, 0.0, 8.0, "ZDC tower"}; - AxisSpec qxZDCAxis = {configbins.QxyNbins, configbins.lbinQxy, configbins.hbinQxy, "Qx"}; - AxisSpec phiAxis = {configbins.PhiNbins, -6.28, 6.28, "phi"}; - AxisSpec vzAxis = {configbins.VzNbins, configbins.lbinVz, configbins.hbinVz, "vz"}; - AxisSpec vxAxis = {configbins.VxNbins, configbins.lbinVx, configbins.hbinVx, "vx"}; - AxisSpec vyAxis = {configbins.VyNbins, configbins.lbinVy, configbins.hbinVy, "vy"}; - AxisSpec centAxis = {configbins.CentNbins, configbins.lbinCent, configbins.hbinCent, "V0M (%)"}; - AxisSpec vzfineAxis = {configbins.VzfineNbins, configbins.lfinebinVz, configbins.hfinebinVz, "vzfine"}; - AxisSpec vxfineAxis = {configbins.VxfineNbins, configbins.lfinebinVx, configbins.hfinebinVx, "vxfine"}; - AxisSpec vyfineAxis = {configbins.VyfineNbins, configbins.lfinebinVy, configbins.hfinebinVy, "vyfine"}; - AxisSpec centfineAxis = {configbins.CentfineNbins, configbins.lfinebinCent, configbins.hfinebinCent, "V0M (%) fine"}; + AxisSpec qxZDCAxis = {configbins.qxyNbins, configbins.lbinQxy, configbins.hbinQxy, "Qx"}; + AxisSpec phiAxis = {configbins.phiNbins, -6.28, 6.28, "phi"}; + AxisSpec vzAxis = {configbins.vzNbins, configbins.lbinVz, configbins.hbinVz, "vz"}; + AxisSpec vxAxis = {configbins.vxNbins, configbins.lbinVx, configbins.hbinVx, "vx"}; + AxisSpec vyAxis = {configbins.vyNbins, configbins.lbinVy, configbins.hbinVy, "vy"}; + AxisSpec centAxis = {configbins.centNbins, configbins.lbinCent, configbins.hbinCent, "V0M (%)"}; + AxisSpec vzfineAxis = {configbins.vzFineNbins, configbins.lfinebinVz, configbins.hfinebinVz, "vzfine"}; + AxisSpec vxfineAxis = {configbins.vxFineNbins, configbins.lfinebinVx, configbins.hfinebinVx, "vxfine"}; + AxisSpec vyfineAxis = {configbins.vyFineNbins, configbins.lfinebinVy, configbins.hfinebinVy, "vyfine"}; + AxisSpec centfineAxis = {configbins.centFineNbins, configbins.lfinebinCent, configbins.hfinebinCent, "V0M (%) fine"}; AxisSpec shiftAxis = {10, 0, 10, "shift"}; AxisSpec basisAxis = {2, 0, 2, "basis"}; AxisSpec VxyAxis = {2, 0, 2, "Vxy"}; @@ -262,7 +264,7 @@ struct zdccalderived { TProfile3D* shiftprofileA; TProfile3D* shiftprofileC; - Bool_t Correctcoarse(const THnF* hrecentereSp, auto centrality, auto vx, auto vy, auto vz, auto& qxZDCA, auto& qyZDCA, auto& qxZDCC, auto& qyZDCC) + bool Correctcoarse(const THnF* hrecentereSp, auto centrality, auto vx, auto vy, auto vz, auto& qxZDCA, auto& qyZDCA, auto& qxZDCC, auto& qyZDCC) { int binCoords[5]; @@ -306,7 +308,7 @@ struct zdccalderived { return kTRUE; } - Bool_t Correctfine(TH2F* hrecenterecentSp, TH2F* hrecenterevxSp, TH2F* hrecenterevySp, TH2F* hrecenterevzSp, auto centrality, auto vx, auto vy, auto vz, auto& qxZDCA, auto& qyZDCA, auto& qxZDCC, auto& qyZDCC) + bool Correctfine(TH2F* hrecenterecentSp, TH2F* hrecenterevxSp, TH2F* hrecenterevySp, TH2F* hrecenterevzSp, auto centrality, auto vx, auto vy, auto vz, auto& qxZDCA, auto& qyZDCA, auto& qxZDCC, auto& qyZDCC) { if (!hrecenterecentSp || !hrecenterevxSp || !hrecenterevySp || !hrecenterevzSp) { @@ -346,9 +348,9 @@ struct zdccalderived { void process(EventCandidates::iterator const& collision) { - if (collision.triggereventzdc()) { + if (collision.triggerEventZDC()) { auto centrality = collision.cent(); - currentRunNumber = collision.triggereventrunno(); + currentRunNumber = collision.triggerEventRunNo(); auto vz = collision.vz(); auto vx = collision.vx(); @@ -386,7 +388,7 @@ struct zdccalderived { histos.fill(HIST("hEvtSelInfo"), 7.5); if (useGainCallib && (currentRunNumber != lastRunNumber)) { - gainprofile = ccdb->getForTimeStamp(ConfGainPath.value, ts); + gainprofile = ccdb->getForTimeStamp(confGainPath.value, ts); } auto gainequal = 1.0; @@ -397,7 +399,8 @@ struct zdccalderived { histos.fill(HIST("ZDCAmpCommon"), 0.5, vz, znaEnergycommon); histos.fill(HIST("ZDCAmpCommon"), 1.5, vz, zncEnergycommon); - for (std::size_t iChA = 0; iChA < 8; iChA++) { + int ntow = 8; + for (std::size_t iChA = 0; iChA < ntow; iChA++) { auto chanelid = iChA; if (useGainCallib && gainprofile) { gainequal = gainprofile->GetBinContent(gainprofile->FindBin(vz + 0.00001, chanelid + 0.5)); @@ -407,7 +410,7 @@ struct zdccalderived { double ampl = gainequal * znaEnergy[iChA]; if (followpub) { - ampl = TMath::Power(ampl, alphaZDC); + ampl = std::pow(ampl, alphaZDC); } qxZDCA = qxZDCA - ampl * x[iChA]; qyZDCA = qyZDCA + ampl * y[iChA]; @@ -416,7 +419,7 @@ struct zdccalderived { } else { double ampl = gainequal * zncEnergy[iChA - 4]; if (followpub) { - ampl = TMath::Power(ampl, alphaZDC); + ampl = std::pow(ampl, alphaZDC); } qxZDCC = qxZDCC + ampl * x[iChA - 4]; qyZDCC = qyZDCC + ampl * y[iChA - 4]; @@ -450,7 +453,7 @@ struct zdccalderived { histos.fill(HIST("AvgVxy"), 1.5, vy); if (useCallibvertex && (currentRunNumber != lastRunNumber)) { - gainprofilevxy = ccdb->getForTimeStamp(ConfGainPathvxy.value, ts); + gainprofilevxy = ccdb->getForTimeStamp(confGainPathVxy.value, ts); } if (useCallibvertex) { @@ -458,13 +461,13 @@ struct zdccalderived { vy = vy - gainprofilevxy->GetBinContent(2); } - Bool_t res = 0; - Bool_t resfine = 0; - Int_t check = 1; + bool res = 0; + bool resfine = 0; + int check = 1; if (coarse1) { if (useRecentereSp && (currentRunNumber != lastRunNumber)) { - hrecentereSpA[0] = ccdb->getForTimeStamp(ConfRecentereSp.value, ts); + hrecentereSpA[0] = ccdb->getForTimeStamp(confRecentereSp.value, ts); } res = Correctcoarse(hrecentereSpA[0], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); } @@ -472,95 +475,95 @@ struct zdccalderived { if (fine1) { if (useRecenterefineSp && (currentRunNumber != lastRunNumber)) { - hrecenterecentSpA[0] = ccdb->getForTimeStamp(ConfRecenterecentSp.value, ts); - hrecenterevxSpA[0] = ccdb->getForTimeStamp(ConfRecenterevxSp.value, ts); - hrecenterevySpA[0] = ccdb->getForTimeStamp(ConfRecenterevySp.value, ts); - hrecenterevzSpA[0] = ccdb->getForTimeStamp(ConfRecenterevzSp.value, ts); + hrecenterecentSpA[0] = ccdb->getForTimeStamp(confRecentereCentSp.value, ts); + hrecenterevxSpA[0] = ccdb->getForTimeStamp(confRecentereVxSp.value, ts); + hrecenterevySpA[0] = ccdb->getForTimeStamp(confRecentereVySp.value, ts); + hrecenterevzSpA[0] = ccdb->getForTimeStamp(confRecentereVzSp.value, ts); } resfine = Correctfine(hrecenterecentSpA[0], hrecenterevxSpA[0], hrecenterevySpA[0], hrecenterevzSpA[0], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); } if (coarse2) { if (useRecentereSp && (currentRunNumber != lastRunNumber)) { - hrecentereSpA[1] = ccdb->getForTimeStamp(ConfRecentereSp2.value, ts); + hrecentereSpA[1] = ccdb->getForTimeStamp(confRecentereSp2.value, ts); } res = Correctcoarse(hrecentereSpA[1], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); } if (fine2) { if (useRecenterefineSp && (currentRunNumber != lastRunNumber)) { - hrecenterecentSpA[1] = ccdb->getForTimeStamp(ConfRecenterecentSp2.value, ts); - hrecenterevxSpA[1] = ccdb->getForTimeStamp(ConfRecenterevxSp2.value, ts); - hrecenterevySpA[1] = ccdb->getForTimeStamp(ConfRecenterevySp2.value, ts); - hrecenterevzSpA[1] = ccdb->getForTimeStamp(ConfRecenterevzSp2.value, ts); + hrecenterecentSpA[1] = ccdb->getForTimeStamp(confRecentereCentSp2.value, ts); + hrecenterevxSpA[1] = ccdb->getForTimeStamp(confRecentereVxSp2.value, ts); + hrecenterevySpA[1] = ccdb->getForTimeStamp(confRecentereVySp2.value, ts); + hrecenterevzSpA[1] = ccdb->getForTimeStamp(confRecentereVzSp2.value, ts); } resfine = Correctfine(hrecenterecentSpA[1], hrecenterevxSpA[1], hrecenterevySpA[1], hrecenterevzSpA[1], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); } if (coarse3) { if (useRecentereSp && (currentRunNumber != lastRunNumber)) { - hrecentereSpA[2] = ccdb->getForTimeStamp(ConfRecentereSp3.value, ts); + hrecentereSpA[2] = ccdb->getForTimeStamp(confRecentereSp3.value, ts); } res = Correctcoarse(hrecentereSpA[2], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); } if (fine3) { if (useRecenterefineSp && (currentRunNumber != lastRunNumber)) { - hrecenterecentSpA[2] = ccdb->getForTimeStamp(ConfRecenterecentSp3.value, ts); - hrecenterevxSpA[2] = ccdb->getForTimeStamp(ConfRecenterevxSp3.value, ts); - hrecenterevySpA[2] = ccdb->getForTimeStamp(ConfRecenterevySp3.value, ts); - hrecenterevzSpA[2] = ccdb->getForTimeStamp(ConfRecenterevzSp3.value, ts); + hrecenterecentSpA[2] = ccdb->getForTimeStamp(confRecentereCentSp3.value, ts); + hrecenterevxSpA[2] = ccdb->getForTimeStamp(confRecentereVxSp3.value, ts); + hrecenterevySpA[2] = ccdb->getForTimeStamp(confRecentereVySp3.value, ts); + hrecenterevzSpA[2] = ccdb->getForTimeStamp(confRecentereVzSp3.value, ts); } resfine = Correctfine(hrecenterecentSpA[2], hrecenterevxSpA[2], hrecenterevySpA[2], hrecenterevzSpA[2], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); } if (coarse4) { if (useRecentereSp && (currentRunNumber != lastRunNumber)) { - hrecentereSpA[3] = ccdb->getForTimeStamp(ConfRecentereSp4.value, ts); + hrecentereSpA[3] = ccdb->getForTimeStamp(confRecentereSp4.value, ts); } res = Correctcoarse(hrecentereSpA[3], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); } if (fine4) { if (useRecenterefineSp && (currentRunNumber != lastRunNumber)) { - hrecenterecentSpA[3] = ccdb->getForTimeStamp(ConfRecenterecentSp4.value, ts); - hrecenterevxSpA[3] = ccdb->getForTimeStamp(ConfRecenterevxSp4.value, ts); - hrecenterevySpA[3] = ccdb->getForTimeStamp(ConfRecenterevySp4.value, ts); - hrecenterevzSpA[3] = ccdb->getForTimeStamp(ConfRecenterevzSp4.value, ts); + hrecenterecentSpA[3] = ccdb->getForTimeStamp(confRecentereCentSp4.value, ts); + hrecenterevxSpA[3] = ccdb->getForTimeStamp(confRecentereVxSp4.value, ts); + hrecenterevySpA[3] = ccdb->getForTimeStamp(confRecentereVySp4.value, ts); + hrecenterevzSpA[3] = ccdb->getForTimeStamp(confRecentereVzSp4.value, ts); } resfine = Correctfine(hrecenterecentSpA[3], hrecenterevxSpA[3], hrecenterevySpA[3], hrecenterevzSpA[3], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); } if (coarse5) { if (useRecentereSp && (currentRunNumber != lastRunNumber)) { - hrecentereSpA[4] = ccdb->getForTimeStamp(ConfRecentereSp5.value, ts); + hrecentereSpA[4] = ccdb->getForTimeStamp(confRecentereSp5.value, ts); } res = Correctcoarse(hrecentereSpA[4], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); } if (fine5) { if (useRecenterefineSp && (currentRunNumber != lastRunNumber)) { - hrecenterecentSpA[4] = ccdb->getForTimeStamp(ConfRecenterecentSp5.value, ts); - hrecenterevxSpA[4] = ccdb->getForTimeStamp(ConfRecenterevxSp5.value, ts); - hrecenterevySpA[4] = ccdb->getForTimeStamp(ConfRecenterevySp5.value, ts); - hrecenterevzSpA[4] = ccdb->getForTimeStamp(ConfRecenterevzSp5.value, ts); + hrecenterecentSpA[4] = ccdb->getForTimeStamp(confRecentereCentSp5.value, ts); + hrecenterevxSpA[4] = ccdb->getForTimeStamp(confRecentereVxSp5.value, ts); + hrecenterevySpA[4] = ccdb->getForTimeStamp(confRecentereVySp5.value, ts); + hrecenterevzSpA[4] = ccdb->getForTimeStamp(confRecentereVzSp5.value, ts); } resfine = Correctfine(hrecenterecentSpA[4], hrecenterevxSpA[4], hrecenterevySpA[4], hrecenterevzSpA[4], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); } if (coarse6) { if (useRecentereSp && (currentRunNumber != lastRunNumber)) { - hrecentereSpA[5] = ccdb->getForTimeStamp(ConfRecentereSp6.value, ts); + hrecentereSpA[5] = ccdb->getForTimeStamp(confRecentereSp6.value, ts); } res = Correctcoarse(hrecentereSpA[5], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); } if (fine6) { if (useRecenterefineSp && (currentRunNumber != lastRunNumber)) { - hrecenterecentSpA[5] = ccdb->getForTimeStamp(ConfRecenterecentSp6.value, ts); - hrecenterevxSpA[5] = ccdb->getForTimeStamp(ConfRecenterevxSp6.value, ts); - hrecenterevySpA[5] = ccdb->getForTimeStamp(ConfRecenterevySp6.value, ts); - hrecenterevzSpA[5] = ccdb->getForTimeStamp(ConfRecenterevzSp6.value, ts); + hrecenterecentSpA[5] = ccdb->getForTimeStamp(confRecentereCentSp6.value, ts); + hrecenterevxSpA[5] = ccdb->getForTimeStamp(confRecentereVxSp6.value, ts); + hrecenterevySpA[5] = ccdb->getForTimeStamp(confRecentereVySp6.value, ts); + hrecenterevzSpA[5] = ccdb->getForTimeStamp(confRecentereVzSp6.value, ts); } resfine = Correctfine(hrecenterecentSpA[5], hrecenterevxSpA[5], hrecenterevySpA[5], hrecenterevzSpA[5], centrality, vx, vy, vz, qxZDCA, qyZDCA, qxZDCC, qyZDCC); } @@ -568,14 +571,14 @@ struct zdccalderived { if (res == 0 && resfine == 0 && check == 0) { LOG(info) << "Histograms are null"; } - psiZDCC = 1.0 * TMath::ATan2(qyZDCC, qxZDCC); - psiZDCA = 1.0 * TMath::ATan2(qyZDCA, qxZDCA); + psiZDCC = 1.0 * std::atan2(qyZDCC, qxZDCC); + psiZDCA = 1.0 * std::atan2(qyZDCA, qxZDCA); int nshift = 10; // no. of iterations if (useShift && (currentRunNumber != lastRunNumber)) { - shiftprofileC = ccdb->getForTimeStamp(ConfShiftC.value, ts); - shiftprofileA = ccdb->getForTimeStamp(ConfShiftA.value, ts); + shiftprofileC = ccdb->getForTimeStamp(confShiftC.value, ts); + shiftprofileA = ccdb->getForTimeStamp(confShiftA.value, ts); } if (useShift) { @@ -586,18 +589,18 @@ struct zdccalderived { auto coeffshiftyZDCC = shiftprofileC->GetBinContent(shiftprofileC->FindBin(centrality, 1.5, ishift - 0.5)); auto coeffshiftxZDCA = shiftprofileA->GetBinContent(shiftprofileA->FindBin(centrality, 0.5, ishift - 0.5)); auto coeffshiftyZDCA = shiftprofileA->GetBinContent(shiftprofileA->FindBin(centrality, 1.5, ishift - 0.5)); - deltapsiZDCC = deltapsiZDCC + ((2 / (1.0 * ishift)) * (-coeffshiftxZDCC * TMath::Cos(ishift * 1.0 * psiZDCC) + coeffshiftyZDCC * TMath::Sin(ishift * 1.0 * psiZDCC))); - deltapsiZDCA = deltapsiZDCA + ((2 / (1.0 * ishift)) * (-coeffshiftxZDCA * TMath::Cos(ishift * 1.0 * psiZDCA) + coeffshiftyZDCA * TMath::Sin(ishift * 1.0 * psiZDCA))); + deltapsiZDCC = deltapsiZDCC + ((2 / (1.0 * ishift)) * (-coeffshiftxZDCC * std::cos(ishift * 1.0 * psiZDCC) + coeffshiftyZDCC * std::sin(ishift * 1.0 * psiZDCC))); + deltapsiZDCA = deltapsiZDCA + ((2 / (1.0 * ishift)) * (-coeffshiftxZDCA * std::cos(ishift * 1.0 * psiZDCA) + coeffshiftyZDCA * std::sin(ishift * 1.0 * psiZDCA))); } psiZDCC = psiZDCC + deltapsiZDCC; psiZDCA = psiZDCA + deltapsiZDCA; } for (int ishift = 1; ishift <= nshift; ishift++) { - histos.fill(HIST("ShiftZDCC"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 1.0 * psiZDCC)); - histos.fill(HIST("ShiftZDCC"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 1.0 * psiZDCC)); - histos.fill(HIST("ShiftZDCA"), centrality, 0.5, ishift - 0.5, TMath::Sin(ishift * 1.0 * psiZDCA)); - histos.fill(HIST("ShiftZDCA"), centrality, 1.5, ishift - 0.5, TMath::Cos(ishift * 1.0 * psiZDCA)); + histos.fill(HIST("ShiftZDCC"), centrality, 0.5, ishift - 0.5, std::sin(ishift * 1.0 * psiZDCC)); + histos.fill(HIST("ShiftZDCC"), centrality, 1.5, ishift - 0.5, std::cos(ishift * 1.0 * psiZDCC)); + histos.fill(HIST("ShiftZDCA"), centrality, 0.5, ishift - 0.5, std::sin(ishift * 1.0 * psiZDCA)); + histos.fill(HIST("ShiftZDCA"), centrality, 1.5, ishift - 0.5, std::cos(ishift * 1.0 * psiZDCA)); } histos.fill(HIST("hpQxZDCAC"), centrality, (qxZDCA * qxZDCC)); @@ -632,8 +635,8 @@ struct zdccalderived { histos.fill(HIST("hvzQyZDCC"), vz, qyZDCC); } - histos.fill(HIST("hpCosPsiAPsiC"), centrality, (TMath::Cos(psiZDCA - psiZDCC))); - histos.fill(HIST("hpSinPsiAPsiC"), centrality, (TMath::Sin(psiZDCA - psiZDCC))); + histos.fill(HIST("hpCosPsiAPsiC"), centrality, (std::cos(psiZDCA - psiZDCC))); + histos.fill(HIST("hpSinPsiAPsiC"), centrality, (std::sin(psiZDCA - psiZDCC))); histos.fill(HIST("PsiZDCA"), centrality, psiZDCA); histos.fill(HIST("PsiZDCC"), centrality, psiZDCC); From e173e84fddc29b9903646a7652ba2976db3fd818 Mon Sep 17 00:00:00 2001 From: Prottay Das Date: Tue, 16 Dec 2025 18:02:14 +0100 Subject: [PATCH 3/5] updated2 --- PWGLF/Tasks/Strangeness/zdccalderived.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Strangeness/zdccalderived.cxx b/PWGLF/Tasks/Strangeness/zdccalderived.cxx index d403c272b3a..72b3f5ddf23 100644 --- a/PWGLF/Tasks/Strangeness/zdccalderived.cxx +++ b/PWGLF/Tasks/Strangeness/zdccalderived.cxx @@ -312,7 +312,7 @@ struct zdccalderived { { if (!hrecenterecentSp || !hrecenterevxSp || !hrecenterevySp || !hrecenterevzSp) { - std::cerr << "Error: One or more histograms are null." << std::endl; + // std::cerr << "Error: One or more histograms are null." << std::endl; return false; } From ce91b5e02662dba8a3a88d547995be5831a4060b Mon Sep 17 00:00:00 2001 From: Prottay Das Date: Wed, 17 Dec 2025 15:32:26 +0100 Subject: [PATCH 4/5] updated3 --- PWGLF/TableProducer/Common/zdcvector.cxx | 3 ++- PWGLF/Tasks/Strangeness/zdccalderived.cxx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/Common/zdcvector.cxx b/PWGLF/TableProducer/Common/zdcvector.cxx index 3d3aeace007..f7a811a7b9e 100644 --- a/PWGLF/TableProducer/Common/zdcvector.cxx +++ b/PWGLF/TableProducer/Common/zdcvector.cxx @@ -242,7 +242,8 @@ struct zdcvector { histos.fill(HIST("ZDCAmpCommon"), 0.5, vz, znaEnergycommon); histos.fill(HIST("ZDCAmpCommon"), 1.5, vz, zncEnergycommon); - int ntow = 8; + // int ntow = 8; + constexpr std::size_t ntow = 8; for (std::size_t iChA = 0; iChA < ntow; iChA++) { auto chanelid = iChA; if (useGainCallib && gainprofile) { diff --git a/PWGLF/Tasks/Strangeness/zdccalderived.cxx b/PWGLF/Tasks/Strangeness/zdccalderived.cxx index 72b3f5ddf23..f2c6e6c3c2c 100644 --- a/PWGLF/Tasks/Strangeness/zdccalderived.cxx +++ b/PWGLF/Tasks/Strangeness/zdccalderived.cxx @@ -399,7 +399,7 @@ struct zdccalderived { histos.fill(HIST("ZDCAmpCommon"), 0.5, vz, znaEnergycommon); histos.fill(HIST("ZDCAmpCommon"), 1.5, vz, zncEnergycommon); - int ntow = 8; + constexpr std::size_t ntow = 8; for (std::size_t iChA = 0; iChA < ntow; iChA++) { auto chanelid = iChA; if (useGainCallib && gainprofile) { From 32303286503dc37bda6b1006b3a0f1b156c65059 Mon Sep 17 00:00:00 2001 From: Prottay Das Date: Wed, 17 Dec 2025 17:13:50 +0100 Subject: [PATCH 5/5] update4 --- PWGLF/Tasks/Strangeness/zdccalderived.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/zdccalderived.cxx b/PWGLF/Tasks/Strangeness/zdccalderived.cxx index f2c6e6c3c2c..5d8776345d1 100644 --- a/PWGLF/Tasks/Strangeness/zdccalderived.cxx +++ b/PWGLF/Tasks/Strangeness/zdccalderived.cxx @@ -25,6 +25,7 @@ #include "Common/DataModel/Qvectors.h" #include "Common/DataModel/TrackSelectionTables.h" +#include "Framework/Logger.h" #include #include #include @@ -53,9 +54,6 @@ #include #include #include -// #include -#include "Framework/Logger.h" - #include #include