~christopher-hunt08/maus/maus_integrated_kalman

« back to all changes in this revision

Viewing changes to src/common_cpp/DataStructure/SciFiHelicalPRTrack.cc

  • Committer: Durga Rajaram
  • Date: 2014-07-16 15:13:05 UTC
  • mfrom: (659.1.92 cand)
  • Revision ID: durga@fnal.gov-20140716151305-q27rv1y9p03v9lks
Tags: MAUS-v0.9, MAUS-v0.9.0
MAUS-v0.9.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
namespace MAUS {
22
22
 
23
23
// Constructors
24
 
SciFiHelicalPRTrack::SciFiHelicalPRTrack() : _phi(0), _spoints(0) {
25
 
  _x0 = -1.0;
26
 
  _y0 = -1.0;
27
 
  _z0 = -1.0;
28
 
  _R = -1.0;
29
 
  _phi0 = -1.0;
30
 
  _psi0 = -1.0;
31
 
  _dsdz = -1.0;
32
 
  _line_sz_c = -1.0;
33
 
  _line_sz_chisq = -1.0;
34
 
  _circle_x0 = -1.0;
35
 
  _circle_y0 = -1.0;
36
 
  _circle_chisq = -1.0;
37
 
  _chisq = -1.0;
38
 
  _chisq_dof = -1.0;
39
 
  _tracker = -1;
40
 
  _num_points = -1;
41
 
  _charge = 0;
 
24
SciFiHelicalPRTrack::SciFiHelicalPRTrack() :  _tracker(-1),
 
25
                                              _num_points(-1),
 
26
                                              _charge(0),
 
27
                                              _R(-1.0),
 
28
                                              _phi0(-1.0),
 
29
                                              _dsdz(-1.0),
 
30
                                              _line_sz_c(-1.0),
 
31
                                              _line_sz_chisq(-1.0),
 
32
                                              _circle_x0(-1.0),
 
33
                                              _circle_y0(-1.0),
 
34
                                              _circle_chisq(-1.0),
 
35
                                              _chisq(-1.0),
 
36
                                              _chisq_dof(-1.0),
 
37
                                              _point_spread(-1.0),
 
38
                                              _pos0(-1.0, -1.0, -1.0),
 
39
                                              _phi(0) {
 
40
  _spoints = new TRefArray();
42
41
}
43
42
 
44
 
 
45
 
SciFiHelicalPRTrack::SciFiHelicalPRTrack(int tracker, int num_points, int charge, double x0,
46
 
                                         double y0, double z0, double phi0, double psi0,
47
 
                                         double dsdz, double R, double chisq) {
48
 
  _x0 = x0;
49
 
  _y0 = y0;
50
 
  _z0 = z0;
51
 
  _R = R;
 
43
SciFiHelicalPRTrack::SciFiHelicalPRTrack(int tracker, int num_points, int charge, ThreeVector pos0,
 
44
                                         double phi0, SimpleCircle circle, SimpleLine line_sz,
 
45
                                         double chisq, double chisq_dof, double point_spread,
 
46
                                         DoubleArray phi, SciFiSpacePointPArray spoints) {
 
47
  _tracker = tracker;
 
48
  _num_points = num_points;
 
49
  _charge = charge;
 
50
  _R  = circle.get_R();
52
51
  _phi0 = phi0;
53
 
  _psi0 = psi0;
54
 
  _dsdz = dsdz;
55
 
  _tracker = tracker;
56
 
  _num_points = num_points;
57
 
  _charge = charge;
58
 
  _chisq = chisq;
59
 
}
60
 
 
61
 
SciFiHelicalPRTrack::SciFiHelicalPRTrack(int tracker, int num_points, int charge, ThreeVector pos0,
62
 
                                         double phi0, double psi0, SimpleCircle circle,
63
 
                                         SimpleLine line_sz) {
64
 
  _tracker = tracker;
65
 
  _num_points = num_points;
66
 
  _charge = charge;
67
 
  _x0 = pos0.x();
68
 
  _y0 = pos0.y();
69
 
  _z0 = pos0.z();
70
 
  _R    = circle.get_R();
71
52
  _dsdz = line_sz.get_m();
72
53
  _line_sz_c = line_sz.get_c();
73
54
  _line_sz_chisq = line_sz.get_chisq();
74
55
  _circle_x0 = circle.get_x0();
75
56
  _circle_y0 = circle.get_y0();
76
57
  _circle_chisq = circle.get_chisq();
77
 
  _phi0 = phi0;
78
 
  _psi0 = psi0;
79
 
}
80
 
 
81
 
SciFiHelicalPRTrack::SciFiHelicalPRTrack(int tracker, int num_points, int charge, ThreeVector pos0,
82
 
                                         SimpleHelix helix) : _phi(0), _spoints(0)  {
83
 
  _tracker = tracker;
84
 
  _num_points = num_points;
85
 
  _charge = charge;
86
 
  _x0        = pos0.x();
87
 
  _y0        = pos0.y();
88
 
  _z0        = pos0.z();
89
 
  _R         = helix.get_R();
90
 
  _phi0      = helix.get_Phi_0();
91
 
  _dsdz      = helix.get_dsdz();
92
 
  _chisq     = helix.get_chisq();
93
 
  _chisq_dof = helix.get_chisq_dof(); // already reduced chisq
94
 
  _psi0 = -1.0;
95
 
  _line_sz_c = -1.0;
96
 
  _line_sz_chisq = -1.0;
97
 
  _circle_x0 = -1.0;
98
 
  _circle_y0 = -1.0;
99
 
  _circle_chisq = -1.0;
 
58
  _chisq = chisq;
 
59
  _chisq_dof = chisq_dof;
 
60
  _point_spread = point_spread;
 
61
  _pos0 = pos0;
 
62
  _spoints = new TRefArray();
 
63
  for (std::vector<SciFiSpacePoint*>::iterator sp = spoints.begin(); sp != spoints.end(); ++sp) {
 
64
    _spoints->Add(*sp);
 
65
  }
 
66
  _phi = phi;
100
67
}
101
68
 
102
69
// Destructor
103
 
SciFiHelicalPRTrack::~SciFiHelicalPRTrack() {}
 
70
SciFiHelicalPRTrack::~SciFiHelicalPRTrack() {
 
71
  // Do nothing
 
72
}
104
73
 
105
74
// Assignment operator
106
 
SciFiHelicalPRTrack &SciFiHelicalPRTrack::operator=(const SciFiHelicalPRTrack &_htrk) {
107
 
  if (this == &_htrk) {
 
75
SciFiHelicalPRTrack &SciFiHelicalPRTrack::operator=(const SciFiHelicalPRTrack &htrk) {
 
76
  if (this == &htrk) {
108
77
      return *this;
109
78
  }
110
 
  _x0 = _htrk.get_x0();
111
 
  _y0 = _htrk.get_y0();
112
 
  _z0 = _htrk.get_z0();
113
 
  _R = _htrk.get_R();
114
 
  _phi0 = _htrk.get_phi0();
115
 
  _psi0 = _htrk.get_psi0();
116
 
  _dsdz = _htrk.get_dsdz();
117
 
  _line_sz_c = _htrk.get_line_sz_c();
118
 
  _line_sz_chisq = _htrk.get_line_sz_chisq();
119
 
  _circle_chisq = _htrk.get_circle_chisq();
120
 
  _circle_x0 = _htrk.get_circle_x0();
121
 
  _circle_y0 = _htrk.get_circle_y0();
122
 
  _chisq = _htrk.get_chisq();
123
 
  _chisq_dof = _htrk.get_chisq_dof();
124
 
  _num_points = _htrk.get_num_points();
125
 
  _charge = _htrk.get_charge();
126
 
  _tracker = _htrk.get_tracker();
127
 
  _spoints = _htrk.get_spacepoints();
128
 
  _phi = _htrk.get_phi();
 
79
  _R = htrk.get_R();
 
80
  _phi0 = htrk.get_phi0();
 
81
  _dsdz = htrk.get_dsdz();
 
82
  _line_sz_c = htrk.get_line_sz_c();
 
83
  _line_sz_chisq = htrk.get_line_sz_chisq();
 
84
  _circle_chisq = htrk.get_circle_chisq();
 
85
  _circle_x0 = htrk.get_circle_x0();
 
86
  _circle_y0 = htrk.get_circle_y0();
 
87
  _chisq = htrk.get_chisq();
 
88
  _chisq_dof = htrk.get_chisq_dof();
 
89
  _num_points = htrk.get_num_points();
 
90
  _charge = htrk.get_charge();
 
91
  _tracker = htrk.get_tracker();
 
92
  _point_spread = htrk.get_point_spread();
 
93
  _pos0 = htrk.get_pos0();
 
94
  if (_spoints) delete _spoints;
 
95
  _spoints = new TRefArray(*(htrk.get_spacepoints()));
 
96
  _phi = htrk.get_phi();
129
97
  return *this;
130
98
}
131
99
 
132
 
SciFiHelicalPRTrack::SciFiHelicalPRTrack(const SciFiHelicalPRTrack &_htrk)
133
 
  : _tracker(-1), _num_points(-1), _charge(0), _x0(-1.0), _y0(-1.0), _z0(-1.0),
134
 
    _R(-1.0), _phi0(-1.0), _psi0(-1.0), _dsdz(-1.0), _line_sz_c(-1.0), _line_sz_chisq(-1.0),
135
 
    _circle_x0(-1.0), _circle_y0(-1.0), _circle_chisq(-1.0), _chisq(-1.0), _phi(0), _spoints(0) {
136
 
  *this = _htrk;
 
100
SciFiHelicalPRTrack::SciFiHelicalPRTrack(const SciFiHelicalPRTrack &htrk)
 
101
  : _tracker(htrk.get_tracker()),
 
102
    _num_points(htrk.get_num_points()),
 
103
    _charge(htrk.get_charge()),
 
104
    _R(htrk.get_R()),
 
105
    _phi0(htrk.get_phi0()),
 
106
    _dsdz(htrk.get_dsdz()),
 
107
    _line_sz_c(htrk.get_line_sz_c()),
 
108
    _line_sz_chisq(htrk.get_line_sz_chisq()),
 
109
    _circle_x0(htrk.get_circle_x0()),
 
110
    _circle_y0(htrk.get_circle_y0()),
 
111
    _circle_chisq(htrk.get_circle_chisq()),
 
112
    _chisq(htrk.get_chisq()),
 
113
    _chisq_dof(htrk.get_chisq_dof()),
 
114
    _point_spread(htrk.get_point_spread()),
 
115
    _pos0(htrk.get_pos0()),
 
116
    _phi(htrk.get_phi()) {
 
117
 
 
118
    // Shallow copy the SpacePoints
 
119
    _spoints = new TRefArray(*(htrk.get_spacepoints()));
137
120
}
138
121
 
 
122
 
139
123
} // ~namespace MAUS