CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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::EDAnalyzer edm::EDFilter edm::EDLooperBase edm::EDProducer 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< B > consumes (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 () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
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 &)
 
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::NumBranchTypes
itemsToGetFromBranch_
 
edm::SoATuple
< ESTokenLookupInfo,
ESProxyIndex
m_esTokenInfo
 
edm::SoATuple< TokenLookupInfo,
bool, LabelPlacement,
edm::KindOfType
m_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 71 of file EDConsumerBase.h.

Member Typedef Documentation

Definition at line 111 of file EDConsumerBase.h.

Member Enumeration Documentation

anonymous enum
private
anonymous enum
private
Enumerator
kESLookupInfo 
kESProxyIndex 

Definition at line 314 of file EDConsumerBase.h.

Constructor & Destructor Documentation

EDConsumerBase::EDConsumerBase ( )

Definition at line 39 of file EDConsumerBase.cc.

40  : m_tokenLabels{makeEmptyTokenLabels()}, frozen_(false), containsCurrentProcessAlias_(false) {}
std::vector< char > m_tokenLabels
EDConsumerBase::~EDConsumerBase ( )
virtualnoexcept

Definition at line 42 of file EDConsumerBase.cc.

42 {}
edm::EDConsumerBase::EDConsumerBase ( EDConsumerBase const &  )
delete
edm::EDConsumerBase::EDConsumerBase ( EDConsumerBase &&  )
default

Member Function Documentation

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

Definition at line 54 of file EDConsumerBase.cc.

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

Referenced by consumes(), and mayConsume().

54  {
55  if (iTag.label().empty()) {
56  return kWasEmpty;
57  }
58  return iTag;
59 }
static const edm::InputTag kWasEmpty("@EmptyLabel@")
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 TtFullHadDaughter::B, checkIfEmpty(), and recordConsumes().

Referenced by AlCaECALRecHitReducer::AlCaECALRecHitReducer(), pat::CandidateSummaryTable::CandidateSummaryTable(), CrossingFramePSimHitToPSimHitsConverter::CrossingFramePSimHitToPSimHitsConverter(), EGammaCutBasedEleIdAnalyzer::EGammaCutBasedEleIdAnalyzer(), EgammaEcalRecHitIsolationProducer::EgammaEcalRecHitIsolationProducer(), EgammaElectronTkIsolationProducer::EgammaElectronTkIsolationProducer(), EgammaIsoDetIdCollectionProducer< T1 >::EgammaIsoDetIdCollectionProducer(), EgammaIsoESDetIdCollectionProducer::EgammaIsoESDetIdCollectionProducer(), EgammaPhotonTkIsolationProducer::EgammaPhotonTkIsolationProducer(), EgammaPhotonTkNumIsolationProducer::EgammaPhotonTkNumIsolationProducer(), ElectronNHitSeedProducer::ElectronNHitSeedProducer(), edm::EventContentAnalyzer::EventContentAnalyzer(), EcalDQMonitorTask::formSchedule(), edm::GenericConsumer::GenericConsumer(), HGCalValidator::HGCalValidator(), HLTMuonIsoFilter::HLTMuonIsoFilter(), HLTMuonPFIsoFilter::HLTMuonPFIsoFilter(), JetCollectionReducerT< T >::JetCollectionReducerT(), edm::core::OutputModuleCore::keepThisBranch(), edm::SubProcess::keepThisBranch(), L1TPFCandMultiMerger::L1TPFCandMultiMerger(), L1TPhase2CorrelatorOffline::L1TPhase2CorrelatorOffline(), MkFitEventOfHitsProducer::MkFitEventOfHitsProducer(), MkFitProducer::MkFitProducer(), MultiplicityCorrelator::MultiplicityCorrelator(), MultiTrackValidator::MultiTrackValidator(), pat::PATPackedCandidateProducer::PATPackedCandidateProducer(), pat::PATSingleVertexSelector::PATSingleVertexSelector(), SeedMultiplicityAnalyzer::SeedMultiplicityAnalyzer(), ShiftedParticleMETcorrInputProducer::ShiftedParticleMETcorrInputProducer(), SiStripMonitorDigi::SiStripMonitorDigi(), edm::SwitchProducer::SwitchProducer(), TrackingNtuple::TrackingNtuple(), TrackingParticleNumberOfLayersProducer::TrackingParticleNumberOfLayersProducer(), and l1tVertexFinder::VertexNTupler::VertexNTupler().

