CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Friends
edm::EDConsumerBase Class Reference

#include <EDConsumerBase.h>

Inheritance diagram for edm::EDConsumerBase:
edm::EDAnalyzer edm::EDFilter edm::EDProducer edm::global::EDAnalyzerBase edm::global::EDFilterBase edm::global::EDProducerBase edm::global::OutputModuleBase edm::limited::EDAnalyzerBase edm::limited::EDFilterBase edm::limited::EDProducerBase edm::limited::OutputModuleBase edm::one::EDAnalyzerBase edm::one::EDFilterBase edm::one::EDProducerBase edm::one::OutputModuleBase edm::stream::EDAnalyzerBase edm::stream::EDFilterBase edm::stream::EDProducerBase edm::SubProcess

Classes

struct  ESTokenLookupInfo
 
struct  LabelPlacement
 
struct  TokenLookupInfo
 

Public Types

typedef ProductLabels Labels
 

Public Member Functions

std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Private Types

enum  { kLookupInfo, kAlwaysGets, kLabels, kKind }
 
enum  { kESLookupInfo, kESProxyIndex }
 

Private Member Functions

edm::InputTag const & checkIfEmpty (edm::InputTag const &tag)
 
const char * labelFor (ESTokenIndex) const
 
unsigned int recordConsumes (BranchType iBranch, TypeToGet const &iType, edm::InputTag const &iTag, bool iAlwaysGets)
 
ESTokenIndex recordESConsumes (Transition, eventsetup::EventSetupRecordKey const &, eventsetup::heterocontainer::HCTypeTag const &, edm::ESInputTag const &iTag)
 
void throwBadToken (edm::TypeID const &iType, EDGetToken iToken) const
 
void throwBranchMismatch (BranchType, EDGetToken) const
 
void throwConsumesCallAfterFrozen (TypeToGet const &, InputTag const &) const
 
void throwTypeMismatch (edm::TypeID const &, EDGetToken) const
 

Private Attributes

bool containsCurrentProcessAlias_
 
std::array< std::vector< ESProxyIndex >, static_cast< unsigned int >edm::Transition::NumberOfTransitions)> esItemsToGetFromTransition_
 
bool frozen_
 
std::array< std::vector< ProductResolverIndexAndSkipBit >, edm::NumBranchTypesitemsToGetFromBranch_
 
edm::SoATuple< ESTokenLookupInfo, ESProxyIndexm_esTokenInfo
 
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfTypem_tokenInfo
 
std::vector< char > m_tokenLabels
 

Friends

class ConsumesCollector
 
template<typename T >
class WillGetIfMatch
 

Detailed Description

Description: Allows declaration of what data is being consumed

Usage: The EDM modules all inherit from this base class

Definition at line 62 of file EDConsumerBase.h.

Member Typedef Documentation

◆ Labels

Definition at line 97 of file EDConsumerBase.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
kLookupInfo 
kAlwaysGets 
kLabels 
kKind 

Definition at line 222 of file EDConsumerBase.h.

◆ anonymous enum

anonymous enum
private
Enumerator
kESLookupInfo 
kESProxyIndex 

Definition at line 246 of file EDConsumerBase.h.

Constructor & Destructor Documentation

◆ EDConsumerBase() [1/3]

edm::EDConsumerBase::EDConsumerBase ( )
inline

Definition at line 64 of file EDConsumerBase.h.

64 : m_tokenLabels{'\0'}, frozen_(false), containsCurrentProcessAlias_(false) {}

◆ ~EDConsumerBase()

EDConsumerBase::~EDConsumerBase ( )
virtualnoexcept

Definition at line 54 of file EDConsumerBase.cc.

54 {}

◆ EDConsumerBase() [2/3]

edm::EDConsumerBase::EDConsumerBase ( EDConsumerBase const &  )
delete

◆ EDConsumerBase() [3/3]

edm::EDConsumerBase::EDConsumerBase ( EDConsumerBase &&  )
default

Member Function Documentation

◆ checkIfEmpty()

edm::InputTag const & EDConsumerBase::checkIfEmpty ( edm::InputTag const &  tag)
private

Definition at line 78 of file EDConsumerBase.cc.

78  {
79  if (iTag.label().empty()) {
80  return kWasEmpty;
81  }
82  return iTag;
83 }

References kWasEmpty, and edm::InputTag::label().

Referenced by consumes(), and mayConsume().

◆ consumes() [1/3]

EDGetToken edm::EDConsumerBase::consumes ( const TypeToGet id,
edm::InputTag const &  tag 
)
inlineprotected

Definition at line 131 of file EDConsumerBase.h.

131  {
132  return EDGetToken{recordConsumes(InEvent, id, checkIfEmpty(tag), true)};
133  }

References checkIfEmpty(), edm::InEvent, recordConsumes(), and GlobalPosition_Frontier_DevDB_cff::tag.

◆ consumes() [2/3]

template<typename ProductType , BranchType B = InEvent>
EDGetTokenT<ProductType> edm::EDConsumerBase::consumes ( edm::InputTag const &  tag)
inlineprotected

Definition at line 126 of file EDConsumerBase.h.

126  {
127  TypeToGet tid = TypeToGet::make<ProductType>();
128  return EDGetTokenT<ProductType>{recordConsumes(B, tid, checkIfEmpty(tag), true)};
129  }

References TtFullHadDaughter::B, checkIfEmpty(), recordConsumes(), and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by AlCaECALRecHitReducer::AlCaECALRecHitReducer(), pat::CandidateSummaryTable::CandidateSummaryTable(), CrossingFramePSimHitToPSimHitsConverter::CrossingFramePSimHitToPSimHitsConverter(), ElectronMVANtuplizer::ElectronMVANtuplizer(), edm::EventContentAnalyzer::EventContentAnalyzer(), EcalDQMonitorTask::formSchedule(), HGCalValidator::HGCalValidator(), HLTMuonIsoFilter::HLTMuonIsoFilter(), HLTMuonPFIsoFilter::HLTMuonPFIsoFilter(), JetCollectionReducerT< T >::JetCollectionReducerT(), edm::one::OutputModuleBase::keepThisBranch(), edm::SubProcess::keepThisBranch(), edm::global::OutputModuleBase::keepThisBranch(), edm::limited::OutputModuleBase::keepThisBranch(), L1TPFCandMultiMerger::L1TPFCandMultiMerger(), MultiplicityCorrelator::MultiplicityCorrelator(), MultiTrackValidator::MultiTrackValidator(), pat::PATPackedCandidateProducer::PATPackedCandidateProducer(), PhotonMVANtuplizer::PhotonMVANtuplizer(), SeedMultiplicityAnalyzer::SeedMultiplicityAnalyzer(), ShallowSimhitClustersProducer::ShallowSimhitClustersProducer(), ShiftedParticleMETcorrInputProducer::ShiftedParticleMETcorrInputProducer(), SiStripMonitorDigi::SiStripMonitorDigi(), edm::SwitchProducer::SwitchProducer(), and TrackingParticleNumberOfLayersProducer::TrackingParticleNumberOfLayersProducer().

◆ consumes() [3/3]

template<BranchType B>
EDGetToken edm::EDConsumerBase::consumes ( TypeToGet const &  id,
edm::InputTag const &  tag 
)
inlineprotected

Definition at line 136 of file EDConsumerBase.h.

