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 ----------------------------------------------------------------------*/
13 
14 #include <memory>
15 
16 #include <iosfwd>
17 #include <vector>
18 
19 /*
20  ProductProvenance
21 */
22 
23 namespace edm {
25  public:
27  explicit ProductProvenance(BranchID const& bid);
28  ProductProvenance(BranchID const& bid,
29  std::shared_ptr<Parentage> parentagePtr);
30  ProductProvenance(BranchID const& bid,
31  ParentageID const& id);
32 
33  ProductProvenance(BranchID const& bid,
34  std::vector<BranchID> const& parents);
35 
37 
39 
40  void write(std::ostream& os) const;
41 
42  BranchID const& branchID() const {return branchID_;}
43  ParentageID const& parentageID() const {return parentageID_;}
44  Parentage const& parentage() const;
45 
46  bool& noParentage() const {return transient_.noParentage_;}
47 
49 
50  struct Transients {
51  Transients();
52  void reset();
53  std::shared_ptr<Parentage> parentagePtr_;
55  };
56 
57  private:
58 
59  std::shared_ptr<Parentage>& parentagePtr() const {return transient_.parentagePtr_;}
60 
64  };
65 
66  inline
67  bool
69  return a.branchID() < b.branchID();
70  }
71 
72  inline
73  std::ostream&
74  operator<<(std::ostream& os, ProductProvenance const& p) {
75  p.write(os);
76  return os;
77  }
78 
79  // Only the 'salient attributes' are testing in equality comparison.
80  bool operator==(ProductProvenance const& a, ProductProvenance const& b);
81  inline bool operator!=(ProductProvenance const& a, ProductProvenance const& b) { return !(a == b); }
82  typedef std::vector<ProductProvenance> ProductProvenanceVector;
83 }
84 #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:21
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.