53SecondVertexFit::SecondVertexFit()
56 m_vpar_primary.
setVx(vx);
57 HepSymMatrix evx(3,0);
58 evx[0][0] = 0.1 * 0.1;
59 evx[1][1] = 0.1 * 0.1;
60 evx[2][2] = 1.5 * 1.5;
61 m_vpar_primary.
setEvx(evx);
77 m_p4par = HepLorentzVector(0, 0, 0, 0);
78 m_crxyz = HepVector(3, 0);
97 HepVector aOrigin(10, 0);
98 HepVector aInfit(10, 0);
99 HepSymMatrix VaOrigin(10, 0);
100 HepSymMatrix VaInfit(10, 0);
102 aOrigin.sub(8, m_vpar_primary.
Vx());
104 VaOrigin.sub(8, m_vpar_primary.
Evx());
105 HepVector ctOrigin(1, 0);
106 HepVector ctInfit(1, 0);
107 HepSymMatrix Vct(1, 0);
111 std::vector<double>
chisq;
114 for(
int it = 0; it < m_niter; it++)
116 HepMatrix D(3, 10, 0);
117 HepLorentzVector
p4par = HepLorentzVector(aInfit[0], aInfit[1], aInfit[2], aInfit[3]);
133 d[0] = aInfit[7]-aInfit[4]+ctInfit[0]*
p4par.px()/
p4par.m();
134 d[1] = aInfit[8]-aInfit[5]+ctInfit[0]*
p4par.py()/
p4par.m();
135 d[2] = aInfit[9]-aInfit[6]+ctInfit[0]*
p4par.pz()/
p4par.m();
154 d[2] = aInfit[9] - aInfit[6]+ctInfit[0]*
p4par.pz()/
p4par.m();
157 HepSymMatrix VD(3, 0);
158 HepVector dela0(10, 0);
159 HepVector lambda0(3, 0);
160 HepVector delct(1, 0);
161 HepVector lambda(3, 0);
164 VD = (VaOrigin.similarity(D)).inverse(ifail);
165 dela0 = aOrigin - aInfit;
166 lambda0 = VD*(D*dela0 + d);
167 Vct = (VD.similarity(E.T())).inverse(ifail);
168 delct = -(Vct * E.T()) * lambda0;
169 ctInfit = ctInfit + delct;
170 lambda = lambda0 + (VD * E) * delct;
171 aInfit = aOrigin - (VaOrigin * D.T()) * lambda;
172 chi2 = dot(lambda, D*dela0 + d);
173 VaInfit = VaOrigin - (VD.similarity(D.T())).similarity(VaOrigin);
174 VaInfit = VaInfit + (((Vct.similarity(E)).similarity(VD)).similarity(D.T())).similarity(VaOrigin);
176 chisq.push_back(chi2);
181 if (fabs(delchi) < m_chiter)
188 if (chi2 < 0 || chi2 > m_chicut)
191 HepLorentzVector
p4par = HepLorentzVector(aInfit[0], aInfit[1], aInfit[2], aInfit[3]);
193 m_ctau_error = sqrt(Vct[0][0]);
194 m_lxyz = ctInfit[0] *
p4par.rho() /
p4par.m();
195 m_lxyz_error = sqrt(Vct[0][0]) *
p4par.rho() /
p4par.m();
198 for(
int i = 0; i < 3; i++)
199 m_crxyz[i] = aInfit[4+i];
201 HepSymMatrix Ew(7, 0);
202 for(
int i = 0; i < 7; i++)
205 for(
int j = 0; j < 7; j++)
207 Ew[i][j] = VaInfit[i][j];
double sin(const BesAngle a)
double cos(const BesAngle a)
HepLorentzVector p4par() const
static SecondVertexFit * instance()
std::vector< WTrackParameter > wTrackOrigin() const
double getCBz(const HepVector &vtx, const HepVector &trackPosition)
static VertexFitBField * instance()
void setEvx(const HepSymMatrix &eVx)
void setVx(const HepPoint3D &vx)
void setEw(const HepSymMatrix &Ew)
void setCharge(const int charge)
void setW(const HepVector &w)