ATLAS Offline Software
Loading...
Searching...
No Matches
DinesRtRelation.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4
6//comment
7namespace TRTCond
8{
9
11 {
12 if ( this != &rhs){
13 m_status = rhs.m_status ;
14 set(rhs.m_cal) ;
15 }
16 return *this ;
17 }
18
19
20 float DinesRtRelation::radius( float time ) const
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*std::sin(v*(time-t_const)/(2*rho))-rmin0*rmin0)/(1-0.25*rmin0*rmin0);
27 double r = 0;
28 if (r_squared>0) r = std::sqrt(r_squared);
29
30 return r;
31 }
32
33 float DinesRtRelation::drdt( float time ) const
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/std::sqrt((4*rho*rho*std::sin(v*(time-t_const)/(2*rho))*std::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*std::sin(v*(time-t_const)/(2*rho))*
45 std::cos(v*(time-t_const)/(2*rho))*
46 v/(2*rho);
47
48 return drdt;
49
50 }
51
52 float DinesRtRelation::drifttime(float r) const
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*std::asin(std::sqrt(rmin0*rmin0*(1-0.25*r*r)+r*r)/(2*rho));
59
60 return t;
61 }
62
63
64 bool DinesRtRelation::isequal(const RtRelation& rhs) const
65 {
66 const DinesRtRelation* rhsp = dynamic_cast<const DinesRtRelation*>(&rhs) ;
67 return rhsp && (*rhsp)==*this ;
68 }
69
70
71 std::ostream& DinesRtRelation::write( std::ostream& os ) const
72 {
73 return os << m_cal[0] << " " << m_cal[1] << " "
74 << m_cal[2] << " " << m_cal[3] << " " ;
75 }
76
77 std::istream& DinesRtRelation::read( std::istream& is )
78 {
79 return is >> m_cal[0] >> m_cal[1] >> m_cal[2] >> m_cal[3] ;
80 }
81}
virtual float radius(float driftime) const
radius for given drifttime
virtual bool isequal(const RtRelation &rhs) const
equality operator
float m_cal[4]
calibration constants
DinesRtRelation & operator=(const DinesRtRelation &rhs)
assignment operator
virtual std::ostream & write(std::ostream &) const
write to ascii ostream
unsigned char m_status
status byte
void set(const float *cal)
set the calibration constants
virtual float drdt(float driftime) const
driftvelocity for given drifttime
virtual std::istream & read(std::istream &)
read from to ascii ostream
virtual float drifttime(float radius) const
drifttime for given radius
RtRelation()=default
constructors, desctructors, cloners
int r
Definition globals.cxx:22