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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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 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, kESResolverIndex }
 

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 &)
 
unsigned int recordConsumes (BranchType iBranch, TypeToGet const &iType, edm::InputTag const &iTag, bool iAlwaysGets)
 
std::tuple< ESTokenIndex, char const * > recordESConsumes (Transition, eventsetup::EventSetupRecordKey const &, eventsetup::heterocontainer::HCTypeTag const &, edm::ESInputTag const &iTag)
 
virtual void registerLateConsumes (eventsetup::ESRecordsToProductResolverIndices 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< ESResolverIndex >, 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, ESResolverIndexm_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 73 of file EDConsumerBase.h.

Member Typedef Documentation

◆ Labels

Definition at line 111 of file EDConsumerBase.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

◆ anonymous enum

anonymous enum
private
Enumerator
kESLookupInfo 
kESResolverIndex 

Definition at line 300 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 160 of file EDConsumerBase.h.

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

Referenced by AlCaECALRecHitReducer::AlCaECALRecHitReducer(), AllLayerClusterToTracksterAssociatorsProducer::AllLayerClusterToTracksterAssociatorsProducer(), AllTracksterToSimTracksterAssociatorsByHitsProducer::AllTracksterToSimTracksterAssociatorsByHitsProducer(), AllTracksterToSimTracksterAssociatorsByLCsProducer::AllTracksterToSimTracksterAssociatorsByLCsProducer(), CAHitNtupletCUDAT< TrackerTraits >::CAHitNtupletCUDAT(), pat::CandidateSummaryTable::CandidateSummaryTable(), CrossingFramePSimHitToPSimHitsConverter::CrossingFramePSimHitToPSimHitsConverter(), EgammaElectronTkIsolationProducer::EgammaElectronTkIsolationProducer(), EgammaIsoDetIdCollectionProducer< T1 >::EgammaIsoDetIdCollectionProducer(), EgammaIsoESDetIdCollectionProducer::EgammaIsoESDetIdCollectionProducer(), EgammaPhotonTkIsolationProducer::EgammaPhotonTkIsolationProducer(), EgammaPhotonTkNumIsolationProducer::EgammaPhotonTkNumIsolationProducer(), edm::EventContentAnalyzer::EventContentAnalyzer(), edmtest::ExistingDictionaryTestAnalyzer::ExistingDictionaryTestAnalyzer(), FinalBxSelector::FinalBxSelector(), EcalDQMonitorTask::formSchedule(), edm::GenericConsumer::GenericConsumer(), HGCalLayerClusterHeterogeneousDumper::HGCalLayerClusterHeterogeneousDumper(), HGCalLayerClusterHeterogeneousSoADumper::HGCalLayerClusterHeterogeneousSoADumper(), HGCalValidator::HGCalValidator(), HLTMuonIsoFilter::HLTMuonIsoFilter(), HLTMuonPFIsoFilter::HLTMuonPFIsoFilter(), JetCollectionReducerT< T >::JetCollectionReducerT(), edm::core::OutputModuleCore::keepThisBranch(), edm::SubProcess::keepThisBranch(), L1Filter::L1Filter(), LCToCPAssociatorByEnergyScoreProducer< HIT >::LCToCPAssociatorByEnergyScoreProducer(), LCToSCAssociatorByEnergyScoreProducer< HIT >::LCToSCAssociatorByEnergyScoreProducer(), 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(), SiStripApprox2Clusters::SiStripApprox2Clusters(), SiStripMonitorDigi::SiStripMonitorDigi(), edm::SwitchProducer::SwitchProducer(), TestAlpakaHostDeviceCompare::TestAlpakaHostDeviceCompare(), edmtest::TestFindProduct::TestFindProduct(), TestHits::TestHits(), TestSmoothHits::TestSmoothHits(), TICLDumper::TICLDumper(), TrackingParticleNumberOfLayersProducer::TrackingParticleNumberOfLayersProducer(), and l1tVertexFinder::VertexNTupler::VertexNTupler().

160  {
161  TypeToGet tid = TypeToGet::make<ProductType>();
162  return EDGetTokenT<ProductType>{recordConsumes(B, tid, checkIfEmpty(tag), true)};
163  }
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 166 of file EDConsumerBase.h.

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

166  {
167  return EDConsumerBaseAdaptor<B>(this, std::move(tag));
168  }
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 170 of file EDConsumerBase.h.

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

170  {
171  return EDGetToken{recordConsumes(InEvent, id, checkIfEmpty(tag), true)};
172  }
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 175 of file EDConsumerBase.h.

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

175  {
176  return EDGetToken{recordConsumes(B, id, checkIfEmpty(tag), true)};
177  }
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 DummyCfis::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(), L1GTAlgoBlockProducer::L1GTAlgoBlockProducer(), 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().

48  {
49  ConsumesCollector c{this};
50  return c;
51 }

◆ consumesInfo()

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

Definition at line 569 of file EDConsumerBase.cc.

References cms::cuda::assert(), kAlwaysGets, kKind, kLabels, kLookupInfo, m_tokenInfo, m_tokenLabels, and mps_fire::result.

569  {
570  std::vector<ConsumesInfo> result;
571  auto itAlways = m_tokenInfo.begin<kAlwaysGets>();
572  auto itKind = m_tokenInfo.begin<kKind>();
573  auto itLabels = m_tokenInfo.begin<kLabels>();
574  for (auto itInfo = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); itInfo != itEnd;
575  ++itInfo, ++itKind, ++itLabels, ++itAlways) {
576  const unsigned int labelStart = itLabels->m_startOfModuleLabel;
577  const char* consumedModuleLabel = &(m_tokenLabels[labelStart]);
578  const char* consumedInstance = consumedModuleLabel + itLabels->m_deltaToProductInstance;
579  const char* consumedProcessName = consumedModuleLabel + itLabels->m_deltaToProcessName;
580 
581  assert(*consumedModuleLabel != '\0');
582 
583  // Just copy the information into the ConsumesInfo data structure
584  result.emplace_back(itInfo->m_type,
585  consumedModuleLabel,
586  consumedInstance,
587  consumedProcessName,
588  itInfo->m_branchType,
589  *itKind,
590  *itAlways,
591  itInfo->m_index.skipCurrentProcess());
592  }
593  return result;
594 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
assert(be >=bs)
std::vector< char > m_tokenLabels

◆ convertCurrentProcessAlias()

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

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

Definition at line 523 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.

523  {
524  frozen_ = true;
525 
528 
529  auto newTokenLabels = makeEmptyTokenLabels();
530 
531  // first calculate the size of the new vector and reserve memory for it
532  std::vector<char>::size_type newSize = newTokenLabels.size();
533  std::string newProcessName;
534  for (auto iter = m_tokenInfo.begin<kLabels>(), itEnd = m_tokenInfo.end<kLabels>(); iter != itEnd; ++iter) {
535  newProcessName = &m_tokenLabels[iter->m_startOfModuleLabel + iter->m_deltaToProcessName];
536  if (newProcessName == InputTag::kCurrentProcess) {
537  newProcessName = processName;
538  }
539  newSize += (iter->m_deltaToProcessName + newProcessName.size() + 1);
540  }
541  newTokenLabels.reserve(newSize);
542 
543  unsigned int newStartOfModuleLabel = newTokenLabels.size();
544  for (auto iter = m_tokenInfo.begin<kLabels>(), itEnd = m_tokenInfo.end<kLabels>(); iter != itEnd; ++iter) {
545  unsigned int startOfModuleLabel = iter->m_startOfModuleLabel;
546  unsigned short deltaToProcessName = iter->m_deltaToProcessName;
547 
548  iter->m_startOfModuleLabel = newStartOfModuleLabel;
549 
550  newProcessName = &m_tokenLabels[startOfModuleLabel + deltaToProcessName];
551  if (newProcessName == InputTag::kCurrentProcess) {
552  newProcessName = processName;
553  }
554 
555  newStartOfModuleLabel += (deltaToProcessName + newProcessName.size() + 1);
556 
557  // Copy in both the module label and instance, they are the same
558  newTokenLabels.insert(newTokenLabels.end(),
559  m_tokenLabels.begin() + startOfModuleLabel,
560  m_tokenLabels.begin() + (startOfModuleLabel + deltaToProcessName));
561 
562  newTokenLabels.insert(newTokenLabels.end(), newProcessName.begin(), newProcessName.end());
563  newTokenLabels.push_back('\0');
564  }
565  m_tokenLabels = std::move(newTokenLabels);
566  }
567 }
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 386 of file EDConsumerBase.cc.

