ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHG4BlockGeomv1.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHG4BlockGeomv1.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef G4DETECTORS_PHG4BLOCKGEOMV1_H
4 #define G4DETECTORS_PHG4BLOCKGEOMV1_H
5 
6 #include "PHG4BlockGeom.h"
7 
8 #include <iostream> // for cout, ostream
9 
11 {
12  public:
14  PHG4BlockGeomv1( const int layer,
15  const double sizex, const double sizey, const double sizez,
16  const double centerx, const double centery, const double centerz,
17  const double zrot );
18 
19  ~PHG4BlockGeomv1() override {}
20 
21 // from PHObject
22  void identify(std::ostream& os = std::cout) const override;
23 
24  int get_layer() const override {return _layer;}
25  double get_width() const override {return _size[0];}
26  double get_thickness() const override {return _size[1];}
27  double get_length() const override {return _size[2];}
28  double get_center_x() const override {return _center[0];}
29  double get_center_y() const override {return _center[1];}
30  double get_center_z() const override {return _center[2];}
31  double get_z_rot() const override {return _rotation_z;}
32 
33  double get_size_x() const override {return _size[0];}
34  double get_size_y() const override {return _size[1];}
35  double get_size_z() const override {return _size[2];}
36 
37  double get_rot_matrix(const int i, const int j) const override {return _rot_matrix[i][j];}
38 
39  void set_layer(const int i) override {_layer = i;}
40 
41  // size in local coordinates
42  void set_size(const double sizex, const double sizey, const double sizez) override;
43 
44  void set_z_rot(const double zrot) override {_build_rot_matrix(); _rotation_z = zrot;}
45 
46  void convert_local_to_global(double, double, double,
47  double &, double &, double &) const override;
48 
49 // our own (not inherited)
50  void set_center(const double centerx, const double centery, const double centerz);
51  void convert_global_x_to_local(double, double, double,
52  double &, double &, double &) const;
53 
54  protected:
55  int _layer;
56  double _size[3];
57  double _center[3];
58  double _rotation_z;
59 
60  void _build_rot_matrix();
61  double _rot_matrix[3][3]; // global -> local coordinates rotation matrix
62 
63  ClassDefOverride(PHG4BlockGeomv1,1)
64 };
65 
66 #endif