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