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::core::OutputModuleCore edm::EDLooperBase edm::global::EDAnalyzerBase edm::global::EDFilterBase edm::global::EDProducerBase edm::limited::EDAnalyzerBase edm::limited::EDFilterBase edm::limited::EDProducerBase edm::one::EDAnalyzerBase edm::one::EDFilterBase edm::one::EDProducerBase 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, 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)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Private Types

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

Private Member Functions

edm::InputTag const & checkIfEmpty (edm::InputTag const &tag)
 
virtual void doSelectInputProcessBlocks (ProductRegistry const &, ProcessBlockHelperBase const &)
 
virtual void extendUpdateLookup (BranchType iBranchType, ProductResolverIndexHelper const &)
 
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)
 
virtual void registerLateConsumes (eventsetup::ESRecordsToProxyIndices const &)
 
void throwBadToken (edm::TypeID const &iType, EDGetToken iToken) const
 
void throwBranchMismatch (BranchType, EDGetToken) const
 
void throwConsumesCallAfterFrozen (TypeToGet const &, InputTag const &) const
 
void throwESConsumesCallAfterFrozen (eventsetup::EventSetupRecordKey const &, eventsetup::heterocontainer::HCTypeTag const &, edm::ESInputTag const &) const
 
void throwESConsumesInProcessBlock () const
 
void throwTypeMismatch (edm::TypeID const &, EDGetToken) const
 

Private Attributes

bool containsCurrentProcessAlias_
 
std::array< std::vector< ESProxyIndex >, static_cast< unsigned int >edm::Transition::NumberOfEventSetupTransitions)> esItemsToGetFromTransition_
 
std::array< std::vector< ESRecordIndex >, static_cast< unsigned int >edm::Transition::NumberOfEventSetupTransitions)> esRecordsToGetFromTransition_
 
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<BranchType B>
class EDConsumerBaseAdaptor
 
template<Transition Tr>
class EDConsumerBaseESAdaptor
 
template<Transition Tr>
class EDConsumerBaseWithTagESAdaptor
 
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 72 of file EDConsumerBase.h.

Member Typedef Documentation

◆ Labels

Definition at line 112 of file EDConsumerBase.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

◆ anonymous enum

anonymous enum
private
Enumerator
kESLookupInfo 
kESProxyIndex 

Definition at line 316 of file EDConsumerBase.h.

Constructor & Destructor Documentation

◆ EDConsumerBase() [1/3]

EDConsumerBase::EDConsumerBase ( )

Definition at line 40 of file EDConsumerBase.cc.

41  : m_tokenLabels{makeEmptyTokenLabels()}, frozen_(false), containsCurrentProcessAlias_(false) {}
std::vector< char > m_tokenLabels

◆ ~EDConsumerBase()

EDConsumerBase::~EDConsumerBase ( )
virtualnoexcept

Definition at line 43 of file EDConsumerBase.cc.

43 {}

◆ 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 55 of file EDConsumerBase.cc.

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

Referenced by consumes(), and mayConsume().

55  {
56  if (iTag.label().empty()) {
57  return kWasEmpty;
58  }
59  return iTag;
60 }
static const edm::InputTag kWasEmpty("@EmptyLabel@")

◆ consumes() [1/4]

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

Definition at line 161 of file EDConsumerBase.h.

References B, checkIfEmpty(), recordConsumes(), and makeGlobalPositionRcd_cfg::tag.

Referenced by AlCaECALRecHitReducer::AlCaECALRecHitReducer(), CAHitNtupletCUDAT< TrackerTraits >::CAHitNtupletCUDAT(), pat::CandidateSummaryTable::CandidateSummaryTable(), CrossingFramePSimHitToPSimHitsConverter::CrossingFramePSimHitToPSimHitsConverter(), EgammaEcalRecHitIsolationProducer::EgammaEcalRecHitIsolationProducer(), EgammaElectronTkIsolationProducer::EgammaElectronTkIsolationProducer(), EgammaIsoDetIdCollectionProducer< T1 >::EgammaIsoDetIdCollectionProducer(), EgammaIsoESDetIdCollectionProducer::EgammaIsoESDetIdCollectionProducer(), EgammaPhotonTkIsolationProducer::EgammaPhotonTkIsolationProducer(), EgammaPhotonTkNumIsolationProducer::EgammaPhotonTkNumIsolationProducer(), edm::EventContentAnalyzer::EventContentAnalyzer(), edmtest::ExistingDictionaryTestAnalyzer::ExistingDictionaryTestAnalyzer(), EcalDQMonitorTask::formSchedule(), edm::GenericConsumer::GenericConsumer(), HGCalValidator::HGCalValidator(), HLTMuonIsoFilter::HLTMuonIsoFilter(), HLTMuonPFIsoFilter::HLTMuonPFIsoFilter(), JetCollectionReducerT< T >::JetCollectionReducerT(), edm::core::OutputModuleCore::keepThisBranch(), edm::SubProcess::keepThisBranch(), L1Filter::L1Filter(), MaskedRctInputDigiProducer::MaskedRctInputDigiProducer(), MkFitEventOfHitsProducer::MkFitEventOfHitsProducer(), MkFitProducer::MkFitProducer(), MultiplicityCorrelator::MultiplicityCorrelator(), MultiTrackValidator::MultiTrackValidator(), pat::PATPackedCandidateProducer::PATPackedCandidateProducer(), PixelTrackDumpCUDAT< TrackerTraits >::PixelTrackDumpCUDAT(), PixelVertexProducerCUDAT< TrackerTraits >::PixelVertexProducerCUDAT(), PPSDiamondSampicTimingCalibrationPCLWorker::PPSDiamondSampicTimingCalibrationPCLWorker(), PPSTimingCalibrationPCLWorker::PPSTimingCalibrationPCLWorker(), ptHatFilter::ptHatFilter(), ShiftedParticleMETcorrInputProducer::ShiftedParticleMETcorrInputProducer(), SiStripMonitorDigi::SiStripMonitorDigi(), edm::SwitchProducer::SwitchProducer(), TestAlpakaHostDeviceCompare::TestAlpakaHostDeviceCompare(), edmtest::TestFindProduct::TestFindProduct(), TestHits::TestHits(), TestSmoothHits::TestSmoothHits(), TrackingParticleNumberOfLayersProducer::TrackingParticleNumberOfLayersProducer(), and l1tVertexFinder::VertexNTupler::VertexNTupler().

161  {
162  TypeToGet tid = TypeToGet::make<ProductType>();
163  return EDGetTokenT<ProductType>{recordConsumes(B, tid, checkIfEmpty(tag), true)};
164  }
Definition: APVGainStruct.h:7
unsigned int recordConsumes(BranchType iBranch, TypeToGet const &iType, edm::InputTag const &iTag, bool iAlwaysGets)
edm::InputTag const & checkIfEmpty(edm::InputTag const &tag)

◆ consumes() [2/4]

template<BranchType B = InEvent>
EDConsumerBaseAdaptor<B> edm::EDConsumerBase::consumes ( edm::InputTag  tag)
inlineprotectednoexcept

Definition at line 167 of file EDConsumerBase.h.

References eostools::move(), and makeGlobalPositionRcd_cfg::tag.

167  {
168  return EDConsumerBaseAdaptor<B>(this, std::move(tag));
169  }
def move(src, dest)
Definition: eostools.py:511

◆ consumes() [3/4]

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

Definition at line 171 of file EDConsumerBase.h.

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

