Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:29

0001 #ifndef DataFormats_Provenance_EventEntryDescription_h
0002 #define DataFormats_Provenance_EventEntryDescription_h
0003 
0004 /*----------------------------------------------------------------------
0005   
0006 EventEntryDescription: The event dependent portion of the description of a product
0007 and how it came into existence.
0008 
0009 ----------------------------------------------------------------------*/
0010 #include <iosfwd>
0011 #include <vector>
0012 
0013 #include "DataFormats/Provenance/interface/BranchID.h"
0014 #include "DataFormats/Provenance/interface/EntryDescriptionID.h"
0015 
0016 /*
0017   EventEntryDescription
0018 
0019   definitions:
0020   Product: The WrapperBase to which a provenance object is associated
0021 
0022   Creator: The EDProducer that made the product.
0023 
0024   Parents: The EDProducts used as input by the creator.
0025 */
0026 
0027 namespace edm {
0028   class EventEntryDescription {
0029   public:
0030     EventEntryDescription();
0031 
0032     ~EventEntryDescription() {}
0033 
0034     // Only the 'salient attributes' are encoded into the ID.
0035     EntryDescriptionID id() const;
0036 
0037     void write(std::ostream& os) const;
0038 
0039     std::vector<BranchID> const& parents() const { return parents_; }
0040 
0041     void setParents(std::vector<BranchID> const& parents) { parents_ = parents; }
0042 
0043   private:
0044     // The Branch IDs of the parents
0045     std::vector<BranchID> parents_;
0046 
0047     Hash<ModuleDescriptionType> moduleDescriptionID_;
0048   };
0049 
0050   inline std::ostream& operator<<(std::ostream& os, EventEntryDescription const& p) {
0051     p.write(os);
0052     return os;
0053   }
0054 
0055   // Only the 'salient attributes' are testing in equality comparison.
0056   bool operator==(EventEntryDescription const& a, EventEntryDescription const& b);
0057   inline bool operator!=(EventEntryDescription const& a, EventEntryDescription const& b) { return !(a == b); }
0058 }  // namespace edm
0059 #endif