|
| 1 | +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. |
| 2 | +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. |
| 3 | +// All rights not expressly granted are reserved. |
| 4 | +// |
| 5 | +// This software is distributed under the terms of the GNU General Public |
| 6 | +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". |
| 7 | +// |
| 8 | +// In applying this license CERN does not waive the privileges and immunities |
| 9 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 10 | +// or submit itself to any jurisdiction. |
| 11 | +// |
| 12 | +/// \file sgDeuteronSpectra.cxx |
| 13 | +/// \brief Analysis for the (anti)deuteron production in UPC |
| 14 | +/// \author Marika Rasa |
| 15 | +/// \since September 2026 |
| 16 | + |
| 17 | +#include "PWGUD/Core/SGSelector.h" |
| 18 | +#include "PWGUD/Core/SGTrackSelector.h" |
| 19 | +#include "PWGUD/DataModel/UDTables.h" |
| 20 | + |
| 21 | +#include <Framework/ASoA.h> |
| 22 | +#include <Framework/AnalysisTask.h> |
| 23 | +#include <Framework/Configurable.h> |
| 24 | +#include <Framework/HistogramRegistry.h> |
| 25 | +#include <Framework/HistogramSpec.h> |
| 26 | +#include <Framework/InitContext.h> |
| 27 | +#include <Framework/runDataProcessing.h> |
| 28 | + |
| 29 | +#include <cmath> |
| 30 | +#include <vector> |
| 31 | + |
| 32 | +using namespace o2; |
| 33 | +using namespace o2::framework; |
| 34 | +using namespace o2::framework::expressions; |
| 35 | + |
| 36 | +struct SgDeuteronSpectra { |
| 37 | + // UPC cuts |
| 38 | + SGSelector sgSelector; |
| 39 | + Configurable<float> fv0Cut{"fv0Cut", 50., "FV0A threshold"}; |
| 40 | + Configurable<float> zdcCut{"zdcCut", 10., "ZDC threshold"}; |
| 41 | + Configurable<float> ft0aCut{"ft0aCut", 150., "FT0A threshold"}; |
| 42 | + Configurable<float> ft0cCut{"ft0cCut", 50., "FT0C threshold"}; |
| 43 | + Configurable<float> fddaCut{"fddaCut", 10000., "FDDA threshold"}; |
| 44 | + Configurable<float> fddcCut{"fddcCut", 10000., "FDDC threshold"}; |
| 45 | + |
| 46 | + // Track cuts |
| 47 | + Configurable<float> pvCut{"pvCut", 1.0, "Use Only PV tracks"}; |
| 48 | + Configurable<float> dcaZCut{"dcaZCut", 2.0, "dcaZ cut"}; |
| 49 | + Configurable<float> dcaXYCut{"dcaXYCut", 0.0, "dcaXY cut (0 for Pt-function)"}; |
| 50 | + Configurable<float> tpcChi2Cut{"tpcChi2Cut", 4, "Max tpcChi2NCl"}; |
| 51 | + Configurable<float> tpcNClsFindableCut{"tpcNClsFindableCut", 70, "Min tpcNClsFindable"}; |
| 52 | + Configurable<float> itsChi2Cut{"itsChi2Cut", 36, "Max itsChi2NCl"}; |
| 53 | + Configurable<float> etaCut{"etaCut", 0.9, "Track Pseudorapidity"}; |
| 54 | + Configurable<float> ptCut{"ptCut", 0.1, "Track Pt"}; |
| 55 | + Configurable<float> nsigmatpcPreselCut{"nsigmatpcPreselCut", 3.0, "nsigma TPC preselection cut for TOF analysis"}; |
| 56 | + |
| 57 | + // Configurable axis for histograms |
| 58 | + ConfigurableAxis ptAxis{"ptAxis", {200, 0.0, 10.0}, "p_{T}"}; |
| 59 | + ConfigurableAxis nSigmaAxis{"nSigmaAxis", {800, -20.0, 20.0}, "nSigma axis for TPC and TOF"}; |
| 60 | + |
| 61 | + // Initialize histogram registry |
| 62 | + HistogramRegistry registry{"registry", {}}; |
| 63 | + |
| 64 | + void init(InitContext&) |
| 65 | + { |
| 66 | + const AxisSpec axispt{ptAxis, "p_{T}"}; |
| 67 | + const AxisSpec axistpc{nSigmaAxis, "n#sigma_{TPC}"}; |
| 68 | + const AxisSpec axistof{nSigmaAxis, "n#sigma_{TOF}"}; |
| 69 | + |
| 70 | + // Collision histograms |
| 71 | + registry.add("collisions/GapSide", "Gap Side: A, C, A+C", {HistType::kTH1F, {{3, -0.5, 2.5}}}); |
| 72 | + registry.add("collisions/TrueGapSide", "Gap Side: A, C, A+C", {HistType::kTH1F, {{4, -1.5, 2.5}}}); |
| 73 | + registry.add("tracks/Deut_Pt_TPC_GapA", "", {HistType::kTH2F, {axispt, axistpc}}); |
| 74 | + registry.add("tracks/Deut_Pt_TOF_GapA", "", {HistType::kTH2F, {axispt, axistof}}); |
| 75 | + registry.add("tracks/Deut_Pt_TOF_GapA_TPCpresel", "", {HistType::kTH2F, {axispt, axistof}}); |
| 76 | + registry.add("tracks/Antideut_Pt_TPC_GapA", "", {HistType::kTH2F, {axispt, axistpc}}); |
| 77 | + registry.add("tracks/Antideut_Pt_TOF_GapA", "", {HistType::kTH2F, {axispt, axistof}}); |
| 78 | + registry.add("tracks/Antideut_Pt_TOF_GapA_TPCpresel", "", {HistType::kTH2F, {axispt, axistof}}); |
| 79 | + registry.add("tracks/Deut_Pt_TPC_GapC", "", {HistType::kTH2F, {axispt, axistpc}}); |
| 80 | + registry.add("tracks/Deut_Pt_TOF_GapC", "", {HistType::kTH2F, {axispt, axistof}}); |
| 81 | + registry.add("tracks/Deut_Pt_TOF_GapC_TPCpresel", "", {HistType::kTH2F, {axispt, axistof}}); |
| 82 | + registry.add("tracks/Antideut_Pt_TPC_GapC", "", {HistType::kTH2F, {axispt, axistpc}}); |
| 83 | + registry.add("tracks/Antideut_Pt_TOF_GapC", "", {HistType::kTH2F, {axispt, axistof}}); |
| 84 | + registry.add("tracks/Antideut_Pt_TOF_GapC_TPCpresel", "", {HistType::kTH2F, {axispt, axistof}}); |
| 85 | + registry.add("tracks/Deut_Pt_TPC_DoubleGap", "", {HistType::kTH2F, {axispt, axistpc}}); |
| 86 | + registry.add("tracks/Deut_Pt_TOF_DoubleGap", "", {HistType::kTH2F, {axispt, axistof}}); |
| 87 | + registry.add("tracks/Deut_Pt_TOF_DoubleGap_TPCpresel", "", {HistType::kTH2F, {axispt, axistof}}); |
| 88 | + registry.add("tracks/Antideut_Pt_TPC_DoubleGap", "", {HistType::kTH2F, {axispt, axistpc}}); |
| 89 | + registry.add("tracks/Antideut_Pt_TOF_DoubleGap", "", {HistType::kTH2F, {axispt, axistof}}); |
| 90 | + registry.add("tracks/Antideut_Pt_TOF_DoubleGap_TPCpresel", "", {HistType::kTH2F, {axispt, axistof}}); |
| 91 | + } |
| 92 | + |
| 93 | + // Define data types |
| 94 | + using UDCollisionsFull = soa::Join<aod::UDCollisions, aod::SGCollisions, aod::UDCollisionsSels, aod::UDZdcsReduced>; // UDCollisions |
| 95 | + using UDCollisionFull = UDCollisionsFull::iterator; |
| 96 | + using UDTracksFull = soa::Join<aod::UDTracks, aod::UDTracksPID, aod::UDTracksPIDExtra, aod::UDTracksExtra, aod::UDTracksFlags, aod::UDTracksDCA>; |
| 97 | + |
| 98 | + void process(UDCollisionFull const& coll, UDTracksFull const& tracks) |
| 99 | + { |
| 100 | + registry.fill(HIST("collisions/GapSide"), coll.gapSide(), 1.); |
| 101 | + std::vector<float> fitCut = {fv0Cut, ft0aCut, ft0cCut, fddaCut, fddcCut}; |
| 102 | + int truegapSide = sgSelector.trueGap(coll, fitCut[0], fitCut[1], fitCut[2], zdcCut); |
| 103 | + registry.fill(HIST("collisions/TrueGapSide"), truegapSide, 1.); |
| 104 | + |
| 105 | + std::vector<float> parameters = {pvCut, dcaZCut, dcaXYCut, tpcChi2Cut, tpcNClsFindableCut, itsChi2Cut, etaCut, ptCut}; |
| 106 | + |
| 107 | + for (const auto& t : tracks) { |
| 108 | + if (trackselector(t, parameters) != 0) { |
| 109 | + if (truegapSide == o2::aod::sgselector::SingleGapA) { |
| 110 | + if (t.sign() > 0) { |
| 111 | + registry.fill(HIST("tracks/Deut_Pt_TPC_GapA"), t.pt(), t.tpcNSigmaDe()); |
| 112 | + registry.fill(HIST("tracks/Deut_Pt_TOF_GapA"), t.pt(), t.tofNSigmaDe()); |
| 113 | + if (std::abs(t.tpcNSigmaDe()) < nsigmatpcPreselCut) { |
| 114 | + registry.fill(HIST("tracks/Deut_Pt_TOF_GapA_TPCpresel"), t.pt(), t.tofNSigmaDe()); |
| 115 | + } |
| 116 | + } else { |
| 117 | + registry.fill(HIST("tracks/Antideut_Pt_TPC_GapA"), t.pt(), t.tpcNSigmaDe()); |
| 118 | + registry.fill(HIST("tracks/Antideut_Pt_TOF_GapA"), t.pt(), t.tofNSigmaDe()); |
| 119 | + if (std::abs(t.tpcNSigmaDe()) < nsigmatpcPreselCut) { |
| 120 | + registry.fill(HIST("tracks/Antideut_Pt_TOF_GapA_TPCpresel"), t.pt(), t.tofNSigmaDe()); |
| 121 | + } |
| 122 | + } |
| 123 | + } |
| 124 | + |
| 125 | + if (truegapSide == o2::aod::sgselector::SingleGapC) { |
| 126 | + if (t.sign() > 0) { |
| 127 | + registry.fill(HIST("tracks/Deut_Pt_TPC_GapC"), t.pt(), t.tpcNSigmaDe()); |
| 128 | + registry.fill(HIST("tracks/Deut_Pt_TOF_GapC"), t.pt(), t.tofNSigmaDe()); |
| 129 | + if (std::abs(t.tpcNSigmaDe()) < nsigmatpcPreselCut) { |
| 130 | + registry.fill(HIST("tracks/Deut_Pt_TOF_GapC_TPCpresel"), t.pt(), t.tofNSigmaDe()); |
| 131 | + } |
| 132 | + } else { |
| 133 | + registry.fill(HIST("tracks/Antideut_Pt_TPC_GapC"), t.pt(), t.tpcNSigmaDe()); |
| 134 | + registry.fill(HIST("tracks/Antideut_Pt_TOF_GapC"), t.pt(), t.tofNSigmaDe()); |
| 135 | + if (std::abs(t.tpcNSigmaDe()) < nsigmatpcPreselCut) { |
| 136 | + registry.fill(HIST("tracks/Antideut_Pt_TOF_GapC_TPCpresel"), t.pt(), t.tofNSigmaDe()); |
| 137 | + } |
| 138 | + } |
| 139 | + } |
| 140 | + |
| 141 | + if (truegapSide == o2::aod::sgselector::DoubleGap) { |
| 142 | + if (t.sign() > 0) { |
| 143 | + registry.fill(HIST("tracks/Deut_Pt_TPC_DoubleGap"), t.pt(), t.tpcNSigmaDe()); |
| 144 | + registry.fill(HIST("tracks/Deut_Pt_TOF_DoubleGap"), t.pt(), t.tofNSigmaDe()); |
| 145 | + if (std::abs(t.tpcNSigmaDe()) < nsigmatpcPreselCut) { |
| 146 | + registry.fill(HIST("tracks/Deut_Pt_TOF_DoubleGap_TPCpresel"), t.pt(), t.tofNSigmaDe()); |
| 147 | + } |
| 148 | + } else { |
| 149 | + registry.fill(HIST("tracks/Antideut_Pt_TPC_DoubleGap"), t.pt(), t.tpcNSigmaDe()); |
| 150 | + registry.fill(HIST("tracks/Antideut_Pt_TOF_DoubleGap"), t.pt(), t.tofNSigmaDe()); |
| 151 | + if (std::abs(t.tpcNSigmaDe()) < nsigmatpcPreselCut) { |
| 152 | + registry.fill(HIST("tracks/Antideut_Pt_TOF_DoubleGap_TPCpresel"), t.pt(), t.tofNSigmaDe()); |
| 153 | + } |
| 154 | + } |
| 155 | + } |
| 156 | + } |
| 157 | + } |
| 158 | + } |
| 159 | +}; |
| 160 | + |
| 161 | +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) |
| 162 | +{ |
| 163 | + return WorkflowSpec{ |
| 164 | + adaptAnalysisTask<SgDeuteronSpectra>(cfgc), |
| 165 | + }; |
| 166 | +} |
0 commit comments