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 
27 
28  public:
29 
31  DTLinearFit() ;
32 
34  ~DTLinearFit() ;
35 
36 /* Operations */
37  void fit(const std::vector<float> & x,
38  const std::vector<float> & y,
39  int ndat,
40  const std::vector<float> & sigy,
41  float& slope,
42  float& intercept,
43  double& chi2,
44  float& covss,
45  float& covii,
46  float& covsi) const;
47 
48  // General function for performing a 2, 3 or 4 parameter fit
49  void fitNpar( const int npar,
50  const std::vector<float>& xfit,
51  const std::vector<float>& yfit,
52  const std::vector<int>& lfit,
53  const std::vector<double>& tfit,
54  const std::vector<float> & sigy,
55  float& aminf,
56  float& bminf,
57  float& cminf,
58  float& vminf,
59  double& chi2fit,
60  const bool debug) const;
61 
62  // wrapper for the 3 parameter fit
63  void fit3par( const std::vector<float>& xfit,
64  const std::vector<float>& yfit,
65  const std::vector<int>& lfit,
66  const int nptfit,
67  const std::vector<float> & sigy,
68  float& aminf,
69  float& bminf,
70  float& cminf,
71  double& chi2fit,
72  const bool debug) const;
73 
74 
75  void fit4Var( const std::vector<float>& xfit,
76  const std::vector<float>& yfit,
77  const std::vector<int>& lfit,
78  const std::vector<double>& tfit,
79  const int nptfit,
80  float& aminf,
81  float& bminf,
82  float& cminf,
83  float& vminf,
84  double& chi2fit,
85  const bool vdrift_4parfit,
86  const bool debug) const;
87 
88  protected:
89 
90  private:
91 
92 };
93 #endif // DTSegment_DTLinearFit_h
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:220
static const double slope[3]
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:27
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:238
~DTLinearFit()
Destructor.
Definition: DTLinearFit.cc:23
DTLinearFit()
Constructor.
Definition: DTLinearFit.cc:18
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:70
#define debug
Definition: HDRShower.cc:19