ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
MuonCalib::RtResolutionChebyshev Class Reference

#include <RtResolutionChebyshev.h>

Inheritance diagram for MuonCalib::RtResolutionChebyshev:
Collaboration diagram for MuonCalib::RtResolutionChebyshev:

Public Types

using ParVec = std::vector< double >
 

Public Member Functions

 RtResolutionChebyshev (const ParVec &vec)
 initialization constructor, More...
 
std::string name () const
 get the class name More...
 
double resolution (double t, double bgRate=0.0) const
 returns resolution for a give time and background rate More...
 
double tLower () const
 < get the lower drift-time bound More...
 
double tUpper () const
 get the number of parameters used to describe the resolution More...
 
unsigned int numberOfResParameters () const
 get the coefficients of the r(t) polynomial More...
 
std::vector< double > resParameters () const
 get the reduced time which is the argument of the Chebyshev polynomial More...
 
double get_reduced_time (const double t) const
 
virtual std::string typeName () const override
 
 CalibFunc (const ParVec &vec)
 
unsigned int nPar () const
 
const ParVecparameters () const
 
double par (unsigned int index) const
 

Private Attributes

ParVec m_parameters {}
 

Detailed Description

This class contains the implementation of a spatial resolution \( \sigma \) parametrized by a linear combination of Chebyshev polyonomials.

Convention:

