ATLAS Offline Software
Parameterization.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 #ifndef AFP_GLOBRECO_PARAMETRIZATION_H
7 #define AFP_GLOBRECO_PARAMETRIZATION_H
8 
9 // STL include(s):
10 #include <memory>
11 #include <array>
12 #include <string>
13 #include <iostream>
14 #include <fstream>
15 #include <sstream>
16 
17 // ROOT include(s):
18 #include <TF1.h>
19 
20 namespace AFP {
21 
24 
26  class Equation {
27  public:
29  Equation(double energy, std::vector<std::unique_ptr<TF1>> polynomial) : m_energy(energy), m_polynomial(std::move(polynomial)) {}
30 
32  double evaluate(double x, double y, double z, double sx, double sy, double E) const;
33 
35  const TF1* getPolynomial(int iPoly) const { return m_polynomial.at(iPoly).get(); };
36 
37  private:
39  double m_energy;
40 
42  std::vector<std::unique_ptr<TF1>> m_polynomial;
43  };
44 
45  public:
48  Parameterization(std::string_view filename);
49 
51  double x(double x0, double y0, double z0, double sx0, double sy0, double E) const;
52 
54  double y(double x0, double y0, double z0, double sx0, double sy0, double E) const;
55 
57  double sx(double x0, double y0, double z0, double sx0, double sy0, double E) const;
58 
60  double sy(double x0, double y0, double z0, double sx0, double sy0, double E) const;
61 
64 
66  double energy() const { return m_energy; }
67 
69  const Equation* getEquation(int iEqu) const { return m_equation.at(iEqu).get(); }
70 
72  bool yIsUsed() const { return m_yIsUsed; }
73 
74  private:
76  static constexpr int m_numberOfPolynomials = 8;
77 
79  static constexpr int m_numberOfEquations = 4;
80 
82  std::array<double, 2> m_slopeInitIP;
83 
85  std::array<double, 3> m_positionInitIP;
86 
88  double m_energy;
89 
92 
94  std::vector<std::unique_ptr<Equation>> m_equation;
95 
97  bool m_yIsUsed;
98  };
99 }
100 
101 #endif // AFP_GLOBRECO_PARAMETRIZATION_H
AFP::Parameterization::Equation::getPolynomial
const TF1 * getPolynomial(int iPoly) const
Returns const raw poiner to polynomial of number iPoly.
Definition: Parameterization.h:35
AFP::Parameterization::parametrizationPosition
double parametrizationPosition() const
Returns position for which parametrization was performed.
Definition: Parameterization.h:63
AFP::Parameterization::yIsUsed
bool yIsUsed() const
Returns m_yIsUsed.
Definition: Parameterization.h:72
AFP::Parameterization
Class representing transport parameterisation as four Equation.
Definition: Parameterization.h:23
AFP::Parameterization::m_yIsUsed
bool m_yIsUsed
True if y measurements are used in reconstruction.
Definition: Parameterization.h:97
AFP::Parameterization::getEquation
const Equation * getEquation(int iEqu) const
Returns const raw pointer to equation of number iEqu.
Definition: Parameterization.h:69
AFP::Parameterization::m_parametrizationPosition
double m_parametrizationPosition
Position for which the parameterisation was performed.
Definition: Parameterization.h:91
AFP
Header file for interface of SiGlobAlignDBTool used to read global alignment for database.
Definition: ISiGlobAlignDBTool.h:18
AFP::Parameterization::m_equation
std::vector< std::unique_ptr< Equation > > m_equation
Vector of equations: 0 - x, 1 - y, 2 - sx, 3 - sy.
Definition: Parameterization.h:94
AFP::Parameterization::m_slopeInitIP
std::array< double, 2 > m_slopeInitIP
Crossing angles in rad.
Definition: Parameterization.h:82
z
#define z
AFP::Parameterization::Equation
Local class for storing parameterization equation.
Definition: Parameterization.h:26
AFP::Parameterization::m_energy
double m_energy
Nominal beam energy.
Definition: Parameterization.h:88
AFP::Parameterization::Equation::evaluate
double evaluate(double x, double y, double z, double sx, double sy, double E) const
Evaluates value of function with given initial positions, slopes and energy.
Definition: Parameterization.cxx:102
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
AFP::Parameterization::Equation::m_polynomial
std::vector< std::unique_ptr< TF1 > > m_polynomial
Vector of TF1 polynomials.
Definition: Parameterization.h:42
AFP::Parameterization::Parameterization
Parameterization(std::string_view filename)
Takes filename of parametrization file as argument.
Definition: Parameterization.cxx:9
VP1PartSpect::E
@ E
Definition: VP1PartSpectFlags.h:21
AFP::Parameterization::sy
double sy(double x0, double y0, double z0, double sx0, double sy0, double E) const
Evaluates value of vertical slope equation.
Definition: Parameterization.cxx:98
AFP::Parameterization::m_positionInitIP
std::array< double, 3 > m_positionInitIP
Initial vertex postition.
Definition: Parameterization.h:85
AFP::Parameterization::Equation::Equation
Equation(double energy, std::vector< std::unique_ptr< TF1 >> polynomial)
Takes nominal energy and vector of polynomials as arguments.
Definition: Parameterization.h:29
AFP::Parameterization::Equation::m_energy
double m_energy
Nominal energy of proton.
Definition: Parameterization.h:35
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
AFP::Parameterization::sx
double sx(double x0, double y0, double z0, double sx0, double sy0, double E) const
Evaluates value of horizontal slope equation.
Definition: Parameterization.cxx:94
AFP::Parameterization::m_numberOfEquations
static constexpr int m_numberOfEquations
Number of equations - each for one measured value.
Definition: Parameterization.h:79
AFP::Parameterization::m_numberOfPolynomials
static constexpr int m_numberOfPolynomials
Number of polynomials in equation.
Definition: Parameterization.h:76
AFP::Parameterization::energy
double energy() const
Returns nominal energy for which parametrization was performed.
Definition: Parameterization.h:66
AFP::Parameterization::y
double y(double x0, double y0, double z0, double sx0, double sy0, double E) const
Evaluates value of vertical position equation.
Definition: Parameterization.cxx:90
AFP::Parameterization::x
double x(double x0, double y0, double z0, double sx0, double sy0, double E) const
Evaluates value of horizontal position equation.
Definition: Parameterization.cxx:86