Referenced by selectInputProcessBlocks().

386 {}

◆ esConsumes() [1/5]

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

Definition at line 194 of file EDConsumerBase.h.

Referenced by edmtest::ESTestAnalyzerIncorrectConsumes::analyze(), APVShotsFilter::APVShotsFilter(), BeamConditionsMonitor::BeamConditionsMonitor(), BeamSpotOnlineShifter::BeamSpotOnlineShifter(), 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(), module::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(), SiStripGainPayloadCopyAndExclude::SiStripGainPayloadCopyAndExclude(), SiStripGainRandomCalculator::SiStripGainRandomCalculator(), SiStripGainsCalibTreeWorker::SiStripGainsCalibTreeWorker(), SiStripGainsPCLWorker::SiStripGainsPCLWorker(), SiStripHitResolFromCalibTree::SiStripHitResolFromCalibTree(), SiStripMonitorDigi::SiStripMonitorDigi(), TestHits::TestHits(), TestSmoothHits::TestSmoothHits(), TestTrackHits::TestTrackHits(), TrackingMaterialAnalyser::TrackingMaterialAnalyser(), ValidateGeometry::ValidateGeometry(), edmtest::WhatsItAnalyzer::WhatsItAnalyzer(), and WriteTotemDAQMapping::WriteTotemDAQMapping().

