3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
9 //_________________________________________________________________________
10 // Implementation version v1 of the PHOS particle identifier
11 // Identification is based on information from CPV and EMC
13 //*-- Author: Yves Schutz (SUBATECH), Gustavo Conesa.
15 // --- ROOT system ---
25 // --- Standard library ---
26 // --- AliRoot header files ---
27 class AliPHOSEmcRecPoint ;
28 class AliPHOSCpvRecPoint ;
29 class AliPHOSClusterizerv1 ;
30 class AliPHOSTrackSegmentMakerv1 ;
32 #include "AliPHOSPID.h"
34 class AliPHOSPIDv1 : public AliPHOSPID {
38 AliPHOSPIDv1() ; // ctor
39 AliPHOSPIDv1(const TString alirunFileNameFile, const TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ;
40 AliPHOSPIDv1(const AliPHOSPIDv1 & pid) ; // cpy ctor
42 virtual ~AliPHOSPIDv1() ; // dtor
44 virtual void Exec(Option_t *option); // Does the job
46 //Get file name that contain the PCA
47 const TString GetFileNamePrincipal(TString particle) const;
49 //Get file name that contain PID parameters
50 const TString GetFileNameParameters() const {return fFileNameParameters ;}
52 // Get number of rec.particles in this run
53 virtual Int_t GetRecParticlesInRun() const {return fRecParticlesInRun ;}
56 // Get PID parameters as they are defined in fParameters
57 Float_t GetParameterCalibration (Int_t i) const;
58 Float_t GetParameterCpv2Emc (Int_t i, TString axis) const;
59 Float_t GetParameterTimeGate (Int_t i) const;
60 Float_t GetParameterToCalculateEllipse(TString particle, TString param, Int_t i) const ;
61 Float_t GetParameterPhotonBoundary (Int_t i) const;
62 Float_t GetParameterPi0Boundary (Int_t i) const;
64 // Get energy-dependent PID parameters
65 Float_t GetCalibratedEnergy (Float_t e) const;
66 Float_t GetCpv2EmcDistanceCut (TString axis, Float_t e) const ;
67 Float_t GetEllipseParameter (TString particle, TString param, Float_t e) const;
69 Double_t GetThresholdChargedNeutral () const {return fChargedNeutralThreshold;}
70 Float_t GetTOFEnergyThreshold () const {return fTOFEnThreshold;}
71 Float_t GetDispersionEnergyThreshold () const {return fDispEnThreshold;}
72 Int_t GetDispersionMultiplicityThreshold () const {return fDispMultThreshold;}
75 void SetBayesianPID(Bool_t set){ fBayesian = set ;}
77 // Set PID parameters to change appropriate element of fParameters
78 void SetParameterCalibration (Int_t i, Float_t param);
79 void SetParameterCpv2Emc (Int_t i, TString axis, Float_t cut) ;
80 void SetParameterTimeGate (Int_t i, Float_t gate) ;
81 void SetParameterToCalculateEllipse(TString particle, TString param, Int_t i, Float_t value) ;
82 void SetParameterPhotonBoundary(Int_t i, Float_t param);
83 void SetParameterPi0Boundary (Int_t i, Float_t param);
85 void SetThresholdChargedNeutral (Double_t th) {fChargedNeutralThreshold = th;}
86 void SetTOFEnergyThreshold (Float_t th) {fTOFEnThreshold = th;}
87 void SetDispersionEnergyThreshold (Float_t th) {fDispEnThreshold = th;}
88 void SetDispersionMultiplicityThreshold (Int_t th) {fDispMultThreshold = th;}
90 //Switch to "on flyght" mode, without writing to TreeR and file
91 void SetWriting(Bool_t toWrite = kFALSE){fWrite = toWrite;}
94 virtual const char * Version() const { return "pid-v1" ; }
96 AliPHOSPIDv1 & operator = (const AliPHOSPIDv1 & /*pid*/) { return *this ;}
100 const TString BranchName() const ;
101 virtual void Init() ;
102 virtual void InitParameters() ;
103 void MakeRecParticles(void ) ;
106 //Functions to calculate the PID probability
107 // Double_t ChargedHadronDistProb(Double_t x, Double_t y, Double_t * parg, Double_t * parl) ;
108 Double_t GausF (Double_t x, Double_t y, Double_t *par) ; //gaussian probability, parameter dependence a+b/(x*x)+c/x
109 Double_t GausPol2(Double_t x, Double_t y, Double_t *par) ; //gaussian probability, parameter dependence a+b*x+c*x*x
110 Double_t LandauF(Double_t x, Double_t y, Double_t *par) ; //gaussian probability, parameter dependence a+b/(x*x)+c/x
111 Double_t LandauPol2(Double_t x, Double_t y, Double_t *par) ; //gaussian probability, parameter dependence a+b*x+c*x*x
112 // Relative Distance CPV-EMC
113 Float_t GetDistance (AliPHOSEmcRecPoint * emc, AliPHOSCpvRecPoint * cpv, Option_t * axis)const ;
114 Int_t GetCPVBit (AliPHOSEmcRecPoint * emc, AliPHOSCpvRecPoint * cpv, Int_t EffPur, Float_t e) const;
115 Int_t GetPrincipalBit (TString particle, const Double_t* P, Int_t EffPur, Float_t e)const ; //Principal cut
116 Int_t GetHardPhotonBit(AliPHOSEmcRecPoint * emc) const;
117 Int_t GetHardPi0Bit (AliPHOSEmcRecPoint * emc) const;
118 TVector3 GetMomentumDirection(AliPHOSEmcRecPoint * emc, AliPHOSCpvRecPoint * cpv)const ;
119 void PrintRecParticles(Option_t * option) ;
120 virtual void WriteRecParticles() ;
121 void SetParameters() ; //Fills the matrix of parameters
125 void SetInitPID(const Double_t * pid) ;
126 void GetInitPID(Double_t * pid) const ;
129 Bool_t fBayesian ; // Do PID bayesian
130 Bool_t fDefaultInit; //! kTRUE if the task was created by defaut ctor (only parameters are initialized)
131 Bool_t fWrite ; //! To write result to file
132 Int_t fNEvent ; //! current event number
133 TString fFileNamePrincipalPhoton ; // File name of the photon principals
134 TString fFileNamePrincipalPi0 ; // File name of the pi0 principals
135 TString fFileNameParameters ; // File name with PID parameters
136 TPrincipal *fPrincipalPhoton ; //! TPrincipal from photon pca file
137 TPrincipal *fPrincipalPi0 ; //! TPrincipal from pi0 pca file
138 Double_t *fX ; //! Shower shape for the principal data
139 Double_t *fPPhoton ; //! Principal photon eigenvalues
140 Double_t *fPPi0 ; //! Principal pi0 eigenvalues
141 Int_t fRecParticlesInRun ; //! Total number of recparticles in one run
142 TMatrix *fParameters; //! Matrix of identification Parameters
144 //Initial pid population
145 Double_t fInitPID[AliPID::kSPECIESN] ; // Initial population to do bayesian PID
146 // pid probability function parameters
148 Double_t fTphoton[3] ; // gaussian tof response for photon
149 TFormula * fTFphoton ; // the formula
150 Double_t fTpiong[3] ; // gaussian tof response for pions
151 TFormula * fTFpiong ; // the formula
152 Double_t fTkaong[3] ; // landau tof response for kaons
153 TFormula * fTFkaong ; // the formula
154 Double_t fTkaonl[3] ; // landau tof response for kaons
155 TFormula * fTFkaonl ; // the formula
156 Double_t fThhadrong[3] ; // gaus tof response for heavy hadrons
157 TFormula * fTFhhadrong ; // the formula
158 Double_t fThhadronl[3] ; // landau tof response for heavy hadrons
159 TFormula * fTFhhadronl ; // the formula
162 Double_t fDmuon[3] ; // gaussian ss response for muon
163 TFormula * fDFmuon ; // the formula
164 Double_t fDphoton[10] ; // gaussian ss response for EM
165 Double_t fDpi0[10] ; // gaussian ss response for pi0
166 Double_t fDhadron[10] ; // gaussian ss response for hadrons
168 Double_t fXelectron[10] ; // gaussian emc-cpv distance response for electron
169 Double_t fXcharged[10] ; // landau emc-cpv distance response for charged part (no elect) */
170 Double_t fZelectron[10] ; // gaussian emc-cpv distance response for electron
171 Double_t fZcharged[10] ; // landau emc-cpv distance response for charged part (no elect) */
174 Double_t fERecWeightPar[4] ; // gaussian tof response for photon
175 TFormula * fERecWeight ; // the formula
176 Double_t fChargedNeutralThreshold ; //Threshold to differentiate between charged and neutral
177 Float_t fTOFEnThreshold; //Maximum energy to use TOF
178 Float_t fDispEnThreshold; //Minimum energy to use shower shape
179 Int_t fDispMultThreshold ; //Minimum multiplicity to use shower shape
181 ClassDef( AliPHOSPIDv1,12) // Particle identifier implementation version 1
185 #endif // AliPHOSPIDV1_H