160  {
161  TypeToGet tid = TypeToGet::make<ProductType>();
162  return EDGetTokenT<ProductType>{recordConsumes(B, tid, checkIfEmpty(tag), true)};
163  }
unsigned int recordConsumes(BranchType iBranch, TypeToGet const &iType, edm::InputTag const &iTag, bool iAlwaysGets)
static const std::string B
edm::InputTag const & checkIfEmpty(edm::InputTag const &tag)
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 GlobalPosition_Frontier_DevDB_cff::tag.

166  {
167  return EDConsumerBaseAdaptor<B>(this, std::move(tag));
168  }
def move
Definition: eostools.py:511
EDGetToken edm::EDConsumerBase::consumes ( const TypeToGet id,
edm::InputTag const &  tag 
)
inlineprotected

Definition at line 170 of file EDConsumerBase.h.

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

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)
template<BranchType B>
EDGetToken edm::EDConsumerBase::consumes ( TypeToGet const &  id,
edm::InputTag const &  tag 
)
inlineprotected

Definition at line 175 of file EDConsumerBase.h.

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

175  {
176  return EDGetToken{recordConsumes(B, id, checkIfEmpty(tag), true)};
177  }
unsigned int recordConsumes(BranchType iBranch, TypeToGet const &iType, edm::InputTag const &iTag, bool iAlwaysGets)
static const std::string B
edm::InputTag const & checkIfEmpty(edm::InputTag const &tag)
ConsumesCollector EDConsumerBase::consumesCollector ( )
protected

Use a ConsumesCollector to gather consumes information from helper functions.

Definition at line 47 of file EDConsumerBase.cc.

References c.

Referenced by AlcaBeamMonitor::AlcaBeamMonitor(), AlcaBeamSpotProducer::AlcaBeamSpotProducer(), AlignmentMonitorAsAnalyzer::AlignmentMonitorAsAnalyzer(), IsolatedParticlesGeneratedJets::analyze(), OverlapValidation::analyze(), BeamMonitor::BeamMonitor(), BeamMonitorBx::BeamMonitorBx(), BeamSpotAnalyzer::BeamSpotAnalyzer(), CaloParticleDebugger::CaloParticleDebugger(), CastorMonitorModule::CastorMonitorModule(), 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(), edm::FilterWrapper< T >::FilterWrapper(), GeometryProducer::GeometryProducer(), edm::HadronizerFilter< HAD, DEC >::HadronizerFilter(), HcalIsoTrkAnalyzer::HcalIsoTrkAnalyzer(), HcalIsoTrkSimAnalyzer::HcalIsoTrkSimAnalyzer(), HcalOfflineHarvesting::HcalOfflineHarvesting(), HcalOnlineHarvesting::HcalOnlineHarvesting(), HGCalTriggerNtupleManager::HGCalTriggerNtupleManager(), HLTBitAnalyzer::HLTBitAnalyzer(), HLTExoticaValidator::HLTExoticaValidator(), HLTMuonIsoFilter::HLTMuonIsoFilter(), cms::CkfDebugTrackCandidateMaker::initDebugger(), IsolatedTracksCone::IsolatedTracksCone(), IsolatedTracksNxN::IsolatedTracksNxN(), L1EventTreeProducer::L1EventTreeProducer(), L1MuGlobalMuonTrigger::L1MuGlobalMuonTrigger(), L1TPhase2CorrelatorOffline::L1TPhase2CorrelatorOffline(), LogMessageMonitor::LogMessageMonitor(), pat::helper::ManyThingsToValueMaps< Adaptor, Collection, value_type >::ManyThingsToValueMaps(), MomentumConstraintProducer::MomentumConstraintProducer(), MultiplicityCorrelator::MultiplicityCorrelator(), MultiplicityInvestigator::MultiplicityInvestigator(), MultiplicityTimeCorrelations::MultiplicityTimeCorrelations(), MultiTrackValidator::MultiTrackValidator(), MuPFIsoEmbedder::MuPFIsoEmbedder(), OMTFPatternMaker::OMTFPatternMaker(), edm::core::OutputModuleCore::OutputModuleCore(), OverlapValidation::OverlapValidation(), edm::PathStatusFilter::PathStatusFilter(), PhotonIDValueMapProducer::PhotonIDValueMapProducer(), PhotonMVANtuplizer::PhotonMVANtuplizer(), PlottingDevice::PlottingDevice(), QuickTrackAssociatorByHitsProducer::QuickTrackAssociatorByHitsProducer(), ResidualRefitting::ResidualRefitting(), edm::SecSourceAnalyzer::SecSourceAnalyzer(), SeedMultiplicityAnalyzer::SeedMultiplicityAnalyzer(), SingleTopTChannelLeptonDQM::SingleTopTChannelLeptonDQM(), SingleTopTChannelLeptonDQM_miniAOD::SingleTopTChannelLeptonDQM_miniAOD(), cms::SiPixelCondObjAllPayloadsReader::SiPixelCondObjAllPayloadsReader(), cms::SiPixelCondObjForHLTReader::SiPixelCondObjForHLTReader(), cms::SiPixelCondObjOfflineReader::SiPixelCondObjOfflineReader(), SiPixelStatusHarvester::SiPixelStatusHarvester(), SiStripAnalyser::SiStripAnalyser(), SiStripBadComponentInfo::SiStripBadComponentInfo(), SiStripBadStripFromQualityDBWriter::SiStripBadStripFromQualityDBWriter(), 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(), TtDilepEvtSolutionMaker::TtDilepEvtSolutionMaker(), TtSemiEvtSolutionMaker::TtSemiEvtSolutionMaker(), and ValidIsoTrkCalib::ValidIsoTrkCalib().

