source: fact/tools/rootmacros/PulseTemplates/pulse.h@ 16858

Last change on this file since 16858 was 14946, checked in by Jens Buss, 12 years ago
added dynamic startvalue calculation
  • Property svn:executable set to *
File size: 3.8 KB
Line 
1#ifndef Pulse_H
2#define Pulse_H
3
4// SYSTEM INCLUDES
5#include <utility>
6//
7
8// PROJECT INCLUDES
9#include <TROOT.h>
10#include <TMath.h>
11#include <TProfile.h>
12#include <TH2F.h>
13#include <TH1I.h>
14#include <TH1F.h>
15#include <TF1.h>
16#include <TString.h>
17#include <TSystem.h>
18#include <TFitResult.h>
19//
20
21// LOCAL INCLUDES
22#include <parameter.h>
23//
24
25// FORWARD REFERENCES
26//
27
28/** Assignment operator.
29* @todo do me
30* @warning not implemented
31* @param from THe value to assign to this object.
32*
33* @return A reference to this object.
34*/
35
36/**
37*/
38// NON CLASS MATH FUNCTIONS
39int Heaviside(double val);
40double shapeFunc( double* t, double* par);
41double shapeFunc2( double* t, double* par);
42
43class Pulse
44{
45public:
46// LIFECYCLE
47
48 /** Default constructor.
49 */
50 Pulse( );
51 Pulse(TString name);
52 Pulse(TString name, TH1* histo );
53 Pulse(TString name, TH1* histo, int type);
54 Pulse(TString name, TH1* histo, TString options );
55 Pulse(TString name, TH1* histo, TString options, int type);
56 Pulse(TString name, TH1* histo, TString options, int type, int order);
57
58 // /** Copy constructor.
59 // *
60 // * @param from The value to copy to this object.
61 // */
62 /** Destructor.
63 */
64 ~Pulse();
65
66
67// OPERATORS
68
69// /** Assignment operator.
70// *
71// * @param from THe value to assign to this object.
72// *
73// * @return A reference to this object.
74// */
75// XX& operator=(const XX& from);
76
77// OPERATIONS
78// double shapeFunc( double* x, double* par);
79 void Fit();
80 void Fit(
81 TString fitOptions,
82 int type
83 );
84 void Fit(TString fitName, TString fitOptions, int type );
85 void Fit(TString fitName, TString fitOptions, int type, int fitMin, int fitMax);
86
87private:
88 void FitSectionWise(TString fitName, TString fitOptions, int fitMin, int fitMax);
89 void FitContious(TString fitName, TString fitOptions, int fitMin, int fitMax);
90 void CalculateParameters();
91 double CalculateHistEdgeRisetime();
92 void InitMembers();
93
94// ACCESS
95public:
96 TString GetName();
97 double GetBsl();
98 double GetBslErr();
99 double GetHeight();
100 double GetHeightErr();
101 double GetT0();
102 double GetT0Err();
103 double GetT1();
104 double GetT1Err();
105 double GetTau1();
106 double GetTau1Err();
107 double GetTau2();
108 double GetTau2Err();
109 double GetIntegral();
110 double GetIntegralErr();
111 double GetAmplitude();
112 double GetAmplitudeErr();
113 int GetPhE();
114 int GetPhEErr();
115 int GetOrder();
116 int GetType();
117 int GetFitMin();
118 int GetFitMax();
119 double GetFitProb();
120 double GetFitNCalls();
121 double GetFitNdf();
122 double GetChi2();
123 double GetRiseTime();
124 double GetRiseTimeErr();
125 double GetTimeResolution();
126 void SetTimeResolution(double timeResolution);
127 void SetVerbosity(int verbLvl);
128
129// INQUIRY
130private:
131 TString mName;
132 TH1* mHisto;
133 TF1* mModel;
134 TString mOptions;
135 pair <double, double> mBsl;
136 pair <double, double> mHeight;
137 pair <double, double> mT0;
138 pair <double, double> mT1;
139 pair <double, double> mTau1;
140 pair <double, double> mTau2;
141 pair <double, double> mIntegral;
142 pair <double, double> mAmplitude;
143 pair <int, double> mPhE;
144 pair <double, double> mRisetime;
145 double mTimeResolution; // [ns/slice]
146 int mOrder;
147 int mType;
148 int mFitMin;
149 int mFitMax;
150 double mFitProb;
151 double mFitNCalls;
152 double mFitNdf;
153 double mChi2;
154
155 TFitResultPtr mFitResultPtr;
156
157 int mVerbosityLvl;
158};
159
160#endif // Pulse_H
Note: See TracBrowser for help on using the repository browser.