]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSPIDv1.h
AliPHOSCalibrationData added
[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 TFormula ;
17 class TVector3 ;
18 class TMatrixD ;
19 class TPrincipal ;
20
21 // --- Standard library ---
22
23 // --- AliRoot header files ---
24 class AliPHOSEmcRecPoint ;
25 class AliPHOSRecPoint ;
26
27 #include "AliPHOSPID.h"
28
29 class  AliPHOSPIDv1 : public AliPHOSPID {
30   
31  public:
32   
33   AliPHOSPIDv1() ;          // ctor            
34   AliPHOSPIDv1(const char* headerFile, const char * tsBranch = "Default", const Bool_t toSplit=kFALSE) ;
35   
36   virtual ~AliPHOSPIDv1() ; // dtor
37   
38   virtual void Exec(Option_t * option) ;
39   //  virtual char * GetRecParticlesBranch()const {return (char*) fRecParticlesTitle.Data() ;}      
40   //  virtual char * GetTrackSegmentsBranch()const{return (char*) fTrackSegmentsTitle.Data(); }
41   virtual const Int_t GetRecParticlesInRun() const  {return fRecParticlesInRun ;}  
42   
43   virtual void Print(Option_t * option) const {}
44   void Print() ; 
45   
46   //Get files that contain the PCA
47   const TString GetPrincipalFile( )const {return fFileName ;}
48   const TString GetPrincipalFilePar( )const {return fFileNamePar ;}
49
50   //To turn on or off the Pi0 analysis
51   const Bool_t GetPi0Analysis(){return fPi0Analysis;}
52   void  SetPi0Analysis(Bool_t turnonoff){ fPi0Analysis = turnonoff; }
53   // Set and Get all parameters necessary in the PID depending on the 
54   // custer energy and Purity-Efficiency point 
55   void SetCpvtoEmcDistanceCutParameters(Float_t Cluster_En, Int_t Eff_Pur, TString Axis,Float_t cut)  ; 
56   void SetTimeGate(Int_t Eff_Pur, Float_t gate)  ; 
57  
58   const Float_t GetCpvtoEmcDistanceCut(const Float_t e, const TString Axis ) const ;
59   const Double_t GetTimeGate(const Int_t Eff_Pur)  const;
60  
61   void SetEllipseParameter(TString Param, Int_t i, Double_t par)  ;    
62   const Double_t GetParameterToCalculateEllipse(const TString Param, const Int_t i) const  ;     
63   const Double_t GetEllipseParameter(const TString Param, Float_t E) const;
64   //Get and Set energy calibration parameters
65   
66   void  SetCalibrationParameter(Int_t Param,Double_t param);
67   const Double_t GetCalibrationParameter(const Int_t i) const;
68   const Double_t GetCalibratedEnergy(const Float_t e)   const; //Calibrates energy.
69   
70   //  virtual void SetTrackSegmentsBranch(const char* title) { fTrackSegmentsTitle = title;}
71   //  virtual void SetRecParticlesBranch (const char* title) { fRecParticlesTitle = title;} 
72   virtual const char * Version() const { return "pid-v1" ; }  
73   
74  private:
75   
76   const TString BranchName() const ; 
77   virtual void Init() ;
78   virtual void InitParameters() ;
79   void     MakeRecParticles(void ) ;
80   // Relative Distance CPV-EMC
81   const Float_t  GetDistance(AliPHOSEmcRecPoint * emc, AliPHOSRecPoint * cpv, Option_t * Axis)const ; 
82   const Int_t    GetCPVBit(AliPHOSEmcRecPoint * emc, AliPHOSRecPoint * cpv,const Int_t EffPur, const Float_t e) const;
83   const Int_t    GetPrincipalBit(const Double_t* P, const Int_t eff_pur, const Float_t E)const ; //Principal cut
84   TVector3 GetMomentumDirection(AliPHOSEmcRecPoint * emc, AliPHOSRecPoint * cpv)const ;
85   void     PrintRecParticles(Option_t * option) ;
86   virtual  void WriteRecParticles(Int_t event) ; 
87   void     SetParameters() ; //Fills the matrix of parameters
88   
89  
90
91  private:
92
93   Bool_t                 fDefaultInit;        //! Says if the task was created by defaut ctor (only parameters are initialized)
94   TString    fFileName ;  // File that contains the Principal file for analysis
95   TString    fFileNamePar ;// File that contains the parameters for analysis
96   
97   //  TString    fFrom ;              // name of Recpoints and TrackSegments 
98   //  TString    fHeaderFileName ;    // file name with event header
99   //  TString    fTrackSegmentsTitle; // branch name with track segments
100   //  TString    fRecPointsTitle ;    // branch name with rec points
101   //  TString    fRecParticlesTitle ; // branch name with rec particles
102  
103   Int_t                      fNEvent ;            //! current event number
104   //  AliPHOSClusterizer *       fClusterizer ;       //! clusterizer
105   //  AliPHOSTrackSegmentMaker * fTSMaker ;           //! track segment maker
106
107
108   Bool_t                     fPi0Analysis;        //! Pi0 analysis on or off  
109   TPrincipal *               fPrincipal ;         //! TPrincipal from pca file 
110   Double_t *                 fX ;                 //! Principal data 
111   Double_t *                 fP ;                 //! Principal eigenvalues
112   Int_t                      fRecParticlesInRun ; //! Total number of recparticles in one run
113   TMatrixD *                 fParameters;         //! Matrix of identification Parameters
114
115   ClassDef( AliPHOSPIDv1,6)  // Particle identifier implementation version 1
116
117 };
118
119 #endif // AliPHOSPIDV1_H