47  {
48  ConsumesCollector c{this};
49  return c;
50 }
const edm::EventSetup & c
std::vector< ConsumesInfo > EDConsumerBase::consumesInfo ( ) const

Definition at line 622 of file EDConsumerBase.cc.

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

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

Definition at line 193 of file EDConsumerBase.h.

193  {
194  TypeToGet tid = TypeToGet::make<ProductType>();
195  consumesMany<B>(tid);
196  }
void edm::EDConsumerBase::consumesMany ( const TypeToGet id)
inlineprotected

Definition at line 198 of file EDConsumerBase.h.

References gpuClustering::id.

198 { consumesMany<InEvent>(id); }
uint16_t *__restrict__ id
template<BranchType B>
void edm::EDConsumerBase::consumesMany ( const TypeToGet id)
inlineprotected

Definition at line 201 of file EDConsumerBase.h.

References TtFullHadDaughter::B, and recordConsumes().

201  {
202  recordConsumes(B, id, edm::InputTag{}, true);
203  }
unsigned int recordConsumes(BranchType iBranch, TypeToGet const &iType, edm::InputTag const &iTag, bool iAlwaysGets)
static const std::string B
void EDConsumerBase::convertCurrentProcessAlias ( std::string const &  processName)

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

Definition at line 576 of file EDConsumerBase.cc.

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

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

Definition at line 419 of file EDConsumerBase.cc.

Referenced by selectInputProcessBlocks().

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

Definition at line 207 of file EDConsumerBase.h.

Referenced by BeamConditionsMonitor::BeamConditionsMonitor(), DD4hep_TrackingMaterialAnalyser::DD4hep_TrackingMaterialAnalyser(), DisplayGeom::DisplayGeom(), DTVDriftCalibration::DTVDriftCalibration(), EcalLaserCondTools::EcalLaserCondTools(), EcalSRCondTools::EcalSRCondTools(), EgammaHLTBcHcalIsolationProducersRegional::EgammaHLTBcHcalIsolationProducersRegional(), EgammaHLTExtraProducer::EgammaHLTExtraProducer(), EgammaHLTHcalVarProducerFromRecHit::EgammaHLTHcalVarProducerFromRecHit(), EgammaHLTPhase2ExtraProducer::EgammaHLTPhase2ExtraProducer(), ElectronNHitSeedProducer::ElectronNHitSeedProducer(), ElectronRegressionEnergyProducer::ElectronRegressionEnergyProducer(), FactorizedJetCorrectorDemo::FactorizedJetCorrectorDemo(), FFTJetProducer::FFTJetProducer(), pat::GenPlusSimParticleProducer::GenPlusSimParticleProducer(), GlobalDigisProducer::GlobalDigisProducer(), HLTScoutingEgammaProducer::HLTScoutingEgammaProducer(), JetCorrectorDBReader::JetCorrectorDBReader(), JetCorrectorDemo::JetCorrectorDemo(), JetResolutionDBReader::JetResolutionDBReader(), JetResolutionDemo::JetResolutionDemo(), JetResolutionScaleFactorDBReader::JetResolutionScaleFactorDBReader(), L1CondDBIOVWriter::L1CondDBIOVWriter(), L1CondDBIOVWriterExt::L1CondDBIOVWriterExt(), L1CondDBPayloadWriter::L1CondDBPayloadWriter(), L1O2OTestAnalyzer::L1O2OTestAnalyzer(), L1O2OTestAnalyzerExt::L1O2OTestAnalyzerExt(), LumiMonitor::LumiMonitor(), MuonGeometryDBConverter::MuonGeometryDBConverter(), PFEGammaProducer::PFEGammaProducer(), PhotonValidator::PhotonValidator(), QGLikelihoodDBReader::QGLikelihoodDBReader(), QGLikelihoodSystematicsDBReader::QGLikelihoodSystematicsDBReader(), QGTagger::QGTagger(), RPCGeometryServTest::RPCGeometryServTest(), RPDigiProducer::RPDigiProducer(), SeedMultiplicityAnalyzer::SeedMultiplicityAnalyzer(), SiPixelGainCalibScaler::SiPixelGainCalibScaler(), SiStripChannelGainFromDBMiscalibrator::SiStripChannelGainFromDBMiscalibrator(), SiStripCommissioningSource::SiStripCommissioningSource(), SiStripFineDelayHit::SiStripFineDelayHit(), SiStripGainRandomCalculator::SiStripGainRandomCalculator(), SiStripGainsPCLWorker::SiStripGainsPCLWorker(), SiStripHitEffFromCalibTree::SiStripHitEffFromCalibTree(), SiStripMonitorDigi::SiStripMonitorDigi(), SiStripNoisesFromDBMiscalibrator::SiStripNoisesFromDBMiscalibrator(), TkConvValidator::TkConvValidator(), TrackingMaterialAnalyser::TrackingMaterialAnalyser(), ValidateGeometry::ValidateGeometry(), and ValidIsoTrkCalib::ValidIsoTrkCalib().

