ATLAS Offline Software
MuonChannelDesign.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
5 namespace MuonGM{
7  m_rotMat.setIdentity();
8  }
9 
10  void MuonChannelDesign::defineTrapezoid(double HalfShortY, double HalfLongY, double HalfHeight, double sAngle){
11  defineTrapezoid(HalfShortY,HalfLongY, HalfHeight);
12  setStereoAngle(sAngle);
13  }
14 
15  void MuonChannelDesign::setStereoAngle(double sAngle) {
16  if (m_isDiamond) return; // forbid diamond shape with stereo strips
17  m_sAngle = sAngle;
18  m_hasStereo = (sAngle !=0.);
19  Eigen::Rotation2D rot{sAngle};
20  m_stereoDir = rot * m_stereoDir;
22  m_rotMat = Eigen::Rotation2D{-sAngle};
23  }
24 
25  void MuonChannelDesign::defineTrapezoid(double HalfShortY, double HalfLongY, double HalfHeight) {
26  m_bottomLeft = Amg::Vector2D{-HalfHeight, -HalfShortY};
27  m_bottomRight = Amg::Vector2D{HalfHeight, -HalfLongY};
28  m_topLeft = Amg::Vector2D{-HalfHeight, HalfShortY};
29  m_topRight = Amg::Vector2D{HalfHeight, HalfLongY};
30 
33  m_maxHorSize = std::hypot(m_topEdge.x(), m_topEdge.y());
34  m_topEdge = m_topEdge.unit();
35 
36  m_xSize = 2.*HalfHeight; // radial length (active area)
37  m_minYSize = 2.*HalfShortY; // bottom length (active area)
38  m_maxYSize = 2.*HalfLongY; // top length (active area)
40  }
41 
42  void MuonChannelDesign::defineDiamond(double HalfShortY, double HalfLongY, double HalfHeight, double ycutout) {
43 
44  // define a trapezoid region
45  double HalfLongY_uncut = HalfLongY + ycutout * (HalfLongY - HalfShortY)/(2*HalfHeight - ycutout);
46  defineTrapezoid(HalfShortY, HalfLongY_uncut, HalfHeight);
47 
48  // move the origin to the cutout base
49  Amg::Vector2D offset(ycutout - HalfHeight, 0.);
52  m_topLeft += offset;
53  m_topRight += offset;
54 
55  m_isDiamond = true;
56  m_yCutout = ycutout;
57  m_maxYSize = 2*HalfLongY;
58  }
59 
60  void MuonChannelDesign::setFirstPos(const double firstPos) {
62  }
63 }
MuonGM::MuonChannelDesign::m_maxHorSize
double m_maxHorSize
Definition: MuonChannelDesign.h:176
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition: GeoMuonHits.h:27
MuonGM::MuonChannelDesign::firstPos
double firstPos() const
Returns the position of the first strip along the x-axis.
Definition: MuonChannelDesign.h:481
MuonGM::MuonChannelDesign::m_bottomEdge
Amg::Vector2D m_bottomEdge
Vector describing the left edge of the trapezoid.
Definition: MuonChannelDesign.h:164
MuonGM::MuonChannelDesign::m_topLeft
Amg::Vector2D m_topLeft
Top right point of the trapezoid.
Definition: MuonChannelDesign.h:170
MuonGM::MuonChannelDesign::MuonChannelDesign
MuonChannelDesign()
Definition: MuonChannelDesign.cxx:6
MuonGM::MuonChannelDesign::defineTrapezoid
void defineTrapezoid(double HalfShortY, double HalfLongY, double HalfHeight)
set the trapezoid dimensions
Definition: MuonChannelDesign.cxx:25
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
MuonGM::MuonChannelDesign::m_minYSize
double m_minYSize
Definition: MuonChannelDesign.h:178
MuonGM::MuonChannelDesign::m_stereoDir
Amg::Vector2D m_stereoDir
Direction of the strips.
Definition: MuonChannelDesign.h:156
MuonGM::MuonChannelDesign::inputLength
double inputLength
Definition: MuonChannelDesign.h:37
MuonGM::MuonChannelDesign::defineDiamond
void defineDiamond(double HalfShortY, double HalfLongY, double HalfHeight, double ycutout)
Definition: MuonChannelDesign.cxx:42
MuonGM::MuonChannelDesign::m_topEdge
Amg::Vector2D m_topEdge
Vector describing the right edge of the trapzoid.
Definition: MuonChannelDesign.h:162
MuonGM::MuonChannelDesign::m_isDiamond
bool m_isDiamond
Definition: MuonChannelDesign.h:152
MuonGM::MuonChannelDesign::m_yCutout
double m_yCutout
Definition: MuonChannelDesign.h:154
MuonGM::MuonChannelDesign::m_topRight
Amg::Vector2D m_topRight
Bottom right point of the trapezoid.
Definition: MuonChannelDesign.h:172
MuonGM::MuonChannelDesign::m_sAngle
double m_sAngle
Definition: MuonChannelDesign.h:153
MuonGM::MuonChannelDesign::m_bottomRight
Amg::Vector2D m_bottomRight
Bottom right point of the trapezoid.
Definition: MuonChannelDesign.h:168
MuonGM::MuonChannelDesign::m_stereoNormal
Amg::Vector2D m_stereoNormal
Direction pointing to the next strips.
Definition: MuonChannelDesign.h:158
MuonGM::MuonChannelDesign::m_hasStereo
bool m_hasStereo
Definition: MuonChannelDesign.h:151
MuonChannelDesign.h
unit
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
Definition: AmgMatrixBasePlugin.h:21
MuonGM::MuonChannelDesign::m_firstPos
double m_firstPos
Position of the first measurement.
Definition: MuonChannelDesign.h:160
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
MuonGM::MuonChannelDesign::setFirstPos
void setFirstPos(const double pos)
Set the position of the first strip along the x-axis.
Definition: MuonChannelDesign.cxx:60
MuonGM::MuonChannelDesign::m_bottomLeft
Amg::Vector2D m_bottomLeft
Bottom left point of the trapezoid.
Definition: MuonChannelDesign.h:166
MuonGM::MuonChannelDesign::m_maxYSize
double m_maxYSize
Definition: MuonChannelDesign.h:179
MuonGM::MuonChannelDesign::setStereoAngle
void setStereoAngle(double sAngle)
calculate local stereo angle
Definition: MuonChannelDesign.cxx:15
MuonGM::MuonChannelDesign::m_xSize
double m_xSize
Definition: MuonChannelDesign.h:177