CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/CalibTracker/SiStripLorentzAngle/interface/SymmetryFit.h

Go to the documentation of this file.
00001 #ifndef CalibTracker_SiStripLorentzAngle_SymmetryFit                                                        
00002 #define CalibTracker_SiStripLorentzAngle_SymmetryFit           
00003 
00004 #include "TH1.h"
00005 #include "TF1.h"
00006 #include <string>
00007 
00008 class SymmetryFit {
00009 
00010  public:
00011   
00012   static TH1* symmetryChi2(std::string, const std::vector<TH1*>&, const std::pair<unsigned,unsigned>);
00013   static TH1* symmetryChi2(const TH1*, const std::pair<unsigned,unsigned>);
00014   static std::string name(std::string base) {return base+"_symmchi2";}
00015   static TF1* fitfunction();
00016   static std::vector<double> pol2_from_pol2(TH1* hist);
00017   static std::vector<double> pol2_from_pol3(TH1* hist);
00018   
00019  private:
00020 
00021   SymmetryFit(const TH1*, const std::pair<unsigned,unsigned>);
00022   std::pair<unsigned,unsigned> findUsableMinMax() const;
00023   std::vector<std::pair<unsigned,unsigned> > continuousRanges() const;
00024   float chi2_element(std::pair<unsigned,unsigned>);
00025   float chi2(std::pair<unsigned,unsigned>);
00026   void makeChi2Histogram();
00027   void fillchi2();
00028   int fit();
00029   SymmetryFit operator+=(const SymmetryFit& R) { ndf_+=R.ndf_; chi2_->Add(R.chi2_); return *this;}
00030 
00031   const TH1* symm_candidate_;
00032   const unsigned minDF_;
00033   const std::pair<unsigned,unsigned> range_,minmaxUsable_;
00034   unsigned ndf_;
00035   TH1* chi2_;
00036 
00037 };
00038 
00039 #endif