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 public:
10  static TH1* symmetryChi2(std::string, const std::vector<TH1*>&, const std::pair<unsigned, unsigned>);
11  static TH1* symmetryChi2(const TH1*, const std::pair<unsigned, unsigned>);
12  static std::string name(std::string base) { return base + "_symmchi2"; }
13  static TF1* fitfunction();
14  static std::vector<double> pol2_from_pol2(TH1* hist);
15  static std::vector<double> pol2_from_pol3(TH1* hist);
16 
17 private:
18  SymmetryFit(const TH1*, const std::pair<unsigned, unsigned>);
19  std::pair<unsigned, unsigned> findUsableMinMax() const;
20  std::vector<std::pair<unsigned, unsigned> > continuousRanges() const;
21  float chi2_element(std::pair<unsigned, unsigned>);
22  float chi2(std::pair<unsigned, unsigned>);
23  void makeChi2Histogram();
24  void fillchi2();
25  int fit();
27  ndf_ += R.ndf_;
28  chi2_->Add(R.chi2_);
29  return *this;
30  }
31 
32  const TH1* symm_candidate_;
33  const unsigned minDF_;
34  const std::pair<unsigned, unsigned> range_, minmaxUsable_;
35  unsigned ndf_;
36  TH1* chi2_;
37 };
38 
39 #endif
SymmetryFit(const TH1 *, const std::pair< unsigned, unsigned >)
Definition: SymmetryFit.cc:38
static std::string name(std::string base)
Definition: SymmetryFit.h:12
base
Main Program
Definition: newFWLiteAna.py:92
static std::vector< double > pol2_from_pol2(TH1 *hist)
Definition: SymmetryFit.cc:154
std::pair< unsigned, unsigned > findUsableMinMax() const
Definition: SymmetryFit.cc:58
float chi2_element(std::pair< unsigned, unsigned >)
Definition: SymmetryFit.cc:119
TH1 * chi2_
Definition: SymmetryFit.h:36
unsigned ndf_
Definition: SymmetryFit.h:35
static std::vector< double > pol2_from_pol3(TH1 *hist)
Definition: SymmetryFit.cc:174
std::vector< std::pair< unsigned, unsigned > > continuousRanges() const
Definition: SymmetryFit.cc:81
float chi2(std::pair< unsigned, unsigned >)
Definition: SymmetryFit.cc:106
static TF1 * fitfunction()
Definition: SymmetryFit.cc:145
__shared__ Hist hist
const TH1 * symm_candidate_
Definition: SymmetryFit.h:32
SymmetryFit operator+=(const SymmetryFit &R)
Definition: SymmetryFit.h:26
static TH1 * symmetryChi2(std::string, const std::vector< TH1 *> &, const std::pair< unsigned, unsigned >)
Definition: SymmetryFit.cc:6
void fillchi2()
Definition: SymmetryFit.cc:96
const unsigned minDF_
Definition: SymmetryFit.h:33
const std::pair< unsigned, unsigned > minmaxUsable_
Definition: SymmetryFit.h:34
const std::pair< unsigned, unsigned > range_
Definition: SymmetryFit.h:34
void makeChi2Histogram()
Definition: SymmetryFit.cc:49