ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RawTowerGeomv4.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RawTowerGeomv4.h
1 #ifndef CALOBASE_RAWTOWERGEOMV4_H
2 #define CALOBASE_RAWTOWERGEOMV4_H
3 
4 #include "RawTowerGeom.h"
5 
6 #include "RawTowerDefs.h"
7 
8 #include <cmath>
9 #include <iostream>
10 #include <TRotation.h>
11 #include <TVector3.h>
12 
14 {
15  public:
18  virtual ~RawTowerGeomv4() {}
19 
20  void identify(std::ostream& os = std::cout) const override;
21 
22  void set_id(RawTowerDefs::keytype key) override { _towerid = key; }
23  RawTowerDefs::keytype get_id() const override { return _towerid; }
24 
25  int get_bineta() const override { return RawTowerDefs::decode_index1(_towerid); }
26  int get_binphi() const override { return RawTowerDefs::decode_index2(_towerid); }
27  int get_column() const override { return RawTowerDefs::decode_index1(_towerid); }
28  int get_row() const override { return RawTowerDefs::decode_index2(_towerid); }
29 
30  void set_center_x(double x) override
31  {
32  _center_x = x;
33  return;
34  }
35  void set_center_y(double y) override
36  {
37  _center_y = y;
38  return;
39  }
40  void set_center_z(double z) override
41  {
42  _center_z = z;
43  return;
44  }
45  void set_roty(double roty) override
46  {
47  _roty = roty;
48  return;
49  }
50  void set_rotz(double rotz) override
51  {
52  _rotz = rotz;
53  return;
54  }
55 
56  double get_center_x() const override { return _center_x; }
57  double get_center_y() const override { return _center_y; }
58  double get_center_z() const override { return _center_z; }
59  double get_roty() const override { return _roty; }
60  double get_rotz() const override { return _rotz; }
61 
62 
63  TVector3 get_final_position() const;
64  double get_center_radius() const override;
65  double get_eta() const override;
66  double get_phi() const override;
67  double get_theta() const override;
68 
69  void set_tower_type(int tt) override { _tower_type = tt; }
70  int get_tower_type() const override { return _tower_type; }
71 
72  protected:
73  RawTowerDefs::keytype _towerid = ~0; // complement = 0xFFFFF... independent of integer type (32/64/... bits)
74 
75  double _center_x = NAN;
76  double _center_y = NAN;
77  double _center_z = NAN;
78  double _roty = NAN;
79  double _rotz = NAN;
80 
81  int _tower_type = -1;
82 
83  ClassDefOverride(RawTowerGeomv4, 5)
84 };
85 
86 #endif /* CALOBASE_RawTowerGeomv4_H */