1 #ifndef ALIFMDDIGITIZER_H
2 #define ALIFMDDIGITIZER_H
3 /* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights
6 * See cxx source for full Copyright notice
9 # include <AliDigitizer.h>
11 #ifndef ALIRUNDIGITIZER_H
12 # include <AliRunDigitizer.h>
14 #ifndef ALIFMDEdepMAP_H
15 # include "AliFMDEdepMap.h"
20 // #ifndef ROOT_TArrayF
21 // # include <TArrayF.h>
24 //====================================================================
32 //====================================================================
33 /** @class AliFMDBaseDigitizer AliFMDDigitizer.h <FMD/AliFMDDigitizer>
34 @brief Base class for digitizers.
36 This class contains the procedures simulation ADC signal for the
37 Forward Multiplicity detector : Hits->Digits and Hits->SDigits
44 - ADC count in this channel
46 Summable digits consists of
51 - Total energy deposited in the strip
52 - ADC count in this channel
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.
58 +---------------------+
59 | AliFMDBaseDigitizer |
60 +---------------------+
63 +----------+---------+
65 +-----------------+ +------------------+
66 | AliFMDDigitizer | | AliFMDSDigitizer |
67 +-----------------+ +------------------+
69 These classes uses parameters fetched from the AliFMDParameters
72 The shaping function of the VA1 is generally given by
74 f(x) = A(1 - \exp(-Bx))
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.
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.
83 That results in the following algorithm:
86 for (i=0; i < n_pre_amp_charge; i++) {
87 charge = GetCharge(i);
89 f(t) = (charge - last) * (1 - exp(-B * t)) + last
91 f(t) = (last - charge) * exp(-B * t) + charge)
92 for (j=0; j < sample_rate; j++)
93 adc[j] = f(i / (# samples))
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.
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
104 Q = \frac{E}{e}\frac{S}{r}
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
111 The energy deposited per MIP is given by
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
120 The final ADC count is given by
124 where @f$ P@f$ is the (randomized) pedestal.
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
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.
140 class AliFMDBaseDigitizer : public AliDigitizer
144 AliFMDBaseDigitizer();
146 @param manager Manager of digitization */
147 AliFMDBaseDigitizer(AliRunDigitizer * manager);
150 @param title Title */
151 AliFMDBaseDigitizer(const Char_t* name, const Char_t* title);
153 virtual ~AliFMDBaseDigitizer();
156 virtual Bool_t Init();
158 /** The response shape of the VA1 shaping circuit is approximently
161 f(x) = A(1 - \exp(-Bx))
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$
168 void SetShapingTime(Float_t B=10) { fShapingTime = B; }
169 /** @return Get the shaping time */
170 Float_t GetShapingTime() const { return fShapingTime; }
172 /** Sum energy deposited contributions from each hit in a cache
173 @param fmd Pointer to detector */
174 virtual void SumContributions(AliFMD* fmd);
175 /** For the stored energy contributions in the cache, convert the
176 energy signal to ADC counts, and store the created digit in
178 @param fmd Pointer to detector */
179 virtual void DigitizeHits(AliFMD* fmd) const;
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 #
186 @param sector Sector #
188 @param counts Array holding the counts on return */
189 virtual void ConvertToCount(Float_t edep,
195 TArrayI& counts) const;
197 @param detector Detector #
199 @param sector Sector #
201 @return Pedestal value */
202 virtual UShort_t MakePedestal(UShort_t detector,
205 UShort_t strip) const;
206 /** Add noise to each sample */
207 virtual void AddNoise(TArrayI&) const {}
208 /** Add a digit to output */
209 virtual void AddDigit(AliFMD* /* fmd */,
210 UShort_t /* detector */,
212 UShort_t /* sector */,
213 UShort_t /* strip */,
215 UShort_t /* count1 */,
216 Short_t /* count2 */,
217 Short_t /* count3 */) const {}
219 AliRunLoader* fRunLoader; //! Run loader
220 AliFMDEdepMap fEdep; // Cache of Energy from hits
221 Float_t fShapingTime; // Shaping profile parameter
224 @param o object to copy from */
225 AliFMDBaseDigitizer(const AliFMDBaseDigitizer& o)
227 /** Assignment operator
228 @return Reference to this object */
229 AliFMDBaseDigitizer& operator=(const AliFMDBaseDigitizer&) { return *this; }
230 ClassDef(AliFMDBaseDigitizer,2) // Base class for FMD digitizers
233 //====================================================================
234 /** @class AliFMDDigitizer
235 @brief Concrete digitizer to make digits from hits. See also
236 AliFMDBaseDigitizer documentation.
239 class AliFMDDigitizer : public AliFMDBaseDigitizer
245 @param manager Manager of digitization */
246 AliFMDDigitizer(AliRunDigitizer * manager);
248 virtual ~AliFMDDigitizer() {}
250 @param option Not used */
251 virtual void Exec(Option_t* option=0);
253 /** Add a digit to output.
254 @param fmd Pointer to detector object
255 @param detector Detector #
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) */
263 virtual void AddDigit(AliFMD* fmd,
271 Short_t count3) const;
273 @param detector Detector #
275 @param sector Sector number
276 @param strip Strip number
277 @return Random noise */
278 virtual UShort_t MakePedestal(UShort_t detector,
281 UShort_t strip) const;
282 /** Check that digit data is consistent
284 @param nhits Number of hits
285 @param counts ADC counts */
286 virtual void CheckDigit(AliFMDDigit* digit,
288 const TArrayI& counts);
289 ClassDef(AliFMDDigitizer,1) // Make Digits from Hits
292 //====================================================================
293 /** @class AliFMDSDigitizer AliFMDDigitizer.h <FMD/AliFMDDigitizer.h>
294 @brief Concrete implementation to make summable digits.
295 See also class documentation of AliFMDBaseDigitizer
298 class AliFMDSDigitizer : public AliFMDBaseDigitizer
304 @param headerFile Where to write headings
305 @param sdigFile Where to write digits. */
306 AliFMDSDigitizer(const Char_t* headerFile, const Char_t* sdigFile="");
308 virtual ~AliFMDSDigitizer();
310 @param option Not used */
311 virtual void Exec(Option_t* option=0);
313 /** Add a digit to output.
314 @param fmd Pointer to detector object
315 @param detector Detector #
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) */
323 virtual void AddDigit(AliFMD* fmd,
331 Short_t count3) const;
332 ClassDef(AliFMDSDigitizer,0) // Make Summable Digits from Hits
338 //____________________________________________________________________