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 
39  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 {
58  return index_;
59  }
60 
61  RunAuxiliary const& aux() const {
62  return *aux_;
63  }
64 
65  RunNumber_t run() const {
66  return aux().run();
67  }
68 
70  return m_reducedHistoryID;
71  }
72 
73  RunID const& id() const {
74  return aux().id();
75  }
76 
77  Timestamp const& beginTime() const {
78  return aux().beginTime();
79  }
80 
81  Timestamp const& endTime() const {
82  return aux().endTime();
83  }
84 
85  void setEndTime(Timestamp const& time) {
86  aux_->setEndTime(time);
87  }
88 
90  return aux_->mergeAuxiliary(aux);
91  }
92 
93  void put(
94  BranchDescription const& bd,
95  std::unique_ptr<WrapperBase> edp) const;
96 
98  std::unique_ptr<WrapperBase> edp) const;
99 
101 
102  void preReadFile();
103 
104  private:
105 
106  unsigned int transitionIndex_() const override;
107 
111 
112  // For the primary input RunPrincipals created by the EventProcessor,
113  // there should be one MergeableRunProductMetadata object created
114  // per concurrent run. In all other cases, this should just be null.
116  };
117 }
118 #endif
119 
edm::propagate_const< std::shared_ptr< RunAuxiliary > > aux_
Definition: RunPrincipal.h:108
unsigned int transitionIndex_() const override
Definition: RunPrincipal.cc:53
ProcessHistoryID const & reducedProcessHistoryID() const
Definition: RunPrincipal.h:69
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:39
Timestamp const & endTime() const
Definition: RunAuxiliary.h:40
RunNumber_t run() const
Definition: RunPrincipal.h:65
void fillRunPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
Definition: RunPrincipal.cc:28
void mergeAuxiliary(RunAuxiliary const &aux)
Definition: RunPrincipal.h:89
ProcessHistoryID m_reducedHistoryID
Definition: RunPrincipal.h:109
void setEndTime(Timestamp const &time)
Definition: RunPrincipal.h:85
RunID const & id() const
Definition: RunAuxiliary.h:37
Timestamp const & beginTime() const
Definition: RunAuxiliary.h:39
Timestamp const & beginTime() const
Definition: RunPrincipal.h:77
Timestamp const & endTime() const
Definition: RunPrincipal.h:81
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:61
RunID const & id() const
Definition: RunPrincipal.h:73
DelayedReader * reader() const
Definition: Principal.h:183
edm::propagate_const< std::unique_ptr< MergeableRunProductMetadata > > mergeableRunProductMetadataPtr_
Definition: RunPrincipal.h:115
~RunPrincipal() override
Definition: RunPrincipal.cc:25
MergeableRunProductMetadata * mergeableRunProductMetadata()
Definition: RunPrincipal.h:100
RunIndex index() const
Definition: RunPrincipal.h:57
RunAuxiliary Auxiliary
Definition: RunPrincipal.h:35
HLT enums.
unsigned int RunNumber_t
RunNumber_t run() const
Definition: RunAuxiliary.h:41