]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDDigit.h
Updated to be in accord with AliFMDInput
[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,
53 const TArrayI& refs=TArrayI());
54 /**
55 * DTOR
56 */
4347b38f 57 virtual ~AliFMDDigit() {}
faf80567 58 /**
59 * @param i # of sample to get
60 *
61 * @return sample # @a i
62 */
6e79feeb 63 Int_t Count(UShort_t i=0) const;
faf80567 64 /**
65 *
66 * @return ADC count (first sample)
67 */
68 UShort_t Count1() const { return fCount1; }
69 /**
70 *
71 * @return ADC count (second sample, or -1 if not used)
72 */
73 Short_t Count2() const { return fCount2; }
74 /**
75 *
76 * @return ADC count (third sample, or -1 if not used)
77 */
78 Short_t Count3() const { return fCount3; }
79 /**
80 *
81 * @return ADC count (third sample, or -1 if not used)
82 */
83 Short_t Count4() const { return fCount4; }
84 /**
85 *
86 * @return Canonical ADC counts
87 */
88 UShort_t Counts() const;
89 /**
90 * Print info
91 *
92 * @param opt Not used
93 */
4347b38f 94 void Print(Option_t* opt="") const;
faf80567 95 /**
96 *
97 * @return Title
98 */
bf000c32 99 const char* GetTitle() const;
faf80567 100 /**
101 * Set the count value
102 *
103 * @param s Sample number
104 * @param c Counts
105 */
f38b1653 106 void SetCount(UShort_t s, Short_t c);
088f8e79 107protected:
108 UShort_t fCount1; // Digital signal
109 Short_t fCount2; // Digital signal (-1 if not used)
110 Short_t fCount3; // Digital signal (-1 if not used)
2aeec17d 111 Short_t fCount4; // Digital signal (-1 if not used)
112 ClassDef(AliFMDDigit,2) // Normal FMD digit
4347b38f 113};
114
115inline UShort_t
116AliFMDDigit::Counts() const
117{
2aeec17d 118 if (fCount4 >= 0) return fCount3;
119 if (fCount3 >= 0) return fCount2;
120 if (fCount2 >= 0) return fCount2;
121 return fCount1;
4347b38f 122}
123
c2fc1258 124inline Int_t
6e79feeb 125AliFMDDigit::Count(UShort_t i) const
c2fc1258 126{
127 switch (i) {
128 case 0: return fCount1;
129 case 1: return fCount2;
130 case 2: return fCount3;
2aeec17d 131 case 3: return fCount4;
c2fc1258 132 }
133 return -1;
134}
f38b1653 135inline void
136AliFMDDigit::SetCount(UShort_t i, Short_t c)
137{
138 switch (i) {
139 case 0: fCount1 = c; break;
140 case 1: fCount2 = c; break;
141 case 2: fCount3 = c; break;
142 case 3: fCount4 = c; break;
143 }
144}
c2fc1258 145
4347b38f 146#endif
147//____________________________________________________________________
148//
0d0e6995 149// Local Variables:
150// mode: C++
151// End:
152//
153//
4347b38f 154// EOF
155//