ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RawTowerZDCv1.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file RawTowerZDCv1.cc
1 #include "RawTowerZDCv1.h"
2 
3 #include <cmath>
4 #include <iostream>
5 
6 using namespace std;
7 
9 {
10  towerid = (tower.get_id());
11  energy = (tower.get_energy());
12  time = (tower.get_time());
13 
14  CellConstRange cell_range = tower.get_g4cells();
15 
16  for (CellConstIterator cell_iter = cell_range.first;
17  cell_iter != cell_range.second; ++cell_iter)
18  {
19  add_ecell(cell_iter->first, cell_iter->second);
20  }
21 
22  ShowerConstRange shower_range = tower.get_g4showers();
23 
24  for (ShowerConstIterator shower_iter = shower_range.first;
25  shower_iter != shower_range.second; ++shower_iter)
26  {
27  add_eshower(shower_iter->first, shower_iter->second);
28  }
29 }
30 
32  : towerid(id)
33 {
34 }
35 
37 {
38  energy = 0;
39  time = NAN;
40  ecells.clear();
41  eshowers.clear();
42 }
43 
45 {
46  return get_energy() != 0;
47 }
48 
49 void RawTowerZDCv1::identify(std::ostream& os) const
50 {
51 
52  os << "RawTowerZDCv1: etabin: " << get_bineta() << ", phibin: " << get_binphi() << ", l-bin: " << get_binl()
53  << " energy=" << get_energy() << std::endl;
54  return;
55 
56 }
57 
59  const float ecell)
60 {
61  if (ecells.find(g4cellid) == ecells.end())
62  {
63  ecells[g4cellid] = ecell;
64  }
65  else
66  {
67  ecells[g4cellid] += ecell;
68  }
69 }
70 
71 void RawTowerZDCv1::add_eshower(const int g4showerid, const float eshower)
72 {
73  if (eshowers.find(g4showerid) == eshowers.end())
74  {
75  eshowers[g4showerid] = eshower;
76  }
77  else
78  {
79  eshowers[g4showerid] += eshower;
80  }
81 }
82 
84 {
86 }
87 
89 {
91 }
92 
94 {
96 
97 }
98