CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/CalibMuon/DTCalibration/interface/DTTimeBoxFitter.h

Go to the documentation of this file.
00001 #ifndef CalibMuon_DTTimeBoxFitter_H
00002 #define CalibMuon_DTTimeBoxFitter_H
00003 
00013 #include <utility>
00014 
00015 
00016 class TH1F;
00017 class TFile;
00018 #include "TString.h"
00019 
00020 class DTTimeBoxFitter {
00021 public:
00023   DTTimeBoxFitter(const TString& debugFileName = TString(""));
00024 
00026   virtual ~DTTimeBoxFitter();
00027 
00028   // Operations
00029 
00031   std::pair<double, double> fitTimeBox(TH1F *hTimeBox);
00032 
00033   
00035   void getFitSeeds(TH1F *hTBox, double& mean, double& sigma, double& tBoxMax, double& xFitMin,
00036                    double& xFitMax);
00037 
00039   void getInteractiveFitSeeds(TH1F *hTBox, double& mean, double& sigma, double& tBoxMax,
00040                               double& xFitMin, double& xFitMax);
00041 
00042 
00044   void setVerbosity(unsigned int lvl) {
00045     theVerbosityLevel = lvl;
00046   }
00047 
00049   void setInteractiveFit(bool isInteractive) {
00050     interactiveFit = isInteractive;
00051   }
00052 
00054   void setRebinning(int reb) {
00055     rebin = reb;
00056   }
00057 
00058   void setFitSigma(double sigma) {
00059     theSigma = sigma;
00060   }
00061 
00062 protected:
00063 
00064 private:
00065 
00066   TFile *hDebugFile;
00067 
00068   unsigned int theVerbosityLevel;
00069   bool interactiveFit;
00070   int rebin;
00071   double theSigma;
00072 
00073 };
00074 
00075 // Define the integral of the gaussian to be used in the fit
00076 double intGauss(double *x, double *par);
00077 
00078 #endif