]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PHOS/AliPHOSPIDv1.h
Added the option to write objects into separate files and improved the cleaning
[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 char * from = 0) ;
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   // Get CpvtoEmcDistanceCut and TimeGate parameters depending on the custer energy and 
46   // Purity-Efficiency point (possible options "HIGH EFFICIENCY" "MEDIUM EFFICIENCY" "LOW  
47   // EFFICIENCY" and 3 more options changing EFFICIENCY by PURITY)
48   Double_t GetCpvtoEmcDistanceCut(const Float_t Cluster_En, const TString Eff_Pur)const  ;
49   Double_t GetTimeGate(const Float_t Cluster_En, const TString Eff_Pur)const  ;
50   const TString GetPrincipalFile( )const {return fFileName ;}
51   const TString GetPrincipalFilePar( )const {return fFileNamePar ;}
52
53   // Set all parameters necessary in the PID depending on the custer energy and 
54   // Purity-Efficiency point (possible options "HIGH EFFICIENCY" "MEDIUM EFFICIENCY" "LOW  
55   // EFFICIENCY" and 3 more options changing EFFICIENCY by PURITY)
56   void SetCpvtoEmcDistanceCut(Float_t Cluster_En, TString Eff_Pur, Float_t cut)  ; 
57   void SetTimeGate(Float_t Cluster_En, TString Eff_Pur, Float_t gate)  ; 
58   void SetEllipseXCenter(Float_t Cluster_En, TString Eff_Pur, Float_t x)  ;    
59   void SetEllipseYCenter(Float_t Cluster_En, TString Eff_Pur, Float_t y)  ;   
60   void SetEllipseAParameter(Float_t Cluster_En, TString Eff_Pur, Float_t a)  ;  
61   void SetEllipseBParameter(Float_t Cluster_En, TString Eff_Pur, Float_t b)  ; 
62   void SetEllipseAngle(Float_t Cluster_En, TString Eff_Pur, Float_t angle)  ;    
63   void SetEllipseParameters(Float_t Cluster_En, TString Eff_Pur, Float_t x, Float_t y,Float_t a, Float_t b,Float_t angle) ;  
64   void SetParameters(TString OptFileName) ; //Fills the matrix of parameters
65  
66   virtual void SetTrackSegmentsBranch(const char* title) { fTrackSegmentsTitle = title;}
67   virtual void SetRecParticlesBranch (const char* title) { fRecParticlesTitle = title;} 
68   virtual const char * Version() const { return "pid-v1" ; }  
69   
70  private:
71
72   const TString AliPHOSPIDv1::BranchName() const ; 
73   virtual void Init() ;
74   virtual void InitParameters() ;
75   void     MakeRecParticles(void ) ;
76   Float_t  GetDistance(AliPHOSEmcRecPoint * emc, AliPHOSRecPoint * cpv, Option_t * Axis)const ; // Relative Distance CPV-EMC
77   Int_t    GetPrincipalSign(Double_t* P, Int_t ell, Int_t eff_pur)const ; //Principal cut
78   TVector3 GetMomentumDirection(AliPHOSEmcRecPoint * emc, AliPHOSRecPoint * cpv)const ;
79   void     PrintRecParticles(Option_t * option) ;
80   //void     SetParameters() ; //Fills the matrix of parameters
81   Int_t    GetClusterOption(const Float_t Cluster_En,const Bool_t rcpv)const ;// Gives in wich cluster energy range is the event
82   Int_t    GetEffPurOption(const TString Eff_Pur)const ;// Gives the Efficiency-Purity point.
83   virtual void WriteRecParticles(Int_t event) ; 
84   void  SetPrincipalFileOptions(TString OptFileName) ;
85
86  private:
87
88   TString                fFileName ;          // Name of the file which contains the Principal file
89   TString                fFileNamePar ;       // Name of the file which contains the parameters
90   Int_t                  fCluster ;           // Parameter that depens on the energy range to select the parameters of the file       
91   TString                fOptFileName ;       // choose de parameters and principal file
92   TString                fFrom ;              // name of Recpoints and TrackSegments 
93   TString                fHeaderFileName ;    // file name with event header
94   TString                fTrackSegmentsTitle; // branch name with track segments
95   TString                fRecPointsTitle ;    // branch name with rec points
96   TString                fRecParticlesTitle ; // branch name with rec particles
97  
98   Int_t                      fNEvent ;            //! current event number
99   AliPHOSClusterizer *       fClusterizer ;       //! clusterizer
100   AliPHOSTrackSegmentMaker * fTSMaker ;           //! track segment maker
101   TPrincipal *               fPrincipal ;         //! TPrincipal from fFileName 
102   Int_t                      fRecParticlesInRun ; //! Total number of recparticles in one run
103   Double_t *                 fX ;                 //! Principal data 
104   Double_t *                 fP ;                 //! Principal eigenvalues
105   TMatrixD *                 fParameters ;        //! Matrix of all identification Parameters
106
107   ClassDef( AliPHOSPIDv1,3)  // Particle identifier implementation version 1
108
109 };
110
111 #endif // AliPHOSPIDV1_H