CMS 3D CMS Logo

DTTimeBoxFitter.h
Go to the documentation of this file.
1 #ifndef CalibMuon_DTTimeBoxFitter_H
2 #define CalibMuon_DTTimeBoxFitter_H
3 
11 #include <utility>
12 
13 
14 class TH1F;
15 class TFile;
16 #include "TString.h"
17 
19 public:
21  DTTimeBoxFitter(const TString& debugFileName = TString(""));
22 
24  virtual ~DTTimeBoxFitter();
25 
26  // Operations
27 
29  std::pair<double, double> fitTimeBox(TH1F *hTimeBox);
30 
31 
33  void getFitSeeds(TH1F *hTBox, double& mean, double& sigma, double& tBoxMax, double& xFitMin,
34  double& xFitMax);
35 
37  void getInteractiveFitSeeds(TH1F *hTBox, double& mean, double& sigma, double& tBoxMax,
38  double& xFitMin, double& xFitMax);
39 
40 
42  void setVerbosity(unsigned int lvl) {
43  theVerbosityLevel = lvl;
44  }
45 
47  void setInteractiveFit(bool isInteractive) {
48  interactiveFit = isInteractive;
49  }
50 
52  void setRebinning(int reb) {
53  rebin = reb;
54  }
55 
56  void setFitSigma(double sigma) {
57  theSigma = sigma;
58  }
59 
60 protected:
61 
62 private:
63 
64  TFile *hDebugFile;
65 
66  unsigned int theVerbosityLevel;
68  int rebin;
69  double theSigma;
70 
71 };
72 
73 // Define the integral of the gaussian to be used in the fit
74 double intGauss(double *x, double *par);
75 
76 #endif
double intGauss(double *x, double *par)
void setVerbosity(unsigned int lvl)
Set the verbosity of the output: 0 = silent, 1 = info, 2 = debug.
void setRebinning(int reb)
Set the rebin.
void setFitSigma(double sigma)
void getFitSeeds(TH1F *hTBox, double &mean, double &sigma, double &tBoxMax, double &xFitMin, double &xFitMax)
Automatically compute the seeds the range to be used for time box fit.
virtual ~DTTimeBoxFitter()
Destructor.
void getInteractiveFitSeeds(TH1F *hTBox, double &mean, double &sigma, double &tBoxMax, double &xFitMin, double &xFitMax)
Ask the user to provide the seeds.
DTTimeBoxFitter(const TString &debugFileName=TString(""))
Constructor.
unsigned int theVerbosityLevel
void setInteractiveFit(bool isInteractive)
Switch to interactive fit.
std::pair< double, double > fitTimeBox(TH1F *hTimeBox)
Fit the rising edge of the time box returning mean value and sigma (first and second respectively) ...