\[ \sigma(t) = \sum_{k=0}^{K} p_k*T_k(2*(t-0.5*(tupper+tlower))/(tupper-tlower) \]

where \( T_k \) is the Chebyshev polynomial of k-th order, tupper and tlower are upper and lower drift-time bounds.

Units: [t] = ns, [r] = mm, [v] = mm/ns.

Definition at line 34 of file RtResolutionChebyshev.h.

Member Typedef Documentation

◆ ParVec

using MuonCalib::CalibFunc::ParVec = std::vector<double>
inherited

Definition at line 35 of file CalibFunc.h.

Constructor & Destructor Documentation

◆ RtResolutionChebyshev()

RtResolutionChebyshev::RtResolutionChebyshev ( const ParVec vec)
explicit

initialization constructor,

size of ParVec - 2 = order of the r(t) polynomial,

ParVec[0] = t_low (smallest allowed drift time), ParVec[1] = t_up (largest allowed drift time). ParVec[2...] = parameters of the Chebyshev polynomial

Definition at line 10 of file RtResolutionChebyshev.cxx.

10  :
11  IRtResolution(vec) {
12  // check for consistency //
13  if (nPar() < 3) {
14  THROW_EXCEPTION("Not enough parameters!");
15  }
16  if (tLower() >= tUpper()) {
17  THROW_EXCEPTION("Lower time boundary >= upper time boundary!");
18  }
19 }

Member Function Documentation

◆ CalibFunc()

MuonCalib::CalibFunc::CalibFunc
inlineexplicitinherited

Definition at line 36 of file CalibFunc.h.

36  :
37  m_parameters{vec} {}

◆ get_reduced_time()

double RtResolutionChebyshev::get_reduced_time ( const double  t) const
inline

Definition at line 58 of file RtResolutionChebyshev.cxx.

58  {
59  return 2 * (t - 0.5 * (tUpper() + tLower())) / (tUpper() - tLower());
60 }

◆ name()

std::string RtResolutionChebyshev::name ( ) const
virtual

get the class name

get the resolution corresponding to the drift time t; if t is not within [t_low, t_up] an unphysical radius of 99999 is returned; the background rate is ignored in present implementation

Implements MuonCalib::CalibFunc.

Definition at line 20 of file RtResolutionChebyshev.cxx.

20 { return std::string("RtResolutionChebyshev"); }

◆ nPar()

unsigned int MuonCalib::CalibFunc::nPar ( ) const
inlineinherited

Definition at line 39 of file CalibFunc.h.

39 { return m_parameters.size(); }

◆ numberOfResParameters()

unsigned int RtResolutionChebyshev::numberOfResParameters ( ) const

get the coefficients of the r(t) polynomial

Definition at line 51 of file RtResolutionChebyshev.cxx.

51 { return nPar() - 2; }

◆ par()

double MuonCalib::CalibFunc::par ( unsigned int  index) const
inlineinherited

Definition at line 41 of file CalibFunc.h.

41  {
42  if (index < nPar())
43  return m_parameters[index];
44  else
45  return 0.;
46  }

◆ parameters()

const ParVec& MuonCalib::CalibFunc::parameters ( ) const
inlineinherited

Definition at line 40 of file CalibFunc.h.

40 { return m_parameters; }

◆ resolution()

double RtResolutionChebyshev::resolution ( double  t,
double  bgRate = 0.0 
) const
virtual

returns resolution for a give time and background rate

Implements MuonCalib::IRtResolution.

Definition at line 21 of file RtResolutionChebyshev.cxx.

21  {
23  // INITIAL TIME CHECK //
25 
26  if (t != tLower() && t != tUpper()) {
27  // get resolution for tmin and tmax to get reasonable boundary conditrions
28  double res_min(resolution(tLower())), res_max(resolution(tUpper()));
29 
30  // if x is out of bounds, return 99999 //
31  if (t < tLower()) return res_min;
32 
33  if (t > tUpper()) return res_max;
34  }
36  // VARIABLES //
38  // argument of the Chebyshev polynomials
39  double x(2 * (t - 0.5 * (tUpper() + tLower())) / (tUpper() - tLower()));
40  double resol(0.0); // auxiliary resolution
41 
43  // CALCULATE r(t) //
45  for (unsigned int k = 0; k < nPar() - 2; k++) { resol = resol + parameters()[k + 2] * chebyshevPoly1st(k, x); }
46 
47  return resol;
48 }

◆ resParameters()

std::vector< double > RtResolutionChebyshev::resParameters ( ) const

get the reduced time which is the argument of the Chebyshev polynomial

Definition at line 52 of file RtResolutionChebyshev.cxx.

52  {
53  std::vector<double> alpha(nPar() - 2);
54  for (unsigned int k = 0; k < alpha.size(); k++) { alpha[k] = parameters()[k + 2]; }
55 
56  return alpha;
57 }

◆ tLower()

double RtResolutionChebyshev::tLower ( ) const

< get the lower drift-time bound

get the upper drift-time bound

Definition at line 49 of file RtResolutionChebyshev.cxx.

49 { return parameters()[0]; }

◆ tUpper()

double RtResolutionChebyshev::tUpper ( ) const

get the number of parameters used to describe the resolution

Definition at line 50 of file RtResolutionChebyshev.cxx.

50 { return parameters()[1]; }

◆ typeName()

virtual std::string MuonCalib::IRtResolution::typeName ( ) const
inlineoverridevirtualinherited

Implements MuonCalib::CalibFunc.

Definition at line 17 of file IRtResolution.h.

17 { return "IRtResolution"; }

Member Data Documentation

◆ m_parameters

ParVec MuonCalib::CalibFunc::m_parameters {}
privateinherited

Definition at line 51 of file CalibFunc.h.


The documentation for this class was generated from the following files:
index
Definition: index.py:1
MuonCalib::RtResolutionChebyshev::resolution
double resolution(double t, double bgRate=0.0) const
returns resolution for a give time and background rate
Definition: RtResolutionChebyshev.cxx:21
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
THROW_EXCEPTION
#define THROW_EXCEPTION(MSG)
Definition: MMReadoutElement.cxx:48
MuonCalib::RtResolutionChebyshev::tUpper
double tUpper() const
get the number of parameters used to describe the resolution
Definition: RtResolutionChebyshev.cxx:50
x
#define x
MuonCalib::RtResolutionChebyshev::tLower
double tLower() const
< get the lower drift-time bound
Definition: RtResolutionChebyshev.cxx:49
MuonCalib::chebyshevPoly1st
constexpr double chebyshevPoly1st(const unsigned int order, const double x)
Returns the n-th Chebyshev polynomial of first kind evaluated at x (c.f.
Definition: ChebychevPoly.h:13
MuonCalib::IRtResolution
generic interface for a resolution function
Definition: IRtResolution.h:13
DeMoScan.index
string index
Definition: DeMoScan.py:364
MuonCalib::CalibFunc::parameters
const ParVec & parameters() const
Definition: CalibFunc.h:40
MuonCalib::CalibFunc::m_parameters
ParVec m_parameters
Definition: CalibFunc.h:51
MuonCalib::CalibFunc::nPar
unsigned int nPar() const
Definition: CalibFunc.h:39
fitman.k
k
Definition: fitman.py:528