CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends
edm::stream::EDAnalyzerAdaptorBase Class Referenceabstract

#include "FWCore/Framework/interface/stream/EDAnalyzerAdaptorBase.h"

Inheritance diagram for edm::stream::EDAnalyzerAdaptorBase:
edm::stream::EDAnalyzerAdaptor< T >

Public Member Functions

 EDAnalyzerAdaptorBase ()
 
const ModuleDescriptionmoduleDescription () const
 
void registerProductsAndCallbacks (EDAnalyzerAdaptorBase const *, ProductRegistry *reg)
 
virtual bool wantsGlobalLuminosityBlocks () const =0
 
virtual bool wantsGlobalRuns () const =0
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
std::string workerType () const
 
virtual ~EDAnalyzerAdaptorBase ()
 

Protected Member Functions

const EDConsumerBaseconsumer () const
 
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 
template<typename T >
void createStreamModules (T iFunc)
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 

Private Member Functions

void doBeginJob ()
 
virtual void doBeginLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)=0
 
virtual void doBeginRun (RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)=0
 
void doBeginStream (StreamID id)
 
virtual void doEndJob ()=0
 
virtual void doEndLuminosityBlock (LuminosityBlockPrincipal const &lbp, EventSetupImpl const &c, ModuleCallingContext const *)=0
 
virtual void doEndRun (RunPrincipal const &rp, EventSetupImpl const &c, ModuleCallingContext const *)=0
 
void doEndStream (StreamID id)
 
bool doEvent (EventPrincipal const &ep, EventSetupImpl const &c, ActivityRegistry *, ModuleCallingContext const *)
 
void doPreallocate (PreallocationConfiguration const &)
 
void doRegisterThinnedAssociations (ProductRegistry const &, ThinnedAssociationsHelper &)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doStreamBeginLuminosityBlock (StreamID id, LuminosityBlockPrincipal const &ep, EventSetupImpl const &c, ModuleCallingContext const *)
 
void doStreamBeginRun (StreamID id, RunPrincipal const &ep, EventSetupImpl const &c, ModuleCallingContext const *)
 
void doStreamEndLuminosityBlock (StreamID id, LuminosityBlockPrincipal const &ep, EventSetupImpl const &c, ModuleCallingContext const *)
 
void doStreamEndRun (StreamID id, RunPrincipal const &ep, EventSetupImpl const &c, ModuleCallingContext const *)
 
 EDAnalyzerAdaptorBase (const EDAnalyzerAdaptorBase &)=delete
 
bool hasAccumulator () const
 
bool hasAcquire () const
 
const EDAnalyzerAdaptorBaseoperator= (const EDAnalyzerAdaptorBase &)=delete
 
void preActionBeforeRunEventAsync (WaitingTask *iTask, ModuleCallingContext const &iModuleCallingContext, Principal const &iPrincipal) const
 
virtual void preallocLumis (unsigned int)
 
void setModuleDescription (ModuleDescription const &md)
 
void setModuleDescriptionPtr (EDAnalyzerBase *m)
 
virtual void setupLuminosityBlock (EDAnalyzerBase *, LuminosityBlockIndex)=0
 
virtual void setupRun (EDAnalyzerBase *, RunIndex)=0
 
virtual void setupStreamModules ()=0
 
virtual void streamEndLuminosityBlockSummary (EDAnalyzerBase *, edm::LuminosityBlock const &, edm::EventSetup const &)=0
 
virtual void streamEndRunSummary (EDAnalyzerBase *, edm::Run const &, edm::EventSetup const &)=0
 

Private Attributes

std::vector< EDAnalyzerBase * > m_streamModules
 
ModuleDescription moduleDescription_
 

Friends

template<typename T >
class edm::maker::ModuleHolderT
 
template<typename T >
class edm::WorkerT
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 62 of file EDAnalyzerAdaptorBase.h.

Constructor & Destructor Documentation

