Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RawTower.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RawTower.h
1 #ifndef CALOBASE_RAWTOWER_H
2 #define CALOBASE_RAWTOWER_H
3 
4 #include "RawTowerDefs.h"
5 
6 #include <phool/PHObject.h>
7 #include <phool/phool.h>
8 
9 #include <climits>
10 #include <cmath>
11 #include <cstddef> // for size_t
12 #include <iostream>
13 #include <map>
14 #include <string> // for string
15 #include <utility>
16 
17 class RawTower : public PHObject
18 {
19  public:
21  typedef unsigned long long CellKeyType;
22 
23  typedef std::map<CellKeyType, float> CellMap;
24  typedef CellMap::iterator CellIterator;
25  typedef CellMap::const_iterator CellConstIterator;
26  typedef std::pair<CellIterator, CellIterator> CellRange;
27  typedef std::pair<CellConstIterator, CellConstIterator> CellConstRange;
28 
29  typedef std::map<int, float> ShowerMap;
30  typedef ShowerMap::iterator ShowerIterator;
31  typedef ShowerMap::const_iterator ShowerConstIterator;
32  typedef std::pair<ShowerIterator, ShowerIterator> ShowerRange;
33  typedef std::pair<ShowerConstIterator, ShowerConstIterator> ShowerConstRange;
34 
35  ~RawTower() override {}
36 
37  void Reset() override { PHOOL_VIRTUAL_WARNING; }
38  int isValid() const override
39  {
40  PHOOL_VIRTUAL_WARN("isValid()");
41  return 0;
42  }
43  void identify(std::ostream& /*os*/ = std::cout) const override { PHOOL_VIRTUAL_WARN("identify()"); }
44 
45  virtual void set_id(RawTowerDefs::keytype) { PHOOL_VIRTUAL_WARN("set_id()"); }
46  virtual RawTowerDefs::keytype get_id() const
47  {
48  PHOOL_VIRTUAL_WARN("get_id()");
49  return 0;
50  }
51 
52  virtual void set_key(RawTowerDefs::keytype id) { set_id(id); }
53  virtual RawTowerDefs::keytype get_key() const { return get_id(); }
54 
55  virtual int get_bineta() const
56  {
57  PHOOL_VIRTUAL_WARN("get_bineta()");
58  return -1;
59  }
60 
61  virtual int get_bintheta() const
62  {
63  return get_bineta();
64  }
65 
66  virtual int get_binphi() const
67  {
68  PHOOL_VIRTUAL_WARN("get_binphi()");
69  return -1;
70  }
71 
73  virtual int get_binl() const
74  {
75  PHOOL_VIRTUAL_WARN("get_binl()");
76  return -1;
77  }
78  virtual int get_column() const
79  {
80  PHOOL_VIRTUAL_WARN("get_column()");
81  return -1;
82  }
83  virtual int get_row() const
84  {
85  PHOOL_VIRTUAL_WARN("get_row()");
86  return -1;
87  }
88 
90  virtual double get_energy() const
91  {
92  PHOOL_VIRTUAL_WARN("get_energy()");
93  return 0.0;
94  }
96  virtual void set_energy(const double)
97  {
98  PHOOL_VIRTUAL_WARN("set_energy()");
99  return;
100  }
101 
103  virtual double get_scint_gammas() const
104  {
105  PHOOL_VIRTUAL_WARN("get_scint_gammas()");
106  return 0.0;
107  }
109  virtual void set_scint_gammas(const double)
110  {
111  PHOOL_VIRTUAL_WARN("set_scint_gammas()");
112  return;
113  }
114 
116  virtual double get_cerenkov_gammas() const
117  {
118  PHOOL_VIRTUAL_WARN("get_cerenkov_gammas()");
119  return 0.0;
120  }
122  virtual void set_cerenkov_gammas(const double)
123  {
124  PHOOL_VIRTUAL_WARN("set_cerenkov_gammas()");
125  return;
126  }
127 
129  virtual float get_time() const
130  {
131  PHOOL_VIRTUAL_WARN("get_time()");
132  return NAN;
133  }
135  virtual void set_time(const float)
136  {
137  PHOOL_VIRTUAL_WARN("set_time()");
138  return;
139  }
140 
141  virtual bool empty_g4cells() const { return true; }
142  virtual size_t size_g4cells() const { return 0; }
143  virtual CellConstRange get_g4cells() const;
145  virtual CellConstIterator find_g4cell(CellKeyType id) const;
146  virtual void add_ecell(const CellKeyType /*g4cellid*/, const float /*ecell*/)
147  {
148  PHOOL_VIRTUAL_WARN("add_ecell(const CellKeyType g4cellid, const float ecell)");
149  return;
150  }
151  virtual void clear_g4cells() {}
152 
153  virtual bool empty_g4showers() const { return true; }
154  virtual size_t size_g4showers() const { return 0; }
155  virtual ShowerConstRange get_g4showers() const;
156  virtual ShowerIterator find_g4shower(int /*id*/);
157  virtual ShowerConstIterator find_g4shower(int /*id*/) const;
158  virtual void add_eshower(const int /*g4showerid*/, const float /*eshower*/)
159  {
160  PHOOL_VIRTUAL_WARN("add_eshower(const unsigned int g4showerid, const float eshower)");
161  return;
162  }
163  virtual void clear_g4showers() {}
164 
168  enum PROPERTY
169  { //
170 
173 
176 
178  prop_MAX_NUMBER = UCHAR_MAX
179  };
180 
181  virtual bool has_property(const PROPERTY /*prop_id*/) const { return false; }
182  virtual double get_property(const PROPERTY /*prop_id*/) const { return NAN; }
183  virtual void set_property(const PROPERTY /*prop_id*/, const double /*value*/) { return; }
184  static const std::string get_property_info(PROPERTY prop_id);
185 
186  protected:
187  RawTower() {}
188 
189  virtual unsigned int get_property_nocheck(const PROPERTY /*prop_id*/) const { return UINT_MAX; }
190  virtual void set_property_nocheck(const PROPERTY /*prop_id*/, const unsigned int) { return; }
191 
192  ClassDefOverride(RawTower, 1)
193 };
194 
195 #endif