FitSum.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // \file FitSum.h
3 // \brief Container class for basic kinematic information.
4 // \version $Id: FitSum.h,v 1.0 2014-09-25 00:00:00 mbaird42 Exp $
5 // \author $Author: mbaird42 $
6 // \date $Date: 2014-09-25 00:00:00 $
7 ////////////////////////////////////////////////////////////////////////
8 #ifndef FITSUM_H
9 #define FITSUM_H
10 
11 #include "TVector3.h"
12 #include "TLorentzVector.h"
13 
14 namespace rb
15 {
16  /// \brief A container for kinematic information.
17  ///
18  /// The rb::FitSum object is a simple container that
19  /// holds simple kinematic information. It is intended to be an
20  /// object produced in association with either a prong or a track.
21  ///
22  class FitSum
23  {
24  public:
25 
26  FitSum();
27  ~FitSum() {};
28 
29 #ifndef __GCCXML__
30 
31  FitSum(TVector3 dir, double momentum, double mass, int pdg = 0,
32  double chi2_hit1 = 0.0, double chi2_hit2 = 0.0,
33  double chi2_angle1 = 0.0, double chi2_angle2 = 0.0,
34  int Ndof_hit1 = 1, int Ndof_hit2 = 1,
35  int Ndof_angle1 = 1, int Ndof_angle2 = 1);
36 
37  void SetKin(TVector3 dir, double momentum, double mass);
38  void SetPDG(int pdg) { fPDG = pdg; }
39 
40  //
41  // Setting chi2 and ndof for each fit parameter and view.
42  //
43  void SetChi2(double chi2_hit1, double chi2_hit2,
44  double chi2_angle1, double chi2_angle2,
45  int Ndof_hit1, int Ndof_hit2,
46  int Ndof_angle1, int Ndof_angle2)
47  {
48  fChi2[0] = chi2_hit1; // chi squared for hits in XZ view.
49  fChi2[1] = chi2_hit2; // chi squared for hits in YZ view.
50  fChi2[2] = chi2_angle1; // chi squared for kink angle in XZ view.
51  fChi2[3] = chi2_angle2; // chi squared for kink angle in YZ view.
52  fNdof[0] = Ndof_hit1; // Degrees of freedom (nhits) in XZ view.
53  fNdof[1] = Ndof_hit2; // Degrees of freedom (nhits) in YZ view.
54  fNdof[2] = Ndof_angle1; // Degrees of freedom for fit angle (1) in XZ view.
55  fNdof[3] = Ndof_angle2; // Degrees of freedom for fit angle (1) in YZ view.
56  }
57 
58  //
59  // Function returning chi2 values for specific parameters and views.
60  //
61  const double Chi2(int index) const{
62  return fChi2[index];
63  }
64 
65  //
66  // Function returning degrees of freedom for specific parameters and views.
67  //
68  const int Ndof(int index) const{
69  return fNdof[index];
70  }
71 
72  const TLorentzVector FourMom() const { return fFourMom; }
73  const int PDG() const { return fPDG; }
74 
75 #endif // __GCCXML__
76 
77  protected:
78  TLorentzVector fFourMom; ///< four momentum
79  int fPDG; ///< pdg code for particle type
80  double fChi2[8]; ///< provide user with a chi-squared for track fit parameters
81  int fNdof[8]; ///< provide user with N degrees of freedom for track fit parameters
82  };
83 }
84 
85 #endif // FITSUM_H
86 ////////////////////////////////////////////////////////////////////////
TLorentzVector fFourMom
four momentum
Definition: FitSum.h:78
const int Ndof(int index) const
Definition: FitSum.h:68
const int PDG() const
Definition: FitSum.h:73
double fChi2[8]
provide user with a chi-squared for track fit parameters
Definition: FitSum.h:80
const TLorentzVector FourMom() const
Definition: FitSum.h:72
void SetPDG(int pdg)
Definition: FitSum.h:38
const double Chi2(int index) const
Definition: FitSum.h:61
Perform a "2 point" Hough transform on a collection of hits.
~FitSum()
Definition: FitSum.h:27
void SetChi2(double chi2_hit1, double chi2_hit2, double chi2_angle1, double chi2_angle2, int Ndof_hit1, int Ndof_hit2, int Ndof_angle1, int Ndof_angle2)
Definition: FitSum.h:43
int fPDG
pdg code for particle type
Definition: FitSum.h:79
int fNdof[8]
provide user with N degrees of freedom for track fit parameters
Definition: FitSum.h:81
TDirectory * dir
Definition: macro.C:5
void SetKin(TVector3 dir, double momentum, double mass)
Definition: FitSum.cxx:48
A container for kinematic information.
Definition: FitSum.h:22