194  {
195  return esConsumes<ESProduct, ESRecord, Tr>(ESInputTag{});
196  }

◆ esConsumes() [2/5]

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

Definition at line 199 of file EDConsumerBase.h.

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

199  {
200  auto [index, productLabel] =
201  recordESConsumes(Tr,
203  std::conditional_t<std::is_same_v<ESRecord, edm::DefaultRecord>,
204  eventsetup::default_record_t<ESHandleAdapter<ESProduct>>,
205  ESRecord>>(),
206  eventsetup::heterocontainer::HCTypeTag::make<ESProduct>(),
207  tag);
208  return ESGetToken<ESProduct, ESRecord>{static_cast<unsigned int>(Tr), index, productLabel};
209  }
typename default_record< T >::RecordT default_record_t
std::tuple< ESTokenIndex, char const * > recordESConsumes(Transition, eventsetup::EventSetupRecordKey const &, eventsetup::heterocontainer::HCTypeTag const &, edm::ESInputTag const &iTag)
static EventSetupRecordKey makeKey()

◆ esConsumes() [3/5]

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

Definition at line 212 of file EDConsumerBase.h.

212  {
213  return EDConsumerBaseESAdaptor<Tr>(this);
214  }

◆ esConsumes() [4/5]

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

Definition at line 217 of file EDConsumerBase.h.

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

217  {
218  return EDConsumerBaseWithTagESAdaptor<Tr>(this, std::move(tag));
219  }
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 223 of file EDConsumerBase.h.

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

223  {
224  auto [index, productLabel] = recordESConsumes(Tr, iRecord, iKey.type(), ESInputTag("", iKey.name().value()));
225  return ESGetTokenGeneric(static_cast<unsigned int>(Tr), index, iRecord.type());
226  }
std::tuple< ESTokenIndex, char const * > recordESConsumes(Transition, eventsetup::EventSetupRecordKey const &, eventsetup::heterocontainer::HCTypeTag const &, edm::ESInputTag const &iTag)

