#include <RtResolutionFromPoints.h>
Definition at line 30 of file RtResolutionFromPoints.h.
◆ RtResolutionFromPoints()
| MuonCalib::RtResolutionFromPoints::RtResolutionFromPoints |
( |
| ) |
|
|
default |
◆ getRtResolutionChebyshev()
< get an RtResolutionChebyshev resembling the sigma(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 RtResolutionChebyshev
get an RtResolutionLookUp resembling the sigma(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 RtResolutionLookUp
Definition at line 22 of file RtResolutionFromPoints.cxx.
23 {
25
28
29 std::vector<double> res_param(order + 3);
30 BaseFunctionFitter
fitter(order + 1);
31 ChebyshevPolynomial chebyshev;
32 std::vector<SamplePoint> my_points(sample_points);
33
35
37 const auto [tLow ,tHigh] =
interval(sample_points);
38 res_param[0] = tLow;
39 res_param[1] = tHigh;
40 double mean(0.5 * (res_param[1] + res_param[0]));
41 double length(res_param[1] - res_param[0]);
42 for (
unsigned int k = 0;
k < my_points.size();
k++) { my_points[
k].set_x1(2 * (sample_points[k].
x1() -
mean) /
length); }
43
45
47 fitter.fit_parameters(my_points, 1, sample_points.size(), chebyshev);
48 for (
unsigned int k = 0;
k <
order + 1;
k++) { res_param[
k + 2] =
fitter.coefficients()[
k]; }
49
51
53 return RtResolutionChebyshev{res_param};
54}
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="")
IMessageSvc * getMessageSvc(bool quiet=false)
const ShapeFitter * fitter
std::pair< double, double > interval(const std::vector< SamplePoint > &points)
Returns the interval covered by the sample points.
◆ getRtResolutionLookUp()
Definition at line 61 of file RtResolutionFromPoints.cxx.
61 {
63
66 unsigned int nb_points(100);
67 double bin_width((
res.tUpper() -
res.tLower()) /
static_cast<double>(nb_points));
68 std::vector<double> res_param(nb_points + 2);
69
71
73 res_param[0] =
res.tLower();
75 for (
unsigned int k = 0;
k < nb_points;
k++) { res_param[
k + 2] =
res.resolution(
res.tLower() + k * bin_width); }
76 RtResolutionLookUp rt_res_relation_look_up(res_param);
77
78 return rt_res_relation_look_up;
79}
std::pair< std::vector< unsigned int >, bool > res
static RtResolutionChebyshev getRtResolutionChebyshev(const std::vector< SamplePoint > &sample_points, const unsigned int order)
< get an RtResolutionChebyshev resembling the sigma(t) function as described by the sample points in ...
The documentation for this class was generated from the following files: