ATLAS Offline Software
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
7 namespace 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*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  }
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/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  }
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*asin(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 }
TRTCond::DinesRtRelation
Definition: DinesRtRelation.h:26
beamspotman.r
def r
Definition: beamspotman.py:676
DinesRtRelation.h
TRTCond::DinesRtRelation::operator=
DinesRtRelation & operator=(const DinesRtRelation &rhs)
assignment operator
Definition: DinesRtRelation.cxx:10
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
Definition: RtRelation.h:27
TRTCond::DinesRtRelation::drdt
virtual float drdt(float driftime) const
driftvelocity for given drifttime
Definition: DinesRtRelation.cxx:33
TRTCond::DinesRtRelation::write
virtual std::ostream & write(std::ostream &) const
write to ascii ostream
Definition: DinesRtRelation.cxx:71
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
TRTCond::DinesRtRelation::set
void set(const float *cal)
set the calibration constants
Definition: DinesRtRelation.h:83
TRTCond::DinesRtRelation::read
virtual std::istream & read(std::istream &)
read from to ascii ostream
Definition: DinesRtRelation.cxx:77
python.PyAthena.v
v
Definition: PyAthena.py:154
TRTCond::DinesRtRelation::m_status
unsigned char m_status
status byte
Definition: DinesRtRelation.h:86
TRTCond
Definition: BasicRtRelation.cxx:8
TRTCond::DinesRtRelation::isequal
virtual bool isequal(const RtRelation &rhs) const
equality operator
Definition: DinesRtRelation.cxx:64
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
TRTCond::DinesRtRelation::drifttime
virtual float drifttime(float radius) const
drifttime for given radius
Definition: DinesRtRelation.cxx:52
fitman.rho
rho
Definition: fitman.py:532
TRTCond::DinesRtRelation::radius
virtual float radius(float driftime) const
radius for given drifttime
Definition: DinesRtRelation.cxx:20