CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
LocalTrackFit.h
Go to the documentation of this file.
1 /****************************************************************************
2 * Authors:
3 * Jan Kašpar (jan.kaspar@gmail.com)
4 ****************************************************************************/
5 
6 #ifndef CalibPPS_AlignmentRelative_LocalTrackFit_h
7 #define CalibPPS_AlignmentRelative_LocalTrackFit_h
8 
9 #include "TMath.h"
10 
15 struct LocalTrackFit {
17  double z0;
18 
20  double ax, ay;
21 
23  double bx, by;
24 
26  signed int ndf;
27 
29  double chi_sq;
30 
31  LocalTrackFit(double _z0 = 0.,
32  double _ax = 0.,
33  double _ay = 0.,
34  double _bx = 0.,
35  double _by = 0.,
36  unsigned int _ndf = 0,
37  double _chi_sq = 0.)
38  : z0(_z0), ax(_ax), ay(_ay), bx(_bx), by(_by), ndf(_ndf), chi_sq(_chi_sq) {}
39 
40  double pValue() const { return TMath::Prob(chi_sq, ndf); }
41 
42  double chiSqPerNdf() const { return (ndf > 0) ? chi_sq / ndf : 0.; }
43 
44  void eval(double z, double &x, double &y) {
45  double ze = z - z0;
46  x = ax * ze + bx;
47  y = ay * ze + by;
48  }
49 };
50 
51 #endif
double z0
the point where intercepts are measured, in mm
Definition: LocalTrackFit.h:17
double chiSqPerNdf() const
Definition: LocalTrackFit.h:42
Local (linear) track description (or a fit result). Uses global reference system. ...
Definition: LocalTrackFit.h:15
signed int ndf
the number of degrees of freedom
Definition: LocalTrackFit.h:26
double pValue() const
Definition: LocalTrackFit.h:40
void eval(double z, double &x, double &y)
Definition: LocalTrackFit.h:44
double chi_sq
the residual sum of squares
Definition: LocalTrackFit.h:29
double bx
intercepts in mm
Definition: LocalTrackFit.h:23
LocalTrackFit(double _z0=0., double _ax=0., double _ay=0., double _bx=0., double _by=0., unsigned int _ndf=0, double _chi_sq=0.)
Definition: LocalTrackFit.h:31
double ax
slopes in rad
Definition: LocalTrackFit.h:20