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<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 
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
edm::propagate_const< std::shared_ptr< RunAuxiliary > > aux_
Definition: RunPrincipal.h:92
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:47
unsigned int ProductResolverIndex
unsigned int transitionIndex_() const override
Definition: RunPrincipal.cc:58
RunID const & id() const
Definition: RunPrincipal.h:65
RunNumber_t run() const
Definition: RunPrincipal.h:61
void mergeAuxiliary(RunAuxiliary const &aux)
Definition: RunPrincipal.h:73
ProcessHistoryID m_reducedHistoryID
Definition: RunPrincipal.h:93
RunNumber_t run() const
Definition: RunAuxiliary.h:31
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:30
ShouldWriteRun shouldWriteRun_
Definition: RunPrincipal.h:101
ShouldWriteRun shouldWriteRun() const
Definition: RunPrincipal.h:86
RunIndex index() const
Definition: RunPrincipal.h:57
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
Definition: value.py:1
RunID const & id() const
Definition: RunAuxiliary.h:27
Timestamp const & beginTime() const
Definition: RunAuxiliary.h:29
edm::propagate_const< std::unique_ptr< MergeableRunProductMetadata > > mergeableRunProductMetadataPtr_
Definition: RunPrincipal.h:99
~RunPrincipal() override
Definition: RunPrincipal.cc:26
MergeableRunProductMetadata * mergeableRunProductMetadata()
Definition: RunPrincipal.h:81
void put(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp) const
Definition: RunPrincipal.cc:38
RunAuxiliary Auxiliary
Definition: RunPrincipal.h:36
HLT enums.
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:59
unsigned int RunNumber_t
void fillRunPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=nullptr)
Definition: RunPrincipal.cc:28
DelayedReader * reader() const
Definition: Principal.h:187