EIC Software
Reference for
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
RawTowerZDCGeomContainer.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file RawTowerZDCGeomContainer.cc
1
#include "
RawTowerZDCGeomContainer.h
"
2
#include "
RawTowerZDCGeom.h
"
3
4
#include <iostream>
5
#include <cassert>
6
#include <cstdlib>
7
8
using namespace
std;
9
10
RawTowerZDCGeomContainer::RawTowerZDCGeomContainer
(
RawTowerZDCDefs::CalorimeterId
caloid)
11
: _caloid(caloid)
12
{
13
}
14
15
RawTowerZDCGeomContainer::~RawTowerZDCGeomContainer
()
16
{
17
Reset
();
//make sure everything is deleted
18
}
19
20
void
RawTowerZDCGeomContainer::identify
(std::ostream& os)
const
21
{
22
os <<
"RawTowerZDCGeomContainer, number of tower geometries: "
<<
size
()
23
<< std::endl;
24
}
25
26
RawTowerZDCGeomContainer::ConstIterator
27
RawTowerZDCGeomContainer::add_tower_geometry
(
RawTowerZDCGeom
* geo)
28
{
29
assert(geo);
30
31
if
(
RawTowerZDCDefs::decode_caloid
(geo->
get_id
()) !=
get_calorimeter_id
())
32
{
33
cout <<
"RawTowerZDCGeomContainer::add_tower_geometry - Fatal Error - "
34
"attempting to add tower geometry with id = "
35
<< geo->
get_id
()
36
<<
" with CaloID = "
<<
RawTowerZDCDefs::decode_caloid
(geo->
get_id
())
37
<<
" to this container of CaloID = "
<<
get_calorimeter_id
() <<
"."
;
38
geo->
identify
(cout);
39
exit
(2);
40
}
41
42
Iterator
it
=
_geoms
.find(geo->
get_id
());
43
if
(it !=
_geoms
.end())
44
{
45
cout
46
<<
"RawTowerZDCGeomContainer::add_tower_geometry - WARNING - replace tower geometry for tower #"
47
<< geo->
get_id
() <<
". This Old tower will be deleted: "
;
48
it->second->identify(cout);
49
50
delete
it->second;
51
_geoms
.erase(it);
52
}
53
54
_geoms
[geo->
get_id
()] = geo;
55
return
_geoms
.find(geo->
get_id
());
56
}
57
58
RawTowerZDCGeomContainer::ConstRange
59
RawTowerZDCGeomContainer::get_tower_geometries
(
void
)
const
60
{
61
return
make_pair<ConstIterator, ConstIterator>(
_geoms
.begin(),
_geoms
.end());
62
}
63
64
RawTowerZDCGeomContainer::Range
65
RawTowerZDCGeomContainer::get_tower_geometries
(
void
)
66
{
67
return
make_pair<Iterator, Iterator>(
_geoms
.begin(),
_geoms
.end());
68
}
69
70
RawTowerZDCGeom
*
71
RawTowerZDCGeomContainer::get_tower_geometry
(
RawTowerZDCDefs::keytype
key)
72
{
73
Iterator
it
=
_geoms
.find(key);
74
if
(it !=
_geoms
.end())
75
{
76
return
it->second;
77
}
78
return
NULL;
79
}
80
81
int
RawTowerZDCGeomContainer::isValid
()
const
82
{
83
return
(!
_geoms
.empty());
84
}
85
86
void
RawTowerZDCGeomContainer::Reset
()
87
{
88
while
(
_geoms
.begin() !=
_geoms
.end())
89
{
90
delete
_geoms
.begin()->second;
91
_geoms
.erase(
_geoms
.begin());
92
}
93
}
fun4all_eicdetectors
blob
master
reconstruction
eiczdcbase
RawTowerZDCGeomContainer.cc
Built by
Jin Huang
. updated:
Mon Jan 22 2024 12:43:51
using
1.8.2 with
EIC GitHub integration