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 * @note This is the first part of the reconstruction as done by the
87 * offical steering class AliReconstruction.
89 * @param reader Raw reader. @param digitsTree Tree to store read
92 virtual void ConvertDigits(AliRawReader* reader, TTree* digitsTree) const;
94 * Reconstruct one event from the digits passed in @a digitsTree.
95 * The member function creates AliFMDRecPoint objects and stores
96 * them on the output tree @a clusterTree. An FMD ESD object is
97 * created in parallel.
99 * @note This is the second part of the reconstruction as done by
100 * the offical steering class AliReconstruction.
102 * @param digitsTree Tree holding the digits of this event
103 * @param clusterTree Tree to store AliFMDRecPoint objects in.
105 virtual void Reconstruct(TTree* digitsTree, TTree* clusterTree) const;
108 * @todo Implement this, such that we'll reconstruct directly from
109 * the read ADC values rather than going via an intermedant
110 * TClonesArray of AliFMDDigits
112 virtual void Reconstruct(AliRawReader *, TTree*) const;
116 * @todo This is called by the above same member function but with a
117 * pointer to a AliRawReader object and a pointer to a TTree object.
119 * @param reader Reader object
121 virtual void Reconstruct(AliFMDRawReader& reader) const;
123 * Put in the ESD data, the FMD ESD data. The object created by
124 * the Reconstruct member function is copied to the ESD object.
126 * @note This is the third part of the reconstruction as done by
127 * the offical steering class AliReconstruction.
129 * @param digitsTree Tree of digits for this event - not used
130 * @param clusterTree Tree of reconstructed points for this event -
132 * @param esd ESD object to store data in.
134 virtual void FillESD(TTree* digitsTree, TTree* clusterTree,
135 AliESDEvent* esd) const;
137 * Forwards to above member function
139 virtual void FillESD(AliRawReader*, TTree* clusterTree,
140 AliESDEvent* esd) const;
142 * Return the filled FMD ESD object
144 * @return FMD ESD object
146 AliESDFMD* GetESDObject() const { return fESDObj; }
148 * Create SDigits from raw data
150 * @param reader The raw reader
151 * @param sdigits Array to fill with AliFMDSDigit objects.
153 virtual void Digitize(AliRawReader* reader,
154 TClonesArray* sdigits) const;
159 virtual void SetESD(AliESDEvent* esd) { fESD = esd; }
161 * Set the noise factor
163 * @param f Factor to use
165 virtual void SetNoiseFactor(Float_t f=3) { fNoiseFactor = f; }
167 * Set whether we should do angle correction or nor
169 * @param use If true, do angle correction
171 virtual void SetAngleCorrect(Bool_t use=kTRUE) { fAngleCorrect = use; }
173 * Set whether we want to do diagnostics. If this is enabled, a
174 * file named @c FMD.Diag.root will be made. It contains a set of
175 * histograms for each event, filed in separate directories in the
176 * file. The histograms are
178 * diagStep1 Read ADC vs. Noise surpressed ADC
179 * diagStep2 Noise surpressed ADC vs. calculated Energy dep.
180 * diagStep3 Energy deposition vs. angle corrected Energy dep.
181 * diagStep4 Energy deposition vs. calculated multiplicity
182 * diagAll Read ADC vs. calculated multiplicity
185 * @param use If true, make the diagnostics file
187 void SetDiagnose(Bool_t use=kTRUE) { fDiagnostics = use; }
189 * Process AliFMDDigit objects in @a digits. For each digit, find
190 * the psuedo-rapidity @f$ \eta@f$, azimuthal angle @f$ \varphi@f$,
191 * energy deposited @f$ E@f$, and psuedo-inclusive multiplicity @f$
194 * @param digits Array of digits.
195 * @param rawRead Raw reader used
197 virtual void ProcessDigits(TClonesArray* digits,
198 const AliFMDRawReader& rawRead) const;
204 * @param other Object to copy from.
206 AliFMDReconstructor(const AliFMDReconstructor&); //Not implemented
208 * Assignment operator
210 * @param other Object to assign from
212 * @return reference to this object
214 AliFMDReconstructor& operator=(const AliFMDReconstructor&); //Not implemented
216 * Run some checks before reconstruction, clear internal arrays, etc.
218 * @return true on success
220 Bool_t PreReconstruct() const;
222 * Try to get the vertex from either ESD or generator header. Sets
223 * @c fCurrentVertex to the found Z posistion of the vertex (if
224 * found), and sets the flag @c fVertexType accordingly
226 * @param esd ESD structure to get Vz from
228 virtual void GetVertex(AliESDEvent* esd) const;
230 * Set-up reconstructor to use values from reconstruction
231 * parameters, if present, for this event. If the argument @a set
232 * is @c false, then restore preset values.
236 virtual void UseRecoParam(Bool_t set=kTRUE) const;
238 * Process AliFMDDigit objects in @a digits. For each digit, find
239 * the psuedo-rapidity @f$ \eta@f$, azimuthal angle @f$ \varphi@f$,
240 * energy deposited @f$ E@f$, and psuedo-inclusive multiplicity @f$
243 * @param digits Array of digits.
245 virtual void ProcessDigits(TClonesArray* digits) const;
247 * Process a single digit
249 * @param digit Digiti to process
251 virtual void ProcessDigit(AliFMDDigit* digit) const;
253 * Process the signal from a single strip.
255 * @param det Detector number
256 * @param rng Ring identifier
257 * @param sec Sector number
258 * @param str Strip number
259 * @param adc Number of ADC counts for this strip
261 virtual void ProcessSignal(UShort_t det,
267 * Process the signal from a single strip.
269 * @param sdigits Array to fill
270 * @param det Detector number
271 * @param rng Ring identifier
272 * @param sec Sector number
273 * @param str Strip number
274 * @param sam Sample number
275 * @param adc Number of ADC counts for this strip
277 virtual void DigitizeSignal(TClonesArray* sdigits,
285 * Subtract the pedestal off the ADC counts.
287 * @param det Detector number
288 * @param rng Ring identifier
289 * @param sec Sector number
290 * @param str Strip number
291 * @param adc ADC counts
292 * @param noiseFactor If pedestal substracted pedestal is less then
293 * this times the noise, then consider this to be 0.
294 * @param zsEnabled Whether zero-suppression is on.
295 * @param zsNoiseFactor Noise factor used in on-line pedestal
298 * @return The pedestal subtracted ADC counts (possibly 0), or @c
299 * USHRT_MAX in case of problems.
301 virtual UShort_t SubtractPedestal(UShort_t det,
308 UShort_t zsNoiseFactor) const;
310 * Substract pedestals from raw ADC in @a digit
312 * @param det Detector number
313 * @param rng Ring identifier
314 * @param sec Sector number
315 * @param str Strip number
316 * @param adc Number of ADC counts
318 * @return Pedestal subtracted ADC count.
320 virtual UShort_t SubtractPedestal(UShort_t det,
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,
347 UShort_t count) const;
349 * Converts number of ADC counts to energy deposited. This is
354 * where @f$ A_i@f$ is the pedestal subtracted ADC counts, and @f$
355 * g_i@f$ is the gain for the @f$ i^{\mbox{th}}@f$ strip.
357 * @param det Detector number
358 * @param rng Ring identifier
359 * @param sec Sector number
360 * @param str Strip number
361 * @param eta Psuedo-rapidity of digit.
362 * @param count Pedestal subtracted ADC counts
364 * @return Energy deposited @f$ E_i@f$
366 virtual Float_t Adc2Energy(UShort_t det,
371 UShort_t count) const;
373 * Converts an energy signal to number of particles. In this
374 * implementation, it's done by
376 * M_i = E_i / E_{\mbox{MIP}}
378 * where @f$ E_i@f$ is the energy deposited, and
379 * @f$ E_{\mbox{MIP}}@f$ is the average energy deposited by a
380 * minimum ionizing particle
382 * @param det Detector number
383 * @param rng Ring identifier
384 * @param sec Sector number
385 * @param str Strip number
386 * @param eta On return, psuedo-rapidity @f$ \eta@f$
387 * @param phi On return, azimuthal angle @f$ \varphi@f$
388 * @param edep Energy deposited @f$ E_i@f$
390 * @return Psuedo-inclusive multiplicity @f$ M@f$
392 virtual Float_t Energy2Multiplicity(UShort_t det,
398 * Calculate the physical coordinates psuedo-rapidity @f$ \eta@f$,
399 * azimuthal angle @f$ \varphi@f$ of the strip corresponding to
400 * the digit @a digit. This is done by using the information
401 * obtained, and previously cached by AliFMDGeometry, from the
404 * @param det Detector number
405 * @param rng Ring identifier
406 * @param sec Sector number
407 * @param str Strip number
408 * @param eta On return, psuedo-rapidity @f$ \eta@f$
409 * @param phi On return, azimuthal angle @f$ \varphi@f$
411 virtual void PhysicalCoordinates(UShort_t det,
418 * Mark dead channels as invalid, and those that are marked as invalid
419 * but are not dead, get the zero signal.
421 * @param esd ESD object to modify.
423 void MarkDeadChannels(AliESDFMD* esd) const;
426 * Utility member function to get the reconstruction parameters for
429 * @return Pointer to AliFMDRecoParam object or null if not
432 const AliFMDRecoParam* GetParameters() const;
434 * Get the numeric identifier of this detector
436 * @return Should be 12
438 Int_t GetIdentifier() const;
440 kNoVertex, // Got no vertex
441 kGenVertex, // Got generator vertex
442 kESDVertex // Got ESD vertex
444 mutable TClonesArray* fMult; // Cache of RecPoints
445 mutable Int_t fNMult; // Number of entries in fMult
446 mutable TTree* fTreeR; // Output tree
447 mutable Float_t fCurrentVertex; // Z-coordinate of primary vertex
448 mutable AliESDFMD* fESDObj; // ESD output object
449 mutable Float_t fNoiseFactor; // Factor of noise to check
450 mutable Bool_t fAngleCorrect; // Whether to angle correct
451 mutable Vertex_t fVertexType; // What kind of vertex we got
452 AliESDEvent* fESD; // ESD object(?)
453 Bool_t fDiagnostics; // Wheter to do diagnostics
454 TH1* fDiagStep1; // Diagnostics histogram
455 TH1* fDiagStep2; // Diagnostics histogram
456 TH1* fDiagStep3; // Diagnostics histogram
457 TH1* fDiagStep4; // Diagnostics histogram
458 TH1* fDiagAll; // Diagnostics histogram
459 mutable Bool_t fZS[3]; // Zero-suppredded?
460 mutable UShort_t fZSFactor[3]; // Noise factor for Zero-suppression
461 mutable AliFMDBoolMap fBad; // Strip marked bad
462 Bool_t fZombie; // Are we a zombie?
465 ClassDef(AliFMDReconstructor, 3) // class for the FMD reconstruction
468 //____________________________________________________________________