1 #ifndef ALIFMDBASEDIGITIZER_H
2 #define ALIFMDBASEDIGITIZER_H
3 /* Copyright(c) 1998-2000, ALICE Experiment at CERN, All rights
6 * See cxx source for full Copyright notice
8 // Classses to make Hits into digits and summable digits.
15 // - ADC count in this channel
17 // Summable digits consists of
22 // - Total energy deposited in the strip
23 // - ADC count in this channel
25 /** @file AliFMDBaseDigitizer.h
26 @author Christian Holm Christensen <cholm@nbi.dk>
27 @date Mon Mar 27 12:38:26 2006
28 @brief FMD Digitizers declaration
31 #ifndef ALIDIGITIZER_H
32 # include <AliDigitizer.h>
34 #ifndef ALIRUNDIGITIZER_H
35 # include <AliRunDigitizer.h>
37 #ifndef ALIFMDEdepMAP_H
38 # include "AliFMDEdepMap.h"
40 //====================================================================
48 //====================================================================
49 /** @class AliFMDBaseDigitizer AliFMDDigitizer.h <FMD/AliFMDDigitizer>
50 @brief Base class for digitizers.
52 This class contains the procedures simulation ADC signal for the
53 Forward Multiplicity detector : Hits->Digits and Hits->SDigits
60 - ADC count in this channel
62 Summable digits consists of
67 - Total energy deposited in the strip
68 - ADC count in this channel
70 As the Digits and SDigits have so much in common, the classes
71 AliFMDDigitizer and AliFMDSDigitizer are implemented via a base
72 class AliFMDBaseDigitizer.
74 +---------------------+
75 | AliFMDBaseDigitizer |
76 +---------------------+
79 +----------+---------+
81 +-----------------+ +------------------+
82 | AliFMDDigitizer | | AliFMDSDigitizer |
83 +-----------------+ +------------------+
85 These classes uses parameters fetched from the AliFMDParameters
88 The shaping function of the VA1 is generally given by
90 f(x) = A(1 - \exp(-Bx))
92 where A is the total charge collected in the pre-amp., and B is a
93 paramter that depends on the shaping time of the VA1 circut.
95 When simulating the shaping function of the VA1 pre-amp. chip, we
96 have to take into account, that the shaping function depends on
97 the previous value of read from the pre-amp.
99 That results in the following algorithm:
102 for (i=0; i < n_pre_amp_charge; i++) {
103 charge = GetCharge(i);
105 f(t) = (charge - last) * (1 - exp(-B * t)) + last
107 f(t) = (last - charge) * exp(-B * t) + charge)
108 for (j=0; j < sample_rate; j++)
109 adc[j] = f(i / (# samples))
113 Here, the first loop is over all charges collected by the VA1
114 chip, and the @c sample_rate is how many times the ALTRO ADC
115 samples each of the 128 charges from the pre-amp.
117 The @c charge is the total charge @f$ Q@f$ collected by the VA1
118 pre-amplifier for a strip. @f$ Q@f$ is then given by
120 Q = \frac{E}{e}\frac{S}{r}
122 where @f$ E@f$ is the total energy deposited in a silicon strip,
123 @f$ R@f$ is the dynamic range of the VA1 pre-amp, @f$ e@f$ is the
124 energy deposited by a single MIP, and @f$ S@f$ ALTRO channel size
127 The energy deposited per MIP is given by
131 where @f$ M@f$ is the universal number
132 @f$ 1.664 \mbox{keV}\mbox{cm}^{2}\mbox{g}^{-1}@f$, @f$ \rho@f$ is
133 the density of silicon, and @f$ w@f$ is the depth of the silicon
136 The final ADC count is given by
140 where @f$ P@f$ is the (randomized) pedestal.
142 This class uses the class template AliFMDEdepMap to make an
143 internal cache of the energy deposted of the hits. The class
144 template is instantasized as
146 The first member of the values is the summed energy deposition in a
147 given strip, while the second member of the values is the number of
148 hits in a given strip. Using the second member, it's possible to
149 do some checks on just how many times a strip got hit, and what
150 kind of error we get in our reconstructed hits. Note, that this
151 information is currently not written to the digits tree. I think a
152 QA (Quality Assurance) digit tree is better suited for that task.
153 However, the information is there to be used in the future.
156 class AliFMDBaseDigitizer : public AliDigitizer
160 AliFMDBaseDigitizer();
162 @param manager Manager of digitization */
163 AliFMDBaseDigitizer(AliRunDigitizer * manager);
166 @param title Title */
167 AliFMDBaseDigitizer(const Char_t* name, const Char_t* title);
169 virtual ~AliFMDBaseDigitizer();
172 virtual Bool_t Init();
174 virtual void Exec(Option_t* option="");
176 /** The response shape of the VA1 shaping circuit is approximently
179 f(x) = A(1 - \exp(-Bx))
181 where @f$ A@f$ is the total charge collected by the pre-amp.,
182 and @f$ B@f$ is parameter that depends on the shaping time of
183 the @b VA1 pre-amp. This member function sets the parameter @f$
186 void SetShapingTime(Float_t B=10) { fShapingTime = B; }
187 /** @return Get the shaping time */
188 Float_t GetShapingTime() const { return fShapingTime; }
190 /** Set-up loaders, etc.
191 @param fmd On return, contains pointer to loaded AliFMD object.
192 @param outFMD On return, contains pointer to loaded loader.
193 @return kTRUE on success, kFALSE otherwise */
194 virtual Bool_t SetupLoaders(AliFMD*& fmd, AliLoader*& outFMD);
195 /** Set-up loaders, etc.
196 @param fmd Pointer to loaded AliFMD object
197 @return kFALSE on failures. */
198 virtual Bool_t LoopOverInput(AliFMD* fmd);
201 @param fmd AliFMD object */
202 virtual void OutputTree(AliLoader* outFMD, AliFMD* fmd) = 0;
203 /** Sum energy deposited contributions from each hit in a cache
204 @param fmd Pointer to detector */
205 virtual void SumContributions(AliFMD* fmd);
206 /** For the stored energy contributions in the cache, convert the
207 energy signal to ADC counts, and store the created digit in
209 @param fmd Pointer to detector */
210 virtual void DigitizeHits(AliFMD* fmd) const;
211 /** Convert the total energy deposited to a (set of) ADC count(s).
212 See also the class description for more details.
213 @param edep Total energy deposited in detector
214 @param last Last charge collected in previous VA1 channnel
215 @param detector Detector #
217 @param sector Sector #
219 @param counts Array holding the counts on return */
220 virtual void ConvertToCount(Float_t edep,
226 TArrayI& counts) const;
228 @param detector Detector #
230 @param sector Sector #
232 @return Pedestal value */
233 virtual UShort_t MakePedestal(UShort_t detector,
236 UShort_t strip) const;
237 /** Add noise to each sample */
238 virtual void AddNoise(TArrayI&) const {}
239 /** Add a digit to output */
240 virtual void AddDigit(AliFMD* /* fmd */,
241 UShort_t /* detector */,
243 UShort_t /* sector */,
244 UShort_t /* strip */,
246 UShort_t /* count1 */,
247 Short_t /* count2 */,
248 Short_t /* count3 */,
249 Short_t /* count4 */) const {}
251 AliRunLoader* fRunLoader; //! Run loader
252 AliFMDEdepMap fEdep; // Cache of Energy from hits
253 Float_t fShapingTime; // Shaping profile parameter
256 @param o object to copy from */
257 AliFMDBaseDigitizer(const AliFMDBaseDigitizer& o)
260 fEdep(AliFMDMap::kMaxDetectors,
261 AliFMDMap::kMaxRings,
262 AliFMDMap::kMaxSectors,
263 AliFMDMap::kMaxStrips),
266 /** Assignment operator
267 @return Reference to this object */
268 AliFMDBaseDigitizer& operator=(const AliFMDBaseDigitizer&) { return *this; }
269 ClassDef(AliFMDBaseDigitizer,2) // Base class for FMD digitizers
274 //____________________________________________________________________