|
| 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 | +// \Single Gap Event Analyzer for (anti)deuteron production |
| 13 | +// \author Marika Rasa, marika.rasa@cern.ch |
| 14 | +// \since September 2026 |
| 15 | + |
| 16 | +#include "PWGUD/Core/SGSelector.h" |
| 17 | +#include "PWGUD/Core/SGTrackSelector.h" |
| 18 | +#include "PWGUD/DataModel/UDTables.h" |
| 19 | + |
| 20 | +#include <Framework/ASoA.h> |
| 21 | +#include <Framework/AnalysisTask.h> |
| 22 | +#include <Framework/Configurable.h> |
| 23 | +#include <Framework/HistogramRegistry.h> |
| 24 | +#include <Framework/HistogramSpec.h> |
| 25 | +#include <Framework/InitContext.h> |
| 26 | +#include <Framework/runDataProcessing.h> |
| 27 | + |
| 28 | +using namespace o2; |
| 29 | +using namespace o2::framework; |
| 30 | +using namespace o2::framework::expressions; |
| 31 | + |
| 32 | +struct SGDeuteronSpectra { |
| 33 | + //UPC cuts |
| 34 | + SGSelector sgSelector; |
| 35 | + Configurable<float> FV0_cut{"FV0", 50., "FV0A threshold"}; |
| 36 | + Configurable<float> ZDC_cut{"ZDC", 10., "ZDC threshold"}; |
| 37 | + Configurable<float> FT0A_cut{"FT0A", 150., "FT0A threshold"}; |
| 38 | + Configurable<float> FT0C_cut{"FT0C", 50., "FT0C threshold"}; |
| 39 | + Configurable<float> FDDA_cut{"FDDA", 10000., "FDDA threshold"}; |
| 40 | + Configurable<float> FDDC_cut{"FDDC", 10000., "FDDC threshold"}; |
| 41 | + |
| 42 | + //Track cuts |
| 43 | + Configurable<float> PV_cut{"PV_cut", 1.0, "Use Only PV tracks"}; |
| 44 | + Configurable<float> dcaZ_cut{"dcaZ_cut", 2.0, "dcaZ cut"}; |
| 45 | + Configurable<float> dcaXY_cut{"dcaXY_cut", 0.0, "dcaXY cut (0 for Pt-function)"}; |
| 46 | + Configurable<float> tpcChi2_cut{"tpcChi2_cut", 4, "Max tpcChi2NCl"}; |
| 47 | + Configurable<float> tpcNClsFindable_cut{"tpcNClsFindable_cut", 70, "Min tpcNClsFindable"}; |
| 48 | + Configurable<float> itsChi2_cut{"itsChi2_cut", 36, "Max itsChi2NCl"}; |
| 49 | + Configurable<float> eta_cut{"eta_cut", 0.9, "Track Pseudorapidity"}; |
| 50 | + Configurable<float> pt_cut{"pt_cut", 0.1, "Track Pt"}; |
| 51 | + |
| 52 | + //configurable axis for histograms |
| 53 | + ConfigurableAxis ptAxis{"ptAxis", {200, 0.0, 10.0}, "p_{T}"}; |
| 54 | + ConfigurableAxis nsigmaAxis{"nSigmaAxis", {800,-20.0,20.0}, "nSigma axis for TPC and TOF"}; |
| 55 | + |
| 56 | + // initialize histogram registry |
| 57 | + HistogramRegistry registry{"registry",{}}; |
| 58 | + |
| 59 | + void init(InitContext&) |
| 60 | + { |
| 61 | + const AxisSpec axispt{ptAxis, "p_{T}"}; |
| 62 | + const AxisSpec axistpc{nsigmaAxis, "n#sigma_{TPC}"}; |
| 63 | + const AxisSpec axistof{nsigmaAxis, "n#sigma_{TOF}"}; |
| 64 | + |
| 65 | + // Collision histograms |
| 66 | + registry.add("collisions/GapSide", "Gap Side: A, C, A+C", {HistType::kTH1F, {{3, -0.5, 2.5}}}); |
| 67 | + registry.add("collisions/TrueGapSide", "Gap Side: A, C, A+C", {HistType::kTH1F, {{4, -1.5, 2.5}}}); |
| 68 | + registry.add("tracks/Deut_Pt_TPC_GapA", "", {HistType::kTH2F, {axispt, axistpc}}); |
| 69 | + registry.add("tracks/Deut_Pt_TOF_GapA", "", {HistType::kTH2F, {axispt, axistof}}); |
| 70 | + registry.add("tracks/Deut_Pt_TOF_GapA_TPCpresel", "", {HistType::kTH2F, {axispt, axistof}}); |
| 71 | + registry.add("tracks/Antideut_Pt_TPC_GapA", "", {HistType::kTH2F, {axispt, axistpc}}); |
| 72 | + registry.add("tracks/Antideut_Pt_TOF_GapA", "", {HistType::kTH2F, {axispt, axistof}}); |
| 73 | + registry.add("tracks/Antideut_Pt_TOF_GapA_TPCpresel", "", {HistType::kTH2F, {axispt, axistof}}); |
| 74 | + registry.add("tracks/Deut_Pt_TPC_GapC", "", {HistType::kTH2F, {axispt, axistpc}}); |
| 75 | + registry.add("tracks/Deut_Pt_TOF_GapC", "", {HistType::kTH2F, {axispt, axistof}}); |
| 76 | + registry.add("tracks/Deut_Pt_TOF_GapC_TPCpresel", "", {HistType::kTH2F, {axispt, axistof}}); |
| 77 | + registry.add("tracks/Antideut_Pt_TPC_GapC", "", {HistType::kTH2F, {axispt, axistpc}}); |
| 78 | + registry.add("tracks/Antideut_Pt_TOF_GapC", "", {HistType::kTH2F, {axispt, axistof}}); |
| 79 | + registry.add("tracks/Antideut_Pt_TOF_GapC_TPCpresel", "", {HistType::kTH2F, {axispt, axistof}}); |
| 80 | + registry.add("tracks/Deut_Pt_TPC_DoubleGap", "", {HistType::kTH2F, {axispt, axistpc}}); |
| 81 | + registry.add("tracks/Deut_Pt_TOF_DoubleGap", "", {HistType::kTH2F, {axispt, axistof}}); |
| 82 | + registry.add("tracks/Deut_Pt_TOF_DoubleGap_TPCpresel", "", {HistType::kTH2F, {axispt, axistof}}); |
| 83 | + registry.add("tracks/Antideut_Pt_TPC_DoubleGap", "", {HistType::kTH2F, {axispt, axistpc}}); |
| 84 | + registry.add("tracks/Antideut_Pt_TOF_DoubleGap", "", {HistType::kTH2F, {axispt, axistof}}); |
| 85 | + registry.add("tracks/Antideut_Pt_TOF_DoubleGap_TPCpresel", "", {HistType::kTH2F, {axispt, axistof}}); |
| 86 | + |
| 87 | + } |
| 88 | + |
| 89 | + |
| 90 | + // define data types |
| 91 | + using UDCollisionsFull = soa::Join<aod::UDCollisions, aod::SGCollisions, aod::UDCollisionsSels, aod::UDZdcsReduced>; // UDCollisions |
| 92 | + using UDCollisionFull = UDCollisionsFull::iterator; |
| 93 | + using UDTracksFull = soa::Join<aod::UDTracks, aod::UDTracksPID, aod::UDTracksPIDExtra, aod::UDTracksExtra, aod::UDTracksFlags, aod::UDTracksDCA>; |
| 94 | + |
| 95 | + void process(UDCollisionFull const& coll, UDTracksFull const& tracks) |
| 96 | + { |
| 97 | + |
| 98 | + registry.fill(HIST("collisions/GapSide"), coll.gapSide(), 1.); |
| 99 | + float FIT_cut[5] = {FV0_cut, FT0A_cut, FT0C_cut, FDDA_cut, FDDC_cut}; |
| 100 | + int truegapSide = sgSelector.trueGap(coll, FIT_cut[0], FIT_cut[1], FIT_cut[2], ZDC_cut); |
| 101 | + registry.fill(HIST("collisions/TrueGapSide"), truegapSide, 1.); |
| 102 | + |
| 103 | + |
| 104 | + std::vector<float> parameters = {PV_cut, dcaZ_cut, dcaXY_cut, tpcChi2_cut, tpcNClsFindable_cut, itsChi2_cut, eta_cut, pt_cut}; |
| 105 | + |
| 106 | + for (const auto& t : tracks) { |
| 107 | + if (trackselector(t, parameters)) { |
| 108 | + if (truegapSide == 0) { |
| 109 | + if (t.sign() > 0) { |
| 110 | + registry.fill(HIST("tracks/Deut_Pt_TPC_GapA"), t.pt(), t.tpcNSigmaDe()); |
| 111 | + registry.fill(HIST("tracks/Deut_Pt_TOF_GapA"), t.pt(), t.tofNSigmaDe()); |
| 112 | + if (TMath::Abs(t.tpcNSigmaDe()) < 3.0) { |
| 113 | + registry.fill(HIST("tracks/Deut_Pt_TOF_GapA_TPCpresel"), t.pt(), t.tofNSigmaDe()); |
| 114 | + } |
| 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 (TMath::Abs(t.tpcNSigmaDe()) < 3.0) { |
| 120 | + registry.fill(HIST("tracks/Antideut_Pt_TOF_GapA_TPCpresel"), t.pt(), t.tofNSigmaDe()); |
| 121 | + } |
| 122 | + } |
| 123 | + } |
| 124 | + |
| 125 | + if (truegapSide == 1) { |
| 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 (TMath::Abs(t.tpcNSigmaDe()) < 3.0) { |
| 130 | + registry.fill(HIST("tracks/Deut_Pt_TOF_GapC_TPCpresel"), t.pt(), t.tofNSigmaDe()); |
| 131 | + } |
| 132 | + } |
| 133 | + else { |
| 134 | + registry.fill(HIST("tracks/Antideut_Pt_TPC_GapC"), t.pt(), t.tpcNSigmaDe()); |
| 135 | + registry.fill(HIST("tracks/Antideut_Pt_TOF_GapC"), t.pt(), t.tofNSigmaDe()); |
| 136 | + if (TMath::Abs(t.tpcNSigmaDe()) < 3.0) { |
| 137 | + registry.fill(HIST("tracks/Antideut_Pt_TOF_GapC_TPCpresel"), t.pt(), t.tofNSigmaDe()); |
| 138 | + } |
| 139 | + } |
| 140 | + } |
| 141 | + |
| 142 | + if (truegapSide == 2) { |
| 143 | + if (t.sign() > 0) { |
| 144 | + registry.fill(HIST("tracks/Deut_Pt_TPC_DoubleGap"), t.pt(), t.tpcNSigmaDe()); |
| 145 | + registry.fill(HIST("tracks/Deut_Pt_TOF_DoubleGap"), t.pt(), t.tofNSigmaDe()); |
| 146 | + if (TMath::Abs(t.tpcNSigmaDe()) < 3.0) { registry.fill(HIST("tracks/Deut_Pt_TOF_DoubleGap_TPCpresel"), t.pt(), t.tofNSigmaDe()); |
| 147 | + } |
| 148 | + } |
| 149 | + else { |
| 150 | + registry.fill(HIST("tracks/Antideut_Pt_TPC_DoubleGap"),t.pt(), t.tpcNSigmaDe()); |
| 151 | + registry.fill(HIST("tracks/Antideut_Pt_TOF_DoubleGap"), t.pt(), t.tofNSigmaDe()); |
| 152 | + if (TMath::Abs(t.tpcNSigmaDe()) < 3.0) { |
| 153 | + registry.fill(HIST("tracks/Antideut_Pt_TOF_DoubleGap_TPCpresel"), t.pt(), t.tofNSigmaDe()); |
| 154 | + } |
| 155 | + } |
| 156 | + } |
| 157 | + } |
| 158 | + } |
| 159 | + } |
| 160 | +}; |
| 161 | + |
| 162 | +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) |
| 163 | +{ |
| 164 | + return WorkflowSpec{ |
| 165 | + adaptAnalysisTask<SGDeuteronSpectra>(cfgc, TaskName{"sgdeuteronspectra"}), |
| 166 | + }; |
| 167 | +} |
0 commit comments