LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
Parentage.cc
Go to the documentation of this file.
2 
3 #include <ostream>
4 #include <sstream>
5 
6 namespace art {
7 
8  Parentage::Parentage(std::vector<ProductID> const& parents)
9  : parents_{parents}
10  {}
11 
13  Parentage::id() const
14  {
15  // This implementation is ripe for optimization.
16  std::ostringstream oss;
17  for (auto const pid : parents_) {
18  oss << pid << ' ';
19  }
20 
21  std::string const stringrep{oss.str()};
22  return ParentageID{cet::MD5Digest{stringrep}.digest().toString()};
23  }
24 
25  bool
26  operator==(Parentage const& a, Parentage const& b)
27  {
28  return a.parents() == b.parents();
29  }
30 }
std::vector< ProductID > const & parents() const
Definition: Parentage.h:30
ParentageID id() const
Definition: Parentage.cc:13
std::vector< ProductID > parents_
Definition: Parentage.h:41
Parentage()=default
HLT enums.
bool operator==(Provenance const &a, Provenance const &b)
Definition: Provenance.h:168