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::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< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Private Types

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

Private Member Functions

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

Private Attributes

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

Friends

class ConsumesCollector
 
template<BranchType B>
class EDConsumerBaseAdaptor
 
template<Transition Tr>
class EDConsumerBaseESAdaptor
 
template<Transition Tr>
class EDConsumerBaseWithTagESAdaptor
 
template<typename T >
class WillGetIfMatch
 

Detailed Description

Description: Allows declaration of what data is being consumed

Usage: The EDM modules all inherit from this base class

Definition at line 72 of file EDConsumerBase.h.

Member Typedef Documentation

◆ Labels

Definition at line 112 of file EDConsumerBase.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private

◆ anonymous enum

anonymous enum
private
Enumerator
kESLookupInfo 
kESProxyIndex 

Definition at line 315 of file EDConsumerBase.h.

Constructor & Destructor Documentation

◆ EDConsumerBase() [1/3]

EDConsumerBase::EDConsumerBase ( )

Definition at line 40 of file EDConsumerBase.cc.

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

◆ ~EDConsumerBase()

EDConsumerBase::~EDConsumerBase ( )
virtualnoexcept

Definition at line 43 of file EDConsumerBase.cc.

43 {}

◆ EDConsumerBase() [2/3]

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

◆ EDConsumerBase() [3/3]

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

Member Function Documentation

◆ checkIfEmpty()

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

Definition at line 55 of file EDConsumerBase.cc.

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

Referenced by consumes(), and mayConsume().

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

◆ consumes() [1/4]

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

Definition at line 161 of file EDConsumerBase.h.

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

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

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

◆ consumes() [2/4]

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

Definition at line 167 of file EDConsumerBase.h.

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

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

◆ consumes() [3/4]

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

Definition at line 171 of file EDConsumerBase.h.

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

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

◆ consumes() [4/4]

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

Definition at line 176 of file EDConsumerBase.h.

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

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

◆ consumesCollector()

ConsumesCollector EDConsumerBase::consumesCollector ( )
protected

Use a ConsumesCollector to gather consumes information from helper functions.

Definition at line 48 of file EDConsumerBase.cc.

References c.

Referenced by AlcaBeamMonitor::AlcaBeamMonitor(), AlcaBeamSpotProducer::AlcaBeamSpotProducer(), AlignmentMonitorAsAnalyzer::AlignmentMonitorAsAnalyzer(), IsolatedParticlesGeneratedJets::analyze(), OverlapValidation::analyze(), BeamMonitor::BeamMonitor(), BeamMonitorBx::BeamMonitorBx(), BeamSpotAnalyzer::BeamSpotAnalyzer(), CaloParticleDebugger::CaloParticleDebugger(), 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(), GeometryProducer::GeometryProducer(), edm::HadronizerFilter< HAD, DEC >::HadronizerFilter(), HcalIsoTrkAnalyzer::HcalIsoTrkAnalyzer(), HcalIsoTrkSimAnalyzer::HcalIsoTrkSimAnalyzer(), HcalOfflineHarvesting::HcalOfflineHarvesting(), HcalOnlineHarvesting::HcalOnlineHarvesting(), HLTBitAnalyzer::HLTBitAnalyzer(), HLTExoticaValidator::HLTExoticaValidator(), HLTMuonIsoFilter::HLTMuonIsoFilter(), cms::CkfDebugTrackCandidateMaker::initDebugger(), IsolatedTracksCone::IsolatedTracksCone(), IsolatedTracksNxN::IsolatedTracksNxN(), L1CondDBPayloadWriterExt::L1CondDBPayloadWriterExt(), L1EventTreeProducer::L1EventTreeProducer(), L1MuGlobalMuonTrigger::L1MuGlobalMuonTrigger(), LogMessageMonitor::LogMessageMonitor(), MomentumConstraintProducer::MomentumConstraintProducer(), MultiplicityCorrelator::MultiplicityCorrelator(), MultiplicityInvestigator::MultiplicityInvestigator(), MultiplicityTimeCorrelations::MultiplicityTimeCorrelations(), MultiTrackValidator::MultiTrackValidator(), MuPFIsoEmbedder::MuPFIsoEmbedder(), 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(), TtDilepEvtSolutionMaker::TtDilepEvtSolutionMaker(), TtSemiEvtSolutionMaker::TtSemiEvtSolutionMaker(), and ValidIsoTrkCalib::ValidIsoTrkCalib().

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

◆ consumesInfo()

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

Definition at line 623 of file EDConsumerBase.cc.

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

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

