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

#include <DinesRtRelation.h>

Inheritance diagram for TRTCond::DinesRtRelation:
Collaboration diagram for TRTCond::DinesRtRelation:

Public Types

enum  Status { Undefined, Calibrated }
 enumerates status More...
 

Public Member Functions

 DinesRtRelation ()
 constructor More...
 
 DinesRtRelation (const float *cal, Status stat=Calibrated)
 constructor More...
 
 DinesRtRelation (const std::vector< float > &cal, Status stat=Calibrated)
 constructor More...
 
 DinesRtRelation (const DinesRtRelation &rhs)
 constructor More...
 
virtual ~DinesRtRelation ()
 destructor More...
 
virtual RtRelationclone () const
 cloner More...
 
DinesRtRelationoperator= (const DinesRtRelation &rhs)
 assignment operator More...
 
bool operator== (const DinesRtRelation &rhs) const
 equality operator More...
 
virtual int status () const
 status flag of (calibrated) rtrelation More...
 
virtual float radius (float driftime) const
 radius for given drifttime More...
 
virtual float drifttime (float radius) const
 drifttime for given radius More...
 
virtual float drdt (float driftime) const
 driftvelocity for given drifttime More...
 
virtual size_t footprint () const
 memory allocated by this rt-relation More...
 
virtual bool isequal (const RtRelation &rhs) const
 equality operator More...
 
virtual std::ostream & write (std::ostream &) const
 write to ascii ostream More...
 
virtual std::istream & read (std::istream &)
 read from to ascii ostream More...
 
const float * cal () const
 return to calibration constants More...
 
bool operator== (const RtRelation &rhs) const
 

Private Member Functions

void setstatus (int status)
 set the status More...
 
void set (const float *cal)
 set the calibration constants More...
 

Private Attributes

unsigned char m_status
 status byte More...
 
float m_cal [4]
 calibration constants More...
 

Detailed Description

Default rt-relation class in the TRT: a 3rd degree polynomial

Definition at line 25 of file DinesRtRelation.h.

Member Enumeration Documentation

◆ Status

enumerates status

Enumerator
Undefined 
Calibrated 

Definition at line 30 of file RtRelation.h.

30 { Undefined, Calibrated } ;

Constructor & Destructor Documentation

◆ DinesRtRelation() [1/4]

TRTCond::DinesRtRelation::DinesRtRelation ( )
inline

constructor

Definition at line 29 of file DinesRtRelation.h.

29 : m_status(Undefined) { m_cal[0] = m_cal[1] = m_cal[2] = m_cal[3] = 0 ; }

◆ DinesRtRelation() [2/4]

TRTCond::DinesRtRelation::DinesRtRelation ( const float *  cal,
Status  stat = Calibrated 
)
inline

constructor

Definition at line 31 of file DinesRtRelation.h.

32  : m_status(stat) { set(cal) ; }

◆ DinesRtRelation() [3/4]

TRTCond::DinesRtRelation::DinesRtRelation ( const std::vector< float > &  cal,
Status  stat = Calibrated 
)
inline

constructor

Definition at line 34 of file DinesRtRelation.h.

35  : m_status(stat) { set(&(cal.front())) ; }

◆ DinesRtRelation() [4/4]

TRTCond::DinesRtRelation::DinesRtRelation ( const DinesRtRelation rhs)
inline

constructor

Definition at line 37 of file DinesRtRelation.h.

37 : RtRelation(rhs) { *this = rhs ; }

◆ ~DinesRtRelation()

virtual TRTCond::DinesRtRelation::~DinesRtRelation ( )
inlinevirtual

destructor

Definition at line 39 of file DinesRtRelation.h.

39 {}

Member Function Documentation

◆ cal()

const float* TRTCond::DinesRtRelation::cal ( ) const
inline

return to calibration constants

Definition at line 76 of file DinesRtRelation.h.

76 { return m_cal ; }

◆ clone()

virtual RtRelation* TRTCond::DinesRtRelation::clone ( ) const
inlinevirtual

cloner

Implements TRTCond::RtRelation.

Definition at line 41 of file DinesRtRelation.h.

41 { return new DinesRtRelation(*this) ; }

◆ drdt()

float TRTCond::DinesRtRelation::drdt ( float  driftime) const
virtual

driftvelocity for given drifttime

Implements TRTCond::RtRelation.

Definition at line 33 of file DinesRtRelation.cxx.

34  {
35  double rmin0 = m_cal[0];
36  double rho = m_cal[1];
37  double v = m_cal[2];
38  double t_const = m_cal[3]; // tw-t0
39 
40 
41  double drdt =
42  0.5/sqrt((4*rho*rho*sin(v*(time-t_const)/(2*rho))*sin(v*(time-t_const)/(2*rho))-rmin0*rmin0)/(1-0.25*rmin0*rmin0))*
43  4*rho*rho/(1-0.25*rmin0*rmin0)*
44  2*sin(v*(time-t_const)/(2*rho))*
45  cos(v*(time-t_const)/(2*rho))*
46  v/(2*rho);
47 
48  return drdt;
49 
50  }

◆ drifttime()

float TRTCond::DinesRtRelation::drifttime ( float  radius) const
virtual

drifttime for given radius

Implements TRTCond::RtRelation.

Definition at line 52 of file DinesRtRelation.cxx.

53  {
54  double rmin0 = m_cal[0];
55  double rho = m_cal[1];
56  double v = m_cal[2];
57  double t_const = m_cal[3];// tw-t0
58  double t = t_const + 2*rho/v*asin(sqrt(rmin0*rmin0*(1-0.25*r*r)+r*r)/(2*rho));
59 
60  return t;
61  }

◆ footprint()

