]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOFpidESD.h
Updated version of TOF PID for ESD (Yu.Belikov)
[u/mrichter/AliRoot.git] / TOF / AliTOFpidESD.h
1 #ifndef ALITOFPIDESD_H
2 #define ALITOFPIDESD_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 //-------------------------------------------------------
7 //                    TOF PID class
8 // A very naive design... Should be made better by the detector experts...
9 //   Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch 
10 //-------------------------------------------------------
11
12 #include <TObject.h>
13
14 class AliESD;
15 class TFile;
16 class TTree;
17
18 class AliTOFpidESD : public TObject {
19 enum {kMaxCluster=77777}; //maximal number of the TOF clusters
20 public:
21   AliTOFpidESD(){fR=376.; fDy=2.5; fDz=3.5; fN=0; fEventN=0;}
22   AliTOFpidESD(Double_t *param) throw (const Char_t *);
23   ~AliTOFpidESD(){UnloadClusters();}
24
25   Int_t MakePID(AliESD *event);
26   Int_t LoadClusters(const TFile *f);
27   Int_t LoadClusters(TTree *f);
28   void  UnloadClusters();
29   void SetEventNumber(Int_t n) {fEventN=n;}
30
31   Int_t GetEventNumber() const {return fEventN;}
32
33 public:
34   class AliTOFcluster {
35   public:
36     AliTOFcluster(Double_t *h, Int_t *l,Int_t idx) {
37       fR=h[0]; fPhi=h[1]; fZ=h[2]; fTDC=h[3]; fADC=h[4];
38       fLab[0]=l[0]; fLab[1]=l[1]; fLab[2]=l[2];
39       fIdx=idx;
40     }
41     void Use() {fADC=-fADC;}
42
43     Double_t GetR() const {return fR;}
44     Double_t GetPhi() const {return fPhi;}
45     Double_t GetZ()   const {return fZ;}
46     Double_t GetTDC() const {return fTDC;}
47     Double_t GetADC() const {return TMath::Abs(fADC);}
48     Int_t IsUsed() const {return (fADC<0) ? 1 : 0;}
49     Int_t GetLabel(Int_t n) const {return fLab[n];}
50     Int_t GetIndex() const {return fIdx;}
51   private:
52     Int_t fLab[3]; //track labels
53     Double_t fR;   //r-coordinate
54     Double_t fPhi; //phi-coordinate
55     Double_t fZ;   //z-coordinate
56     Double_t fTDC; //TDC count
57     Double_t fADC; //ADC count
58     Int_t fIdx;    //index of this cluster
59   };
60
61 private:
62   Int_t InsertCluster(AliTOFcluster *c);
63   Int_t FindClusterIndex(Double_t z) const;
64
65   Int_t fEventN;          //event number
66
67   Double_t fR;            // mean readius of the TOF barrel
68   Double_t fDy;           // size of the TOF cell in R*Phi
69   Double_t fDz;           // size of the TOF cell in Z
70
71   Double_t fSigma;        // intrinsic TOF resolution
72   Double_t fRange;        // one particle type PID range (in sigmas)
73
74   Int_t fN;                  // number of the TOF clusters
75   AliTOFcluster *fClusters[kMaxCluster];  // pointers to the TOF clusters
76
77   ClassDef(AliTOFpidESD,1)   // TOF PID class
78 };
79
80 #endif
81
82