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