ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CylinderGeomMicromegas.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CylinderGeomMicromegas.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 
4 #ifndef MICROMEGAS_CYLINDERGEOMMICROMEGAS_H
5 #define MICROMEGAS_CYLINDERGEOMMICROMEGAS_H
6 
12 #include "MicromegasDefs.h"
13 #include "MicromegasTile.h"
14 
16 
17 #include <TGeoMatrix.h>
18 
19 #include <cmath>
20 #include <iostream>
21 
22 class TVector3;
23 class PHG4Hit;
24 
26 {
27  public:
28 
29  //* empty constructor
31  {}
32 
33  //* constructor
35  : m_layer( layer )
36  {}
37 
39  void identify(std::ostream&) const override;
40 
42 
43  int get_layer() const override {return m_layer;}
44  double get_radius() const override {return m_radius;}
45  double get_thickness() const override { return m_thickness;}
46  double get_zmin() const override {return m_zmin;}
47  double get_zmax() const override {return m_zmax;}
48  double get_pitch() const { return m_pitch; }
49 
52 
55 
56  // check if hit radius matches this cylinder
57  bool check_radius( const TVector3& ) const;
58 
60 
67  TVector3 get_local_from_world_coords( uint tileid, const TVector3& ) const;
68 
70  TVector3 get_local_from_world_vect( uint tileid, const TVector3& ) const;
71 
73 
80  TVector3 get_world_from_local_coords( uint tileid, const TVector3& ) const;
81 
83  TVector3 get_world_from_local_vect( uint tileid, const TVector3& ) const;
84 
86  int find_tile_cylindrical( const TVector3& ) const;
87 
89  int find_tile_planar( const TVector3& ) const;
90 
92  size_t get_tiles_count() const { return m_tiles.size(); }
93 
95  const MicromegasTile& get_tile( uint tileid ) const
96  {
97  assert( tileid < m_tiles.size() );
98  return m_tiles[tileid];
99  }
100 
102 
106  void convert_to_planar( uint tileid, PHG4Hit* ) const;
107 
109  int find_strip_from_world_coords( uint tileid, const TVector3& ) const;
110 
112  int find_strip_from_local_coords( uint tileid, const TVector3& ) const;
113 
115  double get_strip_length( uint tileid ) const;
116 
118  uint get_strip_count( uint tileid ) const;
119 
121  TVector3 get_local_coordinates( uint tileid, uint stripnum ) const;
122 
124  TVector3 get_world_coordinates( uint tileid, uint stripnum ) const;
125 
127  double get_center_phi( uint tileid ) const
128  {
129  assert( tileid < m_tiles.size() );
130  return m_tiles[tileid].m_centerPhi;
131  }
132 
134  static constexpr double reference_radius = 82;
135 
137 
139 
140  void set_layer(const int i) override {m_layer = i;}
141  void set_radius(const double value) override {m_radius = value;}
142  void set_thickness(const double value) override {m_thickness = value;}
143  void set_zmin(const double value) override {m_zmin = value;}
144  void set_zmax(const double value) override {m_zmax = value;}
145  void set_pitch( double value ) { m_pitch = value; }
146 
148  void set_tiles( const MicromegasTile::List& tiles ) {m_tiles = tiles;}
149 
152 
156 
157  private:
158 
159  // get local to master transformation matrix for a given tile
160  TGeoHMatrix transformation_matrix( uint tileid ) const;
161 
163  int m_layer = 0;
164 
167 
169  MicromegasDefs::DriftDirection m_drift_direction = MicromegasDefs::DriftDirection::OUTWARD;
170 
172  double m_radius = 0;
173 
175  double m_thickness = 0;
176 
178  double m_zmin = 0;
179 
181  double m_zmax = 0;
182 
184  double m_pitch = 0.1;
185 
188 
189  ClassDefOverride(CylinderGeomMicromegas, 1)
190 };
191 
192 #endif