EDAnalyzerAdaptorBase::EDAnalyzerAdaptorBase ( )

Definition at line 42 of file EDAnalyzerAdaptorBase.cc.

42 {}
EDAnalyzerAdaptorBase::~EDAnalyzerAdaptorBase ( )
virtual

Definition at line 49 of file EDAnalyzerAdaptorBase.cc.

References funct::m, and m_streamModules.

49  {
50  for (auto m : m_streamModules) {
51  delete m;
52  }
53 }
std::vector< EDAnalyzerBase * > m_streamModules
edm::stream::EDAnalyzerAdaptorBase::EDAnalyzerAdaptorBase ( const EDAnalyzerAdaptorBase )
privatedelete

Member Function Documentation

const edm::EDConsumerBase * EDAnalyzerAdaptorBase::consumer ( ) const
protected

Definition at line 110 of file EDAnalyzerAdaptorBase.cc.

References m_streamModules.

110 { return m_streamModules[0]; }
std::vector< EDAnalyzerBase * > m_streamModules
std::vector< edm::ConsumesInfo > EDAnalyzerAdaptorBase::consumesInfo ( ) const
protected

Definition at line 127 of file EDAnalyzerAdaptorBase.cc.

References m_streamModules.

127  {
128  assert(not m_streamModules.empty());
129  return m_streamModules[0]->consumesInfo();
130 }
std::vector< EDAnalyzerBase * > m_streamModules
void EDAnalyzerAdaptorBase::convertCurrentProcessAlias ( std::string const &  processName)
protected

Definition at line 121 of file EDAnalyzerAdaptorBase.cc.

References m_streamModules, and mod().

121  {
122  for (auto mod : m_streamModules) {
123  mod->convertCurrentProcessAlias(processName);
124  }
125 }
std::vector< EDAnalyzerBase * > m_streamModules
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
template<typename T >
void edm::stream::EDAnalyzerAdaptorBase::createStreamModules ( T  iFunc)
inlineprotected

Definition at line 89 of file EDAnalyzerAdaptorBase.h.

References EnergyCorrector::c, funct::m, modifiedElectrons_cfi::processName, and AlCaHLTBitMon_QueryRunRegistry::string.

89  {
90  for (auto& m : m_streamModules) {
91  m = iFunc();
93  }
94  }
std::vector< EDAnalyzerBase * > m_streamModules
void setModuleDescriptionPtr(EDAnalyzerBase *m)
void EDAnalyzerAdaptorBase::doBeginJob ( )
private

Definition at line 145 of file EDAnalyzerAdaptorBase.cc.

145 {}
virtual void edm::stream::EDAnalyzerAdaptorBase::doBeginLuminosityBlock ( LuminosityBlockPrincipal const &  lbp,
EventSetupImpl const &  c,
ModuleCallingContext const *   
)
privatepure virtual
virtual void edm::stream::EDAnalyzerAdaptorBase::doBeginRun ( RunPrincipal const &  rp,
EventSetupImpl const &  c,
ModuleCallingContext const *   
)
privatepure virtual
void EDAnalyzerAdaptorBase::doBeginStream ( StreamID  id)
private

Definition at line 147 of file EDAnalyzerAdaptorBase.cc.

References triggerObjects_cff::id, and m_streamModules.

147 { m_streamModules[id]->beginStream(id); }
std::vector< EDAnalyzerBase * > m_streamModules
virtual void edm::stream::EDAnalyzerAdaptorBase::doEndJob ( )
privatepure virtual
virtual void edm::stream::EDAnalyzerAdaptorBase::doEndLuminosityBlock ( LuminosityBlockPrincipal const &  lbp,
EventSetupImpl const &  c,
ModuleCallingContext const *   
)
privatepure virtual
virtual void edm::stream::EDAnalyzerAdaptorBase::doEndRun ( RunPrincipal const &  rp,
EventSetupImpl const &  c,
ModuleCallingContext const *   
)
privatepure virtual
void EDAnalyzerAdaptorBase::doEndStream ( StreamID  id)
private