virtual size_t TRTCond::DinesRtRelation::footprint ( ) const
inlinevirtual

memory allocated by this rt-relation

Reimplemented from TRTCond::RtRelation.

Definition at line 64 of file DinesRtRelation.h.

64 { return sizeof(*this) ; }

◆ isequal()

bool TRTCond::DinesRtRelation::isequal ( const RtRelation rhs) const
virtual

equality operator

Implements TRTCond::RtRelation.

Definition at line 64 of file DinesRtRelation.cxx.

65  {
66  const DinesRtRelation* rhsp = dynamic_cast<const DinesRtRelation*>(&rhs) ;
67  return rhsp && (*rhsp)==*this ;
68  }

◆ operator=()

DinesRtRelation & TRTCond::DinesRtRelation::operator= ( const DinesRtRelation rhs)

assignment operator

Definition at line 10 of file DinesRtRelation.cxx.

11  {
12  if ( this != &rhs){
13  m_status = rhs.m_status ;
14  set(rhs.m_cal) ;
15  }
16  return *this ;
17  }

◆ operator==() [1/2]

bool TRTCond::DinesRtRelation::operator== ( const DinesRtRelation rhs) const
inline

equality operator

Definition at line 47 of file DinesRtRelation.h.

47  {
48  return (&rhs == this) || memcmp( m_cal, rhs.m_cal, 4*sizeof(float) )==0 ;
49  }

◆ operator==() [2/2]

bool TRTCond::RtRelation::operator== ( const RtRelation rhs) const
inlineinherited

Definition at line 54 of file RtRelation.h.

54 { return isequal(rhs) ; }

◆ radius()

float TRTCond::DinesRtRelation::radius ( float  driftime) const
virtual

radius for given drifttime

Implements TRTCond::RtRelation.

Definition at line 20 of file DinesRtRelation.cxx.

21  {
22  double rmin0 = m_cal[0];
23  double rho = m_cal[1];
24  double v = m_cal[2];
25  double t_const = m_cal[3]; // tw-t0
26  double r_squared = (4*rho*rho*sin(v*(time-t_const)/(2*rho))-rmin0*rmin0)/(1-0.25*rmin0*rmin0);
27  double r = 0;
28  if (r_squared>0) r = sqrt(r_squared);
29 
30  return r;
31  }

◆ read()

std::istream & TRTCond::DinesRtRelation::read ( std::istream &  is)
virtual

read from to ascii ostream

Implements TRTCond::RtRelation.

Definition at line 77 of file DinesRtRelation.cxx.

78  {
79  return is >> m_cal[0] >> m_cal[1] >> m_cal[2] >> m_cal[3] ;
80  }

◆ set()

void TRTCond::DinesRtRelation::set ( const float *  cal)
inlineprivate

set the calibration constants

Definition at line 83 of file DinesRtRelation.h.

83 { memcpy(m_cal,cal,4*sizeof(float)) ; }

◆ setstatus()

void TRTCond::DinesRtRelation::setstatus ( int  status)
inlineprivate

set the status

Definition at line 80 of file DinesRtRelation.h.

80 { m_status = status ; }

◆ status()

virtual int TRTCond::DinesRtRelation::status ( ) const
inlinevirtual

status flag of (calibrated) rtrelation

Implements TRTCond::RtRelation.

Definition at line 52 of file DinesRtRelation.h.

52 { return m_status ; }

◆ write()

std::ostream & TRTCond::DinesRtRelation::write ( std::ostream &  os) const
virtual

write to ascii ostream

Implements TRTCond::RtRelation.

Definition at line 71 of file DinesRtRelation.cxx.

72  {
73  return os << m_cal[0] << " " << m_cal[1] << " "
74  << m_cal[2] << " " << m_cal[3] << " " ;
75  }

Member Data Documentation

◆ m_cal

float TRTCond::DinesRtRelation::m_cal[4]
private

calibration constants

Definition at line 87 of file DinesRtRelation.h.

◆ m_status

unsigned char TRTCond::DinesRtRelation::m_status
private

status byte

Definition at line 86 of file DinesRtRelation.h.


The documentation for this class was generated from the following files:
beamspotman.r
def r
Definition: beamspotman.py:676
TRTCond::DinesRtRelation::status
virtual int status() const
status flag of (calibrated) rtrelation
Definition: DinesRtRelation.h:52
TRTCond::DinesRtRelation::m_cal
float m_cal[4]
calibration constants
Definition: DinesRtRelation.h:87
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
TRTCond::RtRelation::isequal
virtual bool isequal(const RtRelation &rhs) const =0
equality operator
TRTCond::DinesRtRelation::cal
const float * cal() const
return to calibration constants
Definition: DinesRtRelation.h:76
TRTCond::DinesRtRelation::drdt
virtual float drdt(float driftime) const
driftvelocity for given drifttime
Definition: DinesRtRelation.cxx:33
TRTCond::RtRelation::Calibrated
@ Calibrated
Definition: RtRelation.h:30
beamspotman.stat
stat
Definition: beamspotman.py:266
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
TRTCond::DinesRtRelation::DinesRtRelation
DinesRtRelation()
constructor
Definition: DinesRtRelation.h:29
TRTCond::RtRelation::RtRelation
RtRelation()=default
constructors, desctructors, cloners
TRTCond::DinesRtRelation::set
void set(const float *cal)
set the calibration constants
Definition: DinesRtRelation.h:83
python.PyAthena.v
v
Definition: PyAthena.py:154
TRTCond::DinesRtRelation::m_status
unsigned char m_status
status byte
Definition: DinesRtRelation.h:86
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
TRTCond::RtRelation::Undefined
@ Undefined
Definition: RtRelation.h:30
fitman.rho
rho
Definition: fitman.py:532