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

#include <RtSpline.h>

Inheritance diagram for MuonCalib::RtSpline:
Collaboration diagram for MuonCalib::RtSpline:

Public Types

using ParVec = std::vector< double >
 

Public Member Functions

 RtSpline (const ParVec &vec)
 initialization constructor, More...
 
virtual ~RtSpline ()
 
std::string name () const override final
 get the class name More...
 
virtual double radius (double t) const override final
 get the radius corresponding to the drift time t; 0 or 14.6 is returned if t is outside the range More...
 
virtual double driftVelocity (double t) const override final
 get the drift velocity More...
 
virtual double driftAcceleration (double t) const override final
 Returns the acceleration of the r-t relation. More...
 
virtual double tLower () const override final
 get the lower drift-time bound More...
 
virtual double tUpper () const override final
 get the upper drift-time bound More...
 
virtual double tBinWidth () const override final
 Returns the step-size for the sampling. More...
 
virtual std::string typeName () const override final
 
double GetTmaxDiff () const
 return the difference in total dirft time between the two multilayers (ML1 - ML2) More...
 
bool hasTmaxDiff () const
 
void SetTmaxDiff (const double d)
 set the difference in total drift time betwene the two multilayers (ML1 - ML2) More...
 
 CalibFunc (const ParVec &vec)
 
unsigned int nPar () const
 
const ParVecparameters () const
 
double par (unsigned int index) const
 

Static Protected Attributes

static constexpr double s_tBinWidth = 1.e-3
 

Private Attributes

std::unique_ptr< TSpline3 > m_sp3 {}
 
std::optional< double > m_tmax_diff {std::nullopt}
 
ParVec m_parameters {}
 

Detailed Description

This class contains the implementation of an r(t) relationship parameterized as support points to a cubic spline

Author
Felix.nosp@m..Rau.nosp@m.scher.nosp@m.@cer.nosp@m.n.ch
Date
07.08.2007

Definition at line 45 of file RtSpline.h.

Member Typedef Documentation

◆ ParVec

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

Definition at line 35 of file CalibFunc.h.

Constructor & Destructor Documentation

◆ RtSpline()

MuonCalib::RtSpline::RtSpline ( const ParVec vec)
explicit

initialization constructor,

2 * (size of ParVec) = number of points

ParVec[ 2n] = x coordinate of n_th support point ParVec[1 + 2n] = y coordinate of n_th support point

Definition at line 20 of file RtSpline.cxx.

20  :
21  IRtRelation(vec) {
22  // check for minimum number of parameters
23  if (nPar() < 6) {
24  THROW_EXCEPTION("Not enough parameters!" << std::endl<< "Minimum number of parameters is 6!");
25  }
26  // check if the number of parameters is even
27  if ((nPar() % 2) != 0) {
28  THROW_EXCEPTION("RtSpline::_init(): Odd number of parameters!");
29  }
30  // create spline
31  std::vector<double> x(nPar() /2);
32  std::vector<double> y(nPar() /2);
33  for (unsigned int i = 0; i < nPar() / 2; i++) {
34  x[i] = par(2 * i);
35  y[i] = par(2 * i + 1);
36  }
37  m_sp3 = std::make_unique<TSpline3>("Rt Relation", x.data(), y.data(), nPar() / 2, "b2e2", 0, 0);
38  } // end RtSpline::_init

◆ ~RtSpline()

MuonCalib::RtSpline::~RtSpline ( )
virtualdefault

Member Function Documentation

◆ CalibFunc()

MuonCalib::CalibFunc::CalibFunc
inlineexplicitinherited

Definition at line 36 of file CalibFunc.h.

36  :
37  m_parameters{vec} {}

◆ driftAcceleration()

double MuonCalib::RtSpline::driftAcceleration ( double  t) const
finaloverridevirtual

Returns the acceleration of the r-t relation.

Implements MuonCalib::IRtRelation.

Definition at line 51 of file RtSpline.cxx.

51  {
52  constexpr double h = 1.e-7;
53  return (driftVelocity(t + h) - driftVelocity(t-h))/ (2.*h);
54  }

◆ driftVelocity()

double MuonCalib::RtSpline::driftVelocity ( double  t) const
finaloverridevirtual

get the drift velocity

Implements MuonCalib::IRtRelation.

Definition at line 50 of file RtSpline.cxx.

50 { return m_sp3->Derivative(t); }

◆ GetTmaxDiff()

double MuonCalib::IRtRelation::GetTmaxDiff ( ) const
inlineinherited