Definition at line 148 of file EDAnalyzerAdaptorBase.cc.

References triggerObjects_cff::id, and m_streamModules.

148 { m_streamModules[id]->endStream(); }
std::vector< EDAnalyzerBase * > m_streamModules
bool EDAnalyzerAdaptorBase::doEvent ( EventPrincipal const &  ep,
EventSetupImpl const &  c,
ActivityRegistry act,
ModuleCallingContext const *  mcc 
)
private

Definition at line 132 of file EDAnalyzerAdaptorBase.cc.

References EnergyCorrector::c, MillePedeFileConverter_cfg::e, edm::Event, m_streamModules, mod(), moduleDescription_, edm::Event::setConsumer(), and edm::EventPrincipal::streamID().

135  {
136  assert(ep.streamID() < m_streamModules.size());
137  auto mod = m_streamModules[ep.streamID()];
138  Event e(ep, moduleDescription_, mcc);
139  e.setConsumer(mod);
140  const EventSetup c{ci, static_cast<unsigned int>(Transition::Event), mod->esGetTokenIndices(Transition::Event)};
141  EventSignalsSentry sentry(act, mcc);
142  mod->analyze(e, c);
143  return true;
144 }
std::vector< EDAnalyzerBase * > m_streamModules
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void EDAnalyzerAdaptorBase::doPreallocate ( PreallocationConfiguration const &  iPrealloc)
private

Definition at line 70 of file EDAnalyzerAdaptorBase.cc.

References m_streamModules, edm::PreallocationConfiguration::numberOfLuminosityBlocks(), edm::PreallocationConfiguration::numberOfStreams(), preallocLumis(), and setupStreamModules().

70  {
71  m_streamModules.resize(iPrealloc.numberOfStreams(), static_cast<stream::EDAnalyzerBase*>(nullptr));
73  preallocLumis(iPrealloc.numberOfLuminosityBlocks());
74 }
std::vector< EDAnalyzerBase * > m_streamModules
virtual void preallocLumis(unsigned int)
void edm::stream::EDAnalyzerAdaptorBase::doRegisterThinnedAssociations ( ProductRegistry const &  ,
ThinnedAssociationsHelper  
)
inlineprivate

Definition at line 165 of file EDAnalyzerAdaptorBase.h.

165 {}
void EDAnalyzerAdaptorBase::doRespondToCloseInputFile ( FileBlock const &  fb)
private

Definition at line 204 of file EDAnalyzerAdaptorBase.cc.

204 {}
void EDAnalyzerAdaptorBase::doRespondToOpenInputFile ( FileBlock const &  fb)
private

Definition at line 203 of file EDAnalyzerAdaptorBase.cc.

203 {}
void EDAnalyzerAdaptorBase::doStreamBeginLuminosityBlock ( StreamID  id,
LuminosityBlockPrincipal const &  ep,
EventSetupImpl const &  c,
ModuleCallingContext const *  mcc 
)
private

Definition at line 175 of file EDAnalyzerAdaptorBase.cc.

References edm::BeginLuminosityBlock, EnergyCorrector::c, triggerObjects_cff::id, edm::LuminosityBlockPrincipal::index(), m_streamModules, mod(), moduleDescription_, and setupLuminosityBlock().

178  {
179  auto mod = m_streamModules[id];
180  setupLuminosityBlock(mod, lbp.index());
181 
182  LuminosityBlock lb(lbp, moduleDescription_, mcc, false);
183  lb.setConsumer(mod);
184  const EventSetup c{ci,
185  static_cast<unsigned int>(Transition::BeginLuminosityBlock),
186  mod->esGetTokenIndices(Transition::BeginLuminosityBlock)};
187  mod->beginLuminosityBlock(lb, c);
188 }
std::vector< EDAnalyzerBase * > m_streamModules
virtual void setupLuminosityBlock(EDAnalyzerBase *, LuminosityBlockIndex)=0
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void EDAnalyzerAdaptorBase::doStreamBeginRun ( StreamID  id,
RunPrincipal const &  ep,
EventSetupImpl const &  c,
ModuleCallingContext const *  mcc 
)
private

