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
sPHElectronPairContainerv1.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file sPHElectronPairContainerv1.cc
1
#include "
sPHElectronPairContainerv1.h
"
2
#include "
sPHElectronPairv1.h
"
3
4
#include <iterator>
// for reverse_iterator
5
#include <map>
// for _Rb_tree_const_iterator, _Rb_tree_iterator
6
#include <ostream>
// for operator<<, endl, ostream, basic_ostream, bas...
7
#include <utility>
// for pair, make_pair
8
9
using namespace
std;
10
11
sPHElectronPairContainerv1::sPHElectronPairContainerv1
()
12
: _map()
13
{
14
}
15
16
sPHElectronPairContainerv1::sPHElectronPairContainerv1
(
const
sPHElectronPairContainerv1
&
container
)
17
: _map()
18
{
19
for
(
ConstIter
iter = container.
begin
();
20
iter != container.
end
();
21
++iter)
22
{
23
sPHElectronPairv1
* epair =
dynamic_cast<
sPHElectronPairv1
*
>
(iter->second->CloneMe());
24
_map
.insert(make_pair(epair->
get_id
(), epair));
25
}
26
}
27
28
sPHElectronPairContainerv1
&
sPHElectronPairContainerv1::operator=
(
const
sPHElectronPairContainerv1
&
container
)
29
{
30
Reset
();
31
for
(
ConstIter
iter = container.
begin
();
32
iter != container.
end
();
33
++iter)
34
{
35
sPHElectronPairv1
* epair =
dynamic_cast<
sPHElectronPairv1
*
>
(iter->second->CloneMe());
36
_map
.insert(make_pair(epair->
get_id
(), epair));
37
}
38
return
*
this
;
39
}
40
41
sPHElectronPairContainerv1::~sPHElectronPairContainerv1
()
42
{
43
Reset
();
44
}
45
46
void
sPHElectronPairContainerv1::Reset
()
47
{
48
for
(
Iter
iter =
_map
.begin();
49
iter !=
_map
.end();
50
++iter)
51
{
52
sPHElectronPairv1
* epair = iter->second;
53
delete
epair;
54
}
55
_map
.clear();
56
}
57
58
void
sPHElectronPairContainerv1::identify
(ostream&
os
)
const
59
{
60
os <<
"sPHElectronPairContainerv1: size = "
<<
_map
.size() << endl;
61
return
;
62
}
63
64
const
sPHElectronPairv1
*
sPHElectronPairContainerv1::get
(
unsigned
int
id
)
const
65
{
66
ConstIter
iter =
_map
.find(
id
);
67
if
(iter ==
_map
.end())
return
nullptr
;
68
return
iter->second;
69
}
70
71
sPHElectronPairv1
*
sPHElectronPairContainerv1::get
(
unsigned
int
id
)
72
{
73
Iter
iter =
_map
.find(
id
);
74
if
(iter ==
_map
.end())
return
nullptr
;
75
return
iter->second;
76
}
77
78
void
sPHElectronPairContainerv1::insert
(
const
sPHElectronPairv1
* epair)
79
{
80
unsigned
int
index
= 0;
81
if
(!
_map
.empty()) index =
_map
.rbegin()->first + 1;
82
_map
.insert(make_pair(index, dynamic_cast<sPHElectronPairv1*> (epair->
CloneMe
())));
83
_map
[
index
]->set_id(index);
84
}
85
analysis
blob
master
EventMix
src
sPHElectronPairContainerv1.cc
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:17:51
using
1.8.2 with
sPHENIX GitHub integration