CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch1/src/DataFormats/Provenance/interface/History.h

Go to the documentation of this file.
00001 #ifndef DataFormats_Provenance_History_h
00002 #define DataFormats_Provenance_History_h
00003 
00004 //----------------------------------------------------------------------
00005 //
00006 // Class History represents the processing history of a single Event.
00007 // It includes ordered sequences of elements, each of which contains
00008 // information about a specific 'process' through which the Event has
00009 // passed, with earlier processes at the beginning of the sequence.
00010 // This class is needed for backward compatibility only.
00011 // It is relevant if and only if fileFormatVersion.eventHistoryTree() is true.
00012 //
00013 //
00014 //----------------------------------------------------------------------
00015 
00016 #include <vector>
00017 #include "DataFormats/Provenance/interface/EventSelectionID.h"
00018 #include "DataFormats/Provenance/interface/BranchListIndex.h"
00019 #include "DataFormats/Provenance/interface/ProcessHistoryID.h" 
00020 
00021 namespace edm {
00022   class History {
00023   public:
00024     typedef std::size_t size_type;
00025     
00026     // Compiler-generated default c'tor, copy c'tor, assignment and
00027     // d'tor are all correct.
00028 
00029     // Return the number of 'processing steps' recorded in this
00030     // History.
00031     size_type size() const;
00032     
00033     // Add the given entry to this History. When a new data member is
00034     // added to the History class, this function should be modified to
00035     // take an instance of the type of the new data member.
00036     void addEventSelectionEntry(EventSelectionID const& eventSelection);
00037 
00038     void addBranchListIndexEntry(BranchListIndex const& branchListIndex);
00039 
00040     EventSelectionID const& getEventSelectionID(size_type i) const;
00041 
00042     EventSelectionIDVector const& eventSelectionIDs() const {return eventSelections_;}
00043 
00044     EventSelectionIDVector& eventSelectionIDs() {return eventSelections_;}
00045     
00046     ProcessHistoryID const& processHistoryID() const {return processHistoryID_;}
00047 
00048     void setProcessHistoryID(ProcessHistoryID const& phid) const {processHistoryID_ = phid;}
00049 
00050     BranchListIndexes const& branchListIndexes() const {return branchListIndexes_;}
00051 
00052     BranchListIndexes& branchListIndexes() {return branchListIndexes_;}
00053   private:
00054     
00055     // Note: We could, instead, define a struct that contains the
00056     // appropriate information for each history entry, and then contain
00057     // only one data member: a vector of this struct. This might make
00058     // iteration more convenient. But it would seem to complicate
00059     // persistence. The current plan is to have parallel vectors, one
00060     // for each type of item stored as data.
00061     EventSelectionIDVector eventSelections_;
00062 
00063     BranchListIndexes branchListIndexes_;
00064 
00065     mutable ProcessHistoryID processHistoryID_;
00066   };
00067 
00068 }
00069 
00070 #endif