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