171  {
172  return EDGetToken{recordConsumes(InEvent, id, checkIfEmpty(tag), true)};
173  }
unsigned int recordConsumes(BranchType iBranch, TypeToGet const &iType, edm::InputTag const &iTag, bool iAlwaysGets)
edm::InputTag const & checkIfEmpty(edm::InputTag const &tag)

◆ consumes() [4/4]

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

Definition at line 176 of file EDConsumerBase.h.

References B, checkIfEmpty(), recordConsumes(), and makeGlobalPositionRcd_cfg::tag.

176  {
177  return EDGetToken{recordConsumes(B, id, checkIfEmpty(tag), true)};
178  }
Definition: APVGainStruct.h:7
unsigned int recordConsumes(BranchType iBranch, TypeToGet const &iType, edm::InputTag const &iTag, bool iAlwaysGets)
edm::InputTag const & checkIfEmpty(edm::InputTag const &tag)

◆ consumesCollector()

ConsumesCollector EDConsumerBase::consumesCollector ( )
protected

Use a ConsumesCollector to gather consumes information from helper functions.

Definition at line 48 of file EDConsumerBase.cc.

References HltBtagPostValidation_cff::c.

Referenced by AlcaBeamMonitor::AlcaBeamMonitor(), AlcaBeamSpotProducer::AlcaBeamSpotProducer(), AlignmentMonitorAsAnalyzer::AlignmentMonitorAsAnalyzer(), IsolatedParticlesGeneratedJets::analyze(), OverlapValidation::analyze(), BeamMonitor::BeamMonitor(), BeamMonitorBx::BeamMonitorBx(), BeamSpotAnalyzer::BeamSpotAnalyzer(), CaloParticleDebugger::CaloParticleDebugger(), cms::CkfDebugTrackCandidateMaker::CkfDebugTrackCandidateMaker(), ConfigurableAnalysis::ConfigurableAnalysis(), CosmicSplitterValidation::CosmicSplitterValidation(), CSCMonitorModule::CSCMonitorModule(), edm::core::OutputModuleCore::doPreallocate_(), DTResidualCalibration::DTResidualCalibration(), DTT0Correction::DTT0Correction(), DTTPAnalyzer::DTTPAnalyzer(), DTTrigTest::DTTrigTest(), DTTTrigCorrection::DTTTrigCorrection(), DTTTrigOffsetCalibration::DTTTrigOffsetCalibration(), DTVDriftSegmentCalibration::DTVDriftSegmentCalibration(), DTVDriftWriter::DTVDriftWriter(), EcalCosmicsHists::EcalCosmicsHists(), EcalDQMonitorClient::EcalDQMonitorClient(), EcalDQMonitorTask::EcalDQMonitorTask(), EcalMEFormatter::EcalMEFormatter(), EcalMixingModuleValidation::EcalMixingModuleValidation(), EcalSelectiveReadoutValidation::EcalSelectiveReadoutValidation(), EcalTPGDBCopy::EcalTPGDBCopy(), EDMtoMEConverter::EDMtoMEConverter(), EgammaHLTClusterShapeProducer::EgammaHLTClusterShapeProducer(), EgammaHLTR9IDProducer::EgammaHLTR9IDProducer(), EGEnergyAnalyzer::EGEnergyAnalyzer(), ElectronIdMVAProducer::ElectronIdMVAProducer(), ElectronMVANtuplizer::ElectronMVANtuplizer(), EopTreeWriter::EopTreeWriter(), EventWithHistoryEDFilter::EventWithHistoryEDFilter(), FFTJetCorrectorDBReader::FFTJetCorrectorDBReader(), edm::FilterWrapper< T >::FilterWrapper(), edm::HadronizerFilter< HAD, DEC >::HadronizerFilter(), HcalIsoTrkAnalyzer::HcalIsoTrkAnalyzer(), HcalIsoTrkSimAnalyzer::HcalIsoTrkSimAnalyzer(), HcalOfflineHarvesting::HcalOfflineHarvesting(), HcalOnlineHarvesting::HcalOnlineHarvesting(), HLTBitAnalyzer::HLTBitAnalyzer(), HLTExoticaValidator::HLTExoticaValidator(), HLTMuonIsoFilter::HLTMuonIsoFilter(), IsolatedTracksCone::IsolatedTracksCone(), IsolatedTracksNxN::IsolatedTracksNxN(), L1CondDBPayloadWriterExt::L1CondDBPayloadWriterExt(), L1EventTreeProducer::L1EventTreeProducer(), L1MuGlobalMuonTrigger::L1MuGlobalMuonTrigger(), LogMessageMonitor::LogMessageMonitor(), MomentumConstraintProducer::MomentumConstraintProducer(), MultiplicityCorrelator::MultiplicityCorrelator(), MultiplicityInvestigator::MultiplicityInvestigator(), MultiplicityTimeCorrelations::MultiplicityTimeCorrelations(), MultiTrackValidator::MultiTrackValidator(), MuScleFit::MuScleFit(), OMTFPatternMaker::OMTFPatternMaker(), edm::core::OutputModuleCore::OutputModuleCore(), OverlapValidation::OverlapValidation(), edm::PathStatusFilter::PathStatusFilter(), PhotonIDValueMapProducer::PhotonIDValueMapProducer(), PhotonMVANtuplizer::PhotonMVANtuplizer(), PlottingDevice::PlottingDevice(), QuickTrackAssociatorByHitsProducer::QuickTrackAssociatorByHitsProducer(), ResidualRefitting::ResidualRefitting(), edm::SecSourceAnalyzer::SecSourceAnalyzer(), SingleTopTChannelLeptonDQM::SingleTopTChannelLeptonDQM(), SingleTopTChannelLeptonDQM_miniAOD::SingleTopTChannelLeptonDQM_miniAOD(), cms::SiPixelCondObjAllPayloadsReader::SiPixelCondObjAllPayloadsReader(), cms::SiPixelCondObjForHLTReader::SiPixelCondObjForHLTReader(), cms::SiPixelCondObjOfflineReader::SiPixelCondObjOfflineReader(), SiPixelStatusHarvester::SiPixelStatusHarvester(), SiStripAnalyser::SiStripAnalyser(), SiStripBadComponentInfo::SiStripBadComponentInfo(), SiStripDCSFilter::SiStripDCSFilter(), SiStripFineDelayHit::SiStripFineDelayHit(), SiStripMonitorCondDataOnDemandExample::SiStripMonitorCondDataOnDemandExample(), SiStripMonitorDigi::SiStripMonitorDigi(), SiStripQualityStatistics::SiStripQualityStatistics(), edm::SubProcess::SubProcess(), TagProbeFitTreeProducer::TagProbeFitTreeProducer(), TopDiLeptonOfflineDQM::TopDiLeptonOfflineDQM(), TopSingleLeptonDQM::TopSingleLeptonDQM(), TopSingleLeptonDQM_miniAOD::TopSingleLeptonDQM_miniAOD(), TriggerResultsFilter::TriggerResultsFilter(), and ValidIsoTrkCalib::ValidIsoTrkCalib().

◆ consumesInfo()

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

Definition at line 626 of file EDConsumerBase.cc.

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

