CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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<RunAuxiliary> aux,
40  std::shared_ptr<ProductRegistry const> reg,
41  ProcessConfiguration const& pc,
42  HistoryAppender* historyAppender,
43  unsigned int iRunIndex,
44  bool isForPrimaryProcess = true,
45  MergeableRunProductProcesses const* mergeableRunProductProcesses = nullptr);
46  ~RunPrincipal() override;
47 
48  void fillRunPrincipal(ProcessHistoryRegistry const& processHistoryRegistry, DelayedReader* reader = nullptr);
49 
57  RunIndex index() const { return index_; }
58 
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 
71  void setEndTime(Timestamp const& time) { aux_->setEndTime(time); }
72 
73  void mergeAuxiliary(RunAuxiliary const& aux) { return aux_->mergeAuxiliary(aux); }
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 
85  private:
86  unsigned int transitionIndex_() const override;
87 
91 
92  // For the primary input RunPrincipals created by the EventProcessor,
93  // there should be one MergeableRunProductMetadata object created
94  // per concurrent run. In all other cases, this should just be null.
96  };
97 } // namespace edm
98 #endif
edm::propagate_const< std::shared_ptr< RunAuxiliary > > aux_
Definition: RunPrincipal.h:88
ProcessHistoryID const & reducedProcessHistoryID() const
Definition: RunPrincipal.h:63
unsigned int ProductResolverIndex
unsigned int transitionIndex_() const override
Definition: RunPrincipal.cc:58
void put(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp) const
Definition: RunPrincipal.cc:38
Timestamp const & endTime() const
Definition: RunAuxiliary.h:30
RunNumber_t run() const
Definition: RunPrincipal.h:61
void mergeAuxiliary(RunAuxiliary const &aux)
Definition: RunPrincipal.h:73
ProcessHistoryID m_reducedHistoryID
Definition: RunPrincipal.h:89
void setEndTime(Timestamp const &time)
Definition: RunPrincipal.h:71
RunID const & id() const
Definition: RunAuxiliary.h:27
Timestamp const & beginTime() const
Definition: RunAuxiliary.h:29
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=nullptr)
Definition: RunPrincipal.cc:11
Timestamp const & beginTime() const
Definition: RunPrincipal.h:67
Timestamp const & endTime() const
Definition: RunPrincipal.h:69
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:59
RunID const & id() const
Definition: RunPrincipal.h:65
DelayedReader * reader() const
Definition: Principal.h:187
edm::propagate_const< std::unique_ptr< MergeableRunProductMetadata > > mergeableRunProductMetadataPtr_
Definition: RunPrincipal.h:95
~RunPrincipal() override
Definition: RunPrincipal.cc:26
MergeableRunProductMetadata * mergeableRunProductMetadata()
Definition: RunPrincipal.h:81
RunIndex index() const
Definition: RunPrincipal.h:57
RunAuxiliary Auxiliary
Definition: RunPrincipal.h:36
unsigned int RunNumber_t
void fillRunPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=nullptr)
Definition: RunPrincipal.cc:28
void putOrMerge(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp) const
Definition: RunPrincipal.cc:47
RunNumber_t run() const
Definition: RunAuxiliary.h:31