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