CMS 3D CMS Logo

SymmetryFit.h
Go to the documentation of this file.
1 #ifndef CalibTracker_SiStripLorentzAngle_SymmetryFit
2 #define CalibTracker_SiStripLorentzAngle_SymmetryFit
3 
4 #include "TH1.h"
5 #include "TF1.h"
6 #include <string>
7 
8 class SymmetryFit {
9 
10  public:
11 
12  static TH1* symmetryChi2(std::string, const std::vector<TH1*>&, const std::pair<unsigned,unsigned>);
13  static TH1* symmetryChi2(const TH1*, const std::pair<unsigned,unsigned>);
14  static std::string name(std::string base) {return base+"_symmchi2";}
15  static TF1* fitfunction();
16  static std::vector<double> pol2_from_pol2(TH1* hist);
17  static std::vector<double> pol2_from_pol3(TH1* hist);
18 
19  private:
20 
21  SymmetryFit(const TH1*, const std::pair<unsigned,unsigned>);
22  std::pair<unsigned,unsigned> findUsableMinMax() const;
23  std::vector<std::pair<unsigned,unsigned> > continuousRanges() const;
24  float chi2_element(std::pair<unsigned,unsigned>);
25  float chi2(std::pair<unsigned,unsigned>);
26  void makeChi2Histogram();
27  void fillchi2();
28  int fit();
29  SymmetryFit operator+=(const SymmetryFit& R) { ndf_+=R.ndf_; chi2_->Add(R.chi2_); return *this;}
30 
31  const TH1* symm_candidate_;
32  const unsigned minDF_;
33  const std::pair<unsigned,unsigned> range_,minmaxUsable_;
34  unsigned ndf_;
35  TH1* chi2_;
36 
37 };
38 
39 #endif
const std::pair< unsigned, unsigned > minmaxUsable_
Definition: SymmetryFit.h:33
SymmetryFit(const TH1 *, const std::pair< unsigned, unsigned >)
Definition: SymmetryFit.cc:33
static std::string name(std::string base)
Definition: SymmetryFit.h:14
std::pair< unsigned, unsigned > findUsableMinMax() const
Definition: SymmetryFit.cc:55
const std::pair< unsigned, unsigned > range_
Definition: SymmetryFit.h:33
static TH1 * symmetryChi2(std::string, const std::vector< TH1 * > &, const std::pair< unsigned, unsigned >)
Definition: SymmetryFit.cc:7
static std::vector< double > pol2_from_pol2(TH1 *hist)
Definition: SymmetryFit.cc:152
float chi2_element(std::pair< unsigned, unsigned >)
Definition: SymmetryFit.cc:113
TH1 * chi2_
Definition: SymmetryFit.h:35
unsigned ndf_
Definition: SymmetryFit.h:34
static std::vector< double > pol2_from_pol3(TH1 *hist)
Definition: SymmetryFit.cc:172
float chi2(std::pair< unsigned, unsigned >)
Definition: SymmetryFit.cc:99
static TF1 * fitfunction()
Definition: SymmetryFit.cc:141
base
Make Sure CMSSW is Setup ##.
const TH1 * symm_candidate_
Definition: SymmetryFit.h:31
SymmetryFit operator+=(const SymmetryFit &R)
Definition: SymmetryFit.h:29
void fillchi2()
Definition: SymmetryFit.cc:89
std::vector< std::pair< unsigned, unsigned > > continuousRanges() const
Definition: SymmetryFit.cc:73
const unsigned minDF_
Definition: SymmetryFit.h:32
void makeChi2Histogram()
Definition: SymmetryFit.cc:45