This class allows the user to retrieve an RtChebyshev or RtRelationLookUp object corresponding to a set of (r, t) points.
More...
#include <RtFromPoints.h>
|
| static std::unique_ptr< IRtRelation > | getRtChebyshev (const std::vector< SamplePoint > &dataPoints, const unsigned order) |
| | Converts a list of r-t data points into a r(t) relation expressed as a series of chebychev polynomials.
|
| static std::unique_ptr< ITrRelation > | getTrChebyshev (const std::vector< SamplePoint > &dataPoints, const unsigned order) |
| | Converts a list of r-t data points into a t(r) relation expressed as a series of chebychev polynomials.
|
| static std::unique_ptr< IRtResolution > | getResoChebyshev (const std::vector< SamplePoint > &dataPoints, const unsigned order) |
| | Converts a list of reso - t into a reso(t) relation expressed as a series of chebychev polynomials.
|
| static std::unique_ptr< IRtResolution > | getResoChebyshev (const std::vector< SamplePoint > &dataPoints, const IRtRelationPtr rtRelPtr, const double relUnc, const unsigned order) |
| | Converts a list of sample points into a drift radius resolution function.
|
| static std::unique_ptr< IRtRelation > | getRtLegendre (const std::vector< SamplePoint > &dataPoints, const unsigned order) |
| | Converts a list of r-t data points into a r(t) relation expressed as a series of legendre polynomials.
|
| static std::unique_ptr< ITrRelation > | getTrLegendre (const std::vector< SamplePoint > &dataPoints, const unsigned order) |
| | Converts a list of t(r) data points into a t(r) relation expressed as a series of legendre polynomials.
|
| static std::unique_ptr< IRtRelation > | getRtSimplePoly (const std::vector< SamplePoint > &dataPoints, const unsigned order) |
| | Converts a list of r(t) data points into a r(t) relation expressed as a series of elementary monomonials.
|
| static std::unique_ptr< ITrRelation > | getTrSimplePoly (const std::vector< SamplePoint > &dataPoints, const unsigned order) |
| | Converts a list of t(r) data points into a t(r) relation expressed as a series of elementary monomonials.
|
| static std::unique_ptr< IRtRelation > | getRtRelationLookUp (const std::vector< SamplePoint > &sample_points) |
This class allows the user to retrieve an RtChebyshev or RtRelationLookUp object corresponding to a set of (r, t) points.
Definition at line 22 of file RtFromPoints.h.
◆ chebyFit()
Executes the fit of chebychev polynomials to the data points.
- Parameters
-
| dataPoints | Data points to fit. No normalization of the domain required |
| order | Number of Chebychev polynomials to use in the fit |
Definition at line 51 of file RtFromPoints.cxx.
52 {
53
54 const auto [minT, maxT] =
interval(dataPoints);
57 ChebyshevPolynomial chebyshev{};
58
59
61 for (
unsigned k = 0;
k <
fitter.coefficients().size();
k++) {
63 }
65}
std::vector< double > ParVec
const ShapeFitter * fitter
std::pair< double, double > interval(const std::vector< SamplePoint > &points)
Returns the interval covered by the sample points.
std::vector< SamplePoint > normalizeDomain(const std::vector< SamplePoint > &dataPoints)
Normalizes the domain of the samples points to the interval -1 to 1.
◆ getResoChebyshev() [1/2]
Converts a list of sample points into a drift radius resolution function.
The resolution is parametrized as a series of Chebychev polynomials.
- Parameters
-
| dataPoints | List of data points to convert. The points need to have a resolution attached |
| rtRelPtr | Pointer to the rt-relation acting as mediator from t -> r |
| relUnc | Relative uncertainty on each point. |
| order | Order of the chebychev polynomial |
Definition at line 88 of file RtFromPoints.cxx.
89 {
91 chebyCoeff.erase(chebyCoeff.begin(), chebyCoeff.begin() +2);
92 return std::make_unique<RadiusResolutionChebyshev>(chebyCoeff, rtRelPtr);
93}
static CalibFunc::ParVec chebyFit(const std::vector< SamplePoint > &dataPoints, const unsigned order)
Executes the fit of chebychev polynomials to the data points.
std::vector< SamplePoint > resoFromRadius(const std::vector< SamplePoint > &points, const double uncert)
Creates a new vector of sample points where the x2 coordinate becomes the x1 coordinate and the resol...
◆ getResoChebyshev() [2/2]
| std::unique_ptr< IRtResolution > RtFromPoints::getResoChebyshev |
( |
const std::vector< SamplePoint > & | dataPoints, |
|
|
const unsigned | order ) |
|
static |
Converts a list of reso - t into a reso(t) relation expressed as a series of chebychev polynomials.
- Parameters
-
| dataPoints | List of data points to be converted x1 -> drift time & x2 -> resolution |
| order | Number of chebychev polynomials to fit |
Definition at line 85 of file RtFromPoints.cxx.
85 {
86 return std::make_unique<RtResolutionChebyshev>(
chebyFit(dataPoints, order));
87}
◆ getRtChebyshev()
| std::unique_ptr< IRtRelation > RtFromPoints::getRtChebyshev |
( |
const std::vector< SamplePoint > & | dataPoints, |
|
|
const unsigned | order ) |
|
static |
Converts a list of r-t data points into a r(t) relation expressed as a series of chebychev polynomials.
- Parameters
-
| dataPoints | List of data points to be converted x1 -> drift time & x2 -> drift radius |
| order | Number of chebychev polynomials to fit |
Definition at line 79 of file RtFromPoints.cxx.
79 {
80 return std::make_unique<RtChebyshev>(
chebyFit(dataPoints, order));
81}
◆ getRtLegendre()
| std::unique_ptr< IRtRelation > RtFromPoints::getRtLegendre |
( |
const std::vector< SamplePoint > & | dataPoints, |
|
|
const unsigned | order ) |
|
static |
Converts a list of r-t data points into a r(t) relation expressed as a series of legendre polynomials.
- Parameters
-
| dataPoints | List of data points to be converted x1 -> drift radius & x2 -> drift time |
| order | Number of legendre polynomials to use in the fit |
Definition at line 95 of file RtFromPoints.cxx.
95 {
96 return std::make_unique<RtLegendre>(
legendreFit(dataPoints, order));
97}
static CalibFunc::ParVec legendreFit(const std::vector< SamplePoint > &dataPoints, const unsigned order)
Executes the fit of Legendre polynomials to the data points.
◆ getRtRelationLookUp()
| std::unique_ptr< IRtRelation > RtFromPoints::getRtRelationLookUp |
( |
const std::vector< SamplePoint > & | sample_points | ) |
|
|
static |
Definition at line 112 of file RtFromPoints.cxx.
112 {
113
114 CalibFunc ::ParVec
pars(2 * dataPoints.size());
115 for (
unsigned i = 0;
i < dataPoints.size();
i++) {
116 pars[2 *
i] = dataPoints[
i].x1();
117 pars[2 *
i + 1] = dataPoints[
i].x2();
118 }
119 RtSpline rt(pars);
120
121
122 unsigned nb_points(100);
123 double bin_width((rt.tUpper() - rt.tLower()) /
static_cast<double>(nb_points - 1));
124 std::vector<double> rt_param(nb_points + 2);
125
127
129 rt_param[0] = rt.tLower();
131 for (
unsigned k = 0;
k < nb_points;
k++) { rt_param[
k + 2] = rt.radius(rt.tLower() + k * bin_width); }
132 return std::make_unique<RtRelationLookUp>(rt_param);
133}
◆ getRtSimplePoly()
| std::unique_ptr< IRtRelation > RtFromPoints::getRtSimplePoly |
( |
const std::vector< SamplePoint > & | dataPoints, |
|
|
const unsigned | order ) |
|
static |
Converts a list of r(t) data points into a r(t) relation expressed as a series of elementary monomonials.
- Parameters
-
| dataPoints | List of data points to be converted x1 -> drift time & x2 -> drift radius |
| order | Order of the maximum monomial in the fit |
Definition at line 101 of file RtFromPoints.cxx.
101 {
102 return std::make_unique<RtSimplePolynomial>(
simplePolyFit(dataPoints, order));
103}
static CalibFunc::ParVec simplePolyFit(const std::vector< SamplePoint > &dataPoints, const unsigned order)
Exectues the fit of simple monomials to the data points.
◆ getTrChebyshev()
| std::unique_ptr< ITrRelation > RtFromPoints::getTrChebyshev |
( |
const std::vector< SamplePoint > & | dataPoints, |
|
|
const unsigned | order ) |
|
static |
Converts a list of r-t data points into a t(r) relation expressed as a series of chebychev polynomials.
- Parameters
-
| dataPoints | List of data points to be converted x1 -> drift radius & x2 -> drift time |
| order | Number of chebychev polynomials to fit |
Definition at line 82 of file RtFromPoints.cxx.
82 {
83 return std::make_unique<TrChebyshev>(
chebyFit(dataPoints, order));
84}
◆ getTrLegendre()
| std::unique_ptr< ITrRelation > RtFromPoints::getTrLegendre |
( |
const std::vector< SamplePoint > & | dataPoints, |
|
|
const unsigned | order ) |
|
static |
Converts a list of t(r) data points into a t(r) relation expressed as a series of legendre polynomials.
- Parameters
-
| dataPoints | List of data points to be converted x1 -> drift radius & x2 -> drift time |
| order | Number of chebychev polynomials to fit |
Definition at line 98 of file RtFromPoints.cxx.
98 {
99 return std::make_unique<TrLegendre>(
legendreFit(dataPoints, order));
100}
◆ getTrSimplePoly()
| std::unique_ptr< ITrRelation > RtFromPoints::getTrSimplePoly |
( |
const std::vector< SamplePoint > & | dataPoints, |
|
|
const unsigned | order ) |
|
static |
Converts a list of t(r) data points into a t(r) relation expressed as a series of elementary monomonials.
- Parameters
-
| dataPoints | List of data points to be converted x1 -> drift radius & x2 -> drift time |
| order | Order of the maximum monomial in the fit get an RtRelationLookUp resembling the r(t) function as described by the sample points in the vector "sample_points"; x1 coordinate of the sample points contains the drift time, x2 the corresponding radius; the method takes the minimum and maximum x1 values in the set of sample points a lower and upper limits in RtRelationLookUp |
Definition at line 104 of file RtFromPoints.cxx.
104 {
105 return std::make_unique<TrSimplePolynomial>(
simplePolyFit(dataPoints, order));
106}
◆ legendreFit()
Executes the fit of Legendre polynomials to the data points.
- Parameters
-
| dataPoints | Data points to fit. No normalization of the domain required |
| order | Number of Legendre polynomials to use in the fit |
Definition at line 37 of file RtFromPoints.cxx.
38 {
39 const auto [minT, maxT] =
interval(dataPoints);
40
43 LegendrePolynomial legendre{};
45 for (
unsigned k = 0;
k <
fitter.coefficients().size();
k++) {
47 }
49}
◆ simplePolyFit()
Exectues the fit of simple monomials to the data points.
- Parameters
-
| dataPoints | Data points to fit. |
| order | Number of Legendre polynomials to use in the fit |
Definition at line 66 of file RtFromPoints.cxx.
67 {
68 const auto [minT, maxT] =
interval(dataPoints);
71 SimplePolynomial simplePoly{};
73 for (
unsigned k = 0;
k <
fitter.coefficients().size();
k++) {
75 }
77
78}
The documentation for this class was generated from the following files: