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

Last change on this file since 14807 was 14762, checked in by Jens Buss, 12 years ago
risetime function
  • Property svn:executable set to *
File size: 3.6 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
57 // /** Copy constructor.
58 // *
59 // * @param from The value to copy to this object.
60 // */
61 /** Destructor.
62 */
63 ~Pulse();
64
65
66// OPERATORS
67
68// /** Assignment operator.
69// *
70// * @param from THe value to assign to this object.
71// *
72// * @return A reference to this object.
73// */
74// XX& operator=(const XX& from);
75
76// OPERATIONS
77// double shapeFunc( double* x, double* par);
78 void Fit(TString fitName, TString fitOptions, int type );
79 void Fit(TString fitName, TString fitOptions, int type, int fitMin, int fitMax);
80
81private:
82 void FitSectionWise(TString fitName, TString fitOptions, int fitMin, int fitMax);
83 void FitContious(TString fitName, TString fitOptions, int fitMin, int fitMax);
84 void CalculateParameters();
85 double CalculateHistEdgeRisetime();
86 void InitMembers();
87
88// ACCESS
89public:
90 TString GetName();
91 double GetBsl();
92 double GetBslErr();
93 double GetHeight();
94 double GetHeightErr();
95 double GetT0();
96 double GetT0Err();
97 double GetT1();
98 double GetT1Err();
99 double GetTau1();
100 double GetTau1Err();
101 double GetTau2();
102 double GetTau2Err();
103 double GetIntegral();
104 double GetIntegralErr();
105 double GetAmplitude();
106 double GetAmplitudeErr();
107 int GetPhE();
108 int GetPhEErr();
109 int GetOrder();
110 int GetType();
111 int GetFitMin();
112 int GetFitMax();
113 double GetFitProb();
114 double GetFitNCalls();
115 double GetFitNdf();
116 double GetChi2();
117 double GetRiseTime();
118 double GetRiseTimeErr();
119 double GetTimeResolution();
120 void SetTimeResolution(double timeResolution);
121
122// INQUIRY
123private:
124 TString mName;
125 TH1* mHisto;
126 TF1* mModel;
127 TString mOptions;
128 pair <double, double> mBsl;
129 pair <double, double> mHeight;
130 pair <double, double> mT0;
131 pair <double, double> mT1;
132 pair <double, double> mTau1;
133 pair <double, double> mTau2;
134 pair <double, double> mIntegral;
135 pair <double, double> mAmplitude;
136 pair <int, double> mPhE;
137 pair <double, double> mRisetime;
138 double mTimeResolution; // [ns/slice]
139 int mOrder;
140 int mType;
141 int mFitMin;
142 int mFitMax;
143 double mFitProb;
144 double mFitNCalls;
145 double mFitNdf;
146 double mChi2;
147
148 TFitResultPtr mFitResultPtr;
149};
150
151#endif // Pulse_H
Note: See TracBrowser for help on using the repository browser.