DataFormats
Provenance
src
ProductProvenance.cc
Go to the documentation of this file.
1
#include "
DataFormats/Provenance/interface/ProductProvenance.h
"
2
#include "
DataFormats/Provenance/interface/ParentageRegistry.h
"
3
4
#include <cassert>
5
#include <ostream>
6
7
/*----------------------------------------------------------------------
8
9
----------------------------------------------------------------------*/
10
11
namespace
{
12
edm::Parentage
const
s_emptyParentage;
13
}
14
namespace
edm
{
15
ProductProvenance::ProductProvenance
() : branchID_(), parentageID_() {}
16
17
ProductProvenance::ProductProvenance
(
BranchID
bid) : branchID_(
std
::
move
(bid)), parentageID_() {}
18
19
ProductProvenance::ProductProvenance
(
BranchID
bid,
ParentageID
edid)
20
: branchID_(
std
::
move
(bid)), parentageID_(
std
::
move
(edid)) {}
21
22
ProductProvenance::ProductProvenance
(
BranchID
bid, std::vector<BranchID>
const
&
parents
)
23
: branchID_(
std
::
move
(bid)), parentageID_() {
24
Parentage
p
;
25
p
.setParents(
parents
);
26
parentageID_
=
p
.id();
27
ParentageRegistry::instance
()->
insertMapped
(
p
);
28
}
29
30
ProductProvenance::ProductProvenance
(
BranchID
bid, std::vector<BranchID>&&
parents
)
31
: branchID_(
std
::
move
(bid)), parentageID_() {
32
Parentage
p
;
33
p
.setParents(
std::move
(
parents
));
34
parentageID_
=
p
.id();
35
ParentageRegistry::instance
()->
insertMapped
(
std::move
(
p
));
36
}
37
38
ProductProvenance
ProductProvenance::makeProductProvenance
()
const
{
return
*
this
; }
39
40
Parentage
const
&
ProductProvenance::parentage
()
const
{
41
auto
p
=
ParentageRegistry::instance
()->
getMapped
(
parentageID_
);
42
if
(
p
) {
43
return
*
p
;
44
}
45
return
s_emptyParentage;
46
}
47
48
void
ProductProvenance::write
(std::ostream& os)
const
{
49
os <<
"branch ID = "
<<
branchID
() <<
'\n'
;
50
os <<
"entry description ID = "
<<
parentageID
() <<
'\n'
;
51
}
52
53
bool
operator==
(
ProductProvenance
const
&
a
,
ProductProvenance
const
&
b
) {
54
return
a
.branchID() ==
b
.branchID() &&
a
.parentageID() ==
b
.parentageID();
55
}
56
}
// namespace edm
edm::ProductProvenance::write
void write(std::ostream &os) const
Definition:
ProductProvenance.cc:48
edm
HLT enums.
Definition:
AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition:
AlCaHLTBitMon_ParallelJobs.py:153
edm::ParentageRegistry::instance
static ParentageRegistry * instance()
Definition:
ParentageRegistry.cc:4
edm::ProductProvenance::parentageID_
ParentageID parentageID_
Definition:
ProductProvenance.h:47
ParentageRegistry.h
edm::ProductProvenance
Definition:
ProductProvenance.h:24
edm::ProductProvenance::makeProductProvenance
ProductProvenance makeProductProvenance() const
Definition:
ProductProvenance.cc:38
edm::operator==
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &) noexcept
Definition:
debugging_allocator.h:72
ProductProvenance.h
edm::BranchID
Definition:
BranchID.h:14
edm::ProductProvenance::branchID
BranchID const & branchID() const
Definition:
ProductProvenance.h:38
edm::Hash< ParentageType >
b
double b
Definition:
hdecay.h:118
edm::ProductProvenance::ProductProvenance
ProductProvenance()
Definition:
ProductProvenance.cc:15
edm::Parentage
Definition:
Parentage.h:25
a
double a
Definition:
hdecay.h:119
edm::ParentageRegistry::getMapped
bool getMapped(key_type const &k, value_type &result) const
Definition:
ParentageRegistry.cc:9
edm::ProductProvenance::parentageID
ParentageID const & parentageID() const
Definition:
ProductProvenance.h:39
edm::ParentageRegistry::insertMapped
bool insertMapped(value_type const &v)
Definition:
ParentageRegistry.cc:24
eostools.move
def move(src, dest)
Definition:
eostools.py:511
std
Definition:
JetResolutionObject.h:76
edm::ProductProvenance::parentage
Parentage const & parentage() const
Definition:
ProductProvenance.cc:40
parents
TPRegexp parents
Definition:
eve_filter.cc:21
Generated for CMSSW Reference Manual by
1.8.16