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
SvtxAlignmentStateMap_v1.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file SvtxAlignmentStateMap_v1.cc
1
#include "
SvtxAlignmentStateMap_v1.h
"
2
3
#include "
SvtxAlignmentState.h
"
4
5
#include <
phool/PHObject.h
>
6
7
SvtxAlignmentStateMap_v1::SvtxAlignmentStateMap_v1
()
8
: m_map()
9
{
10
}
11
12
SvtxAlignmentStateMap_v1::~SvtxAlignmentStateMap_v1
()
13
{
14
Reset
();
15
}
16
17
void
SvtxAlignmentStateMap_v1::Reset
()
18
{
19
for
(
auto
[key, statevec] :
m_map
)
20
{
21
for
(
auto
state
: statevec)
22
{
23
delete
state
;
24
}
25
statevec.clear();
26
}
27
28
m_map.clear();
29
}
30
31
std::size_t
SvtxAlignmentStateMap_v1::erase
(
unsigned
int
track)
32
{
33
auto
iter =
m_map
.find(track);
34
if
(iter !=
m_map
.end())
35
{
36
auto
statevec = iter->second;
37
for
(
auto
state
: statevec)
38
{
39
delete
state
;
40
}
41
}
42
43
return
m_map
.erase(track);
44
}
45
46
void
SvtxAlignmentStateMap_v1::identify
(std::ostream&
os
)
const
47
{
48
os <<
"SvtxAlignmentStateMap_v1: size = "
<<
m_map
.size() << std::endl;
49
}
50
51
const
SvtxAlignmentStateMap::StateVec
SvtxAlignmentStateMap_v1::get
(
unsigned
int
track)
const
52
{
53
auto
iter =
m_map
.find(track);
54
if
(iter ==
m_map
.end())
55
{
56
return
SvtxAlignmentStateMap::StateVec
();
57
}
58
59
return
iter->second;
60
}
61
62
SvtxAlignmentStateMap::StateVec
SvtxAlignmentStateMap_v1::get
(
unsigned
int
track)
63
{
64
auto
iter =
m_map
.find(track);
65
if
(iter ==
m_map
.end())
66
{
67
return
SvtxAlignmentStateMap::StateVec
();
68
}
69
70
return
iter->second;
71
}
72
73
SvtxAlignmentStateMap::StateVec
SvtxAlignmentStateMap_v1::insertWithKey
(
unsigned
int
track,
SvtxAlignmentStateMap::StateVec
states)
74
{
75
const
auto
result =
m_map
.insert(std::make_pair(track, states));
76
77
if
(!result.second)
78
{
79
std::cout <<
"SvtxAlignmentStateMap_v1::insertWithKey - duplicated key "
<< track <<
", state not entered. "
<< std::endl;
80
81
return
SvtxAlignmentStateMap::StateVec
();
82
}
83
else
84
{
85
return
states;
86
}
87
}
coresoftware
blob
master
offline
packages
trackbase_historic
SvtxAlignmentStateMap_v1.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:09
using
1.8.2 with
sPHENIX GitHub integration