136  {
137  return EDGetToken{recordConsumes(B, id, checkIfEmpty(tag), true)};
138  }

References TtFullHadDaughter::B, checkIfEmpty(), recordConsumes(), and GlobalPosition_Frontier_DevDB_cff::tag.

◆ consumesCollector()

ConsumesCollector EDConsumerBase::consumesCollector ( )
protected

Use a ConsumesCollector to gather consumes information from helper functions.

Definition at line 71 of file EDConsumerBase.cc.

71  {
72  ConsumesCollector c{this};
73  return c;
74 }

References HltBtagPostValidation_cff::c.

Referenced by AlcaBeamMonitor::AlcaBeamMonitor(), AlcaBeamSpotProducer::AlcaBeamSpotProducer(), IsolatedParticlesGeneratedJets::analyze(), OverlapValidation::analyze(), BeamMonitor::BeamMonitor(), BeamMonitorBx::BeamMonitorBx(), BeamSpotAnalyzer::BeamSpotAnalyzer(), DTTrigTest::beginRun(), CaloParticleDebugger::CaloParticleDebugger(), ConfigurableAnalysis::ConfigurableAnalysis(), CosmicSplitterValidation::CosmicSplitterValidation(), CSCMonitorModule::CSCMonitorModule(), edm::global::OutputModuleBase::doPreallocate(), edm::limited::OutputModuleBase::doPreallocate(), edm::one::OutputModuleBase::doPreallocate(), DTResidualCalibration::DTResidualCalibration(), DTTTrigOffsetCalibration::DTTTrigOffsetCalibration(), DTVDriftSegmentCalibration::DTVDriftSegmentCalibration(), EcalCosmicsHists::EcalCosmicsHists(), EcalDQMonitorTask::EcalDQMonitorTask(), EcalSelectiveReadoutValidation::EcalSelectiveReadoutValidation(), EDMtoMEConverter::EDMtoMEConverter(), EopTreeWriter::EopTreeWriter(), EventWithHistoryEDFilter::EventWithHistoryEDFilter(), edm::FilterWrapper< T >::FilterWrapper(), HcalIsoTrkAnalyzer::HcalIsoTrkAnalyzer(), HGCalTriggerNtupleManager::HGCalTriggerNtupleManager(), HighPtTrackEcalDetIdProducer::HighPtTrackEcalDetIdProducer(), HLTBitAnalyzer::HLTBitAnalyzer(), HLTExoticaValidator::HLTExoticaValidator(), HLTMuonIsoFilter::HLTMuonIsoFilter(), cms::CkfDebugTrackCandidateMaker::initDebugger(), IsolatedTracksCone::IsolatedTracksCone(), IsolatedTracksNxN::IsolatedTracksNxN(), L1EventTreeProducer::L1EventTreeProducer(), L1MuGlobalMuonTrigger::L1MuGlobalMuonTrigger(), LogMessageMonitor::LogMessageMonitor(), pat::helper::ManyThingsToValueMaps< Adaptor, Collection, value_type >::ManyThingsToValueMaps(), MomentumConstraintProducer::MomentumConstraintProducer(), MultiplicityCorrelator::MultiplicityCorrelator(), MultiplicityInvestigator::MultiplicityInvestigator(), MultiplicityTimeCorrelations::MultiplicityTimeCorrelations(), MuPFIsoEmbedder::MuPFIsoEmbedder(), OMTFPatternMaker::OMTFPatternMaker(), OscarProducer::OscarProducer(), edm::global::OutputModuleBase::OutputModuleBase(), edm::limited::OutputModuleBase::OutputModuleBase(), edm::one::OutputModuleBase::OutputModuleBase(), OverlapValidation::OverlapValidation(), edm::PathStatusFilter::PathStatusFilter(), PlottingDevice::PlottingDevice(), QuickTrackAssociatorByHitsProducer::QuickTrackAssociatorByHitsProducer(), ReduceHcalRecHitCollectionProducer::ReduceHcalRecHitCollectionProducer(), ResidualRefitting::ResidualRefitting(), SeedMultiplicityAnalyzer::SeedMultiplicityAnalyzer(), SingleTopTChannelLeptonDQM::SingleTopTChannelLeptonDQM(), SingleTopTChannelLeptonDQM_miniAOD::SingleTopTChannelLeptonDQM_miniAOD(), SiPixelStatusHarvester::SiPixelStatusHarvester(), SiStripDCSFilter::SiStripDCSFilter(), SiStripMonitorDigi::SiStripMonitorDigi(), edm::SubProcess::SubProcess(), TagProbeFitTreeProducer::TagProbeFitTreeProducer(), Tau3MuSkim::Tau3MuSkim(), TopDiLeptonOfflineDQM::TopDiLeptonOfflineDQM(), TopSingleLeptonDQM::TopSingleLeptonDQM(), TopSingleLeptonDQM_miniAOD::TopSingleLeptonDQM_miniAOD(), TtDilepEvtSolutionMaker::TtDilepEvtSolutionMaker(), and TtSemiEvtSolutionMaker::TtSemiEvtSolutionMaker().

◆ consumesInfo()

std::vector< ConsumesInfo > EDConsumerBase::consumesInfo ( ) const

Definition at line 553 of file EDConsumerBase.cc.

553  {
554  // Use this to eliminate duplicate entries related
555  // to consumesMany items where only the type was specified
556  // and the there are multiple matches. In these cases the
557  // label, instance, and process will be empty.
558  std::set<edm::TypeID> alreadySeenTypes;
559 
560  std::vector<ConsumesInfo> result;
561  auto itAlways = m_tokenInfo.begin<kAlwaysGets>();
562  auto itKind = m_tokenInfo.begin<kKind>();
563  auto itLabels = m_tokenInfo.begin<kLabels>();
564  for (auto itInfo = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); itInfo != itEnd;
565  ++itInfo, ++itKind, ++itLabels, ++itAlways) {
566  const unsigned int labelStart = itLabels->m_startOfModuleLabel;
567  const char* consumedModuleLabel = &(m_tokenLabels[labelStart]);
568  const char* consumedInstance = consumedModuleLabel + itLabels->m_deltaToProductInstance;
569  const char* consumedProcessName = consumedModuleLabel + itLabels->m_deltaToProcessName;
570 
571  // consumesMany case
572  if (*consumedModuleLabel == '\0') {
573  if (!alreadySeenTypes.insert(itInfo->m_type).second) {
574  continue;
575  }
576  }
577 
578  // Just copy the information into the ConsumesInfo data structure
579  result.emplace_back(itInfo->m_type,
580  consumedModuleLabel,
581  consumedInstance,
582  consumedProcessName,
583  itInfo->m_branchType,
584  *itKind,
585  *itAlways,
586  itInfo->m_index.skipCurrentProcess());
587  }
588  return result;
589 }

References kAlwaysGets, kKind, kLabels, kLookupInfo, m_tokenInfo, m_tokenLabels, and mps_fire::result.

◆ consumesMany() [1/3]

template<typename ProductType , BranchType B = InEvent>
void edm::EDConsumerBase::consumesMany ( )
inlineprotected

Definition at line 154 of file EDConsumerBase.h.

154  {
155  TypeToGet tid = TypeToGet::make<ProductType>();
156  consumesMany<B>(tid);
157  }

◆ consumesMany() [2/3]

void edm::EDConsumerBase::consumesMany ( const TypeToGet id)
inlineprotected

