Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RawTowerv1.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RawTowerv1.h
1 #ifndef CALOBASE_RAWTOWERV1_H
2 #define CALOBASE_RAWTOWERV1_H
3 
4 #include "RawTower.h"
5 
6 #include "RawTowerDefs.h"
7 
8 #include <cstddef>
9 #include <iostream>
10 #include <map>
11 #include <utility>
12 
13 class RawTowerv1 : public RawTower
14 {
15  public:
17  RawTowerv1(const RawTower& tower);
19  RawTowerv1(const unsigned int ieta, const unsigned int iphi);
20  RawTowerv1(const RawTowerDefs::CalorimeterId caloid, const unsigned int ieta,
21  const unsigned int iphi);
22  ~RawTowerv1() override {}
23 
24  void Reset() override;
25  int isValid() const override;
26  void identify(std::ostream& os = std::cout) const override;
27 
28  void set_id(RawTowerDefs::keytype id) override { towerid = id; }
29  RawTowerDefs::keytype get_id() const override { return towerid; }
30  int get_bineta() const override;
31  int get_binphi() const override;
32  int get_binl() const override { return RawTowerDefs::decode_index3v2(towerid); }
33  double get_energy() const override { return energy; }
34  void set_energy(const double e) override { energy = e; }
35  float get_time() const override { return time; }
36  void set_time(const float t) override { time = t; }
37 
38  //---cell access--------------------------------------------------------------
39 
40  bool empty_g4cells() const override { return ecells.empty(); }
41  size_t size_g4cells() const override { return ecells.size(); }
43  {
44  return make_pair(ecells.begin(), ecells.end());
45  }
46  RawTower::CellIterator find_g4cell(CellKeyType id) override { return ecells.find(id); }
47  RawTower::CellConstIterator find_g4cell(CellKeyType id) const override { return ecells.find(id); }
48  void add_ecell(const CellKeyType g4cellid,
49  const float ecell) override;
50  void clear_g4cells() override { ecells.clear(); }
51 
52  //---shower access------------------------------------------------------------
53 
54  bool empty_g4showers() const override { return eshowers.empty(); }
55  size_t size_g4showers() const override { return eshowers.size(); }
57  {
58  return make_pair(eshowers.begin(), eshowers.end());
59  }
60  RawTower::ShowerIterator find_g4shower(int id) override { return eshowers.find(id); }
61  RawTower::ShowerConstIterator find_g4shower(int id) const override { return eshowers.find(id); }
62  void add_eshower(const int g4showerid, const float eshower) override;
63  void clear_g4showers() override { eshowers.clear(); }
64 
65  protected:
67 
70  double energy = 0.;
73  float time = NAN;
74 
75  CellMap ecells; //< default truth storage
76  ShowerMap eshowers; //< alternate truth storage for smaller filesizes
77 
78  ClassDefOverride(RawTowerv1, 5)
79 };
80 
81 #endif