CMS 3D CMS Logo

ProcessHistory.cc
Go to the documentation of this file.
1 #include <iterator>
2 #include <ostream>
3 #include <sstream>
6 
8 
9 namespace edm {
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);
24  return phID;
25  }
26 
28  if (!transient_.phid_.isValid()) {
29  transient_.phid_ = id();
30  }
31  return transient_.phid_;
32  }
33 
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 
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
ProcessHistory & reduce()
ProcessHistoryID id() const
ProcessHistoryID setProcessHistoryID()
Definition: config.py:1
bool isValid() const
Definition: Hash.h:141
bool getConfigurationForProcess(std::string const &name, ProcessConfiguration &config) const
bool isAncestor(ProcessHistory const &a, ProcessHistory const &b)
MD5Result digest()
Definition: Digest.cc:171
Hash< ProcessHistoryType > ProcessHistoryID
double b
Definition: hdecay.h:120
HLT enums.
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
Definition: Algorithms.h:20
double a
Definition: hdecay.h:121
ProcessHistoryID & phid()
collection_type data_
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger table.
std::string toString() const
Definition: Digest.cc:95