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