EventEntryDescription

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
#ifndef DataFormats_Provenance_EventEntryDescription_h
#define DataFormats_Provenance_EventEntryDescription_h

/*----------------------------------------------------------------------
  
EventEntryDescription: The event dependent portion of the description of a product
and how it came into existence.

----------------------------------------------------------------------*/
#include <iosfwd>
#include <vector>

#include "DataFormats/Provenance/interface/BranchID.h"
#include "DataFormats/Provenance/interface/EntryDescriptionID.h"

/*
  EventEntryDescription

  definitions:
  Product: The WrapperBase to which a provenance object is associated

  Creator: The EDProducer that made the product.

  Parents: The EDProducts used as input by the creator.
*/

namespace edm {
  class EventEntryDescription {
  public:
    EventEntryDescription();

    ~EventEntryDescription() {}

    // Only the 'salient attributes' are encoded into the ID.
    EntryDescriptionID id() const;

    void write(std::ostream& os) const;

    std::vector<BranchID> const& parents() const { return parents_; }

    void setParents(std::vector<BranchID> const& parents) { parents_ = parents; }

  private:
    // The Branch IDs of the parents
    std::vector<BranchID> parents_;

    Hash<ModuleDescriptionType> moduleDescriptionID_;
  };

  inline std::ostream& operator<<(std::ostream& os, EventEntryDescription const& p) {
    p.write(os);
    return os;
  }

  // Only the 'salient attributes' are testing in equality comparison.
  bool operator==(EventEntryDescription const& a, EventEntryDescription const& b);
  inline bool operator!=(EventEntryDescription const& a, EventEntryDescription const& b) { return !(a == b); }
}  // namespace edm
#endif