Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
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
ProcessHistory::id
()
const
{
11
if
(
transient_
.
phid_
.
isValid
()) {
12
return
transient_
.
phid_
;
13
}
14
// This implementation is ripe for optimization.
15
// We do not use operator<< because it does not write out everything.
16
std::ostringstream oss;
17
for
(
auto
const
&
item
: *
this
) {
18
oss <<
item
.processName() <<
' '
<<
item
.parameterSetID() <<
' '
<<
item
.releaseVersion() <<
' '
<<
item
.passID()
19
<<
' '
;
20
}
21
std::string
stringrep = oss.str();
22
cms::Digest
md5alg(stringrep);
23
ProcessHistoryID
phID(md5alg.
digest
().
toString
());
24
return
phID;
25
}
26
27
ProcessHistoryID
ProcessHistory::setProcessHistoryID
() {
28
if
(!
transient_
.
phid_
.
isValid
()) {
29
transient_
.
phid_
=
id
();
30
}
31
return
transient_
.
phid_
;
32
}
33
34
bool
ProcessHistory::getConfigurationForProcess
(
std::string
const
&
name
,
ProcessConfiguration
&
config
)
const
{
35
for
(
auto
const
&
item
: *
this
) {
36
if
(
item
.processName() ==
name
) {
37
config =
item
;
38
return
true
;
39
}
40
}
41
// Name not found!
42
return
false
;
43
}
44
45
ProcessHistory
&
ProcessHistory::reduce
() {
46
phid
() =
ProcessHistoryID
();
47
for
(
auto
&
item
:
data_
) {
48
item
.reduce();
49
}
50
return
*
this
;
51
}
52
53
bool
isAncestor
(
ProcessHistory
const
&
a
,
ProcessHistory
const
&
b
) {
54
if
(a.
size
() >= b.
size
())
55
return
false
;
56
typedef
ProcessHistory::collection_type::const_iterator const_iterator;
57
for
(const_iterator itA = a.
data
().begin(), itB = b.
data
().begin(), itAEnd = a.
data
().end(); itA != itAEnd;
58
++itA, ++itB) {
59
if
(*itA != *itB)
60
return
false
;
61
}
62
return
true
;
63
}
64
65
std::ostream&
operator<<
(std::ostream& ost,
ProcessHistory
const
& ph) {
66
ost <<
"Process History = "
;
67
copy_all
(ph, std::ostream_iterator<ProcessHistory::value_type>(ost,
";"
));
68
return
ost;
69
}
70
}
// namespace edm
edm::ProcessHistory::reduce
ProcessHistory & reduce()
Definition:
ProcessHistory.cc:45
edm::ProcessHistory::size
size_type size() const
Definition:
ProcessHistory.h:52
edm::Hash< ProcessHistoryType >
ProcessHistory.h
B2GTnPMonitor_cfi.item
tuple item
Definition:
B2GTnPMonitor_cfi.py:148
edm::ProcessHistory::data
collection_type const & data() const
Definition:
ProcessHistory.h:74
edm::ProcessHistory::setProcessHistoryID
ProcessHistoryID setProcessHistoryID()
Definition:
ProcessHistory.cc:27
edm::ProcessHistory::transient_
Transients transient_
Definition:
ProcessHistory.h:102
edm::ProcessHistory::Transients::phid_
ProcessHistoryID phid_
Definition:
ProcessHistory.h:96
mergeVDriftHistosByStation.name
string name
Definition:
mergeVDriftHistosByStation.py:78
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition:
AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ProcessHistory::getConfigurationForProcess
bool getConfigurationForProcess(std::string const &name, ProcessConfiguration &config) const
Definition:
ProcessHistory.cc:34
edm::isAncestor
bool isAncestor(ProcessHistory const &a, ProcessHistory const &b)
Definition:
ProcessHistory.cc:53
cms::Digest::digest
MD5Result digest()
Definition:
Digest.cc:171
Digest.h
edm::ProcessHistoryID
Hash< ProcessHistoryType > ProcessHistoryID
Definition:
ProcessHistoryID.h:8
Algorithms.h
cms::MD5Result::toString
std::string toString() const
Definition:
Digest.cc:95
cms::Digest
Definition:
Digest.h:46
b
double b
Definition:
hdecay.h:118
submitPVResolutionJobs.config
tuple config
parse the configuration file
Definition:
submitPVResolutionJobs.py:281
edm::Hash::isValid
bool isValid() const
Definition:
Hash.h:141
edm::copy_all
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
Definition:
Algorithms.h:20
a
double a
Definition:
hdecay.h:119
edm::ProcessHistory
Definition:
ProcessHistory.h:13
edm::ProcessHistory::phid
ProcessHistoryID & phid()
Definition:
ProcessHistory.h:100
edm::ProcessHistory::data_
collection_type data_
Definition:
ProcessHistory.h:101
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:106
edm::ProcessHistory::id
ProcessHistoryID id() const
Definition:
ProcessHistory.cc:10
Generated for CMSSW Reference Manual by
1.8.5