CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EDAnalyzerAdaptorBase.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_stream_EDAnalyzerAdaptorBase_h
2 #define FWCore_Framework_stream_EDAnalyzerAdaptorBase_h
3 // -*- C++ -*-
4 //
5 // Package: FWCore/Framework
6 // Class : EDAnalyzerAdaptorBase
7 //
16 //
17 // Original Author: Chris Jones
18 // Created: Fri, 02 Aug 2013 18:09:15 GMT
19 //
20 
21 // system include files
22 #include <vector>
23 
24 // user include files
33 
34 
35 // forward declarations
36 
37 namespace edm {
38  class ModuleCallingContext;
39  class ProductHolderIndexHelper;
40  class EDConsumerBase;
41  class PreallocationConfiguration;
42  class ProductHolderIndexAndSkipBit;
43  class ActivityRegistry;
44 
45  namespace maker {
46  template<typename T> class ModuleHolderT;
47  }
48 
49  namespace stream {
50  class EDAnalyzerBase;
51 
53  {
54 
55  public:
56  template <typename T> friend class edm::WorkerT;
57  template <typename T> friend class edm::maker::ModuleHolderT;
58 
60  virtual ~EDAnalyzerAdaptorBase();
61 
62  // ---------- const member functions ---------------------
63 
64  // ---------- static member functions --------------------
65 
66  // ---------- member functions ---------------------------
68 
69  std::string workerType() const { return "WorkerT<EDAnalyzerAdaptorBase>";}
70  void
72  protected:
73  template<typename T> void createStreamModules(T iFunc) {
74  for(auto& m: m_streamModules) {
75  m = iFunc();
76  }
77  }
78 
79  //Same interface as EDConsumerBase
80  void itemsToGet(BranchType, std::vector<ProductHolderIndexAndSkipBit>&) const;
81  void itemsMayGet(BranchType, std::vector<ProductHolderIndexAndSkipBit>&) const;
82  std::vector<ProductHolderIndexAndSkipBit> const& itemsToGetFromEvent() const;
83 
84  void updateLookup(BranchType iBranchType,
86 
87  const EDConsumerBase* consumer() const;
88 
89  void modulesDependentUpon(const std::string& iProcessName,
90  std::vector<const char*>& oModuleLabels) const;
91  private:
92  EDAnalyzerAdaptorBase(const EDAnalyzerAdaptorBase&); // stop default
93 
94  const EDAnalyzerAdaptorBase& operator=(const EDAnalyzerAdaptorBase&); // stop default
95 
96  bool doEvent(EventPrincipal& ep, EventSetup const& c,
98  ModuleCallingContext const*) ;
100 
101  virtual void setupStreamModules() = 0;
102  void doBeginJob();
103  virtual void doEndJob() = 0;
104 
105  void doBeginStream(StreamID id);
106  void doEndStream(StreamID id);
107  void doStreamBeginRun(StreamID id,
108  RunPrincipal& ep,
109  EventSetup const& c,
110  ModuleCallingContext const*);
111  virtual void setupRun(EDAnalyzerBase*, RunIndex) = 0;
112  void doStreamEndRun(StreamID id,
113  RunPrincipal& ep,
114  EventSetup const& c,
115  ModuleCallingContext const*);
116  virtual void streamEndRunSummary(EDAnalyzerBase*,edm::Run const&, edm::EventSetup const&) = 0;
117 
120  EventSetup const& c,
121  ModuleCallingContext const*);
125  EventSetup const& c,
126  ModuleCallingContext const*);
128 
129  virtual void doBeginRun(RunPrincipal& rp, EventSetup const& c,
130  ModuleCallingContext const*)=0;
131  virtual void doEndRun(RunPrincipal& rp, EventSetup const& c,
132  ModuleCallingContext const*)=0;
134  ModuleCallingContext const*)=0;
135  virtual void doEndLuminosityBlock(LuminosityBlockPrincipal& lbp, EventSetup const& c,
136  ModuleCallingContext const*)=0;
137 
138  //For now, the following are just dummy implemenations with no ability for users to override
142  void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren);
143 
144  // ---------- member data --------------------------------
146  moduleDescription_ = md;
147  }
149 
150  std::vector<EDAnalyzerBase*> m_streamModules;
151  };
152  }
153 }
154 #endif
void registerProductsAndCallbacks(EDAnalyzerAdaptorBase const *, ProductRegistry *reg)
void doRespondToCloseInputFile(FileBlock const &fb)
std::vector< EDAnalyzerBase * > m_streamModules
void doStreamEndRun(StreamID id, RunPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
void doStreamBeginLuminosityBlock(StreamID id, LuminosityBlockPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
void doStreamEndLuminosityBlock(StreamID id, LuminosityBlockPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
const EDConsumerBase * consumer() const
void itemsMayGet(BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
void doPreallocate(PreallocationConfiguration const &)
void modulesDependentUpon(const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
bool doEvent(EventPrincipal &ep, EventSetup const &c, ActivityRegistry *, ModuleCallingContext const *)
virtual void setupLuminosityBlock(EDAnalyzerBase *, LuminosityBlockIndex)=0
BranchType
Definition: BranchType.h:11
void updateLookup(BranchType iBranchType, ProductHolderIndexHelper const &)
const EDAnalyzerAdaptorBase & operator=(const EDAnalyzerAdaptorBase &)
void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren)
void doStreamBeginRun(StreamID id, RunPrincipal &ep, EventSetup const &c, ModuleCallingContext const *)
virtual void doBeginRun(RunPrincipal &rp, EventSetup const &c, ModuleCallingContext const *)=0
virtual void doEndRun(RunPrincipal &rp, EventSetup const &c, ModuleCallingContext const *)=0
virtual void streamEndLuminosityBlockSummary(EDAnalyzerBase *, edm::LuminosityBlock const &, edm::EventSetup const &)=0
void setModuleDescription(ModuleDescription const &md)
virtual void setupRun(EDAnalyzerBase *, RunIndex)=0
virtual void doEndLuminosityBlock(LuminosityBlockPrincipal &lbp, EventSetup const &c, ModuleCallingContext const *)=0
const ModuleDescription & moduleDescription()
virtual void doBeginLuminosityBlock(LuminosityBlockPrincipal &lbp, EventSetup const &c, ModuleCallingContext const *)=0
virtual void streamEndRunSummary(EDAnalyzerBase *, edm::Run const &, edm::EventSetup const &)=0
long double T
std::vector< ProductHolderIndexAndSkipBit > const & itemsToGetFromEvent() const
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: Run.h:41
void itemsToGet(BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const