Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05:01

0001 #ifndef DataFormats_Provenance_History_h
0002 #define DataFormats_Provenance_History_h
0003 
0004 //----------------------------------------------------------------------
0005 //
0006 // Class History represents the processing history of a single Event.
0007 // It includes ordered sequences of elements, each of which contains
0008 // information about a specific 'process' through which the Event has
0009 // passed, with earlier processes at the beginning of the sequence.
0010 // This class is needed for backward compatibility only.
0011 // It is relevant if and only if fileFormatVersion.eventHistoryTree() is true.
0012 //
0013 //
0014 //----------------------------------------------------------------------
0015 
0016 #include <vector>
0017 #include "DataFormats/Provenance/interface/EventSelectionID.h"
0018 #include "DataFormats/Provenance/interface/BranchListIndex.h"
0019 #include "DataFormats/Provenance/interface/ProcessHistoryID.h"
0020 
0021 namespace edm {
0022   class History {
0023   public:
0024     typedef std::size_t size_type;
0025 
0026     // Compiler-generated default c'tor, copy c'tor, assignment and
0027     // d'tor are all correct.
0028 
0029     // Return the number of 'processing steps' recorded in this
0030     // History.
0031     size_type size() const;
0032 
0033     // Add the given entry to this History. When a new data member is
0034     // added to the History class, this function should be modified to
0035     // take an instance of the type of the new data member.
0036     void addEventSelectionEntry(EventSelectionID const& eventSelection);
0037 
0038     void addBranchListIndexEntry(BranchListIndex const& branchListIndex);
0039 
0040     EventSelectionID const& getEventSelectionID(size_type i) const;
0041 
0042     EventSelectionIDVector const& eventSelectionIDs() const { return eventSelections_; }
0043 
0044     EventSelectionIDVector& eventSelectionIDs() { return eventSelections_; }
0045 
0046     ProcessHistoryID const& processHistoryID() const { return processHistoryID_; }
0047 
0048     void setProcessHistoryID(ProcessHistoryID const& phid) { processHistoryID_ = phid; }
0049 
0050     BranchListIndexes const& branchListIndexes() const { return branchListIndexes_; }
0051 
0052     BranchListIndexes& branchListIndexes() { return branchListIndexes_; }
0053 
0054   private:
0055     // Note: We could, instead, define a struct that contains the
0056     // appropriate information for each history entry, and then contain
0057     // only one data member: a vector of this struct. This might make
0058     // iteration more convenient. But it would seem to complicate
0059     // persistence. The current plan is to have parallel vectors, one
0060     // for each type of item stored as data.
0061     EventSelectionIDVector eventSelections_;
0062 
0063     BranchListIndexes branchListIndexes_;
0064 
0065     ProcessHistoryID processHistoryID_;
0066   };
0067 
0068 }  // namespace edm
0069 
0070 #endif