◆ consumesMany() [1/3]

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

Definition at line 194 of file EDConsumerBase.h.

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

◆ consumesMany() [2/3]

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

Definition at line 199 of file EDConsumerBase.h.

References l1ctLayer2EG_cff::id.

199 { consumesMany<InEvent>(id); }

◆ consumesMany() [3/3]

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

Definition at line 202 of file EDConsumerBase.h.

References B, and recordConsumes().

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

◆ convertCurrentProcessAlias()

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

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

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

577  {
578  frozen_ = true;
579 
582 
583  auto newTokenLabels = makeEmptyTokenLabels();
584 
585  // first calculate the size of the new vector and reserve memory for it
586  std::vector<char>::size_type newSize = newTokenLabels.size();
587  std::string newProcessName;
588  for (auto iter = m_tokenInfo.begin<kLabels>(), itEnd = m_tokenInfo.end<kLabels>(); iter != itEnd; ++iter) {
589  newProcessName = &m_tokenLabels[iter->m_startOfModuleLabel + iter->m_deltaToProcessName];
590  if (newProcessName == InputTag::kCurrentProcess) {
591  newProcessName = processName;
592  }
593  newSize += (iter->m_deltaToProcessName + newProcessName.size() + 1);
594  }
595  newTokenLabels.reserve(newSize);
596 
597  unsigned int newStartOfModuleLabel = newTokenLabels.size();
598  for (auto iter = m_tokenInfo.begin<kLabels>(), itEnd = m_tokenInfo.end<kLabels>(); iter != itEnd; ++iter) {
599  unsigned int startOfModuleLabel = iter->m_startOfModuleLabel;
600  unsigned short deltaToProcessName = iter->m_deltaToProcessName;
601 
602  iter->m_startOfModuleLabel = newStartOfModuleLabel;
603 
604  newProcessName = &m_tokenLabels[startOfModuleLabel + deltaToProcessName];
605  if (newProcessName == InputTag::kCurrentProcess) {
606  newProcessName = processName;
607  }
608 
609  newStartOfModuleLabel += (deltaToProcessName + newProcessName.size() + 1);
610 
611  // Copy in both the module label and instance, they are the same
612  newTokenLabels.insert(newTokenLabels.end(),
613  m_tokenLabels.begin() + startOfModuleLabel,
614  m_tokenLabels.begin() + (startOfModuleLabel + deltaToProcessName));
615 
616  newTokenLabels.insert(newTokenLabels.end(), newProcessName.begin(), newProcessName.end());
617  newTokenLabels.push_back('\0');
618  }
619  m_tokenLabels = std::move(newTokenLabels);
620  }
621 }
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 420 of file EDConsumerBase.cc.

Referenced by selectInputProcessBlocks().

420 {}

◆ esConsumes() [1/5]

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

Definition at line 208 of file EDConsumerBase.h.

Referenced by APVShotsFilter::APVShotsFilter(), BeamConditionsMonitor::BeamConditionsMonitor(), DD4hep_TrackingMaterialAnalyser::DD4hep_TrackingMaterialAnalyser(), DisplayGeom::DisplayGeom(), DTEtaPatternLutTester::DTEtaPatternLutTester(), DTExtLutTester::DTExtLutTester(), DTPhiLutTester::DTPhiLutTester(), DTPtaLutTester::DTPtaLutTester(), DTQualPatternLutTester::DTQualPatternLutTester(), DTTFMasksTester::DTTFMasksTester(), DTTFParametersTester::DTTFParametersTester(), DTVDriftCalibration::DTVDriftCalibration(), EcalLaserCondTools::EcalLaserCondTools(), EcalSRCondTools::EcalSRCondTools(), EgammaHLTBcHcalIsolationProducersRegional::EgammaHLTBcHcalIsolationProducersRegional(), EgammaHLTExtraProducer::EgammaHLTExtraProducer(), EgammaHLTHcalVarProducerFromRecHit::EgammaHLTHcalVarProducerFromRecHit(), EgammaHLTPhase2ExtraProducer::EgammaHLTPhase2ExtraProducer(), ElectronRegressionEnergyProducer::ElectronRegressionEnergyProducer(), FactorizedJetCorrectorDemo::FactorizedJetCorrectorDemo(), GlobalDigisProducer::GlobalDigisProducer(), HLTScoutingEgammaProducer::HLTScoutingEgammaProducer(), JetCorrectorDBReader::JetCorrectorDBReader(), JetCorrectorDemo::JetCorrectorDemo(), JetResolutionDBReader::JetResolutionDBReader(), JetResolutionDemo::JetResolutionDemo(), JetResolutionScaleFactorDBReader::JetResolutionScaleFactorDBReader(), L1CondDBIOVWriter::L1CondDBIOVWriter(), L1CondDBIOVWriterExt::L1CondDBIOVWriterExt(), L1GctConfigDump::L1GctConfigDump(), L1GtDataEmulAnalyzer::L1GtDataEmulAnalyzer(), L1GtVhdlWriter::L1GtVhdlWriter(), L1KeyListWriter::L1KeyListWriter(), L1KeyWriter::L1KeyWriter(), 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(), RPDigiProducer::RPDigiProducer(), SiPixelGainCalibScaler::SiPixelGainCalibScaler(), SiStripApprox2Clusters::SiStripApprox2Clusters(), SiStripCommissioningSource::SiStripCommissioningSource(), SiStripCondVisualizer::SiStripCondVisualizer(), SiStripFineDelayHit::SiStripFineDelayHit(), SiStripGainRandomCalculator::SiStripGainRandomCalculator(), SiStripGainsCalibTreeWorker::SiStripGainsCalibTreeWorker(), SiStripGainsPCLWorker::SiStripGainsPCLWorker(), SiStripHitEffFromCalibTree::SiStripHitEffFromCalibTree(), SiStripMonitorDigi::SiStripMonitorDigi(), TestHits::TestHits(), TestSmoothHits::TestSmoothHits(), TestTrackHits::TestTrackHits(), TrackingMaterialAnalyser::TrackingMaterialAnalyser(), and ValidateGeometry::ValidateGeometry().

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