Definition at line 159 of file EDConsumerBase.h.

159 { consumesMany<InEvent>(id); }

◆ consumesMany() [3/3]

template<BranchType B>
void edm::EDConsumerBase::consumesMany ( const TypeToGet id)
inlineprotected

Definition at line 162 of file EDConsumerBase.h.

162  {
163  recordConsumes(B, id, edm::InputTag{}, true);
164  }

References TtFullHadDaughter::B, and recordConsumes().

◆ convertCurrentProcessAlias()

void EDConsumerBase::convertCurrentProcessAlias ( std::string const &  processName)

Convert "@currentProcess" in InputTag process names to the actual current process name.

Definition at line 507 of file EDConsumerBase.cc.

507  {
508  frozen_ = true;
509 
512 
513  std::vector<char> newTokenLabels;
514 
515  // first calculate the size of the new vector and reserve memory for it
516  std::vector<char>::size_type newSize = 0;
517  std::string newProcessName;
518  for (auto iter = m_tokenInfo.begin<kLabels>(), itEnd = m_tokenInfo.end<kLabels>(); iter != itEnd; ++iter) {
519  newProcessName = &m_tokenLabels[iter->m_startOfModuleLabel + iter->m_deltaToProcessName];
520  if (newProcessName == InputTag::kCurrentProcess) {
521  newProcessName = processName;
522  }
523  newSize += (iter->m_deltaToProcessName + newProcessName.size() + 1);
524  }
525  newTokenLabels.reserve(newSize);
526 
527  unsigned int newStartOfModuleLabel = 0;
528  for (auto iter = m_tokenInfo.begin<kLabels>(), itEnd = m_tokenInfo.end<kLabels>(); iter != itEnd; ++iter) {
529  unsigned int startOfModuleLabel = iter->m_startOfModuleLabel;
530  unsigned short deltaToProcessName = iter->m_deltaToProcessName;
531 
532  iter->m_startOfModuleLabel = newStartOfModuleLabel;
533 
534  newProcessName = &m_tokenLabels[startOfModuleLabel + deltaToProcessName];
535  if (newProcessName == InputTag::kCurrentProcess) {
536  newProcessName = processName;
537  }
538 
539  newStartOfModuleLabel += (deltaToProcessName + newProcessName.size() + 1);
540 
541  // Copy in both the module label and instance, they are the same
542  newTokenLabels.insert(newTokenLabels.end(),
543  m_tokenLabels.begin() + startOfModuleLabel,
544  m_tokenLabels.begin() + (startOfModuleLabel + deltaToProcessName));
545 
546  newTokenLabels.insert(newTokenLabels.end(), newProcessName.begin(), newProcessName.end());
547  newTokenLabels.push_back('\0');
548  }
549  m_tokenLabels = std::move(newTokenLabels);
550  }
551 }

References containsCurrentProcessAlias_, frozen_, edm::InputTag::kCurrentProcess, kLabels, m_tokenInfo, m_tokenLabels, eostools::move(), SimL1EmulatorRepack_CalouGT_cff::processName, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ esConsumes() [1/2]

template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto edm::EDConsumerBase::esConsumes ( )
inlineprotected

Definition at line 168 of file EDConsumerBase.h.

168  {
169  return esConsumes<ESProduct, ESRecord, Tr>(ESInputTag{});
170  }

◆ esConsumes() [2/2]

template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto edm::EDConsumerBase::esConsumes ( ESInputTag const &  tag)
inlineprotected

Definition at line 173 of file EDConsumerBase.h.

173  {
174  auto index = recordESConsumes(Tr,
176  std::conditional_t<std::is_same_v<ESRecord, edm::DefaultRecord>,
177  eventsetup::default_record_t<ESHandleAdapter<ESProduct>>,
178  ESRecord>>(),
179  eventsetup::heterocontainer::HCTypeTag::make<ESProduct>(),
180  tag);
181  return ESGetToken<ESProduct, ESRecord>{static_cast<unsigned int>(Tr), index, labelFor(index)};
182  }

References labelFor(), edm::eventsetup::EventSetupRecordKey::makeKey(), recordESConsumes(), and GlobalPosition_Frontier_DevDB_cff::tag.

◆ esGetTokenIndices()

ESProxyIndex const* edm::EDConsumerBase::esGetTokenIndices ( edm::Transition  iTrans) const
inline

Definition at line 110 of file EDConsumerBase.h.

110  {
111  auto const& v = esItemsToGetFromTransition_[static_cast<unsigned int>(iTrans)];
112  if (v.empty()) {
113  return nullptr;
114  }
115  return &(esItemsToGetFromTransition_[static_cast<unsigned int>(iTrans)].front());
116  }

References esItemsToGetFromTransition_, and findQualityFiles::v.