Definition at line 150 of file EDAnalyzerAdaptorBase.cc.

References edm::BeginRun, EnergyCorrector::c, triggerObjects_cff::id, edm::RunPrincipal::index(), m_streamModules, mod(), moduleDescription_, alignCSCRings::r, and setupRun().

153  {
154  auto mod = m_streamModules[id];
155  setupRun(mod, rp.index());
156 
157  Run r(rp, moduleDescription_, mcc, false);
158  const EventSetup c{ci, static_cast<unsigned int>(Transition::BeginRun), mod->esGetTokenIndices(Transition::BeginRun)};
159  r.setConsumer(mod);
160  mod->beginRun(r, c);
161 }
std::vector< EDAnalyzerBase * > m_streamModules
virtual void setupRun(EDAnalyzerBase *, RunIndex)=0
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void EDAnalyzerAdaptorBase::doStreamEndLuminosityBlock ( StreamID  id,
LuminosityBlockPrincipal const &  ep,
EventSetupImpl const &  c,
ModuleCallingContext const *  mcc 
)
private

Definition at line 189 of file EDAnalyzerAdaptorBase.cc.

References EnergyCorrector::c, edm::EndLuminosityBlock, triggerObjects_cff::id, m_streamModules, mod(), moduleDescription_, edm::LuminosityBlock::setConsumer(), and streamEndLuminosityBlockSummary().

192  {
193  auto mod = m_streamModules[id];
194  LuminosityBlock lb(lbp, moduleDescription_, mcc, true);
195  lb.setConsumer(mod);
196  const EventSetup c{ci,
197  static_cast<unsigned int>(Transition::EndLuminosityBlock),
198  mod->esGetTokenIndices(Transition::EndLuminosityBlock)};
199  mod->endLuminosityBlock(lb, c);
201 }
std::vector< EDAnalyzerBase * > m_streamModules
virtual void streamEndLuminosityBlockSummary(EDAnalyzerBase *, edm::LuminosityBlock const &, edm::EventSetup const &)=0
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void EDAnalyzerAdaptorBase::doStreamEndRun ( StreamID  id,
RunPrincipal const &  ep,
EventSetupImpl const &  c,
ModuleCallingContext const *  mcc 
)
private

Definition at line 163 of file EDAnalyzerAdaptorBase.cc.

References EnergyCorrector::c, edm::EndRun, triggerObjects_cff::id, m_streamModules, mod(), moduleDescription_, alignCSCRings::r, edm::Run::setConsumer(), and streamEndRunSummary().

166  {
167  auto mod = m_streamModules[id];
168  Run r(rp, moduleDescription_, mcc, true);
169  r.setConsumer(mod);
170  const EventSetup c{ci, static_cast<unsigned int>(Transition::EndRun), mod->esGetTokenIndices(Transition::EndRun)};
171  mod->endRun(r, c);
173 }
std::vector< EDAnalyzerBase * > m_streamModules
virtual void streamEndRunSummary(EDAnalyzerBase *, edm::Run const &, edm::EventSetup const &)=0
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
bool edm::stream::EDAnalyzerAdaptorBase::hasAccumulator ( ) const
inlineprivate

Definition at line 168 of file EDAnalyzerAdaptorBase.h.

References funct::m.

168 { return false; }
bool edm::stream::EDAnalyzerAdaptorBase::hasAcquire ( ) const
inlineprivate

Definition at line 167 of file EDAnalyzerAdaptorBase.h.

167 { return false; }
void EDAnalyzerAdaptorBase::itemsMayGet ( BranchType  iType,
std::vector< ProductResolverIndexAndSkipBit > &  iIndices 
) const
protected