◆ esConsumes() [2/5]

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

Definition at line 213 of file EDConsumerBase.h.

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

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

◆ esConsumes() [3/5]

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

Definition at line 225 of file EDConsumerBase.h.

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

◆ esConsumes() [4/5]

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

Definition at line 230 of file EDConsumerBase.h.

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

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

◆ esConsumes() [5/5]

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

Used with EventSetupRecord::doGet.

Definition at line 236 of file EDConsumerBase.h.

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

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

◆ esGetTokenIndices()

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

Definition at line 126 of file EDConsumerBase.h.

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

Referenced by edm::EDLooperBase::beginOfJob(), edm::global::EDFilterBase::doAcquire(), edm::global::EDProducerBase::doAcquire(), edm::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().

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

◆ esGetTokenIndicesVector()

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

Definition at line 137 of file EDConsumerBase.h.

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

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

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

◆ esGetTokenRecordIndicesVector()

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

Definition at line 142 of file EDConsumerBase.h.

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

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

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

◆ indexFrom()

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

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

254  {
255  if (UNLIKELY(iToken.index() >= m_tokenInfo.size())) {
256  throwBadToken(iType, iToken);
257  }
258  const auto& info = m_tokenInfo.get<kLookupInfo>(iToken.index());
259  if (LIKELY(iBranch == info.m_branchType)) {
260  if (LIKELY(iType == info.m_type)) {
261  return info.m_index;
262  } else {
263  throwTypeMismatch(iType, iToken);
264  }
265  } else {
266  throwBranchMismatch(iBranch, iToken);
267  }
269 }
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
#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 307 of file EDConsumerBase.cc.

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

Referenced by updateLookup().

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

◆ itemsToGet()

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

Definition at line 275 of file EDConsumerBase.cc.

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

Referenced by updateLookup().

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

◆ itemsToGetFrom()

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

Definition at line 93 of file EDConsumerBase.h.

References itemsToGetFromBranch_.

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

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

◆ labelFor()

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

Definition at line 661 of file EDConsumerBase.cc.

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

Referenced by esConsumes().

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

◆ labelsForToken()

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

Definition at line 339 of file EDConsumerBase.cc.

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

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

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

◆ mayConsume() [1/3]

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

Definition at line 181 of file EDConsumerBase.h.

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

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

◆ mayConsume() [2/3]

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

Definition at line 186 of file EDConsumerBase.h.

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

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

◆ mayConsume() [3/3]

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

Definition at line 189 of file EDConsumerBase.h.

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

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

◆ modulesWhoseProductsAreConsumed()

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

Definition at line 478 of file EDConsumerBase.cc.

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

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

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ recordConsumes()

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

Definition at line 62 of file EDConsumerBase.cc.

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

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

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

◆ recordESConsumes()

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

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

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

◆ registeredToConsume()

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

Definition at line 348 of file EDConsumerBase.cc.

References kLookupInfo, and m_tokenInfo.

