Update master to aliroot
[u/mrichter/AliRoot.git] / STEER / STEERBase / AliHMPIDPIDResponse.h
1 #ifndef ALIHMPIDPIDRESPONSE_H
2 #define ALIHMPIDPIDRESPONSE_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 //***********************************************************
8 // Class AliHMPIDPIDResponse
9 //
10 // HMPID class to perfom particle identification
11 // 
12 // Author: G. Volpe, giacomo.volpe@cern.ch
13 //***********************************************************
14
15
16 #include <TNamed.h>          //base class
17 #include <TVector3.h>
18 #include <TVector2.h>
19
20 #include "AliPID.h"
21         
22 class AliVTrack;
23 class TObjArray;
24 class TGeoHMatrix;
25
26 class AliHMPIDPIDResponse : public TNamed 
27 {
28 public : 
29              AliHMPIDPIDResponse();    //ctor
30              AliHMPIDPIDResponse(const AliHMPIDPIDResponse& c);                //copy constructor
31              AliHMPIDPIDResponse &operator=(const AliHMPIDPIDResponse& c);     //dummy assignment operator
32              virtual ~AliHMPIDPIDResponse();
33     
34     enum EChamberData{kMinCh=0,kMaxCh=6,kMinPc=0,kMaxPc=5};      //Segmenation
35     enum EPadxData{kPadPcX=80,kMinPx=0,kMaxPx=79,kMaxPcx=159};   //Segmentation structure along x
36     enum EPadyData{kPadPcY=48,kMinPy=0,kMaxPy=47,kMaxPcy=143};   //Segmentation structure along y 
37     
38     Double_t GetExpectedSignal  (const AliVTrack *vTrk, AliPID::EParticleType specie                 ) const;
39     Double_t GetExpectedSigma   (const AliVTrack *vTrk, AliPID::EParticleType specie                 ) const;                                                                     //Find the sigma for a given ThetaCerTh
40     Double_t GetNumberOfSigmas  (const AliVTrack *vTrk, AliPID::EParticleType specie                 ) const;                                                                     //Find the expected Cherenkov angle for a given track
41     void     GetProbability     (const AliVTrack *vTrk, Int_t nSpecies,Double_t *prob                ) const;                                                                     //Find the PID probability array
42     Double_t GetSignalDelta     (const AliVTrack *vTrk, AliPID::EParticleType specie, Bool_t ratio=kFALSE) const;    
43     void     Propagate          (const TVector3  dir,   TVector3 &pos,  Double_t z                   ) const;                                                                     //propagate photon alogn the line  
44     void     Refract            (TVector3 &dir,         Double_t n1,    Double_t n2                  ) const;                                                                     //refract photon on the boundary
45     TVector2 TracePhot          (Double_t xRa, Double_t yRa,  Double_t thRa, Double_t phRa, Double_t ckovThe,Double_t ckovPhi) const;                                             //trace photon created by track to PC 
46     void     Trs2Lors           (Double_t thRa, Double_t phRa, TVector3 dirCkov,      Double_t &thetaCer,Double_t &phiCer) const;                                                 //TRS to LORS
47     TVector2 TraceForward       (Double_t xRa, Double_t yRa, TVector3 dirCkov                        ) const;                                                                     //tracing forward a photon from (x,y) to PC
48     void     SetTrack           (Double_t xRad,         Double_t yRad,  Double_t theta,Double_t phi  )       {fTrkDir.SetMagThetaPhi(1,theta,phi);  fTrkPos.Set(xRad,yRad);}      //set track parameter at RAD
49     Double_t RadThick           (                                                                    ) const {return 1.5;}                                                        //Radiator thickness
50     Double_t WinThick           (                                                                    ) const {return 0.5;}                                                        //Window thickness
51     Double_t GapThick           (                                                                    ) const {return 8.0;}                                                        //Proximity gap thicknes
52     Double_t GetRefIdx          (                                                                    ) const {return fRefIdx;}                                                    //running refractive index
53     Double_t WinIdx             (                                                                    ) const {return 1.5787;}                                                     //Mean refractive index of WIN material (SiO2) 
54     Double_t GapIdx             (                                                                    ) const {return 1.0005;}                                                     //Mean refractive index of GAP material (CH4)
55     static Bool_t  IsInside     (Float_t x,Float_t y,Float_t d=0                                     )       {return  x>-d&&y>-d&&x<fgkMaxPcX[kMaxPc]+d&&y<fgkMaxPcY[kMaxPc]+d; } //is point inside chamber boundaries?
56     static Bool_t  IsInDead     (Float_t x,Float_t y                                                 );                                                                           //is the point in a dead area?
57     static Float_t SizeAllX     (                                                                    )       {return fgAllX;}                                                     //all PCs size x, [cm]        
58     static Float_t SizeAllY     (                                                                    )       {return fgAllY;}                                                     //all PCs size y, [cm]    
59     static void    IdealPosition(Int_t iCh,TGeoHMatrix *m                                            );                                                                           //ideal position of given chamber 
60         
61     Double_t SigLoc             (Double_t trkTheta,Double_t trkPhi,Double_t ckovTh,Double_t ckovPh,Double_t beta) const;                                                          //error due to cathode segmetation
62     Double_t SigGeom            (Double_t trkTheta,Double_t trkPhi,Double_t ckovTh,Double_t ckovPh,Double_t beta) const;                                                          //error due to unknown photon origin
63     Double_t SigCrom            (Double_t trkTheta,Double_t ckovTh,Double_t ckovPh,Double_t beta                ) const;                                                          //error due to unknonw photon energy
64     Double_t Sigma2             (Double_t trkTheta,Double_t trkPhi,Double_t ckovTh,Double_t ckovPh              ) const;                                                          //photon candidate sigma^2  
65     Double_t GetNMean           (const AliVTrack *vTrk                                                          ) const;
66     static Double_t SigmaCorrFact(Int_t iPart, Double_t occupancy                                               )      ;                                                          //correction factor for theoretical resolution
67     
68     void SetRefIndexArray       (TObjArray *array                                                     )       {fRefIndexArray = array;}
69     TObjArray* GetRefIndexArray (                                                                     ) const {return fRefIndexArray;}
70
71 //
72 private:
73         
74     Double_t ExpectedSignal     (const AliVTrack *vTrk, Double_t nmean, AliPID::EParticleType specie ) const;
75     Double_t ExpectedSigma      (const AliVTrack *vTrk, Double_t nmean, AliPID::EParticleType specie ) const;                                                                     //Find the sigma for a given ThetaCerTh
76     
77 protected:
78
79   static /*const*/ Float_t fgkMinPcX[6];                               //limits PC
80   static /*const*/ Float_t fgkMinPcY[6];                               //limits PC
81   static /*const*/ Float_t fgkMaxPcX[6];                               //limits PC
82   static /*const*/ Float_t fgkMaxPcY[6]; 
83           
84   static Float_t fgCellX, fgCellY, fgPcX, fgPcY, fgAllX, fgAllY;       //definition of HMPID geometric parameters 
85         
86   TGeoHMatrix *fM[7];                                                  //pointers to matrices defining HMPID chambers rotations-translations
87   
88   Double_t  fRefIdx;                                                   //running refractive index of C6F14
89   TVector3  fTrkDir;                                                   //track direction in LORS at RAD
90   TVector2  fTrkPos;                                                   //track positon in LORS at RAD
91   TObjArray *fRefIndexArray;                                           //array of refracive index funxtion;
92   
93   ClassDef(AliHMPIDPIDResponse,1)
94 };
95 #endif // #ifdef AliHMPIDPIDResponse_cxx
96