Referenced by edm::global::EDFilterBase::doAcquire(), edm::global::EDProducerBase::doAcquire(), edm::EDAnalyzer::doBeginLuminosityBlock(), edm::EDProducer::doBeginLuminosityBlock(), edm::EDFilter::doBeginLuminosityBlock(), edm::one::EDFilterBase::doBeginLuminosityBlock(), edm::one::EDProducerBase::doBeginLuminosityBlock(), edm::one::EDAnalyzerBase::doBeginLuminosityBlock(), edm::global::EDAnalyzerBase::doBeginLuminosityBlock(), edm::limited::EDProducerBase::doBeginLuminosityBlock(), edm::global::EDProducerBase::doBeginLuminosityBlock(), edm::limited::EDFilterBase::doBeginLuminosityBlock(), edm::global::EDFilterBase::doBeginLuminosityBlock(), edm::limited::EDAnalyzerBase::doBeginLuminosityBlock(), edm::stream::EDAnalyzerAdaptor< T >::doBeginLuminosityBlock(), edm::EDAnalyzer::doBeginRun(), edm::EDProducer::doBeginRun(), edm::EDFilter::doBeginRun(), edm::one::EDProducerBase::doBeginRun(), edm::one::EDFilterBase::doBeginRun(), edm::one::EDAnalyzerBase::doBeginRun(), edm::global::EDAnalyzerBase::doBeginRun(), edm::limited::EDProducerBase::doBeginRun(), edm::global::EDProducerBase::doBeginRun(), edm::limited::EDFilterBase::doBeginRun(), edm::global::EDFilterBase::doBeginRun(), edm::limited::EDAnalyzerBase::doBeginRun(), edm::stream::EDAnalyzerAdaptor< T >::doBeginRun(), edm::EDAnalyzer::doEndLuminosityBlock(), edm::EDProducer::doEndLuminosityBlock(), edm::EDFilter::doEndLuminosityBlock(), edm::one::EDFilterBase::doEndLuminosityBlock(), edm::one::EDProducerBase::doEndLuminosityBlock(), edm::one::EDAnalyzerBase::doEndLuminosityBlock(), edm::global::EDAnalyzerBase::doEndLuminosityBlock(), edm::limited::EDProducerBase::doEndLuminosityBlock(), edm::global::EDProducerBase::doEndLuminosityBlock(), edm::limited::EDFilterBase::doEndLuminosityBlock(), edm::global::EDFilterBase::doEndLuminosityBlock(), edm::limited::EDAnalyzerBase::doEndLuminosityBlock(), edm::stream::EDAnalyzerAdaptor< T >::doEndLuminosityBlock(), edm::EDAnalyzer::doEndRun(), edm::EDProducer::doEndRun(), edm::EDFilter::doEndRun(), edm::one::EDFilterBase::doEndRun(), edm::one::EDProducerBase::doEndRun(), edm::one::EDAnalyzerBase::doEndRun(), edm::global::EDAnalyzerBase::doEndRun(), edm::limited::EDProducerBase::doEndRun(), edm::global::EDProducerBase::doEndRun(), edm::limited::EDFilterBase::doEndRun(), edm::global::EDFilterBase::doEndRun(), edm::limited::EDAnalyzerBase::doEndRun(), edm::stream::EDAnalyzerAdaptor< T >::doEndRun(), edm::EDAnalyzer::doEvent(), edm::EDProducer::doEvent(), edm::EDFilter::doEvent(), edm::global::EDFilterBase::doEvent(), edm::one::EDFilterBase::doEvent(), edm::one::EDProducerBase::doEvent(), edm::global::EDAnalyzerBase::doEvent(), edm::one::EDAnalyzerBase::doEvent(), edm::global::EDProducerBase::doEvent(), edm::limited::EDFilterBase::doEvent(), edm::limited::EDAnalyzerBase::doEvent(), edm::limited::EDProducerBase::doEvent(), edm::global::EDAnalyzerBase::doStreamBeginLuminosityBlock(), edm::limited::EDProducerBase::doStreamBeginLuminosityBlock(), edm::global::EDProducerBase::doStreamBeginLuminosityBlock(), edm::limited::EDFilterBase::doStreamBeginLuminosityBlock(), edm::global::EDFilterBase::doStreamBeginLuminosityBlock(), edm::limited::EDAnalyzerBase::doStreamBeginLuminosityBlock(), edm::global::EDAnalyzerBase::doStreamBeginRun(), edm::limited::EDProducerBase::doStreamBeginRun(), edm::global::EDProducerBase::doStreamBeginRun(), edm::limited::EDFilterBase::doStreamBeginRun(), edm::global::EDFilterBase::doStreamBeginRun(), edm::limited::EDAnalyzerBase::doStreamBeginRun(), edm::global::EDAnalyzerBase::doStreamEndLuminosityBlock(), edm::limited::EDProducerBase::doStreamEndLuminosityBlock(), edm::global::EDProducerBase::doStreamEndLuminosityBlock(), edm::limited::EDFilterBase::doStreamEndLuminosityBlock(), edm::global::EDFilterBase::doStreamEndLuminosityBlock(), edm::limited::EDAnalyzerBase::doStreamEndLuminosityBlock(), edm::global::EDAnalyzerBase::doStreamEndRun(), edm::limited::EDProducerBase::doStreamEndRun(), edm::global::EDProducerBase::doStreamEndRun(), edm::limited::EDFilterBase::doStreamEndRun(), edm::global::EDFilterBase::doStreamEndRun(), and edm::limited::EDAnalyzerBase::doStreamEndRun().

◆ indexFrom()

ProductResolverIndexAndSkipBit EDConsumerBase::indexFrom ( EDGetToken  iToken,
BranchType  iBranch,
TypeID const &  iType 
) const

Definition at line 260 of file EDConsumerBase.cc.

262  {
263  if (UNLIKELY(iToken.index() >= m_tokenInfo.size())) {
264  throwBadToken(iType, iToken);
265  }
266  const auto& info = m_tokenInfo.get<kLookupInfo>(iToken.index());
267  if (LIKELY(iBranch == info.m_branchType)) {
268  if (LIKELY(iType == info.m_type)) {
269  return info.m_index;
270  } else {
271  throwTypeMismatch(iType, iToken);
272  }
273  } else {
274  throwBranchMismatch(iBranch, iToken);
275  }
277 }

References edm::EDGetToken::index(), info(), kLookupInfo, LIKELY, m_tokenInfo, edm::ProductResolverIndexInvalid, throwBadToken(), throwBranchMismatch(), throwTypeMismatch(), and UNLIKELY.

Referenced by edm::PrincipalGetAdapter::getByToken_().

◆ itemsMayGet()

void EDConsumerBase::itemsMayGet ( BranchType  iBranch,
std::vector< ProductResolverIndexAndSkipBit > &  oIndices 
) const

Definition at line 315 of file EDConsumerBase.cc.

315  {
316  //how many are we adding?
317  unsigned int count = 0;
318  {
319  auto itAlwaysGet = m_tokenInfo.begin<kAlwaysGets>();
320  for (auto it = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); it != itEnd;
321  ++it, ++itAlwaysGet) {
322  if (iBranch == it->m_branchType) {
323  if (it->m_index.productResolverIndex() != ProductResolverIndexInvalid) {
324  if (not*itAlwaysGet) {
325  ++count;
326  }
327  }
328  }
329  }
330  }
331  oIndices.reserve(oIndices.size() + count);
332  {
333  auto itAlwaysGet = m_tokenInfo.begin<kAlwaysGets>();
334  for (auto it = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); it != itEnd;
335  ++it, ++itAlwaysGet) {
336  if (iBranch == it->m_branchType) {
337  if (it->m_index.productResolverIndex() != ProductResolverIndexInvalid) {
338  if (not*itAlwaysGet) {
339  oIndices.push_back(it->m_index);
340  }
341  }
342  }
343  }
344  }
345 }

References KineDebug3::count(), kAlwaysGets, kLookupInfo, m_tokenInfo, and edm::ProductResolverIndexInvalid.

Referenced by updateLookup().

◆ itemsToGet()

void EDConsumerBase::itemsToGet ( BranchType  iBranch,
std::vector< ProductResolverIndexAndSkipBit > &  oIndices 
) const

Definition at line 283 of file EDConsumerBase.cc.

283  {
284  //how many are we adding?
285  unsigned int count = 0;
286  {
287  auto itAlwaysGet = m_tokenInfo.begin<kAlwaysGets>();
288  for (auto it = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); it != itEnd;
289  ++it, ++itAlwaysGet) {
290  if (iBranch == it->m_branchType) {
291  if (it->m_index.productResolverIndex() != ProductResolverIndexInvalid) {
292  if (*itAlwaysGet) {
293  ++count;
294  }
295  }
296  }
297  }
298  }
299  oIndices.reserve(oIndices.size() + count);
300  {
301  auto itAlwaysGet = m_tokenInfo.begin<kAlwaysGets>();
302  for (auto it = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); it != itEnd;
303  ++it, ++itAlwaysGet) {
304  if (iBranch == it->m_branchType) {
305  if (it->m_index.productResolverIndex() != ProductResolverIndexInvalid) {
306  if (*itAlwaysGet) {
307  oIndices.push_back(it->m_index);
308  }
309  }
310  }
311  }
312  }
313 }

References KineDebug3::count(), kAlwaysGets, kLookupInfo, m_tokenInfo, and edm::ProductResolverIndexInvalid.

Referenced by updateLookup().

◆ itemsToGetFrom()

std::vector<ProductResolverIndexAndSkipBit> const& edm::EDConsumerBase::itemsToGetFrom ( BranchType  iType) const
inline

Definition at line 82 of file EDConsumerBase.h.

82  {
83  return itemsToGetFromBranch_[iType];
84  }

References itemsToGetFromBranch_.

Referenced by edm::PrincipalGetAdapter::numberOfProductsConsumed().

◆ labelFor()

const char * EDConsumerBase::labelFor ( ESTokenIndex  iIndex) const
private