626  {
627  // Use this to eliminate duplicate entries related
628  // to consumesMany items where only the type was specified
629  // and the there are multiple matches. In these cases the
630  // label, instance, and process will be empty.
631  std::set<edm::TypeID> alreadySeenTypes;
632 
633  std::vector<ConsumesInfo> result;
634  auto itAlways = m_tokenInfo.begin<kAlwaysGets>();
635  auto itKind = m_tokenInfo.begin<kKind>();
636  auto itLabels = m_tokenInfo.begin<kLabels>();
637  for (auto itInfo = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); itInfo != itEnd;
638  ++itInfo, ++itKind, ++itLabels, ++itAlways) {
639  const unsigned int labelStart = itLabels->m_startOfModuleLabel;
640  const char* consumedModuleLabel = &(m_tokenLabels[labelStart]);
641  const char* consumedInstance = consumedModuleLabel + itLabels->m_deltaToProductInstance;
642  const char* consumedProcessName = consumedModuleLabel + itLabels->m_deltaToProcessName;
643 
644  // consumesMany case
645  if (*consumedModuleLabel == '\0') {
646  if (!alreadySeenTypes.insert(itInfo->m_type).second) {
647  continue;
648  }
649  }
650 
651  // Just copy the information into the ConsumesInfo data structure
652  result.emplace_back(itInfo->m_type,
653  consumedModuleLabel,
654  consumedInstance,
655  consumedProcessName,
656  itInfo->m_branchType,
657  *itKind,
658  *itAlways,
659  itInfo->m_index.skipCurrentProcess());
660  }
661  return result;
662 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
std::vector< char > m_tokenLabels

◆ consumesMany() [1/3]

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

Definition at line 194 of file EDConsumerBase.h.

194  {
195  TypeToGet tid = TypeToGet::make<ProductType>();
196  consumesMany<B>(tid);
197  }

◆ consumesMany() [2/3]

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

Definition at line 199 of file EDConsumerBase.h.

References l1ctLayer2EG_cff::id.

199 { consumesMany<InEvent>(id); }

◆ consumesMany() [3/3]

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

Definition at line 202 of file EDConsumerBase.h.

References B, and recordConsumes().

202  {
203  recordConsumes(B, id, edm::InputTag{}, true);
204  }
Definition: APVGainStruct.h:7
unsigned int recordConsumes(BranchType iBranch, TypeToGet const &iType, edm::InputTag const &iTag, bool iAlwaysGets)

◆ convertCurrentProcessAlias()

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

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

Definition at line 580 of file EDConsumerBase.cc.

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

580  {
581  frozen_ = true;
582 
585 
586  auto newTokenLabels = makeEmptyTokenLabels();
587 
588  // first calculate the size of the new vector and reserve memory for it
589  std::vector<char>::size_type newSize = newTokenLabels.size();
590  std::string newProcessName;
591  for (auto iter = m_tokenInfo.begin<kLabels>(), itEnd = m_tokenInfo.end<kLabels>(); iter != itEnd; ++iter) {
592  newProcessName = &m_tokenLabels[iter->m_startOfModuleLabel + iter->m_deltaToProcessName];
593  if (newProcessName == InputTag::kCurrentProcess) {
594  newProcessName = processName;
595  }
596  newSize += (iter->m_deltaToProcessName + newProcessName.size() + 1);
597  }
598  newTokenLabels.reserve(newSize);
599 
600  unsigned int newStartOfModuleLabel = newTokenLabels.size();
601  for (auto iter = m_tokenInfo.begin<kLabels>(), itEnd = m_tokenInfo.end<kLabels>(); iter != itEnd; ++iter) {
602  unsigned int startOfModuleLabel = iter->m_startOfModuleLabel;
603  unsigned short deltaToProcessName = iter->m_deltaToProcessName;
604 
605  iter->m_startOfModuleLabel = newStartOfModuleLabel;
606 
607  newProcessName = &m_tokenLabels[startOfModuleLabel + deltaToProcessName];
608  if (newProcessName == InputTag::kCurrentProcess) {
609  newProcessName = processName;
610  }
611 
612  newStartOfModuleLabel += (deltaToProcessName + newProcessName.size() + 1);
613 
614  // Copy in both the module label and instance, they are the same
615  newTokenLabels.insert(newTokenLabels.end(),
616  m_tokenLabels.begin() + startOfModuleLabel,
617  m_tokenLabels.begin() + (startOfModuleLabel + deltaToProcessName));
618 
619  newTokenLabels.insert(newTokenLabels.end(), newProcessName.begin(), newProcessName.end());
620  newTokenLabels.push_back('\0');
621  }
622  m_tokenLabels = std::move(newTokenLabels);
623  }
624 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
uint16_t size_type
static const std::string kCurrentProcess
Definition: InputTag.h:54
std::vector< char > m_tokenLabels
def move(src, dest)
Definition: eostools.py:511

◆ doSelectInputProcessBlocks()

void EDConsumerBase::doSelectInputProcessBlocks ( ProductRegistry const &  ,
ProcessBlockHelperBase const &   
)
privatevirtual

Definition at line 423 of file EDConsumerBase.cc.

Referenced by selectInputProcessBlocks().

423 {}

◆ esConsumes() [1/5]

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

Definition at line 208 of file EDConsumerBase.h.

Referenced by edmtest::ESTestAnalyzerIncorrectConsumes::analyze(), APVShotsFilter::APVShotsFilter(), BeamConditionsMonitor::BeamConditionsMonitor(), DD4hep_TrackingMaterialAnalyser::DD4hep_TrackingMaterialAnalyser(), DisplayGeom::DisplayGeom(), DTConfigTester::DTConfigTester(), DTEtaPatternLutTester::DTEtaPatternLutTester(), DTExtLutTester::DTExtLutTester(), DTPhiLutTester::DTPhiLutTester(), DTPtaLutTester::DTPtaLutTester(), DTQualPatternLutTester::DTQualPatternLutTester(), DTTFMasksTester::DTTFMasksTester(), DTTFParametersTester::DTTFParametersTester(), DTVDriftCalibration::DTVDriftCalibration(), EcalLaserCondTools::EcalLaserCondTools(), EcalSRCondTools::EcalSRCondTools(), EgammaHLTBcHcalIsolationProducersRegional::EgammaHLTBcHcalIsolationProducersRegional(), EgammaHLTExtraProducer::EgammaHLTExtraProducer(), EgammaHLTHcalVarProducerFromRecHit::EgammaHLTHcalVarProducerFromRecHit(), EgammaHLTPhase2ExtraProducer::EgammaHLTPhase2ExtraProducer(), ElectronRegressionEnergyProducer::ElectronRegressionEnergyProducer(), FactorizedJetCorrectorDemo::FactorizedJetCorrectorDemo(), GlobalDigisProducer::GlobalDigisProducer(), HLTScoutingEgammaProducer::HLTScoutingEgammaProducer(), JetCorrectorDBReader::JetCorrectorDBReader(), JetCorrectorDemo::JetCorrectorDemo(), JetResolutionDBReader::JetResolutionDBReader(), JetResolutionDemo::JetResolutionDemo(), JetResolutionScaleFactorDBReader::JetResolutionScaleFactorDBReader(), L1CondDBIOVWriter::L1CondDBIOVWriter(), L1CondDBIOVWriterExt::L1CondDBIOVWriterExt(), L1GctConfigDump::L1GctConfigDump(), L1GtDataEmulAnalyzer::L1GtDataEmulAnalyzer(), L1GtVhdlWriter::L1GtVhdlWriter(), L1KeyListWriter::L1KeyListWriter(), L1KeyWriter::L1KeyWriter(), L1MuCSCTFParametersTester::L1MuCSCTFParametersTester(), L1O2OTestAnalyzer::L1O2OTestAnalyzer(), L1O2OTestAnalyzerExt::L1O2OTestAnalyzerExt(), L1TCaloParamsUpdater::L1TCaloParamsUpdater(), L1TCaloParamsViewer::L1TCaloParamsViewer(), L1TCaloStage2ParamsWriter::L1TCaloStage2ParamsWriter(), L1TGlobalPrescalesVetosViewer::L1TGlobalPrescalesVetosViewer(), L1TGlobalPrescalesVetosWriter::L1TGlobalPrescalesVetosWriter(), L1TMuonBarrelParamsWriter::L1TMuonBarrelParamsWriter(), L1TMuonEndCapForestWriter::L1TMuonEndCapForestWriter(), L1TMuonEndCapParamsWriter::L1TMuonEndCapParamsWriter(), L1TMuonGlobalParamsWriter::L1TMuonGlobalParamsWriter(), L1TMuonOverlapParamsWriter::L1TMuonOverlapParamsWriter(), L1TriggerKeyExtViewer::L1TriggerKeyExtViewer(), L1TriggerKeyListExtReader::L1TriggerKeyListExtReader(), MuonGeometryDBConverter::MuonGeometryDBConverter(), QGLikelihoodDBReader::QGLikelihoodDBReader(), QGLikelihoodSystematicsDBReader::QGLikelihoodSystematicsDBReader(), QGTagger::QGTagger(), RPCGeometryServTest::RPCGeometryServTest(), edmtest::RunLumiESAnalyzer::RunLumiESAnalyzer(), SiPixelGainCalibScaler::SiPixelGainCalibScaler(), SiStripApprox2Clusters::SiStripApprox2Clusters(), SiStripCommissioningSource::SiStripCommissioningSource(), SiStripCondVisualizer::SiStripCondVisualizer(), SiStripFineDelayHit::SiStripFineDelayHit(), SiStripGainRandomCalculator::SiStripGainRandomCalculator(), SiStripGainsCalibTreeWorker::SiStripGainsCalibTreeWorker(), SiStripGainsPCLWorker::SiStripGainsPCLWorker(), SiStripMonitorDigi::SiStripMonitorDigi(), TestHits::TestHits(), TestSmoothHits::TestSmoothHits(), TestTrackHits::TestTrackHits(), TrackingMaterialAnalyser::TrackingMaterialAnalyser(), ValidateGeometry::ValidateGeometry(), and edmtest::WhatsItAnalyzer::WhatsItAnalyzer().

