]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/AliFMDReconstructor.h
Updated reconstruction to (optionally) make angle correction.
[u/mrichter/AliRoot.git] / FMD / AliFMDReconstructor.h
1 #ifndef ALIFMDRECONSTRUCTOR_H
2 #define ALIFMDRECONSTRUCTOR_H
3 //
4 //  Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
5 //  reserved. 
6 //
7 //  See cxx source for full Copyright notice                               
8 //
9 //  AliFMDReconstructor.h 
10 //  Task Class for making TreeR for FMD                        
11 //
12 //-- Authors: Evgeny Karpechev (INR) and Alla Maevskaia (INR)
13 //   Latest changes by Christian Holm Christensen <cholm@nbi.dk>
14 /* $Id$ */
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 */
20
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>
26 #endif
27
28 //____________________________________________________________________
29 class TTree;
30 class TClonesArray;
31 class AliFMDDigit;
32 class AliRawReader;
33 class AliRunLoader;
34 class AliESD;
35 class AliESDFMD;
36
37 /** @defgroup FMD_rec Reconstruction */
38 //____________________________________________________________________
39 /** @brief This is a class that reconstructs AliFMDRecPoint objects from of
40     Digits.  
41     This class reads either digits from a TClonesArray or raw data
42     from a DDL file (or similar), and applies calibrations to get
43     psuedo-inclusive multiplicities per strip.
44
45     @ingroup FMD_rec
46  */
47 class AliFMDReconstructor: public AliReconstructor 
48 {
49 public:
50   /** CTOR */
51   AliFMDReconstructor();
52   /** DTOR */
53   virtual ~AliFMDReconstructor();
54
55   /** Initialize the reconstructor.  Here, we initialize the geometry
56       manager, and finds the local to global transformations from the
57       geometry.   The calibration parameter manager is also
58       initialized (meaning that the calibration parameters is read
59       from CDB).   Next, we try to get some information about the run
60       from the run loader passed. 
61       @param runLoader Run loader to use to load and store data. 
62   */
63   virtual void   Init(AliRunLoader* runLoader);
64   /** Flag that we can convert raw data into digits. 
65       @return always @c true */
66   virtual Bool_t HasDigitConversion() const { return kTRUE; }
67   /** Convert raw data read from the AliRawReader @a reader into
68       digits.  This is done using AliFMDRawReader and
69       AliFMDAltroReader.  The digits are put in the passed TTree @a
70       digitsTree. 
71       @param reader     Raw reader. 
72       @param digitsTree Tree to store read digits in. */
73   virtual void   ConvertDigits(AliRawReader* reader, TTree* digitsTree) const;
74   /** Flag that we can do one-event reconstruction. 
75       @return always @c true  */
76   virtual Bool_t HasLocalReconstruction() const { return kTRUE; }
77   /** Reconstruct one event from the digits passed in @a digitsTree.
78       The member function creates AliFMDRecPoint objects and stores
79       them on the output tree @a clusterTree.  An FMD ESD object is
80       created in parallel. 
81       @todo Make sure we get a vertex. 
82       @param digitsTree  Tree holding the digits of this event
83       @param clusterTree Tree to store AliFMDRecPoint objects in. */
84   virtual void   Reconstruct(TTree* digitsTree, TTree* clusterTree) const;
85   /** Put in the ESD data, the FMD ESD data.  The object created by
86       the Reconstruct member function is copied to the ESD object. 
87       @param digitsTree   Tree of digits for this event - not used
88       @param clusterTree  Tree of reconstructed points for this event
89       - not used. 
90       @param esd ESD object to store data in. 
91   */
92   virtual void   FillESD(TTree* digitsTree, TTree* clusterTree, 
93                          AliESD* esd) const;
94   /** Not used */
95   virtual void   SetESD(AliESD* esd) { fESD = esd; }
96   /** Set the noise factor 
97       @param f Factor to use */
98   virtual void SetNoiseFactor(Float_t f=3) { fNoiseFactor = f; }
99   /** Set whether we should do angle correction or nor 
100       @param use If true, do angle correction */
101   virtual void SetAngleCorrect(Bool_t use=kTRUE) { fAngleCorrect = use; }
102 protected:
103   /** Copy CTOR 
104       @param other Object to copy from. */
105   AliFMDReconstructor(const AliFMDReconstructor& other);
106   /** Assignment operator 
107       @param other Object to assign from
108       @return reference to this object */
109   AliFMDReconstructor& operator=(const AliFMDReconstructor& other);
110   /** Process AliFMDDigit objects in @a digits.  For each digit, find
111       the psuedo-rapidity @f$ \eta@f$, azimuthal angle @f$ \varphi@f$,
112       energy deposited @f$ E@f$, and psuedo-inclusive multiplicity @f$
113       M@f$.
114       @param digits Array of digits. */
115   virtual void     ProcessDigits(TClonesArray* digits) const;
116   /** Substract pedestals from raw ADC in @a digit
117       @param digit Digit data
118       @return Pedestal subtracted ADC count. */
119   virtual UShort_t SubtractPedestal(AliFMDDigit* digit) const;
120   /** Converts number of ADC counts to energy deposited.   This is
121       done by 
122       @f[
123       E_i = A_i g_i
124       @f]
125       where @f$ A_i@f$ is the pedestal subtracted ADC counts, and @f$
126       g_i@f$ is the gain for the @f$ i^{\mbox{th}}@f$ strip. 
127       @param digit Raw data
128       @param eta   Psuedo-rapidity of digit.
129       @param count Pedestal subtracted ADC counts
130       @return Energy deposited @f$ E_i@f$ */
131   virtual Float_t  Adc2Energy(AliFMDDigit* digit, Float_t eta, 
132                               UShort_t count) const;
133   /** Converts an energy signal to number of particles. In this
134       implementation, it's done by 
135       @f[
136       M_i = E_i / E_{\mbox{MIP}}
137       @f]
138       where @f$ E_i@f$ is the energy deposited, and @f$
139       E_{\mbox{MIP}}@f$ is the average energy deposited by a minimum
140       ionizing particle
141       @param digit Raw data
142       @param edep Energy deposited @f$ E_i@f$
143       @return Psuedo-inclusive multiplicity @f$ M@f$ */
144   virtual Float_t  Energy2Multiplicity(AliFMDDigit* digit, Float_t edep) const;
145   /** Calculate the physical coordinates psuedo-rapidity @f$ \eta@f$,
146       azimuthal angle @f$ \varphi@f$ of the strip corresponding to
147       the digit @a digit.   This is done by using the information
148       obtained, and previously cached by AliFMDGeometry, from the
149       TGeoManager. 
150       @param digit Digit.
151       @param eta   On return, psuedo-rapidity @f$ \eta@f$
152       @param phi   On return, azimuthal angle @f$ \varphi@f$ */
153   virtual void     PhysicalCoordinates(AliFMDDigit* digit, Float_t& eta, 
154                                        Float_t& phi) const;
155   
156   mutable TClonesArray* fMult;          // Cache of RecPoints
157   mutable Int_t         fNMult;         // Number of entries in fMult 
158   mutable TTree*        fTreeR;         // Output tree 
159   mutable Float_t       fCurrentVertex; // Z-coordinate of primary vertex
160   mutable AliESDFMD*    fESDObj;        // ESD output object
161   mutable Float_t       fNoiseFactor;   // Factor of noise to check
162   mutable Bool_t        fAngleCorrect;  // Whether to angle correct
163   AliESD*               fESD;           // ESD object(?)
164   
165 private:
166   /** Hide base classes unused function */
167   void Reconstruct(AliRawReader*, TTree*) const;
168   /** Hide base classes unused function */
169   void Reconstruct(AliRunLoader*) const;
170   /** Hide base classes unused function */
171   void Reconstruct(AliRunLoader*, AliRawReader*) const;
172   /** Hide base classes unused function */
173   void FillESD(AliRawReader*, TTree*, AliESD*) const;
174   /** Hide base classes unused function */
175   void FillESD(AliRunLoader*, AliESD*) const;
176   /** Hide base classes unused function */
177   void FillESD(AliRunLoader*, AliRawReader*, AliESD*) const;
178   
179   ClassDef(AliFMDReconstructor, 0)  // class for the FMD reconstruction
180 }; 
181 #endif
182 //____________________________________________________________________
183 //
184 // Local Variables:
185 //   mode: C++
186 // End:
187 //
188 // EOF
189 //