]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSPIDv1.h
Base Particle Cuts moved to the separate file. Property eneum defined namespace of...
[u/mrichter/AliRoot.git] / PHOS / AliPHOSPIDv1.h
1 #ifndef ALIPHOSPIDV1_H
2 #define ALIPHOSPIDV1_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8
9 //_________________________________________________________________________
10 // Implementation version v1 of the PHOS particle identifier 
11 // Identification is based on information from CPV and EMC
12 // Oh yeah                 
13 //*-- Author: Yves Schutz (SUBATECH), Gustavo Conesa.
14
15 // --- ROOT system ---
16 class TVector3 ;
17 class TMatrix ;
18 class TPrincipal ;
19
20 // --- Standard library ---
21
22 // --- AliRoot header files ---
23 class AliPHOSEmcRecPoint ;
24 class AliPHOSCpvRecPoint ;
25
26 #include "AliPHOSPID.h"
27
28 class  AliPHOSPIDv1 : public AliPHOSPID {
29   
30 public:
31   
32   AliPHOSPIDv1() ;          // ctor   
33   AliPHOSPIDv1(const TString alirunFileNameFile, const TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ;
34   AliPHOSPIDv1(const AliPHOSPIDv1 & pid) ;          // cpy ctor            
35   
36   virtual ~AliPHOSPIDv1() ; // dtor
37   
38   virtual void Exec(Option_t *option);  // Does the job
39
40   //Get file name that contain the PCA
41   const TString GetFileNamePrincipal(TString particle) const;
42
43   //Get file name that contain PID parameters
44   const TString GetFileNameParameters()      const {return fFileNameParameters ;}
45
46   // Get number of rec.particles in this run
47   virtual Int_t GetRecParticlesInRun() const {return fRecParticlesInRun ;}  
48
49   // Get PID parameters as they are defined in fParameters
50   Float_t GetParameterCalibration    (Int_t i)               const;
51   Float_t GetParameterCpv2Emc        (Int_t i, TString axis) const;
52   Float_t GetParameterTimeGate       (Int_t i)               const;
53   Float_t GetParameterToCalculateEllipse(TString particle, TString param, Int_t i) const  ;     
54   Float_t GetParameterPhotonBoundary (Int_t i)               const;
55   Float_t GetParameterPi0Boundary    (Int_t i)               const;
56
57   // Get energy-dependent PID parameters
58   Float_t GetCalibratedEnergy    (Float_t e)                 const;
59   Float_t GetCpv2EmcDistanceCut  (TString axis, Float_t e)   const ;
60   Float_t GetEllipseParameter    (TString particle, TString param, Float_t e) const;
61
62   // Set PID parameters to change appropriate element of fParameters
63   void SetParameterCalibration   (Int_t i, Float_t param);
64   void SetParameterCpv2Emc       (Int_t i, TString axis, Float_t cut)  ; 
65   void SetParameterTimeGate      (Int_t i, Float_t gate)  ; 
66   void SetParameterToCalculateEllipse(TString particle, TString param, Int_t i, Float_t value) ;
67   void SetParameterPhotonBoundary(Int_t i, Float_t param);
68   void SetParameterPi0Boundary   (Int_t i, Float_t param);
69
70   void Print() const ; 
71
72   virtual const char * Version() const { return "pid-v1" ; }  
73
74   AliPHOSPIDv1 & operator = (const AliPHOSPIDv1 & /*pid*/) { return *this ;} 
75   
76 private:
77   
78   const TString BranchName() const ; 
79   virtual void  Init() ;
80   virtual void  InitParameters() ;
81   void          MakeRecParticles(void ) ;
82   void          MakePID(void ) ;
83  // Relative Distance CPV-EMC
84   Float_t GetDistance     (AliPHOSEmcRecPoint * emc, AliPHOSCpvRecPoint * cpv, Option_t * axis)const ; 
85   Int_t   GetCPVBit       (AliPHOSEmcRecPoint * emc, AliPHOSCpvRecPoint * cpv, Int_t EffPur, Float_t e) const;
86   Int_t   GetPrincipalBit (TString particle, const Double_t* P, Int_t EffPur, Float_t e)const ; //Principal cut
87   Int_t   GetHardPhotonBit(AliPHOSEmcRecPoint * emc) const;
88   Int_t   GetHardPi0Bit   (AliPHOSEmcRecPoint * emc) const;
89   TVector3      GetMomentumDirection(AliPHOSEmcRecPoint * emc, AliPHOSCpvRecPoint * cpv)const ;
90   void          PrintRecParticles(Option_t * option) ;
91   virtual void  WriteRecParticles() ; 
92   void          SetParameters() ; //Fills the matrix of parameters
93   void Unload(); 
94
95 private:
96
97   Bool_t      fDefaultInit;              //! kTRUE if the task was created by defaut ctor (only parameters are initialized)
98   Int_t       fNEvent ;                  //! current event number
99   TString     fFileNamePrincipalPhoton ; //  File name of the photon principals
100   TString     fFileNamePrincipalPi0 ;    //  File name of the pi0 principals
101   TString     fFileNameParameters ;      //  File name with PID parameters
102   TPrincipal *fPrincipalPhoton ;         //! TPrincipal from photon pca file 
103   TPrincipal *fPrincipalPi0 ;            //! TPrincipal from pi0 pca file 
104   Double_t   *fX ;                       //! Shower shape for the principal data 
105   Double_t   *fPPhoton ;                 //! Principal photon eigenvalues
106   Double_t   *fPPi0 ;                    //! Principal pi0 eigenvalues
107   Int_t       fRecParticlesInRun ;       //! Total number of recparticles in one run
108   TMatrix    *fParameters;               //! Matrix of identification Parameters
109   // response function parameters
110   // ToF
111   Double_t fTphoton[3] ;                 // gaussian response for photon
112   TFormula * fTFphoton ;                 // the formula   
113   Double_t fTelectron[3] ;               // gaussian response for electrons
114   TFormula * fTFelectron ;               // the formula   
115   Double_t fTchargedhadron[3] ;          // landau   response for charged hadrons
116   TFormula * fTFchargedhadron ;          // the formula   
117   Double_t fTneutralhadron[3] ;          // landau   response for neutral hadrons
118   TFormula * fTFneutralhadron ;          // the formula   
119
120
121   ClassDef( AliPHOSPIDv1,10)  // Particle identifier implementation version 1
122
123 };
124
125 #endif // AliPHOSPIDV1_H