ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CylinderGeom_Mvtx.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CylinderGeom_Mvtx.h
1 #ifndef MVTX_CYLINDERGEOMMVTX_H
2 #define MVTX_CYLINDERGEOMMVTX_H
3 
5 
6 #include <TVector3.h>
7 
8 #include <iostream>
9 
11 {
12  public:
14  int layer,
15  int in_Nstaves,
16  double in_layer_nominal_radius,
17  double in_phistep,
18  double in_phitilt,
19  double in_phi0
20  );
21 
25  /*int layer*/ 0,
26  /*int in_Nstaves*/ 0,
27  /*double in_layer_nominal_radius*/ 3,
28  /*double in_phistep*/ 0,
29  /*double in_phitilt*/ 0,
30  /*double in_phi0*/ 0)
31  {
32  }
33 
34  ~CylinderGeom_Mvtx() override {}
35 
36 // from PHObject
37  void identify(std::ostream& os = std::cout) const override;
38 
39 
40 // from base class
41  void set_layer(const int i) override { layer = i; }
42  int get_layer() const override { return layer; }
43  double get_radius() const override { return layer_radius; }
44 
45  double get_pixel_x() const override { return pixel_x; } // pitch
46  double get_pixel_z() const override { return pixel_z; } // length
47  double get_pixel_thickness() const override { return pixel_thickness; }
48 
49 // our own - no override
50  TVector3 get_local_from_world_coords(int stave, int half_stave, int module, int chip, TVector3 world_location);
51  TVector3 get_world_from_local_coords(int stave, int half_stave, int module, int chip, TVector3 sensor_local);
52 
53  TVector3 get_local_from_world_coords(int stave, int chip, TVector3 world_location)
54  {
55  return get_local_from_world_coords(stave, 0, 0, chip, world_location);
56  }
57 
58 
59  TVector3 get_world_from_local_coords(int stave, int chip, TVector3 sensor_local)
60  {
61  return get_world_from_local_coords(stave, 0, 0, chip, sensor_local);
62  }
63 
64  void get_sensor_indices_from_world_coords(std::vector<double> &world, unsigned int &stave, unsigned int &chip);
65 
66  bool get_pixel_from_local_coords(TVector3 sensor_local, int& iRow, int& iCol);
67  int get_pixel_from_local_coords(TVector3 sensor_local);
68 
69  TVector3 get_local_coords_from_pixel(int NXZ);
70  TVector3 get_local_coords_from_pixel(int iRow, int iCol);
71 
72  int get_pixel_X_from_pixel_number(int NXZ);
73 
74  int get_pixel_Z_from_pixel_number(int NXZ);
75 
76  int get_pixel_number_from_xbin_zbin(int xbin, int zbin); // obsolete
77 
78  double get_stave_phi_tilt() const { return stave_phi_tilt; }
79  double get_stave_phi_0() const { return stave_phi_0; }
80 
81  int get_ladder_phi_index(int stave, int /*half_stave*/, int /*chip*/) {return stave; }
82  int get_ladder_z_index(int /*module*/, int chip) { return chip; }
83 
84  void find_sensor_center(int stave_number, int half_stave_number, int module_number, int chip_number, double location[]);
85 
86  int get_N_staves() const { return N_staves; }
87  int get_N_half_staves() const { return N_half_staves; }
88 
89  int get_NZ() const;
90  int get_NX() const;
91 
92  protected:
93  int layer;
94  int N_staves;
96 
97  // finding the center of a stave
98  double layer_radius;
101  double stave_phi_0;
102 
103  // for all layers
105 
106  // inner barrel layers stave construction
110 
111  double pixel_x;
112  double pixel_z;
114 
115  ClassDefOverride(CylinderGeom_Mvtx, 2)
116 };
117 
118 #endif