208  {
209  return esConsumes<ESProduct, ESRecord, Tr>(ESInputTag{});
210  }

◆ esConsumes() [2/5]

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

Definition at line 213 of file EDConsumerBase.h.

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

213  {
214  auto index = recordESConsumes(Tr,
216  std::conditional_t<std::is_same_v<ESRecord, edm::DefaultRecord>,
217  eventsetup::default_record_t<ESHandleAdapter<ESProduct>>,
218  ESRecord>>(),
219  eventsetup::heterocontainer::HCTypeTag::make<ESProduct>(),
220  tag);
221  return ESGetToken<ESProduct, ESRecord>{static_cast<unsigned int>(Tr), index, labelFor(index)};
222  }
const char * labelFor(ESTokenIndex) const
typename default_record< T >::RecordT default_record_t
static EventSetupRecordKey makeKey()
ESTokenIndex recordESConsumes(Transition, eventsetup::EventSetupRecordKey const &, eventsetup::heterocontainer::HCTypeTag const &, edm::ESInputTag const &iTag)

◆ esConsumes() [3/5]

template<Transition Tr = Transition::Event>
constexpr auto edm::EDConsumerBase::esConsumes ( )
inlineprotected

Definition at line 225 of file EDConsumerBase.h.

225  {
226  return EDConsumerBaseESAdaptor<Tr>(this);
227  }

◆ esConsumes() [4/5]

template<Transition Tr = Transition::Event>
auto edm::EDConsumerBase::esConsumes ( ESInputTag  tag)
inlineprotected

Definition at line 230 of file EDConsumerBase.h.

References eostools::move(), and makeGlobalPositionRcd_cfg::tag.

230  {
231  return EDConsumerBaseWithTagESAdaptor<Tr>(this, std::move(tag));
232  }
def move(src, dest)
Definition: eostools.py:511

◆ esConsumes() [5/5]

template<Transition Tr = Transition::Event>
ESGetTokenGeneric edm::EDConsumerBase::esConsumes ( eventsetup::EventSetupRecordKey const &  iRecord,
eventsetup::DataKey const &  iKey 
)
inlineprotected

Used with EventSetupRecord::doGet.

Definition at line 236 of file EDConsumerBase.h.

References edm::eventsetup::DataKey::name(), recordESConsumes(), edm::eventsetup::EventSetupRecordKey::type(), edm::eventsetup::DataKey::type(), and edm::eventsetup::SimpleStringTag::value().

236  {
237  return ESGetTokenGeneric(static_cast<unsigned int>(Tr),
238  recordESConsumes(Tr, iRecord, iKey.type(), ESInputTag("", iKey.name().value())),
239  iRecord.type());
240  }
ESTokenIndex recordESConsumes(Transition, eventsetup::EventSetupRecordKey const &, eventsetup::heterocontainer::HCTypeTag const &, edm::ESInputTag const &iTag)

◆ esGetTokenIndices()

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

Definition at line 126 of file EDConsumerBase.h.

References esItemsToGetFromTransition_, edm::NumberOfEventSetupTransitions, and findQualityFiles::v.

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

126  {
128  auto const& v = esItemsToGetFromTransition_[static_cast<unsigned int>(iTrans)];
129  if (v.empty()) {
130  return nullptr;
131  }
132  return &(esItemsToGetFromTransition_[static_cast<unsigned int>(iTrans)].front());
133  }
134  return nullptr;
135  }
std::array< std::vector< ESProxyIndex >, static_cast< unsigned int >edm::Transition::NumberOfEventSetupTransitions)> esItemsToGetFromTransition_

◆ esGetTokenIndicesVector()

std::vector<ESProxyIndex> const& edm::EDConsumerBase::esGetTokenIndicesVector ( edm::Transition  iTrans) const
inline

Definition at line 137 of file EDConsumerBase.h.

References cms::cuda::assert(), esItemsToGetFromTransition_, and edm::NumberOfEventSetupTransitions.

Referenced by edm::EDLooperBase::esPrefetchAsync().

137  {
139  return esItemsToGetFromTransition_[static_cast<unsigned int>(iTrans)];
140  }
assert(be >=bs)
std::array< std::vector< ESProxyIndex >, static_cast< unsigned int >edm::Transition::NumberOfEventSetupTransitions)> esItemsToGetFromTransition_

◆ esGetTokenRecordIndicesVector()

std::vector<ESRecordIndex> const& edm::EDConsumerBase::esGetTokenRecordIndicesVector ( edm::Transition  iTrans) const
inline

Definition at line 142 of file EDConsumerBase.h.

References cms::cuda::assert(), esRecordsToGetFromTransition_, and edm::NumberOfEventSetupTransitions.

Referenced by edm::EDLooperBase::esPrefetchAsync().

142  {
144  return esRecordsToGetFromTransition_[static_cast<unsigned int>(iTrans)];
145  }
assert(be >=bs)
std::array< std::vector< ESRecordIndex >, static_cast< unsigned int >edm::Transition::NumberOfEventSetupTransitions)> esRecordsToGetFromTransition_

◆ extendUpdateLookup()

void EDConsumerBase::extendUpdateLookup ( BranchType  iBranchType,
ProductResolverIndexHelper const &   
)
privatevirtual

Reimplemented in edm::stream::impl::Transformer.

Definition at line 113 of file EDConsumerBase.cc.

Referenced by updateLookup().

113 {}

◆ indexFrom()

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

Definition at line 255 of file EDConsumerBase.cc.

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

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

