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 
44  namespace maker {
45  template<typename T> class ModuleHolderT;
46  }
47 
48  namespace stream {
49  class EDAnalyzerBase;
50 
52  {
53 
54  public:
55  template <typename T> friend class edm::WorkerT;
56  template <typename T> friend class edm::maker::ModuleHolderT;
57 
59  virtual ~EDAnalyzerAdaptorBase();
60 
61  // ---------- const member functions ---------------------
62 
63  // ---------- static member functions --------------------
64 
65  // ---------- member functions ---------------------------
67 
68  std::string workerType() const { return "WorkerT<EDAnalyzerAdaptorBase>";}
69  void
71  protected:
72  template<typename T> void createStreamModules(T iFunc) {
73  for(auto& m: m_streamModules) {
74  m = iFunc();
75  }
76  }
77 
78  //Same interface as EDConsumerBase
79  void itemsToGet(BranchType, std::vector<ProductHolderIndexAndSkipBit>&) const;
80  void itemsMayGet(BranchType, std::vector<ProductHolderIndexAndSkipBit>&) const;
81  std::vector<ProductHolderIndexAndSkipBit> const& itemsToGetFromEvent() const;
82 
83  void updateLookup(BranchType iBranchType,
85 
86  const EDConsumerBase* consumer() const;
87  private:
88  EDAnalyzerAdaptorBase(const EDAnalyzerAdaptorBase&); // stop default
89 
90  const EDAnalyzerAdaptorBase& operator=(const EDAnalyzerAdaptorBase&); // stop default
91 
92  bool doEvent(EventPrincipal& ep, EventSetup const& c,
93  ModuleCallingContext const*) ;
95 
96  virtual void setupStreamModules() = 0;
97  void doBeginJob();
98  virtual void doEndJob() = 0;
99 
100  void doBeginStream(StreamID id);
101  void doEndStream(StreamID id);
102  void doStreamBeginRun(StreamID id,
103  RunPrincipal& ep,
104  EventSetup const& c,
105  ModuleCallingContext const*);
106  virtual void setupRun(EDAnalyzerBase*, RunIndex) = 0;
107  void doStreamEndRun(StreamID id,
108  RunPrincipal& ep,
109  EventSetup const& c,
110  ModuleCallingContext const*);
111  virtual void streamEndRunSummary(EDAnalyzerBase*,edm::Run const&, edm::EventSetup const&) = 0;
112 
115  EventSetup const& c,
116  ModuleCallingContext const*);
120  EventSetup const& c,
121  ModuleCallingContext const*);
123 
124  virtual void doBeginRun(RunPrincipal& rp, EventSetup const& c,
125  ModuleCallingContext const*)=0;
126  virtual void doEndRun(RunPrincipal& rp, EventSetup const& c,
127  ModuleCallingContext const*)=0;
129  ModuleCallingContext const*)=0;
130  virtual void doEndLuminosityBlock(LuminosityBlockPrincipal& lbp, EventSetup const& c,
131  ModuleCallingContext const*)=0;
132 
133  //For now, the following are just dummy implemenations with no ability for users to override
137  void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren);
138 
139  // ---------- member data --------------------------------
141  moduleDescription_ = md;
142  }
144 
145  std::vector<EDAnalyzerBase*> m_streamModules;
146  };
147  }
148 }
149 #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 &)
bool doEvent(EventPrincipal &ep, EventSetup const &c, 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