◆ esGetTokenIndices()

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

Definition at line 125 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().

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

◆ esGetTokenIndicesVector()

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

Definition at line 136 of file EDConsumerBase.h.

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

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

◆ esGetTokenRecordIndicesVector()

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

Definition at line 141 of file EDConsumerBase.h.

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

141  {
143  return esRecordsToGetFromTransition_[static_cast<unsigned int>(iTrans)];
144  }
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 229 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_().

231  {
232  if (UNLIKELY(iToken.index() >= m_tokenInfo.size())) {
233  throwBadToken(iType, iToken);
234  }
235  const auto& info = m_tokenInfo.get<kLookupInfo>(iToken.index());
236  if (LIKELY(iBranch == info.m_branchType)) {
237  if (LIKELY(iType == info.m_type)) {
238  return info.m_index;
239  } else {
240  throwTypeMismatch(iType, iToken);
241  }
242  } else {
243  throwBranchMismatch(iBranch, iToken);
244  }
246 }
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 284 of file EDConsumerBase.cc.

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

Referenced by updateLookup().

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

◆ itemsToGet()

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

Definition at line 252 of file EDConsumerBase.cc.

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

Referenced by updateLookup().

252  {
253  //how many are we adding?
254  unsigned int count = 0;
255  {
256  auto itAlwaysGet = m_tokenInfo.begin<kAlwaysGets>();
257  for (auto it = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); it != itEnd;
258  ++it, ++itAlwaysGet) {
259  if (iBranch == it->m_branchType) {
260  if (it->m_index.productResolverIndex() != ProductResolverIndexInvalid) {
261  if (*itAlwaysGet) {
262  ++count;
263  }
264  }
265  }
266  }
267  }
268  oIndices.reserve(oIndices.size() + count);
269  {
270  auto itAlwaysGet = m_tokenInfo.begin<kAlwaysGets>();
271  for (auto it = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); it != itEnd;
272  ++it, ++itAlwaysGet) {
273  if (iBranch == it->m_branchType) {
274  if (it->m_index.productResolverIndex() != ProductResolverIndexInvalid) {
275  if (*itAlwaysGet) {
276  oIndices.push_back(it->m_index);
277  }
278  }
279  }
280  }
281  }
282 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo

◆ itemsToGetFrom()

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

Definition at line 94 of file EDConsumerBase.h.

References itemsToGetFromBranch_.

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

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

◆ labelsForToken()

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

Definition at line 316 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 isotrackNtupler::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(), edm::impl::InputProcessBlockCacheImpl< CacheTypes... >::selectInputProcessBlocks(), and edm::PrincipalGetAdapter::throwAmbiguousException().

316  {
317  unsigned int index = iToken.index();
318  auto labels = m_tokenInfo.get<kLabels>(index);
319  unsigned int start = labels.m_startOfModuleLabel;
320  oLabels.module = &(m_tokenLabels[start]);
321  oLabels.productInstance = oLabels.module + labels.m_deltaToProductInstance;
322  oLabels.process = oLabels.module + labels.m_deltaToProcessName;
323 }
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 180 of file EDConsumerBase.h.

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

180  {
181  TypeToGet tid = TypeToGet::make<ProductType>();
182  return EDGetTokenT<ProductType>{recordConsumes(B, tid, checkIfEmpty(tag), false)};
183  }
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

◆ mayConsume() [3/3]

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

Definition at line 188 of file EDConsumerBase.h.

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

188  {
189  return EDGetToken{recordConsumes(B, id, checkIfEmpty(tag), false)};
190  }
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 444 of file EDConsumerBase.cc.