207  {
208  return esConsumes<ESProduct, ESRecord, Tr>(ESInputTag{});
209  }
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto edm::EDConsumerBase::esConsumes ( ESInputTag const &  tag)
inlineprotected

Definition at line 212 of file EDConsumerBase.h.

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

212  {
213  auto index = recordESConsumes(Tr,
215  std::conditional_t<std::is_same_v<ESRecord, edm::DefaultRecord>,
216  eventsetup::default_record_t<ESHandleAdapter<ESProduct>>,
217  ESRecord>>(),
218  eventsetup::heterocontainer::HCTypeTag::make<ESProduct>(),
219  tag);
220  return ESGetToken<ESProduct, ESRecord>{static_cast<unsigned int>(Tr), index, labelFor(index)};
221  }
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)
template<Transition Tr = Transition::Event>
constexpr auto edm::EDConsumerBase::esConsumes ( )
inlineprotectednoexcept

Definition at line 224 of file EDConsumerBase.h.

224  {
225  return EDConsumerBaseESAdaptor<Tr>(this);
226  }
template<Transition Tr = Transition::Event>
auto edm::EDConsumerBase::esConsumes ( ESInputTag  tag)
inlineprotectednoexcept

Definition at line 229 of file EDConsumerBase.h.

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

229  {
230  return EDConsumerBaseWithTagESAdaptor<Tr>(this, std::move(tag));
231  }
def move
Definition: eostools.py:511
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 235 of file EDConsumerBase.h.

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

