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

#include <RtResolutionFromPoints.h>

Collaboration diagram for MuonCalib::RtResolutionFromPoints:

Public Member Functions

 RtResolutionFromPoints (void)
 Default constructor. More...
 

Static Public Member Functions

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 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 More...
 
static RtResolutionLookUp getRtResolutionLookUp (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

Definition at line 30 of file RtResolutionFromPoints.h.

Constructor & Destructor Documentation

◆ RtResolutionFromPoints()

MuonCalib::RtResolutionFromPoints::RtResolutionFromPoints ( void  )
inline

Default constructor.

Definition at line 33 of file RtResolutionFromPoints.h.

Member Function Documentation

◆ get_min_max()

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

Definition at line 20 of file RtResolutionFromPoints.cxx.

20  {
21  for (unsigned int k = 0; k < sample_points.size(); k++) {
22  if (k == 0) {
23  x_min = sample_points[k].x1();
24  x_max = x_min;
25  }
26  if (x_min > sample_points[k].x1()) { x_min = sample_points[k].x1(); }
27  if (x_max < sample_points[k].x1()) { x_max = sample_points[k].x1(); }
28  }
29 
30  return;
31 }

◆ getRtResolutionChebyshev()

RtResolutionChebyshev RtResolutionFromPoints::getRtResolutionChebyshev ( const std::vector< SamplePoint > &  sample_points,
const unsigned int &  order 
)
static

< 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 38 of file RtResolutionFromPoints.cxx.

39  {
41  // VARIABLES //
43  MsgStream log(Athena::getMessageSvc(), "RtResolutionChebyshev");
44 
45  std::vector<double> res_param(order + 3); // input parameters of RtChebyshev
46  BaseFunctionFitter fitter(order + 1); // Chebyshev fitter
47  ChebyshevPolynomial chebyshev; // Chebyshev polynomial
48  std::vector<SamplePoint> my_points(sample_points); // copy of the sample to add reduced times
49 
51  // GET THE MINIMUM AND MAXIMUM TIMES AND CALCULATE REDUCED TIMES //
53  get_min_max(sample_points, res_param[0], res_param[1]);
54 
55  double mean(0.5 * (res_param[1] + res_param[0]));
56  double length(res_param[1] - res_param[0]);
57  for (unsigned int k = 0; k < my_points.size(); k++) { my_points[k].set_x1(2 * (sample_points[k].x1() - mean) / length); }
58 
60  // PERFORM A CHEBYSHEV FIT TO THE SAMPLE POINTS //
62  if (fitter.fit_parameters(my_points, 1, sample_points.size(), &chebyshev)) {
63  log << MSG::WARNING << "Could not determine Chebyshev coefficients." << endmsg;
64  }
65  for (unsigned int k = 0; k < order + 1; k++) { res_param[k + 2] = fitter.coefficients()[k]; }
66 
68  // CREATE AN RtChebyshev OBJECT WITH THE CORRECT PARAMETERS //
70  RtResolutionChebyshev rt_res_chebyshev(res_param);
71 
72  return rt_res_chebyshev;
73 }

◆ getRtResolutionLookUp()

RtResolutionLookUp RtResolutionFromPoints::getRtResolutionLookUp ( const std::vector< SamplePoint > &  sample_points)
static

Definition at line 80 of file RtResolutionFromPoints.cxx.

80  {
82  // VARIABLES //
84  RtResolutionChebyshev res(getRtResolutionChebyshev(sample_points, 8)); // auxiliary resolution-t
85  unsigned int nb_points(100); // number of (r, t) points
86  double bin_width((res.tUpper() - res.tLower()) / static_cast<double>(nb_points)); // step size
87  std::vector<double> res_param(nb_points + 2); // r-t parameters
88 
90  // CREATE AN RtRelationLookUp OBJECT WITH THE CORRECT PARAMETERS //
92  res_param[0] = res.tLower();
93  res_param[1] = bin_width;
94  for (unsigned int k = 0; k < nb_points; k++) { res_param[k + 2] = res.resolution(res.tLower() + k * bin_width); }
95  RtResolutionLookUp rt_res_relation_look_up(res_param);
96 
97  return rt_res_relation_look_up;
98 }

The documentation for this class was generated from the following files:
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:29
MuonCalib::RtResolutionFromPoints::getRtResolutionChebyshev
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 ...
Definition: RtResolutionFromPoints.cxx:38
CheckAppliedSFs.bin_width
bin_width
Definition: CheckAppliedSFs.py:242
MuonCalib::RtResolutionFromPoints::get_min_max
static void get_min_max(const std::vector< SamplePoint > &sample_points, double &x_min, double &x_max)
Definition: RtResolutionFromPoints.cxx:20
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
MuonCalib::BaseFunctionFitter
Definition: BaseFunctionFitter.h:47
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
mc.order
order
Configure Herwig7.
Definition: mc.Herwig7_Dijet.py:12
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
MuonCalib::RtResolutionChebyshev
Definition: RtResolutionChebyshev.h:50
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
length
double length(const pvec &v)
Definition: FPGATrackSimLLPDoubletHoughTransformTool.cxx:26
fitman.k
k
Definition: fitman.py:528
MuonCalib::RtResolutionLookUp
Equidistant look up table for resolution tables with the time as key.
Definition: RtResolutionLookUp.h:23