]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AliFMDCorrELossFit.h
Mega commit of many changes to PWGLFforward
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AliFMDCorrELossFit.h
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
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  * 
13  * @ingroup pwglf_forward_eloss
14  * 
15  */
16 #include <TObject.h>
17 #include <TAxis.h>
18 #include <TObjArray.h>
19 #include <TArrayI.h>
20 class TF1;
21 class TBrowser;
22
23 /** 
24  * @defgroup pwglf_forward_corr Corrections 
25  * 
26  * Correction objects used 
27  *
28  * @ingroup pwglf_forward
29  */
30 /** 
31  * Object holding the Energy loss fit 'correction'
32  * 
33  * These are generated from Monte-Carlo or real ESDs. 
34  *
35  * @ingroup pwglf_forward_corr
36  * @ingroup pwglf_forward_eloss
37  */
38 class AliFMDCorrELossFit : public TObject 
39 {
40 public:
41   /** 
42    * POD structure to hold data from fits 
43    * 
44    * @ingroup pwglf_forward_corr
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
68     mutable UShort_t fMaxWeight; //!Cached maximum weight
69
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      * 
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
92      * @param c         @f$ C@f$ - scale constant
93      * @param ec        @f$ \delta C@f$ - error on @f$ C@f$ 
94      * @param delta     @f$ \Delta@f$ - Most probable value               
95      * @param edelta    @f$ \delta\Delta@f$ - error on @f$\Delta@f$ 
96      * @param xi        @f$ \xi@f$ - width  
97      * @param exi       @f$ \delta\xi@f$ - error on @f$\xi@f$ 
98      * @param sigma     @f$ \sigma@f$ - Width of Gaussian                  
99      * @param esigma    @f$ \delta\sigma@f$ - error on @f$\sigma@f$ 
100      * @param sigman    @f$ \sigma_n@f$ - Noise width             
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$ 
104      * @param ea        Array of @f$ N-1@f$ error on the weights @f$ a_i@f$ for 
105      *                  @f$ i=2,\ldots@f$ 
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, 
114              const Double_t* a,const Double_t* ea);
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     /**
174      * @param i Which weight to get 
175      *
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     /**
204      * @param i Which weight to get 
205      *
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;
289     /* @} */
290     /** 
291      * @{
292      * @name TObject Sortable interface 
293      */
294     /** 
295      * Declare this object as sortable 
296      * 
297      * @return Always true 
298      */
299     Bool_t IsSortable() const { return kTRUE; }
300     /** 
301      * Compare to another ELossFit object. 
302      * 
303      * - +1, if this quality is better (larger) than other objects quality
304      * - -1, if this quality is worse (smaller) than other objects quality
305      * - +1, if this @f$|\chi^2/\nu-1|@f$ is smaller than the same for other
306      * - -1, if this @f$|\chi^2/\nu-1|@f$ is larger than the same for other
307      * - 0 otherwise 
308      * 
309      * @param o Other object to compare to 
310      *
311      * @return See above
312      */
313     Int_t Compare(const TObject* o) const;
314     /* @} */
315     /** 
316      * @{ 
317      * name Auxiliary member functions  
318      */
319     /** 
320      * Information to standard output 
321      * 
322      * @param option Not used 
323      */
324     void Print(Option_t* option) const; // *MENU*
325     /** 
326      * Draw this fit 
327      * 
328      * @param option Options 
329      *  - COMP  Draw components too 
330      */
331     void Draw(Option_t* option="comp"); // *MENU*
332     /** 
333      * Browse this object 
334      * 
335      * @param b Browser
336      */
337     void Browse(TBrowser* b);
338     /** 
339      * Get the name of this object 
340      * 
341      * 
342      * @return 
343      */
344     const Char_t* GetName() const;
345     /** 
346      * Calculate the lower bound 
347      * 
348      * @param f             Width factor
349      * @param includeSigma  Whether to include sigma
350      * 
351      * @return @f$ \Delta - f (\xi + \sigma)@f$
352      */
353     Double_t GetLowerBound(Double_t f, Bool_t includeSigma) const;
354     /** 
355      * Calculate the lower bound 
356      * 
357      * @param f             fraction of @f$\Delta@f$
358      * 
359      * @return @f$ f\Delta@f$
360      */
361     Double_t GetLowerBound(Double_t f) const;
362     /** 
363      * Calculate the quality 
364      * 
365      * @param maxChi2nu   Maximum reduced @f$\chi^2@f$
366      * @param maxRelError Maximum relative error 
367      * @param leastWeight Least weight to use 
368      */
369     void CalculateQuality(Double_t maxChi2nu=fgMaxChi2nu, 
370                           Double_t maxRelError=fgMaxRelError, 
371                           Double_t leastWeight=fgLeastWeight);
372     /* @} */
373     ClassDef(ELossFit,2); // Result of fit 
374   };
375
376   /** 
377    * Default constructor 
378    */
379   AliFMDCorrELossFit();
380   /** 
381    * Copy constructor 
382    * 
383    * @param o Object to copy from 
384    */
385   AliFMDCorrELossFit(const AliFMDCorrELossFit& o);
386   /** 
387    * Destructor 
388    */
389   virtual ~AliFMDCorrELossFit(); 
390   /** 
391    * Assignment operator 
392    * 
393    * @param o Object to assign from 
394    * 
395    * @return Reference to this object 
396    */
397   AliFMDCorrELossFit& operator=(const AliFMDCorrELossFit& o);
398
399   /** 
400    * @{ 
401    * @name Set fits 
402    */
403   /** 
404    * Set the fit parameters from a function 
405    * 
406    * @param d        Detector
407    * @param r        Ring 
408    * @param eta      Eta 
409    * @param quality  Quality flag
410    * @param f        Function from fit 
411    *
412    * @return true on success
413    */  
414   Bool_t SetFit(UShort_t d, Char_t r, Double_t eta, Int_t quality, 
415                 const TF1& f);
416   /** 
417    * Set the fit parameters from a function 
418    * 
419    * @param d    Detector
420    * @param r    Ring 
421    * @param eta  Eta 
422    * @param f    ELoss fit result - note, the object will take ownership
423    *
424    * @return true on success
425    */  
426   Bool_t SetFit(UShort_t d, Char_t r, Double_t eta, ELossFit* f);
427   /** 
428    * Set the fit parameters from a function 
429    * 
430    * @param d       Detector
431    * @param r       Ring 
432    * @param etaBin  Eta (bin number, 1->nBins)
433    * @param f       ELoss fit result - note, the object will take ownership
434    *
435    * @return true on success
436    */  
437   Bool_t SetFit(UShort_t d, Char_t r, Int_t etaBin, ELossFit* f);
438   /** 
439    * Set the fit parameters from a function 
440    * 
441    * @param d         Detector number
442    * @param r         Ring identifier 
443    * @param eta       Eta value
444    * @param quality   Quality flag
445    * @param n         @f$ N@f$ - Number of fitted peaks
446    * @param chi2      @f$ \chi^2 @f$
447    * @param nu        @f$ \nu @f$ - number degrees of freedom
448    * @param c         @f$ C@f$ - scale constant
449    * @param ec        @f$ \delta C@f$ - error on @f$ C@f$ 
450    * @param delta     @f$ \Delta@f$ - most probable value
451    * @param edelta    @f$ \delta\Delta@f$ - error on @f$\Delta@f$ 
452    * @param xi        @f$ \xi@f$ - Landau width           
453    * @param exi       @f$ \delta\xi@f$ - error on @f$\xi@f$ 
454    * @param sigma     @f$ \sigma@f$ - Gaussian width
455    * @param esigma    @f$ \delta\sigma@f$ - error on @f$\sigma@f$ 
456    * @param sigman    @f$ \sigma_n@f$ - Noise width               
457    * @param esigman   @f$ \delta\sigma_n@f$ - error on @f$\sigma_n@f$ 
458    * @param a         Array of @f$ N-1@f$ weights @f$ a_i@f$ for 
459    *                  @f$ i=2,\ldots@f$ 
460    * @param ea        Array of @f$ N-1@f$ errors on weights @f$ a_i@f$ for 
461    *                  @f$ i=2,\ldots@f$ 
462    *
463    * @return true on success
464    */
465   Bool_t SetFit(UShort_t  d,      Char_t    r, Double_t eta, 
466                 Int_t     quality,UShort_t  n, 
467                 Double_t  chi2,   UShort_t  nu, 
468                 Double_t  c,      Double_t  ec, 
469                 Double_t  delta,  Double_t  edelta, 
470                 Double_t  xi,     Double_t  exi,
471                 Double_t  sigma,  Double_t  esigma, 
472                 Double_t  sigman, Double_t  esigman, 
473                 Double_t* a,      Double_t* ea);
474   /* @} */
475   
476   /** 
477    * @{
478    * @name Set and get eta axis
479    */
480   /** 
481    * Set the eta axis to use 
482    * 
483    * @param axis Eta axis 
484    */
485   void SetEtaAxis(const TAxis& axis);
486   /** 
487    * Set the eta axis to use 
488    * 
489    * @param nBins Number of bins 
490    * @param min   Minimum @f$ \eta@f$
491    * @param max   maximum @f$ \eta@f$
492    */
493   void SetEtaAxis(Int_t nBins, Double_t min, Double_t max);
494   /** 
495    * Get the eta axis used
496    * 
497    * @return 
498    */
499   const TAxis& GetEtaAxis() const { return fEtaAxis; }
500   /** 
501    * Set the low cut used when fitting 
502    * 
503    * @param cut Cut value 
504    */
505   void SetLowCut(Double_t cut) { fLowCut = cut; }
506   /** 
507    * Get the low cut used when fitting 
508    * 
509    * @return Low cut used for fitting 
510    */
511   Double_t GetLowCut() const { return fLowCut; }
512   /** 
513    * Find the eta bin corresponding to the given eta 
514    * 
515    * @param eta  Eta value 
516    * 
517    * @return Bin (in @f$[1,N_{bins}]@f$) corresponding to the given
518    * eta, or 0 if out of range.
519    */
520   Int_t FindEtaBin(Double_t eta) const;
521   /* @} */
522
523   /**
524    * @{                                         
525    * @name Find fits 
526    */
527   /** 
528    * Find the fit corresponding to the specified parameters 
529    * 
530    * @param d      Detector 
531    * @param r      Ring 
532    * @param eta    Eta value 
533    * @param minQ   Minimum quality
534    * 
535    * @return Fit parameters or null in case of problems 
536    */
537   ELossFit* FindFit(UShort_t d, Char_t r, Double_t eta,
538                     UShort_t minQ) const;
539   /** 
540    * Find the fit corresponding to the specified parameters 
541    * 
542    * @param d      Detector 
543    * @param r      Ring 
544    * @param etabin Eta bin (1 based)
545    * @param minQ   Minimum quality
546    * 
547    * @return Fit parameters or null in case of problems 
548    */
549   ELossFit* FindFit(UShort_t d, Char_t r, Int_t etabin,
550                     UShort_t minQ) const;
551   /** 
552    * Find the fit corresponding to the specified parameters 
553    * 
554    * @param d   Detector 
555    * @param r   Ring 
556    * @param eta Eta value 
557    * 
558    * @return Fit parameters or null in case of problems 
559    */
560   ELossFit* GetFit(UShort_t d, Char_t r, Double_t eta) const;
561   /** 
562    * Find the fit corresponding to the specified parameters 
563    * 
564    * @param d      Detector 
565    * @param r      Ring 
566    * @param etabin Eta bin (1 based)
567    * 
568    * @return Fit parameters or null in case of problems 
569    */
570   ELossFit* GetFit(UShort_t d, Char_t r, Int_t etabin) const;
571   /* @} */
572
573   /** 
574    * @{ 
575    * @name Lower bounds on fits 
576    */
577   /** 
578    * Get the lower validity bound of the fit
579    * 
580    * @param d            Detector
581    * @param r            Ring
582    * @param etaBin       Eta bin (1-based)
583    * @param f            Fraction of @f$\Delta_{mp}@f$
584    * 
585    * @return @f$ f\Delta_{mp}@f$ 
586    */
587   Double_t GetLowerBound(UShort_t d, Char_t r, Int_t etaBin, 
588                          Double_t f) const;
589   /** 
590    * Get the lower validity bound of the fit
591    * 
592    * @param d            Detector
593    * @param r            Ring
594    * @param eta          Eta value
595    * @param f            Fraction of @f$\Delta_{mp}@f$
596    * 
597    * @return @f$ f\Delta_{mp}@f$ 
598    */
599   Double_t GetLowerBound(UShort_t d, Char_t r, Double_t eta, 
600                          Double_t f) const;
601   /** 
602    * Get the lower validity bound of the fit
603    * 
604    * @param d            Detector
605    * @param r            Ring
606    * @param etaBin       Eta bin (1-based)
607    * @param f            Factor on xi (and sigma)
608    * @param showErrors   Show errors
609    * @param includeSigma Whether to include sigma 
610    * 
611    * @return @f$ \Delta_{mp} - f(\xi+\sigma)@f$ 
612    */
613   Double_t GetLowerBound(UShort_t d, Char_t r, Int_t etaBin, 
614                          Double_t f, Bool_t showErrors,
615                          Bool_t includeSigma) const;
616   /** 
617    * Get the lower validity bound of the fit
618    * 
619    * @param d            Detector
620    * @param r            Ring
621    * @param eta          Eta value
622    * @param f            Factor on xi (and sigma)
623    * @param showErrors   Show errors
624    * @param includeSigma Whether to include sigma 
625    * 
626    * @return @f$ \Delta_{mp} - f(\xi+\sigma)@f$ 
627    */
628   Double_t GetLowerBound(UShort_t d, Char_t r, Double_t eta, 
629                          Double_t f, Bool_t showErrors,
630                          Bool_t includeSigma) const;
631
632   
633   /**                                           
634    * @{ 
635    * @name Miscellaneous
636    */
637   void CacheBins(UShort_t minQuality) const;
638   /** 
639    * Get the ring array corresponding to the specified ring
640    * 
641    * @param d Detector 
642    * @param r Ring 
643    * 
644    * @return Pointer to ring array, or null in case of problems
645    */
646   TObjArray* GetRingArray(UShort_t d, Char_t r) const;
647   /** 
648    * Signal that this is a folder
649    * 
650    * @return Always true 
651    */
652   Bool_t IsFolder() const { return true; }
653   /** 
654    * Browse this object 
655    * 
656    * @param b 
657    */
658   void Browse(TBrowser* b);
659   /** 
660    * Draw this object 
661    *
662    * @param option Options.  Possible values are 
663    *  - error Plot error bars 
664    *  - relative Plot relative errors
665    */
666   void Draw(Option_t* option=""); //*MENU*
667   /** 
668    * Print this object.  
669    * 
670    * @param option Options 
671    *   - R   Print recursive  
672    *
673    */
674   void Print(Option_t* option="R") const; //*MENU*
675   /** 
676    * Get a list of THStack - one for each parameter 
677    * 
678    * @param err  Show errors
679    * @param rel  Show relative errors 
680    * @param good Only show good fits
681    * @param maxN Maximum weight to use 
682    * 
683    * @return List of THStack
684    */
685   TList* GetStacks(Bool_t err, Bool_t rel, Bool_t good, UShort_t maxN=5) const;
686   /* @} */
687 protected:
688   /** 
689    * Get the ring array corresponding to the specified ring
690    * 
691    * @param d Detector 
692    * @param r Ring 
693    * 
694    * @return Pointer to ring array, or newly created container 
695    */
696   TObjArray* GetOrMakeRingArray(UShort_t d, Char_t r);
697
698   TObjArray  fRings;    // Array of rings
699   TAxis      fEtaAxis;  // Eta axis used
700   Double_t   fLowCut;   // Low cut used when fitting 
701   mutable TArrayI    fCache;
702
703   ClassDef(AliFMDCorrELossFit,3); 
704 };
705
706 //____________________________________________________________________
707 inline void 
708 AliFMDCorrELossFit::SetEtaAxis(Int_t nBins, Double_t min, Double_t max)
709 {
710   fEtaAxis.Set(nBins, min, max);
711 }
712 //____________________________________________________________________
713 inline void 
714 AliFMDCorrELossFit::SetEtaAxis(const TAxis& e)
715 {
716   fEtaAxis.Set(e.GetNbins(), e.GetXmin(), e.GetXmax());
717 }
718 //____________________________________________________________________
719 inline Double_t
720 AliFMDCorrELossFit::ELossFit::GetA(UShort_t i) const
721 {
722   if (i <  1)   return 0;
723   if (i >  fN)  return 0;
724   if (i == 1)   return 1;
725   return fA[i-2];
726 }
727 //____________________________________________________________________
728 inline Double_t
729 AliFMDCorrELossFit::ELossFit::GetEA(UShort_t i) const
730 {
731   if (i <  1)   return 0;
732   if (i >  fN)  return 0;
733   if (i == 1)   return 1;
734   return fEA[i-2];
735 }
736
737
738 #endif
739 // Local Variables:
740 //   mode: C++ 
741 // End:
742