]>
Commit | Line | Data |
---|---|---|
0bd4b00f | 1 | // |
2 | // This class contains the secondary correction and the double hit | |
3 | // correction used in low-flux events. | |
4 | // | |
7984e5f7 | 5 | #ifndef ALIFMDCORRSECONDARYMAP_H |
6 | #define ALIFMDCORRSECONDARYMAP_H | |
ffca499d | 7 | /** |
8 | * @file AliFMDCorrSecondaryMap.h | |
9 | * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk> | |
10 | * @date Wed Mar 23 14:01:42 2011 | |
11 | * | |
12 | * @brief | |
13 | * | |
bd6f5206 | 14 | * @ingroup pwglf_forward_corr |
ffca499d | 15 | * |
16 | */ | |
0bd4b00f | 17 | #include <TObject.h> |
18 | #include <TObjArray.h> | |
19 | #include <TAxis.h> | |
20 | class TH2D; | |
21 | ||
22 | /** | |
23 | * This class contains the secondary correction. | |
24 | * | |
25 | * The secondary correction is given by | |
26 | * @f[ | |
27 | * c_{r,v}(\eta,\varphi) = | |
28 | * \frac{\sum_i N_{ch,i,v,\mbox{primary}}(\eta,\varphi)}{ | |
29 | * \sum_i N_{ch,i,r,v,\mbox{FMD}}(\eta,\varphi)} | |
30 | * @f] | |
31 | * where @f$N_{ch,i,v,\mbox{primary}}(\eta,\varphi)@f$ is the | |
32 | * is the number of primary charged particles that fall within | |
33 | * the @f$(\eta,\varphi)@f$ bin in event @f$i@f$ with vertex @f$v@f$, | |
34 | * and is the total (primary <i>and</i> secondary) charged particles | |
35 | * that hit ring @f$r@f$ within @f$(\eta,\varphi)@f$ bin in event | |
36 | * @f$i@f$ with vertex @f$v@f$. | |
37 | * | |
38 | * These are generated from Monte-Carlo truth information. | |
39 | * | |
bd6f5206 | 40 | * @ingroup pwglf_forward_corr |
0bd4b00f | 41 | */ |
42 | class AliFMDCorrSecondaryMap : public TObject | |
43 | { | |
44 | public: | |
45 | /** | |
46 | * Default constructor | |
47 | */ | |
48 | AliFMDCorrSecondaryMap(); | |
49 | /** | |
50 | * Copy constructor | |
51 | * | |
52 | * @param o Object to copy from | |
53 | */ | |
54 | AliFMDCorrSecondaryMap(const AliFMDCorrSecondaryMap& o); | |
55 | /** | |
56 | * Destructor | |
57 | * | |
58 | */ | |
59 | virtual ~AliFMDCorrSecondaryMap(); | |
60 | /** | |
61 | * @{ | |
62 | * @name Get corrections and parameters | |
63 | */ | |
64 | /** | |
65 | * Assignment operator | |
66 | * | |
67 | * @param o Object to assign from | |
68 | * | |
69 | * @return Reference to this object | |
70 | */ | |
71 | AliFMDCorrSecondaryMap& operator=(const AliFMDCorrSecondaryMap& o); | |
72 | /** | |
73 | * Get the secondary correction @f$ c_{r,v}@f$ | |
74 | * | |
75 | * @param d Detector number (1-3) | |
76 | * @param r Ring identifier (I or O) | |
77 | * @param v Primary interaction point @f$z@f$ coordinate | |
78 | * | |
79 | * @return The correction @f$ c_{r,v}@f$ | |
80 | */ | |
81 | TH2D* GetCorrection(UShort_t d, Char_t r, Double_t v) const; | |
82 | /** | |
83 | * Get the secondary correction @f$ c_{r,v}@f$ | |
84 | * | |
85 | * @param d Detector number (1-3) | |
86 | * @param r Ring identifier (I or O) | |
87 | * @param b Bin corresponding to the primary interaction point | |
88 | * @f$z@f$ coordinate (1 based) | |
89 | * | |
90 | * @return The correction @f$ c_{r,v}@f$ | |
91 | */ | |
92 | TH2D* GetCorrection(UShort_t d, Char_t r, UShort_t b) const; | |
93 | /** | |
94 | * Get the vertex axis used | |
95 | * | |
96 | * @return vertex axis | |
97 | */ | |
98 | const TAxis& GetVertexAxis() const { return fVertexAxis; } | |
99 | /** | |
100 | * Get the eta axis used | |
101 | * | |
102 | * @return eta axis | |
103 | */ | |
104 | const TAxis& GetEtaAxis() const { return fEtaAxis; } | |
105 | /* @} */ | |
106 | ||
107 | /** | |
108 | * @{ | |
109 | * @name Set corrections and parameters | |
110 | */ | |
111 | /** | |
112 | * Set the secondary map correction @f$ c_{r,v}(\eta,\varphi)@f$. | |
113 | * Note, that the object takes ownership of the passed pointer. | |
114 | * | |
115 | * @param d Detector number (1-3) | |
116 | * @param r Ring identifier (I or O) | |
117 | * @param v Primary interaction point @f$z@f$ coordinate | |
118 | * @param h @f$ c_{r,v}(\eta,\varphi)@f$ | |
119 | * | |
120 | * @return true if operation succeeded | |
121 | */ | |
122 | Bool_t SetCorrection(UShort_t d, Char_t r, Double_t v, TH2D* h); | |
123 | /** | |
124 | * Set the secondary map correction @f$ c_{r,v}(\eta,\varphi)@f$ | |
125 | * Note, that the object takes ownership of the passed pointer. | |
126 | * | |
127 | * @param d Detector number (1-3) | |
128 | * @param r Ring identifier (I or O) | |
129 | * @param b Bin corresponding to the primary interaction point | |
130 | * @f$z@f$ coordinate (1 based) | |
131 | * @param h @f$ c_{r,v}(\eta,\varphi)@f$ | |
132 | * | |
133 | * @return true if operation succeeded | |
134 | */ | |
135 | Bool_t SetCorrection(UShort_t d, Char_t r, UShort_t b, TH2D* h); | |
136 | /** | |
137 | * Set the vertex axis to use | |
138 | * | |
139 | * @param axis Vertex axis | |
140 | */ | |
141 | void SetVertexAxis(const TAxis& axis); | |
142 | /** | |
143 | * Set the vertex axis to use | |
144 | * | |
7c1a1f1d | 145 | * @param nBins Number of bins |
146 | * @param min Minimum | |
147 | * @param max Maximum | |
148 | */ | |
0bd4b00f | 149 | void SetVertexAxis(Int_t nBins, Double_t min, Double_t max); |
150 | /** | |
151 | * Set the eta axis to use | |
152 | * | |
153 | * @param axis Eta axis | |
154 | */ | |
155 | void SetEtaAxis(const TAxis& axis); | |
156 | /** | |
157 | * Set the eta axis to use | |
158 | * | |
7c1a1f1d | 159 | * @param nBins Number of bins |
160 | * @param min Minimum | |
161 | * @param max Maximum | |
0bd4b00f | 162 | */ |
163 | void SetEtaAxis(Int_t nBins, Double_t min, Double_t max); | |
164 | /* @} */ | |
165 | ||
166 | /** | |
167 | * @{ | |
168 | * @name Auxiliary member functions | |
169 | */ | |
170 | /** | |
171 | * Declare this as a folder | |
172 | * | |
173 | * @return Always true | |
174 | */ | |
175 | Bool_t IsFolder() const { return true; } | |
176 | /** | |
177 | * Browse this object in the browser | |
178 | * | |
179 | * @param b | |
180 | */ | |
181 | void Browse(TBrowser* b); | |
182 | /** | |
183 | * Print this object | |
184 | * | |
185 | * @param option | |
186 | */ | |
187 | void Print(Option_t* option="R") const; //*MENU* | |
188 | /* @} */ | |
189 | protected: | |
190 | /** | |
191 | * Find the vertex bin that corresponds to the passed vertex | |
192 | * | |
193 | * @param vertex The interaction points @f$z@f$-coordinate | |
194 | * | |
7c1a1f1d | 195 | * @return Vertex bin in @f$[1,N_{\mbox{vertex}}]@f$ or negative if |
0bd4b00f | 196 | * out of range |
197 | */ | |
198 | Int_t FindVertexBin(Double_t vertex) const; | |
199 | /** | |
200 | * Get the index corresponding to the given ring | |
201 | * | |
202 | * @param d Detector | |
203 | * @param r Ring | |
204 | * | |
205 | * @return Index (0 based) or negative in case of errors | |
206 | */ | |
207 | Int_t GetRingIndex(UShort_t d, Char_t r) const; | |
208 | /** | |
209 | * Get the ring array corresponding to the specified ring | |
210 | * | |
211 | * @param d Detector | |
212 | * @param r Ring | |
213 | * | |
214 | * @return Pointer to ring array, or null in case of problems | |
215 | */ | |
216 | TObjArray* GetRingArray(UShort_t d, Char_t r) const; | |
217 | /** | |
218 | * Get the ring array corresponding to the specified ring | |
219 | * | |
220 | * @param d Detector | |
221 | * @param r Ring | |
222 | * | |
223 | * @return Pointer to ring array, or newly created container | |
224 | */ | |
225 | TObjArray* GetOrMakeRingArray(UShort_t d, Char_t r); | |
226 | ||
227 | TObjArray fRingArray; // Array of per-ring, per-vertex 2nd map | |
228 | TAxis fVertexAxis; // The vertex axis | |
229 | TAxis fEtaAxis; // The eta axis | |
230 | ClassDef(AliFMDCorrSecondaryMap,1); // | |
231 | }; | |
232 | ||
233 | //____________________________________________________________________ | |
234 | inline void | |
235 | AliFMDCorrSecondaryMap::SetVertexAxis(Int_t nBins, Double_t min, Double_t max) | |
236 | { | |
237 | fVertexAxis.Set(nBins, min, max); | |
238 | } | |
239 | //____________________________________________________________________ | |
240 | inline void | |
241 | AliFMDCorrSecondaryMap::SetVertexAxis(const TAxis& e) | |
242 | { | |
243 | fVertexAxis.Set(e.GetNbins(), e.GetXmin(), e.GetXmax()); | |
244 | } | |
245 | //____________________________________________________________________ | |
246 | inline void | |
247 | AliFMDCorrSecondaryMap::SetEtaAxis(Int_t nBins, Double_t min, Double_t max) | |
248 | { | |
249 | fEtaAxis.Set(nBins, min, max); | |
250 | } | |
251 | //____________________________________________________________________ | |
252 | inline void | |
253 | AliFMDCorrSecondaryMap::SetEtaAxis(const TAxis& e) | |
254 | { | |
255 | fEtaAxis.Set(e.GetNbins(), e.GetXmin(), e.GetXmax()); | |
256 | } | |
257 | #endif | |
258 | // Local Variables: | |
259 | // mode: C++ | |
260 | // End: |