]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDDigit.h
Initialization of some data members. Copy constructor and assignment operators made...
[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 AliFMDDigit.h <FMD/AliFMDDigit.h>
16     @brief base class for digits 
17     @ingroup FMD_base
18  */
19 class AliFMDBaseDigit : public TObject 
20 {
21 public: 
22   /** CTOR */
23   AliFMDBaseDigit();
24   /** Constrctor 
25       @param detector Detector 
26       @param ring     Ring
27       @param sector   Sector
28       @param strip    Strip */
29   AliFMDBaseDigit(UShort_t detector, 
30                   Char_t   ring='\0', 
31                   UShort_t sector=0, 
32                   UShort_t strip=0);
33   /** DTOR */
34   virtual ~AliFMDBaseDigit() {}
35   /** @return Detector # */
36   UShort_t     Detector()          const { return fDetector; }
37   /** @return Ring ID */
38   Char_t       Ring()              const { return fRing;     }
39   /** @return sector # */
40   UShort_t     Sector()            const { return fSector;   }
41   /** @return strip # */
42   UShort_t     Strip()             const { return fStrip;    }
43   /** Print information 
44       @param opt Not used */
45   virtual void Print(Option_t* opt="") const;
46   /** @return Name */
47   const char*  GetName() const;
48 protected:
49   UShort_t fDetector;  // (Sub) Detector # (1,2, or 3)
50   Char_t   fRing;      // Ring ID ('I' or 'O')
51   UShort_t fSector;    // Sector # (phi division)
52   UShort_t fStrip;     // Strip # (radial division)
53   ClassDef(AliFMDBaseDigit, 1) // Base class for FMD digits 
54 };
55
56 //____________________________________________________________________
57 /** @class AliFMDDigit AliFMDDigit.h <FMD/AliFMDDigit.h>
58     @brief class for digits 
59     @ingroup FMD_base
60  */
61 class AliFMDDigit : public AliFMDBaseDigit
62 {
63 public:
64   /** CTOR */
65   AliFMDDigit();
66   /** Constrctor 
67       @param detector Detector 
68       @param ring     Ring
69       @param sector   Sector
70       @param strip    Strip 
71       @param count1   ADC (first sample)
72       @param count2   ADC (second sample, or -1 if not used)
73       @param count3   ADC (third sample, or -1 if not used) */
74   AliFMDDigit(UShort_t detector, 
75               Char_t   ring='\0', 
76               UShort_t sector=0, 
77               UShort_t strip=0, 
78               UShort_t count=0, 
79               Short_t  count2=-1, 
80               Short_t  count3=-1);
81   /** DTOR */
82   virtual ~AliFMDDigit() {}
83   /** @return ADC count (first sample) */
84   UShort_t Count1()                const { return fCount1;   }
85   /** @return ADC count (second sample, or -1 if not used) */
86   Short_t  Count2()                const { return fCount2;   }
87   /** @return ADC count (third sample, or -1 if not used) */
88   Short_t  Count3()                const { return fCount3;   }
89   /** @return Canonical ADC counts */
90   UShort_t Counts()                const;
91   /** Print info 
92       @param opt Not used */
93   void     Print(Option_t* opt="") const;
94   /** @return Title */
95   const char* GetTitle() const;
96 protected:
97   UShort_t fCount1;     // Digital signal 
98   Short_t  fCount2;     // Digital signal (-1 if not used)
99   Short_t  fCount3;     // Digital signal (-1 if not used)
100   ClassDef(AliFMDDigit,1)     // Normal FMD digit
101 };
102
103 inline UShort_t 
104 AliFMDDigit::Counts() const 
105 {
106   return fCount1 
107     + (fCount2 >= 0 ? fCount2 : 0)
108     + (fCount3 >= 0 ? fCount3 : 0);
109 }
110
111 //____________________________________________________________________
112 /** @class AliFMDSDigit AliFMDDigit.h <FMD/AliFMDDigit.h>
113     @brief class for summable digits 
114     @ingroup FMD_base
115  */
116 class AliFMDSDigit : public AliFMDBaseDigit
117 {
118 public:
119   /** CTOR */
120   AliFMDSDigit();
121   /** Constrctor 
122       @param detector Detector 
123       @param ring     Ring
124       @param sector   Sector
125       @param strip    Strip 
126       @param count1   ADC (first sample)
127       @param count2   ADC (second sample, or -1 if not used)
128       @param count3   ADC (third sample, or -1 if not used) */
129   AliFMDSDigit(UShort_t detector, 
130                Char_t   ring='\0', 
131                UShort_t sector=0, 
132                UShort_t strip=0, 
133                Float_t  edep=0,
134                UShort_t count=0, 
135                Short_t  count2=-1, 
136                Short_t  count3=-1);
137   /** DTOR */
138   virtual ~AliFMDSDigit() {}
139   /** @return ADC count (first sample) */
140   UShort_t Count1()                const { return fCount1;   }
141   /** @return ADC count (second sample, or -1 if not used) */
142   Short_t  Count2()                const { return fCount2;   }
143   /** @return ADC count (third sample, or -1 if not used) */
144   Short_t  Count3()                const { return fCount3;   }
145   /** @return Canonical ADC counts */
146   UShort_t Counts()                const;
147   /** @return Energy deposited */
148   Float_t  Edep()                  const { return fEdep;     }
149   /** Print info 
150       @param opt Not used */
151   void     Print(Option_t* opt="") const;
152 protected:
153   Float_t  fEdep;       // Energy deposited 
154   UShort_t fCount1;     // Digital signal 
155   Short_t  fCount2;     // Digital signal (-1 if not used)
156   Short_t  fCount3;     // Digital signal (-1 if not used)
157   ClassDef(AliFMDSDigit,1)     // Summable FMD digit
158 };
159   
160 inline UShort_t 
161 AliFMDSDigit::Counts() const 
162 {
163   return fCount1 
164     + (fCount2 >= 0 ? fCount2 : 0)
165     + (fCount3 >= 0 ? fCount3 : 0);
166 }
167
168
169 #endif
170 //____________________________________________________________________
171 //
172 // Local Variables:
173 //   mode: C++
174 // End:
175 //
176 //
177 // EOF
178 //