Definition at line 591 of file EDConsumerBase.cc.

591  {
592  return m_esTokenInfo.get<kESLookupInfo>(iIndex.value()).m_key.name().value();
593 }

References kESLookupInfo, m_esTokenInfo, and edm::ESTokenIndex::value().

Referenced by esConsumes().

◆ labelsForToken()

void EDConsumerBase::labelsForToken ( EDGetToken  iToken,
Labels oLabels 
) const

◆ mayConsume() [1/3]

EDGetToken edm::EDConsumerBase::mayConsume ( const TypeToGet id,
edm::InputTag const &  tag 
)
inlineprotected

Definition at line 146 of file EDConsumerBase.h.

146 { return mayConsume<InEvent>(id, tag); }

References GlobalPosition_Frontier_DevDB_cff::tag.

◆ mayConsume() [2/3]

template<BranchType B>
EDGetToken edm::EDConsumerBase::mayConsume ( const TypeToGet id,
edm::InputTag const &  tag 
)
inlineprotected

Definition at line 149 of file EDConsumerBase.h.

149  {
150  return EDGetToken{recordConsumes(B, id, checkIfEmpty(tag), false)};
151  }

References TtFullHadDaughter::B, checkIfEmpty(), recordConsumes(), and GlobalPosition_Frontier_DevDB_cff::tag.

◆ mayConsume() [3/3]

template<typename ProductType , BranchType B = InEvent>
EDGetTokenT<ProductType> edm::EDConsumerBase::mayConsume ( edm::InputTag const &  tag)
inlineprotected

Definition at line 141 of file EDConsumerBase.h.

141  {
142  TypeToGet tid = TypeToGet::make<ProductType>();
143  return EDGetTokenT<ProductType>{recordConsumes(B, tid, checkIfEmpty(tag), false)};
144  }

References TtFullHadDaughter::B, checkIfEmpty(), recordConsumes(), and GlobalPosition_Frontier_DevDB_cff::tag.

◆ modulesWhoseProductsAreConsumed()

void EDConsumerBase::modulesWhoseProductsAreConsumed ( std::vector< ModuleDescription const * > &  modules,
ProductRegistry const &  preg,
std::map< std::string, ModuleDescription const * > const &  labelsToDesc,
std::string const &  processName 
) const

Definition at line 458 of file EDConsumerBase.cc.

461  {
462  ProductResolverIndexHelper const& iHelper = *preg.productLookup(InEvent);
463 
464  std::set<std::string> alreadyFound;
465 
466  auto itKind = m_tokenInfo.begin<kKind>();
467  auto itLabels = m_tokenInfo.begin<kLabels>();
468  for (auto itInfo = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); itInfo != itEnd;
469  ++itInfo, ++itKind, ++itLabels) {
470  if (itInfo->m_branchType == InEvent and (not itInfo->m_index.skipCurrentProcess())) {
471  const unsigned int labelStart = itLabels->m_startOfModuleLabel;
472  const char* consumedModuleLabel = &(m_tokenLabels[labelStart]);
473  const char* consumedProcessName = consumedModuleLabel + itLabels->m_deltaToProcessName;
474 
475  if (*consumedModuleLabel != '\0') { // not a consumesMany
476  if (*consumedProcessName != '\0') { // process name is specified in consumes call
477  if (processName == consumedProcessName &&
478  iHelper.index(*itKind,
479  itInfo->m_type,
480  consumedModuleLabel,
481  consumedModuleLabel + itLabels->m_deltaToProductInstance,
482  consumedModuleLabel + itLabels->m_deltaToProcessName) != ProductResolverIndexInvalid) {
483  insertFoundModuleLabel(consumedModuleLabel, modules, alreadyFound, labelsToDesc, preg);
484  }
485  } else { // process name was empty
486  auto matches = iHelper.relatedIndexes(
487  *itKind, itInfo->m_type, consumedModuleLabel, consumedModuleLabel + itLabels->m_deltaToProductInstance);
488  for (unsigned int j = 0; j < matches.numberOfMatches(); ++j) {
489  if (processName == matches.processName(j)) {
490  insertFoundModuleLabel(consumedModuleLabel, modules, alreadyFound, labelsToDesc, preg);
491  }
492  }
493  }
494  // consumesMany case
495  } else if (itInfo->m_index.productResolverIndex() == ProductResolverIndexInvalid) {
496  auto matches = iHelper.relatedIndexes(*itKind, itInfo->m_type);
497  for (unsigned int j = 0; j < matches.numberOfMatches(); ++j) {
498  if (processName == matches.processName(j)) {
499  insertFoundModuleLabel(matches.moduleLabel(j), modules, alreadyFound, labelsToDesc, preg);
500  }
501  }
502  }
503  }
504  }
505 }

References edm::ProductResolverIndexHelper::index(), edm::InEvent, dqmiolumiharvest::j, kKind, kLabels, kLookupInfo, m_tokenInfo, m_tokenLabels, patCandidatesForDimuonsSequences_cff::matches, LogMessageMonitor_cff::modules, SimL1EmulatorRepack_CalouGT_cff::processName, edm::ProductRegistry::productLookup(), edm::ProductResolverIndexInvalid, and edm::ProductResolverIndexHelper::relatedIndexes().

◆ operator=() [1/2]

EDConsumerBase& edm::EDConsumerBase::operator= ( EDConsumerBase &&  )
default

◆ operator=() [2/2]

EDConsumerBase const& edm::EDConsumerBase::operator= ( EDConsumerBase const &  )
delete

◆ recordConsumes()

unsigned int EDConsumerBase::recordConsumes ( BranchType  iBranch,
TypeToGet const &  iType,
edm::InputTag const &  iTag,
bool  iAlwaysGets 
)
private

Definition at line 85 of file EDConsumerBase.cc.

88  {
89  if (frozen_) {
90  throwConsumesCallAfterFrozen(iType, iTag);
91  }
92 
93  unsigned int index = m_tokenInfo.size();
94 
95  bool skipCurrentProcess = iTag.willSkipCurrentProcess();
96 
97  const size_t labelSize = iTag.label().size();
98  const size_t productInstanceSize = iTag.instance().size();
99  unsigned int labelStart = m_tokenLabels.size();
100  unsigned short delta1 = labelSize + 1;
101  unsigned short delta2 = labelSize + 2 + productInstanceSize;
102  m_tokenInfo.emplace_back(TokenLookupInfo{iType.type(), ProductResolverIndexInvalid, skipCurrentProcess, iBranch},
103  iAlwaysGets,
104  LabelPlacement{labelStart, delta1, delta2},
105  iType.kind());
106 
107  const size_t additionalSize = skipCurrentProcess ? labelSize + productInstanceSize + 3
108  : labelSize + productInstanceSize + iTag.process().size() + 3;
109 
110  m_tokenLabels.reserve(m_tokenLabels.size() + additionalSize);
111  {
112  const std::string& m = iTag.label();
113  m_tokenLabels.insert(m_tokenLabels.end(), m.begin(), m.end());
114  m_tokenLabels.push_back('\0');
115  }
116  {
117  const std::string& m = iTag.instance();
118  m_tokenLabels.insert(m_tokenLabels.end(), m.begin(), m.end());
119  m_tokenLabels.push_back('\0');
120  }
121  {
122  const std::string& m = iTag.process();
123  if (m == InputTag::kCurrentProcess) {
125  }
126  if (!skipCurrentProcess) {
127  m_tokenLabels.insert(m_tokenLabels.end(), m.begin(), m.end());
128  m_tokenLabels.push_back('\0');
129  } else {
130  m_tokenLabels.push_back('\0');
131  }
132  }
133  return index;
134 }

