CMS 3D CMS Logo

RunPrincipal.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_RunPrincipal_h
2 #define FWCore_Framework_RunPrincipal_h
3 
4 /*----------------------------------------------------------------------
5 
6 RunPrincipal: This is the class responsible for management of
7 per run EDProducts. It is not seen by reconstruction code;
8 such code sees the Run class, which is a proxy for RunPrincipal.
9 
10 The major internal component of the RunPrincipal
11 is the DataBlock.
12 
13 ----------------------------------------------------------------------*/
14 
15 #include <string>
16 #include <vector>
17 
18 #include <memory>
19 
25 
26 namespace edm {
27 
28  class HistoryAppender;
29  class MergeableRunProductProcesses;
30  class MergeableRunProductMetadata;
31  class ModuleCallingContext;
32  class ProcessHistoryRegistry;
33 
34  class RunPrincipal : public Principal {
35  public:
37  typedef Principal Base;
38 
39  RunPrincipal(std::shared_ptr<ProductRegistry const> reg,
40  ProcessConfiguration const& pc,
41  HistoryAppender* historyAppender,
42  unsigned int iRunIndex,
43  bool isForPrimaryProcess = true,
44  MergeableRunProductProcesses const* mergeableRunProductProcesses = nullptr);
45  ~RunPrincipal() override;
46 
47  void fillRunPrincipal(ProcessHistoryRegistry const& processHistoryRegistry, DelayedReader* reader = nullptr);
48 
56  RunIndex index() const { return index_; }
57 
58  void setAux(RunAuxiliary iAux) { aux_ = iAux; }
59  RunAuxiliary const& aux() const { return aux_; }
60 
61  RunNumber_t run() const { return aux().run(); }
62 
64 
65  RunID const& id() const { return aux().id(); }
66 
67  Timestamp const& beginTime() const { return aux().beginTime(); }
68 
69  Timestamp const& endTime() const { return aux().endTime(); }
70 
72 
74 
75  void put(BranchDescription const& bd, std::unique_ptr<WrapperBase> edp) const;
76 
77  void put(ProductResolverIndex index, std::unique_ptr<WrapperBase> edp) const;
78 
79  void putOrMerge(BranchDescription const& bd, std::unique_ptr<WrapperBase> edp) const;
80 
82 
83  void preReadFile();
84 
88 
89  private:
90  unsigned int transitionIndex_() const override;
91 
95 
96  // For the primary input RunPrincipals created by the EventProcessor,
97  // there should be one MergeableRunProductMetadata object created
98  // per concurrent run. In all other cases, this should just be null.
100 
102  };
103 } // namespace edm
104 #endif
void setShouldWriteRun(ShouldWriteRun value)
Definition: RunPrincipal.h:87
Timestamp const & endTime() const
Definition: RunPrincipal.h:69
void putOrMerge(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp) const
Definition: RunPrincipal.cc:44
unsigned int ProductResolverIndex
unsigned int transitionIndex_() const override
Definition: RunPrincipal.cc:55
RunPrincipal(std::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, HistoryAppender *historyAppender, unsigned int iRunIndex, bool isForPrimaryProcess=true, MergeableRunProductProcesses const *mergeableRunProductProcesses=nullptr)
Definition: RunPrincipal.cc:11
RunID const & id() const
Definition: RunPrincipal.h:65
RunNumber_t run() const
Definition: RunPrincipal.h:61
RunAuxiliary aux_
Definition: RunPrincipal.h:92
void mergeAuxiliary(RunAuxiliary const &aux)
Definition: RunPrincipal.h:73
ProcessHistoryID m_reducedHistoryID
Definition: RunPrincipal.h:93
RunNumber_t run() const
Definition: RunAuxiliary.h:30
void setAux(RunAuxiliary iAux)
Definition: RunPrincipal.h:58
void setEndTime(Timestamp const &time)
Definition: RunPrincipal.h:71
Timestamp const & beginTime() const
Definition: RunPrincipal.h:67
ProcessHistoryID const & reducedProcessHistoryID() const
Definition: RunPrincipal.h:63
Timestamp const & endTime() const
Definition: RunAuxiliary.h:29
ShouldWriteRun shouldWriteRun_
Definition: RunPrincipal.h:101
ShouldWriteRun shouldWriteRun() const
Definition: RunPrincipal.h:86
RunIndex index() const
Definition: RunPrincipal.h:56
Definition: value.py:1
RunID const & id() const
Definition: RunAuxiliary.h:26
Timestamp const & beginTime() const
Definition: RunAuxiliary.h:28
edm::propagate_const< std::unique_ptr< MergeableRunProductMetadata > > mergeableRunProductMetadataPtr_
Definition: RunPrincipal.h:99
~RunPrincipal() override
Definition: RunPrincipal.cc:23
MergeableRunProductMetadata * mergeableRunProductMetadata()
Definition: RunPrincipal.h:81
void put(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp) const
Definition: RunPrincipal.cc:35
void mergeAuxiliary(RunAuxiliary const &aux)
Definition: RunAuxiliary.cc:15
RunAuxiliary Auxiliary
Definition: RunPrincipal.h:36
HLT enums.
void setEndTime(Timestamp const &time)
Definition: RunAuxiliary.h:35
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:59
unsigned int RunNumber_t
void fillRunPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=nullptr)
Definition: RunPrincipal.cc:25
DelayedReader * reader() const
Definition: Principal.h:181