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