References containsCurrentProcessAlias_, frozen_, edm::InputTag::instance(), edm::InputTag::kCurrentProcess, edm::TypeToGet::kind(), edm::InputTag::label(), visualization-live-secondInstance_cfg::m, m_tokenInfo, m_tokenLabels, edm::InputTag::process(), edm::ProductResolverIndexInvalid, AlCaHLTBitMon_QueryRunRegistry::string, throwConsumesCallAfterFrozen(), edm::TypeToGet::type(), and edm::InputTag::willSkipCurrentProcess().

Referenced by consumes(), consumesMany(), and mayConsume().

◆ recordESConsumes()

ESTokenIndex EDConsumerBase::recordESConsumes ( Transition  iTrans,
eventsetup::EventSetupRecordKey const &  iRecord,
eventsetup::heterocontainer::HCTypeTag const &  iDataType,
edm::ESInputTag const &  iTag 
)
private

Definition at line 230 of file EDConsumerBase.cc.

233  {
234  //m_tokenLabels first entry is a null. Since most ES data requests have
235  // empty labels we will assume we can reuse the first entry
236  unsigned int startOfComponentName = 0;
237  if (not iTag.module().empty()) {
238  startOfComponentName = m_tokenLabels.size();
239 
240  m_tokenLabels.reserve(m_tokenLabels.size() + iTag.module().size() + 1);
241  {
242  const std::string& m = iTag.module();
243  m_tokenLabels.insert(m_tokenLabels.end(), m.begin(), m.end());
244  m_tokenLabels.push_back('\0');
245  }
246  }
247 
248  auto index = static_cast<ESProxyIndex::Value_t>(m_esTokenInfo.size());
249  m_esTokenInfo.emplace_back(
250  ESTokenLookupInfo{iRecord, eventsetup::DataKey{iDataType, iTag.data().c_str()}, startOfComponentName},
251  ESProxyIndex{-1});
252  auto indexForToken = esItemsToGetFromTransition_[static_cast<unsigned int>(iTrans)].size();
253  esItemsToGetFromTransition_[static_cast<unsigned int>(iTrans)].push_back(ESProxyIndex{-1 * (index + 1)});
254  return ESTokenIndex{static_cast<ESTokenIndex::Value_t>(indexForToken)};
255 }

References edm::ESInputTag::data(), esItemsToGetFromTransition_, visualization-live-secondInstance_cfg::m, m_esTokenInfo, m_tokenLabels, edm::ESInputTag::module(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by esConsumes().

◆ registeredToConsume()

bool EDConsumerBase::registeredToConsume ( ProductResolverIndex  iIndex,
bool  skipCurrentProcess,
BranchType  iBranch 
) const
Returns
true if the product corresponding to the index was registered via consumes or mayConsume call

Definition at line 356 of file EDConsumerBase.cc.

358  {
359  for (auto it = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); it != itEnd; ++it) {
360  if (it->m_index.productResolverIndex() == iIndex and it->m_index.skipCurrentProcess() == skipCurrentProcess and
361  it->m_branchType == iBranch) {
362  return true;
363  }
364  }
365  return false;
366 }

References kLookupInfo, and m_tokenInfo.

◆ registeredToConsumeMany()

bool EDConsumerBase::registeredToConsumeMany ( TypeID const &  iType,
BranchType  iBranch 
) const
Returns
true of TypeID corresponds to a type specified in a consumesMany call

Definition at line 368 of file EDConsumerBase.cc.

368  {
369  for (auto it = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); it != itEnd; ++it) {
370  //consumesMany entries do not have their index resolved
371  if (it->m_index.productResolverIndex() == ProductResolverIndexInvalid and it->m_type == iType and
372  it->m_branchType == iBranch) {
373  return true;
374  }
375  }
376  return false;
377 }

References kLookupInfo, m_tokenInfo, and edm::ProductResolverIndexInvalid.

◆ throwBadToken()

void EDConsumerBase::throwBadToken ( edm::TypeID const &  iType,
EDGetToken  iToken 
) const
private

Definition at line 392 of file EDConsumerBase.cc.

392  {
393  if (iToken.isUninitialized()) {
394  throw cms::Exception("BadToken") << "A get using a EDGetToken with the C++ type '" << iType.className()
395  << "' was made using an uninitialized token.\n Please check that the variable is "
396  "being initialized from a 'consumes' call.";
397  }
398  throw cms::Exception("BadToken")
399  << "A get using a EDGetToken with the C++ type '" << iType.className() << "' was made using a token with a value "
400  << iToken.index()
401  << " which is beyond the range used by this module.\n Please check that the variable is being initialized from a "
402  "'consumes' call from this module.\n You can not share EDGetToken values between modules.";
403 }

References edm::TypeID::className(), Exception, edm::EDGetToken::index(), and edm::EDGetToken::isUninitialized().

Referenced by indexFrom().

◆ throwBranchMismatch()

void EDConsumerBase::throwBranchMismatch ( BranchType  iBranch,
EDGetToken  iToken 
) const
private

Definition at line 385 of file EDConsumerBase.cc.

385  {
386  throw cms::Exception("BranchTypeMismatch")
387  << "A get using a EDGetToken was done in " << BranchTypeToString(iBranch) << " but the consumes call was for "
388  << BranchTypeToString(m_tokenInfo.get<kLookupInfo>(iToken.index()).m_branchType)
389  << ".\n Please modify the consumes call to use the correct branch type.";
390 }

References edm::BranchTypeToString(), Exception, edm::EDGetToken::index(), kLookupInfo, and m_tokenInfo.

Referenced by indexFrom().

◆ throwConsumesCallAfterFrozen()

void EDConsumerBase::throwConsumesCallAfterFrozen ( TypeToGet const &  typeToGet,
InputTag const &  inputTag 
) const
private

Definition at line 405 of file EDConsumerBase.cc.

405  {
406  throw cms::Exception("LogicError") << "A module declared it consumes a product after its constructor.\n"
407  << "This must be done in the contructor\n"
408  << "The product type was: " << typeToGet.type() << "\n"
409  << "and " << inputTag << "\n";
410 }

References Exception, SimL1EmulatorRepack_Full_cff::inputTag, and edm::TypeToGet::type().

Referenced by recordConsumes().

◆ throwTypeMismatch()

void EDConsumerBase::throwTypeMismatch ( edm::TypeID const &  iType,
EDGetToken  iToken 
) const
private

Definition at line 379 of file EDConsumerBase.cc.

379  {
380  throw cms::Exception("TypeMismatch") << "A get using a EDGetToken used the C++ type '" << iType.className()
381  << "' but the consumes call was for type '"
382  << m_tokenInfo.get<kLookupInfo>(iToken.index()).m_type.className()
383  << "'.\n Please modify either the consumes or get call so the types match.";
384 }

References edm::TypeID::className(), Exception, edm::EDGetToken::index(), kLookupInfo, and m_tokenInfo.

Referenced by indexFrom().

◆ uncheckedIndexFrom()

ProductResolverIndexAndSkipBit EDConsumerBase::uncheckedIndexFrom ( EDGetToken  iToken) const