350  {
351  for (auto it = m_tokenInfo.begin<kLookupInfo>(), itEnd = m_tokenInfo.end<kLookupInfo>(); it != itEnd; ++it) {
352  if (it->m_index.productResolverIndex() == iIndex and it->m_index.skipCurrentProcess() == skipCurrentProcess and
353  it->m_branchType == iBranch) {
354  return true;
355  }
356  }
357  return false;
358 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo

◆ registeredToConsumeMany()

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

Definition at line 360 of file EDConsumerBase.cc.

References kLookupInfo, m_tokenInfo, and edm::ProductResolverIndexInvalid.

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

◆ registerLateConsumes()

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

Reimplemented in FWLiteESRecordWriterAnalyzer, and edm::EventSetupRecordDataGetter.

Definition at line 246 of file EDConsumerBase.h.

Referenced by updateLookup().

246 {}

◆ resetItemsToGetFrom()

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

Definition at line 243 of file EDConsumerBase.h.

References itemsToGetFromBranch_.

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

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

◆ selectInputProcessBlocks()

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

Definition at line 107 of file EDConsumerBase.h.

References doSelectInputProcessBlocks().

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

◆ throwBadToken()

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

Definition at line 384 of file EDConsumerBase.cc.

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

Referenced by indexFrom().

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

◆ throwBranchMismatch()

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

Definition at line 377 of file EDConsumerBase.cc.

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

Referenced by indexFrom().

377  {
378  throw cms::Exception("BranchTypeMismatch")
379  << "A get using a EDGetToken was done in " << BranchTypeToString(iBranch) << " but the consumes call was for "
380  << BranchTypeToString(m_tokenInfo.get<kLookupInfo>(iToken.index()).m_branchType)
381  << ".\n Please modify the consumes call to use the correct branch type.";
382 }
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

◆ throwConsumesCallAfterFrozen()

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

Definition at line 397 of file EDConsumerBase.cc.

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

Referenced by recordConsumes().

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

◆ throwESConsumesCallAfterFrozen()

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

Definition at line 404 of file EDConsumerBase.cc.

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

Referenced by recordESConsumes().

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

◆ throwESConsumesInProcessBlock()

void EDConsumerBase::throwESConsumesInProcessBlock ( ) const
private

Definition at line 414 of file EDConsumerBase.cc.

References Exception.

Referenced by recordESConsumes().

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

◆ throwTypeMismatch()

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

Definition at line 371 of file EDConsumerBase.cc.

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

Referenced by indexFrom().

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

◆ uncheckedIndexFrom()

ProductResolverIndexAndSkipBit EDConsumerBase::uncheckedIndexFrom ( EDGetToken  iToken) const

Definition at line 271 of file EDConsumerBase.cc.

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

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

271  {
272  return m_tokenInfo.get<kLookupInfo>(iToken.index()).m_index;
273 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
constexpr unsigned int index() const noexcept
Definition: EDGetToken.h:50

◆ updateLookup() [1/2]

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

Definition at line 113 of file EDConsumerBase.cc.

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

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

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

◆ updateLookup() [2/2]

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

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

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

Friends And Related Function Documentation

◆ ConsumesCollector

friend class ConsumesCollector
friend

Definition at line 148 of file EDConsumerBase.h.

◆ EDConsumerBaseAdaptor

template<BranchType B>
friend class EDConsumerBaseAdaptor
friend

Definition at line 154 of file EDConsumerBase.h.

◆ EDConsumerBaseESAdaptor

template<Transition Tr>
friend class EDConsumerBaseESAdaptor
friend

Definition at line 150 of file EDConsumerBase.h.

◆ EDConsumerBaseWithTagESAdaptor

template<Transition Tr>
friend class EDConsumerBaseWithTagESAdaptor
friend

Definition at line 152 of file EDConsumerBase.h.

◆ WillGetIfMatch

template<typename T >
friend class WillGetIfMatch
friend

Definition at line 156 of file EDConsumerBase.h.

Member Data Documentation

◆ containsCurrentProcessAlias_

bool edm::EDConsumerBase::containsCurrentProcessAlias_
private

Definition at line 322 of file EDConsumerBase.h.

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

◆ esItemsToGetFromTransition_

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

◆ esRecordsToGetFromTransition_

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

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

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

◆ m_esTokenInfo

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

Definition at line 316 of file EDConsumerBase.h.

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

◆ m_tokenInfo

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

◆ m_tokenLabels

std::vector<char> edm::EDConsumerBase::m_tokenLabels
private