ATLAS Offline Software
Loading...
Searching...
No Matches
AFPProtonTransportParam.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <utility>
8
9AFPProtonTransportParam::AFPProtonTransportParam(double beam_energy, std::unique_ptr<AFPProtonTransportPolynomial> poly_array[8]) {
10 m_energy = beam_energy;
11 for (int i = 0; i < 8; i++) m_polynomial[i] = std::move(poly_array[i]);
12}
13
14double AFPProtonTransportParam::evaluate(double x0, double y0, double z0, double sx0, double sy0, double E) const {
15 const double xi = (m_energy - E) / m_energy;
16
17 double v0 = m_polynomial[0]->evaluate(xi);
18 double v1 = x0 * m_polynomial[1]->evaluate(xi);
19 double v2 = y0 * m_polynomial[2]->evaluate(xi);
20 double v3 = z0 * m_polynomial[3]->evaluate(xi);
21 double v4 = sx0 * m_polynomial[4]->evaluate(xi);
22 double v5 = sy0 * m_polynomial[5]->evaluate(xi);
23 double v6 = z0 * sx0 * m_polynomial[6]->evaluate(xi);
24 double v7 = z0 * sy0 * m_polynomial[7]->evaluate(xi);
25
26 double value = v0 + v1 + v2 + v3 + v4 + v5 + v6 + v7;
27
28 return value;
29}
double m_energy
Nominal beam energy.
double evaluate(double x0, double y0, double z0, double sx, double sy, double E) const
This function evaluates value of the parameterization given a certain polynomial. It takes as argumen...
AFPProtonTransportParam(double beam_energy, std::unique_ptr< AFPProtonTransportPolynomial > poly_array[8])
Constructor which sets m_energy and m_polynomial.
std::unique_ptr< AFPProtonTransportPolynomial > m_polynomial[8]
Object of the AFPProtonTransportPolynomial class used for the position calculations.