36{
37 m_Ec.clear();
38 m_Dc.clear();
39 m_dc.clear();
40 m_VD.clear();
41 m_EVDE.clear();
42 m_lambda0.clear();
43 m_lambda.clear();
44 m_covax.clear();
45
46 switch(m_type)
47 {
48 case FixedVertex:
49 {
51 for (unsigned int i = 0; i < wlis.size(); i++)
52 {
53 wtrk = wlis[i];
54 HepLorentzVector p = wtrk.
p();
57
59 double a = afield * (0.0+wtrk.
charge());
60 double J = a * (delx.x()*p.px() + delx.y()*p.py())/p.perp2();
61
62 J = std::min(J, 1-1e-4);
63 J = std::max(J, -1+1e-4);
64 double Rx = delx.x() - 2*p.px() * (delx.x()*p.px() + delx.y()*p.py()) / p.perp2();
65 double Ry = delx.y() - 2*p.py() * (delx.x()*p.px() + delx.y()*p.py()) / p.perp2();
66 double S = 1.0/sqrt(1-J*J)/p.perp2();
67
68
70 dc[0] = delx.y() * p.px() - delx.x() * p.py() - 0.5 * a * (delx.x() * delx.x() + delx.y() * delx.y());
71 dc[1] = delx.z() - p.pz()/a*asin(J);
73
74 HepMatrix
Ec(2, 3, 0);
76
77 HepMatrix
Dc(2, 6, 0);
81 Dc[0][3] = p.py() + a * delx.x();
82 Dc[0][4] = -p.px() + a * delx.y();
84 Dc[1][0] = -p.pz() * S * Rx;
85 Dc[1][1] = -p.pz() * S * Ry;
86 Dc[1][2] = - asin(J) / a;
87 Dc[1][3] = p.px() * p.pz() * S;
88 Dc[1][4] = p.py() * p.pz() * S;
91
92 HepSymMatrix
VD(2, 0);
93
94
96
97 HepSymMatrix
EVDE(3, 0);
98 m_EVDE.push_back(
EVDE);
99
102
104 m_lambda.push_back(
lambda);
105
106 HepMatrix
covax(6, 3, 0);
107 m_covax.push_back(
covax);
108 break;
109 }
110 }
111 case CommonVertex:
112 default:
113 {
115 for (unsigned int i = 0; i < wlis.size(); i++)
116 {
117 wtrk = wlis[i];
118 HepLorentzVector p = wtrk.
p();
122 {
123
125 dc[0] = p.pz()*delx.x() - p.px()*delx.z();
126 dc[1] = p.pz()*delx.y() - p.py()*delx.z();
128
137
139 Dc[0][0] = -delx.z();
146 Dc[1][1] = -delx.z();
152 }
153 else
154 {
156 double a = afield * (0.0+wtrk.
charge());
157 double J = a * (delx.x()*p.px() + delx.y()*p.py())/p.perp2();
158 J = std::min(J, 1-1e-4);
159 J = std::max(J, -1+1e-4);
160 double Rx = delx.x() - 2*p.px() * (delx.x()*p.px() + delx.y()*p.py()) / p.perp2();
161 double Ry = delx.y() - 2*p.py() * (delx.x()*p.px() + delx.y()*p.py()) / p.perp2();
162 double S = 1.0/sqrt(1-J*J)/p.perp2();
163
165 dc[0] = delx.y() * p.px() - delx.x() * p.py() - 0.5 * a * (delx.x() * delx.x() + delx.y() * delx.y());
166 dc[1] = delx.z() - p.pz()/a*asin(J);
168
169 HepMatrix
Ec(2, 3, 0);
170 Ec[0][0] = -p.py()- a * delx.x();
171 Ec[0][1] = p.px() - a * delx.y();
173 Ec[1][0] = -p.px() * p.pz() * S ;
174 Ec[1][1] = -p.py() * p.pz() * S ;
177
178 HepMatrix
Dc(2, 6, 0);
180 Dc[0][1] = -delx.x();
182 Dc[0][3] = p.py() + a * delx.x();
183 Dc[0][4] = -p.px() + a * delx.y();
185 Dc[1][0] = -p.pz() * S * Rx;
186 Dc[1][1] = -p.pz() * S * Ry;
187 Dc[1][2] = - asin(J) / a;
188 Dc[1][3] = p.px() * p.pz() * S;
189 Dc[1][4] = p.py() * p.pz() * S;
192 }
193
194 HepSymMatrix
VD(2, 0);
196
197 HepSymMatrix
EVDE(3, 0);
198 m_EVDE.push_back(
EVDE);
199
202
204 m_lambda.push_back(
lambda);
205
206 HepMatrix
covax(6, 3, 0);
207 m_covax.push_back(
covax);
208 }
209 break;
210 }
211 }
212}
std::vector< HepMatrix > Dc() const
std::vector< HepSymMatrix > EVDE() const
std::vector< HepSymMatrix > VD() const
std::vector< HepMatrix > covax() const
std::vector< HepMatrix > Ec() const
std::vector< HepVector > lambda0() const
std::vector< HepVector > dc() const
std::vector< HepVector > lambda() const
double getCBz(const HepVector &vtx, const HepVector &trackPosition)
static VertexFitBField * instance()
HepLorentzVector p() const