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 <map>
23 #include <string>
24 #include <vector>
25 
26 // user include files
36 
37 
38 // forward declarations
39 
40 namespace edm {
41  class ModuleCallingContext;
42  class ProductHolderIndexHelper;
43  class EDConsumerBase;
44  class PreallocationConfiguration;
45  class ProductHolderIndexAndSkipBit;
46  class ActivityRegistry;
47  class ProductRegistry;
48  class ThinnedAssociationsHelper;
49 
50  namespace maker {
51  template<typename T> class ModuleHolderT;
52  }
53 
54  namespace stream {
55  class EDAnalyzerBase;
56 
58  {
59 
60  public:
61  template <typename T> friend class edm::WorkerT;
62  template <typename T> friend class edm::maker::ModuleHolderT;
63 
65  virtual ~EDAnalyzerAdaptorBase();
66 
67  // ---------- const member functions ---------------------
68 
69  // ---------- static member functions --------------------
70 
71  // ---------- member functions ---------------------------
73 
74  std::string workerType() const { return "WorkerT<EDAnalyzerAdaptorBase>";}
75  void
77  protected:
78  template<typename T> void createStreamModules(T iFunc) {
79  for(auto& m: m_streamModules) {
80  m = iFunc();
82  }
83  }
84 
85  //Same interface as EDConsumerBase
86  void itemsToGet(BranchType, std::vector<ProductHolderIndexAndSkipBit>&) const;
87  void itemsMayGet(BranchType, std::vector<ProductHolderIndexAndSkipBit>&) const;
88  std::vector<ProductHolderIndexAndSkipBit> const& itemsToGetFromEvent() const;
89 
90  void updateLookup(BranchType iBranchType,
92 
93  const EDConsumerBase* consumer() const;
94 
95  void modulesDependentUpon(const std::string& iProcessName,
96  std::vector<const char*>& oModuleLabels) const;
97 
98  void modulesWhoseProductsAreConsumed(std::vector<ModuleDescription const*>& modules,
99  ProductRegistry const& preg,
100  std::map<std::string, ModuleDescription const*> const& labelsToDesc,
101  std::string const& processName) const;
102 
103  std::vector<ConsumesInfo> consumesInfo() const;
104 
105  private:
106  EDAnalyzerAdaptorBase(const EDAnalyzerAdaptorBase&); // stop default
107 
108  const EDAnalyzerAdaptorBase& operator=(const EDAnalyzerAdaptorBase&); // stop default
109 
110  bool doEvent(EventPrincipal& ep, EventSetup const& c,
112  ModuleCallingContext const*) ;
114 
115  virtual void setupStreamModules() = 0;
116  void doBeginJob();
117  virtual void doEndJob() = 0;
118 
119  void doBeginStream(StreamID id);
120  void doEndStream(StreamID id);
121  void doStreamBeginRun(StreamID id,
122  RunPrincipal& ep,
123  EventSetup const& c,
124  ModuleCallingContext const*);
125  virtual void setupRun(EDAnalyzerBase*, RunIndex) = 0;
126  void doStreamEndRun(StreamID id,
127  RunPrincipal& ep,
128  EventSetup const& c,
129  ModuleCallingContext const*);
130  virtual void streamEndRunSummary(EDAnalyzerBase*,edm::Run const&, edm::EventSetup const&) = 0;
131 
134  EventSetup const& c,
135  ModuleCallingContext const*);
139  EventSetup const& c,
140  ModuleCallingContext const*);
142 
143  virtual void doBeginRun(RunPrincipal& rp, EventSetup const& c,
144  ModuleCallingContext const*)=0;
145  virtual void doEndRun(RunPrincipal& rp, EventSetup const& c,
146  ModuleCallingContext const*)=0;
148  ModuleCallingContext const*)=0;
149  virtual void doEndLuminosityBlock(LuminosityBlockPrincipal& lbp, EventSetup const& c,
150  ModuleCallingContext const*)=0;
151 
153  void doPostForkReacquireResources(unsigned int iChildIndex, unsigned int iNumberOfChildren);
154 
155  //For now, the following are just dummy implemenations with no ability for users to override
160 
161  // ---------- member data --------------------------------
165  }
167 
168  std::vector<EDAnalyzerBase*> m_streamModules;
169  };
170  }
171 }
172 #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
std::vector< ConsumesInfo > consumesInfo() const
bool doEvent(EventPrincipal &ep, EventSetup const &c, ActivityRegistry *, ModuleCallingContext const *)
virtual void setupLuminosityBlock(EDAnalyzerBase *, LuminosityBlockIndex)=0
BranchType
Definition: BranchType.h:11
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
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
void modulesWhoseProductsAreConsumed(std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
virtual void streamEndRunSummary(EDAnalyzerBase *, edm::Run const &, edm::EventSetup const &)=0
preg
Definition: Schedule.cc:370
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
void setModuleDescriptionPtr(EDAnalyzerBase *m)