1#include "VertexFit/WTrackParameter.h"
6 m_Ew = HepSymMatrix(7, 0);
10 m_massInvariable =
true;
15 m_charge = wtrk.m_charge;
22 m_massInvariable = wtrk.m_massInvariable;
29 m_charge = wtrk.m_charge;
36 m_massInvariable = wtrk.m_massInvariable;
44 tmp[0] = atan(
w()[1]/(
w()[0]));
46 tmp[0] = atan(
w()[1]/(
w()[0])) + 3.1415926;
47 tmp[1] =
w()[2]/sqrt(
w()[0]*
w()[0] +
w()[1]*
w()[1]);
49 tmp[3] = sqrt(
w()[3]*
w()[3] -
p().m()*
p().m());
55 HepSymMatrix error(5, 0);
57 for (
int i = 0; i < 5; i++)
59 for(
int j = i; j < 5; j++)
71 m_w = HepVector(7, 0);
72 m_Ew = HepSymMatrix(7, 0);
76 m_massInvariable =
true;
77 for (
int i = 0; i < 4; i++)
79 for (
int i = 0; i < 3; i++)
82 HepVector helix(5, 0);
83 double phi0 = atan2(-
p[0],
p[1]);
85 helix[0] =
x[0] /
cos(phi0);
87 helix[0] =
x[1] /
sin(phi0);
91 helix[4] =
p[3]/
p.perp();
92 HepMatrix dWdA(7, 5, 0);
93 dWdA = GetCvtMatrix(
p.m(), helix);
94 m_Ew = err.similarity(dWdA);
99 HepSymMatrix error(5, 0);
101 for(
int i = 0; i < 5; i++)
103 for(
int j = i; j < 5; j++)
105 error[i][j] = err[k];
106 error[j][i] = err[k];
118 m_w = HepVector(7, 0);
119 m_Ew = HepSymMatrix(7, 0);
120 HepMatrix dWdA(7, 5, 0);
121 dWdA = GetCvtMatrix(
mass, hel);
122 m_Ew = err.similarity(dWdA);
123 m_w = CvtH2W(
mass, hel);
124 m_charge = hel[2] > 0 ? +1 : -1;
125 m_massInvariable =
true;
137 m_w = HepVector(7, 0);
138 m_Ew = HepSymMatrix(7, 0);
142 m_massInvariable =
true;
143 for (
int i = 0; i< 4; i++)
145 for (
int i = 0; i< 3; i++)
148 HepMatrix dwda(7, 3, 0);
149 dwda[0][0] = -
p.py();
154 dwda[0][1] =
p.px()*
p.pz()/
p.perp();
155 dwda[1][1] =
p.py()*
p.pz()/
p.perp();
156 dwda[2][1] = -
p.perp();
157 dwda[6][1] = -
x.distance2()/sqrt(
x.x()*
x.x()+
x.y()*
x.y());
159 dwda[0][2] =
p.px()/
p.rho();
160 dwda[1][2] =
p.py()/
p.rho();
161 dwda[2][2] =
p.pz()/
p.rho();
162 dwda[3][2] =
p.rho()/
p.e();
167 HepSymMatrix emcmea(3, 0);
168 emcmea[0][0] = dphi * dphi;
169 emcmea[1][1] = dthe * dthe;
170 emcmea[2][2] = dE * dE;
171 m_Ew = emcmea.similarity(dwda);
174HepMatrix WTrackParameter::GetCvtMatrix(
const double mass,
const HepVector &helix)
176 HepMatrix m(7, 5, 0);
177 double drho = helix[0];
178 double phi0 = helix[1];
179 double kappa = helix[2];
180 double kappa2 = kappa * kappa;
181 double kappa3 = kappa * kappa2;
182 double dz = helix[3];
183 double lambda = helix[4];
184 double lambda2 = lambda * lambda;
185 double e = sqrt( (1+lambda2) / kappa2 +
mass *
mass );
186 double sinphi0 =
sin(phi0);
187 double cosphi0 =
cos(phi0);
188 int q = (kappa>0) ? 1 : (-1);
189 m[0][1] = -cosphi0 *
q / kappa;
190 m[0][2] = sinphi0 *
q / kappa2;
191 m[1][1] = -sinphi0 *
q / kappa;
192 m[1][2] = -cosphi0 *
q / kappa2;
193 m[2][2] = -lambda *
q / kappa2;
195 m[3][2] = -(1+lambda2) / (kappa3 * e);
196 m[3][4] = lambda / (kappa2 * e);
198 m[4][1] = -drho * sinphi0;
200 m[5][1] = drho * cosphi0;
205HepVector WTrackParameter::CvtH2W(
const double mass,
const HepVector &helix)
207 double drho = helix[0];
208 double phi0 = helix[1];
209 double kappa = helix[2];
210 double dz = helix[3];
211 double lambda = helix[4];
212 double sinphi0 =
sin(phi0);
213 double cosphi0 =
cos(phi0);
214 int q = (kappa>0) ? 1 : (-1);
216 w[0] = -sinphi0 *
q / kappa;
217 w[1] = cosphi0 *
q / kappa;
218 w[2] = lambda *
q / kappa;
219 w[3] = sqrt( (1+lambda*lambda) / (kappa*kappa) +
mass *
mass );
220 w[4] = drho * cosphi0;
221 w[5] = drho * sinphi0;
double sin(const BesAngle a)
double cos(const BesAngle a)
****INTEGER imax DOUBLE PRECISION m_pi *DOUBLE PRECISION m_amfin DOUBLE PRECISION m_Chfin DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_sinw2 DOUBLE PRECISION m_GFermi DOUBLE PRECISION m_MfinMin DOUBLE PRECISION m_ta2 INTEGER m_out INTEGER m_KeyFSR INTEGER m_KeyQCD *COMMON c_Semalib $ !copy of input $ !CMS energy $ !beam mass $ !final mass $ !beam charge $ !final charge $ !smallest final mass $ !Z mass $ !Z width $ !EW mixing angle $ !Gmu Fermi $ alphaQED at q
HepLorentzVector p() const
WTrackParameter & operator=(const WTrackParameter &wtrk)
HepVector philambdamass()