References cms::cuda::assert(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, dqmiolumiharvest::j, kKind, kLabels, kLookupInfo, pfDeepBoostedJetPreprocessParams_cfi::lower_bound, m_tokenInfo, m_tokenLabels, oniaPATMuonsWithTrigger_cff::matches, callgraph::module, LaserDQM_cfg::process, SimL1EmulatorRepack_CalouGT_cff::processName, edm::ProductRegistry::productLookup(), and edm::ProductResolverIndexInvalid.

449  {
450  std::set<std::string> alreadyFound;
451 
452  auto modulesInPreviousProcessesEmplace = [&modulesInPreviousProcesses](std::string_view module,
453  std::string_view process) {
454  auto it = std::lower_bound(
455  modulesInPreviousProcesses.begin(), modulesInPreviousProcesses.end(), ModuleProcessName(module, process));
456  modulesInPreviousProcesses.emplace(it, module, process);
457  };
458 
459  auto itKind = m_tokenInfo.begin<kKind>();
460  auto itLabels = m_tokenInfo.begin<kLabels>();
461  for (auto itInfo = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); itInfo != itEnd;
462  ++itInfo, ++itKind, ++itLabels) {
463  ProductResolverIndexHelper const& helper = *preg.productLookup(itInfo->m_branchType);
464  std::vector<ModuleDescription const*>& modules = *modulesAll[itInfo->m_branchType];
465 
466  const unsigned int labelStart = itLabels->m_startOfModuleLabel;
467  const char* const consumedModuleLabel = &(m_tokenLabels[labelStart]);
468  const char* const consumedProductInstance = consumedModuleLabel + itLabels->m_deltaToProductInstance;
469  const char* const consumedProcessName = consumedModuleLabel + itLabels->m_deltaToProcessName;
470 
471  if (not itInfo->m_index.skipCurrentProcess()) {
472  assert(*consumedModuleLabel != '\0'); // consumesMany used to create empty labels before we removed consumesMany
473  if (*consumedProcessName != '\0') { // process name is specified in consumes call
474  if (helper.index(*itKind, itInfo->m_type, consumedModuleLabel, consumedProductInstance, consumedProcessName) !=
476  if (processName == consumedProcessName) {
477  insertFoundModuleLabel(*itKind,
478  itInfo->m_type,
479  consumedModuleLabel,
480  consumedProductInstance,
481  modules,
482  alreadyFound,
483  labelsToDesc,
484  preg);
485  } else {
486  // Product explicitly from different process than the current process, so must refer to an earlier process (unless it ends up "not found")
487  modulesInPreviousProcessesEmplace(consumedModuleLabel, consumedProcessName);
488  }
489  }
490  } else { // process name was empty
491  auto matches = helper.relatedIndexes(*itKind, itInfo->m_type, consumedModuleLabel, consumedProductInstance);
492  for (unsigned int j = 0; j < matches.numberOfMatches(); ++j) {
493  if (processName == matches.processName(j)) {
494  insertFoundModuleLabel(*itKind,
495  itInfo->m_type,
496  consumedModuleLabel,
497  consumedProductInstance,
498  modules,
499  alreadyFound,
500  labelsToDesc,
501  preg);
502  } else {
503  // Product did not match to current process, so must refer to an earlier process (unless it ends up "not found")
504  // Recall that empty process name means "in the latest process" that can change event-by-event
505  modulesInPreviousProcessesEmplace(consumedModuleLabel, matches.processName(j));
506  }
507  }
508  }
509  } else {
510  // The skipCurrentProcess means the same as empty process name,
511  // except the current process is skipped. Therefore need to do
512  // the same matching as above.
513  auto matches = helper.relatedIndexes(*itKind, itInfo->m_type, consumedModuleLabel, consumedProductInstance);
514  for (unsigned int j = 0; j < matches.numberOfMatches(); ++j) {
515  if (processName != matches.processName(j)) {
516  modulesInPreviousProcessesEmplace(matches.moduleLabel(j), matches.processName(j));
517  }
518  }
519  }
520  }
521 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
Definition: helper.py:1
assert(be >=bs)
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(), 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()

std::tuple< ESTokenIndex, char const * > EDConsumerBase::recordESConsumes ( Transition  iTrans,
eventsetup::EventSetupRecordKey const &  iRecord,
eventsetup::heterocontainer::HCTypeTag const &  iDataType,
edm::ESInputTag const &  iTag 
)
private

Definition at line 189 of file EDConsumerBase.cc.

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

Referenced by esConsumes().

193  {
194  if (frozen_) {
195  throwESConsumesCallAfterFrozen(iRecord, iDataType, iTag);
196  }
197 
198  //m_tokenLabels first entry is a null. Since most ES data requests have
199  // empty labels we will assume we can reuse the first entry
200  unsigned int startOfComponentName = 0;
201  if (not iTag.module().empty()) {
202  startOfComponentName = m_tokenLabels.size();
203 
204  m_tokenLabels.reserve(m_tokenLabels.size() + iTag.module().size() + 1);
205  {
206  const std::string& m = iTag.module();
207  m_tokenLabels.insert(m_tokenLabels.end(), m.begin(), m.end());
208  m_tokenLabels.push_back('\0');
209  }
210  }
211 
212  auto index = static_cast<ESResolverIndex::Value_t>(m_esTokenInfo.size());
213  m_esTokenInfo.emplace_back(
214  ESTokenLookupInfo{iRecord, eventsetup::DataKey{iDataType, iTag.data().c_str()}, startOfComponentName},
215  ESResolverIndex{-1});
218  }
219  auto indexForToken = esItemsToGetFromTransition_[static_cast<unsigned int>(iTrans)].size();
220  esItemsToGetFromTransition_[static_cast<unsigned int>(iTrans)].emplace_back(-1 * (index + 1));
221  esRecordsToGetFromTransition_[static_cast<unsigned int>(iTrans)].emplace_back();
222  return {ESTokenIndex{static_cast<ESTokenIndex::Value_t>(indexForToken)},
223  m_esTokenInfo.get<kESLookupInfo>(index).m_key.name().value()};
224 }
size
Write out results.
void throwESConsumesInProcessBlock() const
void throwESConsumesCallAfterFrozen(eventsetup::EventSetupRecordKey const &, eventsetup::heterocontainer::HCTypeTag const &, edm::ESInputTag const &) const
std::array< std::vector< ESResolverIndex >, static_cast< unsigned int >edm::Transition::NumberOfEventSetupTransitions)> esItemsToGetFromTransition_
std::array< std::vector< ESRecordIndex >, static_cast< unsigned int >edm::Transition::NumberOfEventSetupTransitions)> esRecordsToGetFromTransition_
std::vector< char > m_tokenLabels
edm::SoATuple< ESTokenLookupInfo, ESResolverIndex > 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 325 of file EDConsumerBase.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, kLookupInfo, and m_tokenInfo.

