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>
29 //____________________________________________________________________
36 class AliFMDRecoParam;
40 /** @defgroup FMD_rec Reconstruction */
41 //____________________________________________________________________
43 * @brief This is a class that reconstructs AliFMDRecPoint objects
46 * This class reads either digits from a TClonesArray or raw data
47 * from a DDL file (or similar), and applies calibrations to get
48 * psuedo-inclusive multiplicities per strip.
52 class AliFMDReconstructor: public AliReconstructor
58 AliFMDReconstructor();
62 virtual ~AliFMDReconstructor();
65 * Initialize the reconstructor. Here, we initialize the geometry
66 * manager, and finds the local to global transformations from the
67 * geometry. The calibration parameter manager is also
68 * initialized (meaning that the calibration parameters is read
73 * Flag that we can convert raw data into digits.
75 * @return always @c true
77 virtual Bool_t HasDigitConversion() const { return kTRUE; }
79 * Convert raw data read from the AliRawReader @a reader into
80 * digits. This is done using AliFMDRawReader and
81 * AliFMDAltroReader. The digits are put in the passed TTree @a
84 * @param reader Raw reader.
85 * @param digitsTree Tree to store read digits in.
87 virtual void ConvertDigits(AliRawReader* reader, TTree* digitsTree) const;
89 * Reconstruct one event from the digits passed in @a digitsTree.
90 * The member function creates AliFMDRecPoint objects and stores
91 * them on the output tree @a clusterTree. An FMD ESD object is
92 * created in parallel.
94 * @param digitsTree Tree holding the digits of this event
95 * @param clusterTree Tree to store AliFMDRecPoint objects in.
97 virtual void Reconstruct(TTree* digitsTree, TTree* clusterTree) const;
100 * @todo Implement this, such that we'll reconstruct directly from
101 * the read ADC values rather than going via an intermedant
102 * TClonesArray of AliFMDDigits
104 virtual void Reconstruct(AliRawReader *, TTree*) const;
106 * Put in the ESD data, the FMD ESD data. The object created by
107 * the Reconstruct member function is copied to the ESD object.
109 * @param digitsTree Tree of digits for this event - not used
110 * @param clusterTree Tree of reconstructed points for this event -
112 * @param esd ESD object to store data in.
114 virtual void FillESD(TTree* digitsTree, TTree* clusterTree,
115 AliESDEvent* esd) const;
117 * Forwards to above member function
119 virtual void FillESD(AliRawReader*, TTree* clusterTree,
120 AliESDEvent* esd) const;
123 * Create SDigits from raw data
125 * @param reader The raw reader
126 * @param sdigits Array to fill with AliFMDSDigit objects.
128 virtual void Digitize(AliRawReader* reader,
129 TClonesArray* sdigits) const;
134 virtual void SetESD(AliESDEvent* esd) { fESD = esd; }
136 * Set the noise factor
138 * @param f Factor to use
140 virtual void SetNoiseFactor(Float_t f=3) { fNoiseFactor = f; }
142 * Set whether we should do angle correction or nor
144 * @param use If true, do angle correction
146 virtual void SetAngleCorrect(Bool_t use=kTRUE) { fAngleCorrect = use; }
148 * Set whether we want to do diagnostics. If this is enabled, a
149 * file named @c FMD.Diag.root will be made. It contains a set of
150 * histograms for each event, filed in separate directories in the
151 * file. The histograms are
153 * diagStep1 Read ADC vs. Noise surpressed ADC
154 * diagStep2 Noise surpressed ADC vs. calculated Energy dep.
155 * diagStep3 Energy deposition vs. angle corrected Energy dep.
156 * diagStep4 Energy deposition vs. calculated multiplicity
157 * diagAll Read ADC vs. calculated multiplicity
160 * @param use If true, make the diagnostics file
162 void SetDiagnose(Bool_t use=kTRUE) { fDiagnostics = use; }
168 * @param other Object to copy from.
170 AliFMDReconstructor(const AliFMDReconstructor&); //Not implemented
172 * Assignment operator
174 * @param other Object to assign from
176 * @return reference to this object
178 AliFMDReconstructor& operator=(const AliFMDReconstructor&); //Not implemented
180 * Try to get the vertex from either ESD or generator header. Sets
181 * @c fCurrentVertex to the found Z posistion of the vertex (if
182 * found), and sets the flag @c fVertexType accordingly
184 * @param esd ESD structure to get Vz from
186 virtual void GetVertex(AliESDEvent* esd) const;
188 * Process AliFMDDigit objects in @a digits. For each digit, find
189 * the psuedo-rapidity @f$ \eta@f$, azimuthal angle @f$ \varphi@f$,
190 * energy deposited @f$ E@f$, and psuedo-inclusive multiplicity @f$
193 * @param digits Array of digits.
195 virtual void ProcessDigits(TClonesArray* digits) const;
197 * Process a single digit
199 * @param digit Digiti to process
201 virtual void ProcessDigit(AliFMDDigit* digit) const;
203 * Process the signal from a single strip.
205 * @param det Detector number
206 * @param rng Ring identifier
207 * @param sec Sector number
208 * @param str Strip number
209 * @param adc Number of ADC counts for this strip
211 virtual void ProcessSignal(UShort_t det,
217 * Process the signal from a single strip.
219 * @param sdigits Array to fill
220 * @param det Detector number
221 * @param rng Ring identifier
222 * @param sec Sector number
223 * @param str Strip number
224 * @param sam Sample number
225 * @param adc Number of ADC counts for this strip
227 virtual void DigitizeSignal(TClonesArray* sdigits,
235 * Subtract the pedestal off the ADC counts.
237 * @param det Detector number
238 * @param rng Ring identifier
239 * @param sec Sector number
240 * @param str Strip number
241 * @param adc ADC counts
242 * @param noiseFactor If pedestal substracted pedestal is less then
243 * this times the noise, then consider this to be 0.
244 * @param zsEnabled Whether zero-suppression is on.
245 * @param zsNoiseFactor Noise factor used in on-line pedestal
248 * @return The pedestal subtracted ADC counts (possibly 0), or @c
249 * USHRT_MAX in case of problems.
251 virtual UShort_t SubtractPedestal(UShort_t det,
258 UShort_t zsNoiseFactor) const;
260 * Substract pedestals from raw ADC in @a digit
262 * @param det Detector number
263 * @param rng Ring identifier
264 * @param sec Sector number
265 * @param str Strip number
266 * @param adc Number of ADC counts
268 * @return Pedestal subtracted ADC count.
270 virtual UShort_t SubtractPedestal(UShort_t det,
276 * Converts number of ADC counts to energy deposited. This is
281 * where @f$ A_i@f$ is the pedestal subtracted ADC counts, and @f$
282 * g_i@f$ is the gain for the @f$ i^{\mbox{th}}@f$ strip.
284 * @param det Detector number
285 * @param rng Ring identifier
286 * @param sec Sector number
287 * @param str Strip number
288 * @param eta Psuedo-rapidity of digit.
289 * @param count Pedestal subtracted ADC counts
291 * @return Energy deposited @f$ E_i@f$
293 virtual Float_t Adc2Energy(UShort_t det,
297 UShort_t count) const;
299 * Converts number of ADC counts to energy deposited. This is
304 * where @f$ A_i@f$ is the pedestal subtracted ADC counts, and @f$
305 * g_i@f$ is the gain for the @f$ i^{\mbox{th}}@f$ strip.
307 * @param det Detector number
308 * @param rng Ring identifier
309 * @param sec Sector number
310 * @param str Strip number
311 * @param eta Psuedo-rapidity of digit.
312 * @param count Pedestal subtracted ADC counts
314 * @return Energy deposited @f$ E_i@f$
316 virtual Float_t Adc2Energy(UShort_t det,
321 UShort_t count) const;
323 * Converts an energy signal to number of particles. In this
324 * implementation, it's done by
326 * M_i = E_i / E_{\mbox{MIP}}
328 * where @f$ E_i@f$ is the energy deposited, and
329 * @f$ E_{\mbox{MIP}}@f$ is the average energy deposited by a
330 * minimum ionizing particle
332 * @param det Detector number
333 * @param rng Ring identifier
334 * @param sec Sector number
335 * @param str Strip number
336 * @param eta On return, psuedo-rapidity @f$ \eta@f$
337 * @param phi On return, azimuthal angle @f$ \varphi@f$
338 * @param edep Energy deposited @f$ E_i@f$
340 * @return Psuedo-inclusive multiplicity @f$ M@f$
342 virtual Float_t Energy2Multiplicity(UShort_t det,
348 * Calculate the physical coordinates psuedo-rapidity @f$ \eta@f$,
349 * azimuthal angle @f$ \varphi@f$ of the strip corresponding to
350 * the digit @a digit. This is done by using the information
351 * obtained, and previously cached by AliFMDGeometry, from the
354 * @param det Detector number
355 * @param rng Ring identifier
356 * @param sec Sector number
357 * @param str Strip number
358 * @param eta On return, psuedo-rapidity @f$ \eta@f$
359 * @param phi On return, azimuthal angle @f$ \varphi@f$
361 virtual void PhysicalCoordinates(UShort_t det,
368 * Mark dead channels as invalid, and those that are marked as invalid
369 * but are not dead, get the zero signal.
371 * @param esd ESD object to modify.
373 void MarkDeadChannels(AliESDFMD* esd) const;
376 * Set-up reconstructor to use values from reconstruction
377 * parameters, if present, for this event. If the argument @a set
378 * is @c false, then restore preset values.
382 virtual void UseRecoParam(Bool_t set=kTRUE) const;
384 * Utility member function to get the reconstruction parameters for
387 * @return Pointer to AliFMDRecoParam object or null if not
390 const AliFMDRecoParam* GetParameters() const;
392 * Get the numeric identifier of this detector
394 * @return Should be 12
396 Int_t GetIdentifier() const;
398 kNoVertex, // Got no vertex
399 kGenVertex, // Got generator vertex
400 kESDVertex // Got ESD vertex
402 mutable TClonesArray* fMult; // Cache of RecPoints
403 mutable Int_t fNMult; // Number of entries in fMult
404 mutable TTree* fTreeR; // Output tree
405 mutable Float_t fCurrentVertex; // Z-coordinate of primary vertex
406 mutable AliESDFMD* fESDObj; // ESD output object
407 mutable Float_t fNoiseFactor; // Factor of noise to check
408 mutable Bool_t fAngleCorrect; // Whether to angle correct
409 mutable Vertex_t fVertexType; // What kind of vertex we got
410 AliESDEvent* fESD; // ESD object(?)
411 Bool_t fDiagnostics; // Wheter to do diagnostics
412 TH1* fDiagStep1; // Diagnostics histogram
413 TH1* fDiagStep2; // Diagnostics histogram
414 TH1* fDiagStep3; // Diagnostics histogram
415 TH1* fDiagStep4; // Diagnostics histogram
416 TH1* fDiagAll; // Diagnostics histogram
417 mutable Bool_t fZS[3]; // Zero-suppredded?
418 mutable UShort_t fZSFactor[3]; // Noise factor for Zero-suppression
421 ClassDef(AliFMDReconstructor, 3) // class for the FMD reconstruction
424 //____________________________________________________________________