From 80d79ba997933c0a8d3cac1a0a4c2bbd103bf1b9 Mon Sep 17 00:00:00 2001 From: jesgum Date: Mon, 7 Jul 2025 12:17:27 +0200 Subject: [PATCH 1/5] Add PVz and IR profiles to centrality task --- Common/Tasks/CMakeLists.txt | 2 +- Common/Tasks/centralityStudy.cxx | 37 +++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/Common/Tasks/CMakeLists.txt b/Common/Tasks/CMakeLists.txt index 64d4f7e6611..932398c97a9 100644 --- a/Common/Tasks/CMakeLists.txt +++ b/Common/Tasks/CMakeLists.txt @@ -81,7 +81,7 @@ o2physics_add_dpl_workflow(qvectors-correction o2physics_add_dpl_workflow(centrality-study SOURCES centralityStudy.cxx - PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore + PUBLIC_LINK_LIBRARIES O2::Framework O2Physics::AnalysisCore O2Physics::AnalysisCCDB COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(flow-test diff --git a/Common/Tasks/centralityStudy.cxx b/Common/Tasks/centralityStudy.cxx index c5cd8916f8b..b7c8c339536 100644 --- a/Common/Tasks/centralityStudy.cxx +++ b/Common/Tasks/centralityStudy.cxx @@ -17,6 +17,7 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/McCollisionExtra.h" #include "Common/DataModel/Multiplicity.h" +#include "Common/CCDB/ctpRateFetcher.h" #include "CCDB/BasicCCDBManager.h" #include "DataFormatsParameters/GRPECSObject.h" @@ -27,6 +28,7 @@ #include "TH1F.h" #include "TH2F.h" +#include "TProfile.h" using namespace o2; using namespace o2::framework; @@ -37,7 +39,8 @@ struct centralityStudy { // Raw multiplicities HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; Service ccdb; - + ctpRateFetcher mRateFetcher; + // Configurables Configurable do2DPlots{"do2DPlots", true, "0 - no, 1 - yes"}; Configurable doOccupancyStudyVsCentrality2d{"doOccupancyStudyVsCentrality2d", true, "0 - no, 1 - yes"}; @@ -76,6 +79,11 @@ struct centralityStudy { Configurable scaleSignalFT0M{"scaleSignalFT0M", 1.00f, "scale FT0M signal for convenience"}; Configurable scaleSignalFV0A{"scaleSignalFV0A", 1.00f, "scale FV0A signal for convenience"}; + Configurable ccdbURL{"ccdbURL", "http://alice-ccdb.cern.ch", "ccdb url"}; + Configurable pathGRPECSObject{"pathGRPECSObject", "GLO/Config/GRPECS", "Path to GRPECS object"}; + Configurable irSource{"irSource", "ZNC hadronic", "Source of the interaction rate: (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"}; + Configurable fIRCrashOnNull{"fIRCrashOnNull", false, "Flag to avoid CTP RateFetcher crash."}; + // _______________________________________ // upc rejection criteria // reject low zna/c @@ -120,6 +128,7 @@ struct centralityStudy { ConfigurableAxis axisPVChi2{"axisPVChi2", {300, 0, 30}, "FT0C percentile"}; ConfigurableAxis axisDeltaTime{"axisDeltaTime", {300, 0, 300}, "#Delta time"}; ConfigurableAxis axisDeltaTimestamp{"axisDeltaTimestamp", {1440, 0, 24}, "#Delta timestamp - sor (hours)"}; + ConfigurableAxis axisInteractionRate{"IRbinning", {500, 0, 100}, "Binning for the interaction rate (kHz)"}; // For profile Z ConfigurableAxis axisPVz{"axisPVz", {400, -20.0f, +20.0f}, "PVz (cm)"}; @@ -235,18 +244,21 @@ struct centralityStudy { } if (doTimeStudies) { - ccdb->setURL("http://alice-ccdb.cern.ch"); + ccdb->setURL(ccdbURL); ccdb->setCaching(true); ccdb->setLocalObjectValidityChecking(); ccdb->setFatalWhenNull(false); histos.add("hFT0AvsTime", "hFT0AvsTime", kTH2F, {axisDeltaTimestamp, axisMultFT0A}); - histos.add("hFT0CvsTime", "hFT0CvsTime", kTH2F, {{axisDeltaTimestamp, axisMultFT0C}}); - histos.add("hFT0MvsTime", "hFT0MvsTime", kTH2F, {{axisDeltaTimestamp, axisMultFT0M}}); - histos.add("hFV0AvsTime", "hFV0AvsTime", kTH2F, {{axisDeltaTimestamp, axisMultFV0A}}); - histos.add("hMFTTracksvsTime", "hMFTTracksvsTime", kTH2F, {{axisDeltaTimestamp, axisMultMFTTracks}}); - histos.add("hNGlobalVsTime", "hNGlobalVsTime", kTH2F, {{axisDeltaTimestamp, axisMultGlobalTracks}}); - histos.add("hNTPVContributorsvsTime", "hNTPVContributorsvsTime", kTH2F, {{axisDeltaTimestamp, axisMultPVContributors}}); + histos.add("hFT0CvsTime", "hFT0CvsTime", kTH2F, {axisDeltaTimestamp, axisMultFT0C}); + histos.add("hFT0MvsTime", "hFT0MvsTime", kTH2F, {axisDeltaTimestamp, axisMultFT0M}); + histos.add("hFV0AvsTime", "hFV0AvsTime", kTH2F, {axisDeltaTimestamp, axisMultFV0A}); + histos.add("hMFTTracksvsTime", "hMFTTracksvsTime", kTH2F, {axisDeltaTimestamp, axisMultMFTTracks}); + histos.add("hNGlobalVsTime", "hNGlobalVsTime", kTH2F, {axisDeltaTimestamp, axisMultGlobalTracks}); + histos.add("hNTPVContributorsvsTime", "hNTPVContributorsvsTime", kTH2F, {axisDeltaTimestamp, axisMultPVContributors}); + histos.add("hIRProfileVsTime", "hIRProfileVsTime", kTProfile, {axisDeltaTimestamp}); + histos.add("hPVzProfileCoVsTime", "hPVzProfileCoVsTime", kTProfile, {axisDeltaTimestamp}); + histos.add("hPVzProfileBcVsTime", "hPVzProfileBcVsTime", kTProfile, {axisDeltaTimestamp}); } } @@ -254,7 +266,6 @@ struct centralityStudy { void genericProcessCollision(TCollision collision) // process this collisions { - histos.fill(HIST("hCollisionSelection"), 0); // all collisions if (applySel8 && !collision.multSel8()) return; @@ -428,9 +439,12 @@ struct centralityStudy { if (doTimeStudies && collision.has_multBC()) { auto multbc = collision.template multBC_as(); uint64_t bcTimestamp = multbc.timestamp(); - o2::parameters::GRPECSObject* grpo = ccdb->getForTimeStamp("GLO/Config/GRPECS", bcTimestamp); + o2::parameters::GRPECSObject* grpo = ccdb->getForTimeStamp(pathGRPECSObject, bcTimestamp); uint64_t startOfRunTimestamp = grpo->getTimeStart(); + float hoursAfterStartOfRun = static_cast(bcTimestamp - startOfRunTimestamp) / 3600000.0; + float interactionRate = mRateFetcher.fetch(ccdb.service, bcTimestamp, collision.multRunNumber(), irSource.value, fIRCrashOnNull) / 1000.; // kHz + histos.fill(HIST("hFT0AvsTime"), hoursAfterStartOfRun, collision.multFT0A()); histos.fill(HIST("hFT0CvsTime"), hoursAfterStartOfRun, collision.multFT0C()); histos.fill(HIST("hFT0MvsTime"), hoursAfterStartOfRun, collision.multFT0M()); @@ -438,6 +452,9 @@ struct centralityStudy { histos.fill(HIST("hMFTTracksvsTime"), hoursAfterStartOfRun, collision.mftNtracks()); histos.fill(HIST("hNGlobalVsTime"), hoursAfterStartOfRun, collision.multNTracksGlobal()); histos.fill(HIST("hNTPVContributorsvsTime"), hoursAfterStartOfRun, collision.multPVTotalContributors()); + histos.fill(HIST("hPVzProfileCoVsTime"), hoursAfterStartOfRun, collision.multPVz()); + histos.fill(HIST("hPVzProfileBcVsTime"), hoursAfterStartOfRun, multbc.multFT0PosZ()); + histos.fill(HIST("hIRProfileVsTime"), hoursAfterStartOfRun, interactionRate); } } From 43860901b3a9c77364f03873ac7e5983ade24149 Mon Sep 17 00:00:00 2001 From: jesgum Date: Mon, 7 Jul 2025 12:18:18 +0200 Subject: [PATCH 2/5] formatting --- Common/Tasks/centralityStudy.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Common/Tasks/centralityStudy.cxx b/Common/Tasks/centralityStudy.cxx index b7c8c339536..07d872299c1 100644 --- a/Common/Tasks/centralityStudy.cxx +++ b/Common/Tasks/centralityStudy.cxx @@ -13,11 +13,11 @@ // Run 3 Pb-Pb centrality selections in 2023 data. It is compatible with // derived data. +#include "Common/CCDB/ctpRateFetcher.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/McCollisionExtra.h" #include "Common/DataModel/Multiplicity.h" -#include "Common/CCDB/ctpRateFetcher.h" #include "CCDB/BasicCCDBManager.h" #include "DataFormatsParameters/GRPECSObject.h" @@ -40,7 +40,7 @@ struct centralityStudy { HistogramRegistry histos{"Histos", {}, OutputObjHandlingPolicy::AnalysisObject}; Service ccdb; ctpRateFetcher mRateFetcher; - + // Configurables Configurable do2DPlots{"do2DPlots", true, "0 - no, 1 - yes"}; Configurable doOccupancyStudyVsCentrality2d{"doOccupancyStudyVsCentrality2d", true, "0 - no, 1 - yes"}; @@ -444,7 +444,7 @@ struct centralityStudy { float hoursAfterStartOfRun = static_cast(bcTimestamp - startOfRunTimestamp) / 3600000.0; float interactionRate = mRateFetcher.fetch(ccdb.service, bcTimestamp, collision.multRunNumber(), irSource.value, fIRCrashOnNull) / 1000.; // kHz - + histos.fill(HIST("hFT0AvsTime"), hoursAfterStartOfRun, collision.multFT0A()); histos.fill(HIST("hFT0CvsTime"), hoursAfterStartOfRun, collision.multFT0C()); histos.fill(HIST("hFT0MvsTime"), hoursAfterStartOfRun, collision.multFT0M()); From 665b2be53793a2eabf6c4258f20ecd844706295a Mon Sep 17 00:00:00 2001 From: jesgum Date: Mon, 7 Jul 2025 12:27:12 +0200 Subject: [PATCH 3/5] Make megalinter happy --- Common/Tasks/centralityStudy.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Common/Tasks/centralityStudy.cxx b/Common/Tasks/centralityStudy.cxx index 07d872299c1..c37ec7454a2 100644 --- a/Common/Tasks/centralityStudy.cxx +++ b/Common/Tasks/centralityStudy.cxx @@ -30,6 +30,8 @@ #include "TH2F.h" #include "TProfile.h" +#include + using namespace o2; using namespace o2::framework; From a743f0b2db9eeda87103bca908695aafe476cf73 Mon Sep 17 00:00:00 2001 From: jesgum Date: Mon, 7 Jul 2025 12:30:50 +0200 Subject: [PATCH 4/5] Update --- Common/Tasks/centralityStudy.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Common/Tasks/centralityStudy.cxx b/Common/Tasks/centralityStudy.cxx index c37ec7454a2..a71be7ec7d3 100644 --- a/Common/Tasks/centralityStudy.cxx +++ b/Common/Tasks/centralityStudy.cxx @@ -84,7 +84,7 @@ struct centralityStudy { Configurable ccdbURL{"ccdbURL", "http://alice-ccdb.cern.ch", "ccdb url"}; Configurable pathGRPECSObject{"pathGRPECSObject", "GLO/Config/GRPECS", "Path to GRPECS object"}; Configurable irSource{"irSource", "ZNC hadronic", "Source of the interaction rate: (Recommended: pp --> T0VTX, Pb-Pb --> ZNC hadronic)"}; - Configurable fIRCrashOnNull{"fIRCrashOnNull", false, "Flag to avoid CTP RateFetcher crash."}; + Configurable irCrashOnNull{"irCrashOnNull", false, "Flag to avoid CTP RateFetcher crash."}; // _______________________________________ // upc rejection criteria @@ -445,7 +445,7 @@ struct centralityStudy { uint64_t startOfRunTimestamp = grpo->getTimeStart(); float hoursAfterStartOfRun = static_cast(bcTimestamp - startOfRunTimestamp) / 3600000.0; - float interactionRate = mRateFetcher.fetch(ccdb.service, bcTimestamp, collision.multRunNumber(), irSource.value, fIRCrashOnNull) / 1000.; // kHz + float interactionRate = mRateFetcher.fetch(ccdb.service, bcTimestamp, collision.multRunNumber(), irSource.value, irCrashOnNull) / 1000.; // kHz histos.fill(HIST("hFT0AvsTime"), hoursAfterStartOfRun, collision.multFT0A()); histos.fill(HIST("hFT0CvsTime"), hoursAfterStartOfRun, collision.multFT0C()); From 451b75c89cf8cd5d46a482c1275b5b29902ea910 Mon Sep 17 00:00:00 2001 From: jesgum Date: Mon, 7 Jul 2025 12:33:32 +0200 Subject: [PATCH 5/5] Update --- Common/Tasks/centralityStudy.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/Tasks/centralityStudy.cxx b/Common/Tasks/centralityStudy.cxx index a71be7ec7d3..0ada553645d 100644 --- a/Common/Tasks/centralityStudy.cxx +++ b/Common/Tasks/centralityStudy.cxx @@ -130,7 +130,7 @@ struct centralityStudy { ConfigurableAxis axisPVChi2{"axisPVChi2", {300, 0, 30}, "FT0C percentile"}; ConfigurableAxis axisDeltaTime{"axisDeltaTime", {300, 0, 300}, "#Delta time"}; ConfigurableAxis axisDeltaTimestamp{"axisDeltaTimestamp", {1440, 0, 24}, "#Delta timestamp - sor (hours)"}; - ConfigurableAxis axisInteractionRate{"IRbinning", {500, 0, 100}, "Binning for the interaction rate (kHz)"}; + ConfigurableAxis axisInteractionRate{"axisInteractionRate", {500, 0, 100}, "Binning for the interaction rate (kHz)"}; // For profile Z ConfigurableAxis axisPVz{"axisPVz", {400, -20.0f, +20.0f}, "PVz (cm)"};