327  {
328  for (auto it = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); it != itEnd; ++it) {
329  if (it->m_index.productResolverIndex() == iIndex and it->m_index.skipCurrentProcess() == skipCurrentProcess and
330  it->m_branchType == iBranch) {
331  return true;
332  }
333  }
334  return false;
335 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo

◆ registerLateConsumes()

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

Reimplemented in FWLiteESRecordWriterAnalyzer, and edm::EventSetupRecordDataGetter.

Definition at line 233 of file EDConsumerBase.h.

Referenced by updateLookup().

233 {}

◆ resetItemsToGetFrom()

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

Definition at line 229 of file EDConsumerBase.h.

References itemsToGetFromBranch_.

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

229 { 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 106 of file EDConsumerBase.h.

References doSelectInputProcessBlocks().

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

◆ throwBadToken()

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

Definition at line 350 of file EDConsumerBase.cc.

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

Referenced by indexFrom().

350  {
351  if (iToken.isUninitialized()) {
352  throw cms::Exception("BadToken") << "A get using a EDGetToken with the C++ type '" << iType.className()
353  << "' was made using an uninitialized token.\n Please check that the variable is "
354  "being initialized from a 'consumes' call.";
355  }
356  throw cms::Exception("BadToken")
357  << "A get using a EDGetToken with the C++ type '" << iType.className() << "' was made using a token with a value "
358  << iToken.index()
359  << " which is beyond the range used by this module.\n Please check that the variable is being initialized from a "
360  "'consumes' call from this module.\n You can not share EDGetToken values between modules.";
361 }
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 343 of file EDConsumerBase.cc.

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

Referenced by indexFrom().

343  {
344  throw cms::Exception("BranchTypeMismatch")
345  << "A get using a EDGetToken was done in " << BranchTypeToString(iBranch) << " but the consumes call was for "
346  << BranchTypeToString(m_tokenInfo.get<kLookupInfo>(iToken.index()).m_branchType)
347  << ".\n Please modify the consumes call to use the correct branch type.";
348 }
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 363 of file EDConsumerBase.cc.

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

Referenced by recordConsumes().

363  {
364  throw cms::Exception("LogicError") << "A module declared it consumes a product after its constructor.\n"
365  << "This must be done in the contructor\n"
366  << "The product type was: " << typeToGet.type() << "\n"
367  << "and " << inputTag << "\n";
368 }

◆ throwESConsumesCallAfterFrozen()

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

Definition at line 370 of file EDConsumerBase.cc.

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

Referenced by recordESConsumes().

372  {
373  throw cms::Exception("LogicError") << "A module declared it consumes an EventSetup product after its constructor.\n"
374  << "This must be done in the contructor\n"
375  << "The product type was: " << iDataType.name() << " in record "
376  << iRecord.type().name() << "\n"
377  << "and ESInputTag was " << iTag << "\n";
378 }

◆ throwESConsumesInProcessBlock()

void EDConsumerBase::throwESConsumesInProcessBlock ( ) const
private

Definition at line 380 of file EDConsumerBase.cc.

References Exception.

Referenced by recordESConsumes().

380  {
381  throw cms::Exception("LogicError")
382  << "A module declared it consumes an EventSetup product during a ProcessBlock transition.\n"
383  << "EventSetup products can only be consumed in Event, Lumi, or Run transitions.\n";
384 }

◆ throwTypeMismatch()

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

Definition at line 337 of file EDConsumerBase.cc.

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

Referenced by indexFrom().

337  {
338  throw cms::Exception("TypeMismatch") << "A get using a EDGetToken used the C++ type '" << iType.className()
339  << "' but the consumes call was for type '"
340  << m_tokenInfo.get<kLookupInfo>(iToken.index()).m_type.className()
341  << "'.\n Please modify either the consumes or get call so the types match.";
342 }
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 248 of file EDConsumerBase.cc.

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

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

248  {
249  return m_tokenInfo.get<kLookupInfo>(iToken.index()).m_index;
250 }
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_, edm::ProductResolverIndexHelper::index(), itemsMayGet(), itemsToGet(), itemsToGetFromBranch_, kKind, kLabels, kLookupInfo, m_tokenInfo, m_tokenLabels, and HerwigMaxPtPartonFilter_cfi::moduleLabel.

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  m_tokenInfo.shrink_to_fit();
140 
141  itemsToGet(iBranchType, itemsToGetFromBranch_[iBranchType]);
142  if (iPrefetchMayGet) {
143  itemsMayGet(iBranchType, itemsToGetFromBranch_[iBranchType]);
144  }
145 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
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::ESRecordsToProductResolverIndices const &  iPI)

