]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDDigit.h
Fixed coding convention issues as given by the automatic
[u/mrichter/AliRoot.git] / FMD / AliFMDDigit.h
CommitLineData
4347b38f 1#ifndef ALIFMDDIGIT_H
2#define ALIFMDDIGIT_H
c2fc1258 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*/
56b1929b 8//___________________________________________________________________
4347b38f 9//
088f8e79 10// Digits classes for the FMD
11// AliFMDBaseDigit - base class
12// AliFMDDigit - Normal (smeared) digit
13// AliFMDSDigit - Summable (non-smeared) digit
4347b38f 14//
02a27b50 15#ifndef ALIFMDBASEDIGIT_H
16# include <AliFMDBaseDigit.h>
4347b38f 17#endif
faf80567 18#ifndef ROOT_TArrayI
19# include <TArrayI.h>
20#endif
21
4347b38f 22
4347b38f 23//____________________________________________________________________
9f662337 24/** @class AliFMDDigit AliFMDDigit.h <FMD/AliFMDDigit.h>
25 @brief class for digits
26 @ingroup FMD_base
27 */
4347b38f 28class AliFMDDigit : public AliFMDBaseDigit
29{
4347b38f 30public:
9f662337 31 /** CTOR */
4347b38f 32 AliFMDDigit();
faf80567 33 /**
34 * Constrctor
35 *
36 * @param detector Detector
37 * @param ring Ring
38 * @param sector Sector
39 * @param strip Strip
40 * @param count ADC (first sample)
41 * @param count2 ADC (second sample, or -1 if not used)
42 * @param count3 ADC (third sample, or -1 if not used)
43 * @param refs Track references
44 */
45 AliFMDDigit(UShort_t detector,
46 Char_t ring='\0',
47 UShort_t sector=0,
48 UShort_t strip=0,
49 UShort_t count=0,
50 Short_t count2=-1,
51 Short_t count3=-1,
52 Short_t count4=-1,
8d00dfa3 53 UShort_t nrefs=0,
09b6c804 54 const Int_t* refs=0);
faf80567 55 /**
56 * DTOR
57 */
4347b38f 58 virtual ~AliFMDDigit() {}
faf80567 59 /**
60 * @param i # of sample to get
61 *
62 * @return sample # @a i
63 */
6e79feeb 64 Int_t Count(UShort_t i=0) const;
faf80567 65 /**
66 *
67 * @return ADC count (first sample)
68 */
69 UShort_t Count1() const { return fCount1; }
70 /**
71 *
72 * @return ADC count (second sample, or -1 if not used)
73 */
74 Short_t Count2() const { return fCount2; }
75 /**
76 *
77 * @return ADC count (third sample, or -1 if not used)
78 */
79 Short_t Count3() const { return fCount3; }
80 /**
81 *
82 * @return ADC count (third sample, or -1 if not used)
83 */
84 Short_t Count4() const { return fCount4; }
85 /**
86 *
87 * @return Canonical ADC counts
88 */
89 UShort_t Counts() const;
90 /**
91 * Print info
92 *
93 * @param opt Not used
94 */
4347b38f 95 void Print(Option_t* opt="") const;
faf80567 96 /**
97 *
98 * @return Title
99 */
bf000c32 100 const char* GetTitle() const;
faf80567 101 /**
102 * Set the count value
103 *
104 * @param s Sample number
105 * @param c Counts
106 */
f38b1653 107 void SetCount(UShort_t s, Short_t c);
86878381 108 /**
109 * Initialize all counts to appropriate values for this oversampling
110 * rate. That is
111 *
112 * @verbatim
113 * Rate | Sample 1 | Sample 2 | Sample 3 | Sample 4
114 * -----+----------+----------+----------+----------
115 * 1 | 0 | -1 | -1 | -1
116 * 2 | 0 | 0 | -1 | -1
117 * 3 | 0 | 0 | 0 | -1
118 * 4 | 0 | 0 | 0 | 0
119 * @endverbatim
120 *
121 * @param rate Oversampling rate
122 */
123 void SetDefaultCounts(UShort_t rate);
088f8e79 124protected:
125 UShort_t fCount1; // Digital signal
126 Short_t fCount2; // Digital signal (-1 if not used)
127 Short_t fCount3; // Digital signal (-1 if not used)
2aeec17d 128 Short_t fCount4; // Digital signal (-1 if not used)
129 ClassDef(AliFMDDigit,2) // Normal FMD digit
4347b38f 130};
131
86878381 132inline void
133AliFMDDigit::SetDefaultCounts(UShort_t rate)
134{
135 switch (rate) {
136 case 4: fCount4 = 0; // Fall through
137 case 3: fCount3 = 0; // Fall through
138 case 2: fCount2 = 0; // Fall through
139 case 1: fCount1 = 0;
140 break;
141 default:
142 fCount4 = fCount3 = fCount2 = fCount1 = 0;
143 break;
144 }
145}
4347b38f 146inline UShort_t
147AliFMDDigit::Counts() const
148{
2aeec17d 149 if (fCount4 >= 0) return fCount3;
150 if (fCount3 >= 0) return fCount2;
151 if (fCount2 >= 0) return fCount2;
152 return fCount1;
4347b38f 153}
154
c2fc1258 155inline Int_t
6e79feeb 156AliFMDDigit::Count(UShort_t i) const
c2fc1258 157{
158 switch (i) {
159 case 0: return fCount1;
160 case 1: return fCount2;
161 case 2: return fCount3;
2aeec17d 162 case 3: return fCount4;
c2fc1258 163 }
164 return -1;
165}
f38b1653 166inline void
167AliFMDDigit::SetCount(UShort_t i, Short_t c)
168{
169 switch (i) {
170 case 0: fCount1 = c; break;
171 case 1: fCount2 = c; break;
172 case 2: fCount3 = c; break;
173 case 3: fCount4 = c; break;
174 }
175}
c2fc1258 176
4347b38f 177#endif
178//____________________________________________________________________
179//
0d0e6995 180// Local Variables:
181// mode: C++
182// End:
183//
184//
4347b38f 185// EOF
186//