ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RawTowerGeomv3.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RawTowerGeomv3.h
1 #ifndef CALOBASE_RAWTOWERGEOMV3_H
2 #define CALOBASE_RAWTOWERGEOMV3_H
3 
4 #include "RawTowerGeom.h"
5 
6 #include "RawTowerDefs.h"
7 
8 #include <cmath>
9 #include <iostream>
10 
12 {
13  public:
16  ~RawTowerGeomv3() override {}
17 
18  void identify(std::ostream& os = std::cout) const override;
19 
20  void set_id(RawTowerDefs::keytype key) override { _towerid = key; }
21  RawTowerDefs::keytype get_id() const override { return _towerid; }
22 
23  int get_bineta() const override;
24  int get_binphi() const override;
25 
26  int get_column() const override { return get_bineta(); }
27  int get_row() const override { return get_binphi(); }
28 
29  int get_binl() const override { return RawTowerDefs::decode_index3v2(_towerid);}
30 
31 
32  void set_center_x(double x) override
33  {
34  _center_x = x;
35  return;
36  }
37  void set_center_y(double y) override
38  {
39  _center_y = y;
40  return;
41  }
42  void set_center_z(double z) override
43  {
44  _center_z = z;
45  return;
46  }
47 
48  void set_size_x(double dx) override
49  {
50  _size_x = dx;
51  return;
52  }
53  void set_size_y(double dy) override
54  {
55  _size_y = dy;
56  return;
57  }
58  void set_size_z(double dz) override
59  {
60  _size_z = dz;
61  return;
62  }
63 
64  double get_center_x() const override { return _center_x; }
65  double get_center_y() const override { return _center_y; }
66  double get_center_z() const override { return _center_z; }
67 
68  double get_size_x() const override { return _size_x; }
69  double get_size_y() const override { return _size_y; }
70  double get_size_z() const override { return _size_z; }
71  double get_volume() const override { return (_size_x * _size_y * _size_z); }
72 
73  double get_center_radius() const override;
74  double get_eta() const override;
75  double get_phi() const override;
76  double get_theta() const override;
77 
78  void set_tower_type(int tt) override { _tower_type = tt; }
79  int get_tower_type() const override { return _tower_type; }
80 
81  protected:
82  RawTowerDefs::keytype _towerid = ~0; // complement = 0xFFFFF... independent of integer type (32/64/... bits)
83 
84  double _center_x = NAN;
85  double _center_y = NAN;
86  double _center_z = NAN;
87 
88  double _size_x = NAN;
89  double _size_y = NAN;
90  double _size_z = NAN;
91 
92  int _tower_type = -1;
93 
94  ClassDefOverride(RawTowerGeomv3, 4)
95 };
96 
97 #endif /* CALOBASE_RAWTOWERGEOMV3_H */