29 return StatusCode::SUCCESS;
53 return StatusCode::FAILURE;
72 return StatusCode::FAILURE;
88 return StatusCode::SUCCESS;
95 auto fn = [
this,
fun, my_slopeCalculated, my_positionCalculated](
double x,
const Measurement&
m, std::vector<double>&
s, std::vector<double>&
p) {
return (this->*fun)(
x,
m,
s,
p); };
97 constexpr
double tol = 1
e-3;
101 if (
fn(eMax, my_measAFP, my_slopeCalculated, my_positionCalculated) *
fn(eMin, my_measAFP, my_slopeCalculated, my_positionCalculated) >= 0) {
106 return (
fn(eMin, my_measAFP, my_slopeCalculated, my_positionCalculated) < 0) ?
std::max(
fn(eMin, my_measAFP, my_slopeCalculated, my_positionCalculated),
fn(eMax, my_measAFP, my_slopeCalculated, my_positionCalculated)) :
std::min(
fn(eMin, my_measAFP, my_slopeCalculated, my_positionCalculated),
fn(eMax, my_measAFP, my_slopeCalculated, my_positionCalculated));
109 ATH_MSG_VERBOSE(
"==== eMin\teMax\te\tfun(eMin)\tfun(eMax)\tfun(E) ====");
114 while (eMax - eMin > tol) {
115 e = (eMin + eMax)/2.0;
116 ATH_MSG_VERBOSE(
"* " << eMin <<
"\t" << eMax <<
"\t" <<
e <<
"\t" <<
fn(
e, my_measAFP, my_slopeCalculated, my_positionCalculated) <<
"\t" <<
fn(eMin, my_measAFP, my_slopeCalculated, my_positionCalculated) <<
"\t" <<
fn(eMax, my_measAFP, my_slopeCalculated, my_positionCalculated));
117 if (
fn(eMax, my_measAFP, my_slopeCalculated, my_positionCalculated) *
fn(
e, my_measAFP, my_slopeCalculated, my_positionCalculated) < 0)
119 else if (
fn(eMin, my_measAFP, my_slopeCalculated, my_positionCalculated) *
fn(
e, my_measAFP, my_slopeCalculated, my_positionCalculated) < 0)
138 std::vector<double> my_slopeCalculated = {0, 0};
139 std::vector<double> my_positionCalculated = {0, 0};
146 ATH_MSG_DEBUG(
"Reconstructing proton with bisection method...");
147 ATH_MSG_DEBUG(
"Tracks (xNear, yNear; xFar, yFar): " << my_measAFP.
xN <<
", " << my_measAFP.
yN <<
"; "
148 << my_measAFP.
xF <<
", " << my_measAFP.
yF);
156 const double pz =
energy * sqrt(1. - slopeX*slopeX - slopeY*slopeY);
166 ATH_MSG_DEBUG(
"Reconstructing proton with bisection method (single station)...");
167 ATH_MSG_DEBUG(
"Tracks (xFar, yFar): " << my_measAFP.
xF <<
", " << my_measAFP.
yF);
169 std::vector<double> my_slopeCalculated = {0, 0};
170 std::vector<double> my_positionCalculated = {0, 0};
183 (my_positionCalculated.at(0)
193 my_slopeCalculated.at(0)
222 const double Ax =
m_parametrization->getEquation(2 + XorY)->getPolynomial(0)->Eval(xi);
223 const double Bx =
m_parametrization->getEquation(2 + XorY)->getPolynomial(4 + XorY)->Eval(xi);
224 const double Cx =
m_parametrization->getEquation(2 + XorY)->getPolynomial(1 + XorY)->Eval(xi);
225 const double Dx =
m_parametrization->getEquation(2 + XorY)->getPolynomial(6 + XorY)->Eval(xi);
226 const double Ex =
m_parametrization->getEquation(2 + XorY)->getPolynomial(3)->Eval(xi);
228 const double Fx = my_slopeCalculated.at(0 + XorY) - Ax - Cx*
m_vertexIP.at(0 + XorY) - Ex*
m_vertexIP.at(2);
230 const double slp = (Gx == 0) ? 0. :
Fx/Gx;
260 const double dx2 = my_measAFP.
xF - xFar;
261 const double dy2 = my_measAFP.
yF - yFar;
266 return chi2x2 + chi2y2;
269 const double dx1 = my_measAFP.
xN - xNear;
270 const double dx2 = my_measAFP.
xF - xFar;
271 const double dy1 = my_measAFP.
yN - yNear;
272 const double dy2 = my_measAFP.
yF - yFar;
279 return chi2x1 + chi2y1 + chi2x2 + chi2y2;