257  {
258  if (UNLIKELY(iToken.index() >= m_tokenInfo.size())) {
259  throwBadToken(iType, iToken);
260  }
261  const auto& info = m_tokenInfo.get<kLookupInfo>(iToken.index());
262  if (LIKELY(iBranch == info.m_branchType)) {
263  if (LIKELY(iType == info.m_type)) {
264  return info.m_index;
265  } else {
266  throwTypeMismatch(iType, iToken);
267  }
268  } else {
269  throwBranchMismatch(iBranch, iToken);
270  }
272 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
static const TGPicture * info(bool iBackgroundIsBlack)
constexpr unsigned int index() const noexcept
Definition: EDGetToken.h:54
void throwTypeMismatch(edm::TypeID const &, EDGetToken) const
#define LIKELY(x)
Definition: Likely.h:20
void throwBadToken(edm::TypeID const &iType, EDGetToken iToken) const
#define UNLIKELY(x)
Definition: Likely.h:21
void throwBranchMismatch(BranchType, EDGetToken) const

◆ itemsMayGet()

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

Definition at line 310 of file EDConsumerBase.cc.

References submitPVResolutionJobs::count, kAlwaysGets, kLookupInfo, m_tokenInfo, and edm::ProductResolverIndexInvalid.

Referenced by updateLookup().

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

◆ itemsToGet()

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

Definition at line 278 of file EDConsumerBase.cc.

References submitPVResolutionJobs::count, kAlwaysGets, kLookupInfo, m_tokenInfo, and edm::ProductResolverIndexInvalid.

Referenced by updateLookup().

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

◆ itemsToGetFrom()

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

Definition at line 93 of file EDConsumerBase.h.

References itemsToGetFromBranch_.

Referenced by edm::EDLooperBase::edPrefetchAsync(), and edm::PrincipalGetAdapter::numberOfProductsConsumed().

93  {
94  return itemsToGetFromBranch_[iType];
95  }
std::array< std::vector< ProductResolverIndexAndSkipBit >, edm::NumBranchTypes > itemsToGetFromBranch_

◆ labelFor()

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

Definition at line 664 of file EDConsumerBase.cc.

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

Referenced by esConsumes().

664  {
665  return m_esTokenInfo.get<kESLookupInfo>(iIndex.value()).m_key.name().value();
666 }
constexpr Value_t value() const noexcept
Definition: ESIndices.h:70
edm::SoATuple< ESTokenLookupInfo, ESProxyIndex > m_esTokenInfo

◆ labelsForToken()

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

Definition at line 342 of file EDConsumerBase.cc.

References edm::EDGetToken::index(), kLabels, SummaryClient_cfi::labels, m_tokenInfo, m_tokenLabels, edm::ProductLabels::module, edm::ProductLabels::process, edm::ProductLabels::productInstance, and command_line::start.

Referenced by AlCaElectronsTest::analyze(), ContainmentCorrectionAnalyzer::analyze(), EnergyScaleAnalyzer::analyze(), PhotonValidator::analyze(), HLTScalers::analyze(), edmtest::TestGetterOfProductsA::analyze(), TrackingNtuple::analyze(), EgammaObjects::analyzeElectrons(), EgammaObjects::analyzePhotons(), HLTVertexPerformanceAnalyzer::dqmBeginRun(), HLTBTagPerformanceAnalyzer::dqmBeginRun(), TriggerBxMonitor::dqmBeginRun(), TriggerRatesMonitor::dqmBeginRun(), edmtest::TestGetterOfProductsA::endLuminosityBlock(), edmtest::TestGetterOfProductsA::endRun(), TrackingNtuple::fillSeeds(), TrackingNtuple::fillTracks(), edmtest::TestGetterOfProducts::filter(), EcalSimpleUncalibRecHitFilter::filter(), EcalMIPRecHitFilter::filter(), HLTBTagPerformanceAnalyzer::HLTBTagPerformanceAnalyzer(), HLTVertexPerformanceAnalyzer::HLTVertexPerformanceAnalyzer(), edm::PrincipalGetAdapter::labelsForToken(), edm::PrincipalGetAdapter::makeFailToGetException(), MultiTrackValidator::MultiTrackValidator(), HIPixelTrackFilterProducer::produce(), HIProtoTrackFilterProducer::produce(), and edm::PrincipalGetAdapter::throwAmbiguousException().

342  {
343  unsigned int index = iToken.index();
344  auto labels = m_tokenInfo.get<kLabels>(index);
345  unsigned int start = labels.m_startOfModuleLabel;
346  oLabels.module = &(m_tokenLabels[start]);
347  oLabels.productInstance = oLabels.module + labels.m_deltaToProductInstance;
348  oLabels.process = oLabels.module + labels.m_deltaToProcessName;
349 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
Definition: start.py:1
constexpr unsigned int index() const noexcept
Definition: EDGetToken.h:54
std::vector< char > m_tokenLabels

◆ mayConsume() [1/3]

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

Definition at line 181 of file EDConsumerBase.h.

References B, checkIfEmpty(), recordConsumes(), and makeGlobalPositionRcd_cfg::tag.

181  {
182  TypeToGet tid = TypeToGet::make<ProductType>();
183  return EDGetTokenT<ProductType>{recordConsumes(B, tid, checkIfEmpty(tag), false)};
184  }
Definition: APVGainStruct.h:7
unsigned int recordConsumes(BranchType iBranch, TypeToGet const &iType, edm::InputTag const &iTag, bool iAlwaysGets)
edm::InputTag const & checkIfEmpty(edm::InputTag const &tag)

◆ mayConsume() [2/3]

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

Definition at line 186 of file EDConsumerBase.h.

References l1ctLayer2EG_cff::id, and makeGlobalPositionRcd_cfg::tag.

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

◆ mayConsume() [3/3]

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

Definition at line 189 of file EDConsumerBase.h.

References B, checkIfEmpty(), recordConsumes(), and makeGlobalPositionRcd_cfg::tag.

189  {
190  return EDGetToken{recordConsumes(B, id, checkIfEmpty(tag), false)};
191  }
Definition: APVGainStruct.h:7
unsigned int recordConsumes(BranchType iBranch, TypeToGet const &iType, edm::InputTag const &iTag, bool iAlwaysGets)
edm::InputTag const & checkIfEmpty(edm::InputTag const &tag)

◆ modulesWhoseProductsAreConsumed()

void EDConsumerBase::modulesWhoseProductsAreConsumed ( std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &  modulesAll,
std::vector< ModuleProcessName > &  modulesInPreviousProcesses,
ProductRegistry const &  preg,
std::map< std::string, ModuleDescription const *> const &  labelsToDesc,
std::string const &  processName 
) const

Definition at line 481 of file EDConsumerBase.cc.

References dqmiolumiharvest::j, kKind, kLabels, kLookupInfo, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, m_tokenInfo, m_tokenLabels, oniaPATMuonsWithTrigger_cff::matches, callgraph::module, LogMessageMonitor_cff::modules, LaserDQM_cfg::process, SimL1EmulatorRepack_CalouGT_cff::processName, edm::ProductRegistry::productLookup(), and edm::ProductResolverIndexInvalid.

486  {
487  std::set<std::string> alreadyFound;
488 
489  auto modulesInPreviousProcessesEmplace = [&modulesInPreviousProcesses](std::string_view module,
490  std::string_view process) {
491  auto it = std::lower_bound(
492  modulesInPreviousProcesses.begin(), modulesInPreviousProcesses.end(), ModuleProcessName(module, process));
493  modulesInPreviousProcesses.emplace(it, module, process);
494  };
495 
496  auto itKind = m_tokenInfo.begin<kKind>();
497  auto itLabels = m_tokenInfo.begin<kLabels>();
498  for (auto itInfo = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); itInfo != itEnd;
499  ++itInfo, ++itKind, ++itLabels) {
500  ProductResolverIndexHelper const& helper = *preg.productLookup(itInfo->m_branchType);
501  std::vector<ModuleDescription const*>& modules = *modulesAll[itInfo->m_branchType];
502 
503  const unsigned int labelStart = itLabels->m_startOfModuleLabel;
504  const char* const consumedModuleLabel = &(m_tokenLabels[labelStart]);
505  const char* const consumedProductInstance = consumedModuleLabel + itLabels->m_deltaToProductInstance;
506  const char* const consumedProcessName = consumedModuleLabel + itLabels->m_deltaToProcessName;
507 
508  if (not itInfo->m_index.skipCurrentProcess()) {
509  if (*consumedModuleLabel != '\0') { // not a consumesMany
510  if (*consumedProcessName != '\0') { // process name is specified in consumes call
511  if (helper.index(
512  *itKind, itInfo->m_type, consumedModuleLabel, consumedProductInstance, consumedProcessName) !=
514  if (processName == consumedProcessName) {
515  insertFoundModuleLabel(*itKind,
516  itInfo->m_type,
517  consumedModuleLabel,
518  consumedProductInstance,
519  modules,
520  alreadyFound,
521  labelsToDesc,
522  preg);
523  } else {
524  // Product explicitly from different process than the current process, so must refer to an earlier process (unless it ends up "not found")
525  modulesInPreviousProcessesEmplace(consumedModuleLabel, consumedProcessName);
526  }
527  }
528  } else { // process name was empty
529  auto matches = helper.relatedIndexes(*itKind, itInfo->m_type, consumedModuleLabel, consumedProductInstance);
530  for (unsigned int j = 0; j < matches.numberOfMatches(); ++j) {
531  if (processName == matches.processName(j)) {
532  insertFoundModuleLabel(*itKind,
533  itInfo->m_type,
534  consumedModuleLabel,
535  consumedProductInstance,
536  modules,
537  alreadyFound,
538  labelsToDesc,
539  preg);
540  } else {
541  // Product did not match to current process, so must refer to an earlier process (unless it ends up "not found")
542  // Recall that empty process name means "in the latest process" that can change event-by-event
543  modulesInPreviousProcessesEmplace(consumedModuleLabel, matches.processName(j));
544  }
545  }
546  }
547  // consumesMany case
548  } else if (itInfo->m_index.productResolverIndex() == ProductResolverIndexInvalid) {
549  auto matches = helper.relatedIndexes(*itKind, itInfo->m_type);
550  for (unsigned int j = 0; j < matches.numberOfMatches(); ++j) {
551  if (processName == matches.processName(j)) {
552  insertFoundModuleLabel(*itKind,
553  itInfo->m_type,
554  matches.moduleLabel(j),
555  matches.productInstanceName(j),
556  modules,
557  alreadyFound,
558  labelsToDesc,
559  preg);
560  } else {
561  modulesInPreviousProcessesEmplace(matches.moduleLabel(j), matches.processName(j));
562  }
563  }
564  }
565  } else {
566  // The skipCurrentProcess means the same as empty process name,
567  // except the current process is skipped. Therefore need to do
568  // the same matching as above. There is no consumesMany branch
569  // in this case.
570  auto matches = helper.relatedIndexes(*itKind, itInfo->m_type, consumedModuleLabel, consumedProductInstance);
571  for (unsigned int j = 0; j < matches.numberOfMatches(); ++j) {
572  if (processName != matches.processName(j)) {
573  modulesInPreviousProcessesEmplace(matches.moduleLabel(j), matches.processName(j));
574  }
575  }
576  }
577  }
578 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
Definition: helper.py:1
std::vector< char > m_tokenLabels

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ recordConsumes()

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

Definition at line 62 of file EDConsumerBase.cc.

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().

65  {
66  if (frozen_) {
67  throwConsumesCallAfterFrozen(iType, iTag);
68  }
69 
70  unsigned int index = m_tokenInfo.size();
71 
72  bool skipCurrentProcess = iTag.willSkipCurrentProcess();
73 
74  const size_t labelSize = iTag.label().size();
75  const size_t productInstanceSize = iTag.instance().size();
76  unsigned int labelStart = m_tokenLabels.size();
77  unsigned short delta1 = labelSize + 1;
78  unsigned short delta2 = labelSize + 2 + productInstanceSize;
79  m_tokenInfo.emplace_back(TokenLookupInfo{iType.type(), ProductResolverIndexInvalid, skipCurrentProcess, iBranch},
80  iAlwaysGets,
81  LabelPlacement{labelStart, delta1, delta2},
82  iType.kind());
83 
84  const size_t additionalSize = skipCurrentProcess ? labelSize + productInstanceSize + 3
85  : labelSize + productInstanceSize + iTag.process().size() + 3;
86 
87  m_tokenLabels.reserve(m_tokenLabels.size() + additionalSize);
88  {
89  const std::string& m = iTag.label();
90  m_tokenLabels.insert(m_tokenLabels.end(), m.begin(), m.end());
91  m_tokenLabels.push_back('\0');
92  }
93  {
94  const std::string& m = iTag.instance();
95  m_tokenLabels.insert(m_tokenLabels.end(), m.begin(), m.end());
96  m_tokenLabels.push_back('\0');
97  }
98  {
99  const std::string& m = iTag.process();
100  if (m == InputTag::kCurrentProcess) {
102  }
103  if (!skipCurrentProcess) {
104  m_tokenLabels.insert(m_tokenLabels.end(), m.begin(), m.end());
105  m_tokenLabels.push_back('\0');
106  } else {
107  m_tokenLabels.push_back('\0');
108  }
109  }
110  return index;
111 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
static const std::string kCurrentProcess
Definition: InputTag.h:54
std::vector< char > m_tokenLabels
void throwConsumesCallAfterFrozen(TypeToGet const &, InputTag const &) const

◆ recordESConsumes()

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

Definition at line 217 of file EDConsumerBase.cc.

References edm::ESInputTag::data(), esItemsToGetFromTransition_, esRecordsToGetFromTransition_, frozen_, visualization-live-secondInstance_cfg::m, m_esTokenInfo, m_tokenLabels, edm::ESInputTag::module(), edm::NumberOfEventSetupTransitions, findQualityFiles::size, AlCaHLTBitMon_QueryRunRegistry::string, throwESConsumesCallAfterFrozen(), and throwESConsumesInProcessBlock().

Referenced by esConsumes().

220  {
221  if (frozen_) {
222  throwESConsumesCallAfterFrozen(iRecord, iDataType, iTag);
223  }
224 
225  //m_tokenLabels first entry is a null. Since most ES data requests have
226  // empty labels we will assume we can reuse the first entry
227  unsigned int startOfComponentName = 0;
228  if (not iTag.module().empty()) {
229  startOfComponentName = m_tokenLabels.size();
230 
231  m_tokenLabels.reserve(m_tokenLabels.size() + iTag.module().size() + 1);
232  {
233  const std::string& m = iTag.module();
234  m_tokenLabels.insert(m_tokenLabels.end(), m.begin(), m.end());
235  m_tokenLabels.push_back('\0');
236  }
237  }
238 
239  auto index = static_cast<ESProxyIndex::Value_t>(m_esTokenInfo.size());
240  m_esTokenInfo.emplace_back(
241  ESTokenLookupInfo{iRecord, eventsetup::DataKey{iDataType, iTag.data().c_str()}, startOfComponentName},
242  ESProxyIndex{-1});
245  }
246  auto indexForToken = esItemsToGetFromTransition_[static_cast<unsigned int>(iTrans)].size();
247  esItemsToGetFromTransition_[static_cast<unsigned int>(iTrans)].emplace_back(-1 * (index + 1));
248  esRecordsToGetFromTransition_[static_cast<unsigned int>(iTrans)].emplace_back();
249  return ESTokenIndex{static_cast<ESTokenIndex::Value_t>(indexForToken)};
250 }
size
Write out results.
void throwESConsumesInProcessBlock() const
std::array< std::vector< ESProxyIndex >, static_cast< unsigned int >edm::Transition::NumberOfEventSetupTransitions)> esItemsToGetFromTransition_
void throwESConsumesCallAfterFrozen(eventsetup::EventSetupRecordKey const &, eventsetup::heterocontainer::HCTypeTag const &, edm::ESInputTag const &) const
std::array< std::vector< ESRecordIndex >, static_cast< unsigned int >edm::Transition::NumberOfEventSetupTransitions)> esRecordsToGetFromTransition_
std::vector< char > m_tokenLabels
edm::SoATuple< ESTokenLookupInfo, ESProxyIndex > m_esTokenInfo

