Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CylinderGeomIntt.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CylinderGeomIntt.h
1 #ifndef INTT_CYLINDERGEOMINTT_H
2 #define INTT_CYLINDERGEOMINTT_H
3 
5 
7 
8 #include <TVector2.h>
9 #include <TVector3.h>
10 
11 #include <cmath>
12 #include <iostream>
13 
15 {
16  public:
17  CylinderGeomIntt() = default;
19  const int layer,
20  const double strip_x,
21  const double strip_y,
22  const double strip_z0,
23  const double strip_z1,
24  const int nstrips_z_sensor0,
25  const int nstrips_z_sensor1,
26  const int nstrips_phi_cell,
27  const int nladders_layer,
28  const double ladder_z0,
29  const double ladder_z1,
30  const double sensor_radius,
31  const double strip_x_offset,
32  const double offsetphi,
33  const double offsetrot)
34  : m_Layer(layer)
35  , m_NStripsPhiCell(nstrips_phi_cell)
36  , m_StripX(strip_x)
37  , m_StripY(strip_y)
38  , m_SensorRadius(sensor_radius)
39  , m_StripXOffset(strip_x_offset)
40  , m_OffsetPhi(offsetphi)
41  , m_OffsetRot(offsetrot)
42  {
43  // Type-A
44  m_StripZ[0] = strip_z0;
45  m_LadderZ[0] = ladder_z0;
46  m_NStripsZSensor[0] = nstrips_z_sensor0;
47 
48  // Type-B
49  m_StripZ[1] = strip_z1;
50  m_LadderZ[1] = ladder_z1;
51  m_NStripsZSensor[1] = nstrips_z_sensor1;
52 
53  m_dPhi = 2. * M_PI / nladders_layer;
54  }
55 
56  // from PHObject
57  void identify(std::ostream& os = std::cout) const override;
58 
59  // overridden from base class
60  double get_thickness() const override
61  {
62  return m_StripX;
63  }
64 
65  double get_strip_y_spacing() const override
66  {
67  return m_StripY;
68  }
69 
70  double get_strip_z_spacing() const override
71  {
72  return m_StripZ[0];
73  }
74 
75  double get_strip_tilt() const override
76  {
77  return 0.;
78  }
79 
80  void set_layer(const int i) override
81  {
82  m_Layer = i;
83  }
84 
85  int get_layer() const override
86  {
87  return m_Layer;
88  }
89 
90  double get_radius() const override
91  {
92  return m_SensorRadius;
93  }
94 
95  // our own
96  void find_segment_center(const Surface& surface, ActsGeometry* tGeometry, double location[]);
97  void find_strip_center(const Surface& surface, ActsGeometry* tGeometry, const int segment_z_bin, const int segment_phi_bin, const int strip_column, const int strip_index, double location[]);
98  void find_strip_index_values(const int segment_z_bin, const double ypos, const double zpos, int& strip_y_index, int& strip_z_index) override;
99 
100  bool load_geometry() { return true; }
101  void find_strip_center_localcoords(const int segment_z_bin, const int strip_y_index, const int strip_z_index, double location[]);
102  void find_indices_from_segment_center(int& segment_z_bin, int& segment_phi_bin, double location[]);
103  TVector3 get_world_from_local_coords(const Surface& surface, ActsGeometry* tGeometry, const TVector2& local);
104  TVector3 get_world_from_local_coords(const Surface& surface, ActsGeometry* tGeometry, const TVector3& local);
105  TVector3 get_local_from_world_coords(const Surface& surface, ActsGeometry* tGeometry, TVector3 world);
106  void find_indices_from_world_location(int& segment_z_bin, int& segment_phi_bin, double location[]);
107 
108  void find_strip_center(int, int, int, int, double*) override
109  {
110  std::cout << "find_strip_center(int, int, int, int, double[]) is deprecated" << std::endl;
111  }
112  void find_segment_center(const int, const int, double*) override
113  {
114  std::cout << "find_segment_center(const int, const int, double*) is deprecated" << std::endl;
115  }
116 
117  double get_strip_phi_tilt() const
118  {
119  return m_OffsetRot;
120  }
121 
122  protected:
123  int m_Layer{-1};
125  int m_NStripsZSensor[2] {-1,-1};
126  double m_StripX{std::numeric_limits<double>::quiet_NaN()};
127  double m_StripY{std::numeric_limits<double>::quiet_NaN()};
128  double m_SensorRadius{std::numeric_limits<double>::quiet_NaN()};
129  double m_StripXOffset{std::numeric_limits<double>::quiet_NaN()};
130  double m_OffsetPhi{std::numeric_limits<double>::quiet_NaN()};
131  double m_OffsetRot{std::numeric_limits<double>::quiet_NaN()};
132  double m_dPhi{std::numeric_limits<double>::quiet_NaN()};
133 
134  double m_StripZ[2] {std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN()};
135  double m_LadderZ[2]{std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN()};
136 
137  ClassDefOverride(CylinderGeomIntt, 1)
138 };
139 
140 #endif