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
40 
41 // forward declarations
42 
43 namespace edm {
44  class ModuleCallingContext;
45  class ModuleProcessName;
46  class ProductResolverIndexHelper;
47  class EDConsumerBase;
48  class PreallocationConfiguration;
49  class ProductResolverIndexAndSkipBit;
50  class ActivityRegistry;
51  class ThinnedAssociationsHelper;
52 
53  namespace maker {
54  template <typename T>
55  class ModuleHolderT;
56  }
57 
58  namespace eventsetup {
60  }
61 
62  namespace stream {
63  class EDAnalyzerBase;
64 
66  public:
67  template <typename T>
68  friend class edm::WorkerT;
69  template <typename T>
71 
73  EDAnalyzerAdaptorBase(const EDAnalyzerAdaptorBase&) = delete; // stop default
74  const EDAnalyzerAdaptorBase& operator=(const EDAnalyzerAdaptorBase&) = delete; // stop default
75  virtual ~EDAnalyzerAdaptorBase();
76 
77  // ---------- const member functions ---------------------
78 
79  // ---------- static member functions --------------------
80 
81  // ---------- member functions ---------------------------
83 
84  virtual bool wantsProcessBlocks() const = 0;
85  virtual bool wantsInputProcessBlocks() const = 0;
86  virtual bool wantsGlobalRuns() const = 0;
87  virtual bool wantsGlobalLuminosityBlocks() const = 0;
88  bool wantsStreamRuns() const { return true; }
89  bool wantsStreamLuminosityBlocks() const { return true; }
90 
91  std::string workerType() const { return "WorkerT<EDAnalyzerAdaptorBase>"; }
93 
94  protected:
95  template <typename T>
96  void createStreamModules(T iFunc) {
97  unsigned int iStreamModule = 0;
98  for (auto& m : m_streamModules) {
99  m = iFunc(iStreamModule);
101  ++iStreamModule;
102  }
103  }
104 
105  //Same interface as EDConsumerBase
106  void itemsToGet(BranchType, std::vector<ProductResolverIndexAndSkipBit>&) const;
107  void itemsMayGet(BranchType, std::vector<ProductResolverIndexAndSkipBit>&) const;
108  std::vector<ProductResolverIndexAndSkipBit> const& itemsToGetFrom(BranchType) const;
109 
110  std::vector<ESProxyIndex> const& esGetTokenIndicesVector(edm::Transition iTrans) const;
111  std::vector<ESRecordIndex> const& esGetTokenRecordIndicesVector(edm::Transition iTrans) const;
112 
113  void updateLookup(BranchType iBranchType, ProductResolverIndexHelper const&, bool iPrefetchMayGet);
115  virtual void selectInputProcessBlocks(ProductRegistry const&, ProcessBlockHelperBase const&) = 0;
116 
117  const EDConsumerBase* consumer() const;
118 
119  void modulesWhoseProductsAreConsumed(std::array<std::vector<ModuleDescription const*>*, NumBranchTypes>& modules,
120  std::vector<ModuleProcessName>& modulesInPreviousProcesses,
121  ProductRegistry const& preg,
122  std::map<std::string, ModuleDescription const*> const& labelsToDesc,
123  std::string const& processName) const;
124 
126 
127  std::vector<ConsumesInfo> consumesInfo() const;
128 
129  private:
132  virtual void preallocLumis(unsigned int) {}
133 
134  //For now this is a placeholder
136  ModuleCallingContext const&,
137  Principal const&) const {}
138 
139  virtual void setupStreamModules() = 0;
140  virtual void doBeginJob() = 0;
141  virtual void doEndJob() = 0;
142 
143  void doBeginStream(StreamID id);
144  void doEndStream(StreamID id);
146  virtual void setupRun(EDAnalyzerBase*, RunIndex) = 0;
148  virtual void streamEndRunSummary(EDAnalyzerBase*, edm::Run const&, edm::EventSetup const&) = 0;
149 
154  edm::LuminosityBlock const&,
155  edm::EventSetup const&) = 0;
156 
157  virtual void doBeginProcessBlock(ProcessBlockPrincipal const&, ModuleCallingContext const*) = 0;
159  virtual void doEndProcessBlock(ProcessBlockPrincipal const&, ModuleCallingContext const*) = 0;
160  virtual void doBeginRun(RunTransitionInfo const&, ModuleCallingContext const*) = 0;
161  virtual void doEndRun(RunTransitionInfo const&, ModuleCallingContext const*) = 0;
162  virtual void doBeginLuminosityBlock(LumiTransitionInfo const&, ModuleCallingContext const*) = 0;
163  virtual void doEndLuminosityBlock(LumiTransitionInfo const&, ModuleCallingContext const*) = 0;
164 
167  virtual void doRespondToCloseOutputFile() = 0;
169 
170  bool hasAcquire() const { return false; }
171  bool hasAccumulator() const { return false; }
172 
173  // ---------- member data --------------------------------
177 
178  std::vector<EDAnalyzerBase*> m_streamModules;
179  };
180  } // namespace stream
181 } // namespace edm
182 #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:230
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::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
edm::stream::EDAnalyzerAdaptorBase::doEndProcessBlock
virtual void doEndProcessBlock(ProcessBlockPrincipal const &, ModuleCallingContext const *)=0
ProductResolverIndex.h
cms::cuda::stream
uint32_t const T *__restrict__ const uint32_t *__restrict__ int32_t int Histo::index_type cudaStream_t stream
Definition: HistoContainer.h:51
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:63
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::stream::EDAnalyzerAdaptorBase::selectInputProcessBlocks
virtual void selectInputProcessBlocks(ProductRegistry const &, ProcessBlockHelperBase const &)=0
edm::ProductRegistry
Definition: ProductRegistry.h:37
ModuleDescription.h
edm::FileBlock
Definition: FileBlock.h:22
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:96
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:79
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:168
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:91
RunIndex.h
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:170
edm::ThinnedAssociationsHelper
Definition: ThinnedAssociationsHelper.h:37
edm::ProcessBlockHelperBase
Definition: ProcessBlockHelperBase.h:18
edm::Transition
Transition
Definition: Transition.h:12
edm::WaitingTaskHolder
Definition: WaitingTaskHolder.h:32
edm::stream::EDAnalyzerAdaptorBase::doRespondToOpenInputFile
void doRespondToOpenInputFile(FileBlock const &)
Definition: EDAnalyzerAdaptorBase.h:165
edm::stream::EDAnalyzerAdaptorBase::wantsStreamRuns
bool wantsStreamRuns() const
Definition: EDAnalyzerAdaptorBase.h:88
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:171
BranchType.h
edm::stream::EDAnalyzerAdaptorBase
Definition: EDAnalyzerAdaptorBase.h:65
edm::stream::EDAnalyzerAdaptorBase::setModuleDescription
void setModuleDescription(ModuleDescription const &md)
Definition: EDAnalyzerAdaptorBase.h:175
edm::stream::EDAnalyzerAdaptorBase::doEndJob
virtual void doEndJob()=0
edm::stream::EDAnalyzerAdaptorBase::EDAnalyzerAdaptorBase
EDAnalyzerAdaptorBase()
Definition: EDAnalyzerAdaptorBase.cc:44
edm::EventSetup
Definition: EventSetup.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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:178
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::doRespondToCloseInputFile
void doRespondToCloseInputFile(FileBlock const &)
Definition: EDAnalyzerAdaptorBase.h:166
edm::stream::EDAnalyzerAdaptorBase::wantsInputProcessBlocks
virtual bool wantsInputProcessBlocks() const =0
edm::stream::EDAnalyzerAdaptorBase::preallocLumis
virtual void preallocLumis(unsigned int)
Definition: EDAnalyzerAdaptorBase.h:132
ParameterSetfwd.h
edm::stream::EDAnalyzerAdaptorBase::preActionBeforeRunEventAsync
void preActionBeforeRunEventAsync(WaitingTaskHolder, ModuleCallingContext const &, Principal const &) const
Definition: EDAnalyzerAdaptorBase.h:135
edm::stream::EDAnalyzerAdaptorBase::doRespondToCloseOutputFile
virtual void doRespondToCloseOutputFile()=0
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:82
edm::stream::EDAnalyzerAdaptorBase::moduleDescription_
ModuleDescription moduleDescription_
Definition: EDAnalyzerAdaptorBase.h:176
edm::stream::EDAnalyzerAdaptorBase::esGetTokenIndicesVector
std::vector< ESProxyIndex > const & esGetTokenIndicesVector(edm::Transition iTrans) const
Definition: EDAnalyzerAdaptorBase.cc:98
EDAnalyzerBase
FWCoreCommonFwd.h
edm::stream::EDAnalyzerAdaptorBase::wantsGlobalRuns
virtual bool wantsGlobalRuns() const =0
edm::stream::EDAnalyzerAdaptorBase::wantsStreamLuminosityBlocks
bool wantsStreamLuminosityBlocks() const
Definition: EDAnalyzerAdaptorBase.h:89
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29