1919#include " Common/DataModel/TrackSelectionTables.h"
2020#include " Common/TableProducer/PID/pidTOFBase.h"
2121
22- #include " Framework/ASoA.h"
23- #include " Framework/ASoAHelpers.h"
24- #include " Framework/AnalysisDataModel.h"
25- #include " Framework/AnalysisTask.h"
26- #include " Framework/HistogramRegistry.h"
27- #include " Framework/RunningWorkflowInfo.h"
28- #include " Framework/runDataProcessing.h"
29- #include " ReconstructionDataFormats/DCA.h"
30- #include " ReconstructionDataFormats/PID.h"
31- #include " ReconstructionDataFormats/Track.h"
32- #include " ReconstructionDataFormats/TrackParametrization.h"
33-
34- #include " TF1.h"
22+ #include < Framework/ASoA.h>
23+ #include < Framework/ASoAHelpers.h>
24+ #include < Framework/AnalysisDataModel.h>
25+ #include < Framework/AnalysisTask.h>
26+ #include < Framework/HistogramRegistry.h>
27+ #include < Framework/RunningWorkflowInfo.h>
28+ #include < Framework/runDataProcessing.h>
29+ #include < ReconstructionDataFormats/DCA.h>
30+ #include < ReconstructionDataFormats/PID.h>
31+ #include < ReconstructionDataFormats/Track.h>
32+ #include < ReconstructionDataFormats/TrackParametrization.h>
33+
34+ #include < TF1.h>
3535#include < TTree.h>
3636
37- #include " HMPIDBase/Param.h"
37+ #include < HMPIDBase/Param.h>
3838
3939using namespace o2 ;
4040using namespace o2 ::framework;
4141using namespace o2 ::framework::expressions;
42-
43- // task per leggere la table creata dal task HMPIDanalysis per performance e stablity --dataset pp SENZA il photscharge as vector
42+ using namespace o2 ::constants::physics;
4443
4544// distance 2D between MIP and Track extrapolated
4645float distance2D (float x1, float y1, float x2, float y2)
@@ -108,8 +107,6 @@ void getProbability(float hmpidSignal, float hmpidMomentum, double* probs)
108107 // Calculates probability to be a pion-kaon-proton with the "amplitude" method
109108 // from the given Cerenkov angle and momentum assuming no initial particle composition (class taken by AliROOT)
110109
111- Double_t probabilityParticle;
112-
113110 Int_t nSpecies = 3 ;
114111
115112 if (hmpidSignal <= 0 ) {
@@ -120,56 +117,10 @@ void getProbability(float hmpidSignal, float hmpidMomentum, double* probs)
120117 }
121118
122119 // assign mass in GeV/c^2
123- Double_t mass[] = {0.139570 , 0.493677 , 0.938272 };
124-
125- /*
126- Double_t chAngle_th = expectedSignal(mass, hmpidMomentum);
127-
128- //check
129- if (chAngle_th > 900.)
130- {
131- return 0.0; // No light emitted, probability is zero
132- }
133-
134- /////////////////////////////////////////////////////////////
135-
136- Double_t sigma_ring = expectedSigma(hmpidMomentum, particleType);
137-
138- if(sigma_ring==0)
139- {
140- return 0.0; //no ring
141- }
142-
143- /////////////////////////////////////////////////////////////
144-
145- // Check if within the "desert" range
146- if (TMath::Abs(hmpidSignal - chAngle_th) >= 4 * sigma_ring)
147- {
148- return 1.0/((Float_t) nSpecies); // Assume equal probability in "desert" case
149- }
150-
151- // Calculate Gaussian height for the selected species
152- Double_t hSpecies = TMath::Gaus(chAngle_th, hmpidSignal, sigma_ring, kTRUE);
153-
154- // To normalize the probability, calculate the total height (hTot) across all species
155- Double_t hTot = 0;
156- for (int i = 0; i < nSpecies; i++)
157- {
158- Double_t chAngle_th_i = expectedSignal(mass_species[i], hmpidMomentum);
159- Double_t sigma_ring_i = expectedSigma(hmpidMomentum, particles_species[i]);
160- if (sigma_ring_i > 0 && chAngle_th_i <= 900)
161- {
162- hTot += TMath::Gaus(chAngle_th_i, hmpidSignal, sigma_ring_i, kTRUE);
163- }
164-
165-
166- }
167-
168- probabilityParticle = hSpecies / hTot;
169-
170- // Return the normalized probability for the specific species
171- return (hTot > 0) ? probabilityParticle : 0.0;
172- */
120+ double mProton = o2::constants::physics::MassProton;
121+ double mPion = o2::constants::physics::MassPionCharged;
122+ double mKaon = o2::constants::physics::MassKaonCharged;
123+ Double_t mass[] = {mPion , mKaon , mProton };
173124
174125 Double_t hTot = 0 ; // Initialize the total height of the amplitude method
175126 Double_t* h = new Double_t[nSpecies]; // number of charged particles to be considered
@@ -425,7 +376,7 @@ struct pidHmpidQaPb {
425376 histos.fill (HIST (" Mass2distribution" ), mass2);
426377 }
427378
428- float sin2changle;
379+ float sin2changle = 0 . ;
429380
430381 if (distance2D (hmpid.xtrack (), hmpid.ytrack (), hmpid.xmip (), hmpid.ymip ()) < cut_d_mip_track && hmpid.chargeMIP () > 120 .) {
431382
@@ -495,7 +446,7 @@ struct pidHmpidQaPb {
495446 // { ---
496447 if (distance2D (hmpid.xtrack (), hmpid.ytrack (), hmpid.xmip (), hmpid.ymip ()) < cut_d_mip_track && hmpid.chargeMIP () > 120 .) {
497448 histos.fill (HIST (" hmpidNPhotons0" ), hmpid.nphotons ());
498- sin2changle = ( float ) TMath::Power (TMath::Sin (hmpid.chAngle ()), 2 );
449+ sin2changle = static_cast < float >( TMath::Power (TMath::Sin (hmpid.chAngle ()), 2 ) );
499450 if (hmpid.xmip () <= 100 . && hmpid.xmip () >= 40 . && hmpid.ymip () <= 100 . && hmpid.ymip () >= 40 .) {
500451 histos.fill (HIST (" nPhotons_vs_sin2Ch0" ), sin2changle, hmpid.nphotons ());
501452 }
@@ -660,7 +611,7 @@ struct pidHmpidQaPb {
660611
661612 if (distance2D (hmpid.xtrack (), hmpid.ytrack (), hmpid.xmip (), hmpid.ymip ()) < cut_d_mip_track && hmpid.chargeMIP () > 120 .) {
662613 histos.fill (HIST (" hmpidNPhotons1" ), hmpid.nphotons ());
663- sin2changle = ( float ) TMath::Power (TMath::Sin (hmpid.chAngle ()), 2 );
614+ sin2changle = static_cast < float >( TMath::Power (TMath::Sin (hmpid.chAngle ()), 2 ) );
664615 if (hmpid.xmip () <= 100 . && hmpid.xmip () >= 40 . && hmpid.ymip () <= 100 . && hmpid.ymip () >= 40 .) {
665616 histos.fill (HIST (" nPhotons_vs_sin2Ch1" ), sin2changle, hmpid.nphotons ());
666617 }
@@ -817,7 +768,7 @@ struct pidHmpidQaPb {
817768
818769 if (distance2D (hmpid.xtrack (), hmpid.ytrack (), hmpid.xmip (), hmpid.ymip ()) < cut_d_mip_track && hmpid.chargeMIP () > 120 .) {
819770 histos.fill (HIST (" hmpidNPhotons2" ), hmpid.nphotons ());
820- sin2changle = ( float ) TMath::Power (TMath::Sin (hmpid.chAngle ()), 2 );
771+ sin2changle = static_cast < float >( TMath::Power (TMath::Sin (hmpid.chAngle ()), 2 ) );
821772 if (hmpid.xmip () <= 100 . && hmpid.xmip () >= 40 . && hmpid.ymip () <= 100 . && hmpid.ymip () >= 40 .) {
822773 histos.fill (HIST (" nPhotons_vs_sin2Ch2" ), sin2changle, hmpid.nphotons ());
823774 }
@@ -975,7 +926,7 @@ struct pidHmpidQaPb {
975926
976927 if (distance2D (hmpid.xtrack (), hmpid.ytrack (), hmpid.xmip (), hmpid.ymip ()) < cut_d_mip_track && hmpid.chargeMIP () > 120 .) {
977928 histos.fill (HIST (" hmpidNPhotons3" ), hmpid.nphotons ());
978- sin2changle = ( float ) TMath::Power (TMath::Sin (hmpid.chAngle ()), 2 );
929+ sin2changle = static_cast < float >( TMath::Power (TMath::Sin (hmpid.chAngle ()), 2 ) );
979930 if (hmpid.xmip () <= 100 . && hmpid.xmip () >= 40 . && hmpid.ymip () <= 100 . && hmpid.ymip () >= 40 .) {
980931 histos.fill (HIST (" nPhotons_vs_sin2Ch3" ), sin2changle, hmpid.nphotons ());
981932 }
@@ -1133,7 +1084,7 @@ struct pidHmpidQaPb {
11331084
11341085 if (distance2D (hmpid.xtrack (), hmpid.ytrack (), hmpid.xmip (), hmpid.ymip ()) < cut_d_mip_track && hmpid.chargeMIP () > 120 .) {
11351086 histos.fill (HIST (" hmpidNPhotons4" ), hmpid.nphotons ());
1136- sin2changle = ( float ) TMath::Power (TMath::Sin (hmpid.chAngle ()), 2 );
1087+ sin2changle = static_cast < float >( TMath::Power (TMath::Sin (hmpid.chAngle ()), 2 ) );
11371088 if (hmpid.xmip () <= 100 . && hmpid.xmip () >= 40 . && hmpid.ymip () <= 100 . && hmpid.ymip () >= 40 .) {
11381089 histos.fill (HIST (" nPhotons_vs_sin2Ch4" ), sin2changle, hmpid.nphotons ());
11391090 }
@@ -1291,7 +1242,7 @@ struct pidHmpidQaPb {
12911242
12921243 if (distance2D (hmpid.xtrack (), hmpid.ytrack (), hmpid.xmip (), hmpid.ymip ()) < cut_d_mip_track && hmpid.chargeMIP () > 120 .) {
12931244 histos.fill (HIST (" hmpidNPhotons5" ), hmpid.nphotons ());
1294- sin2changle = ( float ) TMath::Power (TMath::Sin (hmpid.chAngle ()), 2 );
1245+ sin2changle = static_cast < float >( TMath::Power (TMath::Sin (hmpid.chAngle ()), 2 ) );
12951246 if (hmpid.xmip () <= 100 . && hmpid.xmip () >= 40 . && hmpid.ymip () <= 100 . && hmpid.ymip () >= 40 .) {
12961247 histos.fill (HIST (" nPhotons_vs_sin2Ch5" ), sin2changle, hmpid.nphotons ());
12971248 }
@@ -1449,7 +1400,7 @@ struct pidHmpidQaPb {
14491400
14501401 if (distance2D (hmpid.xtrack (), hmpid.ytrack (), hmpid.xmip (), hmpid.ymip ()) < cut_d_mip_track && hmpid.chargeMIP () > 120 .) {
14511402 histos.fill (HIST (" hmpidNPhotons6" ), hmpid.nphotons ());
1452- sin2changle = ( float ) TMath::Power (TMath::Sin (hmpid.chAngle ()), 2 );
1403+ sin2changle = static_cast < float >( TMath::Power (TMath::Sin (hmpid.chAngle ()), 2 ) );
14531404 if (hmpid.xmip () <= 100 . && hmpid.xmip () >= 40 . && hmpid.ymip () <= 100 . && hmpid.ymip () >= 40 .) {
14541405 histos.fill (HIST (" nPhotons_vs_sin2Ch6" ), sin2changle, hmpid.nphotons ());
14551406 }
0 commit comments