◆ 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 351 of file EDConsumerBase.cc.

References kLookupInfo, and m_tokenInfo.

353  {
354  for (auto it = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); it != itEnd; ++it) {
355  if (it->m_index.productResolverIndex() == iIndex and it->m_index.skipCurrentProcess() == skipCurrentProcess and
356  it->m_branchType == iBranch) {
357  return true;
358  }
359  }
360  return false;
361 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > 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 363 of file EDConsumerBase.cc.

References kLookupInfo, m_tokenInfo, and edm::ProductResolverIndexInvalid.

363  {
364  for (auto it = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); it != itEnd; ++it) {
365  //consumesMany entries do not have their index resolved
366  if (it->m_index.productResolverIndex() == ProductResolverIndexInvalid and it->m_type == iType and
367  it->m_branchType == iBranch) {
368  return true;
369  }
370  }
371  return false;
372 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo

◆ registerLateConsumes()

virtual void edm::EDConsumerBase::registerLateConsumes ( eventsetup::ESRecordsToProxyIndices const &  )
inlineprivatevirtual

Reimplemented in FWLiteESRecordWriterAnalyzer, and edm::EventSetupRecordDataGetter.

Definition at line 247 of file EDConsumerBase.h.

Referenced by updateLookup().

247 {}

◆ resetItemsToGetFrom()

