CMS 3D CMS Logo

DTLinearFit.h
Go to the documentation of this file.
1 #ifndef DTSegment_DTLinearFit_h
2 #define DTSegment_DTLinearFit_h
3 
14 /* Base Class Headers */
15 
16 /* Collaborating Class Declarations */
17 
18 /* C++ Headers */
19 #include <vector>
20 #include <iostream>
21 
22 /* ====================================================================== */
23 
24 /* Class DTLinearFit Interface */
25 
26 class DTLinearFit {
27 public:
29  DTLinearFit();
30 
32  ~DTLinearFit();
33 
34  /* Operations */
35  void fit(const std::vector<float>& x,
36  const std::vector<float>& y,
37  int ndat,
38  const std::vector<float>& sigy,
39  float& slope,
40  float& intercept,
41  double& chi2,
42  float& covss,
43  float& covii,
44  float& covsi) const;
45 
46  // General function for performing a 2, 3 or 4 parameter fit
47  void fitNpar(const int npar,
48  const std::vector<float>& xfit,
49  const std::vector<float>& yfit,
50  const std::vector<int>& lfit,
51  const std::vector<double>& tfit,
52  const std::vector<float>& sigy,
53  float& aminf,
54  float& bminf,
55  float& cminf,
56  float& vminf,
57  double& chi2fit,
58  const bool debug) const;
59 
60  // wrapper for the 3 parameter fit
61  void fit3par(const std::vector<float>& xfit,
62  const std::vector<float>& yfit,
63  const std::vector<int>& lfit,
64  const int nptfit,
65  const std::vector<float>& sigy,
66  float& aminf,
67  float& bminf,
68  float& cminf,
69  double& chi2fit,
70  const bool debug) const;
71 
72  void fit4Var(const std::vector<float>& xfit,
73  const std::vector<float>& yfit,
74  const std::vector<int>& lfit,
75  const std::vector<double>& tfit,
76  const int nptfit,
77  float& aminf,
78  float& bminf,
79  float& cminf,
80  float& vminf,
81  double& chi2fit,
82  const bool vdrift_4parfit,
83  const bool debug) const;
84 
85 protected:
86 private:
87 };
88 #endif // DTSegment_DTLinearFit_h
void fit4Var(const std::vector< float > &xfit, const std::vector< float > &yfit, const std::vector< int > &lfit, const std::vector< double > &tfit, const int nptfit, float &aminf, float &bminf, float &cminf, float &vminf, double &chi2fit, const bool vdrift_4parfit, const bool debug) const
Definition: DTLinearFit.cc:249
static const double slope[3]
~DTLinearFit()
Destructor.
Definition: DTLinearFit.cc:21
DTLinearFit()
Constructor.
Definition: DTLinearFit.cc:18
#define debug
Definition: HDRShower.cc:19
void fitNpar(const int npar, const std::vector< float > &xfit, const std::vector< float > &yfit, const std::vector< int > &lfit, const std::vector< double > &tfit, const std::vector< float > &sigy, float &aminf, float &bminf, float &cminf, float &vminf, double &chi2fit, const bool debug) const
Definition: DTLinearFit.cc:65
void fit(const std::vector< float > &x, const std::vector< float > &y, int ndat, const std::vector< float > &sigy, float &slope, float &intercept, double &chi2, float &covss, float &covii, float &covsi) const
Definition: DTLinearFit.cc:24
void fit3par(const std::vector< float > &xfit, const std::vector< float > &yfit, const std::vector< int > &lfit, const int nptfit, const std::vector< float > &sigy, float &aminf, float &bminf, float &cminf, double &chi2fit, const bool debug) const
Definition: DTLinearFit.cc:233