Line data Source code
1 : #ifndef ALIFMDSDIGIT_H
2 : #define ALIFMDSDIGIT_H
3 : /** @file AliFMDSDigit.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 : // #ifndef ROOT_TArrayI
19 : // # include <TArrayI.h>
20 : // #endif
21 :
22 : //____________________________________________________________________
23 : /** @class AliFMDSDigit AliFMDDigit.h <FMD/AliFMDDigit.h>
24 : @brief class for summable digits
25 : @ingroup FMD_base
26 : */
27 0 : class AliFMDSDigit : public AliFMDBaseDigit
28 : {
29 : public:
30 : /**
31 : * CTOR
32 : */
33 : AliFMDSDigit();
34 : /**
35 : * Constrctor
36 : *
37 : * @param detector Detector
38 : * @param ring Ring
39 : * @param sector Sector
40 : * @param strip Strip
41 : * @param edep Energy deposited
42 : * @param count ADC (first sample)
43 : * @param count2 ADC (second sample, or -1 if not used)
44 : * @param count3 ADC (third sample, or -1 if not used)
45 : */
46 : AliFMDSDigit(UShort_t detector,
47 : Char_t ring='\0',
48 : UShort_t sector=0,
49 : UShort_t strip=0,
50 : Float_t edep=0,
51 : UShort_t count=0,
52 : Short_t count2=-1,
53 : Short_t count3=-1,
54 : Short_t count4=-1,
55 : UShort_t npart=0,
56 : UShort_t nprim=0,
57 : const Int_t* refs=0);
58 : /**
59 : * DTOR
60 : */
61 672 : virtual ~AliFMDSDigit() {}
62 : /**
63 : *
64 : * @return ADC count (first sample)
65 : */
66 0 : UShort_t Count1() const { return fCount1; }
67 : /**
68 : *
69 : * @return ADC count (second sample, or -1 if not used)
70 : */
71 0 : Short_t Count2() const { return fCount2; }
72 : /**
73 : *
74 : * @return ADC count (third sample, or -1 if not used)
75 : */
76 0 : Short_t Count3() const { return fCount3; }
77 : /**
78 : *
79 : * @return ADC count (third sample, or -1 if not used)
80 : */
81 0 : Short_t Count4() const { return fCount4; }
82 : /**
83 : *
84 : * @return Canonical ADC counts
85 : */
86 : UShort_t Counts() const;
87 : /**
88 : *
89 : * @return Energy deposited
90 : */
91 212 : Float_t Edep() const { return fEdep; }
92 : /**
93 : *
94 : * @return Number of particles that hit this strip
95 : */
96 0 : UShort_t NParticles() const { return fNParticles; }
97 : /**
98 : *
99 : * @return Number of primary particles that hit this strip
100 : */
101 0 : UShort_t NPrimaries() const { return fNPrimaries; }
102 : #if 0
103 : /** @return the track labels */
104 : const TArrayI& TrackLabels() const { return fLabels; }
105 : #endif
106 : /**
107 : * Print info
108 : *
109 : * @param opt Not used
110 : */
111 : void Print(Option_t* opt="") const;
112 : /**
113 : * Set the count value
114 : *
115 : * @param s Sample number
116 : * @param c Counts
117 : */
118 : void SetCount(UShort_t s, Short_t c);
119 : protected:
120 : Float_t fEdep; // Energy deposited
121 : UShort_t fCount1; // Digital signal
122 : Short_t fCount2; // Digital signal (-1 if not used)
123 : Short_t fCount3; // Digital signal (-1 if not used)
124 : Short_t fCount4; // Digital signal (-1 if not used)
125 : UShort_t fNParticles; // Total number of particles that hit this strip
126 : UShort_t fNPrimaries; // Number of primary particles that his this strip
127 : #if 0
128 : TArrayI fLabels; // MC-truth track labels
129 : #endif
130 16 : ClassDef(AliFMDSDigit,5) // Summable FMD digit
131 : };
132 :
133 : inline UShort_t
134 : AliFMDSDigit::Counts() const
135 : {
136 318 : if (fCount4 >= 0) return fCount3;
137 0 : if (fCount3 >= 0) return fCount2;
138 0 : if (fCount2 >= 0) return fCount2;
139 0 : return fCount1;
140 106 : }
141 :
142 : inline void
143 : AliFMDSDigit::SetCount(UShort_t i, Short_t c)
144 : {
145 0 : switch (i) {
146 0 : case 0: fCount1 = c; break;
147 0 : case 1: fCount2 = c; break;
148 0 : case 2: fCount3 = c; break;
149 0 : case 3: fCount4 = c; break;
150 : }
151 0 : }
152 :
153 : #endif
154 : //____________________________________________________________________
155 : //
156 : // Local Variables:
157 : // mode: C++
158 : // End:
159 : //
160 : //
161 : // EOF
162 : //
|