235  {
236  return ESGetTokenGeneric(static_cast<unsigned int>(Tr),
237  recordESConsumes(Tr, iRecord, iKey.type(), ESInputTag("", iKey.name().value())),
238  iRecord.type());
239  }
ESTokenIndex recordESConsumes(Transition, eventsetup::EventSetupRecordKey const &, eventsetup::heterocontainer::HCTypeTag const &, edm::ESInputTag const &iTag)
ESProxyIndex 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::EDAnalyzer::doBeginLuminosityBlock(), edm::EDProducer::doBeginLuminosityBlock(), edm::EDFilter::doBeginLuminosityBlock(), edm::one::EDFilterBase::doBeginLuminosityBlock(), edm::one::EDProducerBase::doBeginLuminosityBlock(), edm::one::EDAnalyzerBase::doBeginLuminosityBlock(), edm::EDLooperBase::doBeginLuminosityBlock(), edm::global::EDAnalyzerBase::doBeginLuminosityBlock(), edm::global::EDProducerBase::doBeginLuminosityBlock(), edm::limited::EDProducerBase::doBeginLuminosityBlock(), edm::global::EDFilterBase::doBeginLuminosityBlock(), edm::limited::EDFilterBase::doBeginLuminosityBlock(), edm::limited::EDAnalyzerBase::doBeginLuminosityBlock(), edm::stream::EDAnalyzerAdaptor< T >::doBeginLuminosityBlock(), edm::EDAnalyzer::doBeginRun(), edm::EDProducer::doBeginRun(), edm::EDFilter::doBeginRun(), edm::one::EDFilterBase::doBeginRun(), edm::one::EDProducerBase::doBeginRun(), edm::one::EDAnalyzerBase::doBeginRun(), edm::EDLooperBase::doBeginRun(), edm::global::EDAnalyzerBase::doBeginRun(), edm::global::EDProducerBase::doBeginRun(), edm::limited::EDProducerBase::doBeginRun(), edm::global::EDFilterBase::doBeginRun(), edm::limited::EDFilterBase::doBeginRun(), edm::limited::EDAnalyzerBase::doBeginRun(), edm::stream::EDAnalyzerAdaptor< T >::doBeginRun(), edm::EDLooperBase::doDuringLoop(), edm::EDAnalyzer::doEndLuminosityBlock(), edm::EDProducer::doEndLuminosityBlock(), edm::EDFilter::doEndLuminosityBlock(), edm::one::EDFilterBase::doEndLuminosityBlock(), edm::one::EDProducerBase::doEndLuminosityBlock(), edm::one::EDAnalyzerBase::doEndLuminosityBlock(), edm::EDLooperBase::doEndLuminosityBlock(), edm::global::EDAnalyzerBase::doEndLuminosityBlock(), edm::global::EDProducerBase::doEndLuminosityBlock(), edm::limited::EDProducerBase::doEndLuminosityBlock(), edm::limited::EDFilterBase::doEndLuminosityBlock(), edm::global::EDFilterBase::doEndLuminosityBlock(), edm::limited::EDAnalyzerBase::doEndLuminosityBlock(), edm::stream::EDAnalyzerAdaptor< T >::doEndLuminosityBlock(), edm::EDLooperBase::doEndOfLoop(), edm::EDAnalyzer::doEndRun(), edm::EDProducer::doEndRun(), edm::EDFilter::doEndRun(), edm::one::EDFilterBase::doEndRun(), edm::one::EDProducerBase::doEndRun(), edm::one::EDAnalyzerBase::doEndRun(), edm::EDLooperBase::doEndRun(), edm::global::EDAnalyzerBase::doEndRun(), edm::global::EDProducerBase::doEndRun(), edm::limited::EDProducerBase::doEndRun(), edm::global::EDFilterBase::doEndRun(), edm::limited::EDFilterBase::doEndRun(), edm::limited::EDAnalyzerBase::doEndRun(), edm::stream::EDAnalyzerAdaptor< T >::doEndRun(), edm::EDAnalyzer::doEvent(), edm::EDProducer::doEvent(), edm::EDFilter::doEvent(), edm::global::EDFilterBase::doEvent(), edm::one::EDFilterBase::doEvent(), edm::one::EDProducerBase::doEvent(), edm::global::EDAnalyzerBase::doEvent(), edm::one::EDAnalyzerBase::doEvent(), edm::global::EDProducerBase::doEvent(), edm::limited::EDFilterBase::doEvent(), edm::limited::EDAnalyzerBase::doEvent(), edm::limited::EDProducerBase::doEvent(), edm::global::EDAnalyzerBase::doStreamBeginLuminosityBlock(), edm::global::EDProducerBase::doStreamBeginLuminosityBlock(), edm::limited::EDProducerBase::doStreamBeginLuminosityBlock(), edm::limited::EDFilterBase::doStreamBeginLuminosityBlock(), edm::global::EDFilterBase::doStreamBeginLuminosityBlock(), edm::limited::EDAnalyzerBase::doStreamBeginLuminosityBlock(), edm::global::EDAnalyzerBase::doStreamBeginRun(), edm::global::EDProducerBase::doStreamBeginRun(), edm::limited::EDProducerBase::doStreamBeginRun(), edm::global::EDFilterBase::doStreamBeginRun(), edm::limited::EDFilterBase::doStreamBeginRun(), edm::limited::EDAnalyzerBase::doStreamBeginRun(), edm::global::EDAnalyzerBase::doStreamEndLuminosityBlock(), edm::global::EDProducerBase::doStreamEndLuminosityBlock(), edm::limited::EDProducerBase::doStreamEndLuminosityBlock(), edm::global::EDFilterBase::doStreamEndLuminosityBlock(), edm::limited::EDFilterBase::doStreamEndLuminosityBlock(), edm::limited::EDAnalyzerBase::doStreamEndLuminosityBlock(), edm::global::EDAnalyzerBase::doStreamEndRun(), edm::global::EDProducerBase::doStreamEndRun(), edm::limited::EDProducerBase::doStreamEndRun(), edm::limited::EDFilterBase::doStreamEndRun(), edm::global::EDFilterBase::doStreamEndRun(), and edm::limited::EDAnalyzerBase::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< ESProxyIndex >, static_cast< unsigned int >edm::Transition::NumberOfEventSetupTransitions)> esItemsToGetFromTransition_
std::vector<ESProxyIndex> 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.

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

