MarlinTPC  1.2.0
HistogramWidthExtractionTools.h
1 /*
2  *
3  * Created on: September 30, 2013
4  * Author: amuennich
5  */
6 
7 #ifndef HISTOGRAMWIDTHEXTRACTIONTOOLS
8 #define HISTOGRAMWIDTHEXTRACTIONTOOLS
9 
10 #include "TH1.h"
11 
12 namespace marlintpc
13 {
23  {
24  public:
27 
30 
37  void Calculate(TH1* histogram, int method=1);
39  double GetWidth(){return _width;};
41  double GetWidthError(){return _width_err;};
43  double GetMean(){return _mean;};
45  double GetMeanError(){return _mean_err;};
47  double GetHeight(){return _height;};
49  double GetHeightError(){return _height_err;};
50 
52  std::pair<double, double> GetRange() { return _range; };
53 
54 
55  private:
56 
58  void CalculateRMS90(TH1* histogram);
59 
61  void Fit3SigmaRange(TH1* histogram);
62 
63  void FitLowerHalf3SigmaRange(TH1* histogram);
64 
66  void CalculateRMS5SigmaRange(TH1* histogram);
67 
69  double _width;
70  double _width_err;
71  double _mean;
72  double _mean_err;
73  double _height;
74  double _height_err;
75 
76  std::pair<double,double> _range;
77 
78 
79  };
80 
81 
82 }
83 #endif
A collection of tools to evaluate the width of a distribution in a histogram.
Definition: HistogramWidthExtractionTools.h:22
double GetMeanError()
Function giving back the error on the mean for the chosen method.
Definition: HistogramWidthExtractionTools.h:45
std::pair< double, double > GetRange()
Function giving back the range used in the method.
Definition: HistogramWidthExtractionTools.h:52
double GetWidthError()
Function giving back the error on the width for the chosen method.
Definition: HistogramWidthExtractionTools.h:41
HistogramWidthExtractionTools()
constructor
Definition: HistogramWidthExtractionTools.cc:12
double GetHeightError()
Function giving back the error on the height for the chosen method.
Definition: HistogramWidthExtractionTools.h:49
void Calculate(TH1 *histogram, int method=1)
Function to calculate width and mean and errors of the given histogram to be evaluated using the chos...
Definition: HistogramWidthExtractionTools.cc:20
double GetWidth()
Function giving back the width as a measure for the resolution for the chosen method.
Definition: HistogramWidthExtractionTools.h:39
double GetMean()
Function giving back the mean for the chosen method.
Definition: HistogramWidthExtractionTools.h:43
double GetHeight()
Function giving back the height for the chosen method.
Definition: HistogramWidthExtractionTools.h:47
virtual ~HistogramWidthExtractionTools()
destructor
Definition: HistogramWidthExtractionTools.cc:17