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

#include <TrChebyshev.h>

Inheritance diagram for MuonCalib::TrChebyshev:
Collaboration diagram for MuonCalib::TrChebyshev:

Public Types

using ParVec = std::vector< double >
 

Public Member Functions

 TrChebyshev (const ParVec &vec)
 
virtual std::string name () const override final
 
virtual std::optional< double > driftTime (const double r) const override final
 Interface method for fetching the drift-time from the radius Returns a nullopt if the time is out of the boundaries. More...
 
virtual std::optional< double > driftTimePrime (const double r) const override final
 
virtual std::optional< double > driftTime2Prime (const double r) const override final
 
virtual double minRadius () const override final
 Returns the minimum drift-radius. More...
 
virtual double maxRadius () const override final
 Returns the maximum drift-radius. More...
 
virtual unsigned nDoF () const override final
 Returns the number of degrees of freedom of the tr relation. More...
 
virtual std::string typeName () const override final
 
double getReducedR (const double r) const
 Maps the radius interval [minRadius;maxRadius] to [-1;1] where the minimal radius is on the lower end. More...
 
double getReducedRPrime () const
 Returns the derivative of the reduced radisu w.r.t r. More...
 
unsigned int nPar () const
 
const ParVecparameters () const
 
double par (unsigned int index) const
 

Private Attributes

ParVec m_parameters {}
 

Detailed Description

Definition at line 11 of file TrChebyshev.h.

Member Typedef Documentation

◆ ParVec

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

Definition at line 35 of file CalibFunc.h.

Constructor & Destructor Documentation

◆ TrChebyshev()

MuonCalib::TrChebyshev::TrChebyshev ( const ParVec vec)

Definition at line 10 of file TrChebyshev.cxx.

10  : ITrRelation{vec} {
11  if (minRadius() >= maxRadius()) {
12  THROW_EXCEPTION("Minimum radius greater than maximum radius!");
13  }
14  }

Member Function Documentation

◆ driftTime()

std::optional< double > MuonCalib::TrChebyshev::driftTime ( const double  r) const
finaloverridevirtual

Interface method for fetching the drift-time from the radius Returns a nullopt if the time is out of the boundaries.

Implements MuonCalib::ITrRelation.

Definition at line 17 of file TrChebyshev.cxx.

17  {
18  if (r < minRadius() || r > maxRadius()) return std::nullopt;
19  const double reducedR = getReducedR(r);
20  double time{0.};
21  for (unsigned int k = 0; k < nDoF(); ++k) {
22  time += par(k+2) * chebyshevPoly1st(k, reducedR);
23  }
24  return std::make_optional(time);
25 
26 
27  }

◆ driftTime2Prime()

std::optional< double > MuonCalib::TrChebyshev::driftTime2Prime ( const double  r) const
finaloverridevirtual

Implements MuonCalib::ITrRelation.

Definition at line 39 of file TrChebyshev.cxx.

39  {
40  if (r < minRadius() || r > maxRadius()) return std::nullopt;
41  const double reducedR = getReducedR(r);
42  const double dt_dr = std::pow(getReducedRPrime(), 2);
43  double d2tdr2{0.};
44  for (unsigned int k = 2; k < nDoF(); ++k) {
45  d2tdr2 += par(k+2) * chebyshevPoly1st2Prime(k, reducedR) * dt_dr;
46  }
47  return std::make_optional(d2tdr2);
48  }

◆ driftTimePrime()

std::optional< double > MuonCalib::TrChebyshev::driftTimePrime ( const double  r) const
finaloverridevirtual

Implements MuonCalib::ITrRelation.

Definition at line 28 of file TrChebyshev.cxx.

28  {
29  if (r < minRadius() || r > maxRadius()) return std::nullopt;
30  const double reducedR = getReducedR(r);
31  const double dt_dr = getReducedRPrime();
32  double dtdr{0.};
33  for (unsigned int k = 1; k < nDoF(); ++k) {
34  dtdr += par(k+2) * chebyshevPoly1stPrime(k, reducedR) * dt_dr;
35  }
36  return std::make_optional(dtdr);
37 
38  }

◆ getReducedR()

double MuonCalib::ITrRelation::getReducedR ( const double  r) const
inlineinherited

