Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
DataFormats
Provenance
src
ProcessHistory.cc
Go to the documentation of this file.
1
#include <iterator>
2
#include <ostream>
3
#include <sstream>
4
#include "
FWCore/Utilities/interface/Digest.h
"
5
#include "
FWCore/Utilities/interface/Algorithms.h
"
6
7
#include "
DataFormats/Provenance/interface/ProcessHistory.h
"
8
9
namespace
edm {
10
ProcessHistoryID
11
ProcessHistory::id
()
const
{
12
if
(
transient_
.
phid_
.
isValid
()) {
13
return
transient_
.
phid_
;
14
}
15
// This implementation is ripe for optimization.
16
// We do not use operator<< because it does not write out everything.
17
std::ostringstream oss;
18
for
(
auto
const
& item : *
this
) {
19
oss << item.processName() <<
' '
20
<< item.parameterSetID() <<
' '
21
<< item.releaseVersion() <<
' '
22
<< item.passID() <<
' '
;
23
}
24
std::string
stringrep = oss.str();
25
cms::Digest
md5alg(stringrep);
26
ProcessHistoryID
phID(md5alg.
digest
().
toString
());
27
return
phID;
28
}
29
30
ProcessHistoryID
31
ProcessHistory::setProcessHistoryID
() {
32
if
(!
transient_
.
phid_
.
isValid
()) {
33
transient_
.
phid_
=
id
();
34
}
35
return
transient_
.
phid_
;
36
}
37
38
bool
39
ProcessHistory::getConfigurationForProcess
(
std::string
const
&
name
,
40
ProcessConfiguration
&
config
)
const
{
41
for
(
auto
const
& item : *
this
) {
42
if
(item.processName() ==
name
) {
43
config = item;
44
return
true
;
45
}
46
}
47
// Name not found!
48
return
false
;
49
}
50
51
ProcessHistory
&
52
ProcessHistory::reduce
() {
53
phid
() =
ProcessHistoryID
();
54
for
(
auto
& item :
data_
) {
55
item.reduce();
56
}
57
return
*
this
;
58
}
59
60
bool
61
isAncestor
(
ProcessHistory
const
&
a
,
ProcessHistory
const
&
b
) {
62
if
(a.
size
() >= b.
size
())
return
false
;
63
typedef
ProcessHistory::collection_type::const_iterator const_iterator;
64
for
(const_iterator itA = a.
data
().begin(), itB = b.
data
().begin(),
65
itAEnd = a.
data
().end(); itA != itAEnd; ++itA, ++itB) {
66
if
(*itA != *itB)
return
false
;
67
}
68
return
true
;
69
}
70
71
std::ostream&
72
operator<<
(std::ostream& ost,
ProcessHistory
const
& ph) {
73
ost <<
"Process History = "
;
74
copy_all
(ph, std::ostream_iterator<ProcessHistory::value_type>(ost,
";"
));
75
return
ost;
76
}
77
}
edm::ProcessHistory::reduce
ProcessHistory & reduce()
Definition:
ProcessHistory.cc:52
edm::ProcessHistory::size
size_type size() const
Definition:
ProcessHistory.h:42
edm::Hash< ProcessHistoryType >
ProcessHistory.h
edm::ProcessHistory::data
collection_type const & data() const
Definition:
ProcessHistory.h:64
edm::ProcessHistory::setProcessHistoryID
ProcessHistoryID setProcessHistoryID()
Definition:
ProcessHistory.cc:31
edm::ProcessHistory::transient_
Transients transient_
Definition:
ProcessHistory.h:92
cms::Digest::digest
MD5Result digest() const
Definition:
Digest.cc:194
edm::ProcessHistory::Transients::phid_
ProcessHistoryID phid_
Definition:
ProcessHistory.h:86
mergeVDriftHistosByStation.name
string name
Definition:
mergeVDriftHistosByStation.py:77
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:255
edm::ProcessHistory::getConfigurationForProcess
bool getConfigurationForProcess(std::string const &name, ProcessConfiguration &config) const
Definition:
ProcessHistory.cc:39
edm::isAncestor
bool isAncestor(ProcessHistory const &a, ProcessHistory const &b)
Definition:
ProcessHistory.cc:61
Digest.h
edm::ProcessHistoryID
Hash< ProcessHistoryType > ProcessHistoryID
Definition:
ProcessHistoryID.h:9
Algorithms.h
cms::MD5Result::toString
std::string toString() const
Definition:
Digest.cc:87
cms::Digest
Definition:
Digest.h:54
b
double b
Definition:
hdecay.h:120
HDQMDatabaseProducer.config
tuple config
Definition:
HDQMDatabaseProducer.py:18
edm::Hash::isValid
bool isValid() const
Definition:
Hash.h:150
edm::copy_all
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
Definition:
Algorithms.h:24
a
double a
Definition:
hdecay.h:121
edm::ProcessHistory
Definition:
ProcessHistory.h:13
edm::ProcessHistory::phid
ProcessHistoryID & phid()
Definition:
ProcessHistory.h:90
edm::ProcessHistory::data_
collection_type data_
Definition:
ProcessHistory.h:91
edm::ProcessConfiguration
Definition:
ProcessConfiguration.h:14
edm::operator<<
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
Definition:
HLTGlobalStatus.h:115
edm::ProcessHistory::id
ProcessHistoryID id() const
Definition:
ProcessHistory.cc:11
Generated for CMSSW Reference Manual by
1.8.5