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