ATLAS Offline Software
Public Types | Public Member Functions | Public Attributes | Private Member Functions | 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

typedef std::vector< double > ParVec
 

Public Member Functions

 RtSpline (const ParVec &vec)
 initialization constructor, More...
 
 ~RtSpline ()
 
std::string name (void) const
 get the class name More...
 
double radius (double t) const
 get the radius corresponding to the drift time t; 0 or 14.6 is returned if t is outside the range More...
 
double driftvelocity (double t) const
 get the drift velocity More...
 
double tLower (void) const
 get the lower drift-time bound More...
 
double tUpper (void) const
 get the upper drift-time bound More...
 
virtual std::string typeName () const
 
float GetTmaxDiff () const
 return the difference in total dirft time between the two multilayers (ML1 - ML2) More...
 
bool HasTmaxDiff () const
 
void SetTmaxDiff (const float &d)
 set the difference in total drift time betwene the two multilayers (ML1 - ML2) More...
 
unsigned int nPar () const
 
const ParVecparameters () const
 
double par (unsigned int index) const
 

Public Attributes

float m_tmax_diff
 

Private Member Functions

void _init (void)
 initialization method More...
 

Private Attributes

TSpline3 * p_sp3
 
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

typedef std::vector<double> MuonCalib::CalibFunc::ParVec
inherited

Definition at line 36 of file CalibFunc.h.

Constructor & Destructor Documentation

◆ RtSpline()

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

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 64 of file RtSpline.h.

64 : IRtRelation(vec) { _init(); }

◆ ~RtSpline()

MuonCalib::RtSpline::~RtSpline ( )

Definition at line 19 of file RtSpline.cxx.

19  {
20  // as long as there is no default constructor, we can delete the TSpline3 without a check
21  delete p_sp3;
22  }

Member Function Documentation

◆ _init()

void MuonCalib::RtSpline::_init ( void  )
private

initialization method

Definition at line 24 of file RtSpline.cxx.

24  {
25  MsgStream log(Athena::getMessageSvc(), "RtSpline");
26  // check for minimum number of parameters
27  if (nPar() < 6) {
28  log << MSG::ERROR << "Not enough parameters!" << endmsg;
29  log << MSG::ERROR << "Minimum number of parameters is 6!" << endmsg;
30  throw 1;
31  }
32  // check if the number of parameters is even
33  if ((nPar() % 2) != 0) {
34  log << MSG::ERROR << "RtSpline::_init(): Odd number of parameters!" << endmsg;
35  throw 2;
36  }
37  // create spline
38  Double_t *x = new Double_t[nPar() / 2];
39  Double_t *y = new Double_t[nPar() / 2];
40  for (unsigned int i = 0; i < nPar() / 2; i++) {
41  x[i] = par(2 * i);
42  y[i] = par(2 * i + 1);
43  }
44  p_sp3 = new TSpline3("Rt Relation", x, y, nPar() / 2, "b2e2", 0, 0);
45  delete[] x;
46  delete[] y;
47  } // end RtSpline::_init

◆ driftvelocity()

double MuonCalib::RtSpline::driftvelocity ( double  t) const
virtual

get the drift velocity

Implements MuonCalib::IRtRelation.

Definition at line 57 of file RtSpline.cxx.

57 { return p_sp3->Derivative(t); }

◆ GetTmaxDiff()

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

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

Definition at line 27 of file IRtRelation.h.

27 { return HasTmaxDiff() ? m_tmax_diff : 0.0; }

◆ HasTmaxDiff()

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

Definition at line 29 of file IRtRelation.h.

29 { return (m_tmax_diff < 8e8); }

◆ name()

std::string MuonCalib::RtSpline::name ( void  ) const
inlinevirtual

get the class name

Implements MuonCalib::CalibFunc.

Definition at line 70 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
virtual

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 49 of file RtSpline.cxx.

49  {
50  // check for t_min and t_max
51  if (t > p_sp3->GetXmax()) return p_sp3->Eval(p_sp3->GetXmax());
52  if (t < p_sp3->GetXmin()) return p_sp3->Eval(p_sp3->GetXmin());
53  double r = p_sp3->Eval(t);
54  return r >= 0 ? r : 0;
55  }

◆ SetTmaxDiff()

void MuonCalib::IRtRelation::SetTmaxDiff ( const float &  d)
inlineinherited

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

Definition at line 32 of file IRtRelation.h.

32 { m_tmax_diff = d; }

◆ tLower()

double MuonCalib::RtSpline::tLower ( void  ) const
virtual

get the lower drift-time bound

Implements MuonCalib::IRtRelation.

Definition at line 59 of file RtSpline.cxx.

59 { return par(0); }

◆ tUpper()

double MuonCalib::RtSpline::tUpper ( void  ) const
virtual

get the upper drift-time bound

Implements MuonCalib::IRtRelation.

Definition at line 61 of file RtSpline.cxx.

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

◆ typeName()

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

Implements MuonCalib::CalibFunc.

Definition at line 18 of file IRtRelation.h.

18 { return "IRtRelation"; }

Member Data Documentation

◆ m_parameters

ParVec MuonCalib::CalibFunc::m_parameters
privateinherited

Definition at line 51 of file CalibFunc.h.

◆ m_tmax_diff

float MuonCalib::IRtRelation::m_tmax_diff
inherited

Definition at line 34 of file IRtRelation.h.

◆ p_sp3

TSpline3* MuonCalib::RtSpline::p_sp3
private

Definition at line 48 of file RtSpline.h.


The documentation for this class was generated from the following files:
beamspotman.r
def r
Definition: beamspotman.py:676
MuonCalib::IRtRelation::m_tmax_diff
float m_tmax_diff
Definition: IRtRelation.h:34
index
Definition: index.py:1
hist_file_dump.d
d
Definition: hist_file_dump.py:137
MuonCalib::IRtRelation::HasTmaxDiff
bool HasTmaxDiff() const
Definition: IRtRelation.h:29
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
x
#define x
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
MuonCalib::CalibFunc::par
double par(unsigned int index) const
Definition: CalibFunc.h:41
MuonCalib::IRtRelation::IRtRelation
IRtRelation(const CalibFunc::ParVec &vec)
Definition: IRtRelation.h:16
lumiFormat.i
int i
Definition: lumiFormat.py:92
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
MuonCalib::RtSpline::_init
void _init(void)
initialization method
Definition: RtSpline.cxx:24
DeMoScan.index
string index
Definition: DeMoScan.py:362
y
#define y
MuonCalib::CalibFunc::m_parameters
ParVec m_parameters
Definition: CalibFunc.h:51
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
MuonCalib::CalibFunc::nPar
unsigned int nPar() const
Definition: CalibFunc.h:39
MuonCalib::RtSpline::p_sp3
TSpline3 * p_sp3
Definition: RtSpline.h:48