88// In applying this license CERN does not waive the privileges and immunities
99// granted to it by virtue of its status as an Intergovernmental Organization
1010// or submit itself to any jurisdiction.
11+ //
12+ // / \file trackedCascadeProperties.cxx
13+ // /
14+ // / \brief task to study the average cluster size of tracked cascades
1115// /
1216// / \author Alberto Caliva (alberto.caliva@cern.ch), Francesca Ercolessi (francesca.ercolessi@cern.ch)
1317// / \since May 31, 2024
1418
15- #include < TDatabasePDG.h>
16- #include < TLorentzVector.h>
1719#include < TMath.h>
1820#include < TObjArray.h>
1921#include < TPDGCode.h>
2022#include < TVector2.h>
2123#include < TVector3.h>
2224#include < cmath>
2325#include < vector>
26+ #include < algorithm>
2427
2528#include " Common/Core/RecoDecay.h"
2629#include " Common/Core/trackUtilities.h"
3740#include " PWGLF/DataModel/LFStrangenessTables.h"
3841#include " ReconstructionDataFormats/Track.h"
3942#include " ReconstructionDataFormats/DCA.h"
40- #define mXi 1.32171
41- #define mOmega 1.67245
4243
4344using namespace std ;
4445using namespace o2 ;
@@ -51,7 +52,7 @@ using SelectedCollisions = soa::Join<aod::Collisions, aod::EvSels>;
5152
5253using FullTracks = soa::Join<aod::Tracks, aod::TracksIU, aod::TracksExtra, aod::TracksCovIU, aod::TracksDCA, aod::pidTPCFullPi, aod::pidTPCFullKa, aod::pidTPCFullPr, aod::pidTOFFullPi, aod::pidTOFFullKa, aod::pidTOFFullPr>;
5354
54- struct tracked_cascade_properties {
55+ struct TrackedCascadeProperties {
5556
5657 // QC Histograms
5758 HistogramRegistry registryQC{
@@ -72,15 +73,11 @@ struct tracked_cascade_properties {
7273 // Global Parameters
7374 Configurable<float > zVtx{" zVtx" , 10 .0f , " z vertex cut" };
7475
75- // Cascade Parameters
76- Configurable<float > minimumCascRadius{" minimumCascRadius" , 5 .0f , " Minimum Cascade Radius" };
77- Configurable<float > maximumCascRadius{" maximumCascRadius" , 18 .0f , " Maximum Cascade Radius" };
78-
7976 // Mass Cuts
80- Configurable<float > mMin_xi { " mMin_xi " , 1 .315f , " mMin Xi" };
81- Configurable<float > mMax_xi { " mMax_xi " , 1 .328f , " mMax Xi" };
82- Configurable<float > mMin_omega { " mMin_omega " , 1 .665f , " mMin Omega" };
83- Configurable<float > mMax_omega { " mMax_omega " , 1 .680f , " mMax Omega" };
77+ Configurable<float > massMinXi{ " massMinXi " , 1 .315f , " mMin Xi" };
78+ Configurable<float > massMaxXi{ " massMaxXi " , 1 .328f , " mMax Xi" };
79+ Configurable<float > massMinOmega{ " massMinOmega " , 1 .665f , " mMin Omega" };
80+ Configurable<float > massMaxOmega{ " massMaxOmega " , 1 .680f , " mMax Omega" };
8481
8582 void init (InitContext const &)
8683 {
@@ -95,7 +92,7 @@ struct tracked_cascade_properties {
9592 registryQC.add (" deltaNclsITS" , " deltaNclsITS" , HistType::kTH1F , {{20 , -10 , 10 , " #DeltaN" }});
9693 registryQC.add (" deltaNclsITS_track" , " deltaNclsITS_track" , HistType::kTH1F , {{20 , -10 , 10 , " #DeltaN" }});
9794 registryQC.add (" deltaNclsITS_itstrack" , " deltaNclsITS_itstrack" , HistType::kTH1F , {{20 , -10 , 10 , " #DeltaN" }});
98-
95+
9996 registryData.add (" number_of_events_data" , " number of events in data" , HistType::kTH1F , {{5 , 0 , 5 , " Event Cuts" }});
10097 registryData.add (" xi_pos_avgclustersize" , " xi_pos_avgclustersize" , HistType::kTH3F , {{100 , 0.0 , 10.0 , " #it{p} (GeV/#it{c})" }, {100 , 0.0 , 20.0 , " #LT ITS cluster size #GT" }, {16 , -0.8 , 0.8 , " #eta" }});
10198 registryData.add (" xi_neg_avgclustersize" , " xi_neg_avgclustersize" , HistType::kTH3F , {{100 , 0.0 , 10.0 , " #it{p} (GeV/#it{c})" }, {100 , 0.0 , 20.0 , " #LT ITS cluster size #GT" }, {16 , -0.8 , 0.8 , " #eta" }});
@@ -118,17 +115,27 @@ struct tracked_cascade_properties {
118115 registryData.add (" omega_mass_neg" , " omega_mass_neg" , HistType::kTH2F , {{100 , 0.0 , 10.0 , " #it{p} (GeV/#it{c})" }, {200 , 1.63 , 1.71 , " m_{p#piK} (GeV/#it{c}^{2})" }});
119116 }
120117
121- double track_inclination (double eta)
118+ double trackInclination (double eta)
122119 {
123120 double lambda (0 );
124- double theta = 2.0 * atan (exp (-eta));
125- if (theta <= TMath::Pi () / 2.0 )
126- lambda = 0.5 * TMath::Pi () - theta;
127- if (theta > TMath::Pi () / 2.0 )
128- lambda = theta - 0.5 * TMath::Pi () ;
121+ double theta = 2.0 * std:: atan (std:: exp (-eta));
122+ if (theta <= o2::constants::math::PIHalf )
123+ lambda = o2::constants::math::PIHalf - theta;
124+ if (theta > o2::constants::math::PIHalf )
125+ lambda = theta - o2::constants::math::PIHalf ;
129126 return lambda;
130127 }
131128
129+ int findBin (const std::vector<double >& edges, double value)
130+ {
131+ auto it = std::upper_bound (edges.begin (), edges.end (), value);
132+ int index = static_cast <int >(it - edges.begin ()) - 1 ;
133+ if (index < 0 || index >= static_cast <int >(edges.size ()) - 1 ) {
134+ return -1 ; // value is out of bounds
135+ }
136+ return index;
137+ }
138+
132139 void processData (SelectedCollisions::iterator const & collision, aod::AssignedTrackedCascades const & trackedCascades,
133140 aod::Cascades const &, FullTracks const &)
134141 {
@@ -137,11 +144,13 @@ struct tracked_cascade_properties {
137144 return ;
138145
139146 registryData.fill (HIST (" number_of_events_data" ), 1.5 );
140- if (abs (collision.posZ ()) > zVtx)
147+ if (std:: abs (collision.posZ ()) > zVtx)
141148 return ;
142149
143150 registryData.fill (HIST (" number_of_events_data" ), 2.5 );
144151
152+ std::vector<double > edgesItsLayers = {0.0 , 2.2 , 2.8 , 3.6 , 20.0 , 22.0 , 37.0 , 39.0 , 100.0 };
153+
145154 for (const auto & trackedCascade : trackedCascades) {
146155
147156 const auto track = trackedCascade.track_as <FullTracks>();
@@ -151,17 +160,18 @@ struct tracked_cascade_properties {
151160 registryQC.fill (HIST (" deltaP" ), track.p () - trackITS.p ());
152161 registryQC.fill (HIST (" deltaEta" ), track.eta () - trackITS.eta ());
153162 registryQC.fill (HIST (" deltaNclsITS" ), track.itsNCls () - trackITS.itsNCls ());
154- for (int i = 0 ; i < 7 ; i++) {
163+
164+ const int nItsLayers = 7 ;
165+ for (int i = 0 ; i < nItsLayers; i++) {
155166 registryQC.fill (HIST (" deltaClsSize" ), track.itsClsSizeInLayer (i) - trackITS.itsClsSizeInLayer (i));
156167 }
157168
158169 const auto & casc = trackedCascade.cascade ();
159170 const auto & btrack = casc.bachelor_as <FullTracks>();
160171 double dx = trackedCascade.decayX ();
161172 double dy = trackedCascade.decayY ();
162- double r = sqrt (dx * dx + dy * dy);
163- if (r < minimumCascRadius || r > maximumCascRadius)
164- continue ;
173+ double r = std::sqrt (dx * dx + dy * dy);
174+ int nClsCascade = findBin (edgesItsLayers, r);
165175
166176 registryQC.fill (HIST (" matchingChi2" ), trackedCascade.matchingChi2 ());
167177 registryQC.fill (HIST (" topologyChi2" ), trackedCascade.topologyChi2 ());
@@ -170,7 +180,7 @@ struct tracked_cascade_properties {
170180 // Calculate (Average) Cluster Size
171181 double averageClusterSize (0 );
172182 int nCls (0 );
173- for (int i = 0 ; i < 7 ; i++) {
183+ for (int i = 0 ; i < nClsCascade ; i++) {
174184 int clusterSize = trackITS.itsClsSizeInLayer (i);
175185 averageClusterSize += static_cast <double >(clusterSize);
176186 if (clusterSize > 0 )
@@ -190,20 +200,20 @@ struct tracked_cascade_properties {
190200 }
191201
192202 // Track Inclination
193- double lambda = track_inclination (track.eta ());
203+ double lambda = trackInclination (track.eta ());
194204
195205 // Xi
196- if (trackedCascade.xiMass () > mMin_xi && trackedCascade.xiMass () < mMax_xi ) {
206+ if (trackedCascade.xiMass () > massMinXi && trackedCascade.xiMass () < massMaxXi ) {
197207 registryQC.fill (HIST (" nITScls_vs_p_xi" ), track.p (), trackITS.itsNCls ());
198208 if (btrack.sign () > 0 ) {
199209 registryData.fill (HIST (" xi_pos_avgclustersize" ), track.p (), averageClusterSize, track.eta ());
200- registryData.fill (HIST (" xi_pos_avgclustersize_cosL" ), track.p (), averageClusterSize * cos (lambda));
201- registryData.fill (HIST (" xi_pos_avgclustersize_cosL_vs_betagamma" ), track.p () / mXi , averageClusterSize * cos (lambda));
210+ registryData.fill (HIST (" xi_pos_avgclustersize_cosL" ), track.p (), averageClusterSize * std:: cos (lambda));
211+ registryData.fill (HIST (" xi_pos_avgclustersize_cosL_vs_betagamma" ), track.p () / o2::constants::physics::MassXiPlusBar , averageClusterSize * std:: cos (lambda));
202212 }
203213 if (btrack.sign () < 0 ) {
204214 registryData.fill (HIST (" xi_neg_avgclustersize" ), track.p (), averageClusterSize, track.eta ());
205- registryData.fill (HIST (" xi_neg_avgclustersize_cosL" ), track.p (), averageClusterSize * cos (lambda));
206- registryData.fill (HIST (" xi_neg_avgclustersize_cosL_vs_betagamma" ), track.p () / mXi , averageClusterSize * cos (lambda));
215+ registryData.fill (HIST (" xi_neg_avgclustersize_cosL" ), track.p (), averageClusterSize * std:: cos (lambda));
216+ registryData.fill (HIST (" xi_neg_avgclustersize_cosL_vs_betagamma" ), track.p () / o2::constants::physics::MassXiMinus , averageClusterSize * std:: cos (lambda));
207217 }
208218 continue ;
209219 }
@@ -217,25 +227,25 @@ struct tracked_cascade_properties {
217227 }
218228
219229 // Omega
220- if (trackedCascade.omegaMass () > mMin_omega && trackedCascade.omegaMass () < mMax_omega ) {
230+ if (trackedCascade.omegaMass () > massMinOmega && trackedCascade.omegaMass () < massMaxOmega ) {
221231 registryQC.fill (HIST (" nITScls_vs_p_omega" ), track.p (), trackITS.itsNCls ());
222232 if (btrack.sign () > 0 ) {
223233 registryData.fill (HIST (" omega_pos_avgclustersize" ), track.p (), averageClusterSize, track.eta ());
224- registryData.fill (HIST (" omega_pos_avgclustersize_cosL" ), track.p (), averageClusterSize * cos (lambda));
225- registryData.fill (HIST (" omega_pos_avgclustersize_cosL_vs_betagamma" ), track.p () / mOmega , averageClusterSize * cos (lambda));
234+ registryData.fill (HIST (" omega_pos_avgclustersize_cosL" ), track.p (), averageClusterSize * std:: cos (lambda));
235+ registryData.fill (HIST (" omega_pos_avgclustersize_cosL_vs_betagamma" ), track.p () / o2::constants::physics::MassOmegaPlusBar , averageClusterSize * std:: cos (lambda));
226236 }
227237 if (btrack.sign () < 0 ) {
228238 registryData.fill (HIST (" omega_neg_avgclustersize" ), track.p (), averageClusterSize, track.eta ());
229- registryData.fill (HIST (" omega_neg_avgclustersize_cosL" ), track.p (), averageClusterSize * cos (lambda));
230- registryData.fill (HIST (" omega_neg_avgclustersize_cosL_vs_betagamma" ), track.p () / mOmega , averageClusterSize * cos (lambda));
239+ registryData.fill (HIST (" omega_neg_avgclustersize_cosL" ), track.p (), averageClusterSize * std:: cos (lambda));
240+ registryData.fill (HIST (" omega_neg_avgclustersize_cosL_vs_betagamma" ), track.p () / o2::constants::physics::MassOmegaMinus , averageClusterSize * std:: cos (lambda));
231241 }
232242 }
233243 }
234244 }
235- PROCESS_SWITCH (tracked_cascade_properties , processData, " Process data" , true );
245+ PROCESS_SWITCH (TrackedCascadeProperties , processData, " Process data" , true );
236246};
237247
238248WorkflowSpec defineDataProcessing (ConfigContext const & cfgc)
239249{
240- return WorkflowSpec{adaptAnalysisTask<tracked_cascade_properties >(cfgc)};
250+ return WorkflowSpec{adaptAnalysisTask<TrackedCascadeProperties >(cfgc)};
241251}
0 commit comments