Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
TrLegendre.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 #include "GeoModelKernel/throwExcept.h"
8 
9 namespace MuonCalib{
11  if (minRadius() >= maxRadius()) {
12  THROW_EXCEPTION("Minimum radius greater than maximum radius!");
13  }
14  }
15  std::string TrLegendre::name() const { return "TrLegendre"; }
16 
17  std::optional<double> TrLegendre::driftTime(const double r) const {
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) * legendrePoly(k, reducedR);
23  }
24  return std::make_optional(time);
25 
26 
27  }
28  std::optional<double> TrLegendre::driftTimePrime(const double r) const {
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) * legendreDeriv(k, 1, reducedR) * dt_dr;
35  }
36  return std::make_optional(dtdr);
37 
38  }
39  std::optional<double> TrLegendre::driftTime2Prime(const double r) const {
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) * legendreDeriv(k, 2, reducedR) * dt_dr;
46  }
47  return std::make_optional(d2tdr2);
48  }
49  double TrLegendre::minRadius() const { return par(0); }
50  double TrLegendre::maxRadius() const { return par(1); }
51  unsigned TrLegendre::nDoF() const { return nPar() -2; }
52 
53 }
54 
55 
56 
57 
beamspotman.r
def r
Definition: beamspotman.py:676
MuonCalib::TrLegendre::minRadius
virtual double minRadius() const override final
Returns the minimum drift-radius.
Definition: TrLegendre.cxx:49
MuonCalib::TrLegendre::TrLegendre
TrLegendre(const ParVec &vec)
Definition: TrLegendre.cxx:10
MuonCalib::TrLegendre::nDoF
virtual unsigned nDoF() const override final
Returns the number of degrees of freedom of the tr relation.
Definition: TrLegendre.cxx:51
LegendrePoly.h
MuonCalib::TrLegendre::maxRadius
virtual double maxRadius() const override final
Returns the maximum drift-radius.
Definition: TrLegendre.cxx:50
MuonCalib::legendreDeriv
constexpr double legendreDeriv(const unsigned l, const unsigned d, const double x)
Evaluates the n-th derivative of the l-th Legendre polynomial.
Definition: LegendrePoly.h:198
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:9
MuonCalib::CalibFunc::par
double par(unsigned int index) const
Definition: CalibFunc.h:41
MuonCalib::TrLegendre::driftTime2Prime
virtual std::optional< double > driftTime2Prime(const double r) const override final
Definition: TrLegendre.cxx:39
MuonCalib::TrLegendre::driftTimePrime
virtual std::optional< double > driftTimePrime(const double r) const override final
Definition: TrLegendre.cxx:28
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::TrLegendre::name
virtual std::string name() const override final
Definition: TrLegendre.cxx:15
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
MuonCalib::CalibFunc::ParVec
std::vector< double > ParVec
Definition: CalibFunc.h:35
TrLegendre.h
MuonCalib::legendrePoly
constexpr double legendrePoly(const unsigned l, const double x)
Calculates the legendre polynomial of rank l at x.
Definition: LegendrePoly.h:171
THROW_EXCEPTION
#define THROW_EXCEPTION(MESSAGE)
Definition: throwExcept.h:10
MuonCalib::TrLegendre::driftTime
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 ...
Definition: TrLegendre.cxx:17
MuonCalib::ITrRelation::getReducedRPrime
double getReducedRPrime() const
Returns the derivative of the reduced radisu w.r.t r.
Definition: ITrRelation.h:46
MuonCalib::CalibFunc::nPar
unsigned int nPar() const
Definition: CalibFunc.h:39
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
fitman.k
k
Definition: fitman.py:528
MuonCalib::ITrRelation
Definition: ITrRelation.h:17