Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4MicromegasSurvey.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4MicromegasSurvey.h
1 #ifndef PHG4MICROMEGASSURVEY_H
2 #define PHG4MICROMEGASSURVEY_H
3 
16 #include <Geant4/G4Transform3D.hh>
17 
18 #include <array>
19 #include <string>
20 #include <unordered_map>
21 
23 {
24  public:
27 
29  std::string get_module_name(int layer, uint tile) const;
30 
32  G4Transform3D get_transformation(int layer, uint tile) const;
33 
34  private:
36  struct tile_id_t
37  {
38  tile_id_t(int layer, uint tile)
39  : m_layer(layer)
40  , m_tile(tile)
41  {
42  }
43  int m_layer = 0;
44  uint m_tile = 0;
45 
46  bool operator==(const tile_id_t& other) const
47  {
48  return other.m_layer == m_layer && other.m_tile == m_tile;
49  }
50  };
51 
53  {
54  std::size_t operator()(const tile_id_t& id) const noexcept
55  {
56  return id.m_tile + (id.m_layer << 4);
57  }
58  };
59 
61  using tile_map_t = std::unordered_map<tile_id_t, std::string, tile_id_hash_t>;
63 
65  using rotation_t = std::array<double, 3>;
66  using translation_t = std::array<double, 3>;
68  {
70  : m_rotation(rotation)
71  , m_translation(translation)
72  {
73  }
74 
77 
80  };
81 
83  using transformation_map_t = std::unordered_map<std::string, transformation_t>;
85 };
86 
87 #endif