ATLAS Offline Software
MdtChamberGeometry.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef DCMATH_MDTCHAMBERGEOMETRY_H
6 #define DCMATH_MDTCHAMBERGEOMETRY_H
7 
8 #include <cassert>
9 #include <vector>
10 
15 
16 namespace TrkDriftCircleMath {
17 
19  public:
21 
22  MdtChamberGeometry(const Identifier& id, const Muon::IMuonIdHelperSvc* idHelperSvc, unsigned int nml, unsigned int nlay, unsigned int ntubesml0, unsigned int ntubesml1,
23  const LocVec2D& tube0ml0, const LocVec2D& tube0ml1, double tubeDist, double tubeStage, double layDist,
24  double stationTheta);
25 
26  virtual ~MdtChamberGeometry() = default;
27 
28  void init();
29  void setGeometry(unsigned int nml, unsigned int nlay, unsigned int ntubesml0, unsigned int ntubesml1, const LocVec2D& tube0ml0,
30  const LocVec2D& tube0ml1, double tubeDist, double tubeStage, double layDist, double stationTheta);
31 
32  unsigned int nml() const { return m_nml; }
33  unsigned int nlay() const override { return m_nlay; }
34  unsigned int ntubesml0() const { return m_ntubesml[0]; }
35  unsigned int ntubesml1() const { return m_ntubesml[1]; }
36 
37  const Identifier& stationId() const override { return m_id; }
38 
39  const LocVec2D& firstTubeMl0() const { return m_firstTube[0]; }
40  const LocVec2D& firstTubeMl1() const { return m_firstTube[1]; }
41 
42  double tubeDist() const { return m_tubeDist; }
43  double tubeStage() const { return m_tubeStage; }
44  double layerDist() const { return m_layDist; }
45 
46  double stationTheta() const override { return m_stationTheta; }
47 
48  double tubeRadius() const override { return m_tubeRad; }
49 
50  LocVec2D tubePosition(unsigned int ml, unsigned int lay, unsigned int tube) const override;
51 
52  DCVec tubesPassedByLine(const Line& line, int ml) const;
53  DCVec tubesPassedByLine(const Line& line) const override { return tubesPassedByLine(line, -1); }
54 
56  void tubesPassedByLine(const Line& line, int ml, DCVec& crossedTubes) const;
57  void tubesPassedByLine(const Line& line, DCVec& crossedTubes) const { return tubesPassedByLine(line, -1, crossedTubes); }
58 
61  void isSecondMultiLayer(bool isSecond) { m_isSecondMultiLayer = isSecond; }
62 
63  bool validGeometry() const override { return m_validGeometry; }
64 
65  void print(MsgStream& msg) const override;
66 
67  bool validId(unsigned int ml, unsigned int lay, unsigned int tube) const;
68 
69  private:
70  double xPosTube(unsigned int ml, unsigned int lay, unsigned int tube) const;
71  double yPosTube(unsigned int ml, unsigned int lay) const;
72 
74  bool m_sMdt{false};
75  bool m_isBarrel{false};
76  unsigned int m_nml{0};
77  unsigned int m_nlay{0};
78  std::vector<unsigned int> m_ntubesml{};
79  double m_tubeDist{0};
80  double m_tubeRad{0};
81  double m_tubeStage{0};
82  double m_layDist{0};
83  double m_stationTheta{0};
84 
85  std::vector<bool> m_wasInit{};
86  std::vector<LocVec2D> m_firstTube{};
87  bool m_validGeometry{false};
88  bool m_isSecondMultiLayer{false};
89  };
90 
91 } // namespace TrkDriftCircleMath
92 
93 #endif
TrkDriftCircleMath::MdtChamberGeometry::firstTubeMl0
const LocVec2D & firstTubeMl0() const
Definition: MdtChamberGeometry.h:39
TrkDriftCircleMath::MdtChamberGeometry::print
void print(MsgStream &msg) const override
Definition: MdtChamberGeometry.cxx:170
ResidualWithLine.h
checkFileSG.line
line
Definition: checkFileSG.py:75
TrkDriftCircleMath::MdtChamberGeometry::m_isSecondMultiLayer
bool m_isSecondMultiLayer
Definition: MdtChamberGeometry.h:88
TrkDriftCircleMath::MdtChamberGeometry::tubeDist
double tubeDist() const
Definition: MdtChamberGeometry.h:42
TrkDriftCircleMath::MdtChamberGeometry::m_nml
unsigned int m_nml
Definition: MdtChamberGeometry.h:76
TrkDriftCircleMath::MdtChamberGeometry::yPosTube
double yPosTube(unsigned int ml, unsigned int lay) const
Definition: MdtChamberGeometry.cxx:198
TrkDriftCircleMath::MdtChamberGeometry::m_tubeRad
double m_tubeRad
Definition: MdtChamberGeometry.h:80
TrkDriftCircleMath::ChamberGeometry
Definition: ChamberGeometry.h:17
TrkDriftCircleMath::MdtChamberGeometry::ntubesml1
unsigned int ntubesml1() const
Definition: MdtChamberGeometry.h:35
TrkDriftCircleMath::MdtChamberGeometry::m_ntubesml
std::vector< unsigned int > m_ntubesml
Definition: MdtChamberGeometry.h:78
TrkDriftCircleMath::MdtChamberGeometry::m_isBarrel
bool m_isBarrel
Definition: MdtChamberGeometry.h:75
TrkDriftCircleMath::MdtChamberGeometry::m_layDist
double m_layDist
Definition: MdtChamberGeometry.h:82
TrkDriftCircleMath
Function object to check whether two Segments are sub/super sets or different.
Definition: IMdtSegmentFinder.h:13
DriftCircle.h
TrkDriftCircleMath::MdtChamberGeometry::tubesPassedByLine
DCVec tubesPassedByLine(const Line &line) const override
Retrieves the vector of drift circles traveresed by the line.
Definition: MdtChamberGeometry.h:53
TrkDriftCircleMath::MdtChamberGeometry::m_id
Identifier m_id
Definition: MdtChamberGeometry.h:73
TrkDriftCircleMath::LocVec2D
Implementation of 2 dimensional vector class.
Definition: LocVec2D.h:16
TrkDriftCircleMath::DCVec
std::vector< DriftCircle > DCVec
Definition: DriftCircle.h:117
ChamberGeometry.h
TrkDriftCircleMath::MdtChamberGeometry::ntubesml0
unsigned int ntubesml0() const
Definition: MdtChamberGeometry.h:34
TrkDriftCircleMath::Line
Definition: Line.h:17
TrkDriftCircleMath::MdtChamberGeometry::stationId
const Identifier & stationId() const override
Definition: MdtChamberGeometry.h:37
TrkDriftCircleMath::MdtChamberGeometry::m_firstTube
std::vector< LocVec2D > m_firstTube
Definition: MdtChamberGeometry.h:86
TrkDriftCircleMath::MdtChamberGeometry::isSecondMultiLayer
void isSecondMultiLayer(bool isSecond)
set that this is the second multi layer instead of the first, used in case the first ML is dead
Definition: MdtChamberGeometry.h:61
Line.h
TrkDriftCircleMath::MdtChamberGeometry::nml
unsigned int nml() const
Definition: MdtChamberGeometry.h:32
TrkDriftCircleMath::MdtChamberGeometry::m_nlay
unsigned int m_nlay
Definition: MdtChamberGeometry.h:77
TrkDriftCircleMath::MdtChamberGeometry
Definition: MdtChamberGeometry.h:18
TrkDriftCircleMath::MdtChamberGeometry::stationTheta
double stationTheta() const override
Definition: MdtChamberGeometry.h:46
TrkDriftCircleMath::MdtChamberGeometry::m_wasInit
std::vector< bool > m_wasInit
Definition: MdtChamberGeometry.h:85
TrkDriftCircleMath::MdtChamberGeometry::layerDist
double layerDist() const
Definition: MdtChamberGeometry.h:44
TrkDriftCircleMath::MdtChamberGeometry::xPosTube
double xPosTube(unsigned int ml, unsigned int lay, unsigned int tube) const
Definition: MdtChamberGeometry.cxx:185
TrkDriftCircleMath::MdtChamberGeometry::m_validGeometry
bool m_validGeometry
Definition: MdtChamberGeometry.h:87
TrkDriftCircleMath::MdtChamberGeometry::tubeRadius
double tubeRadius() const override
Definition: MdtChamberGeometry.h:48
TrkDriftCircleMath::MdtChamberGeometry::m_stationTheta
double m_stationTheta
Definition: MdtChamberGeometry.h:83
TrkDriftCircleMath::MdtChamberGeometry::m_tubeStage
double m_tubeStage
Definition: MdtChamberGeometry.h:81
TrkDriftCircleMath::MdtChamberGeometry::tubesPassedByLine
void tubesPassedByLine(const Line &line, DCVec &crossedTubes) const
Definition: MdtChamberGeometry.h:57
TrkDriftCircleMath::MdtChamberGeometry::tubeStage
double tubeStage() const
Definition: MdtChamberGeometry.h:43
TrkDriftCircleMath::MdtChamberGeometry::m_tubeDist
double m_tubeDist
Definition: MdtChamberGeometry.h:79
TrkDriftCircleMath::MdtChamberGeometry::setGeometry
void setGeometry(unsigned int nml, unsigned int nlay, unsigned int ntubesml0, unsigned int ntubesml1, const LocVec2D &tube0ml0, const LocVec2D &tube0ml1, double tubeDist, double tubeStage, double layDist, double stationTheta)
Definition: MdtChamberGeometry.cxx:33
TrkDriftCircleMath::MdtChamberGeometry::m_sMdt
bool m_sMdt
Definition: MdtChamberGeometry.h:74
TrkDriftCircleMath::MdtChamberGeometry::tubesPassedByLine
DCVec tubesPassedByLine(const Line &line, int ml) const
Definition: MdtChamberGeometry.cxx:160
TrkDriftCircleMath::MdtChamberGeometry::validGeometry
bool validGeometry() const override
Definition: MdtChamberGeometry.h:63
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition: IMuonIdHelperSvc.h:26
TrkDriftCircleMath::MdtChamberGeometry::tubePosition
LocVec2D tubePosition(unsigned int ml, unsigned int lay, unsigned int tube) const override
Definition: MdtChamberGeometry.cxx:177
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
TrkDriftCircleMath::MdtChamberGeometry::~MdtChamberGeometry
virtual ~MdtChamberGeometry()=default
calibdata.tube
tube
Definition: calibdata.py:31
TrkDriftCircleMath::MdtChamberGeometry::firstTubeMl1
const LocVec2D & firstTubeMl1() const
Definition: MdtChamberGeometry.h:40
TrkDriftCircleMath::MdtChamberGeometry::MdtChamberGeometry
MdtChamberGeometry()
Definition: MdtChamberGeometry.cxx:20
TrkDriftCircleMath::MdtChamberGeometry::init
void init()
Definition: MdtChamberGeometry.cxx:61
TrkDriftCircleMath::MdtChamberGeometry::nlay
unsigned int nlay() const override
Definition: MdtChamberGeometry.h:33
TrkDriftCircleMath::MdtChamberGeometry::validId
bool validId(unsigned int ml, unsigned int lay, unsigned int tube) const
Definition: MdtChamberGeometry.cxx:81
Identifier
Definition: IdentifierFieldParser.cxx:14