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 
33  class RunPrincipal : public Principal {
34  public:
36  typedef Principal Base;
37 
38  RunPrincipal(std::shared_ptr<RunAuxiliary> aux,
39  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  RunAuxiliary const& aux() const { return *aux_; }
59 
60  RunNumber_t run() const { return aux().run(); }
61 
63 
64  RunID const& id() const { return aux().id(); }
65 
66  Timestamp const& beginTime() const { return aux().beginTime(); }
67 
68  Timestamp const& endTime() const { return aux().endTime(); }
69 
70  void setEndTime(Timestamp const& time) { aux_->setEndTime(time); }
71 
72  void mergeAuxiliary(RunAuxiliary const& aux) { return aux_->mergeAuxiliary(aux); }
73 
74  void put(BranchDescription const& bd, std::unique_ptr<WrapperBase> edp) const;
75 
76  void put(ProductResolverIndex index, std::unique_ptr<WrapperBase> edp) const;
77 
79 
80  void preReadFile();
81 
82  private:
83  unsigned int transitionIndex_() const override;
84 
88 
89  // For the primary input RunPrincipals created by the EventProcessor,
90  // there should be one MergeableRunProductMetadata object created
91  // per concurrent run. In all other cases, this should just be null.
93  };
94 } // namespace edm
95 #endif
edm::propagate_const< std::shared_ptr< RunAuxiliary > > aux_
Definition: RunPrincipal.h:85
unsigned int transitionIndex_() const override
Definition: RunPrincipal.cc:45
ProcessHistoryID const & reducedProcessHistoryID() const
Definition: RunPrincipal.h:62
RunPrincipal(std::shared_ptr< RunAuxiliary > aux, std::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, HistoryAppender *historyAppender, unsigned int iRunIndex, bool isForPrimaryProcess=true, MergeableRunProductProcesses const *mergeableRunProductProcesses=0)
Definition: RunPrincipal.cc:9
unsigned int ProductResolverIndex
void put(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp) const
Definition: RunPrincipal.cc:36
Timestamp const & endTime() const
Definition: RunAuxiliary.h:40
RunNumber_t run() const
Definition: RunPrincipal.h:60
void fillRunPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
Definition: RunPrincipal.cc:26
void mergeAuxiliary(RunAuxiliary const &aux)
Definition: RunPrincipal.h:72
ProcessHistoryID m_reducedHistoryID
Definition: RunPrincipal.h:86
void setEndTime(Timestamp const &time)
Definition: RunPrincipal.h:70
RunID const & id() const
Definition: RunAuxiliary.h:37
Timestamp const & beginTime() const
Definition: RunAuxiliary.h:39
Timestamp const & beginTime() const
Definition: RunPrincipal.h:66
Timestamp const & endTime() const
Definition: RunPrincipal.h:68
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:58
RunID const & id() const
Definition: RunPrincipal.h:64
DelayedReader * reader() const
Definition: Principal.h:186
edm::propagate_const< std::unique_ptr< MergeableRunProductMetadata > > mergeableRunProductMetadataPtr_
Definition: RunPrincipal.h:92
~RunPrincipal() override
Definition: RunPrincipal.cc:24
MergeableRunProductMetadata * mergeableRunProductMetadata()
Definition: RunPrincipal.h:78
RunIndex index() const
Definition: RunPrincipal.h:56
RunAuxiliary Auxiliary
Definition: RunPrincipal.h:35
HLT enums.
unsigned int RunNumber_t
RunNumber_t run() const
Definition: RunAuxiliary.h:41