]>
Commit | Line | Data |
---|---|---|
0b272b9b | 1 | #ifndef ALIPHOSFASTALTROFIT_H |
2 | #define ALIPHOSFASTALTROFIT_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | /* $Id: $ */ | |
6 | ||
7 | /* History of svn commits | |
8 | * $Log$ | |
9 | */ | |
10 | ||
11 | ||
12 | //_________________________________________________________________________ | |
13 | // Procedure of fast altro fitting | |
14 | // | |
15 | //*-- Author: Aleksei Pavlinov; IHEP, Protvino, Russia | |
16 | ||
17 | #include <TNamed.h> | |
18 | #include <TArrayD.h> | |
19 | // --- ROOT system --- | |
8d0626c1 | 20 | class TCanvas; |
21 | class TVirtualPad; | |
22 | class TF1; | |
23 | class TH1F; | |
24 | //class TLegend; | |
25 | //class TPaveStats; | |
0b272b9b | 26 | |
27 | class AliPHOSFastAltroFit : public TNamed { | |
28 | ||
29 | public: | |
30 | ||
31 | AliPHOSFastAltroFit(); | |
32 | AliPHOSFastAltroFit(const char* name, const char* title, const Double_t tau); | |
33 | virtual ~AliPHOSFastAltroFit(); | |
34 | ||
35 | void SetTau(const Double_t tau) {fTau = tau;} | |
36 | ||
8d0626c1 | 37 | void FastFit(TH1F* h, Double_t sig, Double_t tau, Double_t ped); |
0b272b9b | 38 | void FastFit(Int_t* t, Int_t* y, Int_t n, Double_t sig, Double_t tau, Double_t ped); |
8d0626c1 | 39 | void Reset(); |
0b272b9b | 40 | |
8d0626c1 | 41 | void GetFitResult(Double_t &, Double_t &eamp, Double_t &t0, Double_t &et0, |
42 | Double_t &chi2,Int_t &ndf); | |
0b272b9b | 43 | Double_t GetSig() const {return fSig;} |
44 | Double_t GetTau() const {return fTau;} | |
45 | Double_t GetN() const {return fN;} | |
8d0626c1 | 46 | Double_t GetPed() const {return fPed;} |
47 | ||
48 | Double_t GetEnergy() const {return fAmp;} | |
49 | Double_t GetAmp() const {return GetEnergy();} | |
0b272b9b | 50 | Double_t GetAmpErr() const {return fAmpErr;} |
8d0626c1 | 51 | Double_t GetTime() const {return fT0;} |
52 | Double_t GetT0() const {return GetTime();} | |
0b272b9b | 53 | Double_t GetT0Err() const {return fT0Err;} |
54 | Double_t GetChi2() const {return fChi2;} | |
8d0626c1 | 55 | Int_t GetNDF() const {return fNDF;} |
56 | Int_t GetNfit() const {return fNfit;} | |
57 | void GetFittedPoints(Int_t &nfit, Double_t* ar[2]); | |
0b272b9b | 58 | |
59 | static void DeductPedestal(Int_t* t, Int_t* y, Int_t n, Double_t ped, Double_t tau, | |
60 | Double_t* tn, Double_t* yn, Int_t &nn); | |
61 | static void FastFit(Double_t* t, Double_t* y, Int_t n, Double_t sig, Double_t tau, | |
62 | Double_t &, Double_t &eamp, Double_t &t0, Double_t &et0, Double_t &chi2); | |
63 | static Bool_t QuadraticRoots(Double_t a, Double_t b, Double_t c, Double_t &x1, Double_t &x2); | |
64 | static void Amplitude(Double_t* t, Double_t* y, Int_t n, Double_t sig, Double_t tau, | |
65 | Double_t t0, Double_t &, Double_t &chi2); | |
66 | static void CalculateParsErrors(Double_t* t, Double_t* y, Int_t n, Double_t sig, Double_t tau, | |
67 | Double_t &, Double_t &t0, Double_t &eamp, Double_t &et0); | |
68 | ||
8d0626c1 | 69 | // Drawing for QA |
70 | TCanvas* DrawFastFunction(); // *MENU* | |
71 | static Double_t StdResponseFunction(Double_t *x, Double_t *par); | |
72 | ||
73 | private: | |
74 | AliPHOSFastAltroFit(const AliPHOSFastAltroFit &obj); | |
75 | AliPHOSFastAltroFit& operator= (const AliPHOSFastAltroFit &obj); | |
76 | ||
77 | protected: | |
0b272b9b | 78 | Double_t fSig; |
79 | Double_t fTau; // filter time response | |
80 | Double_t fN; // order of function (equal 2) | |
8d0626c1 | 81 | Double_t fPed; // pedestal |
0b272b9b | 82 | |
83 | Double_t fAmp; | |
8d0626c1 | 84 | Double_t fAmpErr; |
0b272b9b | 85 | Double_t fT0; |
86 | Double_t fT0Err; | |
87 | Double_t fChi2; | |
88 | Int_t fNDF; | |
89 | ||
8d0626c1 | 90 | // Working variable |
91 | Int_t fNfit; //! number points for fit | |
92 | Double_t* fTfit; //! points for fit after selection | |
93 | Double_t* fAmpfit; //! | |
94 | // | |
95 | TF1* fStdFun; //! function for drawing | |
96 | ||
0b272b9b | 97 | ClassDef(AliPHOSFastAltroFit,1) // Class for fast altro fitting |
98 | }; | |
99 | ||
100 | #endif // ALIPHOSFASTALTROFIT_H |