CMS 3D CMS Logo

Provenance.cc

Go to the documentation of this file.
00001 #include "DataFormats/Provenance/interface/Provenance.h"
00002 
00003 /*----------------------------------------------------------------------
00004 
00005 ----------------------------------------------------------------------*/
00006 
00007 namespace edm {
00008 
00009   Provenance::Provenance(BranchDescription const& p) :
00010     branchDescription_(p),
00011     branchEntryInfoPtr_() {
00012   }
00013 
00014   Provenance::Provenance(ConstBranchDescription const& p) :
00015     branchDescription_(p),
00016     branchEntryInfoPtr_() {
00017   }
00018 
00019   Provenance::Provenance(BranchDescription const& p, boost::shared_ptr<EventEntryInfo> ei) :
00020     branchDescription_(p),
00021     branchEntryInfoPtr_(ei)
00022   { }
00023 
00024   Provenance::Provenance(ConstBranchDescription const& p, boost::shared_ptr<EventEntryInfo> ei) :
00025     branchDescription_(p),
00026     branchEntryInfoPtr_(ei)
00027   { }
00028 
00029   Provenance::Provenance(BranchDescription const& p, boost::shared_ptr<RunLumiEntryInfo> ei) :
00030     branchDescription_(p),
00031     branchEntryInfoPtr_(boost::shared_ptr<EventEntryInfo>(
00032       new EventEntryInfo(ei->branchID(), ei->productStatus(), ei->moduleDescriptionID()))) {
00033   }
00034 
00035   Provenance::Provenance(ConstBranchDescription const& p, boost::shared_ptr<RunLumiEntryInfo> ei) :
00036     branchDescription_(p),
00037     branchEntryInfoPtr_(boost::shared_ptr<EventEntryInfo>(
00038       new EventEntryInfo(ei->branchID(), ei->productStatus(), ei->moduleDescriptionID()))) {
00039   }
00040 
00041   void
00042   Provenance::setEventEntryInfo(boost::shared_ptr<EventEntryInfo> bei) const {
00043     assert(branchEntryInfoPtr_.get() == 0);
00044     branchEntryInfoPtr_ = bei;
00045   }
00046 
00047   boost::shared_ptr<EventEntryInfo>
00048   Provenance::resolve () const {
00049     boost::shared_ptr<EventEntryInfo> prov = store_->branchToEntryInfo(branchDescription_.branchID());
00050     setEventEntryInfo(prov);
00051     return prov;
00052 }
00053 
00054 
00055   void
00056   Provenance::write(std::ostream& os) const {
00057     // This is grossly inadequate, but it is not critical for the
00058     // first pass.
00059     product().write(os);
00060     branchEntryInfo().write(os);
00061   }
00062 
00063     
00064   bool operator==(Provenance const& a, Provenance const& b) {
00065     return
00066       a.product() == b.product()
00067       && a.entryDescription() == b.entryDescription();
00068   }
00069 
00070 }
00071 

Generated on Tue Jun 9 17:31:39 2009 for CMSSW by  doxygen 1.5.4