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
RawTowerv2.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file RawTowerv2.cc
1
#include "
RawTowerv2.h
"
2
3
#include <climits>
// for UCHAR_MAX
4
#include <cmath>
5
#include <iostream>
6
#include <string>
// for operator<<, string
7
#include <utility>
// for pair
8
9
using namespace
std;
10
11
RawTowerv2::RawTowerv2
()
12
{
13
}
14
15
RawTowerv2::RawTowerv2
(
const
RawTower
& tower)
16
:
RawTowerv1
(tower)
17
{
18
// This is a generic copy of ALL properties a hit has
19
// do not add explicit copies, they will be added to
20
// the new hits with their default value increasing memory use
21
for
(
unsigned
char
ic = 0; ic < UCHAR_MAX; ic++)
22
{
23
PROPERTY
prop_id =
static_cast<
PROPERTY
>
(ic);
24
if
(tower.
has_property
(prop_id))
25
{
26
set_property
(prop_id, tower.
get_property
(prop_id));
27
}
28
}
29
}
30
31
RawTowerv2::RawTowerv2
(
RawTowerDefs::keytype
id
)
32
:
RawTowerv1
(id)
33
{
34
}
35
36
RawTowerv2::RawTowerv2
(
const
unsigned
int
ieta,
const
unsigned
int
iphi)
37
:
RawTowerv1
(ieta, iphi)
38
{
39
}
40
41
RawTowerv2::RawTowerv2
(
const
RawTowerDefs::CalorimeterId
caloid,
42
const
unsigned
int
ieta,
const
unsigned
int
iphi)
43
:
RawTowerv1
(caloid, ieta, iphi)
44
{
45
}
46
47
void
RawTowerv2::Reset
()
48
{
49
RawTowerv1::Reset
();
50
prop_map
.clear();
51
}
52
53
int
RawTowerv2::isValid
()
const
54
{
55
return
RawTowerv1::isValid
();
56
}
57
58
void
RawTowerv2::identify
(std::ostream& os)
const
59
{
60
os <<
"RawTowerv2: etabin: "
<<
get_bineta
() <<
", phibin: "
<<
get_binphi
()
61
<<
" energy="
<<
get_energy
() << std::endl;
62
63
for
(prop_map_t::const_iterator i =
prop_map
.begin(); i !=
prop_map
.end(); ++i)
64
{
65
PROPERTY
prop_id =
static_cast<
PROPERTY
>
(i->first);
66
const
string
property_info =
get_property_info
(prop_id);
67
cout <<
"\t"
<< prop_id <<
":\t"
<< property_info <<
" = \t"
<<
get_property
(prop_id) << endl;
68
}
69
}
70
71
bool
RawTowerv2::has_property
(
const
PROPERTY
prop_id)
const
72
{
73
prop_map_t::const_iterator i =
prop_map
.find(prop_id);
74
return
i !=
prop_map
.end();
75
}
76
77
double
78
RawTowerv2::get_property
(
const
PROPERTY
prop_id)
const
79
{
80
prop_map_t::const_iterator i =
prop_map
.find(prop_id);
81
82
if
(i !=
prop_map
.end())
return
i->second;
83
84
return
NAN;
85
}
86
87
void
RawTowerv2::set_property
(
const
PROPERTY
prop_id,
const
double
value
)
88
{
89
prop_map
[prop_id] =
value
;
90
}
coresoftware
blob
master
offline
packages
CaloBase
RawTowerv2.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:34
using
1.8.2 with
ECCE GitHub integration