GausStepFitter.h
Go to the documentation of this file.
1 // GausStepFitter.h
2 
3 #ifndef GausStepFitter_H
4 #define GausStepFitter_H
5 
6 // David Adams
7 // December 2018
8 //
9 // Utility that fits a histogram with a Gaussian stating from specified
10 // position, width and fit window.
11 
12 #include <string>
13 class TH1;
14 
16 
17 public:
18 
19  using Name = std::string;
20  using Index = unsigned int;
21 
22  // Ctor.
23  // pos - starting position
24  // width - starting sigma
25  // xwin - us d to construct the fit range (pos-xwin, pos+xwin)
26  // fopt - Root fitting option.
27  GausStepFitter(double pos, double sigma, double height, Name fnam, Name fopt ="WWS");
28 
29  // Fit a histogram.
30  // Returns 0 for success.
31  // If successful, a gaus function is attahed to the histogram.
32  int fit(TH1* ph) const;
33 
34 private:
35 
36  double m_pos;
37  double m_sigma;
38  double m_height;
42 
43 };
44 
45 #endif
std::string string
Definition: nybbler.cc:12
GausStepFitter(double pos, double sigma, double height, Name fnam, Name fopt="WWS")
unsigned int Index
int fit(TH1 *ph) const
std::string Name