Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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...
 
virtual std::string name () const override final
 Initialization from a
More...
 
virtual double resolution (double t, double bgRate=0.0) const override final
 returns resolution for a give time and background rate More...
 
virtual double tLower () const
 < get the lower drift-time bound More...
 
virtual double tUpper () const
 get the number of parameters used to describe the resolution More...
 
virtual unsigned int nDoF () const override final
 get the coefficients of the r(t) polynomial More...
 
std::vector< double > resParameters () const
 
virtual std::string typeName () const override final
 
 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 35 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)

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 12 of file RtResolutionChebyshev.cxx.

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

Member Function Documentation

◆ CalibFunc()

MuonCalib::CalibFunc::CalibFunc
inlineexplicitinherited

Definition at line 36 of file CalibFunc.h.

36  :
37  m_parameters{vec} {}

◆ name()

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

Initialization from a

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 22 of file RtResolutionChebyshev.cxx.

22 { return "RtResolutionChebyshev"; }

◆ nDoF()

unsigned int RtResolutionChebyshev::nDoF ( ) const
finaloverridevirtual

get the coefficients of the r(t) polynomial

Implements MuonCalib::IRtResolution.

Definition at line 47 of file RtResolutionChebyshev.cxx.

47 { return nPar() -2; }

◆ nPar()

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

Definition at line 39 of file CalibFunc.h.

39 { return m_parameters.size(); }

◆ par()

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

Definition at line 41 of file CalibFunc.h.

41  {
42  return index < nPar() ? m_parameters[index] : 0.;
43  }

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

returns resolution for a give time and background rate

Implements MuonCalib::IRtResolution.

Definition at line 23 of file RtResolutionChebyshev.cxx.

23  {
25  // INITIAL TIME CHECK //
27  t = std::clamp(t, tLower(), tUpper());
28 
30  // VARIABLES //
32  // argument of the Chebyshev polynomials
33  const double x = mapToUnitInterval(t, tLower(), tUpper());
34  double resol{0.0}; // auxiliary resolution
35 
37  // CALCULATE r(t) //
39  for (unsigned int k = 0; k < nDoF(); k++) {
40  resol = resol + parameters()[k + 2] * chebyshevPoly1st(k, x);
41  }
42 
43  return resol;
44 }

◆ resParameters()

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

Definition at line 48 of file RtResolutionChebyshev.cxx.

48  {
49  std::vector<double> alpha{};
50  alpha.insert(alpha.begin(), parameters().begin()+2, parameters().end());
51  return alpha;
52 }

◆ tLower()

double RtResolutionChebyshev::tLower ( ) const
virtual

< get the lower drift-time bound

get the upper drift-time bound

Definition at line 45 of file RtResolutionChebyshev.cxx.

45 { return par(0); }

◆ tUpper()

double RtResolutionChebyshev::tUpper ( ) const
virtual

get the number of parameters used to describe the resolution

Definition at line 46 of file RtResolutionChebyshev.cxx.

46 { return par(1); }

◆ typeName()

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

Implements MuonCalib::CalibFunc.

Definition at line 24 of file IRtResolution.h.

24 { return "IRtResolution"; }

Member Data Documentation

◆ m_parameters

ParVec MuonCalib::CalibFunc::m_parameters {}
privateinherited

Definition at line 48 of file CalibFunc.h.


The documentation for this class was generated from the following files:
add-xsec-uncert-quadrature-N.alpha
alpha
Definition: add-xsec-uncert-quadrature-N.py:110
index
Definition: index.py:1
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:9
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
MuonCalib::RtResolutionChebyshev::tUpper
virtual double tUpper() const
get the number of parameters used to describe the resolution
Definition: RtResolutionChebyshev.cxx:46
x
#define x
MuonCalib::RtResolutionChebyshev::nDoF
virtual unsigned int nDoF() const override final
get the coefficients of the r(t) polynomial
Definition: RtResolutionChebyshev.cxx:47
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
MuonCalib::CalibFunc::par
double par(unsigned int index) const
Definition: CalibFunc.h:41
MuonCalib::RtResolutionChebyshev::tLower
virtual double tLower() const
< get the lower drift-time bound
Definition: RtResolutionChebyshev.cxx:45
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
THROW_EXCEPTION
#define THROW_EXCEPTION(MESSAGE)
Definition: throwExcept.h:10
MuonCalib::IRtResolution
Generic interface to retrieve the resolution on the drift radius as a function of the drift time.
Definition: IRtResolution.h:20
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:48
MuonCalib::CalibFunc::nPar
unsigned int nPar() const
Definition: CalibFunc.h:39
MuonCalib::mapToUnitInterval
double mapToUnitInterval(const double x, const double lowerEdge, const double upperEdge)
Maps the number x which is in [lowEdge;upperEdge] to the interval [-1;1].
Definition: UtilFunc.h:12
fitman.k
k
Definition: fitman.py:528