From 39289f5cde600bd550611dea3d4dade010a3fd39 Mon Sep 17 00:00:00 2001 From: arkaprabha Date: Wed, 17 Sep 2025 19:02:24 +0200 Subject: [PATCH 01/13] Add new task for nuclei analysis in light ions. --- PWGLF/Tasks/Nuspex/Antinucleitask.cxx | 161 ++++++++++++++++++++++++++ PWGLF/Tasks/Nuspex/CMakeLists.txt | 5 + 2 files changed, 166 insertions(+) create mode 100644 PWGLF/Tasks/Nuspex/Antinucleitask.cxx diff --git a/PWGLF/Tasks/Nuspex/Antinucleitask.cxx b/PWGLF/Tasks/Nuspex/Antinucleitask.cxx new file mode 100644 index 00000000000..5ce6af4918c --- /dev/null +++ b/PWGLF/Tasks/Nuspex/Antinucleitask.cxx @@ -0,0 +1,161 @@ +// 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 Antinucleitask.cxx +/// +/// \author Arkaprabha Saha +/// +/// \brief An analysis task to select and analyze anti-nuclei events and tracks. + +#include "Framework/runDataProcessing.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/AnalysisDataModel.h" +#include +#include +#include "Common/DataModel/EventSelection.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/DataModel/PIDResponse.h" +#include "Common/Core/PID/TPCPIDResponse.h" +#include "Common/DataModel/TrackSelectionTables.h" +#include "Common/DataModel/Centrality.h" +#include "DataFormatsTPC/BetheBlochAleph.h" + +using namespace o2; +using namespace o2::framework; +using CollisionWithEvSel = soa::Join; +using TotalTracks = soa::Join; + +namespace { +static const std::vector particleName{"d"}; +static const double kBetheBlochDefault[6]{-1.e32, -1.e32, -1.e32, -1.e32, -1.e32, -1.e32}; +static const std::vector betheBlochParNames{"p0", "p1", "p2", "p3", "p4", "resolution"}; +} + +struct Antinucleitask { + // Histogram registry: for holding histograms + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + // Configurable track cuts + Configurable mtrackNclusTPCcut{"trackNclusTPCcut", 70.0f, "min number of TPC clusters"}; + Configurable mtrackNclusITScut{"trackNclusITScut", 4.0f, "min number of ITS clusters"}; + Configurable mChi2TPC{"Chi2TPC", 4.0f, "max chi2 per cluster TPC"}; + Configurable mChi2ITS{"Chi2ITS", 36.0f, "max chi2 per cluster ITS"}; + Configurable mtrackDCAz{"trackDCAz", 0.1f, "maxDCAz"}; + Configurable mtrackDCAxy{"trackDCAxy", 0.1f, "maxDCAxy"}; + Configurable> cfgBetheBlochParams{"cfgBetheBlochParams", {kBetheBlochDefault, 1, 6, particleName, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for deuteron"}; + + void init(InitContext const&) + { // Defining the Histogram Axes + ConfigurableAxis etaAxis{"etaAxis", {16, -0.8, +0.8}, "#eta"}; + ConfigurableAxis phiAxis{"phiAxis", {70, 0.f, 7.f}, "#phi"}; + ConfigurableAxis zVtxAxis{"zVtxAxis", {100, -20.f, 20.f}, "Primary Vertex z (cm)"}; + ConfigurableAxis NSigmaAxis{"NSigmaAxis", {50, -5.f, 5.f}, "N_{#sigma}"}; + ConfigurableAxis ptAxis{"ptAxis", {100, -5.0f, 5.0f}, "p_{T} (GeV/c)"}; + ConfigurableAxis centAxis{"centAxis", {100, 0, 100.0f}, "Centrality"}; + ConfigurableAxis momAxis{"momAxis", {5.e2, 0.f, 5.f}, "momentum axis binning"}; + ConfigurableAxis tpcAxis{"tpcAxis", {4.e2, 0.f, 4.e3f}, "tpc signal axis binning"}; + + + // Creating histograms + histos.add("RawzVtx", "RawzVtx", kTH1F, {{zVtxAxis, "Primary Vertex z (cm)"}}); + histos.add("zVtx", "zVtx", kTH1F,{{zVtxAxis, "Primary Vertex z (cm)"}}); + histos.add("RawEta", "RawEta", kTH1F, {{etaAxis, "#eta"}}); + histos.add("Eta", "Eta", kTH1F, {{etaAxis, "#eta"}}); + histos.add("RawPhi", "RawPhi", kTH1F, {{phiAxis, "#phi (rad)"}}); + histos.add("Phi", "Phi", kTH1F, {{phiAxis, "#phi (rad)"}}); + histos.add("RawPt", "RawPt", kTH1F, {{ptAxis, "#it{p}_{T} (GeV/#it{c})"}}); + histos.add("Pt", "Pt", kTH1F, {{ptAxis, "#it{p}_{T} (GeV/#it{c})"}}); + histos.add("TpcSignal", "TpcSignal", kTH2F, {{momAxis, "#it{p}_{TPC} (GeV/#it{c})"}, {tpcAxis, "d#it{E}/d#it{x}_{TPC}"}}); + histos.add("RawtpcNSigma", "RawtpcNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}}); + histos.add("tpcNSigma", "tpcNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}}); + histos.add("RawtofNSigma", "RawtofNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}}); + histos.add("tofNSigma", "tofNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}}); + + } + + //Function to apply track cuts + template + bool isGoodTrack(const T& track) + { + if (track.eta() > 0.8f) return false; + if (track.tpcNClsFound() < mtrackNclusTPCcut) return false; + if (track.tpcNClsCrossedRows() < 70) return false; + if (track.itsNCls() < mtrackNclusITScut) return false; + if (track.tpcChi2NCl() > mChi2TPC) return false; + if (track.itsChi2NCl() > mChi2ITS) return false; + if (std::abs(track.dcaXY()) > mtrackDCAxy) return false; + if (std::abs(track.dcaZ()) > mtrackDCAz) return false; + + return true; + } + + // The process function + void process(CollisionWithEvSel::iterator const& collision, TotalTracks const& tracks) + { + // Event Selection + if (std::abs(collision.posZ()) > 10.f) { + return; + } + + // Filling the z-vertex histogram before the event selection cuts. + histos.fill(HIST("RawzVtx"), collision.posZ()); + + // Applying the built-in O2 event selection (sel8). + if (!collision.sel8()) { + return; + } + + // Filling the z-vertex histogram after the event selection cuts. + histos.fill(HIST("zVtx"), collision.posZ()); + + // Track Selection + for (auto& track : tracks) { + + double expBethe{tpc::BetheBlochAleph(static_cast(track.tpcInnerParam() / o2::constants::physics::MassDeuteron), cfgBetheBlochParams->get("p0"), cfgBetheBlochParams->get("p1"), cfgBetheBlochParams->get("p2"), cfgBetheBlochParams->get("p3"), cfgBetheBlochParams->get("p4"))}; + double expSigma{expBethe * cfgBetheBlochParams->get("resolution")}; + float tpcNSigmaDeuteron = static_cast((track.tpcSignal() - expBethe) / expSigma); + + float pt = track.sign() > 0 ? track.pt() : -track.pt(); + // Filling histograms with track data before applying any cuts. + histos.fill(HIST("RawEta"), track.eta()); + histos.fill(HIST("RawPhi"), track.phi()); + histos.fill(HIST("RawPt"), pt); + histos.fill(HIST("RawtpcNSigma"), collision.centFT0C(), pt, tpcNSigmaDeuteron); + histos.fill(HIST("RawtofNSigma"), collision.centFT0C(), pt, track.tofNSigmaDe()); + + // If the track is good, fill the "after cuts" histograms. + if (isGoodTrack(track)) { + histos.fill(HIST("Eta"), track.eta()); + histos.fill(HIST("Phi"), track.phi()); + histos.fill(HIST("Pt"), pt); + + histos.fill(HIST("tpcNSigma"), collision.centFT0C(), pt, tpcNSigmaDeuteron); + + histos.fill(HIST("TpcSignal"), track.tpcInnerParam(), track.tpcSignal()); + + if (std::abs(tpcNSigmaDeuteron)< 3.f) { + histos.fill(HIST("tofNSigma"), collision.centFT0C(), pt, track.tofNSigmaDe()); + } + + } + } + } + + PROCESS_SWITCH(Antinucleitask, process, "process", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} \ No newline at end of file diff --git a/PWGLF/Tasks/Nuspex/CMakeLists.txt b/PWGLF/Tasks/Nuspex/CMakeLists.txt index 8f134d60175..d7850707e40 100644 --- a/PWGLF/Tasks/Nuspex/CMakeLists.txt +++ b/PWGLF/Tasks/Nuspex/CMakeLists.txt @@ -119,6 +119,11 @@ o2physics_add_dpl_workflow(nuclei-ebye PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) +o2physics_add_dpl_workflow(anti-nuclei-hist + SOURCES Antinucleitask.cxx + PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore + COMPONENT_NAME Analysis) + o2physics_add_dpl_workflow(nuclei-toward-transv SOURCES nuclei_in_toward_transv_regions.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore From 9d96b02faf5769d642ef666779c11ccaeb51ac64 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 17 Sep 2025 17:17:20 +0000 Subject: [PATCH 02/13] Please consider the following formatting changes --- PWGLF/Tasks/Nuspex/Antinucleitask.cxx | 74 +++++++++++++++------------ 1 file changed, 42 insertions(+), 32 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/Antinucleitask.cxx b/PWGLF/Tasks/Nuspex/Antinucleitask.cxx index 5ce6af4918c..030a15028af 100644 --- a/PWGLF/Tasks/Nuspex/Antinucleitask.cxx +++ b/PWGLF/Tasks/Nuspex/Antinucleitask.cxx @@ -15,31 +15,35 @@ /// /// \brief An analysis task to select and analyze anti-nuclei events and tracks. -#include "Framework/runDataProcessing.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/AnalysisDataModel.h" -#include -#include -#include "Common/DataModel/EventSelection.h" +#include "Common/Core/PID/TPCPIDResponse.h" #include "Common/Core/TrackSelection.h" #include "Common/Core/TrackSelectionDefaults.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" -#include "Common/Core/PID/TPCPIDResponse.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "Common/DataModel/Centrality.h" + #include "DataFormatsTPC/BetheBlochAleph.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" + +#include + +#include using namespace o2; using namespace o2::framework; using CollisionWithEvSel = soa::Join; using TotalTracks = soa::Join; -namespace { -static const std::vector particleName{"d"}; +namespace +{ +static const std::vector particleName{"d"}; static const double kBetheBlochDefault[6]{-1.e32, -1.e32, -1.e32, -1.e32, -1.e32, -1.e32}; static const std::vector betheBlochParNames{"p0", "p1", "p2", "p3", "p4", "resolution"}; -} +} // namespace struct Antinucleitask { // Histogram registry: for holding histograms @@ -55,7 +59,7 @@ struct Antinucleitask { Configurable> cfgBetheBlochParams{"cfgBetheBlochParams", {kBetheBlochDefault, 1, 6, particleName, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for deuteron"}; void init(InitContext const&) - { // Defining the Histogram Axes + { // Defining the Histogram Axes ConfigurableAxis etaAxis{"etaAxis", {16, -0.8, +0.8}, "#eta"}; ConfigurableAxis phiAxis{"phiAxis", {70, 0.f, 7.f}, "#phi"}; ConfigurableAxis zVtxAxis{"zVtxAxis", {100, -20.f, 20.f}, "Primary Vertex z (cm)"}; @@ -64,11 +68,10 @@ struct Antinucleitask { ConfigurableAxis centAxis{"centAxis", {100, 0, 100.0f}, "Centrality"}; ConfigurableAxis momAxis{"momAxis", {5.e2, 0.f, 5.f}, "momentum axis binning"}; ConfigurableAxis tpcAxis{"tpcAxis", {4.e2, 0.f, 4.e3f}, "tpc signal axis binning"}; - // Creating histograms histos.add("RawzVtx", "RawzVtx", kTH1F, {{zVtxAxis, "Primary Vertex z (cm)"}}); - histos.add("zVtx", "zVtx", kTH1F,{{zVtxAxis, "Primary Vertex z (cm)"}}); + histos.add("zVtx", "zVtx", kTH1F, {{zVtxAxis, "Primary Vertex z (cm)"}}); histos.add("RawEta", "RawEta", kTH1F, {{etaAxis, "#eta"}}); histos.add("Eta", "Eta", kTH1F, {{etaAxis, "#eta"}}); histos.add("RawPhi", "RawPhi", kTH1F, {{phiAxis, "#phi (rad)"}}); @@ -80,21 +83,28 @@ struct Antinucleitask { histos.add("tpcNSigma", "tpcNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}}); histos.add("RawtofNSigma", "RawtofNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}}); histos.add("tofNSigma", "tofNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}}); - } - //Function to apply track cuts + // Function to apply track cuts template bool isGoodTrack(const T& track) { - if (track.eta() > 0.8f) return false; - if (track.tpcNClsFound() < mtrackNclusTPCcut) return false; - if (track.tpcNClsCrossedRows() < 70) return false; - if (track.itsNCls() < mtrackNclusITScut) return false; - if (track.tpcChi2NCl() > mChi2TPC) return false; - if (track.itsChi2NCl() > mChi2ITS) return false; - if (std::abs(track.dcaXY()) > mtrackDCAxy) return false; - if (std::abs(track.dcaZ()) > mtrackDCAz) return false; + if (track.eta() > 0.8f) + return false; + if (track.tpcNClsFound() < mtrackNclusTPCcut) + return false; + if (track.tpcNClsCrossedRows() < 70) + return false; + if (track.itsNCls() < mtrackNclusITScut) + return false; + if (track.tpcChi2NCl() > mChi2TPC) + return false; + if (track.itsChi2NCl() > mChi2ITS) + return false; + if (std::abs(track.dcaXY()) > mtrackDCAxy) + return false; + if (std::abs(track.dcaZ()) > mtrackDCAz) + return false; return true; } @@ -132,21 +142,20 @@ struct Antinucleitask { histos.fill(HIST("RawPt"), pt); histos.fill(HIST("RawtpcNSigma"), collision.centFT0C(), pt, tpcNSigmaDeuteron); histos.fill(HIST("RawtofNSigma"), collision.centFT0C(), pt, track.tofNSigmaDe()); - + // If the track is good, fill the "after cuts" histograms. if (isGoodTrack(track)) { histos.fill(HIST("Eta"), track.eta()); histos.fill(HIST("Phi"), track.phi()); histos.fill(HIST("Pt"), pt); - + histos.fill(HIST("tpcNSigma"), collision.centFT0C(), pt, tpcNSigmaDeuteron); histos.fill(HIST("TpcSignal"), track.tpcInnerParam(), track.tpcSignal()); - if (std::abs(tpcNSigmaDeuteron)< 3.f) { - histos.fill(HIST("tofNSigma"), collision.centFT0C(), pt, track.tofNSigmaDe()); - } - + if (std::abs(tpcNSigmaDeuteron) < 3.f) { + histos.fill(HIST("tofNSigma"), collision.centFT0C(), pt, track.tofNSigmaDe()); + } } } } @@ -158,4 +167,5 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ adaptAnalysisTask(cfgc)}; -} \ No newline at end of file +} + \ No newline at end of file From fb6337b131818b0a8f17db0ebcd3fbb46c41c69d Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 17 Sep 2025 17:19:38 +0000 Subject: [PATCH 03/13] Please consider the following formatting changes --- PWGLF/Tasks/Nuspex/Antinucleitask.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGLF/Tasks/Nuspex/Antinucleitask.cxx b/PWGLF/Tasks/Nuspex/Antinucleitask.cxx index 030a15028af..f90fd56d5ed 100644 --- a/PWGLF/Tasks/Nuspex/Antinucleitask.cxx +++ b/PWGLF/Tasks/Nuspex/Antinucleitask.cxx @@ -168,4 +168,3 @@ WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) return WorkflowSpec{ adaptAnalysisTask(cfgc)}; } - \ No newline at end of file From 8c5a3af7c67618007d734b2dd2b68de28bbad749 Mon Sep 17 00:00:00 2001 From: arkaprabha Date: Wed, 17 Sep 2025 19:31:51 +0200 Subject: [PATCH 04/13] Fix copyright notice --- PWGLF/Tasks/Nuspex/Antinucleitask.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/Antinucleitask.cxx b/PWGLF/Tasks/Nuspex/Antinucleitask.cxx index f90fd56d5ed..df97b30fb28 100644 --- a/PWGLF/Tasks/Nuspex/Antinucleitask.cxx +++ b/PWGLF/Tasks/Nuspex/Antinucleitask.cxx @@ -9,11 +9,9 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file Antinucleitask.cxx -/// -/// \author Arkaprabha Saha -/// -/// \brief An analysis task to select and analyze anti-nuclei events and tracks. +/// \file Antinuclitask.cxx +/// \brief task for analysing the anti nuclei in LF +/// \author Arkaprabha Saha #include "Common/Core/PID/TPCPIDResponse.h" #include "Common/Core/TrackSelection.h" From 5c8f4d1fccc90fd46513c327e61b1005df745b07 Mon Sep 17 00:00:00 2001 From: arkaprabha Date: Wed, 17 Sep 2025 19:39:45 +0200 Subject: [PATCH 05/13] Fix trailing spaces --- PWGLF/Tasks/Nuspex/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Nuspex/CMakeLists.txt b/PWGLF/Tasks/Nuspex/CMakeLists.txt index d7850707e40..cc1214d322c 100644 --- a/PWGLF/Tasks/Nuspex/CMakeLists.txt +++ b/PWGLF/Tasks/Nuspex/CMakeLists.txt @@ -123,7 +123,7 @@ o2physics_add_dpl_workflow(anti-nuclei-hist SOURCES Antinucleitask.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) - + o2physics_add_dpl_workflow(nuclei-toward-transv SOURCES nuclei_in_toward_transv_regions.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore From ff8d6f560946114ecec6ca55b48f7ca0b6ee6028 Mon Sep 17 00:00:00 2001 From: arkaprabha Date: Thu, 18 Sep 2025 11:28:12 +0200 Subject: [PATCH 06/13] Fix line ending issue --- PWGLF/Tasks/Nuspex/Antinucleitask.cxx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/Antinucleitask.cxx b/PWGLF/Tasks/Nuspex/Antinucleitask.cxx index df97b30fb28..d764ea4974d 100644 --- a/PWGLF/Tasks/Nuspex/Antinucleitask.cxx +++ b/PWGLF/Tasks/Nuspex/Antinucleitask.cxx @@ -11,7 +11,7 @@ /// \file Antinuclitask.cxx /// \brief task for analysing the anti nuclei in LF -/// \author Arkaprabha Saha +/// \author Arkaprabha Saha #include "Common/Core/PID/TPCPIDResponse.h" #include "Common/Core/TrackSelection.h" @@ -20,15 +20,12 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/TrackSelectionTables.h" - #include "DataFormatsTPC/BetheBlochAleph.h" #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" - #include - #include using namespace o2; @@ -146,9 +143,7 @@ struct Antinucleitask { histos.fill(HIST("Eta"), track.eta()); histos.fill(HIST("Phi"), track.phi()); histos.fill(HIST("Pt"), pt); - histos.fill(HIST("tpcNSigma"), collision.centFT0C(), pt, tpcNSigmaDeuteron); - histos.fill(HIST("TpcSignal"), track.tpcInnerParam(), track.tpcSignal()); if (std::abs(tpcNSigmaDeuteron) < 3.f) { From d4da0e03205424ea8129764f937d58359a7f2ddf Mon Sep 17 00:00:00 2001 From: arkaprabha Date: Thu, 18 Sep 2025 12:01:06 +0200 Subject: [PATCH 07/13] Fix copyright headers --- PWGLF/Tasks/Nuspex/Antinucleitask.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/Antinucleitask.cxx b/PWGLF/Tasks/Nuspex/Antinucleitask.cxx index d764ea4974d..fc8ab768947 100644 --- a/PWGLF/Tasks/Nuspex/Antinucleitask.cxx +++ b/PWGLF/Tasks/Nuspex/Antinucleitask.cxx @@ -8,10 +8,11 @@ // 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 Antinuclitask.cxx -/// \brief task for analysing the anti nuclei in LF -/// \author Arkaprabha Saha +/// +/// \author Arkaprabha Saha (arkaprabha.saha@cern.ch) +/// \since September 18, 2025 +/// \file Antinucleitask.cxx +/// \brief A task to analyse Anti-nuclei #include "Common/Core/PID/TPCPIDResponse.h" #include "Common/Core/TrackSelection.h" From 9d9a07a023986a827b0f99487c7d7da6790e8f13 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 18 Sep 2025 10:03:43 +0000 Subject: [PATCH 08/13] Please consider the following formatting changes --- PWGLF/Tasks/Nuspex/Antinucleitask.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PWGLF/Tasks/Nuspex/Antinucleitask.cxx b/PWGLF/Tasks/Nuspex/Antinucleitask.cxx index fc8ab768947..3c927a6b59a 100644 --- a/PWGLF/Tasks/Nuspex/Antinucleitask.cxx +++ b/PWGLF/Tasks/Nuspex/Antinucleitask.cxx @@ -21,12 +21,15 @@ #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/TrackSelectionTables.h" + #include "DataFormatsTPC/BetheBlochAleph.h" #include "Framework/AnalysisDataModel.h" #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" #include "Framework/runDataProcessing.h" + #include + #include using namespace o2; From 4a41f5b655ac1f37df614a9fe6ab76bb4baebcce Mon Sep 17 00:00:00 2001 From: arkaprabha Date: Thu, 18 Sep 2025 12:06:49 +0200 Subject: [PATCH 09/13] Fix headers --- PWGLF/Tasks/Nuspex/Antinucleitask.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGLF/Tasks/Nuspex/Antinucleitask.cxx b/PWGLF/Tasks/Nuspex/Antinucleitask.cxx index 3c927a6b59a..035fb8d04cb 100644 --- a/PWGLF/Tasks/Nuspex/Antinucleitask.cxx +++ b/PWGLF/Tasks/Nuspex/Antinucleitask.cxx @@ -31,6 +31,8 @@ #include #include +#include +#include using namespace o2; using namespace o2::framework; From 24a3126ef33e46b5b99f60068c8823f1448d0989 Mon Sep 17 00:00:00 2001 From: arkaprabha Date: Thu, 18 Sep 2025 12:30:46 +0200 Subject: [PATCH 10/13] Fix lining spaces --- PWGLF/Tasks/Nuspex/Antinucleitask.cxx | 337 +++++++++++++------------- 1 file changed, 168 insertions(+), 169 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/Antinucleitask.cxx b/PWGLF/Tasks/Nuspex/Antinucleitask.cxx index 035fb8d04cb..62df96c6929 100644 --- a/PWGLF/Tasks/Nuspex/Antinucleitask.cxx +++ b/PWGLF/Tasks/Nuspex/Antinucleitask.cxx @@ -1,169 +1,168 @@ -// 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 Arkaprabha Saha (arkaprabha.saha@cern.ch) -/// \since September 18, 2025 -/// \file Antinucleitask.cxx -/// \brief A task to analyse Anti-nuclei - -#include "Common/Core/PID/TPCPIDResponse.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/TrackSelectionDefaults.h" -#include "Common/DataModel/Centrality.h" -#include "Common/DataModel/EventSelection.h" -#include "Common/DataModel/PIDResponse.h" -#include "Common/DataModel/TrackSelectionTables.h" - -#include "DataFormatsTPC/BetheBlochAleph.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" - -#include - -#include -#include -#include - -using namespace o2; -using namespace o2::framework; -using CollisionWithEvSel = soa::Join; -using TotalTracks = soa::Join; - -namespace -{ -static const std::vector particleName{"d"}; -static const double kBetheBlochDefault[6]{-1.e32, -1.e32, -1.e32, -1.e32, -1.e32, -1.e32}; -static const std::vector betheBlochParNames{"p0", "p1", "p2", "p3", "p4", "resolution"}; -} // namespace - -struct Antinucleitask { - // Histogram registry: for holding histograms - HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; - - // Configurable track cuts - Configurable mtrackNclusTPCcut{"trackNclusTPCcut", 70.0f, "min number of TPC clusters"}; - Configurable mtrackNclusITScut{"trackNclusITScut", 4.0f, "min number of ITS clusters"}; - Configurable mChi2TPC{"Chi2TPC", 4.0f, "max chi2 per cluster TPC"}; - Configurable mChi2ITS{"Chi2ITS", 36.0f, "max chi2 per cluster ITS"}; - Configurable mtrackDCAz{"trackDCAz", 0.1f, "maxDCAz"}; - Configurable mtrackDCAxy{"trackDCAxy", 0.1f, "maxDCAxy"}; - Configurable> cfgBetheBlochParams{"cfgBetheBlochParams", {kBetheBlochDefault, 1, 6, particleName, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for deuteron"}; - - void init(InitContext const&) - { // Defining the Histogram Axes - ConfigurableAxis etaAxis{"etaAxis", {16, -0.8, +0.8}, "#eta"}; - ConfigurableAxis phiAxis{"phiAxis", {70, 0.f, 7.f}, "#phi"}; - ConfigurableAxis zVtxAxis{"zVtxAxis", {100, -20.f, 20.f}, "Primary Vertex z (cm)"}; - ConfigurableAxis NSigmaAxis{"NSigmaAxis", {50, -5.f, 5.f}, "N_{#sigma}"}; - ConfigurableAxis ptAxis{"ptAxis", {100, -5.0f, 5.0f}, "p_{T} (GeV/c)"}; - ConfigurableAxis centAxis{"centAxis", {100, 0, 100.0f}, "Centrality"}; - ConfigurableAxis momAxis{"momAxis", {5.e2, 0.f, 5.f}, "momentum axis binning"}; - ConfigurableAxis tpcAxis{"tpcAxis", {4.e2, 0.f, 4.e3f}, "tpc signal axis binning"}; - - // Creating histograms - histos.add("RawzVtx", "RawzVtx", kTH1F, {{zVtxAxis, "Primary Vertex z (cm)"}}); - histos.add("zVtx", "zVtx", kTH1F, {{zVtxAxis, "Primary Vertex z (cm)"}}); - histos.add("RawEta", "RawEta", kTH1F, {{etaAxis, "#eta"}}); - histos.add("Eta", "Eta", kTH1F, {{etaAxis, "#eta"}}); - histos.add("RawPhi", "RawPhi", kTH1F, {{phiAxis, "#phi (rad)"}}); - histos.add("Phi", "Phi", kTH1F, {{phiAxis, "#phi (rad)"}}); - histos.add("RawPt", "RawPt", kTH1F, {{ptAxis, "#it{p}_{T} (GeV/#it{c})"}}); - histos.add("Pt", "Pt", kTH1F, {{ptAxis, "#it{p}_{T} (GeV/#it{c})"}}); - histos.add("TpcSignal", "TpcSignal", kTH2F, {{momAxis, "#it{p}_{TPC} (GeV/#it{c})"}, {tpcAxis, "d#it{E}/d#it{x}_{TPC}"}}); - histos.add("RawtpcNSigma", "RawtpcNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}}); - histos.add("tpcNSigma", "tpcNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}}); - histos.add("RawtofNSigma", "RawtofNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}}); - histos.add("tofNSigma", "tofNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}}); - } - - // Function to apply track cuts - template - bool isGoodTrack(const T& track) - { - if (track.eta() > 0.8f) - return false; - if (track.tpcNClsFound() < mtrackNclusTPCcut) - return false; - if (track.tpcNClsCrossedRows() < 70) - return false; - if (track.itsNCls() < mtrackNclusITScut) - return false; - if (track.tpcChi2NCl() > mChi2TPC) - return false; - if (track.itsChi2NCl() > mChi2ITS) - return false; - if (std::abs(track.dcaXY()) > mtrackDCAxy) - return false; - if (std::abs(track.dcaZ()) > mtrackDCAz) - return false; - - return true; - } - - // The process function - void process(CollisionWithEvSel::iterator const& collision, TotalTracks const& tracks) - { - // Event Selection - if (std::abs(collision.posZ()) > 10.f) { - return; - } - - // Filling the z-vertex histogram before the event selection cuts. - histos.fill(HIST("RawzVtx"), collision.posZ()); - - // Applying the built-in O2 event selection (sel8). - if (!collision.sel8()) { - return; - } - - // Filling the z-vertex histogram after the event selection cuts. - histos.fill(HIST("zVtx"), collision.posZ()); - - // Track Selection - for (auto& track : tracks) { - - double expBethe{tpc::BetheBlochAleph(static_cast(track.tpcInnerParam() / o2::constants::physics::MassDeuteron), cfgBetheBlochParams->get("p0"), cfgBetheBlochParams->get("p1"), cfgBetheBlochParams->get("p2"), cfgBetheBlochParams->get("p3"), cfgBetheBlochParams->get("p4"))}; - double expSigma{expBethe * cfgBetheBlochParams->get("resolution")}; - float tpcNSigmaDeuteron = static_cast((track.tpcSignal() - expBethe) / expSigma); - - float pt = track.sign() > 0 ? track.pt() : -track.pt(); - // Filling histograms with track data before applying any cuts. - histos.fill(HIST("RawEta"), track.eta()); - histos.fill(HIST("RawPhi"), track.phi()); - histos.fill(HIST("RawPt"), pt); - histos.fill(HIST("RawtpcNSigma"), collision.centFT0C(), pt, tpcNSigmaDeuteron); - histos.fill(HIST("RawtofNSigma"), collision.centFT0C(), pt, track.tofNSigmaDe()); - - // If the track is good, fill the "after cuts" histograms. - if (isGoodTrack(track)) { - histos.fill(HIST("Eta"), track.eta()); - histos.fill(HIST("Phi"), track.phi()); - histos.fill(HIST("Pt"), pt); - histos.fill(HIST("tpcNSigma"), collision.centFT0C(), pt, tpcNSigmaDeuteron); - histos.fill(HIST("TpcSignal"), track.tpcInnerParam(), track.tpcSignal()); - - if (std::abs(tpcNSigmaDeuteron) < 3.f) { - histos.fill(HIST("tofNSigma"), collision.centFT0C(), pt, track.tofNSigmaDe()); - } - } - } - } - - PROCESS_SWITCH(Antinucleitask, process, "process", true); -}; - -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ - return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; -} +// 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 Antinucleitask.cxx +/// \brief A task to analyse Anti-nuclei +/// \author Arkaprabha Saha + +#include "Common/Core/PID/TPCPIDResponse.h" +#include "Common/Core/TrackSelection.h" +#include "Common/Core/TrackSelectionDefaults.h" +#include "Common/DataModel/Centrality.h" +#include "Common/DataModel/EventSelection.h" +#include "Common/DataModel/PIDResponse.h" +#include "Common/DataModel/TrackSelectionTables.h" + +#include "DataFormatsTPC/BetheBlochAleph.h" +#include "Framework/AnalysisDataModel.h" +#include "Framework/AnalysisTask.h" +#include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" + +#include + +#include +#include +#include + +using namespace o2; +using namespace o2::framework; +using CollisionWithEvSel = soa::Join; +using TotalTracks = soa::Join; + +namespace +{ +static const std::vector particleName{"d"}; +static const double kBetheBlochDefault[6]{-1.e32, -1.e32, -1.e32, -1.e32, -1.e32, -1.e32}; +static const std::vector betheBlochParNames{"p0", "p1", "p2", "p3", "p4", "resolution"}; +} // namespace + +struct Antinucleitask { + // Histogram registry: for holding histograms + HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; + + // Configurable track cuts + Configurable mtrackNclusTPCcut{"trackNclusTPCcut", 70.0f, "min number of TPC clusters"}; + Configurable mtrackNclusITScut{"trackNclusITScut", 4.0f, "min number of ITS clusters"}; + Configurable mChi2TPC{"Chi2TPC", 4.0f, "max chi2 per cluster TPC"}; + Configurable mChi2ITS{"Chi2ITS", 36.0f, "max chi2 per cluster ITS"}; + Configurable mtrackDCAz{"trackDCAz", 0.1f, "maxDCAz"}; + Configurable mtrackDCAxy{"trackDCAxy", 0.1f, "maxDCAxy"}; + Configurable> cfgBetheBlochParams{"cfgBetheBlochParams", {kBetheBlochDefault, 1, 6, particleName, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for deuteron"}; + + void init(InitContext const&) + { // Defining the Histogram Axes + ConfigurableAxis etaAxis{"etaAxis", {16, -0.8, +0.8}, "#eta"}; + ConfigurableAxis phiAxis{"phiAxis", {70, 0.f, 7.f}, "#phi"}; + ConfigurableAxis zVtxAxis{"zVtxAxis", {100, -20.f, 20.f}, "Primary Vertex z (cm)"}; + ConfigurableAxis NSigmaAxis{"NSigmaAxis", {50, -5.f, 5.f}, "N_{#sigma}"}; + ConfigurableAxis ptAxis{"ptAxis", {100, -5.0f, 5.0f}, "p_{T} (GeV/c)"}; + ConfigurableAxis centAxis{"centAxis", {100, 0, 100.0f}, "Centrality"}; + ConfigurableAxis momAxis{"momAxis", {5.e2, 0.f, 5.f}, "momentum axis binning"}; + ConfigurableAxis tpcAxis{"tpcAxis", {4.e2, 0.f, 4.e3f}, "tpc signal axis binning"}; + + // Creating histograms + histos.add("RawzVtx", "RawzVtx", kTH1F, {{zVtxAxis, "Primary Vertex z (cm)"}}); + histos.add("zVtx", "zVtx", kTH1F, {{zVtxAxis, "Primary Vertex z (cm)"}}); + histos.add("RawEta", "RawEta", kTH1F, {{etaAxis, "#eta"}}); + histos.add("Eta", "Eta", kTH1F, {{etaAxis, "#eta"}}); + histos.add("RawPhi", "RawPhi", kTH1F, {{phiAxis, "#phi (rad)"}}); + histos.add("Phi", "Phi", kTH1F, {{phiAxis, "#phi (rad)"}}); + histos.add("RawPt", "RawPt", kTH1F, {{ptAxis, "#it{p}_{T} (GeV/#it{c})"}}); + histos.add("Pt", "Pt", kTH1F, {{ptAxis, "#it{p}_{T} (GeV/#it{c})"}}); + histos.add("TpcSignal", "TpcSignal", kTH2F, {{momAxis, "#it{p}_{TPC} (GeV/#it{c})"}, {tpcAxis, "d#it{E}/d#it{x}_{TPC}"}}); + histos.add("RawtpcNSigma", "RawtpcNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}}); + histos.add("tpcNSigma", "tpcNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}}); + histos.add("RawtofNSigma", "RawtofNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}}); + histos.add("tofNSigma", "tofNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}}); + } + + // Function to apply track cuts + template + bool isGoodTrack(const T& track) + { + if (track.eta() > 0.8f) + return false; + if (track.tpcNClsFound() < mtrackNclusTPCcut) + return false; + if (track.tpcNClsCrossedRows() < 70) + return false; + if (track.itsNCls() < mtrackNclusITScut) + return false; + if (track.tpcChi2NCl() > mChi2TPC) + return false; + if (track.itsChi2NCl() > mChi2ITS) + return false; + if (std::abs(track.dcaXY()) > mtrackDCAxy) + return false; + if (std::abs(track.dcaZ()) > mtrackDCAz) + return false; + + return true; + } + + // The process function + void process(CollisionWithEvSel::iterator const& collision, TotalTracks const& tracks) + { + // Event Selection + if (std::abs(collision.posZ()) > 10.f) { + return; + } + + // Filling the z-vertex histogram before the event selection cuts. + histos.fill(HIST("RawzVtx"), collision.posZ()); + + // Applying the built-in O2 event selection (sel8). + if (!collision.sel8()) { + return; + } + + // Filling the z-vertex histogram after the event selection cuts. + histos.fill(HIST("zVtx"), collision.posZ()); + + // Track Selection + for (auto& track : tracks) { + + double expBethe{tpc::BetheBlochAleph(static_cast(track.tpcInnerParam() / o2::constants::physics::MassDeuteron), cfgBetheBlochParams->get("p0"), cfgBetheBlochParams->get("p1"), cfgBetheBlochParams->get("p2"), cfgBetheBlochParams->get("p3"), cfgBetheBlochParams->get("p4"))}; + double expSigma{expBethe * cfgBetheBlochParams->get("resolution")}; + float tpcNSigmaDeuteron = static_cast((track.tpcSignal() - expBethe) / expSigma); + + float pt = track.sign() > 0 ? track.pt() : -track.pt(); + // Filling histograms with track data before applying any cuts. + histos.fill(HIST("RawEta"), track.eta()); + histos.fill(HIST("RawPhi"), track.phi()); + histos.fill(HIST("RawPt"), pt); + histos.fill(HIST("RawtpcNSigma"), collision.centFT0C(), pt, tpcNSigmaDeuteron); + histos.fill(HIST("RawtofNSigma"), collision.centFT0C(), pt, track.tofNSigmaDe()); + + // If the track is good, fill the "after cuts" histograms. + if (isGoodTrack(track)) { + histos.fill(HIST("Eta"), track.eta()); + histos.fill(HIST("Phi"), track.phi()); + histos.fill(HIST("Pt"), pt); + histos.fill(HIST("tpcNSigma"), collision.centFT0C(), pt, tpcNSigmaDeuteron); + histos.fill(HIST("TpcSignal"), track.tpcInnerParam(), track.tpcSignal()); + + if (std::abs(tpcNSigmaDeuteron) < 3.f) { + histos.fill(HIST("tofNSigma"), collision.centFT0C(), pt, track.tofNSigmaDe()); + } + } + } + } + + PROCESS_SWITCH(Antinucleitask, process, "process", true); +}; + +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From 88eefb954a9d4500eadd0c7b61a3cdf393906013 Mon Sep 17 00:00:00 2001 From: arkaprabha Date: Thu, 18 Sep 2025 17:39:22 +0200 Subject: [PATCH 11/13] Fix file and variable naming --- ...{Antinucleitask.cxx => AntinucleiTask.cxx} | 56 ++++++++++--------- PWGLF/Tasks/Nuspex/CMakeLists.txt | 2 +- 2 files changed, 31 insertions(+), 27 deletions(-) rename PWGLF/Tasks/Nuspex/{Antinucleitask.cxx => AntinucleiTask.cxx} (78%) diff --git a/PWGLF/Tasks/Nuspex/Antinucleitask.cxx b/PWGLF/Tasks/Nuspex/AntinucleiTask.cxx similarity index 78% rename from PWGLF/Tasks/Nuspex/Antinucleitask.cxx rename to PWGLF/Tasks/Nuspex/AntinucleiTask.cxx index 62df96c6929..d91f7bbe8c9 100644 --- a/PWGLF/Tasks/Nuspex/Antinucleitask.cxx +++ b/PWGLF/Tasks/Nuspex/AntinucleiTask.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file Antinucleitask.cxx +/// \file AntinucleiTask.cxx /// \brief A task to analyse Anti-nuclei /// \author Arkaprabha Saha @@ -43,19 +43,23 @@ namespace static const std::vector particleName{"d"}; static const double kBetheBlochDefault[6]{-1.e32, -1.e32, -1.e32, -1.e32, -1.e32, -1.e32}; static const std::vector betheBlochParNames{"p0", "p1", "p2", "p3", "p4", "resolution"}; +static const float maxEtaCut = 0.8f; +static const int minTpcCrossedRowsCut = 70; +static const float maxVertexZCut = 10.f; } // namespace -struct Antinucleitask { +struct AntinucleiTask { // Histogram registry: for holding histograms HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; // Configurable track cuts - Configurable mtrackNclusTPCcut{"trackNclusTPCcut", 70.0f, "min number of TPC clusters"}; - Configurable mtrackNclusITScut{"trackNclusITScut", 4.0f, "min number of ITS clusters"}; - Configurable mChi2TPC{"Chi2TPC", 4.0f, "max chi2 per cluster TPC"}; - Configurable mChi2ITS{"Chi2ITS", 36.0f, "max chi2 per cluster ITS"}; - Configurable mtrackDCAz{"trackDCAz", 0.1f, "maxDCAz"}; - Configurable mtrackDCAxy{"trackDCAxy", 0.1f, "maxDCAxy"}; + Configurable trackNclusTPCcut{"trackNclusTPCcut", 70.0f, "min number of TPC clusters"}; + Configurable trackNclusITScut{"trackNclusITScut", 4.0f, "min number of ITS clusters"}; + Configurable chi2TPC{"chi2TPC", 4.0f, "max chi2 per cluster TPC"}; + Configurable chi2ITS{"chi2ITS", 36.0f, "max chi2 per cluster ITS"}; + Configurable trackDCAz{"trackDCAz", 0.1f, "maxDCAz"}; + Configurable trackDCAxy{"trackDCAxy", 0.1f, "maxDCAxy"}; + Configurable tpcNSigmaCut{"tpcNSigmaCut", 3.0f, "tpcNSigmaCut"}; Configurable> cfgBetheBlochParams{"cfgBetheBlochParams", {kBetheBlochDefault, 1, 6, particleName, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for deuteron"}; void init(InitContext const&) @@ -63,7 +67,7 @@ struct Antinucleitask { ConfigurableAxis etaAxis{"etaAxis", {16, -0.8, +0.8}, "#eta"}; ConfigurableAxis phiAxis{"phiAxis", {70, 0.f, 7.f}, "#phi"}; ConfigurableAxis zVtxAxis{"zVtxAxis", {100, -20.f, 20.f}, "Primary Vertex z (cm)"}; - ConfigurableAxis NSigmaAxis{"NSigmaAxis", {50, -5.f, 5.f}, "N_{#sigma}"}; + ConfigurableAxis nSigmaAxis{"nSigmaAxis", {50, -5.f, 5.f}, "N_{#sigma}"}; ConfigurableAxis ptAxis{"ptAxis", {100, -5.0f, 5.0f}, "p_{T} (GeV/c)"}; ConfigurableAxis centAxis{"centAxis", {100, 0, 100.0f}, "Centrality"}; ConfigurableAxis momAxis{"momAxis", {5.e2, 0.f, 5.f}, "momentum axis binning"}; @@ -79,31 +83,31 @@ struct Antinucleitask { histos.add("RawPt", "RawPt", kTH1F, {{ptAxis, "#it{p}_{T} (GeV/#it{c})"}}); histos.add("Pt", "Pt", kTH1F, {{ptAxis, "#it{p}_{T} (GeV/#it{c})"}}); histos.add("TpcSignal", "TpcSignal", kTH2F, {{momAxis, "#it{p}_{TPC} (GeV/#it{c})"}, {tpcAxis, "d#it{E}/d#it{x}_{TPC}"}}); - histos.add("RawtpcNSigma", "RawtpcNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}}); - histos.add("tpcNSigma", "tpcNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}}); - histos.add("RawtofNSigma", "RawtofNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}}); - histos.add("tofNSigma", "tofNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {NSigmaAxis, "N_{#sigma}"}}); + histos.add("RawtpcNSigma", "RawtpcNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {nSigmaAxis, "N_{#sigma}"}}); + histos.add("tpcNSigma", "tpcNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {nSigmaAxis, "N_{#sigma}"}}); + histos.add("RawtofNSigma", "RawtofNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {nSigmaAxis, "N_{#sigma}"}}); + histos.add("tofNSigma", "tofNSigma", kTH3F, {{centAxis, "Centrality"}, {ptAxis, "#it{p}_{T} (GeV/#it{c})"}, {nSigmaAxis, "N_{#sigma}"}}); } // Function to apply track cuts template bool isGoodTrack(const T& track) { - if (track.eta() > 0.8f) + if (track.eta() > maxEtaCut) return false; - if (track.tpcNClsFound() < mtrackNclusTPCcut) + if (track.tpcNClsFound() < trackNclusTPCcut) return false; - if (track.tpcNClsCrossedRows() < 70) + if (track.tpcNClsCrossedRows() < minTpcCrossedRowsCut) return false; - if (track.itsNCls() < mtrackNclusITScut) + if (track.itsNCls() < trackNclusITScut) return false; - if (track.tpcChi2NCl() > mChi2TPC) + if (track.tpcChi2NCl() > chi2TPC) return false; - if (track.itsChi2NCl() > mChi2ITS) + if (track.itsChi2NCl() > chi2ITS) return false; - if (std::abs(track.dcaXY()) > mtrackDCAxy) + if (std::abs(track.dcaXY()) > trackDCAxy) return false; - if (std::abs(track.dcaZ()) > mtrackDCAz) + if (std::abs(track.dcaZ()) > trackDCAz) return false; return true; @@ -113,7 +117,7 @@ struct Antinucleitask { void process(CollisionWithEvSel::iterator const& collision, TotalTracks const& tracks) { // Event Selection - if (std::abs(collision.posZ()) > 10.f) { + if (std::abs(collision.posZ()) > maxVertexZCut) { return; } @@ -129,7 +133,7 @@ struct Antinucleitask { histos.fill(HIST("zVtx"), collision.posZ()); // Track Selection - for (auto& track : tracks) { + for (const auto& track : tracks) { double expBethe{tpc::BetheBlochAleph(static_cast(track.tpcInnerParam() / o2::constants::physics::MassDeuteron), cfgBetheBlochParams->get("p0"), cfgBetheBlochParams->get("p1"), cfgBetheBlochParams->get("p2"), cfgBetheBlochParams->get("p3"), cfgBetheBlochParams->get("p4"))}; double expSigma{expBethe * cfgBetheBlochParams->get("resolution")}; @@ -151,18 +155,18 @@ struct Antinucleitask { histos.fill(HIST("tpcNSigma"), collision.centFT0C(), pt, tpcNSigmaDeuteron); histos.fill(HIST("TpcSignal"), track.tpcInnerParam(), track.tpcSignal()); - if (std::abs(tpcNSigmaDeuteron) < 3.f) { + if (std::abs(tpcNSigmaDeuteron) < tpcNSigmaCut) { histos.fill(HIST("tofNSigma"), collision.centFT0C(), pt, track.tofNSigmaDe()); } } } } - PROCESS_SWITCH(Antinucleitask, process, "process", true); + PROCESS_SWITCH(AntinucleiTask, process, "process", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; } diff --git a/PWGLF/Tasks/Nuspex/CMakeLists.txt b/PWGLF/Tasks/Nuspex/CMakeLists.txt index cc1214d322c..8144b39bbae 100644 --- a/PWGLF/Tasks/Nuspex/CMakeLists.txt +++ b/PWGLF/Tasks/Nuspex/CMakeLists.txt @@ -120,7 +120,7 @@ o2physics_add_dpl_workflow(nuclei-ebye COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(anti-nuclei-hist - SOURCES Antinucleitask.cxx + SOURCES AntinucleiTask.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) From c37f061adcefa78e00af1b106da1491a50cc8a6f Mon Sep 17 00:00:00 2001 From: arkaprabha Date: Thu, 18 Sep 2025 18:16:15 +0200 Subject: [PATCH 12/13] Fix the file name --- .../Nuspex/{AntinucleiTask.cxx => AntiNucleiTask.cxx} | 8 ++++---- PWGLF/Tasks/Nuspex/CMakeLists.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) rename PWGLF/Tasks/Nuspex/{AntinucleiTask.cxx => AntiNucleiTask.cxx} (97%) diff --git a/PWGLF/Tasks/Nuspex/AntinucleiTask.cxx b/PWGLF/Tasks/Nuspex/AntiNucleiTask.cxx similarity index 97% rename from PWGLF/Tasks/Nuspex/AntinucleiTask.cxx rename to PWGLF/Tasks/Nuspex/AntiNucleiTask.cxx index d91f7bbe8c9..de5f7ec5a4b 100644 --- a/PWGLF/Tasks/Nuspex/AntinucleiTask.cxx +++ b/PWGLF/Tasks/Nuspex/AntiNucleiTask.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file AntinucleiTask.cxx +/// \file AntiNucleiTask.cxx /// \brief A task to analyse Anti-nuclei /// \author Arkaprabha Saha @@ -48,7 +48,7 @@ static const int minTpcCrossedRowsCut = 70; static const float maxVertexZCut = 10.f; } // namespace -struct AntinucleiTask { +struct AntiNucleiTask { // Histogram registry: for holding histograms HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -162,11 +162,11 @@ struct AntinucleiTask { } } - PROCESS_SWITCH(AntinucleiTask, process, "process", true); + PROCESS_SWITCH(AntiNucleiTask, process, "process", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; } diff --git a/PWGLF/Tasks/Nuspex/CMakeLists.txt b/PWGLF/Tasks/Nuspex/CMakeLists.txt index 8144b39bbae..cfae47d4ab6 100644 --- a/PWGLF/Tasks/Nuspex/CMakeLists.txt +++ b/PWGLF/Tasks/Nuspex/CMakeLists.txt @@ -120,7 +120,7 @@ o2physics_add_dpl_workflow(nuclei-ebye COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(anti-nuclei-hist - SOURCES AntinucleiTask.cxx + SOURCES AntiNucleiTask.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) From 10d85c80aed01a54d491a557c9a79748c1375fde Mon Sep 17 00:00:00 2001 From: arkaprabha Date: Thu, 18 Sep 2025 19:20:36 +0200 Subject: [PATCH 13/13] Fix file naming --- PWGLF/Tasks/Nuspex/CMakeLists.txt | 2 +- .../Nuspex/{AntiNucleiTask.cxx => antinucleiTask.cxx} | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) rename PWGLF/Tasks/Nuspex/{AntiNucleiTask.cxx => antinucleiTask.cxx} (97%) diff --git a/PWGLF/Tasks/Nuspex/CMakeLists.txt b/PWGLF/Tasks/Nuspex/CMakeLists.txt index cfae47d4ab6..38d5704f683 100644 --- a/PWGLF/Tasks/Nuspex/CMakeLists.txt +++ b/PWGLF/Tasks/Nuspex/CMakeLists.txt @@ -120,7 +120,7 @@ o2physics_add_dpl_workflow(nuclei-ebye COMPONENT_NAME Analysis) o2physics_add_dpl_workflow(anti-nuclei-hist - SOURCES AntiNucleiTask.cxx + SOURCES antinucleiTask.cxx PUBLIC_LINK_LIBRARIES O2Physics::AnalysisCore COMPONENT_NAME Analysis) diff --git a/PWGLF/Tasks/Nuspex/AntiNucleiTask.cxx b/PWGLF/Tasks/Nuspex/antinucleiTask.cxx similarity index 97% rename from PWGLF/Tasks/Nuspex/AntiNucleiTask.cxx rename to PWGLF/Tasks/Nuspex/antinucleiTask.cxx index de5f7ec5a4b..7cf38de948f 100644 --- a/PWGLF/Tasks/Nuspex/AntiNucleiTask.cxx +++ b/PWGLF/Tasks/Nuspex/antinucleiTask.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file AntiNucleiTask.cxx +/// \file antinucleiTask.cxx /// \brief A task to analyse Anti-nuclei /// \author Arkaprabha Saha @@ -48,7 +48,7 @@ static const int minTpcCrossedRowsCut = 70; static const float maxVertexZCut = 10.f; } // namespace -struct AntiNucleiTask { +struct antinucleiTask { // Histogram registry: for holding histograms HistogramRegistry histos{"histos", {}, OutputObjHandlingPolicy::AnalysisObject}; @@ -162,11 +162,11 @@ struct AntiNucleiTask { } } - PROCESS_SWITCH(AntiNucleiTask, process, "process", true); + PROCESS_SWITCH(antinucleiTask, process, "process", true); }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; }