136  {
138  return esItemsToGetFromTransition_[static_cast<unsigned int>(iTrans)];
139  }
assert(be >=bs)
std::array< std::vector< ESProxyIndex >, static_cast< unsigned int >edm::Transition::NumberOfEventSetupTransitions)> esItemsToGetFromTransition_
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.

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

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_
ProductResolverIndexAndSkipBit EDConsumerBase::indexFrom ( EDGetToken  iToken,
BranchType  iBranch,
TypeID const &  iType 
) const

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

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

Definition at line 306 of file EDConsumerBase.cc.

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

Referenced by updateLookup().

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

Definition at line 274 of file EDConsumerBase.cc.

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

Referenced by updateLookup().

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

Definition at line 92 of file EDConsumerBase.h.

References itemsToGetFromBranch_.

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

92  {
93  return itemsToGetFromBranch_[iType];
94  }
std::array< std::vector< ProductResolverIndexAndSkipBit >, edm::NumBranchTypes > itemsToGetFromBranch_
const char * EDConsumerBase::labelFor ( ESTokenIndex  iIndex) const
private

Definition at line 660 of file EDConsumerBase.cc.

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

Referenced by esConsumes().

660  {
661  return m_esTokenInfo.get<kESLookupInfo>(iIndex.value()).m_key.name().value();
662 }
constexpr Value_t value() const noexcept
Definition: ESIndices.h:70
edm::SoATuple< ESTokenLookupInfo, ESProxyIndex > m_esTokenInfo
void EDConsumerBase::labelsForToken ( EDGetToken  iToken,
Labels oLabels 
) const

Definition at line 338 of file EDConsumerBase.cc.

References edm::EDGetToken::index(), kLabels, HLT_FULL_cff::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(), EgammaObjects::analyzeElectrons(), EgammaObjects::analyzePhotons(), HLTVertexPerformanceAnalyzer::dqmBeginRun(), HLTBTagPerformanceAnalyzer::dqmBeginRun(), TriggerBxMonitor::dqmBeginRun(), TriggerRatesMonitor::dqmBeginRun(), TrackingNtuple::fillSeeds(), TrackingNtuple::fillTracks(), EcalMIPRecHitFilter::filter(), edm::PrincipalGetAdapter::labelsForToken(), edm::PrincipalGetAdapter::makeFailToGetException(), MultiTrackValidator::MultiTrackValidator(), HIPixelTrackFilterProducer::produce(), HIProtoTrackFilterProducer::produce(), and edm::PrincipalGetAdapter::throwAmbiguousException().

