CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Provenance.h
Go to the documentation of this file.
1 #ifndef DataFormats_Provenance_Provenance_h
2 #define DataFormats_Provenance_Provenance_h
3 
4 /*----------------------------------------------------------------------
5 
6 Provenance: The full description of a product and how it came into
7 existence.
8 
9 ----------------------------------------------------------------------*/
10 
20 
21 #include "boost/shared_ptr.hpp"
22 
23 #include <iosfwd>
24 /*
25  Provenance
26 
27  definitions:
28  Product: The EDProduct to which a provenance object is associated
29 
30  Creator: The EDProducer that made the product.
31 
32  Parents: The EDProducts used as input by the creator.
33 */
34 
35 namespace edm {
36  class ProductProvenance;
37  class Provenance {
38  public:
39  Provenance();
40 
41  Provenance(boost::shared_ptr<ConstBranchDescription> const& p, ProductID const& pid);
42 
43  Parentage const& event() const {return parentage();}
44  BranchDescription const& product() const {return branchDescription_->me();}
45 
48  boost::shared_ptr<ConstBranchDescription> const& constBranchDescriptionPtr() const {return branchDescription_;}
49 
50  ProductProvenance* resolve() const;
53  return resolve();
54  }
55  bool productProvenanceValid() const {
57  }
58  Parentage const& parentage() const {return productProvenance()->parentage();}
59  BranchID const& branchID() const {return product().branchID();}
60  std::string const& branchName() const {return product().branchName();}
61  std::string const& className() const {return product().className();}
62  std::string const& moduleLabel() const {return product().moduleLabel();}
63  std::string const& processName() const {return product().processName();}
66  boost::shared_ptr<BranchMapper> const& store() const {return store_;}
69  ParameterSetID psetID() const;
70  std::string moduleName() const;
72  std::map<ProcessConfigurationID, ParameterSetID> const& parameterSetIDs() const {
73  return product().parameterSetIDs();
74  }
75  std::map<ProcessConfigurationID, std::string> const& moduleNames() const {
76  return product().moduleNames();
77  }
78  std::set<std::string> const& branchAliases() const {return product().branchAliases();}
79 
80  std::vector<BranchID> const& parents() const {return parentage().parents();}
81 
82  void write(std::ostream& os) const;
83 
84  void setStore(boost::shared_ptr<BranchMapper> store) const {store_ = store;}
85 
87 
88  ProductID const& productID() const {return productID_;}
89 
90  void setProductProvenance(ProductProvenance const& prov) const;
91 
92  void setProductID(ProductID const& pid) {
93  productID_ = pid;
94  }
95 
96  void setBranchDescription(boost::shared_ptr<ConstBranchDescription> const& p) {
98  }
99 
100  void resetProductProvenance() const;
101 
102  void swap(Provenance&);
103 
104  private:
105  boost::shared_ptr<ConstBranchDescription> branchDescription_;
107  ProcessHistoryID const* processHistoryID_; // Owned by Auxiliary
109  mutable boost::shared_ptr<ProductProvenance> productProvenancePtr_;
110  mutable boost::shared_ptr<BranchMapper> store_;
111  };
112 
113  inline
114  std::ostream&
115  operator<<(std::ostream& os, Provenance const& p) {
116  p.write(os);
117  return os;
118  }
119 
120  bool operator==(Provenance const& a, Provenance const& b);
121 
122 }
123 #endif
bool productProvenanceValid() const
Definition: Provenance.h:55
Parentage const & event() const
Definition: Provenance.h:43
boost::shared_ptr< BranchMapper > store_
Definition: Provenance.h:110
void setProcessHistoryID(ProcessHistoryID const &phid)
Definition: Provenance.h:86
std::set< std::string > const & branchAliases() const
Definition: Provenance.h:78
std::string & branchName() const
std::map< ProcessConfigurationID, std::string > & moduleNames() const
ReleaseVersion releaseVersion() const
Definition: Provenance.cc:65
ProductProvenance * productProvenance() const
Definition: Provenance.h:51
std::string const & processName() const
ProductID productID_
Definition: Provenance.h:106
std::string const & processName() const
Definition: Provenance.h:63
void resetProductProvenance() const
Definition: Provenance.cc:119
void write(std::ostream &os) const
Definition: Provenance.cc:104
ParameterSetID psetID() const
Definition: Provenance.cc:72
std::vector< BranchID > const & parents() const
Definition: Parentage.h:38
boost::shared_ptr< BranchMapper > const & store() const
Definition: Provenance.h:66
std::string const & className() const
ProductProvenance * resolve() const
Definition: Provenance.cc:28
std::string const & moduleLabel() const
std::string const & productInstanceName() const
bool operator==(debugging_allocator< X > const &, debugging_allocator< Y > const &)
void setStore(boost::shared_ptr< BranchMapper > store) const
Definition: Provenance.h:84
void setBranchDescription(boost::shared_ptr< ConstBranchDescription > const &p)
Definition: Provenance.h:96
std::string const & friendlyClassName() const
BranchID const & branchID() const
BranchDescription const & product() const
Definition: Provenance.h:44
std::string const & friendlyClassName() const
Definition: Provenance.h:65
BranchID const & branchID() const
Definition: Provenance.h:59
bool productProvenanceValid_
Definition: Provenance.h:108
std::map< ProcessConfigurationID, ParameterSetID > const & parameterSetIDs() const
Definition: Provenance.h:72
std::string moduleName() const
Definition: Provenance.cc:88
ConstBranchDescription const & constBranchDescription() const
Definition: Provenance.h:47
BranchDescription const & branchDescription() const
Definition: Provenance.h:46
boost::shared_ptr< ProductProvenance > productProvenancePtr_
Definition: Provenance.h:109
std::string const & className() const
Definition: Provenance.h:61
boost::shared_ptr< ConstBranchDescription > branchDescription_
Definition: Provenance.h:105
std::vector< BranchID > const & parents() const
Definition: Provenance.h:80
double b
Definition: hdecay.h:120
std::string ReleaseVersion
Definition: ReleaseVersion.h:7
std::string const & moduleLabel() const
Definition: Provenance.h:62
std::set< std::string > const & branchAliases() const
ProcessHistoryID const & processHistoryID() const
Definition: Provenance.h:67
std::map< ProcessConfigurationID, std::string > const & moduleNames() const
Definition: Provenance.h:75
ProcessHistoryID const * processHistoryID_
Definition: Provenance.h:107
void setProductID(ProductID const &pid)
Definition: Provenance.h:92
std::map< ProcessConfigurationID, ParameterSetID > & parameterSetIDs() const
double a
Definition: hdecay.h:121
boost::shared_ptr< ConstBranchDescription > const & constBranchDescriptionPtr() const
Definition: Provenance.h:48
void setProductProvenance(ProductProvenance const &prov) const
Definition: Provenance.cc:125
ProcessConfigurationID processConfigurationID() const
Definition: Provenance.cc:43
Parentage const & parentage() const
Definition: Provenance.h:58
ProductID const & productID() const
Definition: Provenance.h:88
Parentage const & parentage() const
std::string const & productInstanceName() const
Definition: Provenance.h:64
std::string const & branchName() const
Definition: Provenance.h:60
std::ostream & operator<<(std::ostream &ost, const HLTGlobalStatus &hlt)
Formatted printout of trigger tbale.
void swap(Provenance &)
Definition: Provenance.cc:131