99// granted to it by virtue of its status as an Intergovernmental Organization
1010// or submit itself to any jurisdiction.
1111//
12- // \Single Gap Event Analyzer for (anti)deuteron production
13- // \author Marika Rasa, marika.rasa@cern.ch
14- // \since September 2026
12+ // / \file sgDeuteronSpectra.cxx
13+ // / \brief Analysis for the (anti)deuteron production in UPC
14+ // / \author Marika Rasa
15+ // / \since September 2026
1516
1617#include " PWGUD/Core/SGSelector.h"
1718#include " PWGUD/Core/SGTrackSelector.h"
2526#include < Framework/InitContext.h>
2627#include < Framework/runDataProcessing.h>
2728
28- #include < TMathBase.h>
29-
3029#include < vector>
30+ #include < cmath>
3131
3232using namespace o2 ;
3333using namespace o2 ::framework;
3434using namespace o2 ::framework::expressions;
3535
36- struct SGDeuteronSpectra {
36+ struct SgDeuteronSpectra {
3737 // UPC cuts
3838 SGSelector sgSelector;
39- Configurable<float > FV0_cut{ " FV0 " , 50 ., " FV0A threshold" };
40- Configurable<float > ZDC_cut{ " ZDC " , 10 ., " ZDC threshold" };
41- Configurable<float > FT0A_cut{ " FT0A " , 150 ., " FT0A threshold" };
42- Configurable<float > FT0C_cut{ " FT0C " , 50 ., " FT0C threshold" };
43- Configurable<float > FDDA_cut{ " FDDA " , 10000 ., " FDDA threshold" };
44- Configurable<float > FDDC_cut{ " FDDC " , 10000 ., " FDDC threshold" };
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" };
4545
4646 // Track cuts
47- Configurable<float > PV_cut{" PV_cut" , 1.0 , " Use Only PV tracks" };
48- Configurable<float > dcaZ_cut{" dcaZ_cut" , 2.0 , " dcaZ cut" };
49- Configurable<float > dcaXY_cut{" dcaXY_cut" , 0.0 , " dcaXY cut (0 for Pt-function)" };
50- Configurable<float > tpcChi2_cut{" tpcChi2_cut" , 4 , " Max tpcChi2NCl" };
51- Configurable<float > tpcNClsFindable_cut{" tpcNClsFindable_cut" , 70 , " Min tpcNClsFindable" };
52- Configurable<float > itsChi2_cut{" itsChi2_cut" , 36 , " Max itsChi2NCl" };
53- Configurable<float > eta_cut{" eta_cut" , 0.9 , " Track Pseudorapidity" };
54- Configurable<float > pt_cut{" pt_cut" , 0.1 , " Track Pt" };
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" };
5556
5657 // Configurable axis for histograms
5758 ConfigurableAxis ptAxis{" ptAxis" , {200 , 0.0 , 10.0 }, " p_{T}" };
58- ConfigurableAxis nsigmaAxis {" nSigmaAxis" , {800 , -20.0 , 20.0 }, " nSigma axis for TPC and TOF" };
59+ ConfigurableAxis nSigmaAxis {" nSigmaAxis" , {800 , -20.0 , 20.0 }, " nSigma axis for TPC and TOF" };
5960
6061 // Initialize histogram registry
6162 HistogramRegistry registry{" registry" , {}};
6263
6364 void init (InitContext&)
6465 {
6566 const AxisSpec axispt{ptAxis, " p_{T}" };
66- const AxisSpec axistpc{nsigmaAxis , " n#sigma_{TPC}" };
67- const AxisSpec axistof{nsigmaAxis , " n#sigma_{TOF}" };
67+ const AxisSpec axistpc{nSigmaAxis , " n#sigma_{TPC}" };
68+ const AxisSpec axistof{nSigmaAxis , " n#sigma_{TOF}" };
6869
6970 // Collision histograms
7071 registry.add (" collisions/GapSide" , " Gap Side: A, C, A+C" , {HistType::kTH1F , {{3 , -0.5 , 2.5 }}});
@@ -97,57 +98,60 @@ struct SGDeuteronSpectra {
9798 void process (UDCollisionFull const & coll, UDTracksFull const & tracks)
9899 {
99100 registry.fill (HIST (" collisions/GapSide" ), coll.gapSide (), 1 .);
100- std::vector<float > FIT_cut = {FV0_cut, FT0A_cut, FT0C_cut, FDDA_cut, FDDC_cut};
101- int truegapSide = sgSelector.trueGap (coll, FIT_cut[0 ], FIT_cut[1 ], FIT_cut[2 ], ZDC_cut);
101+ std::vector<float > fitCut = {fv0Cut, ft0aCut, ft0cCut, fddaCut, fddcCut};
102+ int truegapSide = sgSelector.trueGap (coll, fitCut[0 ], fitCut[1 ], fitCut[2 ], zdcCut);
103+ int gapA = 0 ;
104+ int gapC = 1 ;
105+ int doubleGap = 2 ;
102106 registry.fill (HIST (" collisions/TrueGapSide" ), truegapSide, 1 .);
103107
104- std::vector<float > parameters = {PV_cut, dcaZ_cut, dcaXY_cut, tpcChi2_cut, tpcNClsFindable_cut, itsChi2_cut, eta_cut, pt_cut };
108+ std::vector<float > parameters = {pvCut, dcaZCut, dcaXYCut, tpcChi2Cut, tpcNClsFindableCut, itsChi2Cut, etaCut, ptCut };
105109
106110 for (const auto & t : tracks) {
107111 if (trackselector (t, parameters) != 0 ) {
108- if (truegapSide == 0 ) {
112+ if (truegapSide == gapA ) {
109113 if (t.sign () > 0 ) {
110114 registry.fill (HIST (" tracks/Deut_Pt_TPC_GapA" ), t.pt (), t.tpcNSigmaDe ());
111115 registry.fill (HIST (" tracks/Deut_Pt_TOF_GapA" ), t.pt (), t.tofNSigmaDe ());
112- if (TMath::Abs (t.tpcNSigmaDe ()) < 3.0 ) {
116+ if (std::abs (t.tpcNSigmaDe ()) < nsigmatpcPreselCut ) {
113117 registry.fill (HIST (" tracks/Deut_Pt_TOF_GapA_TPCpresel" ), t.pt (), t.tofNSigmaDe ());
114118 }
115119 } else {
116120 registry.fill (HIST (" tracks/Antideut_Pt_TPC_GapA" ), t.pt (), t.tpcNSigmaDe ());
117121 registry.fill (HIST (" tracks/Antideut_Pt_TOF_GapA" ), t.pt (), t.tofNSigmaDe ());
118- if (TMath::Abs (t.tpcNSigmaDe ()) < 3.0 ) {
122+ if (std::abs (t.tpcNSigmaDe ()) < nsigmatpcPreselCut ) {
119123 registry.fill (HIST (" tracks/Antideut_Pt_TOF_GapA_TPCpresel" ), t.pt (), t.tofNSigmaDe ());
120124 }
121125 }
122126 }
123127
124- if (truegapSide == 1 ) {
128+ if (truegapSide == gapC ) {
125129 if (t.sign () > 0 ) {
126130 registry.fill (HIST (" tracks/Deut_Pt_TPC_GapC" ), t.pt (), t.tpcNSigmaDe ());
127131 registry.fill (HIST (" tracks/Deut_Pt_TOF_GapC" ), t.pt (), t.tofNSigmaDe ());
128- if (TMath::Abs (t.tpcNSigmaDe ()) < 3.0 ) {
132+ if (std::abs (t.tpcNSigmaDe ()) < nsigmatpcPreselCut ) {
129133 registry.fill (HIST (" tracks/Deut_Pt_TOF_GapC_TPCpresel" ), t.pt (), t.tofNSigmaDe ());
130134 }
131135 } else {
132136 registry.fill (HIST (" tracks/Antideut_Pt_TPC_GapC" ), t.pt (), t.tpcNSigmaDe ());
133137 registry.fill (HIST (" tracks/Antideut_Pt_TOF_GapC" ), t.pt (), t.tofNSigmaDe ());
134- if (TMath::Abs (t.tpcNSigmaDe ()) < 3.0 ) {
138+ if (std::abs (t.tpcNSigmaDe ()) < nsigmatpcPreselCut ) {
135139 registry.fill (HIST (" tracks/Antideut_Pt_TOF_GapC_TPCpresel" ), t.pt (), t.tofNSigmaDe ());
136140 }
137141 }
138142 }
139143
140- if (truegapSide == 2 ) {
144+ if (truegapSide == doubleGap ) {
141145 if (t.sign () > 0 ) {
142146 registry.fill (HIST (" tracks/Deut_Pt_TPC_DoubleGap" ), t.pt (), t.tpcNSigmaDe ());
143147 registry.fill (HIST (" tracks/Deut_Pt_TOF_DoubleGap" ), t.pt (), t.tofNSigmaDe ());
144- if (TMath::Abs (t.tpcNSigmaDe ()) < 3.0 ) {
148+ if (std::abs (t.tpcNSigmaDe ()) < nsigmatpcPreselCut ) {
145149 registry.fill (HIST (" tracks/Deut_Pt_TOF_DoubleGap_TPCpresel" ), t.pt (), t.tofNSigmaDe ());
146150 }
147151 } else {
148152 registry.fill (HIST (" tracks/Antideut_Pt_TPC_DoubleGap" ), t.pt (), t.tpcNSigmaDe ());
149153 registry.fill (HIST (" tracks/Antideut_Pt_TOF_DoubleGap" ), t.pt (), t.tofNSigmaDe ());
150- if (TMath::Abs (t.tpcNSigmaDe ()) < 3.0 ) {
154+ if (std::abs (t.tpcNSigmaDe ()) < nsigmatpcPreselCut ) {
151155 registry.fill (HIST (" tracks/Antideut_Pt_TOF_DoubleGap_TPCpresel" ), t.pt (), t.tofNSigmaDe ());
152156 }
153157 }
@@ -160,6 +164,6 @@ struct SGDeuteronSpectra {
160164WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
161165{
162166 return WorkflowSpec{
163- adaptAnalysisTask<SGDeuteronSpectra >(cfgc, TaskName{ " sgdeuteronspectra " } ),
167+ adaptAnalysisTask<SgDeuteronSpectra >(cfgc),
164168 };
165169}
0 commit comments