338  {
339  unsigned int index = iToken.index();
340  auto labels = m_tokenInfo.get<kLabels>(index);
341  unsigned int start = labels.m_startOfModuleLabel;
342  oLabels.module = &(m_tokenLabels[start]);
343  oLabels.productInstance = oLabels.module + labels.m_deltaToProductInstance;
344  oLabels.process = oLabels.module + labels.m_deltaToProcessName;
345 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
constexpr unsigned int index() const noexcept
Definition: EDGetToken.h:50
std::vector< char > m_tokenLabels
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 TtFullHadDaughter::B, checkIfEmpty(), and recordConsumes().

180  {
181  TypeToGet tid = TypeToGet::make<ProductType>();
182  return EDGetTokenT<ProductType>{recordConsumes(B, tid, checkIfEmpty(tag), false)};
183  }
unsigned int recordConsumes(BranchType iBranch, TypeToGet const &iType, edm::InputTag const &iTag, bool iAlwaysGets)
static const std::string B
edm::InputTag const & checkIfEmpty(edm::InputTag const &tag)
EDGetToken edm::EDConsumerBase::mayConsume ( const TypeToGet id,
edm::InputTag const &  tag 
)
inlineprotected

Definition at line 185 of file EDConsumerBase.h.

References gpuClustering::id, and GlobalPosition_Frontier_DevDB_cff::tag.

185 { return mayConsume<InEvent>(id, tag); }
uint16_t *__restrict__ id
template<BranchType B>
EDGetToken edm::EDConsumerBase::mayConsume ( const TypeToGet id,
edm::InputTag const &  tag 
)
inlineprotected

Definition at line 188 of file EDConsumerBase.h.

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

188  {
189  return EDGetToken{recordConsumes(B, id, checkIfEmpty(tag), false)};
190  }
unsigned int recordConsumes(BranchType iBranch, TypeToGet const &iType, edm::InputTag const &iTag, bool iAlwaysGets)
static const std::string B
edm::InputTag const & checkIfEmpty(edm::InputTag const &tag)
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 477 of file EDConsumerBase.cc.

References edm::ProductResolverIndexHelper::index(), dqmiolumiharvest::j, kKind, kLabels, kLookupInfo, cuda_std::lower_bound(), m_tokenInfo, m_tokenLabels, callgraph::module, TrackingSourceConfig_Tier0_Cosmic_cff::modules, edm::preg, LaserDQM_cfg::process, edm::ProductRegistry::productLookup(), edm::ProductResolverIndexInvalid, and edm::ProductResolverIndexHelper::relatedIndexes().

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

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

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

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

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

References kLookupInfo, and m_tokenInfo.

Referenced by edm::Principal::findProductByLabel().

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

References kLookupInfo, m_tokenInfo, and edm::ProductResolverIndexInvalid.

Referenced by edm::Principal::getManyByType().

359  {
360  for (auto it = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); it != itEnd; ++it) {
361  //consumesMany entries do not have their index resolved
362  if (it->m_index.productResolverIndex() == ProductResolverIndexInvalid and it->m_type == iType and
363  it->m_branchType == iBranch) {
364  return true;
365  }
366  }
367  return false;
368 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
virtual void edm::EDConsumerBase::registerLateConsumes ( eventsetup::ESRecordsToProxyIndices const &  )
inlineprivatevirtual

Reimplemented in FWLiteESRecordWriterAnalyzer, and edm::EventSetupRecordDataGetter.

Definition at line 245 of file EDConsumerBase.h.

Referenced by updateLookup().

245 {}
void edm::EDConsumerBase::resetItemsToGetFrom ( BranchType  iType)
inlineprotected

Definition at line 242 of file EDConsumerBase.h.

References itemsToGetFromBranch_.

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

242 { itemsToGetFromBranch_[iType].clear(); }
std::array< std::vector< ProductResolverIndexAndSkipBit >, edm::NumBranchTypes > itemsToGetFromBranch_
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 &)
void EDConsumerBase::throwBadToken ( edm::TypeID const &  iType,
EDGetToken  iToken 
) const
private

Definition at line 383 of file EDConsumerBase.cc.

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

Referenced by indexFrom().

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

Definition at line 376 of file EDConsumerBase.cc.

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

Referenced by indexFrom().

