20 return compute(chargeA, momentumA, positionA, chargeB, momentumB, positionB);
35 return compute(chargeA, momentumA, positionA, chargeB, momentumB, positionB);
41 "TrackingTools/PatternTools",
42 "ClosestApproachInRPhi::could not compute track crossing. Check status before calling this method!");
43 return pair<GlobalPoint, GlobalPoint>(posA, posB);
49 "TrackingTools/PatternTools",
50 "ClosestApproachInRPhi::could not compute track crossing. Check status before calling this method!");
51 return GlobalPoint(0.5 * (posA.basicVector() + posB.basicVector()));
57 "TrackingTools/PatternTools",
58 "ClosestApproachInRPhi::could not compute track crossing. Check status before calling this method!");
59 return (posB - posA).mag();
70 circleParameters(chargeA, momentumA, positionA, xca, yca, ra, bz);
72 circleParameters(chargeB, momentumB, positionB, xcb, ycb, rb, bz);
75 double xg1, yg1, xg2, yg2;
76 int flag = transverseCoord(xca, yca, ra, xcb, ycb, rb, xg1, yg1, xg2, yg2);
82 double xga, yga, zga, xgb, ygb, zgb;
87 double za1 = zCoord(momentumA, positionA, ra, xca, yca, xg1, yg1);
88 double zb1 = zCoord(momentumB, positionB, rb, xcb, ycb, xg1, yg1);
89 double za2 = zCoord(momentumA, positionA, ra, xca, yca, xg2, yg2);
90 double zb2 = zCoord(momentumB, positionB, rb, xcb, ycb, xg2, yg2);
92 if (
abs(zb1 - za1) <
abs(zb2 - za2)) {
109 zga = zCoord(momentumA, positionA, ra, xca, yca, xga, yga);
112 zgb = zCoord(momentumB, positionB, rb, xcb, ycb, xgb, ygb);
124 "TrackingTools/PatternTools",
125 "ClosestApproachInRPhi::could not compute track crossing. Check status before calling this method!");
126 pair<GlobalTrajectoryParameters, GlobalTrajectoryParameters>
ret(newTrajectory(posA, paramA, bz),
127 newTrajectory(posB, paramB, bz));
135 double qob = oldgtp.
charge() / bz;
140 double npx = (newpt.
y() - yc) * (bz / oldgtp.
charge());
141 double npy = (xc - newpt.
x()) * (bz / oldgtp.
charge());
184 double signed_r = qob * momentum.
transverse();
213 double d_ab =
sqrt((cxb - cxa) * (cxb - cxa) + (cyb - cya) * (cyb - cya));
218 double u = (cxb - cxa) / d_ab;
219 double v = (cyb - cya) / d_ab;
222 if (d_ab <= ra + rb && d_ab >=
abs(rb - ra)) {
227 double cosphi = (ra * ra - rb * rb + d_ab * d_ab) / (2 * ra * d_ab);
228 double sinphi2 = 1. - cosphi * cosphi;
235 double sinphi =
sqrt(sinphi2);
240 }
else if (d_ab > ra + rb) {
250 }
else if (d_ab <
abs(rb - ra)) {
268 xg1 = u *
x1 -
v *
y1 + cxa;
269 yg1 =
v *
x1 + u *
y1 + cya;
270 xg2 = u *
x2 -
v *
y2 + cxa;
271 yg2 =
v *
x2 + u *
y2 + cya;
291 double sinHalfPhi =
sqrt((x - xg) * (x - xg) + (y - yg) * (y - yg)) / (2 *
r);
292 if (sinHalfPhi < 0.383) {
293 phi = 2 * asin(sinHalfPhi);
295 double cosPhi = ((x - xc) * (xg - xc) + (y - yc) * (yg - yc)) / (
r *
r);
297 cosPhi = (cosPhi > 0 ? 1 : -1);
298 phi =
abs(acos(cosPhi));
301 double signPhi = ((x - xc) * (yg - yc) - (xg - xc) * (y - yc) > 0) ? 1. : -1.;
305 double signOmega = ((x - xc) *
py - (y - yc) *
px > 0) ? 1. : -1.;
310 double dz = signPhi * signOmega * (pz / mom.
transverse()) * phi *
r;