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
60
61
62
63
64
65
66
67
68
69
70
|
#ifndef DataFormats_Provenance_History_h
#define DataFormats_Provenance_History_h
//----------------------------------------------------------------------
//
// Class History represents the processing history of a single Event.
// It includes ordered sequences of elements, each of which contains
// information about a specific 'process' through which the Event has
// passed, with earlier processes at the beginning of the sequence.
// This class is needed for backward compatibility only.
// It is relevant if and only if fileFormatVersion.eventHistoryTree() is true.
//
//
//----------------------------------------------------------------------
#include <vector>
#include "DataFormats/Provenance/interface/EventSelectionID.h"
#include "DataFormats/Provenance/interface/BranchListIndex.h"
#include "DataFormats/Provenance/interface/ProcessHistoryID.h"
namespace edm {
class History {
public:
typedef std::size_t size_type;
// Compiler-generated default c'tor, copy c'tor, assignment and
// d'tor are all correct.
// Return the number of 'processing steps' recorded in this
// History.
size_type size() const;
// Add the given entry to this History. When a new data member is
// added to the History class, this function should be modified to
// take an instance of the type of the new data member.
void addEventSelectionEntry(EventSelectionID const& eventSelection);
void addBranchListIndexEntry(BranchListIndex const& branchListIndex);
EventSelectionID const& getEventSelectionID(size_type i) const;
EventSelectionIDVector const& eventSelectionIDs() const { return eventSelections_; }
EventSelectionIDVector& eventSelectionIDs() { return eventSelections_; }
ProcessHistoryID const& processHistoryID() const { return processHistoryID_; }
void setProcessHistoryID(ProcessHistoryID const& phid) { processHistoryID_ = phid; }
BranchListIndexes const& branchListIndexes() const { return branchListIndexes_; }
BranchListIndexes& branchListIndexes() { return branchListIndexes_; }
private:
// Note: We could, instead, define a struct that contains the
// appropriate information for each history entry, and then contain
// only one data member: a vector of this struct. This might make
// iteration more convenient. But it would seem to complicate
// persistence. The current plan is to have parallel vectors, one
// for each type of item stored as data.
EventSelectionIDVector eventSelections_;
BranchListIndexes branchListIndexes_;
ProcessHistoryID processHistoryID_;
};
} // namespace edm
#endif
|