ATLAS Offline Software
Station.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef Station_H
6 #define Station_H
7 
12 #include "GeoModelKernel/GeoDefinitions.h"
13 #include "MuonGeoModel/AlignPos.h"
14 #include "MuonGeoModel/Component.h"
15 #include "MuonGeoModel/Cutout.h"
16 #include "MuonGeoModel/Position.h"
17 
18 #include <atomic>
19 #include <map>
20 #include <memory>
21 #include <string>
22 #include <vector>
23 
24 /*
25  This class holds an std::map of Position, AlignPos and an std::vector of
26  Comonents* and Cutouts*
27  It is used only to build the geometry - can be deleted as soon as the job
28  is done (in MYSQL).
29  It is responsible for releasing the memory allocated by Components and Cutouts
30 */
31 
32 namespace MuonGM {
33  class MYSQL;
34 
35  typedef std::map<int, Position, std::less<int>> PositionMap;
36  typedef std::multimap<int, AlignPos, std::less<int>> AlignPosMap;
37  typedef std::map<int, Position, std::less<int>>::const_iterator PositionIterator;
38  typedef std::multimap<int, AlignPos, std::less<int>>::const_iterator AlignPosIterator;
39 
40  class Station : public AthMessaging {
41  public:
42  Station();
43  ~Station() = default;
44  Station(const Station &s) = delete;
45  Station& operator= (const Station &s) = delete;
46 
47  Station(MYSQL& mysql, std::string name);
48  void SetComponent(Component *c);
49  void SetCutout(Cutout *c);
50  Component *GetComponent(int i) const;
51  Cutout *GetCutout(int i) const;
52  int GetNrOfComponents() const;
53  int GetNrOfCutouts() const;
54  void SetPosition(Position p);
55  void SetAlignPos(const AlignPos &p);
56  // Position GetPosition(int i) const;
57  PositionIterator begin() const;
58  PositionIterator end() const;
59  AlignPosIterator abegin() const;
60  AlignPosIterator aend() const;
61  PositionIterator FindPosition(int iz, int iphi) const;
62  AlignPosIterator FindAlignPos(int iz, int iphi) const;
63  int CountAlignPos(int iz, int iphi) const;
64  AlignPosIterator getFirstAlignPosInRange(int iz, int iphi, AlignPosIterator &lastAlignPosInRange) const;
65  int Npositions() const;
66 
67  GeoTrf::Transform3D native_to_tsz_frame(const MYSQL& mysql, const Position &p) const;
68  GeoTrf::Transform3D tsz_to_native_frame(const MYSQL& mysql, const Position &p) const;
69  GeoTrf::Transform3D tsz_to_global_frame(const MYSQL& mysql, const Position &p) const;
70  GeoTrf::Transform3D global_to_tsz_frame(const MYSQL& mysql, const Position &p) const;
71  GeoTrf::Transform3D getNominalTransform(const MYSQL& mysql, const Position &p) const;
74  const AlignPos &ap, const Position &p) const;
76  const AlignPos &ap, const Position &p) const;
77 
78  friend std::ostream &operator<<(std::ostream &os, const Station &s);
79  const std::string& GetName() const;
80  double GetThickness(const MYSQL& mysql) const;
81  double GetExtraBottomThickness() const;
82  double GetExtraTopThickness() const;
83  double GetLength() const;
84  double GetWidth1() const;
85  double GetWidth2() const;
86  double getAmdbOrigine_along_length() const;
87  double getAmdbOrigine_along_thickness(const MYSQL& mysql) const;
88  bool hasMdts() const { return m_hasMdts; }
89  void setHasMdts(bool x) { m_hasMdts = x; }
90 
91  double mdtHalfPitch(const MYSQL& mysql) const;
92 
93  private:
94  double getYMin() const;
95  mutable std::atomic<double> m_amdbOrigine_along_length;
96  mutable std::atomic<double> m_amdbOrigine_along_thickness;
97  std::string m_name{};
98  bool m_hasMdts{false};
99  std::vector<std::unique_ptr<Component>> m_components{};
100  std::vector< std::unique_ptr<Cutout>> m_cutouts{};
103  }; // class Station
104 
105 } // namespace MuonGM
106 
107 #endif
MuonGM::Station::hasMdts
bool hasMdts() const
Definition: Station.h:88
MuonGM::PositionMap
std::map< int, Position, std::less< int > > PositionMap
Definition: Station.h:33
MuonGM::AlignPos
Definition: AlignPos.h:12
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition: GeoMuonHits.h:27
MuonGM::Station::tsz_to_global_frame
GeoTrf::Transform3D tsz_to_global_frame(const MYSQL &mysql, const Position &p) const
Definition: Station.cxx:430
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
MuonGM::Station::m_components
std::vector< std::unique_ptr< Component > > m_components
Definition: Station.h:99
MuonGM::Station::getFirstAlignPosInRange
AlignPosIterator getFirstAlignPosInRange(int iz, int iphi, AlignPosIterator &lastAlignPosInRange) const
Definition: Station.cxx:55
AlignPos.h
MuonGM::Station::GetExtraBottomThickness
double GetExtraBottomThickness() const
Definition: Station.cxx:155
MuonGM::Station::getNominalTransform
GeoTrf::Transform3D getNominalTransform(const MYSQL &mysql, const Position &p) const
Definition: Station.cxx:511
MuonGM::Station::getAlignedTransform
GeoTrf::Transform3D getAlignedTransform(const MYSQL &mysql, const AlignPos &ap, const Position &p) const
Definition: Station.cxx:514
MuonGM::Station::m_amdbOrigine_along_length
std::atomic< double > m_amdbOrigine_along_length
Definition: Station.h:95
MuonGM::Station::getAmdbOrigine_along_thickness
double getAmdbOrigine_along_thickness(const MYSQL &mysql) const
Definition: Station.cxx:558
MuonGM::Station::global_to_tsz_frame
GeoTrf::Transform3D global_to_tsz_frame(const MYSQL &mysql, const Position &p) const
Definition: Station.cxx:508
MuonGM::Station
Definition: Station.h:40
MuonGM::Station::m_cutouts
std::vector< std::unique_ptr< Cutout > > m_cutouts
Definition: Station.h:100
MuonGM::MYSQL
Definition: MYSQL.h:43
MuonGM::Station::m_positions
PositionMap m_positions
Definition: Station.h:101
MuonGM::Station::getYMin
double getYMin() const
Definition: Station.cxx:209
MuonGM::Station::SetPosition
void SetPosition(Position p)
Definition: Station.cxx:87
x
#define x
python.AtlRunQueryParser.ap
ap
Definition: AtlRunQueryParser.py:826
MuonGM::Station::getDeltaTransform
GeoTrf::Transform3D getDeltaTransform(const MYSQL &mysql, const AlignPos &ap, const Position &p) const
Definition: Station.cxx:546
MuonGM::Station::operator=
Station & operator=(const Station &s)=delete
MuonGM::Station::begin
PositionIterator begin() const
Definition: Station.cxx:106
GeoPrimitives.h
MuonGM::Component
Definition: Component.h:11
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
MuonGM::Position
Definition: Position.h:11
lumiFormat.i
int i
Definition: lumiFormat.py:85
MuonGM::Station::m_name
std::string m_name
Definition: Station.h:97
MuonGM::PositionIterator
std::map< int, Position, std::less< int > >::const_iterator PositionIterator
Definition: Station.h:37
MuonGM::Station::Npositions
int Npositions() const
Definition: Station.cxx:104
MuonGM::Station::FindPosition
PositionIterator FindPosition(int iz, int iphi) const
Definition: Station.cxx:99
Cutout.h
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
MuonGM::Station::aend
AlignPosIterator aend() const
Definition: Station.cxx:77
MuonGM::Station::getAmdbOrigine_along_length
double getAmdbOrigine_along_length() const
Definition: Station.cxx:553
MuonGM::AlignPosIterator
std::multimap< int, AlignPos, std::less< int > >::const_iterator AlignPosIterator
Definition: Station.h:38
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
MuonGM::Station::GetExtraTopThickness
double GetExtraTopThickness() const
Definition: Station.cxx:151
Component.h
MuonGM::Station::SetCutout
void SetCutout(Cutout *c)
Definition: Station.cxx:81
MuonGM::Station::tsz_to_native_frame
GeoTrf::Transform3D tsz_to_native_frame(const MYSQL &mysql, const Position &p) const
Definition: Station.cxx:426
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
MuonGM::Station::setHasMdts
void setHasMdts(bool x)
Definition: Station.h:89
MuonGM::Station::FindAlignPos
AlignPosIterator FindAlignPos(int iz, int iphi) const
Definition: Station.cxx:62
MuonGM::Station::SetComponent
void SetComponent(Component *c)
Definition: Station.cxx:79
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
MuonGM::AlignPosMap
std::multimap< int, AlignPos, std::less< int > > AlignPosMap
Definition: Station.h:36
MuonGM::Station::GetLength
double GetLength() const
Definition: Station.cxx:160
MuonGM::Station::SetAlignPos
void SetAlignPos(const AlignPos &p)
Definition: Station.cxx:42
MuonGM::Station::GetWidth1
double GetWidth1() const
Definition: Station.cxx:227
MuonGM::Station::GetNrOfCutouts
int GetNrOfCutouts() const
Definition: Station.cxx:324
Position.h
MuonGM::Station::GetWidth2
double GetWidth2() const
Definition: Station.cxx:275
MuonGM::Station::getDeltaTransform_tszFrame
GeoTrf::Transform3D getDeltaTransform_tszFrame(const MYSQL &mysql, const AlignPos &ap) const
Definition: Station.cxx:519
MuonGM::Station::operator<<
friend std::ostream & operator<<(std::ostream &os, const Station &s)
Definition: Station.cxx:326
MuonGM::Station::~Station
~Station()=default
MuonGM::Station::GetNrOfComponents
int GetNrOfComponents() const
Definition: Station.cxx:322
AthMessaging.h
MuonGM::Station::Station
Station(const Station &s)=delete
MuonGM::Station::Station
Station()
Definition: Station.cxx:33
MuonGM::Station::m_alignpositions
AlignPosMap m_alignpositions
Definition: Station.h:102
MuonGM::Station::GetCutout
Cutout * GetCutout(int i) const
Definition: Station.cxx:85
MuonGM::Station::GetThickness
double GetThickness(const MYSQL &mysql) const
Definition: Station.cxx:112
MuonGM::Station::native_to_tsz_frame
GeoTrf::Transform3D native_to_tsz_frame(const MYSQL &mysql, const Position &p) const
Definition: Station.cxx:371
MuonGM::Station::m_amdbOrigine_along_thickness
std::atomic< double > m_amdbOrigine_along_thickness
Definition: Station.h:96
MuonGM::Station::abegin
AlignPosIterator abegin() const
Definition: Station.cxx:76
MuonGM::Station::end
PositionIterator end() const
Definition: Station.cxx:108
MuonGM::Cutout
Definition: Cutout.h:14
MuonGM::Station::GetComponent
Component * GetComponent(int i) const
Definition: Station.cxx:83
MuonGM::Station::GetName
const std::string & GetName() const
Definition: Station.cxx:110
MuonGM::Station::mdtHalfPitch
double mdtHalfPitch(const MYSQL &mysql) const
Definition: Station.cxx:343
python.compressB64.c
def c
Definition: compressB64.py:93
CLASS_DEF.h
macros to associate a CLID to a type
MuonGM::Station::m_hasMdts
bool m_hasMdts
Definition: Station.h:98
MuonGM::Station::CountAlignPos
int CountAlignPos(int iz, int iphi) const
Definition: Station.cxx:69