ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
DecayFinderContainer_v1.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file DecayFinderContainer_v1.cc
1
/*****************/
2
/* Cameron Dean */
3
/* LANL 2021 */
4
/* cdean@bnl.gov */
5
/*****************/
6
7
#include "
DecayFinderContainer_v1.h
"
8
9
#include <map>
// for _Rb_tree_const_iterator, _Rb_tree_iterator
10
#include <ostream>
// for operator<<, endl, ostream, basic_ostream, bas...
11
#include <utility>
// for pair, make_pair
12
#include <vector>
// for vector
13
14
DecayFinderContainer_v1::DecayFinderContainer_v1
()
15
: m_decaymap()
16
{
17
}
18
19
DecayFinderContainer_v1::DecayFinderContainer_v1
(
const
DecayFinderContainer_v1
& decaymap)
20
: m_decaymap()
21
{
22
for
(
ConstIter
iter = decaymap.
begin
(); iter != decaymap.
end
(); ++iter)
23
{
24
Decay
decay
= iter->second;
25
m_decaymap
.insert(std::make_pair(iter->first, decay));
26
}
27
}
28
29
DecayFinderContainer_v1
&
DecayFinderContainer_v1::operator=
(
const
DecayFinderContainer_v1
& decaymap)
30
{
31
Reset
();
32
for
(
ConstIter
iter = decaymap.
begin
(); iter != decaymap.
end
(); ++iter)
33
{
34
Decay
decay
= iter->second;
35
m_decaymap
.insert(std::make_pair(iter->first, decay));
36
}
37
return
*
this
;
38
}
39
40
DecayFinderContainer_v1::~DecayFinderContainer_v1
()
41
{
42
Reset
();
43
}
44
45
void
DecayFinderContainer_v1::Reset
()
46
{
47
m_decaymap
.clear();
48
}
49
50
void
DecayFinderContainer_v1::identify
(std::ostream& os)
const
51
{
52
os <<
"DecayFinderContainer_v1: size = "
<<
m_decaymap
.size() << std::endl;
53
return
;
54
}
55
56
const
DecayFinderContainerBase::Decay
DecayFinderContainer_v1::get
(
unsigned
int
id
)
const
57
{
58
Decay
dummyDecay = {{0, 0}};
59
ConstIter
iter =
m_decaymap
.find(
id
);
60
if
(iter ==
m_decaymap
.end())
return
dummyDecay;
61
return
iter->second;
62
}
63
64
DecayFinderContainerBase::Decay
DecayFinderContainer_v1::get
(
unsigned
int
id
)
65
{
66
Decay
dummyDecay = {{0, 0}};
67
Iter
iter =
m_decaymap
.find(
id
);
68
if
(iter ==
m_decaymap
.end())
return
dummyDecay;
69
return
iter->second;
70
}
71
72
DecayFinderContainerBase::Decay
DecayFinderContainer_v1::insert
(
const
Decay
decay
)
73
{
74
unsigned
int
index = 0;
75
if
(!
m_decaymap
.empty()) index =
m_decaymap
.rbegin()->first + 1;
76
m_decaymap
.insert(std::make_pair(index, decay));
77
return
m_decaymap
[index];
78
}
79
80
DecayFinderContainerBase::Map
DecayFinderContainer_v1::returnDecaysByPDGid
(
int
PDGid)
81
{
82
Map
requiredDecays;
83
84
for
(
Iter
iter =
m_decaymap
.begin(); iter !=
m_decaymap
.end(); ++iter)
85
for
(
auto
& [particleNumber, particleType] : iter->second)
86
if
(particleType == PDGid)
87
requiredDecays.insert(std::make_pair(iter->first, iter->second));
88
89
return
requiredDecays;
90
}
91
92
size_t
DecayFinderContainer_v1::erase
(
unsigned
int
key)
93
{
94
return
m_decaymap
.erase(key);
95
}
coresoftware
blob
master
generators
decayFinder
DecayFinderContainer_v1.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:24:29
using
1.8.2 with
ECCE GitHub integration