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());
183 double qob = charge / bz;
184 double signed_r = qob * momentum.
transverse();
193 xc = position.
x() + qob * momentum.
y();
194 yc = position.
y() - qob * momentum.
x();
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)) {
261 x2 = d_ab + sign * rb;
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;
std::pair< GlobalTrajectoryParameters, GlobalTrajectoryParameters > trajectoryParameters() const
float distance() const override
static int transverseCoord(double cxa, double cya, double ra, double cxb, double cyb, double rb, double &xg1, double &yg1, double &xg2, double &yg2)
static void circleParameters(const TrackCharge &charge, const GlobalVector &momemtum, const GlobalPoint &position, double &xc, double &yc, double &r, double bz)
TrackCharge charge() const
const GlobalTrajectoryParameters & parameters() const
ret
prodAgent to be discontinued
Global3DPoint GlobalPoint
GlobalPoint globalPosition() const
TrackCharge charge() const
std::pair< GlobalPoint, GlobalPoint > points() const override
bool compute(const TrackCharge &chargeA, const GlobalVector &momentumA, const GlobalPoint &positionA, const TrackCharge &chargeB, const GlobalVector &momentumB, const GlobalPoint &positionB)
bool calculate(const TrajectoryStateOnSurface &sta, const TrajectoryStateOnSurface &stb) override
FreeTrajectoryState const * freeState(bool withErrors=true) const
GlobalVector momentum() const
Abs< T >::type abs(const T &t)
static double zCoord(const GlobalVector &mom, const GlobalPoint &pos, double r, double xc, double yc, double xg, double yg)
GlobalVector momentum() const
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
GlobalPoint position() const
GlobalPoint position() const
const GlobalTrajectoryParameters & globalParameters() const
static GlobalTrajectoryParameters newTrajectory(const GlobalPoint &newpt, const GlobalTrajectoryParameters &oldpar, double bz)
GlobalVector globalMomentum() const
static int position[264][3]
const MagneticField & magneticField() const
TrackCharge charge() const
GlobalPoint crossingPoint() const override