CMS 3D CMS Logo

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
38 
39 // forward declarations
40 
41 namespace edm {
42  class ModuleCallingContext;
43  class ProductResolverIndexHelper;
44  class EDConsumerBase;
45  class PreallocationConfiguration;
46  class ProductResolverIndexAndSkipBit;
47  class ActivityRegistry;
48  class ThinnedAssociationsHelper;
49  class WaitingTask;
50 
51  namespace maker {
52  template <typename T>
53  class ModuleHolderT;
54  }
55 
56  namespace eventsetup {
58  }
59 
60  namespace stream {
61  class EDAnalyzerBase;
62 
64  public:
65  template <typename T>
66  friend class edm::WorkerT;
67  template <typename T>
69 
71  EDAnalyzerAdaptorBase(const EDAnalyzerAdaptorBase&) = delete; // stop default
72  const EDAnalyzerAdaptorBase& operator=(const EDAnalyzerAdaptorBase&) = delete; // stop default
73  virtual ~EDAnalyzerAdaptorBase();
74 
75  // ---------- const member functions ---------------------
76 
77  // ---------- static member functions --------------------
78 
79  // ---------- member functions ---------------------------
81 
82  virtual bool wantsProcessBlocks() const = 0;
83  virtual bool wantsInputProcessBlocks() const = 0;
84  virtual bool wantsGlobalRuns() const = 0;
85  virtual bool wantsGlobalLuminosityBlocks() const = 0;
86  bool wantsStreamRuns() const { return true; }
87  bool wantsStreamLuminosityBlocks() const { return true; }
88 
89  std::string workerType() const { return "WorkerT<EDAnalyzerAdaptorBase>"; }
91 
92  protected:
93  template <typename T>
94  void createStreamModules(T iFunc) {
95  for (auto& m : m_streamModules) {
96  m = iFunc();
98  }
99  }
100 
101  //Same interface as EDConsumerBase
102  void itemsToGet(BranchType, std::vector<ProductResolverIndexAndSkipBit>&) const;
103  void itemsMayGet(BranchType, std::vector<ProductResolverIndexAndSkipBit>&) const;
104  std::vector<ProductResolverIndexAndSkipBit> const& itemsToGetFrom(BranchType) const;
105 
106  std::vector<ESProxyIndex> const& esGetTokenIndicesVector(edm::Transition iTrans) const;
107  std::vector<ESRecordIndex> const& esGetTokenRecordIndicesVector(edm::Transition iTrans) const;
108 
109  void updateLookup(BranchType iBranchType, ProductResolverIndexHelper const&, bool iPrefetchMayGet);
111 
112  const EDConsumerBase* consumer() const;
113 
114  void modulesWhoseProductsAreConsumed(std::vector<ModuleDescription const*>& modules,
115  ProductRegistry const& preg,
116  std::map<std::string, ModuleDescription const*> const& labelsToDesc,
117  std::string const& processName) const;
118 
120 
121  std::vector<ConsumesInfo> consumesInfo() const;
122 
123  private:
126  virtual void preallocLumis(unsigned int) {}
127 
128  //For now this is a placeholder
129  /*virtual*/ void preActionBeforeRunEventAsync(WaitingTask*, ModuleCallingContext const&, Principal const&) const {
130  }
131 
132  virtual void setupStreamModules() = 0;
133  virtual void doBeginJob() = 0;
134  virtual void doEndJob() = 0;
135 
136  void doBeginStream(StreamID id);
137  void doEndStream(StreamID id);
139  virtual void setupRun(EDAnalyzerBase*, RunIndex) = 0;
141  virtual void streamEndRunSummary(EDAnalyzerBase*, edm::Run const&, edm::EventSetup const&) = 0;
142 
147  edm::LuminosityBlock const&,
148  edm::EventSetup const&) = 0;
149 
150  virtual void doBeginProcessBlock(ProcessBlockPrincipal const&, ModuleCallingContext const*) = 0;
152  virtual void doEndProcessBlock(ProcessBlockPrincipal const&, ModuleCallingContext const*) = 0;
153  virtual void doBeginRun(RunTransitionInfo const&, ModuleCallingContext const*) = 0;
154  virtual void doEndRun(RunTransitionInfo const&, ModuleCallingContext const*) = 0;
155  virtual void doBeginLuminosityBlock(LumiTransitionInfo const&, ModuleCallingContext const*) = 0;
156  virtual void doEndLuminosityBlock(LumiTransitionInfo const&, ModuleCallingContext const*) = 0;
157 
158  //For now, the following are just dummy implemenations with no ability for users to override
162 
163  bool hasAcquire() const { return false; }
164  bool hasAccumulator() const { return false; }
165 
166  // ---------- member data --------------------------------
170 
171  std::vector<EDAnalyzerBase*> m_streamModules;
172  };
173  } // namespace stream
174 } // namespace edm
175 #endif
edm::stream::EDAnalyzerAdaptorBase::setupRun
virtual void setupRun(EDAnalyzerBase *, RunIndex)=0
edm::EventTransitionInfo
Definition: TransitionInfoTypes.h:26
edm::stream::EDAnalyzerAdaptorBase::doEndLuminosityBlock
virtual void doEndLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)=0
edm::StreamID
Definition: StreamID.h:30
edm::stream::EDAnalyzerAdaptorBase::setModuleDescriptionPtr
void setModuleDescriptionPtr(EDAnalyzerBase *m)
Definition: EDAnalyzerAdaptorBase.cc:220
edm::stream::EDAnalyzerAdaptorBase::itemsToGet
void itemsToGet(BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
Definition: EDAnalyzerAdaptorBase.cc:83
edm::eventsetup::ESRecordsToProxyIndices
Definition: ESRecordsToProxyIndices.h:35
edm::stream::EDAnalyzerAdaptorBase::doBeginStream
void doBeginStream(StreamID id)
Definition: EDAnalyzerAdaptorBase.cc:159
ActivityRegistry
edm::stream::EDAnalyzerAdaptorBase::consumesInfo
std::vector< ConsumesInfo > consumesInfo() const
Definition: EDAnalyzerAdaptorBase.cc:139
edm::LumiTransitionInfo
Definition: TransitionInfoTypes.h:42
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::stream::EDAnalyzerAdaptorBase::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDAnalyzerAdaptorBase.cc:218
edm::Run
Definition: Run.h:45
modules
Definition: ZHLTMatchFilter.cc:17
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::stream::EDAnalyzerAdaptorBase::doBeginLuminosityBlock
virtual void doBeginLuminosityBlock(LumiTransitionInfo const &, ModuleCallingContext const *)=0
edm::stream::EDAnalyzerAdaptorBase::doBeginJob
virtual void doBeginJob()=0
cms::cuda::stream
cudaStream_t stream
Definition: HistoContainer.h:57
edm::stream::EDAnalyzerAdaptorBase::doEndProcessBlock
virtual void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)=0
ProductResolverIndex.h
edm::stream::EDAnalyzerAdaptorBase::doEndStream
void doEndStream(StreamID id)
Definition: EDAnalyzerAdaptorBase.cc:160
edm::stream::EDAnalyzerAdaptorBase::~EDAnalyzerAdaptorBase
virtual ~EDAnalyzerAdaptorBase()
Definition: EDAnalyzerAdaptorBase.cc:50
edm::Principal
Definition: Principal.h:57
edm::stream::EDAnalyzerAdaptorBase::streamEndLuminosityBlockSummary
virtual void streamEndLuminosityBlockSummary(EDAnalyzerBase *, edm::LuminosityBlock const &, edm::EventSetup const &)=0
edm::WorkerT
Definition: Frameworkfwd.h:62
edm::ProductResolverIndexHelper
Definition: ProductResolverIndexHelper.h:89
edm::stream::EDAnalyzerAdaptorBase::operator=
const EDAnalyzerAdaptorBase & operator=(const EDAnalyzerAdaptorBase &)=delete
edm::RunTransitionInfo
Definition: TransitionInfoTypes.h:64
edm::stream::EDAnalyzerAdaptorBase::doStreamEndLuminosityBlock
void doStreamEndLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerAdaptorBase.cc:203
edm::stream::EDAnalyzerAdaptorBase::doBeginRun
virtual void doBeginRun(RunTransitionInfo const &, ModuleCallingContext const *)=0
ESIndices.h
edm::ProcessBlockPrincipal
Definition: ProcessBlockPrincipal.h:22
edm::BranchType
BranchType
Definition: BranchType.h:11
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::ProductRegistry
Definition: ProductRegistry.h:37
ModuleDescription.h
edm::FileBlock
Definition: FileBlock.h:20
edm::stream::EDAnalyzerAdaptorBase::preActionBeforeRunEventAsync
void preActionBeforeRunEventAsync(WaitingTask *, ModuleCallingContext const &, Principal const &) const
Definition: EDAnalyzerAdaptorBase.h:129
edm::EDConsumerBase
Definition: EDConsumerBase.h:70
edm::LuminosityBlockIndex
Definition: LuminosityBlockIndex.h:33
edm::stream::EDAnalyzerAdaptorBase::doStreamBeginLuminosityBlock
void doStreamBeginLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerAdaptorBase.cc:188
WaitingTask
edm::stream::EDAnalyzerAdaptorBase::modulesWhoseProductsAreConsumed
void modulesWhoseProductsAreConsumed(std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
Definition: EDAnalyzerAdaptorBase.cc:124
edm::stream::EDAnalyzerAdaptorBase::createStreamModules
void createStreamModules(T iFunc)
Definition: EDAnalyzerAdaptorBase.h:94
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
edm::ActivityRegistry
Definition: ActivityRegistry.h:133
edm::stream::EDAnalyzerAdaptorBase::setupStreamModules
virtual void setupStreamModules()=0
edm::stream::EDAnalyzerAdaptorBase::doRegisterThinnedAssociations
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
Definition: EDAnalyzerAdaptorBase.h:161
edm::stream::EDAnalyzerAdaptorBase::doBeginProcessBlock
virtual void doBeginProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)=0
edm::stream::EDAnalyzerAdaptorBase::doStreamEndRun
void doStreamEndRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerAdaptorBase.cc:176
edm::maker::ModuleHolderT
Definition: EDAnalyzer.h:25
Transition.h
edm::stream::EDAnalyzerAdaptorBase::workerType
std::string workerType() const
Definition: EDAnalyzerAdaptorBase.h:89
RunIndex.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::stream::EDAnalyzerAdaptorBase::wantsGlobalLuminosityBlocks
virtual bool wantsGlobalLuminosityBlocks() const =0
edm::stream::EDAnalyzerAdaptorBase::streamEndRunSummary
virtual void streamEndRunSummary(EDAnalyzerBase *, edm::Run const &, edm::EventSetup const &)=0
edm::stream::EDAnalyzerAdaptorBase::registerProductsAndCallbacks
void registerProductsAndCallbacks(EDAnalyzerAdaptorBase const *, ProductRegistry *reg)
Definition: EDAnalyzerAdaptorBase.cc:77
edm::stream::EDAnalyzerAdaptorBase::hasAcquire
bool hasAcquire() const
Definition: EDAnalyzerAdaptorBase.h:163
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:37
edm::Transition
Transition
Definition: Transition.h:12
edm::stream::EDAnalyzerAdaptorBase::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &fb)
Definition: EDAnalyzerAdaptorBase.cc:217
edm::stream::EDAnalyzerAdaptorBase::wantsStreamRuns
bool wantsStreamRuns() const
Definition: EDAnalyzerAdaptorBase.h:86
ESRecordsToProxyIndices
edm::stream::EDAnalyzerAdaptorBase::updateLookup
void updateLookup(BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
Definition: EDAnalyzerAdaptorBase.cc:108
edm::stream::EDAnalyzerAdaptorBase::hasAccumulator
bool hasAccumulator() const
Definition: EDAnalyzerAdaptorBase.h:164
BranchType.h
edm::stream::EDAnalyzerAdaptorBase
Definition: EDAnalyzerAdaptorBase.h:63
edm::stream::EDAnalyzerAdaptorBase::setModuleDescription
void setModuleDescription(ModuleDescription const &md)
Definition: EDAnalyzerAdaptorBase.h:168
edm::stream::EDAnalyzerAdaptorBase::doEndJob
virtual void doEndJob()=0
edm::stream::EDAnalyzerAdaptorBase::EDAnalyzerAdaptorBase
EDAnalyzerAdaptorBase()
Definition: EDAnalyzerAdaptorBase.cc:43
edm::EventSetup
Definition: EventSetup.h:57
edm::stream::EDAnalyzerAdaptorBase::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDAnalyzerAdaptorBase.cc:71
edm::stream::EDAnalyzerAdaptorBase::wantsProcessBlocks
virtual bool wantsProcessBlocks() const =0
SimL1EmulatorRepack_CalouGT_cff.processName
processName
Definition: SimL1EmulatorRepack_CalouGT_cff.py:17
edm::stream::EDAnalyzerAdaptorBase::doStreamBeginRun
void doStreamBeginRun(StreamID, RunTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerAdaptorBase.cc:162
edm::stream::EDAnalyzerAdaptorBase::m_streamModules
std::vector< EDAnalyzerBase * > m_streamModules
Definition: EDAnalyzerAdaptorBase.h:171
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
edm::WaitingTask
Definition: WaitingTask.h:36
edm::stream::EDAnalyzerBase
Definition: EDAnalyzerBase.h:35
Frameworkfwd.h
T
long double T
Definition: Basic3DVectorLD.h:48
edm::stream::EDAnalyzerAdaptorBase::wantsInputProcessBlocks
virtual bool wantsInputProcessBlocks() const =0
edm::stream::EDAnalyzerAdaptorBase::preallocLumis
virtual void preallocLumis(unsigned int)
Definition: EDAnalyzerAdaptorBase.h:126
ParameterSetfwd.h
edm::stream::EDAnalyzerAdaptorBase::esGetTokenRecordIndicesVector
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector(edm::Transition iTrans) const
Definition: EDAnalyzerAdaptorBase.cc:102
edm::RunIndex
Definition: RunIndex.h:32
LuminosityBlockIndex.h
edm::stream::EDAnalyzerAdaptorBase::itemsMayGet
void itemsMayGet(BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
Definition: EDAnalyzerAdaptorBase.cc:87
edm::stream::EDAnalyzerAdaptorBase::doEndRun
virtual void doEndRun(RunTransitionInfo const &, ModuleCallingContext const *)=0
edm::stream::EDAnalyzerAdaptorBase::doAccessInputProcessBlock
virtual void doAccessInputProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)=0
edm::stream::EDAnalyzerAdaptorBase::itemsToGetFrom
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom(BranchType) const
Definition: EDAnalyzerAdaptorBase.cc:92
edm::stream::EDAnalyzerAdaptorBase::doEvent
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDAnalyzerAdaptorBase.cc:144
edm::stream::EDAnalyzerAdaptorBase::setupLuminosityBlock
virtual void setupLuminosityBlock(EDAnalyzerBase *, LuminosityBlockIndex)=0
ConsumesInfo.h
edm::stream::EDAnalyzerAdaptorBase::convertCurrentProcessAlias
void convertCurrentProcessAlias(std::string const &processName)
Definition: EDAnalyzerAdaptorBase.cc:133
StreamID.h
edm::stream::EDAnalyzerAdaptorBase::consumer
const EDConsumerBase * consumer() const
Definition: EDAnalyzerAdaptorBase.cc:122
edm::stream::EDAnalyzerAdaptorBase::moduleDescription
const ModuleDescription & moduleDescription() const
Definition: EDAnalyzerAdaptorBase.h:80
benchmark_cfg.fb
fb
Definition: benchmark_cfg.py:14
edm::stream::EDAnalyzerAdaptorBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDAnalyzerAdaptorBase.h:169
edm::stream::EDAnalyzerAdaptorBase::esGetTokenIndicesVector
std::vector< ESProxyIndex > const & esGetTokenIndicesVector(edm::Transition iTrans) const
Definition: EDAnalyzerAdaptorBase.cc:97
EDAnalyzerBase
edm::stream::EDAnalyzerAdaptorBase::wantsGlobalRuns
virtual bool wantsGlobalRuns() const =0
edm::stream::EDAnalyzerAdaptorBase::wantsStreamLuminosityBlocks
bool wantsStreamLuminosityBlocks() const
Definition: EDAnalyzerAdaptorBase.h:87
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29