Definition at line 147 of file EDConsumerBase.cc.

References edm::eventsetup::ESRecordsToProductResolverIndices::component(), esItemsToGetFromTransition_, esRecordsToGetFromTransition_, frozen_, edm::eventsetup::ESRecordsToProductResolverIndices::indexInRecord(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, mps_monitormerge::items, kESLookupInfo, kESResolverIndex, m_esTokenInfo, m_tokenLabels, edm::ESResolverIndex::moduleLabelDoesNotMatch(), edm::ESResolverIndex::noResolverConfigured(), edm::eventsetup::ESRecordsToProductResolverIndices::recordIndexFor(), and registerLateConsumes().

147  {
148  // temporarily unfreeze to allow late EventSetup consumes registration
149  frozen_ = false;
151  frozen_ = true;
152 
153  unsigned int index = 0;
154  for (auto it = m_esTokenInfo.begin<kESLookupInfo>(); it != m_esTokenInfo.end<kESLookupInfo>(); ++it, ++index) {
155  auto indexInRecord = iPI.indexInRecord(it->m_record, it->m_key);
156  if (indexInRecord != ESResolverIndex::noResolverConfigured()) {
157  const char* componentName = &(m_tokenLabels[it->m_startOfComponentName]);
158  if (*componentName) {
159  auto component = iPI.component(it->m_record, it->m_key);
160  if (component->label_.empty()) {
161  if (component->type_ != componentName) {
163  }
164  } else if (component->label_ != componentName) {
166  }
167  }
168  }
169  m_esTokenInfo.get<kESResolverIndex>(index) = indexInRecord;
170 
171  int negIndex = -1 * (index + 1);
172  for (auto& items : esItemsToGetFromTransition_) {
173  for (auto& itemIndex : items) {
174  if (itemIndex.value() == negIndex) {
175  itemIndex = indexInRecord;
176  esRecordsToGetFromTransition_[&items - &esItemsToGetFromTransition_.front()][&itemIndex - &items.front()] =
177  iPI.recordIndexFor(it->m_record);
178  negIndex = 1;
179  break;
180  }
181  }
182  if (negIndex > 0) {
183  break;
184  }
185  }
186  }
187 }
static constexpr ESResolverIndex moduleLabelDoesNotMatch() noexcept
Definition: ESIndices.h:50
std::array< std::vector< ESResolverIndex >, static_cast< unsigned int >edm::Transition::NumberOfEventSetupTransitions)> esItemsToGetFromTransition_
std::array< std::vector< ESRecordIndex >, static_cast< unsigned int >edm::Transition::NumberOfEventSetupTransitions)> esRecordsToGetFromTransition_
std::vector< char > m_tokenLabels
virtual void registerLateConsumes(eventsetup::ESRecordsToProductResolverIndices const &)
static constexpr ESResolverIndex noResolverConfigured() noexcept
Definition: ESIndices.h:46
edm::SoATuple< ESTokenLookupInfo, ESResolverIndex > m_esTokenInfo

