]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSPIDv1.h
Corrected signature of Clear to avoid compilation warnings (icc)
[u/mrichter/AliRoot.git] / PHOS / AliPHOSPIDv1.h
CommitLineData
26d4b141 1#ifndef ALIPHOSPIDV1_H
2#define ALIPHOSPIDV1_H
6ad0bfa0 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
702ab87e 8/* History of cvs commits:
9 *
10 * $Log$
11 */
b2a60966 12
13//_________________________________________________________________________
14// Implementation version v1 of the PHOS particle identifier
148b2bba 15// Identification is based on information from CPV and EMC
2f04ed65 16// Oh yeah
148b2bba 17//*-- Author: Yves Schutz (SUBATECH), Gustavo Conesa.
6ad0bfa0 18
19// --- ROOT system ---
7acf6008 20class TVector3 ;
e3817e5f 21class TMatrix ;
148b2bba 22class TPrincipal ;
c947e71a 23class TROOT ;
24class TTree ;
25class TCanvas ;
26class TFolder ;
27class TMatrixD ;
acb5beb7 28class TFormula;
6ad0bfa0 29// --- Standard library ---
6ad0bfa0 30// --- AliRoot header files ---
7acf6008 31class AliPHOSEmcRecPoint ;
8d4608b5 32class AliPHOSCpvRecPoint ;
c947e71a 33class AliPHOSClusterizerv1 ;
34class AliPHOSTrackSegmentMakerv1 ;
6ad0bfa0 35
26d4b141 36#include "AliPHOSPID.h"
fb7b51ad 37#include "AliPID.h"
26d4b141 38class AliPHOSPIDv1 : public AliPHOSPID {
50739f15 39
e3817e5f 40public:
50739f15 41
88cb7938 42 AliPHOSPIDv1() ; // ctor
e191bb57 43 AliPHOSPIDv1(const TString alirunFileNameFile, const TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ;
88cb7938 44 AliPHOSPIDv1(const AliPHOSPIDv1 & pid) ; // cpy ctor
e3817e5f 45
7acf6008 46 virtual ~AliPHOSPIDv1() ; // dtor
50739f15 47
eabde521 48 virtual void Exec(Option_t *option); // Does the job
e3817e5f 49
50 //Get file name that contain the PCA
51 const TString GetFileNamePrincipal(TString particle) const;
52
53 //Get file name that contain PID parameters
54 const TString GetFileNameParameters() const {return fFileNameParameters ;}
55
56 // Get number of rec.particles in this run
fc7e2f43 57 virtual Int_t GetRecParticlesInRun() const {return fRecParticlesInRun ;}
e3817e5f 58
35adb638 59
e3817e5f 60 // Get PID parameters as they are defined in fParameters
fc7e2f43 61 Float_t GetParameterCalibration (Int_t i) const;
62 Float_t GetParameterCpv2Emc (Int_t i, TString axis) const;
63 Float_t GetParameterTimeGate (Int_t i) const;
64 Float_t GetParameterToCalculateEllipse(TString particle, TString param, Int_t i) const ;
65 Float_t GetParameterPhotonBoundary (Int_t i) const;
66 Float_t GetParameterPi0Boundary (Int_t i) const;
e3817e5f 67
68 // Get energy-dependent PID parameters
fc7e2f43 69 Float_t GetCalibratedEnergy (Float_t e) const;
70 Float_t GetCpv2EmcDistanceCut (TString axis, Float_t e) const ;
71 Float_t GetEllipseParameter (TString particle, TString param, Float_t e) const;
e3817e5f 72
fb7b51ad 73 Double_t GetThresholdChargedNeutral () const {return fChargedNeutralThreshold;}
2924941c 74 Float_t GetTOFEnergyThreshold () const {return fTOFEnThreshold;}
75 Float_t GetDispersionEnergyThreshold () const {return fDispEnThreshold;}
76 Int_t GetDispersionMultiplicityThreshold () const {return fDispMultThreshold;}
fb7b51ad 77
c947e71a 78 //Do bayesian PID
79 void SetBayesianPID(Bool_t set){ fBayesian = set ;}
80
e3817e5f 81 // Set PID parameters to change appropriate element of fParameters
82 void SetParameterCalibration (Int_t i, Float_t param);
83 void SetParameterCpv2Emc (Int_t i, TString axis, Float_t cut) ;
84 void SetParameterTimeGate (Int_t i, Float_t gate) ;
85 void SetParameterToCalculateEllipse(TString particle, TString param, Int_t i, Float_t value) ;
86 void SetParameterPhotonBoundary(Int_t i, Float_t param);
87 void SetParameterPi0Boundary (Int_t i, Float_t param);
88
fb7b51ad 89 void SetThresholdChargedNeutral (Double_t th) {fChargedNeutralThreshold = th;}
2924941c 90 void SetTOFEnergyThreshold (Float_t th) {fTOFEnThreshold = th;}
91 void SetDispersionEnergyThreshold (Float_t th) {fDispEnThreshold = th;}
92 void SetDispersionMultiplicityThreshold (Int_t th) {fDispMultThreshold = th;}
fb7b51ad 93
adcca1e6 94 //Switch to "on flyght" mode, without writing to TreeR and file
5d0435dd 95 void SetWriting(Bool_t toWrite = kFALSE){fWrite = toWrite;}
702ab87e 96 void Print(const Option_t * = "") const ;
e3817e5f 97
8e8eae84 98 virtual const char * Version() const { return "pid-v1" ; }
e3817e5f 99
8c140292 100 AliPHOSPIDv1 & operator = (const AliPHOSPIDv1 & /*pid*/) { return *this ;}
e3817e5f 101
102private:
50739f15 103
c6987a88 104 const TString BranchName() const ;
e3817e5f 105 virtual void Init() ;
106 virtual void InitParameters() ;
107 void MakeRecParticles(void ) ;
35adb638 108 void MakePID(void) ;
109
110 //Functions to calculate the PID probability
111 // Double_t ChargedHadronDistProb(Double_t x, Double_t y, Double_t * parg, Double_t * parl) ;
17323043 112 Double_t GausF (Double_t x, Double_t y, Double_t *par) ; //gaussian probability, parameter dependence a+b/(x*x)+c/x
113 Double_t GausPol2(Double_t x, Double_t y, Double_t *par) ; //gaussian probability, parameter dependence a+b*x+c*x*x
114 Double_t LandauF(Double_t x, Double_t y, Double_t *par) ; //gaussian probability, parameter dependence a+b/(x*x)+c/x
115 Double_t LandauPol2(Double_t x, Double_t y, Double_t *par) ; //gaussian probability, parameter dependence a+b*x+c*x*x
2cc71c1e 116 // Relative Distance CPV-EMC
8d4608b5 117 Float_t GetDistance (AliPHOSEmcRecPoint * emc, AliPHOSCpvRecPoint * cpv, Option_t * axis)const ;
118 Int_t GetCPVBit (AliPHOSEmcRecPoint * emc, AliPHOSCpvRecPoint * cpv, Int_t EffPur, Float_t e) const;
fc7e2f43 119 Int_t GetPrincipalBit (TString particle, const Double_t* P, Int_t EffPur, Float_t e)const ; //Principal cut
120 Int_t GetHardPhotonBit(AliPHOSEmcRecPoint * emc) const;
121 Int_t GetHardPi0Bit (AliPHOSEmcRecPoint * emc) const;
8d4608b5 122 TVector3 GetMomentumDirection(AliPHOSEmcRecPoint * emc, AliPHOSCpvRecPoint * cpv)const ;
e3817e5f 123 void PrintRecParticles(Option_t * option) ;
90cceaf6 124 virtual void WriteRecParticles() ;
e3817e5f 125 void SetParameters() ; //Fills the matrix of parameters
adcca1e6 126 void Unload();
e3817e5f 127
35adb638 128 //PID population
129 void SetInitPID(const Double_t * pid) ;
130 void GetInitPID(Double_t * pid) const ;
e3817e5f 131
35adb638 132private:
133 Bool_t fBayesian ; // Do PID bayesian
e3817e5f 134 Bool_t fDefaultInit; //! kTRUE if the task was created by defaut ctor (only parameters are initialized)
adcca1e6 135 Bool_t fWrite ; //! To write result to file
e3817e5f 136 Int_t fNEvent ; //! current event number
137 TString fFileNamePrincipalPhoton ; // File name of the photon principals
138 TString fFileNamePrincipalPi0 ; // File name of the pi0 principals
139 TString fFileNameParameters ; // File name with PID parameters
140 TPrincipal *fPrincipalPhoton ; //! TPrincipal from photon pca file
141 TPrincipal *fPrincipalPi0 ; //! TPrincipal from pi0 pca file
142 Double_t *fX ; //! Shower shape for the principal data
143 Double_t *fPPhoton ; //! Principal photon eigenvalues
144 Double_t *fPPi0 ; //! Principal pi0 eigenvalues
145 Int_t fRecParticlesInRun ; //! Total number of recparticles in one run
146 TMatrix *fParameters; //! Matrix of identification Parameters
cc1fe362 147
35adb638 148 //Initial pid population
304864ab 149 Double_t fInitPID[AliPID::kSPECIESN] ; // Initial population to do bayesian PID
35adb638 150 // pid probability function parameters
151 // ToF
2924941c 152 Double_t fTphoton[3] ; // gaussian tof response for photon
153 TFormula * fTFphoton ; // the formula
154 Double_t fTpiong[3] ; // gaussian tof response for pions
155 TFormula * fTFpiong ; // the formula
156 Double_t fTkaong[3] ; // landau tof response for kaons
157 TFormula * fTFkaong ; // the formula
158 Double_t fTkaonl[3] ; // landau tof response for kaons
159 TFormula * fTFkaonl ; // the formula
160 Double_t fThhadrong[3] ; // gaus tof response for heavy hadrons
161 TFormula * fTFhhadrong ; // the formula
162 Double_t fThhadronl[3] ; // landau tof response for heavy hadrons
163 TFormula * fTFhhadronl ; // the formula
35adb638 164
165 //Shower dispersion
2924941c 166 Double_t fDmuon[3] ; // gaussian ss response for muon
167 TFormula * fDFmuon ; // the formula
168 Double_t fDphoton[10] ; // gaussian ss response for EM
169 Double_t fDpi0[10] ; // gaussian ss response for pi0
170 Double_t fDhadron[10] ; // gaussian ss response for hadrons
171
172 Double_t fXelectron[10] ; // gaussian emc-cpv distance response for electron
173 Double_t fXcharged[10] ; // landau emc-cpv distance response for charged part (no elect) */
174 Double_t fZelectron[10] ; // gaussian emc-cpv distance response for electron
175 Double_t fZcharged[10] ; // landau emc-cpv distance response for charged part (no elect) */
176
cc1fe362 177
fb7b51ad 178 Double_t fERecWeightPar[4] ; // gaussian tof response for photon
179 TFormula * fERecWeight ; // the formula
2924941c 180 Double_t fChargedNeutralThreshold ; //Threshold to differentiate between charged and neutral
181 Float_t fTOFEnThreshold; //Maximum energy to use TOF
182 Float_t fDispEnThreshold; //Minimum energy to use shower shape
183 Int_t fDispMultThreshold ; //Minimum multiplicity to use shower shape
184
185 ClassDef( AliPHOSPIDv1,12) // Particle identifier implementation version 1
6ad0bfa0 186
187};
188
26d4b141 189#endif // AliPHOSPIDV1_H