Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
PHG4TpcCylinderGeomContainer.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHG4TpcCylinderGeomContainer.cc
1
#include "
PHG4TpcCylinderGeomContainer.h
"
2
3
#include "
PHG4TpcCylinderGeom.h
"
4
5
PHG4TpcCylinderGeomContainer::~PHG4TpcCylinderGeomContainer
()
6
{
7
while
(
layergeoms
.begin() !=
layergeoms
.end())
8
{
9
delete
layergeoms
.begin()->second;
10
layergeoms
.erase(
layergeoms
.begin());
11
}
12
return
;
13
}
14
15
void
PHG4TpcCylinderGeomContainer::identify
(std::ostream &
os
)
const
16
{
17
std::map<int, PHG4TpcCylinderGeom *>::const_iterator iter;
18
for
(iter =
layergeoms
.begin(); iter !=
layergeoms
.end(); ++iter)
19
{
20
std::cout <<
"layer "
<< iter->first << std::endl;
21
(iter->second)->
identify
(os);
22
}
23
return
;
24
}
25
26
int
PHG4TpcCylinderGeomContainer::AddLayerCellGeom
(
const
int
i
,
PHG4TpcCylinderGeom
*mygeom)
27
{
28
if
(
layergeoms
.find(i) !=
layergeoms
.end())
29
{
30
std::cout <<
"layer "
<< i <<
" already added to PHCylinderCellGeomContainer"
<< std::endl;
31
return
-1;
32
}
33
mygeom->
set_layer
(i);
34
layergeoms
[
i
] = mygeom;
35
return
0;
36
}
37
38
int
PHG4TpcCylinderGeomContainer::AddLayerCellGeom
(
PHG4TpcCylinderGeom
*mygeom)
39
{
40
int
layer
= mygeom->
get_layer
();
41
if
(
layergeoms
.find(layer) !=
layergeoms
.end())
42
{
43
std::cout <<
"layer "
<< layer <<
" already added to PHCylinderCellGeomContainer"
<< std::endl;
44
return
-1;
45
}
46
layergeoms
[
layer
] = mygeom;
47
return
0;
48
}
49
50
PHG4TpcCylinderGeom
*
51
PHG4TpcCylinderGeomContainer::GetLayerCellGeom
(
const
int
i
)
52
{
53
std::map<int, PHG4TpcCylinderGeom *>::const_iterator iter =
layergeoms
.find(i);
54
if
(iter !=
layergeoms
.end())
55
{
56
return
iter->second;
57
}
58
std::cout <<
"Could not locate layer "
<< i <<
" in PHG4TpcCylinderGeomContainer"
<< std::endl;
59
return
nullptr
;
60
}
61
62
PHG4TpcCylinderGeom
*
63
PHG4TpcCylinderGeomContainer::GetFirstLayerCellGeom
()
64
{
65
if
(
layergeoms
.empty())
66
{
67
return
nullptr
;
68
}
69
return
layergeoms
.begin()->second;
70
}
coresoftware
blob
master
simulation
g4simulation
g4detectors
PHG4TpcCylinderGeomContainer.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:13
using
1.8.2 with
sPHENIX GitHub integration