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

Last change on this file since 14942 was 14814, checked in by Jens Buss, 12 years ago
new construktor is pulse order, new calculation of phe
  • Property svn:executable set to *
File size: 3.7 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(TString fitName, TString fitOptions, int type );
80 void Fit(TString fitName, TString fitOptions, int type, int fitMin, int fitMax);
81
82private:
83 void FitSectionWise(TString fitName, TString fitOptions, int fitMin, int fitMax);
84 void FitContious(TString fitName, TString fitOptions, int fitMin, int fitMax);
85 void CalculateParameters();
86 double CalculateHistEdgeRisetime();
87 void InitMembers();
88
89// ACCESS
90public:
91 TString GetName();
92 double GetBsl();
93 double GetBslErr();
94 double GetHeight();
95 double GetHeightErr();
96 double GetT0();
97 double GetT0Err();
98 double GetT1();
99 double GetT1Err();
100 double GetTau1();
101 double GetTau1Err();
102 double GetTau2();
103 double GetTau2Err();
104 double GetIntegral();
105 double GetIntegralErr();
106 double GetAmplitude();
107 double GetAmplitudeErr();
108 int GetPhE();
109 int GetPhEErr();
110 int GetOrder();
111 int GetType();
112 int GetFitMin();
113 int GetFitMax();
114 double GetFitProb();
115 double GetFitNCalls();
116 double GetFitNdf();
117 double GetChi2();
118 double GetRiseTime();
119 double GetRiseTimeErr();
120 double GetTimeResolution();
121 void SetTimeResolution(double timeResolution);
122
123// INQUIRY
124private:
125 TString mName;
126 TH1* mHisto;
127 TF1* mModel;
128 TString mOptions;
129 pair <double, double> mBsl;
130 pair <double, double> mHeight;
131 pair <double, double> mT0;
132 pair <double, double> mT1;
133 pair <double, double> mTau1;
134 pair <double, double> mTau2;
135 pair <double, double> mIntegral;
136 pair <double, double> mAmplitude;
137 pair <int, double> mPhE;
138 pair <double, double> mRisetime;
139 double mTimeResolution; // [ns/slice]
140 int mOrder;
141 int mType;
142 int mFitMin;
143 int mFitMax;
144 double mFitProb;
145 double mFitNCalls;
146 double mFitNdf;
147 double mChi2;
148
149 TFitResultPtr mFitResultPtr;
150};
151
152#endif // Pulse_H
Note: See TracBrowser for help on using the repository browser.