void edm::EDConsumerBase::resetItemsToGetFrom ( BranchType  iType)
inlineprotected

Definition at line 243 of file EDConsumerBase.h.

References itemsToGetFromBranch_.

Referenced by edm::core::OutputModuleCore::doBeginJob_().

243 { itemsToGetFromBranch_[iType].clear(); }
std::array< std::vector< ProductResolverIndexAndSkipBit >, edm::NumBranchTypes > itemsToGetFromBranch_

◆ selectInputProcessBlocks()

void edm::EDConsumerBase::selectInputProcessBlocks ( ProductRegistry const &  productRegistry,
ProcessBlockHelperBase const &  processBlockHelperBase 
)
inline

Definition at line 107 of file EDConsumerBase.h.

References doSelectInputProcessBlocks().

108  {
109  doSelectInputProcessBlocks(productRegistry, processBlockHelperBase);
110  }
virtual void doSelectInputProcessBlocks(ProductRegistry const &, ProcessBlockHelperBase const &)

◆ throwBadToken()

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

Definition at line 387 of file EDConsumerBase.cc.

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

Referenced by indexFrom().

387  {
388  if (iToken.isUninitialized()) {
389  throw cms::Exception("BadToken") << "A get using a EDGetToken with the C++ type '" << iType.className()
390  << "' was made using an uninitialized token.\n Please check that the variable is "
391  "being initialized from a 'consumes' call.";
392  }
393  throw cms::Exception("BadToken")
394  << "A get using a EDGetToken with the C++ type '" << iType.className() << "' was made using a token with a value "
395  << iToken.index()
396  << " which is beyond the range used by this module.\n Please check that the variable is being initialized from a "
397  "'consumes' call from this module.\n You can not share EDGetToken values between modules.";
398 }
constexpr unsigned int index() const noexcept
Definition: EDGetToken.h:54
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:55

◆ throwBranchMismatch()

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

Definition at line 380 of file EDConsumerBase.cc.

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

Referenced by indexFrom().