376  {
377  throw cms::Exception("BranchTypeMismatch")
378  << "A get using a EDGetToken was done in " << BranchTypeToString(iBranch) << " but the consumes call was for "
379  << BranchTypeToString(m_tokenInfo.get<kLookupInfo>(iToken.index()).m_branchType)
380  << ".\n Please modify the consumes call to use the correct branch type.";
381 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
constexpr unsigned int index() const noexcept
Definition: EDGetToken.h:50
std::string const & BranchTypeToString(BranchType const &branchType)
Definition: BranchType.cc:93
void EDConsumerBase::throwConsumesCallAfterFrozen ( TypeToGet const &  typeToGet,
InputTag const &  inputTag 
) const
private

Definition at line 396 of file EDConsumerBase.cc.

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

Referenced by recordConsumes().

396  {
397  throw cms::Exception("LogicError") << "A module declared it consumes a product after its constructor.\n"
398  << "This must be done in the contructor\n"
399  << "The product type was: " << typeToGet.type() << "\n"
400  << "and " << inputTag << "\n";
401 }
void EDConsumerBase::throwESConsumesCallAfterFrozen ( eventsetup::EventSetupRecordKey const &  iRecord,
eventsetup::heterocontainer::HCTypeTag const &  iDataType,
edm::ESInputTag const &  iTag 
) const
private

Definition at line 403 of file EDConsumerBase.cc.

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

Referenced by recordESConsumes().

405  {
406  throw cms::Exception("LogicError") << "A module declared it consumes an EventSetup product after its constructor.\n"
407  << "This must be done in the contructor\n"
408  << "The product type was: " << iDataType.name() << " in record "
409  << iRecord.type().name() << "\n"
410  << "and ESInputTag was " << iTag << "\n";
411 }
void EDConsumerBase::throwESConsumesInProcessBlock ( ) const
private

Definition at line 413 of file EDConsumerBase.cc.

References Exception.

Referenced by recordESConsumes().

413  {
414  throw cms::Exception("LogicError")
415  << "A module declared it consumes an EventSetup product during a ProcessBlock transition.\n"
416  << "EventSetup products can only be consumed in Event, Lumi, or Run transitions.\n";
417 }
void EDConsumerBase::throwTypeMismatch ( edm::TypeID const &  iType,
EDGetToken  iToken 
) const
private

Definition at line 370 of file EDConsumerBase.cc.

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

Referenced by indexFrom().

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

Definition at line 270 of file EDConsumerBase.cc.

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

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

270  {
271  return m_tokenInfo.get<kLookupInfo>(iToken.index()).m_index;
272 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
m_index(idict.size(), 1)
constexpr unsigned int index() const noexcept
Definition: EDGetToken.h:50
void EDConsumerBase::updateLookup ( BranchType  iBranchType,
ProductResolverIndexHelper const &  iHelper,
bool  iPrefetchMayGet 
)

Definition at line 112 of file EDConsumerBase.cc.

References cms::cuda::assert(), containsCurrentProcessAlias_, frozen_, mps_fire::i, edm::ProductResolverIndexHelper::index(), info(), itemsMayGet(), itemsToGet(), itemsToGetFromBranch_, dqmiolumiharvest::j, kAlwaysGets, class-composition::kind, kKind, kLabels, kLookupInfo, HLT_FULL_cff::labels, m_tokenInfo, m_tokenLabels, edm::ProductResolverIndexInvalid, and edm::ProductResolverIndexHelper::relatedIndexes().

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

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

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

171  {
172  // temporarily unfreeze to allow late EventSetup consumes registration
173  frozen_ = false;
175  frozen_ = true;
176 
177  unsigned int index = 0;
178  for (auto it = m_esTokenInfo.begin<kESLookupInfo>(); it != m_esTokenInfo.end<kESLookupInfo>(); ++it, ++index) {
179  auto indexInRecord = iPI.indexInRecord(it->m_record, it->m_key);
181  const char* componentName = &(m_tokenLabels[it->m_startOfComponentName]);
182  if (*componentName) {
183  auto component = iPI.component(it->m_record, it->m_key);
184  if (component->label_.empty()) {
185  if (component->type_ != componentName) {
187  }
188  } else if (component->label_ != componentName) {
190  }
191  }
192  }
193  m_esTokenInfo.get<kESProxyIndex>(index) = indexInRecord;
194 
195  int negIndex = -1 * (index + 1);
196  for (auto& items : esItemsToGetFromTransition_) {
197  for (auto& itemIndex : items) {
198  if (itemIndex.value() == negIndex) {
199  itemIndex = indexInRecord;
200  esRecordsToGetFromTransition_[&items - &esItemsToGetFromTransition_.front()][&itemIndex - &items.front()] =
201  iPI.recordIndexFor(it->m_record);
202  negIndex = 1;
203  break;
204  }
205  }
206  if (negIndex > 0) {
207  break;
208  }
209  }
210  }
211 }
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

friend class ConsumesCollector
friend

Definition at line 147 of file EDConsumerBase.h.

template<BranchType B>
friend class EDConsumerBaseAdaptor
friend

Definition at line 153 of file EDConsumerBase.h.

template<Transition Tr>
friend class EDConsumerBaseESAdaptor
friend

Definition at line 149 of file EDConsumerBase.h.

template<Transition Tr>
friend class EDConsumerBaseWithTagESAdaptor
friend

Definition at line 151 of file EDConsumerBase.h.

template<typename T >
friend class WillGetIfMatch
friend

Definition at line 155 of file EDConsumerBase.h.

Member Data Documentation

bool edm::EDConsumerBase::containsCurrentProcessAlias_
private

Definition at line 321 of file EDConsumerBase.h.

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

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

Definition at line 319 of file EDConsumerBase.h.

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

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

Definition at line 297 of file EDConsumerBase.h.

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

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

Definition at line 315 of file EDConsumerBase.h.

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

edm::SoATuple<TokenLookupInfo, bool, LabelPlacement, edm::KindOfType> edm::EDConsumerBase::m_tokenInfo
private
std::vector<char> edm::EDConsumerBase::m_tokenLabels
private