ATLAS Offline Software
SCT_ForwardFrameTransformation.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // SCT_ForwardFrameTransformation.cxx
7 // Implementation file for class SCT_ForwardFrameTransformation
9 // (c) ATLAS Detector software
11 // Version 1.4 09/7/2001 Alessandro Fornaini
13 
17 #include <cmath>
18 
19 using std::abs;
20 using std::cos;
21 using std::sin;
22 
23 namespace InDetDD {
24 
25 // Copy constructor:
26 SCT_ForwardFrameTransformation::SCT_ForwardFrameTransformation(const SCT_ForwardFrameTransformation &frame)
27 
28 = default;
29 
30 // Constructor with parameters:
31 SCT_ForwardFrameTransformation::SCT_ForwardFrameTransformation(const double etaCenter,const double phiCenter,const double radius) :
32  m_etaCenter(etaCenter),
33  m_phiCenter(phiCenter),
34  m_radius(radius)
35 {
36  //check if parameters are consistent
37  if (m_radius<0) m_radius=0;
38 }
39 
40 
41 // Assignment operator:
43 {
44  if (this!=&frame) {
47  m_radius=frame.m_radius;
48  } else {}
49  return *this;
50 }
51 
52 
53 // create a SCT_ForwardPolarPosition from a SiLocalPosition
55 {
56  const double deltaPhi = cartesian.xPhi()-m_phiCenter;
57  const double deltaEta = cartesian.xEta()-m_etaCenter+m_radius;
58  const double r = sqrt(deltaPhi*deltaPhi+deltaEta*deltaEta);
59  if (r<=0) return {};
60  const double theta = asin((cartesian.xPhi()-m_phiCenter)/r);
61  return SCT_ForwardPolarPosition(r,theta);
62 }
63 
64 // create a SiLocalPosition from a SCT_ForwardPolarPosition
66 {
67  const double phi = m_phiCenter + polar.r()*sin(polar.theta());
68  const double eta = m_etaCenter + polar.r()*cos(polar.theta()) - m_radius;
69  return SiLocalPosition(eta, phi);
70 }
71 
72 } // namespace InDetDD
beamspotman.r
def r
Definition: beamspotman.py:676
InDetDD::SCT_ForwardPolarPosition::theta
double theta() const
theta coordinate of point:
Definition: SCT_ForwardPolarPosition.h:79
xAOD::deltaPhi
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
Definition: L2StandAloneMuon_v1.cxx:160
InDetDD::SCT_ForwardFrameTransformation::polarFromCartesian
SCT_ForwardPolarPosition polarFromCartesian(const SiLocalPosition &cartesian) const
create a SCT_ForwardPolarPosition from a SiLocalPosition
Definition: SCT_ForwardFrameTransformation.cxx:54
InDetDD::SCT_ForwardFrameTransformation::SCT_ForwardFrameTransformation
SCT_ForwardFrameTransformation()
InDetDD::SCT_ForwardPolarPosition
Definition: SCT_ForwardPolarPosition.h:25
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
InDetDD::SiLocalPosition
Definition: SiLocalPosition.h:31
InDetDD::SiLocalPosition::xPhi
double xPhi() const
position along phi direction:
Definition: SiLocalPosition.h:123
InDetDD::SCT_ForwardFrameTransformation
Definition: SCT_ForwardFrameTransformation.h:27
InDetDD::SCT_ForwardPolarPosition::r
double r() const
r coordinate of point:
Definition: SCT_ForwardPolarPosition.h:74
P4Helpers::deltaEta
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
Definition: P4Helpers.h:66
InDetDD::SCT_ForwardFrameTransformation::operator=
SCT_ForwardFrameTransformation & operator=(const SCT_ForwardFrameTransformation &frame)
Assignment operator:
Definition: SCT_ForwardFrameTransformation.cxx:42
InDetDD::SiLocalPosition::xEta
double xEta() const
position along eta direction:
Definition: SiLocalPosition.h:118
SiLocalPosition.h
InDetDD::SCT_ForwardFrameTransformation::cartesianFromPolar
SiLocalPosition cartesianFromPolar(const SCT_ForwardPolarPosition &polar) const
create a SiLocalPosition from a SCT_ForwardPolarPosition
Definition: SCT_ForwardFrameTransformation.cxx:65
InDetDD::SCT_ForwardFrameTransformation::m_etaCenter
double m_etaCenter
eta coordinate of module center
Definition: SCT_ForwardFrameTransformation.h:83
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
SCT_ForwardFrameTransformation.h
InDetDD::SCT_ForwardFrameTransformation::m_phiCenter
double m_phiCenter
phi coordinate of module center
Definition: SCT_ForwardFrameTransformation.h:84
InDetDD::SCT_ForwardFrameTransformation::m_radius
double m_radius
r from module center to beam
Definition: SCT_ForwardFrameTransformation.h:85
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
SCT_ForwardPolarPosition.h