Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
DataFormats
Provenance
src
Provenance.cc
Go to the documentation of this file.
1
#include "
DataFormats/Provenance/interface/Provenance.h
"
2
#include "
DataFormats/Provenance/interface/ProcessConfiguration.h
"
3
#include "
DataFormats/Provenance/interface/ProcessHistoryRegistry.h
"
4
#include "
DataFormats/Provenance/interface/ProductProvenance.h
"
5
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
6
#include "
FWCore/ParameterSet/interface/Registry.h
"
7
8
#include <algorithm>
9
#include <cassert>
10
11
/*----------------------------------------------------------------------
12
13
----------------------------------------------------------------------*/
14
15
namespace
edm {
16
17
Provenance::Provenance
() :
Provenance
{std::shared_ptr<BranchDescription const>(),
ProductID
()} {
18
}
19
20
Provenance::Provenance
(std::shared_ptr<BranchDescription const>
const
&
p
,
ProductID
const
&
pid
) :
21
branchDescription_(p),
22
productID_(pid),
23
processHistory_(),
24
productProvenanceValid_(
false
),
25
productProvenancePtr_(new
ProductProvenance
),
26
store_() {
27
}
28
29
ProductProvenance
*
30
Provenance::resolve
()
const
{
31
if
(!
store_
) {
32
return
nullptr
;
33
}
34
if
(!
productProvenanceValid_
) {
35
ProductProvenance
const
* prov =
store_
->branchIDToProvenance(
branchDescription_
->branchID());
36
if
(prov) {
37
*
productProvenancePtr_
= *prov;
38
productProvenanceValid_
=
true
;
39
}
40
}
41
return
productProvenancePtr_
.get();
42
}
43
44
bool
45
Provenance::getProcessConfiguration
(
ProcessConfiguration
& pc)
const
{
46
return
processHistory_
->
getConfigurationForProcess
(
processName
(), pc);
47
}
48
49
ReleaseVersion
50
Provenance::releaseVersion
()
const
{
51
ProcessConfiguration
pc;
52
assert
(
getProcessConfiguration
(pc));
53
return
pc.
releaseVersion
();
54
}
55
56
void
57
Provenance::write
(std::ostream& os)
const
{
58
// This is grossly inadequate, but it is not critical for the
59
// first pass.
60
product
().
write
(os);
61
ProductProvenance
*
pp
=
productProvenance
();
62
if
(pp !=
nullptr
) {
63
pp->
write
(os);
64
}
65
}
66
67
bool
operator==
(
Provenance
const
&
a
,
Provenance
const
&
b
) {
68
return
a.
product
() == b.
product
();
69
}
70
71
void
72
Provenance::resetProductProvenance
()
const
{
73
*
productProvenancePtr_
=
ProductProvenance
();
74
productProvenanceValid_
=
false
;
75
}
76
77
void
78
Provenance::setProductProvenance
(
ProductProvenance
const
& prov)
const
{
79
*
productProvenancePtr_
= prov;
80
productProvenanceValid_
=
true
;
81
}
82
83
void
84
Provenance::swap
(
Provenance
& iOther) {
85
branchDescription_
.swap(iOther.
branchDescription_
);
86
productID_
.
swap
(iOther.
productID_
);
87
std::swap
(
processHistory_
, iOther.
processHistory_
);
88
std::swap
(
productProvenanceValid_
, iOther.
productProvenanceValid_
);
89
productProvenancePtr_
.swap(iOther.
productProvenancePtr_
);
90
store_
.swap(iOther.
store_
);
91
}
92
}
edm::Provenance::store_
std::shared_ptr< ProductProvenanceRetriever > store_
Definition:
Provenance.h:100
Registry.h
createTree.pp
tuple pp
Definition:
createTree.py:15
edm::Provenance::releaseVersion
ReleaseVersion releaseVersion() const
Definition:
Provenance.cc:50
assert
assert(m_qm.get())
edm::Provenance::productProvenance
ProductProvenance * productProvenance() const
Definition:
Provenance.h:49
edm::Provenance::getProcessConfiguration
bool getProcessConfiguration(ProcessConfiguration &pc) const
Definition:
Provenance.cc:45
edm::Provenance::productID_
ProductID productID_
Definition:
Provenance.h:96
edm::Provenance::processName
std::string const & processName() const
Definition:
Provenance.h:61
edm::Provenance::branchDescription_
std::shared_ptr< BranchDescription const > branchDescription_
Definition:
Provenance.h:95
edm::ProductID::swap
void swap(ProductID &other)
Definition:
ProductID.cc:17
edm::Provenance::resetProductProvenance
void resetProductProvenance() const
Definition:
Provenance.cc:72
edm::Provenance::write
void write(std::ostream &os) const
Definition:
Provenance.cc:57
edm::BranchDescription::write
void write(std::ostream &os) const
Definition:
BranchDescription.cc:225
ProductProvenance.h
ParameterSet.h
edm::ProcessHistory::getConfigurationForProcess
bool getConfigurationForProcess(std::string const &name, ProcessConfiguration &config) const
Definition:
ProcessHistory.cc:39
edm::ProductProvenance::write
void write(std::ostream &os) const
Definition:
ProductProvenance.cc:77
edm::Provenance::resolve
ProductProvenance * resolve() const
Definition:
Provenance.cc:30
edm::ProductID
Definition:
ProductID.h:27
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition:
DataFrameContainer.h:234
edm::operator==
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &)
Definition:
debugging_allocator.h:72
edm::Provenance::Provenance
Provenance()
Definition:
Provenance.cc:17
edm::Provenance::product
BranchDescription const & product() const
Definition:
Provenance.h:42
edm::Provenance
Definition:
Provenance.h:35
edm::Provenance::productProvenanceValid_
bool productProvenanceValid_
Definition:
Provenance.h:98
ProcessConfiguration.h
edm::ProcessConfiguration::releaseVersion
ReleaseVersion const & releaseVersion() const
Definition:
ProcessConfiguration.h:29
edm::Provenance::processHistory_
ProcessHistory const * processHistory_
Definition:
Provenance.h:97
sysUtil.pid
tuple pid
Definition:
sysUtil.py:22
b
double b
Definition:
hdecay.h:120
edm::ReleaseVersion
std::string ReleaseVersion
Definition:
ReleaseVersion.h:7
edm::Provenance::productProvenancePtr_
std::shared_ptr< ProductProvenance > productProvenancePtr_
Definition:
Provenance.h:99
AlCaHLTBitMon_ParallelJobs.p
tuple p
Definition:
AlCaHLTBitMon_ParallelJobs.py:152
a
double a
Definition:
hdecay.h:121
edm::ProductProvenance
Definition:
ProductProvenance.h:24
edm::Provenance::setProductProvenance
void setProductProvenance(ProductProvenance const &prov) const
Definition:
Provenance.cc:78
Provenance.h
ProcessHistoryRegistry.h
edm::false
volatile std::atomic< bool > shutdown_flag false
Definition:
UnixSignalHandlers.cc:22
edm::ProcessConfiguration
Definition:
ProcessConfiguration.h:14
edm::Provenance::swap
void swap(Provenance &)
Definition:
Provenance.cc:84
Generated for CMSSW Reference Manual by
1.8.5