CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LocalTrackFit.h
Go to the documentation of this file.
1 /****************************************************************************
2 *
3 * This is a part of TOTEM offline software.
4 * Authors:
5 * Jan Kašpar (jan.kaspar@gmail.com)
6 *
7 ****************************************************************************/
8 
9 #ifndef DataFormats_CTPPSAlignment_LocalTrackFit
10 #define DataFormats_CTPPSAlignment_LocalTrackFit
11 
12 #include "TMath.h"
13 
19 {
21  double z0;
22 
24  double ax, ay;
25 
27  double bx, by;
28 
30  signed int ndf;
31 
33  double chi_sq;
34 
35  LocalTrackFit(double _z0=0., double _ax=0., double _ay=0., double _bx=0., double _by=0., unsigned int _ndf=0, double _chi_sq=0.) :
36  z0(_z0), ax(_ax), ay(_ay), bx(_bx), by(_by), ndf(_ndf), chi_sq(_chi_sq) {}
37 
38  double PValue() const
39  { return TMath::Prob(chi_sq, ndf); }
40 
41  double ChiSqPerNdf() const
42  { return (ndf > 0) ? chi_sq / ndf : 0.; }
43 
44  void Eval(double z, double &x, double &y)
45  {
46  double ze = z - z0;
47  x = ax*ze + bx;
48  y = ay*ze + by;
49  }
50 };
51 
52 #endif
53 
double z0
the point where intercepts are measured, in mm
Definition: LocalTrackFit.h:21
double PValue() const
Definition: LocalTrackFit.h:38
double ChiSqPerNdf() const
Definition: LocalTrackFit.h:41
Local (linear) track description (or a fit result). Uses global reference system. ...
Definition: LocalTrackFit.h:18
signed int ndf
the number of degrees of freedom
Definition: LocalTrackFit.h:30
double chi_sq
the residual sum of squares
Definition: LocalTrackFit.h:33
void Eval(double z, double &x, double &y)
Definition: LocalTrackFit.h:44
double bx
intercepts in mm
Definition: LocalTrackFit.h:27
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:35
double ax
slopes in rad
Definition: LocalTrackFit.h:24