CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ProductProvenance.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_ProductProvenance_h
2 #define DataFormats_Provenance_ProductProvenance_h
3 
4 /*----------------------------------------------------------------------
5 
6 ProductProvenance: The event dependent portion of the description of a product
7 and how it came into existence.
8 
9 ----------------------------------------------------------------------*/
14 
15 #include <memory>
16 
17 #include <iosfwd>
18 #include <vector>
19 
20 /*
21  ProductProvenance
22 */
23 
24 namespace edm {
26  public:
28  explicit ProductProvenance(BranchID const& bid);
29  ProductProvenance(BranchID const& bid,
30  std::shared_ptr<Parentage> parentagePtr);
31  ProductProvenance(BranchID const& bid,
32  ParentageID const& id);
33 
34  ProductProvenance(BranchID const& bid,
35  std::vector<BranchID> const& parents);
36 
38 
40 
41  void write(std::ostream& os) const;
42 
43  BranchID const& branchID() const {return branchID_;}
44  ParentageID const& parentageID() const {return parentageID_;}
45  Parentage const& parentage() const;
46 
47  bool& noParentage() const {return transient_.noParentage_;}
48 
50 
51  struct Transients {
52  Transients();
53  void reset();
54  std::shared_ptr<Parentage> parentagePtr_;
56  };
57 
58  private:
59 
60  std::shared_ptr<Parentage>& parentagePtr() const {return transient_.parentagePtr_;}
61 
65  };
66 
67  inline
68  bool
70  return a.branchID() < b.branchID();
71  }
72 
73  inline
74  std::ostream&
75  operator<<(std::ostream& os, ProductProvenance const& p) {
76  p.write(os);
77  return os;
78  }
79 
80  // Only the 'salient attributes' are testing in equality comparison.
81  bool operator==(ProductProvenance const& a, ProductProvenance const& b);
82  inline bool operator!=(ProductProvenance const& a, ProductProvenance const& b) { return !(a == b); }
83  typedef std::vector<ProductProvenance> ProductProvenanceVector;
84 }
85 #endif
bool operator<(DetSet< T > const &x, DetSet< T > const &y)
Definition: DetSet.h:90
BranchID const & branchID() const
TPRegexp parents
Definition: eve_filter.cc:24
void initializeTransients() const
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &)
void write(std::ostream &os) const
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &)
std::vector< ProductProvenance > ProductProvenanceVector
std::shared_ptr< Parentage > parentagePtr_
ProductProvenance makeProductProvenance() const
bool & noParentage() const
double b
Definition: hdecay.h:120
ParentageID const & parentageID() const
double a
Definition: hdecay.h:121
std::shared_ptr< Parentage > & parentagePtr() const
Parentage const & parentage() const
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.