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
39 
40 // forward declarations
41 
42 namespace edm {
43  class ModuleCallingContext;
44  class ModuleProcessName;
45  class ProductResolverIndexHelper;
46  class EDConsumerBase;
47  class PreallocationConfiguration;
48  class ProductResolverIndexAndSkipBit;
49  class ActivityRegistry;
50  class ThinnedAssociationsHelper;
51 
52  namespace maker {
53  template <typename T>
54  class ModuleHolderT;
55  }
56 
57  namespace eventsetup {
59  }
60 
61  namespace stream {
62  class EDAnalyzerBase;
63 
65  public:
66  template <typename T>
67  friend class edm::WorkerT;
68  template <typename T>
70 
72  EDAnalyzerAdaptorBase(const EDAnalyzerAdaptorBase&) = delete; // stop default
73  const EDAnalyzerAdaptorBase& operator=(const EDAnalyzerAdaptorBase&) = delete; // stop default
74  virtual ~EDAnalyzerAdaptorBase();
75 
76  // ---------- const member functions ---------------------
77 
78  // ---------- static member functions --------------------
79 
80  // ---------- member functions ---------------------------
82 
83  virtual bool wantsProcessBlocks() const = 0;
84  virtual bool wantsInputProcessBlocks() const = 0;
85  virtual bool wantsGlobalRuns() const = 0;
86  virtual bool wantsGlobalLuminosityBlocks() const = 0;
87  bool wantsStreamRuns() const { return true; }
88  bool wantsStreamLuminosityBlocks() const { return true; }
89 
90  std::string workerType() const { return "WorkerT<EDAnalyzerAdaptorBase>"; }
92 
93  protected:
94  template <typename T>
95  void createStreamModules(T iFunc) {
96  for (auto& m : m_streamModules) {
97  m = iFunc();
99  }
100  }
101 
102  //Same interface as EDConsumerBase
103  void itemsToGet(BranchType, std::vector<ProductResolverIndexAndSkipBit>&) const;
104  void itemsMayGet(BranchType, std::vector<ProductResolverIndexAndSkipBit>&) const;
105  std::vector<ProductResolverIndexAndSkipBit> const& itemsToGetFrom(BranchType) const;
106 
107  std::vector<ESProxyIndex> const& esGetTokenIndicesVector(edm::Transition iTrans) const;
108  std::vector<ESRecordIndex> const& esGetTokenRecordIndicesVector(edm::Transition iTrans) const;
109 
110  void updateLookup(BranchType iBranchType, ProductResolverIndexHelper const&, bool iPrefetchMayGet);
112 
113  const EDConsumerBase* consumer() const;
114 
115  void modulesWhoseProductsAreConsumed(std::array<std::vector<ModuleDescription const*>*, NumBranchTypes>& modules,
116  std::vector<ModuleProcessName>& modulesInPreviousProcesses,
117  ProductRegistry const& preg,
118  std::map<std::string, ModuleDescription const*> const& labelsToDesc,
119  std::string const& processName) const;
120 
122 
123  std::vector<ConsumesInfo> consumesInfo() const;
124 
125  private:
128  virtual void preallocLumis(unsigned int) {}
129 
130  //For now this is a placeholder
132  ModuleCallingContext const&,
133  Principal const&) const {}
134 
135  virtual void setupStreamModules() = 0;
136  virtual void doBeginJob() = 0;
137  virtual void doEndJob() = 0;
138 
139  void doBeginStream(StreamID id);
140  void doEndStream(StreamID id);
142  virtual void setupRun(EDAnalyzerBase*, RunIndex) = 0;
144  virtual void streamEndRunSummary(EDAnalyzerBase*, edm::Run const&, edm::EventSetup const&) = 0;
145 
150  edm::LuminosityBlock const&,
151  edm::EventSetup const&) = 0;
152 
153  virtual void doBeginProcessBlock(ProcessBlockPrincipal const&, ModuleCallingContext const*) = 0;
155  virtual void doEndProcessBlock(ProcessBlockPrincipal const&, ModuleCallingContext const*) = 0;
156  virtual void doBeginRun(RunTransitionInfo const&, ModuleCallingContext const*) = 0;
157  virtual void doEndRun(RunTransitionInfo const&, ModuleCallingContext const*) = 0;
158  virtual void doBeginLuminosityBlock(LumiTransitionInfo const&, ModuleCallingContext const*) = 0;
159  virtual void doEndLuminosityBlock(LumiTransitionInfo const&, ModuleCallingContext const*) = 0;
160 
161  //For now, the following are just dummy implemenations with no ability for users to override
165 
166  bool hasAcquire() const { return false; }
167  bool hasAccumulator() const { return false; }
168 
169  // ---------- member data --------------------------------
173 
174  std::vector<EDAnalyzerBase*> m_streamModules;
175  };
176  } // namespace stream
177 } // namespace edm
178 #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:233
edm::stream::EDAnalyzerAdaptorBase::itemsToGet
void itemsToGet(BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
Definition: EDAnalyzerAdaptorBase.cc:84
edm::eventsetup::ESRecordsToProxyIndices
Definition: ESRecordsToProxyIndices.h:35
edm::stream::EDAnalyzerAdaptorBase::doBeginStream
void doBeginStream(StreamID id)
Definition: EDAnalyzerAdaptorBase.cc:163
ActivityRegistry
edm::stream::EDAnalyzerAdaptorBase::consumesInfo
std::vector< ConsumesInfo > consumesInfo() const
Definition: EDAnalyzerAdaptorBase.cc:142
edm::LumiTransitionInfo
Definition: TransitionInfoTypes.h:42
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
edm::stream::EDAnalyzerAdaptorBase::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &fb)
Definition: EDAnalyzerAdaptorBase.cc:231
edm::Run
Definition: Run.h:45
WaitingTaskHolder.h
modules
Definition: MuonCleanerBySegments.cc:35
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:164
edm::stream::EDAnalyzerAdaptorBase::~EDAnalyzerAdaptorBase
virtual ~EDAnalyzerAdaptorBase()
Definition: EDAnalyzerAdaptorBase.cc:51
edm::Principal
Definition: Principal.h:56
edm::stream::EDAnalyzerAdaptorBase::streamEndLuminosityBlockSummary
virtual void streamEndLuminosityBlockSummary(EDAnalyzerBase *, edm::LuminosityBlock const &, edm::EventSetup const &)=0
mps_check.array
array
Definition: mps_check.py:216
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:214
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::NumBranchTypes
Definition: BranchType.h:11
edm::ProductRegistry
Definition: ProductRegistry.h:37
ModuleDescription.h
edm::FileBlock
Definition: FileBlock.h:20
edm::EDConsumerBase
Definition: EDConsumerBase.h:71
edm::stream::EDAnalyzerAdaptorBase::modulesWhoseProductsAreConsumed
void modulesWhoseProductsAreConsumed(std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modules, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
Definition: EDAnalyzerAdaptorBase.cc:125
edm::LuminosityBlockIndex
Definition: LuminosityBlockIndex.h:33
edm::stream::EDAnalyzerAdaptorBase::doStreamBeginLuminosityBlock
void doStreamBeginLuminosityBlock(StreamID, LumiTransitionInfo const &, ModuleCallingContext const *)
Definition: EDAnalyzerAdaptorBase.cc:197
edm::stream::EDAnalyzerAdaptorBase::createStreamModules
void createStreamModules(T iFunc)
Definition: EDAnalyzerAdaptorBase.h:95
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
edm::ActivityRegistry
Definition: ActivityRegistry.h:134
edm::stream::EDAnalyzerAdaptorBase::setupStreamModules
virtual void setupStreamModules()=0
edm::stream::EDAnalyzerAdaptorBase::doRegisterThinnedAssociations
void doRegisterThinnedAssociations(ProductRegistry const &, ThinnedAssociationsHelper &)
Definition: EDAnalyzerAdaptorBase.h:164
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:184
edm::maker::ModuleHolderT
Definition: EDAnalyzer.h:25
Transition.h
edm::stream::EDAnalyzerAdaptorBase::workerType
std::string workerType() const
Definition: EDAnalyzerAdaptorBase.h:90
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:78
edm::stream::EDAnalyzerAdaptorBase::hasAcquire
bool hasAcquire() const
Definition: EDAnalyzerAdaptorBase.h:166
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:230
edm::WaitingTaskHolder
Definition: WaitingTaskHolder.h:32
edm::stream::EDAnalyzerAdaptorBase::wantsStreamRuns
bool wantsStreamRuns() const
Definition: EDAnalyzerAdaptorBase.h:87
ESRecordsToProxyIndices
edm::stream::EDAnalyzerAdaptorBase::updateLookup
void updateLookup(BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
Definition: EDAnalyzerAdaptorBase.cc:109
edm::stream::EDAnalyzerAdaptorBase::hasAccumulator
bool hasAccumulator() const
Definition: EDAnalyzerAdaptorBase.h:167
BranchType.h
edm::stream::EDAnalyzerAdaptorBase
Definition: EDAnalyzerAdaptorBase.h:64
edm::stream::EDAnalyzerAdaptorBase::setModuleDescription
void setModuleDescription(ModuleDescription const &md)
Definition: EDAnalyzerAdaptorBase.h:171
edm::stream::EDAnalyzerAdaptorBase::doEndJob
virtual void doEndJob()=0
edm::stream::EDAnalyzerAdaptorBase::EDAnalyzerAdaptorBase
EDAnalyzerAdaptorBase()
Definition: EDAnalyzerAdaptorBase.cc:44
edm::EventSetup
Definition: EventSetup.h:58
edm::stream::EDAnalyzerAdaptorBase::doPreallocate
void doPreallocate(PreallocationConfiguration const &)
Definition: EDAnalyzerAdaptorBase.cc:72
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:166
edm::stream::EDAnalyzerAdaptorBase::m_streamModules
std::vector< EDAnalyzerBase * > m_streamModules
Definition: EDAnalyzerAdaptorBase.h:174
edm::PreallocationConfiguration
Definition: PreallocationConfiguration.h:27
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:128
ParameterSetfwd.h
edm::stream::EDAnalyzerAdaptorBase::preActionBeforeRunEventAsync
void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const &, Principal const &) const
Definition: EDAnalyzerAdaptorBase.h:131
edm::stream::EDAnalyzerAdaptorBase::esGetTokenRecordIndicesVector
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector(edm::Transition iTrans) const
Definition: EDAnalyzerAdaptorBase.cc:103
edm::RunIndex
Definition: RunIndex.h:32
LuminosityBlockIndex.h
edm::stream::EDAnalyzerAdaptorBase::itemsMayGet
void itemsMayGet(BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
Definition: EDAnalyzerAdaptorBase.cc:88
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:93
edm::stream::EDAnalyzerAdaptorBase::doEvent
bool doEvent(EventTransitionInfo const &, ActivityRegistry *, ModuleCallingContext const *)
Definition: EDAnalyzerAdaptorBase.cc:147
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:136
StreamID.h
edm::stream::EDAnalyzerAdaptorBase::consumer
const EDConsumerBase * consumer() const
Definition: EDAnalyzerAdaptorBase.cc:123
edm::stream::EDAnalyzerAdaptorBase::moduleDescription
const ModuleDescription & moduleDescription() const
Definition: EDAnalyzerAdaptorBase.h:81
benchmark_cfg.fb
fb
Definition: benchmark_cfg.py:14
edm::stream::EDAnalyzerAdaptorBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDAnalyzerAdaptorBase.h:172
edm::stream::EDAnalyzerAdaptorBase::esGetTokenIndicesVector
std::vector< ESProxyIndex > const & esGetTokenIndicesVector(edm::Transition iTrans) const
Definition: EDAnalyzerAdaptorBase.cc:98
EDAnalyzerBase
edm::stream::EDAnalyzerAdaptorBase::wantsGlobalRuns
virtual bool wantsGlobalRuns() const =0
edm::stream::EDAnalyzerAdaptorBase::wantsStreamLuminosityBlocks
bool wantsStreamLuminosityBlocks() const
Definition: EDAnalyzerAdaptorBase.h:88
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29