]>
Commit | Line | Data |
---|---|---|
7984e5f7 | 1 | // Object holding the Energy loss fit 'correction' |
2 | // | |
3 | // These are generated from Monte-Carlo or real ESDs. | |
4 | #ifndef ALIFMDCORRELOSSFIT_H | |
5 | #define ALIFMDCORRELOSSFIT_H | |
ffca499d | 6 | /** |
7 | * @file AliFMDCorrELossFit.h | |
8 | * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk> | |
9 | * @date Wed Mar 23 14:01:15 2011 | |
10 | * | |
11 | * @brief | |
12 | * | |
bd6f5206 | 13 | * @ingroup pwglf_forward_eloss |
ffca499d | 14 | * |
15 | */ | |
0bd4b00f | 16 | #include <TObject.h> |
17 | #include <TAxis.h> | |
18 | #include <TObjArray.h> | |
8449e3e0 | 19 | #include <TArrayI.h> |
0bd4b00f | 20 | class TF1; |
21 | class TBrowser; | |
22 | ||
7c1a1f1d | 23 | /** |
bd6f5206 | 24 | * @defgroup pwglf_forward_corr Corrections |
7c1a1f1d | 25 | * |
290052e7 | 26 | * Correction objects used |
27 | * | |
bd6f5206 | 28 | * @ingroup pwglf_forward |
7c1a1f1d | 29 | */ |
0bd4b00f | 30 | /** |
31 | * Object holding the Energy loss fit 'correction' | |
32 | * | |
33 | * These are generated from Monte-Carlo or real ESDs. | |
34 | * | |
bd6f5206 | 35 | * @ingroup pwglf_forward_corr |
36 | * @ingroup pwglf_forward_eloss | |
0bd4b00f | 37 | */ |
38 | class AliFMDCorrELossFit : public TObject | |
39 | { | |
40 | public: | |
41 | /** | |
42 | * POD structure to hold data from fits | |
43 | * | |
bd6f5206 | 44 | * @ingroup pwglf_forward_corr |
0bd4b00f | 45 | */ |
46 | struct ELossFit : public TObject | |
47 | { | |
48 | Int_t fN; // Number of peaks fitted | |
49 | UShort_t fNu; // Number degrees of freedom | |
50 | Double_t fChi2; // Chi square from fit | |
51 | Double_t fC; // Scaling constant | |
52 | Double_t fDelta; // Most probable value | |
53 | Double_t fXi; // Width parameter of Landau | |
54 | Double_t fSigma; // Sigma on folded gaussian | |
55 | Double_t fSigmaN; // Sigma of detector noise | |
56 | Double_t* fA; // [fN] Weights | |
57 | Double_t fEC; // Error on C | |
58 | Double_t fEDelta; // Error on Delta | |
59 | Double_t fEXi; // Error on Xi | |
60 | Double_t fESigma; // Error on sigma | |
61 | Double_t fESigmaN;// Error on sigma (noise) | |
62 | Double_t* fEA; // [fN] Error on weights | |
63 | Int_t fQuality;// Assigned quality | |
64 | UShort_t fDet; // Detector | |
65 | Char_t fRing; // Ring | |
66 | UShort_t fBin; // Eta bin | |
67 | ||
8449e3e0 | 68 | mutable UShort_t fMaxWeight; //!Cached maximum weight |
69 | ||
0bd4b00f | 70 | static Double_t fgMaxRelError; // Global default max relative error |
71 | static Double_t fgLeastWeight; // Global default least weight | |
72 | static Double_t fgMaxChi2nu; // Global default maximum reduced chi^2 | |
73 | /** | |
74 | * Default constructor | |
75 | * | |
76 | */ | |
77 | ELossFit(); | |
78 | /** | |
79 | * Construct from a function | |
80 | * | |
81 | * @param quality Quality flag | |
82 | * @param f Function | |
83 | */ | |
84 | ELossFit(Int_t quality,const TF1& f); | |
85 | /** | |
86 | * Constructor with full parameter set | |
87 | * | |
0bd4b00f | 88 | * @param quality Quality flag |
89 | * @param n @f$ N@f$ - Number of fitted peaks | |
90 | * @param chi2 @f$ \chi^2 @f$ | |
91 | * @param nu @f$ \nu @f$ - number degrees of freedom | |
7c1a1f1d | 92 | * @param c @f$ C@f$ - scale constant |
0bd4b00f | 93 | * @param ec @f$ \delta C@f$ - error on @f$ C@f$ |
7c1a1f1d | 94 | * @param delta @f$ \Delta@f$ - Most probable value |
0bd4b00f | 95 | * @param edelta @f$ \delta\Delta@f$ - error on @f$\Delta@f$ |
7c1a1f1d | 96 | * @param xi @f$ \xi@f$ - width |
0bd4b00f | 97 | * @param exi @f$ \delta\xi@f$ - error on @f$\xi@f$ |
7c1a1f1d | 98 | * @param sigma @f$ \sigma@f$ - Width of Gaussian |
0bd4b00f | 99 | * @param esigma @f$ \delta\sigma@f$ - error on @f$\sigma@f$ |
7c1a1f1d | 100 | * @param sigman @f$ \sigma_n@f$ - Noise width |
0bd4b00f | 101 | * @param esigman @f$ \delta\sigma_n@f$ - error on @f$\sigma_n@f$ |
102 | * @param a Array of @f$ N-1@f$ weights @f$ a_i@f$ for | |
103 | * @f$ i=2,\ldots@f$ | |
7c1a1f1d | 104 | * @param ea Array of @f$ N-1@f$ error on the weights @f$ a_i@f$ for |
105 | * @f$ i=2,\ldots@f$ | |
0bd4b00f | 106 | */ |
107 | ELossFit(Int_t quality,UShort_t n, | |
108 | Double_t chi2, UShort_t nu, | |
109 | Double_t c, Double_t ec, | |
110 | Double_t delta, Double_t edelta, | |
111 | Double_t xi, Double_t exi, | |
112 | Double_t sigma, Double_t esigma, | |
113 | Double_t sigman, Double_t esigman, | |
fb3430ac | 114 | const Double_t* a,const Double_t* ea); |
0bd4b00f | 115 | /** |
116 | * Copy constructor | |
117 | * | |
118 | * @param o Object to copy from | |
119 | */ | |
120 | ELossFit(const ELossFit& o); | |
121 | /** | |
122 | * Assignment operator | |
123 | * | |
124 | * @param o Object to assign from | |
125 | * | |
126 | * @return Reference to this object | |
127 | */ | |
128 | ELossFit& operator=(const ELossFit& o); | |
129 | /** | |
130 | * Destructor | |
131 | */ | |
132 | ~ELossFit(); | |
133 | /** | |
134 | * @{ | |
135 | * @name Access to parameters | |
136 | */ | |
137 | /** | |
138 | * @return Number of peaks fitted | |
139 | */ | |
140 | Int_t GetN() const { return fN; } | |
141 | /** | |
142 | * @return Number degrees of freedom | |
143 | */ | |
144 | UShort_t GetNu() const { return fNu; } | |
145 | /** | |
146 | * @return Chi square from fit | |
147 | */ | |
148 | Double_t GetChi2() const { return fChi2; } | |
149 | /** | |
150 | * @return Scaling constant | |
151 | */ | |
152 | Double_t GetC() const { return fC; } | |
153 | /** | |
154 | * @return Most probable value | |
155 | */ | |
156 | Double_t GetDelta() const { return fDelta; } | |
157 | /** | |
158 | * @return Width parameter of Landau | |
159 | */ | |
160 | Double_t GetXi() const { return fXi; } | |
161 | /** | |
162 | * @return Sigma on folded gaussian | |
163 | */ | |
164 | Double_t GetSigma() const { return fSigma; } | |
165 | /** | |
166 | * @return Sigma of detector noise | |
167 | */ | |
168 | Double_t GetSigmaN() const { return fSigmaN; } | |
169 | /** | |
170 | * @return Weights | |
171 | */ | |
172 | Double_t* GetAs() const { return fA; } | |
173 | /** | |
290052e7 | 174 | * @param i Which weight to get |
175 | * | |
0bd4b00f | 176 | * @return Weights |
177 | */ | |
178 | Double_t GetA(UShort_t i) const; | |
179 | /** | |
180 | * @return Error on C | |
181 | */ | |
182 | Double_t GetEC() const { return fEC; } | |
183 | /** | |
184 | * @return Error on Delta | |
185 | */ | |
186 | Double_t GetEDelta() const { return fEDelta; } | |
187 | /** | |
188 | * @return Error on Xi | |
189 | */ | |
190 | Double_t GetEXi() const { return fEXi; } | |
191 | /** | |
192 | * @return Error on sigma | |
193 | */ | |
194 | Double_t GetESigma() const { return fESigma; } | |
195 | /** | |
196 | * @return Error on sigma (noise) | |
197 | */ | |
198 | Double_t GetESigmaN() const { return fESigmaN; } | |
199 | /** | |
200 | * @return Error on weights | |
201 | */ | |
202 | Double_t* GetEAs() const { return fEA; } | |
203 | /** | |
290052e7 | 204 | * @param i Which weight to get |
205 | * | |
0bd4b00f | 206 | * @return Error on weights |
207 | */ | |
208 | Double_t GetEA(UShort_t i) const; | |
209 | /** | |
210 | * @return Assigned quality | |
211 | */ | |
212 | Int_t GetQuality() const { return fQuality; } | |
213 | /** | |
214 | * @return Detector | |
215 | */ | |
216 | UShort_t GetDet() const { return fDet; } | |
217 | /** | |
218 | * @return Ring | |
219 | */ | |
220 | Char_t GetRing() const { return fRing; } | |
221 | /** | |
222 | * @return Eta bin | |
223 | */ | |
224 | UShort_t GetBin() const { return fBin; } | |
225 | /* @} */ | |
226 | ||
227 | /** | |
228 | * @{ | |
229 | * @name Evaluation | |
230 | */ | |
231 | /** | |
232 | * Evaluate | |
233 | * @f[ | |
234 | * f_N(x;\Delta,\xi,\sigma') = | |
235 | * \sum_{i=1}^{n} a_i f(x;\Delta_i,\xi_i,\sigma_i') | |
236 | * @f] | |
237 | * | |
238 | * (see AliForwardUtil::NLandauGaus) for the maximum @f$ N @f$ | |
239 | * that fulfills the requirements | |
240 | * | |
241 | * @param x Where to evaluate | |
242 | * @param maxN @f$ \max{N}@f$ | |
243 | * | |
244 | * @return @f$ f_N(x;\Delta,\xi,\sigma')@f$ | |
245 | */ | |
246 | Double_t Evaluate(Double_t x, | |
247 | UShort_t maxN=999) const; | |
248 | /** | |
249 | * Evaluate | |
250 | * @f[ | |
251 | * f_W(x;\Delta,\xi,\sigma') = | |
252 | * \frac{\sum_{i=1}^{n} i a_i f_i(x;\Delta,\xi,\sigma')}{ | |
253 | * f_N(x;\Delta,\xi,\sigma')} = | |
254 | * \frac{\sum_{i=1}^{n} i a_i f(x;\Delta_i,\xi_i,\sigma_i')}{ | |
255 | * \sum_{i=1}^{n} a_i f(x;\Delta_i,\xi_i,\sigma_i')} | |
256 | * @f] | |
257 | * where @f$ n@f$ fulfills the requirements (see FindMaxWeight). | |
258 | * | |
259 | * If the denominator is zero, then 1 is returned. | |
260 | * | |
261 | * See also AliForwardUtil::ILandauGaus and AliForwardUtil::NLandauGaus | |
262 | * for more information on the evaluated functions. | |
263 | * | |
264 | * @param x Where to evaluate | |
265 | * @param maxN @f$ \max{N}@f$ | |
266 | * | |
267 | * @return @f$ f_W(x;\Delta,\xi,\sigma')@f$. | |
268 | */ | |
269 | Double_t EvaluateWeighted(Double_t x, | |
270 | UShort_t maxN=9999) const; | |
271 | /** | |
272 | * Find the maximum weight to use. The maximum weight is the | |
273 | * largest i for which | |
274 | * | |
275 | * - @f$ i \leq \max{N}@f$ | |
276 | * - @f$ a_i > \min{a}@f$ | |
277 | * - @f$ \delta a_i/a_i > \delta_{max}@f$ | |
278 | * | |
279 | * @param maxRelError @f$ \min{a}@f$ | |
280 | * @param leastWeight @f$ \delta_{max}@f$ | |
281 | * @param maxN @f$ \max{N}@f$ | |
282 | * | |
283 | * @return The largest index @f$ i@f$ for which the above | |
284 | * conditions hold. Will never return less than 1. | |
285 | */ | |
286 | Int_t FindMaxWeight(Double_t maxRelError=2*fgMaxRelError, | |
287 | Double_t leastWeight=fgLeastWeight, | |
288 | UShort_t maxN=999) const; | |
7095962e CHC |
289 | /** |
290 | * Get a function that expresses this fit. | |
291 | * | |
292 | * @f[ | |
293 | * f_N(x;\Delta,\xi,\sigma') = | |
294 | * \sum_{i=1}^{n} a_i f(x;\Delta_i,\xi_i,\sigma_i') | |
295 | * @f] | |
296 | * (see AliForwardUtil::NLandauGaus) or, if @a i is 1 or larger | |
297 | * @f[ | |
298 | * f_i(x;\Delta,\xi,\sigma') = a_i f(x;\Delta_i,\xi_i,\sigma_i') | |
299 | * @f] | |
300 | * (see AliForwardUtil::ILandauGaus). | |
301 | * | |
302 | * @param i Component to get. If @a i is 0 or less, then the full | |
303 | * function is returned, otherwise the specified component (if | |
304 | * valid). | |
305 | * @param max Upper bound on function | |
306 | * | |
307 | * @return Pointer to newly allocated function. The caller owns | |
308 | * this object, and must clean it up. | |
309 | */ | |
310 | TF1* GetF1(Int_t i=0, Double_t max=20) const; | |
311 | /** | |
312 | * Find the x value that corresponds to a (normalized) probability | |
313 | * of @a low or less. That is, we can use this to say: "Give me | |
314 | * the x value under which it is unlikely that a particle gave a | |
315 | * signal". | |
316 | * | |
317 | * @param low Threshold (between 0 and 1) | |
318 | * | |
319 | * @return Cut value, or 1000 in case of problems | |
320 | */ | |
321 | Double_t FindProbabilityCut(Double_t low) const; | |
0bd4b00f | 322 | /* @} */ |
323 | /** | |
324 | * @{ | |
325 | * @name TObject Sortable interface | |
326 | */ | |
327 | /** | |
328 | * Declare this object as sortable | |
329 | * | |
330 | * @return Always true | |
331 | */ | |
332 | Bool_t IsSortable() const { return kTRUE; } | |
333 | /** | |
334 | * Compare to another ELossFit object. | |
335 | * | |
336 | * - +1, if this quality is better (larger) than other objects quality | |
337 | * - -1, if this quality is worse (smaller) than other objects quality | |
338 | * - +1, if this @f$|\chi^2/\nu-1|@f$ is smaller than the same for other | |
339 | * - -1, if this @f$|\chi^2/\nu-1|@f$ is larger than the same for other | |
340 | * - 0 otherwise | |
341 | * | |
342 | * @param o Other object to compare to | |
290052e7 | 343 | * |
344 | * @return See above | |
0bd4b00f | 345 | */ |
346 | Int_t Compare(const TObject* o) const; | |
347 | /* @} */ | |
348 | /** | |
349 | * @{ | |
350 | * name Auxiliary member functions | |
351 | */ | |
352 | /** | |
353 | * Information to standard output | |
354 | * | |
355 | * @param option Not used | |
356 | */ | |
357 | void Print(Option_t* option) const; // *MENU* | |
358 | /** | |
359 | * Draw this fit | |
360 | * | |
361 | * @param option Options | |
362 | * - COMP Draw components too | |
363 | */ | |
364 | void Draw(Option_t* option="comp"); // *MENU* | |
365 | /** | |
366 | * Browse this object | |
367 | * | |
368 | * @param b Browser | |
369 | */ | |
370 | void Browse(TBrowser* b); | |
371 | /** | |
372 | * Get the name of this object | |
373 | * | |
374 | * | |
375 | * @return | |
376 | */ | |
377 | const Char_t* GetName() const; | |
5bb5d1f6 | 378 | /** |
379 | * Calculate the lower bound | |
380 | * | |
381 | * @param f Width factor | |
382 | * @param includeSigma Whether to include sigma | |
383 | * | |
384 | * @return @f$ \Delta - f (\xi + \sigma)@f$ | |
385 | */ | |
386 | Double_t GetLowerBound(Double_t f, Bool_t includeSigma) const; | |
16ac05a3 | 387 | /** |
388 | * Calculate the lower bound | |
389 | * | |
390 | * @param f fraction of @f$\Delta@f$ | |
391 | * | |
392 | * @return @f$ f\Delta@f$ | |
393 | */ | |
394 | Double_t GetLowerBound(Double_t f) const; | |
0bd4b00f | 395 | /** |
396 | * Calculate the quality | |
290052e7 | 397 | * |
398 | * @param maxChi2nu Maximum reduced @f$\chi^2@f$ | |
399 | * @param maxRelError Maximum relative error | |
400 | * @param leastWeight Least weight to use | |
0bd4b00f | 401 | */ |
402 | void CalculateQuality(Double_t maxChi2nu=fgMaxChi2nu, | |
403 | Double_t maxRelError=fgMaxRelError, | |
404 | Double_t leastWeight=fgLeastWeight); | |
405 | /* @} */ | |
8449e3e0 | 406 | ClassDef(ELossFit,2); // Result of fit |
0bd4b00f | 407 | }; |
408 | ||
409 | /** | |
410 | * Default constructor | |
411 | */ | |
412 | AliFMDCorrELossFit(); | |
413 | /** | |
414 | * Copy constructor | |
415 | * | |
416 | * @param o Object to copy from | |
417 | */ | |
418 | AliFMDCorrELossFit(const AliFMDCorrELossFit& o); | |
419 | /** | |
420 | * Destructor | |
421 | */ | |
422 | virtual ~AliFMDCorrELossFit(); | |
423 | /** | |
424 | * Assignment operator | |
425 | * | |
426 | * @param o Object to assign from | |
427 | * | |
428 | * @return Reference to this object | |
429 | */ | |
430 | AliFMDCorrELossFit& operator=(const AliFMDCorrELossFit& o); | |
431 | ||
432 | /** | |
433 | * @{ | |
434 | * @name Set fits | |
435 | */ | |
436 | /** | |
437 | * Set the fit parameters from a function | |
438 | * | |
439 | * @param d Detector | |
440 | * @param r Ring | |
441 | * @param eta Eta | |
442 | * @param quality Quality flag | |
443 | * @param f Function from fit | |
290052e7 | 444 | * |
445 | * @return true on success | |
0bd4b00f | 446 | */ |
447 | Bool_t SetFit(UShort_t d, Char_t r, Double_t eta, Int_t quality, | |
448 | const TF1& f); | |
449 | /** | |
450 | * Set the fit parameters from a function | |
451 | * | |
452 | * @param d Detector | |
453 | * @param r Ring | |
454 | * @param eta Eta | |
455 | * @param f ELoss fit result - note, the object will take ownership | |
290052e7 | 456 | * |
457 | * @return true on success | |
0bd4b00f | 458 | */ |
459 | Bool_t SetFit(UShort_t d, Char_t r, Double_t eta, ELossFit* f); | |
460 | /** | |
461 | * Set the fit parameters from a function | |
462 | * | |
7c1a1f1d | 463 | * @param d Detector |
464 | * @param r Ring | |
465 | * @param etaBin Eta (bin number, 1->nBins) | |
466 | * @param f ELoss fit result - note, the object will take ownership | |
290052e7 | 467 | * |
468 | * @return true on success | |
0bd4b00f | 469 | */ |
470 | Bool_t SetFit(UShort_t d, Char_t r, Int_t etaBin, ELossFit* f); | |
471 | /** | |
472 | * Set the fit parameters from a function | |
473 | * | |
474 | * @param d Detector number | |
475 | * @param r Ring identifier | |
7c1a1f1d | 476 | * @param eta Eta value |
0bd4b00f | 477 | * @param quality Quality flag |
478 | * @param n @f$ N@f$ - Number of fitted peaks | |
479 | * @param chi2 @f$ \chi^2 @f$ | |
480 | * @param nu @f$ \nu @f$ - number degrees of freedom | |
7c1a1f1d | 481 | * @param c @f$ C@f$ - scale constant |
0bd4b00f | 482 | * @param ec @f$ \delta C@f$ - error on @f$ C@f$ |
7c1a1f1d | 483 | * @param delta @f$ \Delta@f$ - most probable value |
0bd4b00f | 484 | * @param edelta @f$ \delta\Delta@f$ - error on @f$\Delta@f$ |
7c1a1f1d | 485 | * @param xi @f$ \xi@f$ - Landau width |
0bd4b00f | 486 | * @param exi @f$ \delta\xi@f$ - error on @f$\xi@f$ |
7c1a1f1d | 487 | * @param sigma @f$ \sigma@f$ - Gaussian width |
0bd4b00f | 488 | * @param esigma @f$ \delta\sigma@f$ - error on @f$\sigma@f$ |
7c1a1f1d | 489 | * @param sigman @f$ \sigma_n@f$ - Noise width |
0bd4b00f | 490 | * @param esigman @f$ \delta\sigma_n@f$ - error on @f$\sigma_n@f$ |
491 | * @param a Array of @f$ N-1@f$ weights @f$ a_i@f$ for | |
492 | * @f$ i=2,\ldots@f$ | |
7c1a1f1d | 493 | * @param ea Array of @f$ N-1@f$ errors on weights @f$ a_i@f$ for |
494 | * @f$ i=2,\ldots@f$ | |
290052e7 | 495 | * |
496 | * @return true on success | |
0bd4b00f | 497 | */ |
498 | Bool_t SetFit(UShort_t d, Char_t r, Double_t eta, | |
499 | Int_t quality,UShort_t n, | |
500 | Double_t chi2, UShort_t nu, | |
501 | Double_t c, Double_t ec, | |
502 | Double_t delta, Double_t edelta, | |
503 | Double_t xi, Double_t exi, | |
504 | Double_t sigma, Double_t esigma, | |
505 | Double_t sigman, Double_t esigman, | |
506 | Double_t* a, Double_t* ea); | |
507 | /* @} */ | |
508 | ||
509 | /** | |
510 | * @{ | |
511 | * @name Set and get eta axis | |
512 | */ | |
513 | /** | |
514 | * Set the eta axis to use | |
515 | * | |
516 | * @param axis Eta axis | |
517 | */ | |
518 | void SetEtaAxis(const TAxis& axis); | |
519 | /** | |
520 | * Set the eta axis to use | |
521 | * | |
7c1a1f1d | 522 | * @param nBins Number of bins |
523 | * @param min Minimum @f$ \eta@f$ | |
524 | * @param max maximum @f$ \eta@f$ | |
0bd4b00f | 525 | */ |
526 | void SetEtaAxis(Int_t nBins, Double_t min, Double_t max); | |
527 | /** | |
528 | * Get the eta axis used | |
529 | * | |
530 | * @return | |
531 | */ | |
532 | const TAxis& GetEtaAxis() const { return fEtaAxis; } | |
533 | /** | |
534 | * Set the low cut used when fitting | |
535 | * | |
536 | * @param cut Cut value | |
537 | */ | |
538 | void SetLowCut(Double_t cut) { fLowCut = cut; } | |
539 | /** | |
540 | * Get the low cut used when fitting | |
541 | * | |
542 | * @return Low cut used for fitting | |
543 | */ | |
544 | Double_t GetLowCut() const { return fLowCut; } | |
545 | /** | |
546 | * Find the eta bin corresponding to the given eta | |
547 | * | |
548 | * @param eta Eta value | |
549 | * | |
550 | * @return Bin (in @f$[1,N_{bins}]@f$) corresponding to the given | |
551 | * eta, or 0 if out of range. | |
552 | */ | |
553 | Int_t FindEtaBin(Double_t eta) const; | |
554 | /* @} */ | |
555 | ||
556 | /** | |
557 | * @{ | |
558 | * @name Find fits | |
559 | */ | |
560 | /** | |
561 | * Find the fit corresponding to the specified parameters | |
562 | * | |
8449e3e0 | 563 | * @param d Detector |
564 | * @param r Ring | |
565 | * @param eta Eta value | |
566 | * @param minQ Minimum quality | |
0bd4b00f | 567 | * |
568 | * @return Fit parameters or null in case of problems | |
569 | */ | |
8449e3e0 | 570 | ELossFit* FindFit(UShort_t d, Char_t r, Double_t eta, |
571 | UShort_t minQ) const; | |
0bd4b00f | 572 | /** |
573 | * Find the fit corresponding to the specified parameters | |
574 | * | |
575 | * @param d Detector | |
576 | * @param r Ring | |
577 | * @param etabin Eta bin (1 based) | |
8449e3e0 | 578 | * @param minQ Minimum quality |
0bd4b00f | 579 | * |
580 | * @return Fit parameters or null in case of problems | |
581 | */ | |
8449e3e0 | 582 | ELossFit* FindFit(UShort_t d, Char_t r, Int_t etabin, |
583 | UShort_t minQ) const; | |
1174780f | 584 | /** |
585 | * Find the fit corresponding to the specified parameters | |
586 | * | |
587 | * @param d Detector | |
588 | * @param r Ring | |
589 | * @param eta Eta value | |
590 | * | |
591 | * @return Fit parameters or null in case of problems | |
592 | */ | |
593 | ELossFit* GetFit(UShort_t d, Char_t r, Double_t eta) const; | |
594 | /** | |
595 | * Find the fit corresponding to the specified parameters | |
596 | * | |
597 | * @param d Detector | |
598 | * @param r Ring | |
599 | * @param etabin Eta bin (1 based) | |
600 | * | |
601 | * @return Fit parameters or null in case of problems | |
602 | */ | |
603 | ELossFit* GetFit(UShort_t d, Char_t r, Int_t etabin) const; | |
0bd4b00f | 604 | /* @} */ |
605 | ||
5bb5d1f6 | 606 | /** |
607 | * @{ | |
608 | * @name Lower bounds on fits | |
609 | */ | |
16ac05a3 | 610 | /** |
7095962e | 611 | * Get the lower validity bound of the fit. |
16ac05a3 | 612 | * |
613 | * @param d Detector | |
614 | * @param r Ring | |
615 | * @param etaBin Eta bin (1-based) | |
616 | * @param f Fraction of @f$\Delta_{mp}@f$ | |
617 | * | |
618 | * @return @f$ f\Delta_{mp}@f$ | |
619 | */ | |
620 | Double_t GetLowerBound(UShort_t d, Char_t r, Int_t etaBin, | |
621 | Double_t f) const; | |
622 | /** | |
7095962e | 623 | * Get the lower validity bound of the fit. |
16ac05a3 | 624 | * |
625 | * @param d Detector | |
626 | * @param r Ring | |
627 | * @param eta Eta value | |
628 | * @param f Fraction of @f$\Delta_{mp}@f$ | |
629 | * | |
630 | * @return @f$ f\Delta_{mp}@f$ | |
631 | */ | |
632 | Double_t GetLowerBound(UShort_t d, Char_t r, Double_t eta, | |
633 | Double_t f) const; | |
7095962e CHC |
634 | /** |
635 | * Get the lower validity bound of the fit. | |
636 | * | |
637 | * @param d Detector | |
638 | * @param r Ring | |
639 | * @param etaBin Eta bin (1-based) | |
640 | * @param p Probability cut | |
641 | * @param dummy Not used | |
642 | * | |
643 | * @return @f$ x@f$ for which @f$ P(x>p)@f$ | |
644 | */ | |
645 | Double_t GetLowerBound(UShort_t d, Char_t r, Int_t etaBin, | |
646 | Double_t p, Bool_t dummy) const; | |
647 | /** | |
648 | * Get the lower validity bound of the fit. | |
649 | * | |
650 | * @param d Detector | |
651 | * @param r Ring | |
652 | * @param eta Eta value | |
653 | * @param p Probability cut | |
654 | * @param dummy Not used | |
655 | * | |
656 | * @return @f$ x@f$ for which @f$ P(x>p)@f$ | |
657 | */ | |
658 | Double_t GetLowerBound(UShort_t d, Char_t r, Double_t eta, | |
659 | Double_t p, Bool_t dummy) const; | |
5bb5d1f6 | 660 | /** |
661 | * Get the lower validity bound of the fit | |
662 | * | |
663 | * @param d Detector | |
664 | * @param r Ring | |
665 | * @param etaBin Eta bin (1-based) | |
666 | * @param f Factor on xi (and sigma) | |
667 | * @param showErrors Show errors | |
668 | * @param includeSigma Whether to include sigma | |
669 | * | |
670 | * @return @f$ \Delta_{mp} - f(\xi+\sigma)@f$ | |
671 | */ | |
672 | Double_t GetLowerBound(UShort_t d, Char_t r, Int_t etaBin, | |
16ac05a3 | 673 | Double_t f, Bool_t showErrors, |
674 | Bool_t includeSigma) const; | |
5bb5d1f6 | 675 | /** |
676 | * Get the lower validity bound of the fit | |
677 | * | |
678 | * @param d Detector | |
679 | * @param r Ring | |
680 | * @param eta Eta value | |
681 | * @param f Factor on xi (and sigma) | |
682 | * @param showErrors Show errors | |
683 | * @param includeSigma Whether to include sigma | |
684 | * | |
685 | * @return @f$ \Delta_{mp} - f(\xi+\sigma)@f$ | |
686 | */ | |
687 | Double_t GetLowerBound(UShort_t d, Char_t r, Double_t eta, | |
16ac05a3 | 688 | Double_t f, Bool_t showErrors, |
689 | Bool_t includeSigma) const; | |
7095962e | 690 | /* @} */ |
5bb5d1f6 | 691 | |
0bd4b00f | 692 | /** |
693 | * @{ | |
694 | * @name Miscellaneous | |
695 | */ | |
8449e3e0 | 696 | void CacheBins(UShort_t minQuality) const; |
0bd4b00f | 697 | /** |
698 | * Get the ring array corresponding to the specified ring | |
699 | * | |
700 | * @param d Detector | |
701 | * @param r Ring | |
702 | * | |
703 | * @return Pointer to ring array, or null in case of problems | |
704 | */ | |
705 | TObjArray* GetRingArray(UShort_t d, Char_t r) const; | |
706 | /** | |
707 | * Signal that this is a folder | |
708 | * | |
709 | * @return Always true | |
710 | */ | |
711 | Bool_t IsFolder() const { return true; } | |
712 | /** | |
713 | * Browse this object | |
714 | * | |
715 | * @param b | |
716 | */ | |
717 | void Browse(TBrowser* b); | |
718 | /** | |
719 | * Draw this object | |
720 | * | |
721 | * @param option Options. Possible values are | |
7dacdf84 | 722 | * - error Plot error bars |
723 | * - relative Plot relative errors | |
0bd4b00f | 724 | */ |
725 | void Draw(Option_t* option=""); //*MENU* | |
726 | /** | |
727 | * Print this object. | |
728 | * | |
729 | * @param option Options | |
730 | * - R Print recursive | |
731 | * | |
732 | */ | |
733 | void Print(Option_t* option="R") const; //*MENU* | |
c6115ede | 734 | /** |
735 | * Get a list of THStack - one for each parameter | |
736 | * | |
737 | * @param err Show errors | |
738 | * @param rel Show relative errors | |
8449e3e0 | 739 | * @param good Only show good fits |
c6115ede | 740 | * @param maxN Maximum weight to use |
741 | * | |
742 | * @return List of THStack | |
743 | */ | |
8449e3e0 | 744 | TList* GetStacks(Bool_t err, Bool_t rel, Bool_t good, UShort_t maxN=5) const; |
0bd4b00f | 745 | /* @} */ |
746 | protected: | |
747 | /** | |
748 | * Get the ring array corresponding to the specified ring | |
749 | * | |
750 | * @param d Detector | |
751 | * @param r Ring | |
752 | * | |
753 | * @return Pointer to ring array, or newly created container | |
754 | */ | |
755 | TObjArray* GetOrMakeRingArray(UShort_t d, Char_t r); | |
756 | ||
757 | TObjArray fRings; // Array of rings | |
758 | TAxis fEtaAxis; // Eta axis used | |
759 | Double_t fLowCut; // Low cut used when fitting | |
8449e3e0 | 760 | mutable TArrayI fCache; |
0bd4b00f | 761 | |
8449e3e0 | 762 | ClassDef(AliFMDCorrELossFit,3); |
0bd4b00f | 763 | }; |
764 | ||
765 | //____________________________________________________________________ | |
766 | inline void | |
767 | AliFMDCorrELossFit::SetEtaAxis(Int_t nBins, Double_t min, Double_t max) | |
768 | { | |
769 | fEtaAxis.Set(nBins, min, max); | |
770 | } | |
771 | //____________________________________________________________________ | |
772 | inline void | |
773 | AliFMDCorrELossFit::SetEtaAxis(const TAxis& e) | |
774 | { | |
775 | fEtaAxis.Set(e.GetNbins(), e.GetXmin(), e.GetXmax()); | |
776 | } | |
777 | //____________________________________________________________________ | |
778 | inline Double_t | |
779 | AliFMDCorrELossFit::ELossFit::GetA(UShort_t i) const | |
780 | { | |
781 | if (i < 1) return 0; | |
782 | if (i > fN) return 0; | |
783 | if (i == 1) return 1; | |
784 | return fA[i-2]; | |
785 | } | |
786 | //____________________________________________________________________ | |
787 | inline Double_t | |
788 | AliFMDCorrELossFit::ELossFit::GetEA(UShort_t i) const | |
789 | { | |
790 | if (i < 1) return 0; | |
791 | if (i > fN) return 0; | |
792 | if (i == 1) return 1; | |
793 | return fEA[i-2]; | |
794 | } | |
795 | ||
796 | ||
797 | #endif | |
798 | // Local Variables: | |
799 | // mode: C++ | |
800 | // End: | |
801 |