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
MbdVertexMapv1.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file MbdVertexMapv1.cc
1
#include "
MbdVertexMapv1.h
"
2
3
#include "
MbdVertex.h
"
4
#include "
MbdVertexMap.h
"
5
6
#include <iterator>
// for reverse_iterator
7
#include <utility>
// for pair, make_pair
8
9
using namespace
std;
10
11
MbdVertexMapv1::MbdVertexMapv1
()
12
: _map()
13
{
14
}
15
16
MbdVertexMapv1::~MbdVertexMapv1
()
17
{
18
MbdVertexMapv1::clear
();
19
}
20
21
void
MbdVertexMapv1::identify
(ostream&
os
)
const
22
{
23
os <<
"MbdVertexMapv1: size = "
<<
_map
.size() << endl;
24
return
;
25
}
26
27
void
MbdVertexMapv1::clear
()
28
{
29
for
(
auto
& iter :
_map
)
30
{
31
delete
iter.second;
32
}
33
_map.clear();
34
return
;
35
}
36
37
const
MbdVertex
*
MbdVertexMapv1::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
MbdVertex
*
MbdVertexMapv1::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
MbdVertex
*
MbdVertexMapv1::insert
(
MbdVertex
* 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
globalvertex
MbdVertexMapv1.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:06
using
1.8.2 with
sPHENIX GitHub integration