return the difference in total dirft time between the two multilayers (ML1 - ML2)

Definition at line 34 of file IRtRelation.h.

34 { return m_tmax_diff.value_or(0.); }

◆ hasTmaxDiff()

bool MuonCalib::IRtRelation::hasTmaxDiff ( ) const
inlineinherited

Definition at line 36 of file IRtRelation.h.

36 { return m_tmax_diff.has_value(); }

◆ name()

std::string MuonCalib::RtSpline::name ( ) const
inlinefinaloverridevirtual

get the class name

Implements MuonCalib::CalibFunc.

Definition at line 66 of file RtSpline.h.

◆ 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  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; }

◆ radius()

double MuonCalib::RtSpline::radius ( double  t) const
finaloverridevirtual

get the radius corresponding to the drift time t; 0 or 14.6 is returned if t is outside the range

Implements MuonCalib::IRtRelation.

Definition at line 42 of file RtSpline.cxx.

42  {
43  // check for t_min and t_max
44  if (t > m_sp3->GetXmax()) return m_sp3->Eval(m_sp3->GetXmax());
45  if (t < m_sp3->GetXmin()) return m_sp3->Eval(m_sp3->GetXmin());
46  double r = m_sp3->Eval(t);
47  return r >= 0 ? r : 0;
48  }

◆ SetTmaxDiff()

void MuonCalib::IRtRelation::SetTmaxDiff ( const double  d)
inlineinherited

set the difference in total drift time betwene the two multilayers (ML1 - ML2)

Definition at line 39 of file IRtRelation.h.

39 { m_tmax_diff = d; }

◆ tBinWidth()

double MuonCalib::RtSpline::tBinWidth ( ) const
finaloverridevirtual

Returns the step-size for the sampling.

Implements MuonCalib::IRtRelation.

Definition at line 39 of file RtSpline.cxx.

39  {
40  return m_sp3->GetDelta();
41  }

◆ tLower()

double MuonCalib::RtSpline::tLower ( ) const
finaloverridevirtual

get the lower drift-time bound

Implements MuonCalib::IRtRelation.

Definition at line 55 of file RtSpline.cxx.

55 { return par(0); }

◆ tUpper()

double MuonCalib::RtSpline::tUpper ( ) const
finaloverridevirtual

get the upper drift-time bound

Implements MuonCalib::IRtRelation.

Definition at line 57 of file RtSpline.cxx.

57 { return par(nPar() - 2); }

◆ typeName()

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

Implements MuonCalib::CalibFunc.

Definition at line 19 of file IRtRelation.h.

19 { return "IRtRelation"; }

Member Data Documentation

◆ m_parameters

ParVec MuonCalib::CalibFunc::m_parameters {}
privateinherited

Definition at line 51 of file CalibFunc.h.

◆ m_sp3

std::unique_ptr<TSpline3> MuonCalib::RtSpline::m_sp3 {}
private

Definition at line 48 of file RtSpline.h.

◆ m_tmax_diff

std::optional<double> MuonCalib::IRtRelation::m_tmax_diff {std::nullopt}
privateinherited

Definition at line 41 of file IRtRelation.h.

◆ s_tBinWidth

constexpr double MuonCalib::IRtRelation::s_tBinWidth = 1.e-3
staticconstexprprotectedinherited

Definition at line 43 of file IRtRelation.h.


The documentation for this class was generated from the following files:
beamspotman.r
def r
Definition: beamspotman.py:676
index
Definition: index.py:1
hist_file_dump.d
d
Definition: hist_file_dump.py:137
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
x
#define x
MuonCalib::CalibFunc::par
double par(unsigned int index) const
Definition: CalibFunc.h:41
MuonCalib::RtSpline::driftVelocity
virtual double driftVelocity(double t) const override final
get the drift velocity
Definition: RtSpline.cxx:50
lumiFormat.i
int i
Definition: lumiFormat.py:85
extractSporadic.h
list h
Definition: extractSporadic.py:97
MuonCalib::RtSpline::m_sp3
std::unique_ptr< TSpline3 > m_sp3
Definition: RtSpline.h:48
MuonCalib::IRtRelation::m_tmax_diff
std::optional< double > m_tmax_diff
Definition: IRtRelation.h:41
DeMoScan.index
string index
Definition: DeMoScan.py:364
y
#define y
h
MuonCalib::CalibFunc::m_parameters
ParVec m_parameters
Definition: CalibFunc.h:51
MuonCalib::CalibFunc::nPar
unsigned int nPar() const
Definition: CalibFunc.h:39