First V0 MC Analysis from H.Ricaud
[u/mrichter/AliRoot.git] / FMD / AliFMDReconstructor.h
CommitLineData
8f1cfb0c 1#ifndef ALIFMDRECONSTRUCTOR_H
2#define ALIFMDRECONSTRUCTOR_H
4347b38f 3//
4// Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights
5// reserved.
6//
121a60bd 7// See cxx source for full Copyright notice
4347b38f 8//
121a60bd 9// AliFMDReconstructor.h
4347b38f 10// Task Class for making TreeR for FMD
11//
121a60bd 12//-- Authors: Evgeny Karpechev (INR) and Alla Maevskaia (INR)
4347b38f 13// Latest changes by Christian Holm Christensen <cholm@nbi.dk>
121a60bd 14/* $Id$ */
c2fc1258 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*/
8f1cfb0c 20
42403906 21//____________________________________________________________________
0d0e6995 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
121a60bd 27
d76c31f4 28#include "AliLog.h"
29
4347b38f 30//____________________________________________________________________
1a1fdef7 31class TTree;
4347b38f 32class TClonesArray;
4347b38f 33class AliFMDDigit;
34class AliRawReader;
af885e0f 35class AliESDEvent;
8f6ee336 36class AliESDFMD;
9684be2f 37class TH1;
38
e802be3e 39
9f662337 40/** @defgroup FMD_rec Reconstruction */
4347b38f 41//____________________________________________________________________
c2fc1258 42/** @brief This is a class that reconstructs AliFMDRecPoint objects from of
43 Digits.
44 This class reads either digits from a TClonesArray or raw data
45 from a DDL file (or similar), and applies calibrations to get
9f662337 46 psuedo-inclusive multiplicities per strip.
c2fc1258 47
9f662337 48 @ingroup FMD_rec
49 */
121a60bd 50class AliFMDReconstructor: public AliReconstructor
51{
4347b38f 52public:
9f662337 53 /** CTOR */
4347b38f 54 AliFMDReconstructor();
9f662337 55 /** DTOR */
56b1929b 56 virtual ~AliFMDReconstructor();
4347b38f 57
9f662337 58 /** Initialize the reconstructor. Here, we initialize the geometry
59 manager, and finds the local to global transformations from the
60 geometry. The calibration parameter manager is also
61 initialized (meaning that the calibration parameters is read
f011bd38 62 from CDB).
9f662337 63 */
d76c31f4 64 virtual void Init();
9f662337 65 /** Flag that we can convert raw data into digits.
66 @return always @c true */
1a1fdef7 67 virtual Bool_t HasDigitConversion() const { return kTRUE; }
9f662337 68 /** Convert raw data read from the AliRawReader @a reader into
69 digits. This is done using AliFMDRawReader and
70 AliFMDAltroReader. The digits are put in the passed TTree @a
71 digitsTree.
72 @param reader Raw reader.
73 @param digitsTree Tree to store read digits in. */
1a1fdef7 74 virtual void ConvertDigits(AliRawReader* reader, TTree* digitsTree) const;
9f662337 75 /** Reconstruct one event from the digits passed in @a digitsTree.
76 The member function creates AliFMDRecPoint objects and stores
77 them on the output tree @a clusterTree. An FMD ESD object is
78 created in parallel.
79 @todo Make sure we get a vertex.
80 @param digitsTree Tree holding the digits of this event
81 @param clusterTree Tree to store AliFMDRecPoint objects in. */
1a1fdef7 82 virtual void Reconstruct(TTree* digitsTree, TTree* clusterTree) const;
ddaa8027 83 /** Not used */
84 virtual void Reconstruct(AliRawReader *, TTree*) const;
9f662337 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 */
1a1fdef7 92 virtual void FillESD(TTree* digitsTree, TTree* clusterTree,
af885e0f 93 AliESDEvent* esd) const;
ddaa8027 94 /** Forwards to above member function */
95 virtual void FillESD(AliRawReader*, TTree* clusterTree,
96 AliESDEvent* esd) const;
9f662337 97 /** Not used */
af885e0f 98 virtual void SetESD(AliESDEvent* esd) { fESD = esd; }
a9579262 99 /** Set the noise factor
100 @param f Factor to use */
101 virtual void SetNoiseFactor(Float_t f=3) { fNoiseFactor = f; }
102 /** Set whether we should do angle correction or nor
103 @param use If true, do angle correction */
104 virtual void SetAngleCorrect(Bool_t use=kTRUE) { fAngleCorrect = use; }
9684be2f 105 /** Set whether we want to do diagnostics. If this is enabled, a
106 file named @c FMD.Diag.root will be made. It contains a set of
107 histograms for each event, filed in separate directories in the
108 file. The histograms are
109 @verbatim
110 diagStep1 Read ADC vs. Noise surpressed ADC
111 diagStep2 Noise surpressed ADC vs. calculated Energy dep.
112 diagStep3 Energy deposition vs. angle corrected Energy dep.
113 diagStep4 Energy deposition vs. calculated multiplicity
114 diagAll Read ADC vs. calculated multiplicity
115 @endverbatim
116 @param use If true, make the diagnostics file */
117 void SetDiagnose(Bool_t use=kTRUE) { fDiagnostics = use; }
4347b38f 118protected:
0e73cae6 119 /** Copy CTOR
120 @param other Object to copy from. */
121 AliFMDReconstructor(const AliFMDReconstructor& other);
122 /** Assignment operator
123 @param other Object to assign from
124 @return reference to this object */
125 AliFMDReconstructor& operator=(const AliFMDReconstructor& other);
9684be2f 126 /** Try to get the vertex from either ESD or generator header. Sets
127 @c fCurrentVertex to the found Z posistion of the vertex (if
128 found), and sets the flag @c fVertexType accordingly */
129 virtual void GetVertex() const;
9f662337 130 /** Process AliFMDDigit objects in @a digits. For each digit, find
131 the psuedo-rapidity @f$ \eta@f$, azimuthal angle @f$ \varphi@f$,
132 energy deposited @f$ E@f$, and psuedo-inclusive multiplicity @f$
133 M@f$.
134 @param digits Array of digits. */
e802be3e 135 virtual void ProcessDigits(TClonesArray* digits) const;
9f662337 136 /** Substract pedestals from raw ADC in @a digit
137 @param digit Digit data
138 @return Pedestal subtracted ADC count. */
4347b38f 139 virtual UShort_t SubtractPedestal(AliFMDDigit* digit) const;
9f662337 140 /** Converts number of ADC counts to energy deposited. This is
141 done by
142 @f[
143 E_i = A_i g_i
144 @f]
145 where @f$ A_i@f$ is the pedestal subtracted ADC counts, and @f$
146 g_i@f$ is the gain for the @f$ i^{\mbox{th}}@f$ strip.
147 @param digit Raw data
148 @param eta Psuedo-rapidity of digit.
149 @param count Pedestal subtracted ADC counts
150 @return Energy deposited @f$ E_i@f$ */
8f6ee336 151 virtual Float_t Adc2Energy(AliFMDDigit* digit, Float_t eta,
152 UShort_t count) const;
9f662337 153 /** Converts an energy signal to number of particles. In this
154 implementation, it's done by
155 @f[
156 M_i = E_i / E_{\mbox{MIP}}
157 @f]
158 where @f$ E_i@f$ is the energy deposited, and @f$
159 E_{\mbox{MIP}}@f$ is the average energy deposited by a minimum
160 ionizing particle
161 @param digit Raw data
162 @param edep Energy deposited @f$ E_i@f$
163 @return Psuedo-inclusive multiplicity @f$ M@f$ */
8f6ee336 164 virtual Float_t Energy2Multiplicity(AliFMDDigit* digit, Float_t edep) const;
9f662337 165 /** Calculate the physical coordinates psuedo-rapidity @f$ \eta@f$,
166 azimuthal angle @f$ \varphi@f$ of the strip corresponding to
167 the digit @a digit. This is done by using the information
168 obtained, and previously cached by AliFMDGeometry, from the
169 TGeoManager.
170 @param digit Digit.
171 @param eta On return, psuedo-rapidity @f$ \eta@f$
172 @param phi On return, azimuthal angle @f$ \varphi@f$ */
8f6ee336 173 virtual void PhysicalCoordinates(AliFMDDigit* digit, Float_t& eta,
174 Float_t& phi) const;
42403906 175
9684be2f 176 enum Vertex_t {
177 kNoVertex, // Got no vertex
178 kGenVertex, // Got generator vertex
179 kESDVertex // Got ESD vertex
180 };
8f6ee336 181 mutable TClonesArray* fMult; // Cache of RecPoints
182 mutable Int_t fNMult; // Number of entries in fMult
183 mutable TTree* fTreeR; // Output tree
e802be3e 184 mutable Float_t fCurrentVertex; // Z-coordinate of primary vertex
8f6ee336 185 mutable AliESDFMD* fESDObj; // ESD output object
9684be2f 186 Float_t fNoiseFactor; // Factor of noise to check
187 Bool_t fAngleCorrect; // Whether to angle correct
188 mutable Vertex_t fVertexType; // What kind of vertex we got
af885e0f 189 AliESDEvent* fESD; // ESD object(?)
9684be2f 190 Bool_t fDiagnostics; // Wheter to do diagnostics
191 TH1* fDiagStep1; // Diagnostics histogram
192 TH1* fDiagStep2; // Diagnostics histogram
193 TH1* fDiagStep3; // Diagnostics histogram
194 TH1* fDiagStep4; // Diagnostics histogram
195 TH1* fDiagAll; // Diagnostics histogram
02a27b50 196private:
d76c31f4 197
198 ClassDef(AliFMDReconstructor, 3) // class for the FMD reconstruction
121a60bd 199};
200#endif
4347b38f 201//____________________________________________________________________
202//
0d0e6995 203// Local Variables:
204// mode: C++
205// End:
206//
4347b38f 207// EOF
208//