CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 
24 
25 namespace edm {
26 
27  class HistoryAppender;
28  class ModuleCallingContext;
29  class UnscheduledHandler;
30 
31  class RunPrincipal : public Principal {
32  public:
34  typedef Principal Base;
35 
37  std::shared_ptr<RunAuxiliary> aux,
38  std::shared_ptr<ProductRegistry const> reg,
39  ProcessConfiguration const& pc,
40  HistoryAppender* historyAppender,
41  unsigned int iRunIndex);
43 
44  void fillRunPrincipal(ProcessHistoryRegistry const& processHistoryRegistry, DelayedReader* reader = 0);
45 
53  RunIndex index() const {
54  return index_;
55  }
56 
57  RunAuxiliary const& aux() const {
58  return *aux_;
59  }
60 
61  RunNumber_t run() const {
62  return aux().run();
63  }
64 
66  return m_reducedHistoryID;
67  }
68 
69  RunID const& id() const {
70  return aux().id();
71  }
72 
73  Timestamp const& beginTime() const {
74  return aux().beginTime();
75  }
76 
77  Timestamp const& endTime() const {
78  return aux().endTime();
79  }
80 
81  void setEndTime(Timestamp const& time) {
82  aux_->setEndTime(time);
83  }
84 
86  return aux_->mergeAuxiliary(aux);
87  }
88 
89  void setUnscheduledHandler(std::shared_ptr<UnscheduledHandler>) {}
90 
91  void put(
92  BranchDescription const& bd,
93  std::unique_ptr<WrapperBase> edp);
94 
95  void readImmediate() const;
96 
97  void setComplete() {
98  complete_ = true;
99  }
100 
101  private:
102 
103  virtual bool isComplete_() const override {return complete_;}
104 
105  virtual bool unscheduledFill(std::string const&,
106  ModuleCallingContext const* mcc) const override {return false;}
107 
108  virtual unsigned int transitionIndex_() const override;
109 
110  void resolveProductImmediate(ProductHolderBase const& phb) const;
111 
112  std::shared_ptr<RunAuxiliary> aux_;
115 
116  bool complete_;
117  };
118 }
119 #endif
120 
RunPrincipal(std::shared_ptr< RunAuxiliary > aux, std::shared_ptr< ProductRegistry const > reg, ProcessConfiguration const &pc, HistoryAppender *historyAppender, unsigned int iRunIndex)
Definition: RunPrincipal.cc:10
ProcessHistoryID const & reducedProcessHistoryID() const
Definition: RunPrincipal.h:65
virtual unsigned int transitionIndex_() const override
Definition: RunPrincipal.cc:78
Timestamp const & endTime() const
Definition: RunAuxiliary.h:40
void put(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp)
Definition: RunPrincipal.cc:33
RunNumber_t run() const
Definition: RunPrincipal.h:61
void fillRunPrincipal(ProcessHistoryRegistry const &processHistoryRegistry, DelayedReader *reader=0)
Definition: RunPrincipal.cc:21
void readImmediate() const
Definition: RunPrincipal.cc:51
void setUnscheduledHandler(std::shared_ptr< UnscheduledHandler >)
Definition: RunPrincipal.h:89
void mergeAuxiliary(RunAuxiliary const &aux)
Definition: RunPrincipal.h:85
ProcessHistoryID m_reducedHistoryID
Definition: RunPrincipal.h:113
std::shared_ptr< RunAuxiliary > aux_
Definition: RunPrincipal.h:112
void setEndTime(Timestamp const &time)
Definition: RunPrincipal.h:81
RunID const & id() const
Definition: RunAuxiliary.h:37
Timestamp const & beginTime() const
Definition: RunAuxiliary.h:39
Timestamp const & beginTime() const
Definition: RunPrincipal.h:73
void resolveProductImmediate(ProductHolderBase const &phb) const
Definition: RunPrincipal.cc:63
Timestamp const & endTime() const
Definition: RunPrincipal.h:77
RunAuxiliary const & aux() const
Definition: RunPrincipal.h:57
RunID const & id() const
Definition: RunPrincipal.h:69
DelayedReader * reader() const
Definition: Principal.h:171
virtual bool unscheduledFill(std::string const &, ModuleCallingContext const *mcc) const override
Definition: RunPrincipal.h:105
RunIndex index() const
Definition: RunPrincipal.h:53
RunAuxiliary Auxiliary
Definition: RunPrincipal.h:33
virtual bool isComplete_() const override
Definition: RunPrincipal.h:103
unsigned int RunNumber_t
RunNumber_t run() const
Definition: RunAuxiliary.h:41