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
TrkrClusterContainerv1.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file TrkrClusterContainerv1.cc
1
7
#include "
TrkrClusterContainerv1.h
"
8
#include "
TrkrCluster.h
"
9
10
#include <cstdlib>
11
12
void
TrkrClusterContainerv1::Reset
()
13
{
14
while
(
m_clusmap
.begin() !=
m_clusmap
.end())
15
{
16
delete
m_clusmap
.begin()->second;
17
m_clusmap
.erase(
m_clusmap
.begin());
18
}
19
return
;
20
}
21
22
void
TrkrClusterContainerv1::identify
(std::ostream&
os
)
const
23
{
24
os <<
"-----TrkrClusterContainerv1-----"
<< std::endl;
25
ConstIterator
iter;
26
os <<
"Number of clusters: "
<<
size
() << std::endl;
27
for
(iter =
m_clusmap
.begin(); iter !=
m_clusmap
.end(); ++iter)
28
{
29
int
layer
=
TrkrDefs::getLayer
(iter->first);
30
os <<
"clus key "
<< iter->first <<
" layer "
<< layer << std::endl;
31
(iter->second)->
identify
();
32
}
33
os <<
"------------------------------"
<< std::endl;
34
return
;
35
}
36
37
void
TrkrClusterContainerv1::addClusterSpecifyKey
(
const
TrkrDefs::cluskey
key,
TrkrCluster
* newclus)
38
{
39
const
auto
[iter, success] =
m_clusmap
.insert(std::make_pair(key, newclus));
40
if
(!success)
41
{
42
std::cout <<
"TrkrClusterContainerv1::AddClusterSpecifyKey: duplicate key: "
<< key <<
" exiting now"
<< std::endl;
43
exit(1);
44
}
45
}
46
47
void
TrkrClusterContainerv1::removeCluster
(
TrkrDefs::cluskey
key)
48
{
49
m_clusmap
.erase(key);
50
}
51
52
TrkrClusterContainer::ConstRange
53
TrkrClusterContainerv1::getClusters
()
const
54
{
55
return
std::make_pair(
m_clusmap
.cbegin(),
m_clusmap
.cend());
56
}
57
58
TrkrCluster
*
59
TrkrClusterContainerv1::findCluster
(
TrkrDefs::cluskey
key)
const
60
{
61
auto
it
=
m_clusmap
.find(key);
62
return
it
==
m_clusmap
.end() ?
nullptr
:
it
->second;
63
}
64
65
unsigned
int
TrkrClusterContainerv1::size
()
const
66
{
67
return
m_clusmap
.size();
68
}
coresoftware
blob
master
offline
packages
trackbase
TrkrClusterContainerv1.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:09
using
1.8.2 with
sPHENIX GitHub integration