]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOF.h
Major upgrade of AliRoot code
[u/mrichter/AliRoot.git] / TOF / AliTOF.h
1 #ifndef TOF_H
2 #define TOF_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 //  Manager and hits classes for set: TOF     //
10 ////////////////////////////////////////////////
11 #include "TObject.h"
12
13 class TFile;
14  
15 #include "AliDetector.h"
16 #include "AliHit.h"
17 #include "AliDigit.h" 
18 #include "AliTOFD.h"
19
20 class AliTOF : public AliDetector {
21
22 protected:
23   Int_t   fIdSens;
24
25 public:
26   Int_t   fNTof;
27   Float_t fRmax;
28   Float_t fRmin;
29   Float_t fZlenA;
30   Float_t fZlenB;
31   Float_t fZlenC;
32   Float_t fZtof;
33    
34   Float_t fStripLn;
35   Float_t fSpace;
36   Float_t fDeadBndZ;
37   Float_t fDeadBndX;
38   Float_t fXpad;
39   Float_t fZpad;
40   Float_t fGapA;
41   Float_t fGapB;
42   Float_t fOverSpc;
43   Int_t   fNpadX;
44   Int_t   fNpadZ;
45   Int_t   fPadXStr;
46
47   Int_t   fNStripA;
48   Int_t   fNStripB;
49   Int_t   fNStripC;
50
51   Float_t fTimeRes;
52   Float_t fChrgRes;
53   
54   Int_t   fPadXSector;
55   Int_t   fNRoc;
56   Int_t   fNFec;
57   Int_t   fNTdc;
58   Int_t   fNPadXRoc;
59
60
61 public:
62   AliTOF();
63   AliTOF(const char *name, const char *title);
64   virtual        ~AliTOF() {}
65   virtual void    AddHit(Int_t track, Int_t* vol, Float_t* hits);
66   virtual void    AddDigit(Int_t*, Int_t*, Float_t*);
67   virtual void    CreateGeometry();
68   virtual void    CreateMaterials();
69   virtual void    Init();
70   virtual void    MakeBranch(Option_t*, char *file=0);
71   virtual void    FinishEvent();
72   virtual Int_t   IsVersion() const =0;
73   Int_t           DistancetoPrimitive(Int_t px, Int_t py);
74   virtual void    StepManager()=0;
75   virtual void    TOFpc(Float_t, Float_t, Float_t,
76                         Float_t, Float_t,Float_t) {}
77   virtual void    DrawModule();
78   virtual void    SDigits2Digits();
79           void    Hits2Digits(Int_t evNumber=0);
80           void    Digits2Raw (Int_t evNumber=0);
81           void    Raw2Digits (Int_t evNumber=0);
82   
83 private:
84         Bool_t    CheckOverlap(Int_t*, Float_t*, Int_t);
85
86   ClassDef(AliTOF,1)  // Time Of Flight base class
87 };
88  
89 //___________________________________________
90  
91 class AliTOFhit : public AliHit {
92 public:
93   Int_t      fSector;  // number of sector 
94   Int_t      fPlate;   // number of plate
95   Int_t      fStrip;   // number of strip
96   Int_t      fPad_x;   // number of pad along x
97   Int_t      fPad_z;   // number of pad along z
98   Float_t    fPx;      // px in TOF
99   Float_t    fPy;      // py in TOF
100   Float_t    fPz;      // pz in TOF
101   Float_t    fPmom;    // P in TOF
102   Float_t    fTof;     // Time of Flight
103   Float_t    fDx;      // x of impact point in pad r.s.
104   Float_t    fDy;      // y of impact point in pad r.s.
105   Float_t    fDz;      // z of impact point in pad r.s.
106   Float_t    fIncA;    // Incidence angle
107   Float_t    fEdep;    // Energy lost in tof layer
108  
109 public:
110   AliTOFhit() {}
111   AliTOFhit(Int_t shunt, Int_t track, Int_t* vol, 
112             Float_t *hits);
113   virtual ~AliTOFhit() {}
114
115   inline  Int_t   GetSector() {return fSector;}
116   inline  Int_t   GetPlate()  {return fPlate;}
117   inline  Int_t   GetPad_x()  {return fPad_x;}
118   inline  Int_t   GetPad_z()  {return fPad_z;}
119   inline  Int_t   GetStrip()  {return (Int_t)(fPad_z*0.5);}
120   inline  Float_t GetTof()    {return fTof;}
121   inline  Float_t GetMom()    {return fPmom;}
122   inline  Float_t GetDx()     {return fDx;}
123   inline  Float_t GetDz()     {return fDz;}
124   inline  Float_t GetIncA()   {return fIncA;}
125   inline  Float_t GetEdep()   {return fEdep;}
126
127   ClassDef(AliTOFhit,1)  // Hits for Time Of Flight
128 };
129
130 //_______________________________________________________
131
132 class AliTOFdigit : public AliDigit {
133
134  public:
135   Int_t   fSector;
136   Int_t   fPlate;
137   Int_t   fStrip;
138   Int_t   fPad_x;
139   Int_t   fPad_z;
140   Float_t fTdc;
141   Float_t fAdc;
142
143  public:
144   AliTOFdigit(){}
145   AliTOFdigit(Int_t*, Int_t*, Float_t*);
146   virtual ~AliTOFdigit(){}
147   void            GetLocation(Int_t*);
148   Int_t           GetTotPad();
149   void            AddTrack(Int_t);
150
151   inline  Float_t GetTdc()           {return fTdc;}
152   inline  Float_t GetAdc()           {return fAdc;}
153   inline  Int_t   GetSector()        {return fSector;}
154   inline  void    SetTdc(Float_t TDC){fTdc = TDC;}
155   inline  void    SetAdc(Float_t ADC){fAdc = ADC;}
156
157   ClassDef(AliTOFdigit,2)  // Digits for Time Of Flight
158 };
159
160 #endif