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 //____________________________________________________________________
37 class AliFMDRecoParam;
41 /** @defgroup FMD_rec Reconstruction */
42 //____________________________________________________________________
44 * @brief This is a class that reconstructs AliFMDRecPoint objects
47 * This class reads either digits from a TClonesArray or raw data
48 * from a DDL file (or similar), and applies calibrations to get
49 * psuedo-inclusive multiplicities per strip.
53 class AliFMDReconstructor: public AliReconstructor
59 AliFMDReconstructor();
63 virtual ~AliFMDReconstructor();
66 * Initialize the reconstructor. Here, we initialize the geometry
67 * manager, and finds the local to global transformations from the
68 * geometry. The calibration parameter manager is also
69 * initialized (meaning that the calibration parameters is read
74 * Flag that we can convert raw data into digits.
76 * @return always @c true
78 virtual Bool_t HasDigitConversion() const { return kTRUE; }
80 * Convert raw data read from the AliRawReader @a reader into
81 * digits. This is done using AliFMDRawReader and
82 * AliFMDAltroReader. The digits are put in the passed TTree @a
85 * @param reader Raw reader.
86 * @param digitsTree Tree to store read digits in.
88 virtual void ConvertDigits(AliRawReader* reader, TTree* digitsTree) const;
90 * Reconstruct one event from the digits passed in @a digitsTree.
91 * The member function creates AliFMDRecPoint objects and stores
92 * them on the output tree @a clusterTree. An FMD ESD object is
93 * created in parallel.
95 * @param digitsTree Tree holding the digits of this event
96 * @param clusterTree Tree to store AliFMDRecPoint objects in.
98 virtual void Reconstruct(TTree* digitsTree, TTree* clusterTree) const;
101 * @todo Implement this, such that we'll reconstruct directly from
102 * the read ADC values rather than going via an intermedant
103 * TClonesArray of AliFMDDigits
105 virtual void Reconstruct(AliRawReader *, TTree*) const;
107 * Put in the ESD data, the FMD ESD data. The object created by
108 * the Reconstruct member function is copied to the ESD object.
110 * @param digitsTree Tree of digits for this event - not used
111 * @param clusterTree Tree of reconstructed points for this event -
113 * @param esd ESD object to store data in.
115 virtual void FillESD(TTree* digitsTree, TTree* clusterTree,
116 AliESDEvent* esd) const;
118 * Forwards to above member function
120 virtual void FillESD(AliRawReader*, TTree* clusterTree,
121 AliESDEvent* esd) const;
124 * Create SDigits from raw data
126 * @param reader The raw reader
127 * @param sdigits Array to fill with AliFMDSDigit objects.
129 virtual void Digitize(AliRawReader* reader,
130 TClonesArray* sdigits) const;
135 virtual void SetESD(AliESDEvent* esd) { fESD = esd; }
137 * Set the noise factor
139 * @param f Factor to use
141 virtual void SetNoiseFactor(Float_t f=3) { fNoiseFactor = f; }
143 * Set whether we should do angle correction or nor
145 * @param use If true, do angle correction
147 virtual void SetAngleCorrect(Bool_t use=kTRUE) { fAngleCorrect = use; }
149 * Set whether we want to do diagnostics. If this is enabled, a
150 * file named @c FMD.Diag.root will be made. It contains a set of
151 * histograms for each event, filed in separate directories in the
152 * file. The histograms are
154 * diagStep1 Read ADC vs. Noise surpressed ADC
155 * diagStep2 Noise surpressed ADC vs. calculated Energy dep.
156 * diagStep3 Energy deposition vs. angle corrected Energy dep.
157 * diagStep4 Energy deposition vs. calculated multiplicity
158 * diagAll Read ADC vs. calculated multiplicity
161 * @param use If true, make the diagnostics file
163 void SetDiagnose(Bool_t use=kTRUE) { fDiagnostics = use; }
169 * @param other Object to copy from.
171 AliFMDReconstructor(const AliFMDReconstructor&); //Not implemented
173 * Assignment operator
175 * @param other Object to assign from
177 * @return reference to this object
179 AliFMDReconstructor& operator=(const AliFMDReconstructor&); //Not implemented
181 * Try to get the vertex from either ESD or generator header. Sets
182 * @c fCurrentVertex to the found Z posistion of the vertex (if
183 * found), and sets the flag @c fVertexType accordingly
185 * @param esd ESD structure to get Vz from
187 virtual void GetVertex(AliESDEvent* esd) const;
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.
196 virtual void ProcessDigits(TClonesArray* digits) const;
198 * Process a single digit
200 * @param digit Digiti to process
202 virtual void ProcessDigit(AliFMDDigit* digit) const;
204 * Process the signal from a single strip.
206 * @param det Detector number
207 * @param rng Ring identifier
208 * @param sec Sector number
209 * @param str Strip number
210 * @param adc Number of ADC counts for this strip
212 virtual void ProcessSignal(UShort_t det,
218 * Process the signal from a single strip.
220 * @param sdigits Array to fill
221 * @param det Detector number
222 * @param rng Ring identifier
223 * @param sec Sector number
224 * @param str Strip number
225 * @param sam Sample number
226 * @param adc Number of ADC counts for this strip
228 virtual void DigitizeSignal(TClonesArray* sdigits,
236 * Subtract the pedestal off the ADC counts.
238 * @param det Detector number
239 * @param rng Ring identifier
240 * @param sec Sector number
241 * @param str Strip number
242 * @param adc ADC counts
243 * @param noiseFactor If pedestal substracted pedestal is less then
244 * this times the noise, then consider this to be 0.
245 * @param zsEnabled Whether zero-suppression is on.
246 * @param zsNoiseFactor Noise factor used in on-line pedestal
249 * @return The pedestal subtracted ADC counts (possibly 0), or @c
250 * USHRT_MAX in case of problems.
252 virtual UShort_t SubtractPedestal(UShort_t det,
259 UShort_t zsNoiseFactor) const;
261 * Substract pedestals from raw ADC in @a digit
263 * @param det Detector number
264 * @param rng Ring identifier
265 * @param sec Sector number
266 * @param str Strip number
267 * @param adc Number of ADC counts
269 * @return Pedestal subtracted ADC count.
271 virtual UShort_t SubtractPedestal(UShort_t det,
277 * Converts number of ADC counts to energy deposited. This is
282 * where @f$ A_i@f$ is the pedestal subtracted ADC counts, and @f$
283 * g_i@f$ is the gain for the @f$ i^{\mbox{th}}@f$ strip.
285 * @param det Detector number
286 * @param rng Ring identifier
287 * @param sec Sector number
288 * @param str Strip number
289 * @param eta Psuedo-rapidity of digit.
290 * @param count Pedestal subtracted ADC counts
292 * @return Energy deposited @f$ E_i@f$
294 virtual Float_t Adc2Energy(UShort_t det,
298 UShort_t count) const;
300 * Converts number of ADC counts to energy deposited. This is
305 * where @f$ A_i@f$ is the pedestal subtracted ADC counts, and @f$
306 * g_i@f$ is the gain for the @f$ i^{\mbox{th}}@f$ strip.
308 * @param det Detector number
309 * @param rng Ring identifier
310 * @param sec Sector number
311 * @param str Strip number
312 * @param eta Psuedo-rapidity of digit.
313 * @param count Pedestal subtracted ADC counts
315 * @return Energy deposited @f$ E_i@f$
317 virtual Float_t Adc2Energy(UShort_t det,
322 UShort_t count) const;
324 * Converts an energy signal to number of particles. In this
325 * implementation, it's done by
327 * M_i = E_i / E_{\mbox{MIP}}
329 * where @f$ E_i@f$ is the energy deposited, and
330 * @f$ E_{\mbox{MIP}}@f$ is the average energy deposited by a
331 * minimum ionizing particle
333 * @param det Detector number
334 * @param rng Ring identifier
335 * @param sec Sector number
336 * @param str Strip number
337 * @param eta On return, psuedo-rapidity @f$ \eta@f$
338 * @param phi On return, azimuthal angle @f$ \varphi@f$
339 * @param edep Energy deposited @f$ E_i@f$
341 * @return Psuedo-inclusive multiplicity @f$ M@f$
343 virtual Float_t Energy2Multiplicity(UShort_t det,
349 * Calculate the physical coordinates psuedo-rapidity @f$ \eta@f$,
350 * azimuthal angle @f$ \varphi@f$ of the strip corresponding to
351 * the digit @a digit. This is done by using the information
352 * obtained, and previously cached by AliFMDGeometry, from the
355 * @param det Detector number
356 * @param rng Ring identifier
357 * @param sec Sector number
358 * @param str Strip number
359 * @param eta On return, psuedo-rapidity @f$ \eta@f$
360 * @param phi On return, azimuthal angle @f$ \varphi@f$
362 virtual void PhysicalCoordinates(UShort_t det,
369 * Mark dead channels as invalid, and those that are marked as invalid
370 * but are not dead, get the zero signal.
372 * @param esd ESD object to modify.
374 void MarkDeadChannels(AliESDFMD* esd) const;
377 * Set-up reconstructor to use values from reconstruction
378 * parameters, if present, for this event. If the argument @a set
379 * is @c false, then restore preset values.
383 virtual void UseRecoParam(Bool_t set=kTRUE) const;
385 * Utility member function to get the reconstruction parameters for
388 * @return Pointer to AliFMDRecoParam object or null if not
391 const AliFMDRecoParam* GetParameters() const;
393 * Get the numeric identifier of this detector
395 * @return Should be 12
397 Int_t GetIdentifier() const;
399 kNoVertex, // Got no vertex
400 kGenVertex, // Got generator vertex
401 kESDVertex // Got ESD vertex
403 mutable TClonesArray* fMult; // Cache of RecPoints
404 mutable Int_t fNMult; // Number of entries in fMult
405 mutable TTree* fTreeR; // Output tree
406 mutable Float_t fCurrentVertex; // Z-coordinate of primary vertex
407 mutable AliESDFMD* fESDObj; // ESD output object
408 mutable Float_t fNoiseFactor; // Factor of noise to check
409 mutable Bool_t fAngleCorrect; // Whether to angle correct
410 mutable Vertex_t fVertexType; // What kind of vertex we got
411 AliESDEvent* fESD; // ESD object(?)
412 Bool_t fDiagnostics; // Wheter to do diagnostics
413 TH1* fDiagStep1; // Diagnostics histogram
414 TH1* fDiagStep2; // Diagnostics histogram
415 TH1* fDiagStep3; // Diagnostics histogram
416 TH1* fDiagStep4; // Diagnostics histogram
417 TH1* fDiagAll; // Diagnostics histogram
418 mutable Bool_t fZS[3]; // Zero-suppredded?
419 mutable UShort_t fZSFactor[3]; // Noise factor for Zero-suppression
420 mutable AliFMDBoolMap fBad; // Strip marked bad
423 ClassDef(AliFMDReconstructor, 3) // class for the FMD reconstruction
426 //____________________________________________________________________