Definition at line 86 of file EDAnalyzerAdaptorBase.cc.

References m_streamModules.

86  {
87  assert(not m_streamModules.empty());
88  m_streamModules[0]->itemsMayGet(iType, iIndices);
89 }
std::vector< EDAnalyzerBase * > m_streamModules
void EDAnalyzerAdaptorBase::itemsToGet ( BranchType  iType,
std::vector< ProductResolverIndexAndSkipBit > &  iIndices 
) const
protected

Definition at line 82 of file EDAnalyzerAdaptorBase.cc.

References m_streamModules.

82  {
83  assert(not m_streamModules.empty());
84  m_streamModules[0]->itemsToGet(iType, iIndices);
85 }
std::vector< EDAnalyzerBase * > m_streamModules
std::vector< edm::ProductResolverIndexAndSkipBit > const & EDAnalyzerAdaptorBase::itemsToGetFrom ( BranchType  iType) const
protected

Definition at line 91 of file EDAnalyzerAdaptorBase.cc.

References m_streamModules.

91  {
92  assert(not m_streamModules.empty());
93  return m_streamModules[0]->itemsToGetFrom(iType);
94 }
std::vector< EDAnalyzerBase * > m_streamModules
const ModuleDescription& edm::stream::EDAnalyzerAdaptorBase::moduleDescription ( ) const
inline

Definition at line 77 of file EDAnalyzerAdaptorBase.h.

77 { return moduleDescription_; }
void EDAnalyzerAdaptorBase::modulesWhoseProductsAreConsumed ( std::vector< ModuleDescription const * > &  modules,
ProductRegistry const &  preg,
std::map< std::string, ModuleDescription const * > const &  labelsToDesc,
std::string const &  processName 
) const
protected

Definition at line 112 of file EDAnalyzerAdaptorBase.cc.

References m_streamModules.

116  {
117  assert(not m_streamModules.empty());
118  return m_streamModules[0]->modulesWhoseProductsAreConsumed(modules, preg, labelsToDesc, processName);
119 }
std::vector< EDAnalyzerBase * > m_streamModules
const EDAnalyzerAdaptorBase& edm::stream::EDAnalyzerAdaptorBase::operator= ( const EDAnalyzerAdaptorBase )
privatedelete
void edm::stream::EDAnalyzerAdaptorBase::preActionBeforeRunEventAsync ( WaitingTask iTask,
ModuleCallingContext const &  iModuleCallingContext,
Principal const &  iPrincipal 
) const
inlineprivate

Definition at line 125 of file EDAnalyzerAdaptorBase.h.

References benchmark_cfg::fb.

127  {}
virtual void edm::stream::EDAnalyzerAdaptorBase::preallocLumis ( unsigned int  )
inlineprivatevirtual

Reimplemented in edm::stream::EDAnalyzerAdaptor< T >.

Definition at line 122 of file EDAnalyzerAdaptorBase.h.

Referenced by doPreallocate().

122 {}
void EDAnalyzerAdaptorBase::registerProductsAndCallbacks ( EDAnalyzerAdaptorBase const *  ,
ProductRegistry reg 
)

Definition at line 76 of file EDAnalyzerAdaptorBase.cc.

References m_streamModules, and mod().

76  {
77  for (auto mod : m_streamModules) {
78  mod->registerProductsAndCallbacks(mod, reg);
79  }
80 }
std::vector< EDAnalyzerBase * > m_streamModules
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void edm::stream::EDAnalyzerAdaptorBase::setModuleDescription ( ModuleDescription const &  md)
inlineprivate

Definition at line 172 of file EDAnalyzerAdaptorBase.h.

void EDAnalyzerAdaptorBase::setModuleDescriptionPtr ( EDAnalyzerBase m)
private

Definition at line 206 of file EDAnalyzerAdaptorBase.cc.

