]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDDigit.h
Added AliFMD3Support class
[u/mrichter/AliRoot.git] / FMD / AliFMDDigit.h
1 #ifndef ALIFMDDIGIT_H
2 #define ALIFMDDIGIT_H
3 //___________________________________________________________________
4 //
5 //  Digits classes for the FMD                
6 //
7 #ifndef ROOT_TObject
8 # include <TObject.h>
9 #endif
10
11 //____________________________________________________________________
12 class AliFMDBaseDigit : public TObject 
13 {
14 public: 
15   AliFMDBaseDigit();
16   AliFMDBaseDigit(UShort_t detector, 
17                   Char_t   ring='\0', 
18                   UShort_t sector=0, 
19                   UShort_t strip=0);
20   virtual ~AliFMDBaseDigit() {}
21   UShort_t     Detector()          const { return fDetector; }
22   Char_t       Ring()              const { return fRing;     }
23   UShort_t     Sector()            const { return fSector;   }
24   UShort_t     Strip()             const { return fStrip;    }
25   virtual void Print(Option_t* opt="") const;
26
27 protected:
28   UShort_t fDetector;  // (Sub) Detector # (1,2, or 3)
29   Char_t   fRing;      // Ring ID ('I' or 'O')
30   UShort_t fSector;    // Sector # (phi division)
31   UShort_t fStrip;     // Strip # (radial division)
32   ClassDef(AliFMDBaseDigit, 1) // Base class for FMD digits 
33 };
34
35 //____________________________________________________________________
36 class AliFMDDigit : public AliFMDBaseDigit
37 {
38 protected:
39   UShort_t fCount1;     // Digital signal 
40   Short_t  fCount2;     // Digital signal (-1 if not used)
41   Short_t  fCount3;     // Digital signal (-1 if not used)
42 public:
43   AliFMDDigit();
44   AliFMDDigit(UShort_t detector, 
45               Char_t   ring='\0', 
46               UShort_t sector=0, 
47               UShort_t strip=0, 
48               UShort_t count=0, 
49               Short_t  count2=-1, 
50               Short_t  count3=-1);
51   virtual ~AliFMDDigit() {}
52   UShort_t Count1()                const { return fCount1;   }
53   Short_t  Count2()                const { return fCount2;   }
54   Short_t  Count3()                const { return fCount3;   }
55   UShort_t Counts()                const;
56   void     Print(Option_t* opt="") const;
57   ClassDef(AliFMDDigit,1)     // Normal FMD digit
58 };
59
60 inline UShort_t 
61 AliFMDDigit::Counts() const 
62 {
63   return fCount1 
64     + (fCount2 >= 0 ? fCount2 : 0)
65     + (fCount3 >= 0 ? fCount3 : 0);
66 }
67
68 //____________________________________________________________________
69 class AliFMDSDigit : public AliFMDBaseDigit
70 {
71 protected:
72   Float_t  fEdep;       // Energy deposited 
73   UShort_t fCount1;     // Digital signal 
74   Short_t  fCount2;     // Digital signal (-1 if not used)
75   Short_t  fCount3;     // Digital signal (-1 if not used)
76 public:
77   AliFMDSDigit();
78   AliFMDSDigit(UShort_t detector, 
79                Char_t   ring='\0', 
80                UShort_t sector=0, 
81                UShort_t strip=0, 
82                Float_t  edep=0,
83                UShort_t count=0, 
84                Short_t  count2=-1, 
85                Short_t  count3=-1);
86   virtual ~AliFMDSDigit() {}
87   UShort_t Count1()                const { return fCount1;   }
88   Short_t  Count2()                const { return fCount2;   }
89   Short_t  Count3()                const { return fCount3;   }
90   Float_t  Edep()                  const { return fEdep;     }
91   UShort_t Counts()                const;
92   void     Print(Option_t* opt="") const;
93   ClassDef(AliFMDSDigit,1)     // Summable FMD digit
94 };
95   
96 inline UShort_t 
97 AliFMDSDigit::Counts() const 
98 {
99   return fCount1 
100     + (fCount2 >= 0 ? fCount2 : 0)
101     + (fCount3 >= 0 ? fCount3 : 0);
102 }
103
104
105 #endif
106 //____________________________________________________________________
107 //
108 // Local Variables:
109 //   mode: C++
110 // End:
111 //
112 //
113 // EOF
114 //