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