]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PHOS/AliPHOSPIDv1.h
Classes for online analysis added
[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 ;
6ad0bfa0 19
20// --- Standard library ---
21
22// --- AliRoot header files ---
7acf6008 23class AliPHOSEmcRecPoint ;
8d4608b5 24class AliPHOSCpvRecPoint ;
6ad0bfa0 25
26d4b141 26#include "AliPHOSPID.h"
6ad0bfa0 27
26d4b141 28class AliPHOSPIDv1 : public AliPHOSPID {
50739f15 29
e3817e5f 30public:
50739f15 31
88cb7938 32 AliPHOSPIDv1() ; // ctor
e191bb57 33 AliPHOSPIDv1(const TString alirunFileNameFile, const TString eventFolderName = AliConfig::GetDefaultEventFolderName()) ;
88cb7938 34 AliPHOSPIDv1(const AliPHOSPIDv1 & pid) ; // cpy ctor
e3817e5f 35
7acf6008 36 virtual ~AliPHOSPIDv1() ; // dtor
50739f15 37
eabde521 38 virtual void Exec(Option_t *option); // Does the job
e3817e5f 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
fc7e2f43 47 virtual Int_t GetRecParticlesInRun() const {return fRecParticlesInRun ;}
e3817e5f 48
49 // Get PID parameters as they are defined in fParameters
fc7e2f43 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;
e3817e5f 56
57 // Get energy-dependent PID parameters
fc7e2f43 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;
e3817e5f 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
adcca1e6 70 //Switch to "on flyght" mode, without writing to TreeR and file
71 void SetWriting(const Bool_t toWrite = kFALSE){fWrite = toWrite;}
88cb7938 72 void Print() const ;
e3817e5f 73
8e8eae84 74 virtual const char * Version() const { return "pid-v1" ; }
e3817e5f 75
8c140292 76 AliPHOSPIDv1 & operator = (const AliPHOSPIDv1 & /*pid*/) { return *this ;}
e3817e5f 77
78private:
50739f15 79
c6987a88 80 const TString BranchName() const ;
e3817e5f 81 virtual void Init() ;
82 virtual void InitParameters() ;
83 void MakeRecParticles(void ) ;
2cc71c1e 84 void MakePID(void ) ;
85 // Relative Distance CPV-EMC
8d4608b5 86 Float_t GetDistance (AliPHOSEmcRecPoint * emc, AliPHOSCpvRecPoint * cpv, Option_t * axis)const ;
87 Int_t GetCPVBit (AliPHOSEmcRecPoint * emc, AliPHOSCpvRecPoint * cpv, Int_t EffPur, Float_t e) const;
fc7e2f43 88 Int_t GetPrincipalBit (TString particle, const Double_t* P, Int_t EffPur, Float_t e)const ; //Principal cut
89 Int_t GetHardPhotonBit(AliPHOSEmcRecPoint * emc) const;
90 Int_t GetHardPi0Bit (AliPHOSEmcRecPoint * emc) const;
8d4608b5 91 TVector3 GetMomentumDirection(AliPHOSEmcRecPoint * emc, AliPHOSCpvRecPoint * cpv)const ;
e3817e5f 92 void PrintRecParticles(Option_t * option) ;
90cceaf6 93 virtual void WriteRecParticles() ;
e3817e5f 94 void SetParameters() ; //Fills the matrix of parameters
adcca1e6 95 void Unload();
e3817e5f 96
97private:
98
99 Bool_t fDefaultInit; //! kTRUE if the task was created by defaut ctor (only parameters are initialized)
adcca1e6 100 Bool_t fWrite ; //! To write result to file
e3817e5f 101 Int_t fNEvent ; //! current event number
102 TString fFileNamePrincipalPhoton ; // File name of the photon principals
103 TString fFileNamePrincipalPi0 ; // File name of the pi0 principals
104 TString fFileNameParameters ; // File name with PID parameters
105 TPrincipal *fPrincipalPhoton ; //! TPrincipal from photon pca file
106 TPrincipal *fPrincipalPi0 ; //! TPrincipal from pi0 pca file
107 Double_t *fX ; //! Shower shape for the principal data
108 Double_t *fPPhoton ; //! Principal photon eigenvalues
109 Double_t *fPPi0 ; //! Principal pi0 eigenvalues
110 Int_t fRecParticlesInRun ; //! Total number of recparticles in one run
111 TMatrix *fParameters; //! Matrix of identification Parameters
cc1fe362 112 // response function parameters
113 // ToF
114 Double_t fTphoton[3] ; // gaussian response for photon
115 TFormula * fTFphoton ; // the formula
116 Double_t fTelectron[3] ; // gaussian response for electrons
117 TFormula * fTFelectron ; // the formula
118 Double_t fTchargedhadron[3] ; // landau response for charged hadrons
119 TFormula * fTFchargedhadron ; // the formula
120 Double_t fTneutralhadron[3] ; // landau response for neutral hadrons
121 TFormula * fTFneutralhadron ; // the formula
122
123
124 ClassDef( AliPHOSPIDv1,10) // Particle identifier implementation version 1
6ad0bfa0 125
126};
127
26d4b141 128#endif // AliPHOSPIDV1_H