ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Static Private Member Functions | List of all members
MuonCalib::RtFromPoints Class Reference

#include <RtFromPoints.h>

Collaboration diagram for MuonCalib::RtFromPoints:

Public Member Functions

 RtFromPoints ()=default
 Default constructor. More...
 

Static Public Member Functions

static RtChebyshev getRtChebyshev (const std::vector< SamplePoint > &sample_points, const unsigned int &order)
 < 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 More...
 
static RtRelationLookUp getRtRelationLookUp (const std::vector< SamplePoint > &sample_points)
 

Static Private Member Functions

static void get_min_max (const std::vector< SamplePoint > &sample_points, double &x_min, double &x_max)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ RtFromPoints()

MuonCalib::RtFromPoints::RtFromPoints ( )
default

Default constructor.

Member Function Documentation

◆ 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.

21  {
22  for (unsigned int k = 0; k < sample_points.size(); k++) {
23  if (k == 0) {
24  x_min = sample_points[k].x1();
25  x_max = x_min;
26  }
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(); }
29  }
30 
31  return;
32 }

◆ getRtChebyshev()

RtChebyshev RtFromPoints::getRtChebyshev ( const std::vector< SamplePoint > &  sample_points,
const unsigned int &  order 
)
static

< 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.

39  {
41  // VARIABLES //
43  std::vector<double> rt_param(order + 3); // input parameters of RtChebyshev
44  BaseFunctionFitter fitter(order + 1); // Chebyshev fitter
45  ChebyshevPolynomial chebyshev; // Chebyshev polynomial
46  std::vector<SamplePoint> my_points(sample_points); // copy of the sample to add reduced times
47 
49  // GET THE MINIMUM AND MAXIMUM TIMES AND CALCULATE REDUCED TIMES //
51  get_min_max(sample_points, rt_param[0], rt_param[1]);
52 
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); }
56 
58  // PERFORM A CHEBYSHEV FIT TO THE SAMPLE POINTS //
60  fitter.fit_parameters(my_points, 1, sample_points.size(), chebyshev);
61 
62  for (unsigned int k = 0; k < order + 1; k++) { rt_param[k + 2] = fitter.coefficients()[k]; }
63 
65  // CREATE AN RtChebyshev OBJECT WITH THE CORRECT PARAMETERS //
67  RtChebyshev rt_chebyshev(rt_param);
68  return rt_chebyshev;
69 } // end RtFromPoints::getRtChebyshev

◆ getRtRelationLookUp()

RtRelationLookUp RtFromPoints::getRtRelationLookUp ( const std::vector< SamplePoint > &  sample_points)
static

Definition at line 76 of file RtFromPoints.cxx.

76  {
77  // create spline rt relation
78  CalibFunc ::ParVec pars(2 * sample_points.size());
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();
82  }
83  RtSpline rt(pars);
84 
85  // variables
86  unsigned int nb_points(100); // number of (r, t) points
87  double bin_width((rt.tUpper() - rt.tLower()) / static_cast<double>(nb_points - 1)); // step size
88  std::vector<double> rt_param(nb_points + 2); // r-t parameters
89 
91  // CREATE AN RtRelationLookUp OBJECT WITH THE CORRECT PARAMETERS //
93  rt_param[0] = rt.tLower();
94  rt_param[1] = bin_width;
95  for (unsigned int k = 0; k < nb_points; k++) { rt_param[k + 2] = rt.radius(rt.tLower() + k * bin_width); }
96  RtRelationLookUp rt_relation_look_up(rt_param);
97 
98  return rt_relation_look_up;
99 }

The documentation for this class was generated from the following files:
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
LArSamples::FitterData::fitter
const ShapeFitter * fitter
Definition: ShapeFitter.cxx:23
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
mean
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="")
Definition: dependence.cxx:254
MuonCalib::ChebyshevPolynomial
Definition: ChebyshevPolynomial.h:17
CheckAppliedSFs.bin_width
bin_width
Definition: CheckAppliedSFs.py:242
MuonCalib::RtChebyshev
Definition: RtChebyshev.h:29
MuonCalib::RtRelationLookUp
Equidistant look up table for rt-relations with the time as key.
Definition: RtRelationLookUp.h:23
MuonCalib::BaseFunctionFitter
Definition: BaseFunctionFitter.h:39
lumiFormat.i
int i
Definition: lumiFormat.py:85
mc.order
order
Configure Herwig7.
Definition: mc.Herwig7_Dijet.py:12
MuonCalib::CalibFunc::ParVec
std::vector< double > ParVec
Definition: CalibFunc.h:35
MuonCalib::RtSpline
Definition: RtSpline.h:45
MuonCalib::RtFromPoints::get_min_max
static void get_min_max(const std::vector< SamplePoint > &sample_points, double &x_min, double &x_max)
Definition: RtFromPoints.cxx:21
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
fitman.k
k
Definition: fitman.py:528