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