Friends And Related Function Documentation

◆ ConsumesCollector

friend class ConsumesCollector
friend

Definition at line 147 of file EDConsumerBase.h.

◆ EDConsumerBaseAdaptor

template<BranchType B>
friend class EDConsumerBaseAdaptor
friend

Definition at line 153 of file EDConsumerBase.h.

◆ EDConsumerBaseESAdaptor

template<Transition Tr>
friend class EDConsumerBaseESAdaptor
friend

Definition at line 149 of file EDConsumerBase.h.

◆ EDConsumerBaseWithTagESAdaptor

template<Transition Tr>
friend class EDConsumerBaseWithTagESAdaptor
friend

Definition at line 151 of file EDConsumerBase.h.

◆ WillGetIfMatch

template<typename T >
friend class WillGetIfMatch
friend

Definition at line 155 of file EDConsumerBase.h.

Member Data Documentation

◆ containsCurrentProcessAlias_

bool edm::EDConsumerBase::containsCurrentProcessAlias_
private

Definition at line 307 of file EDConsumerBase.h.

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

◆ esItemsToGetFromTransition_

std::array<std::vector<ESResolverIndex>, 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 305 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 283 of file EDConsumerBase.h.

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

◆ m_esTokenInfo

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

Definition at line 301 of file EDConsumerBase.h.

Referenced by 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