◆ updateLookup() [1/2]

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

Definition at line 136 of file EDConsumerBase.cc.

138  {
139  frozen_ = true;
141  {
142  auto itKind = m_tokenInfo.begin<kKind>();
143  auto itLabels = m_tokenInfo.begin<kLabels>();
144  for (auto itInfo = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); itInfo != itEnd;
145  ++itInfo, ++itKind, ++itLabels) {
146  if (itInfo->m_branchType == iBranchType) {
147  const unsigned int labelStart = itLabels->m_startOfModuleLabel;
148  const char* moduleLabel = &(m_tokenLabels[labelStart]);
149  itInfo->m_index = ProductResolverIndexAndSkipBit(iHelper.index(*itKind,
150  itInfo->m_type,
151  moduleLabel,
152  moduleLabel + itLabels->m_deltaToProductInstance,
153  moduleLabel + itLabels->m_deltaToProcessName),
154  itInfo->m_index.skipCurrentProcess());
155  }
156  }
157  }
158 
159  //now add resolved requests to get many to the end of our list
160  // a get many will have an empty module label
161  for (size_t i = 0, iEnd = m_tokenInfo.size(); i != iEnd; ++i) {
162  //need to copy since pointer could be invalidated by emplace_back
163  auto const info = m_tokenInfo.get<kLookupInfo>(i);
164  if (info.m_branchType == iBranchType && info.m_index.productResolverIndex() == ProductResolverIndexInvalid &&
165  m_tokenLabels[m_tokenInfo.get<kLabels>(i).m_startOfModuleLabel] == '\0') {
166  //find all matching types
167  const auto kind = m_tokenInfo.get<kKind>(i);
168  auto matches = iHelper.relatedIndexes(kind, info.m_type);
169 
170  //NOTE: This could be changed to contain the true labels for what is being
171  // requested but for now I want to remember these are part of a get many
172  const LabelPlacement labels = m_tokenInfo.get<kLabels>(i);
173  bool alwaysGet = m_tokenInfo.get<kAlwaysGets>(i);
174  for (unsigned int j = 0; j != matches.numberOfMatches(); ++j) {
175  //only keep the ones that are for a specific data item and not a collection
176  if (matches.isFullyResolved(j)) {
177  auto index = matches.index(j);
178  m_tokenInfo.emplace_back(
179  TokenLookupInfo{info.m_type, index, info.m_index.skipCurrentProcess(), info.m_branchType},
180  alwaysGet,
181  labels,
182  kind);
183  }
184  }
185  }
186  }
187  m_tokenInfo.shrink_to_fit();
188 
189  itemsToGet(iBranchType, itemsToGetFromBranch_[iBranchType]);
190  if (iPrefetchMayGet) {
191  itemsMayGet(iBranchType, itemsToGetFromBranch_[iBranchType]);
192  }
193 }

References cms::cuda::assert(), containsCurrentProcessAlias_, frozen_, mps_fire::i, edm::ProductResolverIndexHelper::index(), info(), itemsMayGet(), itemsToGet(), itemsToGetFromBranch_, dqmiolumiharvest::j, kAlwaysGets, CalibrationSummaryClient_cfi::kind, kKind, kLabels, kLookupInfo, SummaryClient_cfi::labels, m_tokenInfo, m_tokenLabels, patCandidatesForDimuonsSequences_cff::matches, HerwigMaxPtPartonFilter_cfi::moduleLabel, edm::ProductResolverIndexInvalid, and edm::ProductResolverIndexHelper::relatedIndexes().

Referenced by edm::SubProcess::beginJob().

◆ updateLookup() [2/2]

void EDConsumerBase::updateLookup ( eventsetup::ESRecordsToProxyIndices const &  iPI)

Definition at line 195 of file EDConsumerBase.cc.

195  {
196  unsigned int index = 0;
197  for (auto it = m_esTokenInfo.begin<kESLookupInfo>(); it != m_esTokenInfo.end<kESLookupInfo>(); ++it, ++index) {
198  auto indexInRecord = iPI.indexInRecord(it->m_record, it->m_key);
200  const char* componentName = &(m_tokenLabels[it->m_startOfComponentName]);
201  if (*componentName) {
202  auto component = iPI.component(it->m_record, it->m_key);
203  if (component->label_.empty()) {
204  if (component->type_ != componentName) {
206  }
207  } else if (component->label_ != componentName) {
209  }
210  }
211  }
212  m_esTokenInfo.get<kESProxyIndex>(index) = indexInRecord;
213 
214  int negIndex = -1 * (index + 1);
215  for (auto& items : esItemsToGetFromTransition_) {
216  for (auto& itemIndex : items) {
217  if (itemIndex.value() == negIndex) {
218  itemIndex = indexInRecord;
219  negIndex = 1;
220  break;
221  }
222  }
223  if (negIndex > 0) {
224  break;
225  }
226  }
227  }
228 }

References edm::eventsetup::ESRecordsToProxyIndices::component(), esItemsToGetFromTransition_, edm::eventsetup::ESRecordsToProxyIndices::indexInRecord(), mps_monitormerge::items, kESLookupInfo, kESProxyIndex, m_esTokenInfo, m_tokenLabels, and edm::eventsetup::ESRecordsToProxyIndices::missingProxyIndex().

Friends And Related Function Documentation

◆ ConsumesCollector

friend class ConsumesCollector
friend

Definition at line 119 of file EDConsumerBase.h.

◆ WillGetIfMatch

template<typename T >
friend class WillGetIfMatch
friend

Definition at line 121 of file EDConsumerBase.h.

Member Data Documentation

◆ containsCurrentProcessAlias_

bool edm::EDConsumerBase::containsCurrentProcessAlias_
private

Definition at line 251 of file EDConsumerBase.h.

Referenced by convertCurrentProcessAlias(), recordConsumes(), and updateLookup().

◆ esItemsToGetFromTransition_

std::array<std::vector<ESProxyIndex>, static_cast<unsigned int>edm::Transition::NumberOfTransitions)> edm::EDConsumerBase::esItemsToGetFromTransition_
private

Definition at line 249 of file EDConsumerBase.h.

Referenced by esGetTokenIndices(), recordESConsumes(), and updateLookup().

◆ frozen_

bool edm::EDConsumerBase::frozen_
private

Definition at line 250 of file EDConsumerBase.h.

Referenced by convertCurrentProcessAlias(), recordConsumes(), and updateLookup().

◆ itemsToGetFromBranch_

std::array<std::vector<ProductResolverIndexAndSkipBit>, edm::NumBranchTypes> edm::EDConsumerBase::itemsToGetFromBranch_
private

Definition at line 229 of file EDConsumerBase.h.

Referenced by itemsToGetFrom(), and updateLookup().

◆ m_esTokenInfo

edm::SoATuple<ESTokenLookupInfo, ESProxyIndex> edm::EDConsumerBase::m_esTokenInfo
private

Definition at line 247 of file EDConsumerBase.h.

Referenced by labelFor(), recordESConsumes(), and updateLookup().

◆ m_tokenInfo

edm::SoATuple<TokenLookupInfo, bool, LabelPlacement, edm::KindOfType> edm::EDConsumerBase::m_tokenInfo
private

◆ m_tokenLabels

