]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDDigit.h
RICH becomes HMPID
[u/mrichter/AliRoot.git] / FMD / AliFMDDigit.h
1 #ifndef ALIFMDDIGIT_H
2 #define ALIFMDDIGIT_H
3 /** @file    AliFMDDigit.h
4     @author  Christian Holm Christensen <cholm@nbi.dk>
5     @date    Mon Mar 27 12:37:41 2006
6     @brief   Digits for the FMD 
7 */
8 //___________________________________________________________________
9 //
10 //  Digits classes for the FMD
11 //  AliFMDBaseDigit - base class 
12 //  AliFMDDigit     - Normal (smeared) digit             
13 //  AliFMDSDigit    - Summable (non-smeared) digit             
14 //
15 #ifndef ALIFMDBASEDIGIT_H
16 # include <AliFMDBaseDigit.h>
17 #endif
18
19 //____________________________________________________________________
20 /** @class AliFMDDigit AliFMDDigit.h <FMD/AliFMDDigit.h>
21     @brief class for digits 
22     @ingroup FMD_base
23  */
24 class AliFMDDigit : public AliFMDBaseDigit
25 {
26 public:
27   /** CTOR */
28   AliFMDDigit();
29   /** Constrctor 
30       @param detector Detector 
31       @param ring     Ring
32       @param sector   Sector
33       @param strip    Strip 
34       @param count    ADC (first sample)
35       @param count2   ADC (second sample, or -1 if not used)
36       @param count3   ADC (third sample, or -1 if not used) */
37   AliFMDDigit(UShort_t detector, 
38               Char_t   ring='\0', 
39               UShort_t sector=0, 
40               UShort_t strip=0, 
41               UShort_t count=0, 
42               Short_t  count2=-1, 
43               Short_t  count3=-1);
44   /** DTOR */
45   virtual ~AliFMDDigit() {}
46   /** @param i # of sample to get 
47       @return sample # @a i */
48   Int_t Count(UShort_t i=0) const;
49   /** @return ADC count (first sample) */
50   UShort_t Count1()                const { return fCount1;   }
51   /** @return ADC count (second sample, or -1 if not used) */
52   Short_t  Count2()                const { return fCount2;   }
53   /** @return ADC count (third sample, or -1 if not used) */
54   Short_t  Count3()                const { return fCount3;   }
55   /** @return Canonical ADC counts */
56   UShort_t Counts()                const;
57   /** Print info 
58       @param opt Not used */
59   void     Print(Option_t* opt="") const;
60   /** @return Title */
61   const char* GetTitle() const;
62 protected:
63   UShort_t fCount1;     // Digital signal 
64   Short_t  fCount2;     // Digital signal (-1 if not used)
65   Short_t  fCount3;     // Digital signal (-1 if not used)
66   ClassDef(AliFMDDigit,1)     // Normal FMD digit
67 };
68
69 inline UShort_t 
70 AliFMDDigit::Counts() const 
71 {
72   return fCount1 
73     + (fCount2 >= 0 ? fCount2 : 0)
74     + (fCount3 >= 0 ? fCount3 : 0);
75 }
76
77 inline Int_t
78 AliFMDDigit::Count(UShort_t i) const 
79 {
80   switch (i) {
81   case 0: return fCount1;
82   case 1: return fCount2;
83   case 2: return fCount3;
84   }
85   return -1;
86 }
87
88 #endif
89 //____________________________________________________________________
90 //
91 // Local Variables:
92 //   mode: C++
93 // End:
94 //
95 //
96 // EOF
97 //