#include <RtFromPoints.h>
This class allows the user to retrieve an RtChebyshev or RtRelationLookUp object corresponding to a set of (r, t) points.
Definition at line 30 of file RtFromPoints.h.
◆ RtFromPoints()
MuonCalib::RtFromPoints::RtFromPoints |
( |
| ) |
|
|
default |
◆ get_min_max()
void RtFromPoints::get_min_max |
( |
const std::vector< SamplePoint > & |
sample_points, |
|
|
double & |
x_min, |
|
|
double & |
x_max |
|
) |
| |
|
staticprivate |
Definition at line 21 of file RtFromPoints.cxx.
22 for (
unsigned int k = 0;
k < sample_points.size();
k++) {
24 x_min = sample_points[
k].x1();
27 if (x_min > sample_points[
k].
x1()) { x_min = sample_points[
k].x1(); }
28 if (x_max < sample_points[
k].
x1()) { x_max = sample_points[
k].x1(); }
◆ getRtChebyshev()
< get an RtChebyshev resembling the r(t) function as described by the sample points in the vector "sample_points"; use Chebyshev polynomials up to order "order"; 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 RtChebyshev
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 39 of file RtFromPoints.cxx.
43 std::vector<double> rt_param(
order + 3);
46 std::vector<SamplePoint> my_points(sample_points);
51 get_min_max(sample_points, rt_param[0], rt_param[1]);
53 double mean(0.5 * (rt_param[1] + rt_param[0]));
54 double length(rt_param[1] - rt_param[0]);
55 for (
unsigned int k = 0;
k < my_points.size();
k++) { my_points[
k].set_x1(2 * (sample_points[
k].
x1() -
mean) /
length); }
60 fitter.fit_parameters(my_points, 1, sample_points.size(), chebyshev);
62 for (
unsigned int k = 0;
k <
order + 1;
k++) { rt_param[
k + 2] =
fitter.coefficients()[
k]; }
◆ getRtRelationLookUp()
Definition at line 76 of file RtFromPoints.cxx.
79 for (
unsigned int i = 0;
i < sample_points.size();
i++) {
80 pars[2 *
i] = sample_points[
i].x1();
81 pars[2 *
i + 1] = sample_points[
i].x2();
86 unsigned int nb_points(100);
87 double bin_width((rt.tUpper() - rt.tLower()) /
static_cast<double>(nb_points - 1));
88 std::vector<double> rt_param(nb_points + 2);
93 rt_param[0] = rt.tLower();
95 for (
unsigned int k = 0;
k < nb_points;
k++) { rt_param[
k + 2] = rt.radius(rt.tLower() +
k *
bin_width); }
98 return rt_relation_look_up;
The documentation for this class was generated from the following files:
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")