std::vector<char> edm::EDConsumerBase::m_tokenLabels
private
SummaryClient_cfi.labels
labels
Definition: SummaryClient_cfi.py:61
edm::InputTag::kCurrentProcess
static const std::string kCurrentProcess
Definition: InputTag.h:54
edm::ESTokenIndex
Definition: ESIndices.h:54
mps_fire.i
i
Definition: mps_fire.py:355
TypeToGet
start
Definition: start.py:1
LogMessageMonitor_cff.modules
modules
Definition: LogMessageMonitor_cff.py:7
edm::EDConsumerBase::esItemsToGetFromTransition_
std::array< std::vector< ESProxyIndex >, static_cast< unsigned int >edm::Transition::NumberOfTransitions)> esItemsToGetFromTransition_
Definition: EDConsumerBase.h:249
ESInputTag
edm::EDConsumerBase::recordConsumes
unsigned int recordConsumes(BranchType iBranch, TypeToGet const &iType, edm::InputTag const &iTag, bool iAlwaysGets)
Definition: EDConsumerBase.cc:85
modules
Definition: ZHLTMatchFilter.cc:17
edm::ProductResolverIndexAndSkipBit
Definition: ProductResolverIndexAndSkipBit.h:28
edm::EDConsumerBase::checkIfEmpty
edm::InputTag const & checkIfEmpty(edm::InputTag const &tag)
Definition: EDConsumerBase.cc:78
edm::EDConsumerBase::kLookupInfo
Definition: EDConsumerBase.h:222
edm::EDConsumerBase::m_esTokenInfo
edm::SoATuple< ESTokenLookupInfo, ESProxyIndex > m_esTokenInfo
Definition: EDConsumerBase.h:247
cms::cuda::assert
assert(be >=bs)
edm::ProductResolverIndexHelper::index
ProductResolverIndex index(KindOfType kindOfType, TypeID const &typeID, char const *moduleLabel, char const *instance, char const *process=nullptr) const
Definition: ProductResolverIndexHelper.cc:81
edm::eventsetup::DataKey
Definition: DataKey.h:29
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:152
edm::EDConsumerBase::kESProxyIndex
Definition: EDConsumerBase.h:246
edm::ProductResolverIndexHelper::relatedIndexes
Matches relatedIndexes(KindOfType kindOfType, TypeID const &typeID, char const *moduleLabel, char const *instance) const
Definition: ProductResolverIndexHelper.cc:142
edm::ProductResolverIndexHelper
Definition: ProductResolverIndexHelper.h:89
findQualityFiles.v
v
Definition: findQualityFiles.py:179
edm::EDConsumerBase::itemsMayGet
void itemsMayGet(BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
Definition: EDConsumerBase.cc:315
edm::EDConsumerBase::throwConsumesCallAfterFrozen
void throwConsumesCallAfterFrozen(TypeToGet const &, InputTag const &) const
Definition: EDConsumerBase.cc:405
edm::ESProxyIndex
Definition: ESIndices.h:29
mps_monitormerge.items
list items
Definition: mps_monitormerge.py:29
edm::EDConsumerBase::m_tokenLabels
std::vector< char > m_tokenLabels
Definition: EDConsumerBase.h:227
edm::EDConsumerBase::kESLookupInfo
Definition: EDConsumerBase.h:246
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
kWasEmpty
static const edm::InputTag kWasEmpty("@EmptyLabel@")
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
edm::eventsetup::default_record_t
typename default_record< T >::RecordT default_record_t
Definition: data_default_record_trait.h:68
edm::ESTokenIndex::value
constexpr Value_t value() const noexcept
Definition: ESIndices.h:69
edm::EDGetToken::isUninitialized
bool isUninitialized() const
Definition: EDGetToken.h:46
edm::EDConsumerBase::itemsToGet
void itemsToGet(BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
Definition: EDConsumerBase.cc:283
edm::InEvent
Definition: BranchType.h:11
edm::eventsetup::EventSetupRecordKey::makeKey
static EventSetupRecordKey makeKey()
Definition: EventSetupRecordKey.h:49
edm::eventsetup::ESRecordsToProxyIndices::missingProxyIndex
static constexpr ESProxyIndex missingProxyIndex() noexcept
Definition: ESRecordsToProxyIndices.h:48
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::EDConsumerBase::m_tokenInfo
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
Definition: EDConsumerBase.h:223
edm::EDGetToken::index
unsigned int index() const
Definition: EDGetToken.h:45
KineDebug3::count
void count()
Definition: KinematicConstrainedVertexUpdatorT.h:21
edm::EDConsumerBase::throwBadToken
void throwBadToken(edm::TypeID const &iType, EDGetToken iToken) const
Definition: EDConsumerBase.cc:392
edm::ProductResolverIndexInvalid
Definition: ProductResolverIndex.h:16
edm::EDConsumerBase::kLabels
Definition: EDConsumerBase.h:222
edm::EDConsumerBase::itemsToGetFromBranch_
std::array< std::vector< ProductResolverIndexAndSkipBit >, edm::NumBranchTypes > itemsToGetFromBranch_
Definition: EDConsumerBase.h:229
ESGetToken
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::EDConsumerBase::containsCurrentProcessAlias_
bool containsCurrentProcessAlias_
Definition: EDConsumerBase.h:251
CalibrationSummaryClient_cfi.kind
kind
Definition: CalibrationSummaryClient_cfi.py:37
SimL1EmulatorRepack_CalouGT_cff.processName
processName
Definition: SimL1EmulatorRepack_CalouGT_cff.py:17
EDGetToken
edm::EDConsumerBase::kKind
Definition: EDConsumerBase.h:222
TtFullHadDaughter::B
static const std::string B
Definition: TtFullHadronicEvent.h:9
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::EDConsumerBase::frozen_
bool frozen_
Definition: EDConsumerBase.h:250
LIKELY
#define LIKELY(x)
Definition: Likely.h:20
Exception
Definition: hltDiff.cc:246
edm::EDConsumerBase::labelFor
const char * labelFor(ESTokenIndex) const
Definition: EDConsumerBase.cc:591
edm::EDConsumerBase::throwBranchMismatch
void throwBranchMismatch(BranchType, EDGetToken) const
Definition: EDConsumerBase.cc:385
patCandidatesForDimuonsSequences_cff.matches
matches
Definition: patCandidatesForDimuonsSequences_cff.py:131
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
mps_fire.result
result
Definition: mps_fire.py:303
command_line.start
start
Definition: command_line.py:167
HerwigMaxPtPartonFilter_cfi.moduleLabel
moduleLabel
Definition: HerwigMaxPtPartonFilter_cfi.py:4
edm::EDConsumerBase::recordESConsumes
ESTokenIndex recordESConsumes(Transition, eventsetup::EventSetupRecordKey const &, eventsetup::heterocontainer::HCTypeTag const &, edm::ESInputTag const &iTag)
Definition: EDConsumerBase.cc:230
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
SimL1EmulatorRepack_Full_cff.inputTag
inputTag
Definition: SimL1EmulatorRepack_Full_cff.py:56
edm::BranchTypeToString
std::string const & BranchTypeToString(BranchType const &branchType)
Definition: BranchType.cc:98
edm::EDConsumerBase::kAlwaysGets
Definition: EDConsumerBase.h:222
edm::EDConsumerBase::throwTypeMismatch
void throwTypeMismatch(edm::TypeID const &, EDGetToken) const
Definition: EDConsumerBase.cc:379
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:39