]> git.uio.no Git - u/mrichter/AliRoot.git/blame - FMD/AliFMDReconstructor.h
same modifications as in ppbench
[u/mrichter/AliRoot.git] / FMD / AliFMDReconstructor.h
CommitLineData
8f1cfb0c 1#ifndef ALIFMDRECONSTRUCTOR_H
2#define ALIFMDRECONSTRUCTOR_H
4347b38f 3//
4// Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
5// reserved.
6//
121a60bd 7// See cxx source for full Copyright notice
4347b38f 8//
121a60bd 9// AliFMDReconstructor.h
4347b38f 10// Task Class for making TreeR for FMD
11//
121a60bd 12//-- Authors: Evgeny Karpechev (INR) and Alla Maevskaia (INR)
4347b38f 13// Latest changes by Christian Holm Christensen <cholm@nbi.dk>
121a60bd 14/* $Id$ */
c2fc1258 15/** @file AliFMDReconstructor.h
16 @author Christian Holm Christensen <cholm@nbi.dk>
17 @date Mon Mar 27 12:47:09 2006
18 @brief FMD reconstruction
19*/
8f1cfb0c 20
42403906 21//____________________________________________________________________
0d0e6995 22// Header guards in the header files speeds up the compilation
23// considerably. Please leave them in.
24#ifndef ALIRECONSTRUCTOR_H
25# include <AliReconstructor.h>
26#endif
d76c31f4 27#include "AliLog.h"
28
4347b38f 29//____________________________________________________________________
1a1fdef7 30class TTree;
4347b38f 31class TClonesArray;
4347b38f 32class AliFMDDigit;
33class AliRawReader;
af885e0f 34class AliESDEvent;
8f6ee336 35class AliESDFMD;
9684be2f 36class TH1;
37
e802be3e 38
9f662337 39/** @defgroup FMD_rec Reconstruction */
4347b38f 40//____________________________________________________________________
50b9d194 41/**
42 * @brief This is a class that reconstructs AliFMDRecPoint objects
43 * from of Digits.
44 *
45 * This class reads either digits from a TClonesArray or raw data
46 * from a DDL file (or similar), and applies calibrations to get
47 * psuedo-inclusive multiplicities per strip.
48 *
49 * @ingroup FMD_rec
9f662337 50 */
121a60bd 51class AliFMDReconstructor: public AliReconstructor
52{
4347b38f 53public:
50b9d194 54 /**
55 * CTOR
56 */
4347b38f 57 AliFMDReconstructor();
50b9d194 58 /**
59 * DTOR
60 */
56b1929b 61 virtual ~AliFMDReconstructor();
4347b38f 62
50b9d194 63 /**
64 * Initialize the reconstructor. Here, we initialize the geometry
65 * manager, and finds the local to global transformations from the
66 * geometry. The calibration parameter manager is also
67 * initialized (meaning that the calibration parameters is read
68 * from CDB).
69 */
d76c31f4 70 virtual void Init();
50b9d194 71 /**
72 * Flag that we can convert raw data into digits.
73 *
74 * @return always @c true
75 */
1a1fdef7 76 virtual Bool_t HasDigitConversion() const { return kTRUE; }
50b9d194 77 /**
78 * Convert raw data read from the AliRawReader @a reader into
79 * digits. This is done using AliFMDRawReader and
80 * AliFMDAltroReader. The digits are put in the passed TTree @a
81 * digitsTree.
82 *
83 * @param reader Raw reader.
84 * @param digitsTree Tree to store read digits in.
85 */
1a1fdef7 86 virtual void ConvertDigits(AliRawReader* reader, TTree* digitsTree) const;
50b9d194 87 /**
88 * Reconstruct one event from the digits passed in @a digitsTree.
89 * The member function creates AliFMDRecPoint objects and stores
90 * them on the output tree @a clusterTree. An FMD ESD object is
91 * created in parallel.
92 *
93 * @param digitsTree Tree holding the digits of this event
94 * @param clusterTree Tree to store AliFMDRecPoint objects in.
95 */
1a1fdef7 96 virtual void Reconstruct(TTree* digitsTree, TTree* clusterTree) const;
50b9d194 97 /**
98 * Not used
99 * @todo Implement this, such that we'll reconstruct directly from
100 * the read ADC values rather than going via an intermedant
101 * TClonesArray of AliFMDDigits
102 */
ddaa8027 103 virtual void Reconstruct(AliRawReader *, TTree*) const;
50b9d194 104 /**
105 * Put in the ESD data, the FMD ESD data. The object created by
106 * the Reconstruct member function is copied to the ESD object.
107 *
108 * @param digitsTree Tree of digits for this event - not used
109 * @param clusterTree Tree of reconstructed points for this event -
110 * not used.
111 * @param esd ESD object to store data in.
112 */
1a1fdef7 113 virtual void FillESD(TTree* digitsTree, TTree* clusterTree,
af885e0f 114 AliESDEvent* esd) const;
50b9d194 115 /**
116 * Forwards to above member function
117 */
ddaa8027 118 virtual void FillESD(AliRawReader*, TTree* clusterTree,
119 AliESDEvent* esd) const;
faf80567 120
121 /**
122 * Create SDigits from raw data
123 *
124 * @param reader The raw reader
125 * @param sdigits Array to fill with AliFMDSDigit objects.
126 */
127 virtual void Digitize(AliRawReader* reader,
128 TClonesArray* sdigits) const;
129
50b9d194 130 /**
131 * Not used
132 */
af885e0f 133 virtual void SetESD(AliESDEvent* esd) { fESD = esd; }
50b9d194 134 /**
135 * Set the noise factor
136 *
137 * @param f Factor to use
138 */
a9579262 139 virtual void SetNoiseFactor(Float_t f=3) { fNoiseFactor = f; }
50b9d194 140 /**
141 * Set whether we should do angle correction or nor
142 *
143 * @param use If true, do angle correction
144 */
a9579262 145 virtual void SetAngleCorrect(Bool_t use=kTRUE) { fAngleCorrect = use; }
50b9d194 146 /**
147 * Set whether we want to do diagnostics. If this is enabled, a
148 * file named @c FMD.Diag.root will be made. It contains a set of
149 * histograms for each event, filed in separate directories in the
150 * file. The histograms are
151 * @verbatim
152 * diagStep1 Read ADC vs. Noise surpressed ADC
153 * diagStep2 Noise surpressed ADC vs. calculated Energy dep.
154 * diagStep3 Energy deposition vs. angle corrected Energy dep.
155 * diagStep4 Energy deposition vs. calculated multiplicity
156 * diagAll Read ADC vs. calculated multiplicity
157 * @endverbatim
158 *
159 * @param use If true, make the diagnostics file
160 */
9684be2f 161 void SetDiagnose(Bool_t use=kTRUE) { fDiagnostics = use; }
4347b38f 162protected:
50b9d194 163 /**
164 * Copy CTOR
165 *
166 * @param other Object to copy from.
167 */
0e73cae6 168 AliFMDReconstructor(const AliFMDReconstructor& other);
50b9d194 169 /**
170 * Assignment operator
171 *
172 * @param other Object to assign from
173 *
174 * @return reference to this object
175 */
0e73cae6 176 AliFMDReconstructor& operator=(const AliFMDReconstructor& other);
50b9d194 177 /**
178 * Try to get the vertex from either ESD or generator header. Sets
179 * @c fCurrentVertex to the found Z posistion of the vertex (if
180 * found), and sets the flag @c fVertexType accordingly
181 */
9684be2f 182 virtual void GetVertex() const;
50b9d194 183 /**
184 * Process AliFMDDigit objects in @a digits. For each digit, find
185 * the psuedo-rapidity @f$ \eta@f$, azimuthal angle @f$ \varphi@f$,
186 * energy deposited @f$ E@f$, and psuedo-inclusive multiplicity @f$
187 * M@f$.
188 *
189 * @param digits Array of digits.
190 */
e802be3e 191 virtual void ProcessDigits(TClonesArray* digits) const;
50b9d194 192 /**
193 * Process a single digit
194 *
195 * @param digit Digiti to process
196 */
197 virtual void ProcessDigit(AliFMDDigit* digit) const;
198 /**
199 * Process the signal from a single strip.
200 *
201 * @param det Detector number
202 * @param rng Ring identifier
203 * @param sec Sector number
204 * @param str Strip number
205 * @param adc Number of ADC counts for this strip
206 */
207 virtual void ProcessSignal(UShort_t det,
208 Char_t rng,
209 UShort_t sec,
210 UShort_t str,
211 Short_t adc) const;
faf80567 212 /**
213 * Process the signal from a single strip.
214 *
215 * @param sdigits Array to fill
216 * @param det Detector number
217 * @param rng Ring identifier
218 * @param sec Sector number
219 * @param str Strip number
220 * @param sam Sample number
221 * @param adc Number of ADC counts for this strip
222 */
223 virtual void DigitizeSignal(TClonesArray* sdigits,
224 UShort_t det,
225 Char_t rng,
226 UShort_t sec,
227 UShort_t str,
228 UShort_t sam,
229 Short_t adc) const;
230 /**
231 * Subtract the pedestal off the ADC counts.
232 *
233 * @param det Detector number
234 * @param rng Ring identifier
235 * @param sec Sector number
236 * @param str Strip number
237 * @param adc ADC counts
238 * @param noiseFactor If pedestal substracted pedestal is less then
239 * this times the noise, then consider this to be 0.
240 * @param zsEnabled Whether zero-suppression is on.
241 * @param zsNoiseFactor Noise factor used in on-line pedestal
242 * subtraction.
243 *
244 * @return The pedestal subtracted ADC counts (possibly 0), or @c
245 * USHRT_MAX in case of problems.
246 */
247 virtual UShort_t SubtractPedestal(UShort_t det,
248 Char_t rng,
249 UShort_t sec,
250 UShort_t str,
251 UShort_t adc,
252 Float_t noiseFactor,
253 Bool_t zsEnabled,
254 UShort_t zsNoiseFactor) const;
50b9d194 255 /**
256 * Substract pedestals from raw ADC in @a digit
257 *
258 * @param det Detector number
259 * @param rng Ring identifier
260 * @param sec Sector number
261 * @param str Strip number
262 * @param adc Number of ADC counts
263 *
264 * @return Pedestal subtracted ADC count.
265 */
266 virtual UShort_t SubtractPedestal(UShort_t det,
267 Char_t rng,
268 UShort_t sec,
269 UShort_t str,
270 Short_t adc) const;
271 /**
272 * Converts number of ADC counts to energy deposited. This is
273 * done by
274 * @f[
275 * E_i = A_i g_i
276 * @f]
277 * where @f$ A_i@f$ is the pedestal subtracted ADC counts, and @f$
278 * g_i@f$ is the gain for the @f$ i^{\mbox{th}}@f$ strip.
279 *
280 * @param det Detector number
281 * @param rng Ring identifier
282 * @param sec Sector number
283 * @param str Strip number
284 * @param eta Psuedo-rapidity of digit.
285 * @param count Pedestal subtracted ADC counts
286 *
287 * @return Energy deposited @f$ E_i@f$
288 */
faf80567 289 virtual Float_t Adc2Energy(UShort_t det,
290 Char_t rng,
291 UShort_t sec,
292 UShort_t str,
293 UShort_t count) const;
294 /**
295 * Converts number of ADC counts to energy deposited. This is
296 * done by
297 * @f[
298 * E_i = A_i g_i
299 * @f]
300 * where @f$ A_i@f$ is the pedestal subtracted ADC counts, and @f$
301 * g_i@f$ is the gain for the @f$ i^{\mbox{th}}@f$ strip.
302 *
303 * @param det Detector number
304 * @param rng Ring identifier
305 * @param sec Sector number
306 * @param str Strip number
307 * @param eta Psuedo-rapidity of digit.
308 * @param count Pedestal subtracted ADC counts
309 *
310 * @return Energy deposited @f$ E_i@f$
311 */
50b9d194 312 virtual Float_t Adc2Energy(UShort_t det,
313 Char_t rng,
314 UShort_t sec,
315 UShort_t str,
316 Float_t eta,
8f6ee336 317 UShort_t count) const;
50b9d194 318 /**
319 * Converts an energy signal to number of particles. In this
320 * implementation, it's done by
321 * @f[
322 * M_i = E_i / E_{\mbox{MIP}}
323 * @f]
324 * where @f$ E_i@f$ is the energy deposited, and
325 * @f$ E_{\mbox{MIP}}@f$ is the average energy deposited by a
326 * minimum ionizing particle
327 *
328 * @param det Detector number
329 * @param rng Ring identifier
330 * @param sec Sector number
331 * @param str Strip number
332 * @param eta On return, psuedo-rapidity @f$ \eta@f$
333 * @param phi On return, azimuthal angle @f$ \varphi@f$
334 * @param edep Energy deposited @f$ E_i@f$
335 *
336 * @return Psuedo-inclusive multiplicity @f$ M@f$
337 */
338 virtual Float_t Energy2Multiplicity(UShort_t det,
339 Char_t rng,
340 UShort_t sec,
341 UShort_t str,
342 Float_t edep) const;
343 /**
344 * Calculate the physical coordinates psuedo-rapidity @f$ \eta@f$,
345 * azimuthal angle @f$ \varphi@f$ of the strip corresponding to
346 * the digit @a digit. This is done by using the information
347 * obtained, and previously cached by AliFMDGeometry, from the
348 * TGeoManager.
349 *
350 * @param det Detector number
351 * @param rng Ring identifier
352 * @param sec Sector number
353 * @param str Strip number
354 * @param eta On return, psuedo-rapidity @f$ \eta@f$
355 * @param phi On return, azimuthal angle @f$ \varphi@f$
356 */
357 virtual void PhysicalCoordinates(UShort_t det,
358 Char_t rng,
359 UShort_t sec,
360 UShort_t str,
361 Float_t& eta,
8f6ee336 362 Float_t& phi) const;
42403906 363
9684be2f 364 enum Vertex_t {
365 kNoVertex, // Got no vertex
366 kGenVertex, // Got generator vertex
367 kESDVertex // Got ESD vertex
368 };
8f6ee336 369 mutable TClonesArray* fMult; // Cache of RecPoints
370 mutable Int_t fNMult; // Number of entries in fMult
371 mutable TTree* fTreeR; // Output tree
e802be3e 372 mutable Float_t fCurrentVertex; // Z-coordinate of primary vertex
8f6ee336 373 mutable AliESDFMD* fESDObj; // ESD output object
9684be2f 374 Float_t fNoiseFactor; // Factor of noise to check
375 Bool_t fAngleCorrect; // Whether to angle correct
376 mutable Vertex_t fVertexType; // What kind of vertex we got
af885e0f 377 AliESDEvent* fESD; // ESD object(?)
9684be2f 378 Bool_t fDiagnostics; // Wheter to do diagnostics
379 TH1* fDiagStep1; // Diagnostics histogram
380 TH1* fDiagStep2; // Diagnostics histogram
381 TH1* fDiagStep3; // Diagnostics histogram
382 TH1* fDiagStep4; // Diagnostics histogram
383 TH1* fDiagAll; // Diagnostics histogram
5cf05dbb 384 mutable Bool_t fZS[3]; // Zero-suppredded?
385 mutable UShort_t fZSFactor[3]; // Noise factor for Zero-suppression
02a27b50 386private:
d76c31f4 387
388 ClassDef(AliFMDReconstructor, 3) // class for the FMD reconstruction
121a60bd 389};
390#endif
4347b38f 391//____________________________________________________________________
392//
0d0e6995 393// Local Variables:
394// mode: C++
395// End:
396//
4347b38f 397// EOF
398//