]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDDigitizer.h
Added a lot of Doxygen documentation
[u/mrichter/AliRoot.git] / FMD / AliFMDDigitizer.h
CommitLineData
66d2ede1 1#ifndef ALIFMDDIGITIZER_H
2#define ALIFMDDIGITIZER_H
4347b38f 3/* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights
4 * reserved.
5 *
6 * See cxx source for full Copyright notice
7 */
8#ifndef ALIDIGITIZER_H
9# include <AliDigitizer.h>
10#endif
11#ifndef ALIRUNDIGITIZER_H
12# include <AliRunDigitizer.h>
13#endif
e802be3e 14#ifndef ALIFMDEdepMAP_H
97961cbd 15# include "AliFMDEdepMap.h"
4347b38f 16#endif
17#ifndef __UTILITY__
18# include <utility>
19#endif
20// #ifndef ROOT_TArrayF
21// # include <TArrayF.h>
22// #endif
88cb7938 23
4347b38f 24//====================================================================
88cb7938 25class TClonesArray;
4347b38f 26class AliFMD;
27class AliLoader;
28class AliRunLoader;
8f6ee336 29class AliFMDDigit;
4347b38f 30
4347b38f 31
32//====================================================================
9f662337 33/** @class AliFMDBaseDigitizer AliFMDDigitizer.h <FMD/AliFMDDigitizer>
34 @brief Base class for digitizers.
35
36 This class contains the procedures simulation ADC signal for the
37 Forward Multiplicity detector : Hits->Digits and Hits->SDigits
38
39 Digits consists of
40 - Detector #
41 - Ring ID
42 - Sector #
43 - Strip #
44 - ADC count in this channel
45
46 Summable digits consists of
47 - Detector #
48 - Ring ID
49 - Sector #
50 - Strip #
51 - Total energy deposited in the strip
52 - ADC count in this channel
53
54 As the Digits and SDigits have so much in common, the classes
55 AliFMDDigitizer and AliFMDSDigitizer are implemented via a base
56 class AliFMDBaseDigitizer.
57 @verbatim
58 +---------------------+
59 | AliFMDBaseDigitizer |
60 +---------------------+
61 ^
62 |
63 +----------+---------+
64 | |
65 +-----------------+ +------------------+
66 | AliFMDDigitizer | | AliFMDSDigitizer |
67 +-----------------+ +------------------+
68 @endverbatim
69 These classes uses parameters fetched from the AliFMDParameters
70 manager.
71
72 The shaping function of the VA1 is generally given by
73 @f[
74 f(x) = A(1 - \exp(-Bx))
75 @f]
76 where A is the total charge collected in the pre-amp., and B is a
77 paramter that depends on the shaping time of the VA1 circut.
78
79 When simulating the shaping function of the VA1 pre-amp. chip, we
80 have to take into account, that the shaping function depends on
81 the previous value of read from the pre-amp.
82
83 That results in the following algorithm:
84 @code
85 last = 0;
86 for (i=0; i < n_pre_amp_charge; i++) {
87 charge = GetCharge(i);
88 if (last < charge)
89 f(t) = (charge - last) * (1 - exp(-B * t)) + last
90 else
91 f(t) = (last - charge) * exp(-B * t) + charge)
92 for (j=0; j < sample_rate; j++)
93 adc[j] = f(i / (# samples))
94 last = charge
95 }
96 @endcode
97 Here, the first loop is over all charges collected by the VA1
98 chip, and the @c sample_rate is how many times the ALTRO ADC
99 samples each of the 128 charges from the pre-amp.
100
101 The @c charge is the total charge @f$ Q@f$ collected by the VA1
102 pre-amplifier for a strip. @f$ Q@f$ is then given by
103 @f[
104 Q = \frac{E}{e}\frac{S}{r}
105 @f]
106 where @f$ E@f$ is the total energy deposited in a silicon strip,
107 @f$ R@f$ is the dynamic range of the VA1 pre-amp, @f$ e@f$ is the
108 energy deposited by a single MIP, and @f$ S@f$ ALTRO channel size
109 in each time step.
110
111 The energy deposited per MIP is given by
112 @f$
113 e = M \rho w
114 @f$
115 where @f$ M@f$ is the universal number
116 @f$ 1.664 \mbox{keV}\mbox{cm}^{2}\mbox{g}^{-1}@f$, @f$ \rho@f$ is
117 the density of silicon, and @f$ w@f$ is the depth of the silicon
118 sensor.
119
120 The final ADC count is given by
121 @f[
122 C' = C + P
123 @f]
124 where @f$ P@f$ is the (randomized) pedestal.
125
126 This class uses the class template AliFMDEdepMap to make an
127 internal cache of the energy deposted of the hits. The class
128 template is instantasized as
129
130 The first member of the values is the summed energy deposition in a
131 given strip, while the second member of the values is the number of
132 hits in a given strip. Using the second member, it's possible to
133 do some checks on just how many times a strip got hit, and what
134 kind of error we get in our reconstructed hits. Note, that this
135 information is currently not written to the digits tree. I think a
136 QA (Quality Assurance) digit tree is better suited for that task.
137 However, the information is there to be used in the future.
138 @ingroup FMD_sim
139 */
4347b38f 140class AliFMDBaseDigitizer : public AliDigitizer
141{
142public:
9f662337 143 /** CTOR */
4347b38f 144 AliFMDBaseDigitizer();
9f662337 145 /** Normal CTOR
146 @param manager Manager of digitization */
4347b38f 147 AliFMDBaseDigitizer(AliRunDigitizer * manager);
9f662337 148 /** Normal ctor
149 @param name Name
150 @param title Title */
4347b38f 151 AliFMDBaseDigitizer(const Char_t* name, const Char_t* title);
9f662337 152 /** DTOR */
4347b38f 153 virtual ~AliFMDBaseDigitizer();
4110645f 154
9f662337 155 /** Initialize */
4347b38f 156 virtual Bool_t Init();
157
9f662337 158 /** The response shape of the VA1 shaping circuit is approximently
159 given by
160 @f[
161 f(x) = A(1 - \exp(-Bx))
162 @f]
163 where @f$ A@f$ is the total charge collected by the pre-amp.,
164 and @f$ B@f$ is parameter that depends on the shaping time of
165 the @b VA1 pre-amp. This member function sets the parameter @f$
166 B@f$
167 @param B */
168 void SetShapingTime(Float_t B=10) { fShapingTime = B; }
169 /** @return Get the shaping time */
4347b38f 170 Float_t GetShapingTime() const { return fShapingTime; }
171protected:
9f662337 172 /** Sum energy deposited contributions from each hit in a cache
173 @param fmd Pointer to detector */
4347b38f 174 virtual void SumContributions(AliFMD* fmd);
9f662337 175 /** For the stored energy contributions in the cache, convert the
176 energy signal to ADC counts, and store the created digit in
177 the digits array
178 @param fmd Pointer to detector */
4347b38f 179 virtual void DigitizeHits(AliFMD* fmd) const;
9f662337 180 /** Convert the total energy deposited to a (set of) ADC count(s).
181 See also the class description for more details.
182 @param edep Total energy deposited in detector
183 @param last Last charge collected in previous VA1 channnel
184 @param detector Detector #
185 @param ring Ring ID
186 @param sector Sector #
187 @param strip Strip #
188 @param counts Array holding the counts on return */
4347b38f 189 virtual void ConvertToCount(Float_t edep,
e802be3e 190 Float_t last,
8f6ee336 191 UShort_t detector,
192 Char_t ring,
193 UShort_t sector,
194 UShort_t strip,
4347b38f 195 TArrayI& counts) const;
9f662337 196 /** Make a pedestal
197 @param detector Detector #
198 @param ring Ring ID
199 @param sector Sector #
200 @param strip Strip #
201 @return Pedestal value */
8f6ee336 202 virtual UShort_t MakePedestal(UShort_t detector,
203 Char_t ring,
204 UShort_t sector,
205 UShort_t strip) const;
9f662337 206 /** Add noise to each sample */
4347b38f 207 virtual void AddNoise(TArrayI&) const {}
9f662337 208 /** Add a digit to output */
4347b38f 209 virtual void AddDigit(AliFMD* /* fmd */,
210 UShort_t /* detector */,
211 Char_t /* ring */,
212 UShort_t /* sector */,
213 UShort_t /* strip */,
214 Float_t /* edep */,
215 UShort_t /* count1 */,
216 Short_t /* count2 */,
217 Short_t /* count3 */) const {}
66d2ede1 218
e5c81efd 219 AliRunLoader* fRunLoader; //! Run loader
4347b38f 220 AliFMDEdepMap fEdep; // Cache of Energy from hits
4347b38f 221 Float_t fShapingTime; // Shaping profile parameter
222
9f662337 223 /** Copy CTOR
224 @param o object to copy from */
088f8e79 225 AliFMDBaseDigitizer(const AliFMDBaseDigitizer& o)
226 : AliDigitizer(o) {}
9f662337 227 /** Assignment operator
228 @return Reference to this object */
088f8e79 229 AliFMDBaseDigitizer& operator=(const AliFMDBaseDigitizer&) { return *this; }
e5c81efd 230 ClassDef(AliFMDBaseDigitizer,2) // Base class for FMD digitizers
4347b38f 231};
232
233//====================================================================
9f662337 234/** @class AliFMDDigitizer
235 @brief Concrete digitizer to make digits from hits. See also
236 AliFMDBaseDigitizer documentation.
237 @ingroup FMD_sim
238 */
4347b38f 239class AliFMDDigitizer : public AliFMDBaseDigitizer
240{
241public:
9f662337 242 /** CTOR */
4347b38f 243 AliFMDDigitizer();
9f662337 244 /** CTOR
245 @param manager Manager of digitization */
4347b38f 246 AliFMDDigitizer(AliRunDigitizer * manager);
9f662337 247 /** DTOR */
4347b38f 248 virtual ~AliFMDDigitizer() {}
9f662337 249 /** Do everything
250 @param option Not used */
4347b38f 251 virtual void Exec(Option_t* option=0);
4347b38f 252protected:
9f662337 253 /** Add a digit to output.
254 @param fmd Pointer to detector object
255 @param detector Detector #
256 @param ring Ring ID
257 @param sector Sector number
258 @param strip Strip number
259 @param edep Energy deposited (not used)
260 @param count1 ADC count 1
261 @param count2 ADC count 2 (-1 if not used)
262 @param count3 ADC count 3 (-1 if not used) */
4347b38f 263 virtual void AddDigit(AliFMD* fmd,
264 UShort_t detector,
265 Char_t ring,
266 UShort_t sector,
267 UShort_t strip,
268 Float_t edep,
269 UShort_t count1,
270 Short_t count2,
271 Short_t count3) const;
9f662337 272 /** MAke a pedestal
273 @param detector Detector #
274 @param ring Ring ID
275 @param sector Sector number
276 @param strip Strip number
277 @return Random noise */
8f6ee336 278 virtual UShort_t MakePedestal(UShort_t detector,
279 Char_t ring,
280 UShort_t sector,
281 UShort_t strip) const;
9f662337 282 /** Check that digit data is consistent
283 @param digit Digit
284 @param nhits Number of hits
285 @param counts ADC counts */
8f6ee336 286 virtual void CheckDigit(AliFMDDigit* digit,
4347b38f 287 UShort_t nhits,
288 const TArrayI& counts);
8f6ee336 289 ClassDef(AliFMDDigitizer,1) // Make Digits from Hits
4347b38f 290};
4110645f 291
4347b38f 292//====================================================================
9f662337 293/** @class AliFMDSDigitizer AliFMDDigitizer.h <FMD/AliFMDDigitizer.h>
294 @brief Concrete implementation to make summable digits.
295 See also class documentation of AliFMDBaseDigitizer
296 @ingroup FMD_sim
297 */
4347b38f 298class AliFMDSDigitizer : public AliFMDBaseDigitizer
299{
300public:
9f662337 301 /** CTOR */
4347b38f 302 AliFMDSDigitizer();
9f662337 303 /** CTOR
304 @param headerFile Where to write headings
305 @param sdigFile Where to write digits. */
4347b38f 306 AliFMDSDigitizer(const Char_t* headerFile, const Char_t* sdigFile="");
9f662337 307 /** DTOR */
4347b38f 308 virtual ~AliFMDSDigitizer();
9f662337 309 /** Do it all
310 @param option Not used */
4347b38f 311 virtual void Exec(Option_t* option=0);
312protected:
9f662337 313 /** Add a digit to output.
314 @param fmd Pointer to detector object
315 @param detector Detector #
316 @param ring Ring ID
317 @param sector Sector number
318 @param strip Strip number
319 @param edep Energy deposited (not used)
320 @param count1 ADC count 1
321 @param count2 ADC count 2 (-1 if not used)
322 @param count3 ADC count 3 (-1 if not used) */
4347b38f 323 virtual void AddDigit(AliFMD* fmd,
324 UShort_t detector,
325 Char_t ring,
326 UShort_t sector,
327 UShort_t strip,
328 Float_t edep,
329 UShort_t count1,
330 Short_t count2,
331 Short_t count3) const;
332 ClassDef(AliFMDSDigitizer,0) // Make Summable Digits from Hits
333};
4110645f 334
335
4347b38f 336
337#endif
338//____________________________________________________________________
339//
0d0e6995 340// Local Variables:
341// mode: C++
342// End:
343//
344//
4347b38f 345// EOF
346//
347