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