Maps the radius interval [minRadius;maxRadius] to [-1;1] where the minimal radius is on the lower end.

Definition at line 42 of file ITrRelation.h.

42  {
43  return mapToUnitInterval(r, minRadius(), maxRadius());
44  }

◆ getReducedRPrime()

double MuonCalib::ITrRelation::getReducedRPrime ( ) const
inlineinherited

Returns the derivative of the reduced radisu w.r.t r.

Definition at line 46 of file ITrRelation.h.

46  {
48  }

◆ maxRadius()

double MuonCalib::TrChebyshev::maxRadius ( ) const
finaloverridevirtual

Returns the maximum drift-radius.

Implements MuonCalib::ITrRelation.

Definition at line 51 of file TrChebyshev.cxx.

51 { return par(1); }

◆ minRadius()

double MuonCalib::TrChebyshev::minRadius ( ) const
finaloverridevirtual

Returns the minimum drift-radius.

Implements MuonCalib::ITrRelation.

Definition at line 50 of file TrChebyshev.cxx.

50 { return par(0); }

◆ name()

std::string MuonCalib::TrChebyshev::name ( ) const
finaloverridevirtual

Implements MuonCalib::CalibFunc.

Definition at line 15 of file TrChebyshev.cxx.

15 { return "TrChebyshev"; }

◆ nDoF()

unsigned MuonCalib::TrChebyshev::nDoF ( ) const
finaloverridevirtual

Returns the number of degrees of freedom of the tr relation.

Implements MuonCalib::ITrRelation.

Definition at line 52 of file TrChebyshev.cxx.

52 { 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; }

◆ typeName()

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

Implements MuonCalib::CalibFunc.

Definition at line 24 of file ITrRelation.h.

24 { return "ITrRelation"; }

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:
beamspotman.r
def r
Definition: beamspotman.py:674
MuonCalib::TrChebyshev::maxRadius
virtual double maxRadius() const override final
Returns the maximum drift-radius.
Definition: TrChebyshev.cxx:51
index
Definition: index.py:1
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:9
MuonCalib::CalibFunc::par
double par(unsigned int index) const
Definition: CalibFunc.h:41
MuonCalib::chebyshevPoly1st2Prime
constexpr double chebyshevPoly1st2Prime(const unsigned int order, const double x)
Returns the second derivative of the n-th Chebycheb polynomial of the first kind.
Definition: ChebychevPoly.h:81
MuonCalib::ITrRelation::getReducedR
double getReducedR(const double r) const
Maps the radius interval [minRadius;maxRadius] to [-1;1] where the minimal radius is on the lower end...
Definition: ITrRelation.h:42
MuonCalib::ITrRelation::maxRadius
virtual double maxRadius() const =0
Returns the maximum drift-radius.
MuonCalib::unitIntervalPrime
double unitIntervalPrime(const double lowerEdge, const double upperEdge)
Definition: UtilFunc.h:15
MuonCalib::ITrRelation::minRadius
virtual double minRadius() const =0
Returns the minimum drift-radius.
MuonCalib::TrChebyshev::nDoF
virtual unsigned nDoF() const override final
Returns the number of degrees of freedom of the tr relation.
Definition: TrChebyshev.cxx:52
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
DeMoScan.index
string index
Definition: DeMoScan.py:362
MuonCalib::ITrRelation::getReducedRPrime
double getReducedRPrime() const
Returns the derivative of the reduced radisu w.r.t r.
Definition: ITrRelation.h:46
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
MuonCalib::CalibFunc::m_parameters
ParVec m_parameters
Definition: CalibFunc.h:48
MuonCalib::ITrRelation::ITrRelation
ITrRelation(const ParVec &parameters)
Constructor taking the input r-t relation & the vector of parameters.
Definition: ITrRelation.h:20
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
MuonCalib::chebyshevPoly1stPrime
constexpr double chebyshevPoly1stPrime(const unsigned int order, const double x)
Returns the first derivative of the n-th Chebycheb polynomial of the first kind.
Definition: ChebychevPoly.h:49
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
fitman.k
k
Definition: fitman.py:528
MuonCalib::TrChebyshev::minRadius
virtual double minRadius() const override final
Returns the minimum drift-radius.
Definition: TrChebyshev.cxx:50