CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ProcessHistory.cc
Go to the documentation of this file.
1 #include <iterator>
2 #include <ostream>
3 #include <sstream>
6 
8 
9 
10 namespace edm {
13  if(phid().isValid()) {
14  return phid();
15  }
16  // This implementation is ripe for optimization.
17  // We do not use operator<< because it does not write out everything.
18  std::ostringstream oss;
19  for (const_iterator i = begin(), e = end(); i != e; ++i) {
20  oss << i->processName() << ' '
21  << i->parameterSetID() << ' '
22  << i->releaseVersion() << ' '
23  << i->passID() << ' ';
24  }
25  std::string stringrep = oss.str();
26  cms::Digest md5alg(stringrep);
27  ProcessHistoryID tmp(md5alg.digest().toString());
28  phid().swap(tmp);
29  return phid();
30  }
31 
32  bool
35  for (const_iterator i = begin(), e = end(); i != e; ++i) {
36  if (i->processName() == name) {
37  config = *i;
38  return true;
39  }
40  }
41  // Name not found!
42  return false;
43  }
44 
45  void
47  phid() = ProcessHistoryID();
48  for (iterator i = data_.begin(), e = data_.end(); i != e; ++i) {
49  i->reduce();
50  }
51  }
52 
53  bool
55  if (a.size() >= b.size()) return false;
56  typedef ProcessHistory::collection_type::const_iterator const_iterator;
57  for (const_iterator itA = a.data().begin(), itB = b.data().begin(),
58  itAEnd = a.data().end(); itA != itAEnd; ++itA, ++itB) {
59  if (*itA != *itB) return false;
60  }
61  return true;
62  }
63 
64  std::ostream&
65  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 }
collection_type::const_iterator const_iterator
const_iterator begin() const
int i
Definition: DBlmapReader.cc:9
size_type size() const
collection_type const & data() const
void swap(Hash< I > &other)
Definition: Hash.h:202
ProcessHistoryID & phid() const
MD5Result digest() const
Definition: Digest.cc:194
bool getConfigurationForProcess(std::string const &name, ProcessConfiguration &config) const
bool isAncestor(ProcessHistory const &a, ProcessHistory const &b)
Hash< ProcessHistoryType > ProcessHistoryID
collection_type::iterator iterator
std::string toString() const
Definition: Digest.cc:87
double b
Definition: hdecay.h:120
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
const_iterator end() const
Func copy_all(ForwardSequence &s, Func f)
wrappers for copy
Definition: Algorithms.h:24
double a
Definition: hdecay.h:121
collection_type data_
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
ProcessHistoryID id() const