]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/AliTOF.h
Major upgrades to the strip structure
[u/mrichter/AliRoot.git] / TOF / AliTOF.h
1 ////////////////////////////////////////////////
2 //                                            //
3 //  Manager, hit and digit classes for TOF    //
4 //  Interfaces:
5 //  AliTOF                                    //
6 //  AliTOFhit                                 //
7 //  AliTOFdigit                               //
8 ////////////////////////////////////////////////
9
10 #ifndef ALITOF_H
11 #define ALITOF_H
12 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
13  * See cxx source for full Copyright notice                               */
14
15 /* $Id$ */
16
17 #include "TObject.h"
18
19 class TFile;
20  
21 #include "AliDetector.h"
22 #include "AliHit.h"
23 #include "AliDigit.h" 
24 //#include "AliTOFD.h"
25
26 class AliTOF : public AliDetector {
27
28 public:
29   AliTOF();
30   AliTOF(const char *name, const char *title);
31   virtual        ~AliTOF() {}
32 // getters for AliTOF object status
33   Int_t GetNStripA() const {return fNStripA;}
34   Int_t GetNStripB() const {return fNStripB;}
35   Int_t GetNStripC() const {return fNStripC;}
36   Int_t GetNpadX()   const {return fNpadX;}
37   Int_t GetNpadZ()   const {return fNpadZ;}
38   Int_t GetPadXStr() const {return fPadXStr;}
39
40   virtual void    AddHit(Int_t track, Int_t* vol, Float_t* hits);
41   virtual void    AddDigit(Int_t* tracks, Int_t* vol, Float_t* digits);
42   virtual void    CreateGeometry();
43   virtual void    CreateMaterials();
44   virtual void    Init();
45   virtual void    MakeBranch(Option_t* option, char *file=0);
46   virtual void    FinishEvent();
47   virtual Int_t   IsVersion() const =0;
48   Int_t           DistancetoPrimitive(Int_t px, Int_t py);
49   virtual void    StepManager()=0;
50   virtual void    TOFpc(Float_t xtof, Float_t ytof, Float_t zlenC,
51                         Float_t zlenB, Float_t zlenA, Float_t ztof0){}
52   virtual void    DrawModule();
53   virtual void    SDigits2Digits();
54           void    Hits2Digits(Int_t evNumber=0);
55           void    Digits2Raw (Int_t evNumber=0);
56           void    Raw2Digits (Int_t evNumber=0);
57
58 protected:
59   Int_t   fNTof;  // number of TOF sectors
60   Float_t fRmax;  // upper bound for radial extension of TOF detector
61   Float_t fRmin;  // lower bound for radial extension of TOF detector
62   Float_t fZlenA; // length along z-axis of type A module 
63   Float_t fZlenB; // length along z-axis of type B module
64   Float_t fZlenC; // length along z-axis of type C module
65   Float_t fZtof;  // total semi-length of TOF detector
66    
67   Float_t fStripLn;  //  Strip Length
68   Float_t fSpace;    //  Space Beetween the strip and the bottom of the plate
69   Float_t fDeadBndZ; //  Dead Boundaries of a Strip along Z direction (width)
70   Float_t fDeadBndX; //  Dead Boundaries of a Strip along X direction (length)
71   Float_t fXpad;  //  X size of a pad
72   Float_t fZpad;  //  Z size of a pad
73   Float_t fGapA;  //  Gap beetween tilted strip in A-type plate
74   Float_t fGapB;  //  Gap beetween tilted strip in B-type plate
75   Float_t fOverSpc; // Space available for sensitive layers in radial direction
76   Int_t   fNpadX; // Number of pads in a strip along the X direction
77   Int_t   fNpadZ; // Number of pads in a strip along the Z direction
78   Int_t   fPadXStr; // Number of pads per strip
79
80   Int_t   fNStripA; // number of strips in A type module
81   Int_t   fNStripB; // number of strips in B type module
82   Int_t   fNStripC; // number of strips in C type module
83
84   Float_t fTimeRes; // time resolution of the TOF
85   Float_t fChrgRes; // charge resolution of ADC
86   
87   Int_t   fPadXSector; // number of pads per sector
88   Int_t   fNRoc;       // number of ROC
89   Int_t   fNFec;       // number of FEC
90   Int_t   fNTdc;       // number of TDC
91   Int_t   fNPadXRoc;   // number of pads for each ROC
92   Int_t   fIdSens;  // the unique numeric identifier for sensitive volume FPAD 
93   
94 private:
95         Bool_t    CheckOverlap(Int_t* vol, Float_t* digit, Int_t Track);
96
97   ClassDef(AliTOF,1)  // Time Of Flight base class
98 };
99  
100 //___________________________________________
101  
102 class AliTOFhit : public AliHit {
103   
104 public:
105   AliTOFhit() {}
106   AliTOFhit(Int_t shunt, Int_t track, Int_t* vol, 
107             Float_t *hits);
108   AliTOFhit(const AliTOFhit & hit) ;
109   virtual ~AliTOFhit() {}
110   // getters for AliTOFhit object
111   Int_t   GetSector() const {return fSector;}
112   Int_t   GetPlate() const {return fPlate;}
113   Int_t   GetPadx() const {return fPadx;}
114   Int_t   GetPadz() const {return fPadz;}
115   Int_t   GetStrip() const {return fStrip;}
116   Float_t GetTof() const {return fTof;}
117   Float_t GetMom() const {return fPmom;}
118   Float_t GetDx() const  {return fDx;}
119   Float_t GetDz() const  {return fDz;}
120   Float_t GetIncA() const {return fIncA;}
121   Float_t GetEdep() const {return fEdep;}
122
123 protected:
124   Int_t      fSector;  // number of sector 
125   Int_t      fPlate;   // number of plate
126   Int_t      fStrip;   // number of strip
127   Int_t      fPadx;    // number of pad along x
128   Int_t      fPadz;    // number of pad along z
129 // X, Y and Z coordinates of the hit are defined on mother class
130 // AliHit
131   Float_t    fPx;      // px in TOF
132   Float_t    fPy;      // py in TOF
133   Float_t    fPz;      // pz in TOF
134   Float_t    fPmom;    // P in TOF
135   Float_t    fTof;     // Time of Flight
136   Float_t    fDx;      // x of impact point in pad r.s.
137   Float_t    fDy;      // y of impact point in pad r.s.
138   Float_t    fDz;      // z of impact point in pad r.s.
139   Float_t    fIncA;    // Incidence angle
140   Float_t    fEdep;    // Energy lost in TOF sensitive layer
141
142   ClassDef(AliTOFhit,1)  // Hits for Time Of Flight
143 };
144
145 //_______________________________________________________
146
147 class AliTOFdigit : public AliDigit {
148
149  public:
150   AliTOFdigit(){}
151   AliTOFdigit(Int_t* tracks, Int_t* vol, Float_t* digit);
152   AliTOFdigit(const AliTOFdigit & digit) ;
153   virtual ~AliTOFdigit(){}
154   void            GetLocation(Int_t* Loc);
155   Int_t           GetTotPad();
156   void            AddTrack(Int_t track);
157   // getters for AliTOFdigit object 
158   Float_t GetTdc()    const     {return fTdc;}
159   Float_t GetAdc()    const     {return fAdc;}
160   Int_t   GetSector() const     {return fSector;}
161   // setters for AliTOFdigit object
162   void    SetTdc(Float_t TDC){fTdc = TDC;}
163   void    SetAdc(Float_t ADC){fAdc = ADC;}
164
165 protected:
166   Int_t   fSector;  // number of sector
167   Int_t   fPlate;   // number of plate
168   Int_t   fStrip;   // number of strip
169   Int_t   fPadx;    // number of pad along x
170   Int_t   fPadz;    // number of pad along z
171   Float_t fTdc;     // tdc values for digit
172   Float_t fAdc;     // adc values for digit
173
174   ClassDef(AliTOFdigit,2)  // Digits for Time Of Flight
175 };
176
177 #endif /* ALITOF_H */