25 const double maxDistance,
const double maxAngleTheta2,
26 const double maxAnglePhi2)
const {
28 if ((pos1 - pos2).
norm() > maxDistance) {
38 double diffTheta2 = (theta1 - theta2) * (theta1 - theta2);
39 if (diffTheta2 > maxAngleTheta2) {
43 double diffPhi2 = (phi1 - phi2) * (phi1 - phi2);
44 if (diffPhi2 > maxAnglePhi2) {
75 auto scale = 2 / std::hypot(
x,
y);
77 jacXyzToRhoZ(0,
ePos0) = scale *
x;
78 jacXyzToRhoZ(0,
ePos1) = scale *
y;
79 jacXyzToRhoZ(1,
ePos2) = 1;
82 jacXyzToRhoZ * rotLocalToGlobal.block<3, 2>(
ePos0,
ePos0);
84 ActsVector<2> var = (jac * localCov * jac.transpose()).diagonal();
86 auto gcov =
Vector2(var[0], var[1]);
87 return std::make_pair(globalPos, gcov);
94 const std::function<std::pair<const BoundVector, const BoundSquareMatrix>(
97 const auto var1 = paramCovAccessor(slinkFront).second(0, 0);
98 const auto var2 = paramCovAccessor(slinkBack).second(0, 0);
101 double sigma_x = std::hypot(var1, var2) / (2 * sin(theta * 0.5));
102 double sigma_y = std::hypot(var1, var2) / (2 * cos(theta * 0.5));
105 double sig_x1 = sigma_x * cos(0.5 * theta) + sigma_y * sin(0.5 * theta);
106 double sig_y1 = sigma_y * cos(0.5 * theta) + sigma_x * sin(0.5 * theta);
108 lcov << sig_x1, 0, 0, sig_y1;
120 Vector3 globalFakeMom(1, 1, 1);
125 auto x = globalPos[
ePos0];
126 auto y = globalPos[
ePos1];
127 auto scale = 2 / std::hypot(
x,
y);
129 jacXyzToRhoZ(0,
ePos0) = scale *
x;
130 jacXyzToRhoZ(0,
ePos1) = scale *
y;
131 jacXyzToRhoZ(1,
ePos2) = 1;
134 jacXyzToRhoZ * rotLocalToGlobal.block<3, 2>(
ePos0,
ePos0);
136 ActsVector<2> var = (jac * localCov * jac.transpose()).diagonal();
138 auto gcov =
Vector2(var[0], var[1]);
144 const std::pair<Vector3, Vector3>& stripEnds1,
145 const std::pair<Vector3, Vector3>& stripEnds2,
const Vector3& posVertex,
168 spParams.
firstBtmToTop = stripEnds1.first - stripEnds1.second;
171 stripEnds1.first + stripEnds1.second - 2 * posVertex;
173 stripEnds2.first + stripEnds2.second - 2 * posVertex;
186 if (spParams.
limit == 1. && stripLengthTolerance != 0.) {
187 spParams.
limit = 1. + stripLengthTolerance;
191 if (fabs(spParams.
m) <= spParams.
limit &&
192 fabs(spParams.
n) <= spParams.
limit) {
202 if (stripLengthGapTolerance <= 0.) {
217 if (spParams.
n == 0.) {
246 double secOnFirstScale =
250 if (spParams.
m > 1. && spParams.
n > 1.) {
252 double mOvershoot = spParams.
m - 1.;
254 (spParams.
n - 1.) * secOnFirstScale;
256 double biggerOvershoot = std::max(mOvershoot, nOvershoot);
258 spParams.
m -= biggerOvershoot;
259 spParams.
n -= (biggerOvershoot / secOnFirstScale);
262 if (fabs(spParams.
m) < spParams.
limit &&
263 fabs(spParams.
n) < spParams.
limit) {
270 if (spParams.
m < -1. && spParams.
n < -1.) {
272 double mOvershoot = -(spParams.
m + 1.);
274 -(spParams.
n + 1.) * secOnFirstScale;
276 double biggerOvershoot = std::max(mOvershoot, nOvershoot);
278 spParams.
m += biggerOvershoot;
279 spParams.
n += (biggerOvershoot / secOnFirstScale);
281 if (fabs(spParams.
m) < spParams.
limit &&
282 fabs(spParams.
n) < spParams.
limit) {
291 const std::pair<Vector3, Vector3>& stripEnds1,
292 const std::pair<Vector3, Vector3>& stripEnds2,
305 spParams.
firstBtmToTop = stripEnds1.first - stripEnds1.second;
308 Vector3 ac = stripEnds2.first - stripEnds1.first;
312 if (fabs(denom) > 1
e-6) {