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