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