Belle II Software development
BKLMTrack.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9/* Own header. */
10#include "klm/dataobjects/bklm/BKLMTrack.h"
11
12using namespace Belle2;
13
17 m_Valid(false),
18 m_Good(false),
19 m_Chi2(0.0),
20 m_NumHit(0)
21{
22 for (int ii = 0 ; ii < 4; ii ++) {
23 m_TrackParam[0] = 0.0;
24 m_LocalTrackParam[ii] = 0.0;
25 for (int jj = 0 ; jj < 4; jj ++) {
26 m_TrackParamErr[ii][jj] = 0.0;
27 m_LocalTrackParamErr[ii][jj] = 0.0;
28 }
29 }
30}
31
34 RelationsObject(track),
35 m_Valid(track.m_Valid),
36 m_Good(track.m_Good),
37 m_Chi2(track.m_Chi2),
38 m_NumHit(track.m_NumHit)
39{
40
41 for (int ii = 0 ; ii < 4; ii ++) {
42 m_TrackParam[ii] = track.m_TrackParam[ii];
43 m_LocalTrackParam[ii] = track.m_LocalTrackParam[ii];
44 for (int jj = 0 ; jj < 4; jj ++) {
45 m_TrackParamErr[ii][jj] = track.m_TrackParamErr[ii][jj];
46 m_LocalTrackParamErr[ii][jj] = track.m_LocalTrackParamErr[ii][jj];
47 }
48 }
49}
50
53{
54 m_Valid = track.m_Valid;
55 m_Good = track.m_Good;
56 m_Chi2 = track.m_Chi2;
57 m_NumHit = track.m_NumHit;
58
59 for (int ii = 0 ; ii < 4; ii ++) {
60 m_TrackParam[ii] = track.m_TrackParam[ii];
61 m_LocalTrackParam[ii] = track.m_LocalTrackParam[ii];
62 for (int jj = 0 ; jj < 4; jj ++) {
63 m_TrackParamErr[ii][jj] = track.m_TrackParamErr[ii][jj];
64 m_LocalTrackParamErr[ii][jj] = track.m_LocalTrackParamErr[ii][jj];
65 }
66 }
67 return *this;
68}
69
72{
73 TVectorD trackParam(4);
74 trackParam[0] = m_TrackParam[0];
75 trackParam[1] = m_TrackParam[1];
76 trackParam[2] = m_TrackParam[2];
77 trackParam[3] = m_TrackParam[3];
78
79 return trackParam;
80}
81
82
85{
86 TVectorD trackParam(4);
87 trackParam[0] = m_LocalTrackParam[0];
88 trackParam[1] = m_LocalTrackParam[1];
89 trackParam[2] = m_LocalTrackParam[2];
90 trackParam[3] = m_LocalTrackParam[3];
91
92 return trackParam;
93}
94
97{
98 TMatrixDSym trkParamErr(4);
99 for (int ii = 0 ; ii < 4; ii ++) {
100 for (int jj = 0 ; jj < 4; jj ++) {
101 trkParamErr[ii][jj] = m_TrackParamErr[ii][jj];
102 }
103 }
104 return trkParamErr;
105}
106
109{
110 TMatrixDSym trkParamErr(4);
111 for (int ii = 0 ; ii < 4; ii ++) {
112 for (int jj = 0 ; jj < 4; jj ++) {
113 trkParamErr[ii][jj] = m_LocalTrackParamErr[ii][jj];
114 }
115 }
116 return trkParamErr;
117}
118
120void BKLMTrack::setTrackParam(const CLHEP::HepVector& trkPar)
121{
122 m_TrackParam[0] = trkPar[0];
123 m_TrackParam[1] = trkPar[1];
124 m_TrackParam[2] = trkPar[2];
125 m_TrackParam[3] = trkPar[3];
126
127}
128
130void BKLMTrack::setTrackParamErr(const CLHEP::HepSymMatrix& trkParErr)
131{
132 for (int ii = 0 ; ii < 4; ii ++) {
133 for (int jj = 0 ; jj < 4; jj ++) {
134 m_TrackParamErr[ii][jj] = trkParErr[ii][jj];
135 }
136 }
137}
138
140void BKLMTrack::setLocalTrackParam(const CLHEP::HepVector& trkPar)
141{
142 m_LocalTrackParam[0] = trkPar[0];
143 m_LocalTrackParam[1] = trkPar[1];
144 m_LocalTrackParam[2] = trkPar[2];
145 m_LocalTrackParam[3] = trkPar[3];
146
147}
148
150void BKLMTrack::setLocalTrackParamErr(const CLHEP::HepSymMatrix& trkParErr)
151{
152 for (int ii = 0 ; ii < 4; ii ++) {
153 for (int jj = 0 ; jj < 4; jj ++) {
154 m_LocalTrackParamErr[ii][jj] = trkParErr[ii][jj];
155 }
156 }
157}
158
160ROOT::Math::XYZVector BKLMTrack::getLocalIntercept(double x)
161{
162
163 ROOT::Math::XYZVector intercept;
164
165 intercept.SetX(x);
166 intercept.SetY(m_LocalTrackParam[ 0 ] + x * m_LocalTrackParam[ 1 ]);
167 intercept.SetZ(m_LocalTrackParam[ 2 ] + x * m_LocalTrackParam[ 3 ]);
168
169 return intercept;
170
171}
172
175{
176
177 TMatrixD errors(2, 2, 0);
178 TMatrixD A(2, 4, 0);
179 A[ 0 ][ 0 ] = 1.0;
180 A[ 0 ][ 1 ] = x;
181 A[ 1 ][ 2 ] = 1.0;
182 A[ 1 ][ 3 ] = x;
183 errors = A * getLocalTrackParamErr() * A.T();
184
185 return errors;
186
187}
Store one BKLM Track as a ROOT object.
Definition: BKLMTrack.h:35
float m_Chi2
fitted chi2 of the track
Definition: BKLMTrack.h:140
BKLMTrack & operator=(const BKLMTrack &)
Assignment operator.
Definition: BKLMTrack.cc:52
int m_NumHit
the number of 2d hits on the track
Definition: BKLMTrack.h:143
void setLocalTrackParam(const CLHEP::HepVector &trkPar)
Set track parameters in the sector local system, where the first layer of the sector is used as refer...
Definition: BKLMTrack.cc:140
void setTrackParamErr(const CLHEP::HepSymMatrix &trkParErr)
Set invariance matrix of track parameters in the global system.
Definition: BKLMTrack.cc:130
TMatrixDSym getTrackParamErr()
Get invariance matrix of track parameters in the global system.
Definition: BKLMTrack.cc:96
float m_TrackParam[4]
track parameters in the global system. y = p0 + p1 * x; z = p2 + p3 * x
Definition: BKLMTrack.h:146
TMatrixD getLocalInterceptVariance(double x)
Get the variance matrix of (y,z) coordinates of the track intercept in plane of constant x in sector ...
Definition: BKLMTrack.cc:174
TVectorD getTrackParam()
Get track parameters in the global system. y = p0 + p1 * x; z = p2 + p3 * x.
Definition: BKLMTrack.cc:71
ROOT::Math::XYZVector getLocalIntercept(double x)
Get the position in local coordinate system of track intercept in plane of constant x.
Definition: BKLMTrack.cc:160
BKLMTrack()
Empty constructor for ROOT IO (needed to make the class storable)
Definition: BKLMTrack.cc:15
bool m_Valid
Is fit valid.
Definition: BKLMTrack.h:134
bool m_Good
Is fit good.
Definition: BKLMTrack.h:137
void setLocalTrackParamErr(const CLHEP::HepSymMatrix &trkParErr)
Set invariance matrix of track parameters in the sector local system, where the first layer of the se...
Definition: BKLMTrack.cc:150
float m_TrackParamErr[4][4]
track parameters variance in the global system.
Definition: BKLMTrack.h:149
float m_LocalTrackParamErr[4][4]
track parameters variance in the sector local system.
Definition: BKLMTrack.h:155
float m_LocalTrackParam[4]
track parameters in the sector local system.
Definition: BKLMTrack.h:152
void setTrackParam(const CLHEP::HepVector &trkPar)
Set track parameters in the global system. y = p0 + p1 * x; z = p2 + p3 * x.
Definition: BKLMTrack.cc:120
TMatrixDSym getLocalTrackParamErr()
Get invariance matrix of track parameters in the sector local system, where the first layer of the se...
Definition: BKLMTrack.cc:108
TVectorD getLocalTrackParam()
Get track parameters in the sector locan system, where the first layer of the sector is used as refer...
Definition: BKLMTrack.cc:84
Defines interface for accessing relations of objects in StoreArray.
Abstract base class for different kinds of events.