Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RawCluster.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RawCluster.h
1 #ifndef CALOBASE_RAWCLUSTER_H
2 #define CALOBASE_RAWCLUSTER_H
3 
4 #include "RawClusterDefs.h"
5 #include "RawTowerDefs.h"
6 
7 #include <phool/PHObject.h>
8 #include <phool/phool.h>
9 
10 #include <CLHEP/Vector/ThreeVector.h>
11 
12 #include <climits>
13 #include <cmath> // def of NAN
14 #include <cstddef>
15 #include <iostream>
16 #include <map>
17 #include <string> // for string
18 #include <type_traits>
19 #include <utility>
20 
21 class RawCluster : public PHObject
22 {
23  public:
24  typedef std::map<RawTowerDefs::keytype, float> TowerMap;
25  typedef TowerMap::iterator TowerIterator;
26  typedef TowerMap::const_iterator TowerConstIterator;
27  typedef std::pair<TowerIterator, TowerIterator> TowerRange;
28  typedef std::pair<TowerConstIterator, TowerConstIterator> TowerConstRange;
29 
30  ~RawCluster() override {}
31  void Reset() override { PHOOL_VIRTUAL_WARNING; }
32 
33  PHObject* CloneMe() const override { return nullptr; }
34 
35  int isValid() const override
36  {
38  return 0;
39  }
40  void identify(std::ostream& /*os*/ = std::cout) const override { PHOOL_VIRTUAL_WARNING; }
44 
46  {
47  PHOOL_VIRTUAL_WARN("get_id()");
48  return 0;
49  }
51  virtual float get_energy() const
52  {
53  PHOOL_VIRTUAL_WARN("get_energy()");
54  return NAN;
55  }
57  virtual size_t getNTowers() const
58  {
60  return 0;
61  }
62  virtual TowerConstRange get_towers() const
63  {
64  PHOOL_VIRTUAL_WARN("get_towers()");
65  static TowerMap dummy;
66  return make_pair(dummy.begin(), dummy.end());
67  }
69  virtual const TowerMap& get_towermap() const
70  {
71  PHOOL_VIRTUAL_WARN("get_towers()");
72  static TowerMap dummy;
73  return dummy;
74  }
75 
76  virtual CLHEP::Hep3Vector get_position() const
77  {
78  PHOOL_VIRTUAL_WARN("get_position()");
79  return CLHEP::Hep3Vector(NAN, NAN, NAN);
80  }
81  //
83  virtual float get_phi() const
84  {
85  PHOOL_VIRTUAL_WARN("get_phi()");
86  return NAN;
87  }
88  virtual float get_r() const
89  {
90  PHOOL_VIRTUAL_WARN("get_r()");
91  return NAN;
92  }
93  virtual float get_z() const
94  {
95  PHOOL_VIRTUAL_WARN("get_z()");
96  return NAN;
97  }
98  //
99 
128 
129  virtual float get_x() const
130  {
131  PHOOL_VIRTUAL_WARN("get_x()");
132  return NAN;
133  }
134  virtual float get_y() const
135  {
136  PHOOL_VIRTUAL_WARN("get_y()");
137  return NAN;
138  }
139  //
142  virtual float get_ecore() const
143  {
144  PHOOL_VIRTUAL_WARN("get_ecore()");
145  return NAN;
146  }
148  virtual float get_chi2() const
149  {
150  PHOOL_VIRTUAL_WARN("get_chi2()");
151  return NAN;
152  }
154  virtual float get_prob() const
155  {
156  PHOOL_VIRTUAL_WARN("get_prob()");
157  return NAN;
158  }
160  virtual float get_et_iso() const
161  {
162  PHOOL_VIRTUAL_WARN("get_et_iso()");
163  return NAN;
164  }
166  virtual float get_et_iso(const int /*radiusx10*/, bool /*subtracted*/, bool /*clusterTower*/) const
167  {
168  PHOOL_VIRTUAL_WARN("get_et_iso(const int radiusx10, bool subtracted, bool clusterTower)");
169  return NAN;
170  }
171 
172  // //! truth cluster's PHG4Particle ID
173  // virtual int get_truth_track_ID() const
174  // {
175  // PHOOL_VIRTUAL_WARN("get_truth_track_ID()");
176  // return 0;
177  // }
178  // //! truth cluster's PHG4Particle flavor
179  // virtual int get_truth_flavor() const
180  // {
181  // PHOOL_VIRTUAL_WARN("get_truth_flavor()");
182  // return 0;
183  // }
184  // // end of getters
186 
190 
193  virtual void addTower(const RawClusterDefs::keytype /*twrid*/, const float /*etower*/) { PHOOL_VIRTUAL_WARNING; }
195  virtual void set_energy(const float) { PHOOL_VIRTUAL_WARNING; }
196  //
198  virtual void set_phi(const float) { PHOOL_VIRTUAL_WARNING; }
199  virtual void set_z(const float) { PHOOL_VIRTUAL_WARNING; }
200  virtual void set_r(const float) { PHOOL_VIRTUAL_WARNING; }
201  //
204  virtual void set_ecore(const float) { PHOOL_VIRTUAL_WARNING; }
206  virtual void set_chi2(const float) { PHOOL_VIRTUAL_WARNING; }
208  virtual void set_prob(const float) { PHOOL_VIRTUAL_WARNING; }
210  virtual void set_et_iso(const float) { PHOOL_VIRTUAL_WARNING; }
211  virtual void set_et_iso(const float /*e*/, const int /*radiusx10*/, bool /*subtracted*/, bool /*clusterTower*/) { PHOOL_VIRTUAL_WARNING; }
212  // //! truth cluster's PHG4Particle ID
213  // virtual void set_truth_track_ID(const int) { PHOOL_VIRTUAL_WARNING; }
214  // //! truth cluster's PHG4Particle flavor
215  // virtual void set_truth_flavor(const int) { PHOOL_VIRTUAL_WARNING; }
216  //
217  /*
218  *
219  * @} */
220  // end of setters
221 
226  public:
230  enum PROPERTY
231  { //
232  // ----- additional cluster properties -----
239 
240  // ----- analysis specific quantities -----
257  // // ----- truth cluster quantities -----
258  // //! truth cluster's PHG4Particle ID
259  // prop_truth_track_ID = 100,
260  // //! truth cluster's PHG4Particle flavor
261  // prop_truth_flavor = 101,
262 
264  prop_MAX_NUMBER = UCHAR_MAX
265  };
266 
268  { //
269  type_int = 1,
273  };
274 
276  virtual bool has_property(const PROPERTY /*prop_id*/) const { return false; }
277  virtual float get_property_float(const PROPERTY /*prop_id*/) const { return NAN; }
278  virtual int get_property_int(const PROPERTY /*prop_id*/) const { return INT_MIN; }
279  virtual unsigned int get_property_uint(const PROPERTY /*prop_id*/) const { return UINT_MAX; }
281  virtual void set_property(const PROPERTY /*prop_id*/, const float /*value*/) { return; }
282  virtual void set_property(const PROPERTY /*prop_id*/, const int /*value*/) { return; }
283  virtual void set_property(const PROPERTY /*prop_id*/, const unsigned int /*value*/) { return; }
285  static std::pair<const std::string, PROPERTY_TYPE> get_property_info(PROPERTY prop_id);
286  static bool check_property(const PROPERTY prop_id, const PROPERTY_TYPE prop_type);
287  static std::string get_property_type(const PROPERTY_TYPE prop_type);
288  // end of property map definitions
290 
291  protected:
292  RawCluster() {} // make sure nobody calls ctor of base class
293  ClassDefOverride(RawCluster, 1)
294 };
295 
296 #endif