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