1 #ifndef ALIFMDRECONSTRUCTOR_H
2 #define ALIFMDRECONSTRUCTOR_H
4 // Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
7 // See cxx source for full Copyright notice
9 // AliFMDReconstructor.h
10 // Task Class for making TreeR for FMD
12 //-- Authors: Evgeny Karpechev (INR) and Alla Maevskaia (INR)
13 // Latest changes by Christian Holm Christensen <cholm@nbi.dk>
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
21 //____________________________________________________________________
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>
28 #include <AliFMDBoolMap.h>
30 //____________________________________________________________________
35 class AliFMDRawReader;
38 class AliFMDRecoParam;
42 /** @defgroup FMD_rec Reconstruction */
43 //____________________________________________________________________
45 * @brief This is a class that reconstructs AliFMDRecPoint objects
48 * This class reads either digits from a TClonesArray or raw data
49 * from a DDL file (or similar), and applies calibrations to get
50 * psuedo-inclusive multiplicities per strip.
54 class AliFMDReconstructor: public AliReconstructor
60 AliFMDReconstructor();
64 virtual ~AliFMDReconstructor();
67 * Initialize the reconstructor. Here, we initialize the geometry
68 * manager, and finds the local to global transformations from the
69 * geometry. The calibration parameter manager is also
70 * initialized (meaning that the calibration parameters is read
75 * Flag that we can convert raw data into digits.
77 * @return always @c true
79 virtual Bool_t HasDigitConversion() const { return kTRUE; }
81 * Convert raw data read from the AliRawReader @a reader into
82 * digits. This is done using AliFMDRawReader and
83 * AliFMDAltroReader. The digits are put in the passed TTree @a
86 * @param reader Raw reader.
87 * @param digitsTree Tree to store read digits in.
89 virtual void ConvertDigits(AliRawReader* reader, TTree* digitsTree) const;
91 * Reconstruct one event from the digits passed in @a digitsTree.
92 * The member function creates AliFMDRecPoint objects and stores
93 * them on the output tree @a clusterTree. An FMD ESD object is
94 * created in parallel.
96 * @param digitsTree Tree holding the digits of this event
97 * @param clusterTree Tree to store AliFMDRecPoint objects in.
99 virtual void Reconstruct(TTree* digitsTree, TTree* clusterTree) const;
102 * @todo Implement this, such that we'll reconstruct directly from
103 * the read ADC values rather than going via an intermedant
104 * TClonesArray of AliFMDDigits
106 virtual void Reconstruct(AliRawReader *, TTree*) const;
107 virtual void Reconstruct(AliFMDRawReader& reader) const;
109 * Put in the ESD data, the FMD ESD data. The object created by
110 * the Reconstruct member function is copied to the ESD object.
112 * @param digitsTree Tree of digits for this event - not used
113 * @param clusterTree Tree of reconstructed points for this event -
115 * @param esd ESD object to store data in.
117 virtual void FillESD(TTree* digitsTree, TTree* clusterTree,
118 AliESDEvent* esd) const;
120 * Forwards to above member function
122 virtual void FillESD(AliRawReader*, TTree* clusterTree,
123 AliESDEvent* esd) const;
125 * Return the filled FMD ESD object
127 * @return FMD ESD object
129 AliESDFMD* GetESDObject() const { return fESDObj; }
131 * Create SDigits from raw data
133 * @param reader The raw reader
134 * @param sdigits Array to fill with AliFMDSDigit objects.
136 virtual void Digitize(AliRawReader* reader,
137 TClonesArray* sdigits) const;
142 virtual void SetESD(AliESDEvent* esd) { fESD = esd; }
144 * Set the noise factor
146 * @param f Factor to use
148 virtual void SetNoiseFactor(Float_t f=3) { fNoiseFactor = f; }
150 * Set whether we should do angle correction or nor
152 * @param use If true, do angle correction
154 virtual void SetAngleCorrect(Bool_t use=kTRUE) { fAngleCorrect = use; }
156 * Set whether we want to do diagnostics. If this is enabled, a
157 * file named @c FMD.Diag.root will be made. It contains a set of
158 * histograms for each event, filed in separate directories in the
159 * file. The histograms are
161 * diagStep1 Read ADC vs. Noise surpressed ADC
162 * diagStep2 Noise surpressed ADC vs. calculated Energy dep.
163 * diagStep3 Energy deposition vs. angle corrected Energy dep.
164 * diagStep4 Energy deposition vs. calculated multiplicity
165 * diagAll Read ADC vs. calculated multiplicity
168 * @param use If true, make the diagnostics file
170 void SetDiagnose(Bool_t use=kTRUE) { fDiagnostics = use; }
172 * Process AliFMDDigit objects in @a digits. For each digit, find
173 * the psuedo-rapidity @f$ \eta@f$, azimuthal angle @f$ \varphi@f$,
174 * energy deposited @f$ E@f$, and psuedo-inclusive multiplicity @f$
177 * @param digits Array of digits.
178 * @param rawRead Raw reader used
180 virtual void ProcessDigits(TClonesArray* digits,
181 const AliFMDRawReader& rawRead) const;
187 * @param other Object to copy from.
189 AliFMDReconstructor(const AliFMDReconstructor&); //Not implemented
191 * Assignment operator
193 * @param other Object to assign from
195 * @return reference to this object
197 AliFMDReconstructor& operator=(const AliFMDReconstructor&); //Not implemented
199 * Try to get the vertex from either ESD or generator header. Sets
200 * @c fCurrentVertex to the found Z posistion of the vertex (if
201 * found), and sets the flag @c fVertexType accordingly
203 * @param esd ESD structure to get Vz from
205 virtual void GetVertex(AliESDEvent* esd) const;
207 * Set-up reconstructor to use values from reconstruction
208 * parameters, if present, for this event. If the argument @a set
209 * is @c false, then restore preset values.
213 virtual void UseRecoParam(Bool_t set=kTRUE) const;
215 * Process AliFMDDigit objects in @a digits. For each digit, find
216 * the psuedo-rapidity @f$ \eta@f$, azimuthal angle @f$ \varphi@f$,
217 * energy deposited @f$ E@f$, and psuedo-inclusive multiplicity @f$
220 * @param digits Array of digits.
222 virtual void ProcessDigits(TClonesArray* digits) const;
224 * Process a single digit
226 * @param digit Digiti to process
228 virtual void ProcessDigit(AliFMDDigit* digit) const;
230 * Process the signal from a single strip.
232 * @param det Detector number
233 * @param rng Ring identifier
234 * @param sec Sector number
235 * @param str Strip number
236 * @param adc Number of ADC counts for this strip
238 virtual void ProcessSignal(UShort_t det,
244 * Process the signal from a single strip.
246 * @param sdigits Array to fill
247 * @param det Detector number
248 * @param rng Ring identifier
249 * @param sec Sector number
250 * @param str Strip number
251 * @param sam Sample number
252 * @param adc Number of ADC counts for this strip
254 virtual void DigitizeSignal(TClonesArray* sdigits,
262 * Subtract the pedestal off the ADC counts.
264 * @param det Detector number
265 * @param rng Ring identifier
266 * @param sec Sector number
267 * @param str Strip number
268 * @param adc ADC counts
269 * @param noiseFactor If pedestal substracted pedestal is less then
270 * this times the noise, then consider this to be 0.
271 * @param zsEnabled Whether zero-suppression is on.
272 * @param zsNoiseFactor Noise factor used in on-line pedestal
275 * @return The pedestal subtracted ADC counts (possibly 0), or @c
276 * USHRT_MAX in case of problems.
278 virtual UShort_t SubtractPedestal(UShort_t det,
285 UShort_t zsNoiseFactor) const;
287 * Substract pedestals from raw ADC in @a digit
289 * @param det Detector number
290 * @param rng Ring identifier
291 * @param sec Sector number
292 * @param str Strip number
293 * @param adc Number of ADC counts
295 * @return Pedestal subtracted ADC count.
297 virtual UShort_t SubtractPedestal(UShort_t det,
303 * Converts number of ADC counts to energy deposited. This is
308 * where @f$ A_i@f$ is the pedestal subtracted ADC counts, and @f$
309 * g_i@f$ is the gain for the @f$ i^{\mbox{th}}@f$ strip.
311 * @param det Detector number
312 * @param rng Ring identifier
313 * @param sec Sector number
314 * @param str Strip number
315 * @param eta Psuedo-rapidity of digit.
316 * @param count Pedestal subtracted ADC counts
318 * @return Energy deposited @f$ E_i@f$
320 virtual Float_t Adc2Energy(UShort_t det,
324 UShort_t count) const;
326 * Converts number of ADC counts to energy deposited. This is
331 * where @f$ A_i@f$ is the pedestal subtracted ADC counts, and @f$
332 * g_i@f$ is the gain for the @f$ i^{\mbox{th}}@f$ strip.
334 * @param det Detector number
335 * @param rng Ring identifier
336 * @param sec Sector number
337 * @param str Strip number
338 * @param eta Psuedo-rapidity of digit.
339 * @param count Pedestal subtracted ADC counts
341 * @return Energy deposited @f$ E_i@f$
343 virtual Float_t Adc2Energy(UShort_t det,
348 UShort_t count) const;
350 * Converts an energy signal to number of particles. In this
351 * implementation, it's done by
353 * M_i = E_i / E_{\mbox{MIP}}
355 * where @f$ E_i@f$ is the energy deposited, and
356 * @f$ E_{\mbox{MIP}}@f$ is the average energy deposited by a
357 * minimum ionizing particle
359 * @param det Detector number
360 * @param rng Ring identifier
361 * @param sec Sector number
362 * @param str Strip number
363 * @param eta On return, psuedo-rapidity @f$ \eta@f$
364 * @param phi On return, azimuthal angle @f$ \varphi@f$
365 * @param edep Energy deposited @f$ E_i@f$
367 * @return Psuedo-inclusive multiplicity @f$ M@f$
369 virtual Float_t Energy2Multiplicity(UShort_t det,
375 * Calculate the physical coordinates psuedo-rapidity @f$ \eta@f$,
376 * azimuthal angle @f$ \varphi@f$ of the strip corresponding to
377 * the digit @a digit. This is done by using the information
378 * obtained, and previously cached by AliFMDGeometry, from the
381 * @param det Detector number
382 * @param rng Ring identifier
383 * @param sec Sector number
384 * @param str Strip number
385 * @param eta On return, psuedo-rapidity @f$ \eta@f$
386 * @param phi On return, azimuthal angle @f$ \varphi@f$
388 virtual void PhysicalCoordinates(UShort_t det,
395 * Mark dead channels as invalid, and those that are marked as invalid
396 * but are not dead, get the zero signal.
398 * @param esd ESD object to modify.
400 void MarkDeadChannels(AliESDFMD* esd) const;
403 * Utility member function to get the reconstruction parameters for
406 * @return Pointer to AliFMDRecoParam object or null if not
409 const AliFMDRecoParam* GetParameters() const;
411 * Get the numeric identifier of this detector
413 * @return Should be 12
415 Int_t GetIdentifier() const;
417 kNoVertex, // Got no vertex
418 kGenVertex, // Got generator vertex
419 kESDVertex // Got ESD vertex
421 mutable TClonesArray* fMult; // Cache of RecPoints
422 mutable Int_t fNMult; // Number of entries in fMult
423 mutable TTree* fTreeR; // Output tree
424 mutable Float_t fCurrentVertex; // Z-coordinate of primary vertex
425 mutable AliESDFMD* fESDObj; // ESD output object
426 mutable Float_t fNoiseFactor; // Factor of noise to check
427 mutable Bool_t fAngleCorrect; // Whether to angle correct
428 mutable Vertex_t fVertexType; // What kind of vertex we got
429 AliESDEvent* fESD; // ESD object(?)
430 Bool_t fDiagnostics; // Wheter to do diagnostics
431 TH1* fDiagStep1; // Diagnostics histogram
432 TH1* fDiagStep2; // Diagnostics histogram
433 TH1* fDiagStep3; // Diagnostics histogram
434 TH1* fDiagStep4; // Diagnostics histogram
435 TH1* fDiagAll; // Diagnostics histogram
436 mutable Bool_t fZS[3]; // Zero-suppredded?
437 mutable UShort_t fZSFactor[3]; // Noise factor for Zero-suppression
438 mutable AliFMDBoolMap fBad; // Strip marked bad
439 Bool_t fZombie; // Are we a zombie?
442 ClassDef(AliFMDReconstructor, 3) // class for the FMD reconstruction
445 //____________________________________________________________________