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
GlobalVertexMapv1.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file GlobalVertexMapv1.cc
1
#include "
GlobalVertexMapv1.h
"
2
3
#include "
GlobalVertex.h
"
4
#include "
GlobalVertexMap.h
"
5
6
#include <iterator>
// for reverse_iterator
7
#include <utility>
// for pair, make_pair
8
9
using namespace
std;
10
11
GlobalVertexMapv1::GlobalVertexMapv1
()
12
: _map()
13
{
14
}
15
16
GlobalVertexMapv1::~GlobalVertexMapv1
()
17
{
18
clear
();
19
}
20
21
void
GlobalVertexMapv1::identify
(ostream& os)
const
22
{
23
os <<
"GlobalVertexMapv1: size = "
<<
_map
.size() << endl;
24
return
;
25
}
26
27
void
GlobalVertexMapv1::clear
()
28
{
29
for
(
Iter
iter =
_map
.begin();
30
iter !=
_map
.end();
31
++iter)
32
{
33
delete
iter->second;
34
}
35
_map
.clear();
36
return
;
37
}
38
39
const
GlobalVertex
*
GlobalVertexMapv1::get
(
unsigned
int
id
)
const
40
{
41
ConstIter
iter =
_map
.find(
id
);
42
if
(iter ==
_map
.end())
return
nullptr
;
43
return
iter->second;
44
}
45
46
GlobalVertex
*
GlobalVertexMapv1::get
(
unsigned
int
id
)
47
{
48
Iter
iter =
_map
.find(
id
);
49
if
(iter ==
_map
.end())
return
nullptr
;
50
return
iter->second;
51
}
52
53
GlobalVertex
*
GlobalVertexMapv1::insert
(
GlobalVertex
* clus)
54
{
55
unsigned
int
index = 0;
56
if
(!
_map
.empty()) index =
_map
.rbegin()->first + 1;
57
_map
.insert(make_pair(index, clus));
58
_map
[index]->set_id(index);
59
return
_map
[index];
60
}
coresoftware
blob
master
simulation
g4simulation
g4vertex
GlobalVertexMapv1.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:45
using
1.8.2 with
ECCE GitHub integration