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