380  {
381  throw cms::Exception("BranchTypeMismatch")
382  << "A get using a EDGetToken was done in " << BranchTypeToString(iBranch) << " but the consumes call was for "
383  << BranchTypeToString(m_tokenInfo.get<kLookupInfo>(iToken.index()).m_branchType)
384  << ".\n Please modify the consumes call to use the correct branch type.";
385 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
constexpr unsigned int index() const noexcept
Definition: EDGetToken.h:54
std::string const & BranchTypeToString(BranchType const &branchType)
Definition: BranchType.cc:93

◆ throwConsumesCallAfterFrozen()

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

Definition at line 400 of file EDConsumerBase.cc.

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

Referenced by recordConsumes().

400  {
401  throw cms::Exception("LogicError") << "A module declared it consumes a product after its constructor.\n"
402  << "This must be done in the contructor\n"
403  << "The product type was: " << typeToGet.type() << "\n"
404  << "and " << inputTag << "\n";
405 }

◆ throwESConsumesCallAfterFrozen()

void EDConsumerBase::throwESConsumesCallAfterFrozen ( eventsetup::EventSetupRecordKey const &  iRecord,
eventsetup::heterocontainer::HCTypeTag const &  iDataType,
edm::ESInputTag const &  iTag 
) const
private

Definition at line 407 of file EDConsumerBase.cc.

References Exception, edm::eventsetup::heterocontainer::HCTypeTag::name(), and edm::eventsetup::EventSetupRecordKey::type().

Referenced by recordESConsumes().

409  {
410  throw cms::Exception("LogicError") << "A module declared it consumes an EventSetup product after its constructor.\n"
411  << "This must be done in the contructor\n"
412  << "The product type was: " << iDataType.name() << " in record "
413  << iRecord.type().name() << "\n"
414  << "and ESInputTag was " << iTag << "\n";
415 }

◆ throwESConsumesInProcessBlock()

void EDConsumerBase::throwESConsumesInProcessBlock ( ) const
private

Definition at line 417 of file EDConsumerBase.cc.

References Exception.

Referenced by recordESConsumes().

417  {
418  throw cms::Exception("LogicError")
419  << "A module declared it consumes an EventSetup product during a ProcessBlock transition.\n"
420  << "EventSetup products can only be consumed in Event, Lumi, or Run transitions.\n";
421 }

◆ throwTypeMismatch()

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

Definition at line 374 of file EDConsumerBase.cc.

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

Referenced by indexFrom().

374  {
375  throw cms::Exception("TypeMismatch") << "A get using a EDGetToken used the C++ type '" << iType.className()
376  << "' but the consumes call was for type '"
377  << m_tokenInfo.get<kLookupInfo>(iToken.index()).m_type.className()
378  << "'.\n Please modify either the consumes or get call so the types match.";
379 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
constexpr unsigned int index() const noexcept
Definition: EDGetToken.h:54

◆ uncheckedIndexFrom()

ProductResolverIndexAndSkipBit EDConsumerBase::uncheckedIndexFrom ( EDGetToken  iToken) const

Definition at line 274 of file EDConsumerBase.cc.

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

Referenced by edm::core::OutputModuleCore::productsUsedBySelection().

274  {
275  return m_tokenInfo.get<kLookupInfo>(iToken.index()).m_index;
276 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
constexpr unsigned int index() const noexcept
Definition: EDGetToken.h:54

◆ updateLookup() [1/2]

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

Definition at line 115 of file EDConsumerBase.cc.

References cms::cuda::assert(), containsCurrentProcessAlias_, extendUpdateLookup(), 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, oniaPATMuonsWithTrigger_cff::matches, HerwigMaxPtPartonFilter_cfi::moduleLabel, edm::ProductResolverIndexInvalid, and edm::ProductResolverIndexHelper::relatedIndexes().

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

117  {
118  frozen_ = true;
120  extendUpdateLookup(iBranchType, iHelper);
121  {
122  auto itKind = m_tokenInfo.begin<kKind>();
123  auto itLabels = m_tokenInfo.begin<kLabels>();
124  for (auto itInfo = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); itInfo != itEnd;
125  ++itInfo, ++itKind, ++itLabels) {
126  if (itInfo->m_branchType == iBranchType) {
127  const unsigned int labelStart = itLabels->m_startOfModuleLabel;
128  const char* moduleLabel = &(m_tokenLabels[labelStart]);
129  itInfo->m_index = ProductResolverIndexAndSkipBit(iHelper.index(*itKind,
130  itInfo->m_type,
131  moduleLabel,
132  moduleLabel + itLabels->m_deltaToProductInstance,
133  moduleLabel + itLabels->m_deltaToProcessName),
134  itInfo->m_index.skipCurrentProcess());
135  }
136  }
137  }
138 
139  //now add resolved requests to get many to the end of our list
140  // a get many will have an empty module label
141  for (size_t i = 0, iEnd = m_tokenInfo.size(); i != iEnd; ++i) {
142  //need to copy since pointer could be invalidated by emplace_back
143  auto const info = m_tokenInfo.get<kLookupInfo>(i);
144  if (info.m_branchType == iBranchType && info.m_index.productResolverIndex() == ProductResolverIndexInvalid &&
145  m_tokenLabels[m_tokenInfo.get<kLabels>(i).m_startOfModuleLabel] == '\0') {
146  //find all matching types
147  const auto kind = m_tokenInfo.get<kKind>(i);
148  auto matches = iHelper.relatedIndexes(kind, info.m_type);
149 
150  //NOTE: This could be changed to contain the true labels for what is being
151  // requested but for now I want to remember these are part of a get many
152  const LabelPlacement labels = m_tokenInfo.get<kLabels>(i);
153  bool alwaysGet = m_tokenInfo.get<kAlwaysGets>(i);
154  for (unsigned int j = 0; j != matches.numberOfMatches(); ++j) {
155  //only keep the ones that are for a specific data item and not a collection
156  if (matches.isFullyResolved(j)) {
157  auto index = matches.index(j);
158  m_tokenInfo.emplace_back(
159  TokenLookupInfo{info.m_type, index, info.m_index.skipCurrentProcess(), info.m_branchType},
160  alwaysGet,
161  labels,
162  kind);
163  }
164  }
165  }
166  }
167  m_tokenInfo.shrink_to_fit();
168 
169  itemsToGet(iBranchType, itemsToGetFromBranch_[iBranchType]);
170  if (iPrefetchMayGet) {
171  itemsMayGet(iBranchType, itemsToGetFromBranch_[iBranchType]);
172  }
173 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
static const TGPicture * info(bool iBackgroundIsBlack)
virtual void extendUpdateLookup(BranchType iBranchType, ProductResolverIndexHelper const &)
void itemsToGet(BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
assert(be >=bs)
std::vector< char > m_tokenLabels
void itemsMayGet(BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
std::array< std::vector< ProductResolverIndexAndSkipBit >, edm::NumBranchTypes > itemsToGetFromBranch_

◆ updateLookup() [2/2]

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

Definition at line 175 of file EDConsumerBase.cc.

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

175  {
176  // temporarily unfreeze to allow late EventSetup consumes registration
177  frozen_ = false;
179  frozen_ = true;
180 
181  unsigned int index = 0;
182  for (auto it = m_esTokenInfo.begin<kESLookupInfo>(); it != m_esTokenInfo.end<kESLookupInfo>(); ++it, ++index) {
183  auto indexInRecord = iPI.indexInRecord(it->m_record, it->m_key);
185  const char* componentName = &(m_tokenLabels[it->m_startOfComponentName]);
186  if (*componentName) {
187  auto component = iPI.component(it->m_record, it->m_key);
188  if (component->label_.empty()) {
189  if (component->type_ != componentName) {
191  }
192  } else if (component->label_ != componentName) {
194  }
195  }
196  }
197  m_esTokenInfo.get<kESProxyIndex>(index) = indexInRecord;
198 
199  int negIndex = -1 * (index + 1);
200  for (auto& items : esItemsToGetFromTransition_) {
201  for (auto& itemIndex : items) {
202  if (itemIndex.value() == negIndex) {
203  itemIndex = indexInRecord;
204  esRecordsToGetFromTransition_[&items - &esItemsToGetFromTransition_.front()][&itemIndex - &items.front()] =
205  iPI.recordIndexFor(it->m_record);
206  negIndex = 1;
207  break;
208  }
209  }
210  if (negIndex > 0) {
211  break;
212  }
213  }
214  }
215 }
std::array< std::vector< ESProxyIndex >, static_cast< unsigned int >edm::Transition::NumberOfEventSetupTransitions)> esItemsToGetFromTransition_
virtual void registerLateConsumes(eventsetup::ESRecordsToProxyIndices const &)
std::array< std::vector< ESRecordIndex >, static_cast< unsigned int >edm::Transition::NumberOfEventSetupTransitions)> esRecordsToGetFromTransition_
static constexpr ESProxyIndex missingProxyIndex() noexcept
std::vector< char > m_tokenLabels
edm::SoATuple< ESTokenLookupInfo, ESProxyIndex > m_esTokenInfo

Friends And Related Function Documentation

◆ ConsumesCollector

friend class ConsumesCollector
friend

Definition at line 148 of file EDConsumerBase.h.

◆ EDConsumerBaseAdaptor

template<BranchType B>
friend class EDConsumerBaseAdaptor
friend

Definition at line 154 of file EDConsumerBase.h.

◆ EDConsumerBaseESAdaptor

template<Transition Tr>
friend class EDConsumerBaseESAdaptor
friend

Definition at line 150 of file EDConsumerBase.h.

◆ EDConsumerBaseWithTagESAdaptor

template<Transition Tr>
friend class EDConsumerBaseWithTagESAdaptor
friend

Definition at line 152 of file EDConsumerBase.h.

◆ WillGetIfMatch

template<typename T >
friend class WillGetIfMatch
friend

Definition at line 156 of file EDConsumerBase.h.

Member Data Documentation

◆ containsCurrentProcessAlias_

bool edm::EDConsumerBase::containsCurrentProcessAlias_
private

Definition at line 323 of file EDConsumerBase.h.

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

◆ esItemsToGetFromTransition_

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

◆ esRecordsToGetFromTransition_

std::array<std::vector<ESRecordIndex>, static_cast<unsigned int>edm::Transition::NumberOfEventSetupTransitions)> edm::EDConsumerBase::esRecordsToGetFromTransition_
private

Definition at line 321 of file EDConsumerBase.h.

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

◆ frozen_

bool edm::EDConsumerBase::frozen_
private

◆ itemsToGetFromBranch_

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

Definition at line 299 of file EDConsumerBase.h.

Referenced by itemsToGetFrom(), resetItemsToGetFrom(), and updateLookup().

◆ m_esTokenInfo

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

Definition at line 317 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