ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
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
8
RawTowerZDCv1::RawTowerZDCv1
(
const
RawTowerZDC
& tower)
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
31
RawTowerZDCv1::RawTowerZDCv1
(
RawTowerZDCDefs::keytype
id
)
32
: towerid(id)
33
{
34
}
35
36
void
RawTowerZDCv1::Reset
()
37
{
38
energy
= 0;
39
time
= NAN;
40
ecells
.clear();
41
eshowers
.clear();
42
}
43
44
int
RawTowerZDCv1::isValid
()
const
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
58
void
RawTowerZDCv1::add_ecell
(
const
CellKeyType
g4cellid,
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
83
int
RawTowerZDCv1::get_bineta
()
const
84
{
85
return
RawTowerZDCDefs::decode_index1zdc
(
towerid
);
86
}
87
88
int
RawTowerZDCv1::get_binphi
()
const
89
{
90
return
RawTowerZDCDefs::decode_index2zdc
(
towerid
);
91
}
92
93
int
RawTowerZDCv1::get_binl
()
const
94
{
95
return
RawTowerZDCDefs::decode_index3zdc
(
towerid
);
96
97
}
98
fun4all_eicdetectors
blob
master
reconstruction
eiczdcbase
RawTowerZDCv1.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:46
using
1.8.2 with
ECCE GitHub integration