References moduleDescription_, and edm::stream::EDAnalyzerBase::setModuleDescriptionPtr().

206  {
208 }
void setModuleDescriptionPtr(ModuleDescription const *iDesc)
virtual void edm::stream::EDAnalyzerAdaptorBase::setupLuminosityBlock ( EDAnalyzerBase ,
LuminosityBlockIndex   
)
privatepure virtual
virtual void edm::stream::EDAnalyzerAdaptorBase::setupRun ( EDAnalyzerBase ,
RunIndex   
)
privatepure virtual
virtual void edm::stream::EDAnalyzerAdaptorBase::setupStreamModules ( )
privatepure virtual

Implemented in edm::stream::EDAnalyzerAdaptor< T >.

Referenced by doPreallocate().

virtual void edm::stream::EDAnalyzerAdaptorBase::streamEndLuminosityBlockSummary ( EDAnalyzerBase ,
edm::LuminosityBlock const &  ,
edm::EventSetup const &   
)
privatepure virtual
virtual void edm::stream::EDAnalyzerAdaptorBase::streamEndRunSummary ( EDAnalyzerBase ,
edm::Run const &  ,
edm::EventSetup const &   
)
privatepure virtual

Implemented in edm::stream::EDAnalyzerAdaptor< T >.

Referenced by doStreamEndRun().

void EDAnalyzerAdaptorBase::updateLookup ( BranchType  iBranchType,
ProductResolverIndexHelper const &  iHelper,
bool  iPrefetchMayGet 
)
protected

Definition at line 96 of file EDAnalyzerAdaptorBase.cc.

References m_streamModules, and mod().

98  {
99  for (auto mod : m_streamModules) {
100  mod->updateLookup(iType, iHelper, iPrefetchMayGet);
101  }
102 }
std::vector< EDAnalyzerBase * > m_streamModules
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
void EDAnalyzerAdaptorBase::updateLookup ( eventsetup::ESRecordsToProxyIndices const &  iPI)
protected

Definition at line 104 of file EDAnalyzerAdaptorBase.cc.

References m_streamModules, and mod().

104  {
105  for (auto mod : m_streamModules) {
106  mod->updateLookup(iPI);
107  }
108 }
std::vector< EDAnalyzerBase * > m_streamModules
T mod(const T &a, const T &b)
Definition: ecalDccMap.h:4
virtual bool edm::stream::EDAnalyzerAdaptorBase::wantsGlobalLuminosityBlocks ( ) const
pure virtual
virtual bool edm::stream::EDAnalyzerAdaptorBase::wantsGlobalRuns ( ) const
pure virtual
bool edm::stream::EDAnalyzerAdaptorBase::wantsStreamLuminosityBlocks ( ) const
inline

Definition at line 82 of file EDAnalyzerAdaptorBase.h.

82 { return true; }
bool edm::stream::EDAnalyzerAdaptorBase::wantsStreamRuns ( ) const
inline

Definition at line 81 of file EDAnalyzerAdaptorBase.h.

81 { return true; }
std::string edm::stream::EDAnalyzerAdaptorBase::workerType ( ) const
inline

Definition at line 84 of file EDAnalyzerAdaptorBase.h.

References edm::maker::ModuleHolderT< T >::registerProductsAndCallbacks().

84 { return "WorkerT<EDAnalyzerAdaptorBase>"; }

Friends And Related Function Documentation

template<typename T >
friend class edm::maker::ModuleHolderT
friend

Definition at line 67 of file EDAnalyzerAdaptorBase.h.

template<typename T >
friend class edm::WorkerT
friend

Definition at line 65 of file EDAnalyzerAdaptorBase.h.

Member Data Documentation

std::vector<EDAnalyzerBase*> edm::stream::EDAnalyzerAdaptorBase::m_streamModules
private
ModuleDescription edm::stream::EDAnalyzerAdaptorBase::moduleDescription_
private