9 #define Conv4HitsReco2_cxx 18 Refresh(vPhotVertex, h1, h2, h3, h4);
73 double x11, x12, x21, x22, y11, y12, y21, y22;
89 double AbsCOSP = std::fabs(COSP);
91 double X11 = -std::fabs(x11 * SINP * SignCOSP - y11 * AbsCOSP);
92 double Y11 = std::fabs(y11 * SINP * SignCOSP + x11 * AbsCOSP);
94 double X21 = -std::fabs(x21 * SINP * SignCOSP - y21 * AbsCOSP);
95 double Y21 = std::fabs(y21 * SINP * SignCOSP + x21 * AbsCOSP);
97 double X12 = std::fabs(x12 * SINP * SignCOSP - y12 * AbsCOSP);
98 double Y12 = std::fabs(y12 * SINP * SignCOSP + x12 * AbsCOSP);
100 double X22 = std::fabs(x22 * SINP * SignCOSP - y22 * AbsCOSP);
101 double Y22 = std::fabs(y22 * SINP * SignCOSP + x22 * AbsCOSP);
103 V11.SetXYZ(X11, Y11, 0.);
104 V12.SetXYZ(X12, Y12, 0.);
105 V21.SetXYZ(X21, Y21, 0.);
106 V22.SetXYZ(X22, Y22, 0.);
120 double x11, x12, x21, x22, y11, y12, y21, y22;
137 double tempr1 =
std::sqrt(y11 * y11 + x11 * x11);
138 double tempr2 =
std::sqrt(y12 * y12 + x12 * x12);
140 double Phi1 = 2.0 * std::atan(y11 / (x11 + tempr1));
141 double Phi2 = 2.0 * std::atan(y12 / (x12 + tempr2));
144 Phi1 += 2.0 * 3.141592653;
148 double NextPhi = (Phi1 + Phi2) / 2.0;
160 double SignCOSP = 1.;
163 double AbsCOSP = std::fabs(COSP);
165 double X11 = -std::fabs(x11 * SINP * SignCOSP - y11 * AbsCOSP);
166 double Y11 = std::fabs(y11 * SINP * SignCOSP + x11 * AbsCOSP);
168 double X21 = -std::fabs(x21 * SINP * SignCOSP - y21 * AbsCOSP);
169 double Y21 = std::fabs(y21 * SINP * SignCOSP + x21 * AbsCOSP);
171 double X12 = std::fabs(x12 * SINP * SignCOSP - y12 * AbsCOSP);
172 double Y12 = std::fabs(y12 * SINP * SignCOSP + x12 * AbsCOSP);
174 double X22 = std::fabs(x22 * SINP * SignCOSP - y22 * AbsCOSP);
175 double Y22 = std::fabs(y22 * SINP * SignCOSP + x22 * AbsCOSP);
179 double d1 = Y21 - Y11;
180 double d2 = Y22 - Y12;
182 if (((X11 * X11 *
d1 *
d1 / (X21 - X11) / (X21 - X11) + X11 * X21 + X11 *
d1 *
d1 / (X21 - X11)) < 0) ||
183 ((X12 * X12 * d2 * d2 / (X22 - X12) / (X22 - X12) + X12 * X22 + X12 * d2 * d2 / (X22 - X12)) < 0)) {
191 D1 = X11 *
d1 / (X21 - X11);
192 D1 =
D1 +
std::sqrt(X11 * X11 *
d1 *
d1 / (X21 - X11) / (X21 - X11) + X11 * X21 + X11 *
d1 *
d1 / (X21 - X11));
193 D2 = X12 * d2 / (X22 - X12);
194 D2 =
D2 +
std::sqrt(X12 * X12 * d2 * d2 / (X22 - X12) / (X22 - X12) + X12 * X22 + X12 * d2 * d2 / (X22 - X12));
196 R1 = std::fabs((X11 + X21) / 2.0 + (
D1 +
d1 / 2.0) *
d1 / (X21 - X11));
197 R2 = std::fabs((X12 + X22) / 2.0 + (
D2 + d2 / 2.0) * d2 / (X22 - X12));
199 if ((Y11 -
D1) >= (Y12 -
D2)) {
202 NextPhi = (Phi1 + Phi2) / 2.0;
203 }
else if ((Y11 -
D1) < (Y12 -
D2)) {
206 NextPhi = (Phi1 + Phi2) / 2.0;
210 double tmpPhiE = std::fabs(Phi1 - Phi2);
211 double tmpRE = std::fabs((Y11 -
D1) - (Y12 -
D2));
212 double tmpRadiusE = (std::fabs(R1 - prevR1) + std::fabs(R2 - prevR2)) / 2.;
235 if ((R1 > 0) && (R2 > 0) && (
D1 > 0) && (
D2 > 0) && ((Y11 -
D1) > 0) && ((Y12 -
D2) > 0))
239 }
else if (
i ==
fLoop - 1) {
258 if ((R1 > 0) && (R2 > 0) && (
D1 > 0) && (
D2 > 0) && ((Y11 -
D1) > 0) && ((Y12 -
D2) > 0))
271 std::cout << std::endl <<
"================================================" << std::endl;
int fFixedNumberOfIterations
Sin< T >::type sin(const T &t)
void LocalTransformation(const math::XYZVector &v11, const math::XYZVector &v12, const math::XYZVector &v21, const math::XYZVector &v22, math::XYZVector &V11, math::XYZVector &V12, math::XYZVector &V21, math::XYZVector &V22, double Phi)
math::XYZVector GetMinusCenter(double &)
int ConversionCandidate(math::XYZVector &, double &, double &)
Cos< T >::type cos(const T &t)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
int fMaxNumberOfIterations
void Refresh(math::XYZVector &vPhotVertex, math::XYZVector &h1, math::XYZVector &h2, math::XYZVector &h3, math::XYZVector &h4)
math::XYZVector GetPlusCenter(double &)
static constexpr float d1
Power< A, B >::type pow(const A &a, const B &b)