CMS 3D CMS Logo

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

#include <EDConsumerBase.h>

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

Classes

struct  LabelPlacement
 
struct  TokenLookupInfo
 

Public Types

typedef ProductLabels Labels
 

Public Member Functions

std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Private Types

enum  { kLookupInfo, kAlwaysGets, kLabels, kKind }
 

Private Member Functions

edm::InputTag const & checkIfEmpty (edm::InputTag const &tag)
 
unsigned int recordConsumes (BranchType iBranch, TypeToGet const &iType, edm::InputTag const &iTag, bool iAlwaysGets)
 
void throwBadToken (edm::TypeID const &iType, EDGetToken iToken) const
 
void throwBranchMismatch (BranchType, EDGetToken) const
 
void throwConsumesCallAfterFrozen (TypeToGet const &, InputTag const &) const
 
void throwTypeMismatch (edm::TypeID const &, EDGetToken) const
 

Private Attributes

bool frozen_
 
std::array< std::vector< ProductResolverIndexAndSkipBit >, edm::NumBranchTypesitemsToGetFromBranch_
 
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfTypem_tokenInfo
 
std::vector< char > m_tokenLabels
 

Friends

class ConsumesCollector
 
template<typename T >
class WillGetIfMatch
 

Detailed Description

Description: Allows declaration of what data is being consumed

Usage: The EDM modules all inherit from this base class

Definition at line 49 of file EDConsumerBase.h.

Member Typedef Documentation

Definition at line 84 of file EDConsumerBase.h.

Member Enumeration Documentation

anonymous enum
private

Constructor & Destructor Documentation

edm::EDConsumerBase::EDConsumerBase ( )
inline

Definition at line 53 of file EDConsumerBase.h.

References indexFrom(), itemsMayGet(), itemsToGet(), noexcept, operator=(), and ~EDConsumerBase().

53 : frozen_(false) {}
EDConsumerBase::~EDConsumerBase ( )
virtualnoexcept

Definition at line 52 of file EDConsumerBase.cc.

Referenced by EDConsumerBase().

53 {
54 }
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 80 of file EDConsumerBase.cc.

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

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

80  {
81  if (iTag.label().empty()) {
82  return kWasEmpty;
83  }
84  return iTag;
85 }
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 101 of file EDConsumerBase.h.

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

Referenced by AlCaECALRecHitReducer::AlCaECALRecHitReducer(), MixCollectionValidation::bookHistograms(), BTagPerformanceAnalyzerMC::BTagPerformanceAnalyzerMC(), BTagPerformanceAnalyzerOnData::BTagPerformanceAnalyzerOnData(), CrossingFramePSimHitToPSimHitsConverter::CrossingFramePSimHitToPSimHitsConverter(), EcalPileUpDepMonitor::EcalPileUpDepMonitor(), ElectronNHitSeedProducer::ElectronNHitSeedProducer(), EmDQMReco::EmDQMReco(), edm::EventContentAnalyzer::EventContentAnalyzer(), EcalDQMonitorTask::formSchedule(), GoodSeedProducer::GoodSeedProducer(), GsfTrackRefitter::GsfTrackRefitter(), HITrackClusterRemover::HITrackClusterRemover(), HLTMuonIsoFilter::HLTMuonIsoFilter(), HLTMuonPFIsoFilter::HLTMuonPFIsoFilter(), JetCollectionReducerT< T >::JetCollectionReducerT(), JetTagProducer::JetTagProducer(), edm::OutputModule::keepThisBranch(), edm::one::OutputModuleBase::keepThisBranch(), edm::SubProcess::keepThisBranch(), edm::global::OutputModuleBase::keepThisBranch(), cms::METSignificanceProducer::METSignificanceProducer(), MultiplicityCorrelator::MultiplicityCorrelator(), MuonProducer::MuonProducer(), MuonTrackValidator::MuonTrackValidator(), NewMuonTrackValidator::NewMuonTrackValidator(), NoPileUpPFMEtProducer::NoPileUpPFMEtProducer(), pat::PackedPFCandidateRefMixer::PackedPFCandidateRefMixer(), pat::PATElectronProducer::PATElectronProducer(), pat::PATGenericParticleProducer::PATGenericParticleProducer(), pat::PATMETProducer::PATMETProducer(), pat::PATMuonProducer::PATMuonProducer(), pat::PATMuonSlimmer::PATMuonSlimmer(), pat::PATPackedCandidateProducer::PATPackedCandidateProducer(), pat::PATPFParticleProducer::PATPFParticleProducer(), pat::PATPhotonProducer::PATPhotonProducer(), pat::PATTauProducer::PATTauProducer(), pat::PATVertexAssociationProducer::PATVertexAssociationProducer(), PFTrackProducer::PFTrackProducer(), PrimaryVertexAnalyzer4PUSlimmed::PrimaryVertexAnalyzer4PUSlimmed(), ReducedEGProducer::ReducedEGProducer(), SeedMultiplicityAnalyzer::SeedMultiplicityAnalyzer(), ShallowSimhitClustersProducer::ShallowSimhitClustersProducer(), SiStripMonitorDigi::SiStripMonitorDigi(), TrackingParticleNumberOfLayersProducer::TrackingParticleNumberOfLayersProducer(), TrackRefitter::TrackRefitter(), TTClusterAssociator< T >::TTClusterAssociator(), TTClusterBuilder< T >::TTClusterBuilder(), TTStubAssociator< T >::TTStubAssociator(), and TTTrackAssociator< T >::TTTrackAssociator().

101  {
102  TypeToGet tid=TypeToGet::make<ProductType>();
103  return EDGetTokenT<ProductType>{recordConsumes(B,tid, checkIfEmpty(tag),true)};
104  }
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::consumes ( const TypeToGet id,
edm::InputTag const &  tag 
)
inlineprotected

Definition at line 106 of file EDConsumerBase.h.

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

106  {
107  return EDGetToken{recordConsumes(InEvent, id, checkIfEmpty(tag), true)};
108  }
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 111 of file EDConsumerBase.h.

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

111  {
112  return EDGetToken{recordConsumes(B, id, checkIfEmpty(tag), true)};
113  }
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 72 of file EDConsumerBase.cc.

References EnergyCorrector::c, and kWasEmpty.

Referenced by AlcaBeamMonitor::AlcaBeamMonitor(), AlcaBeamSpotProducer::AlcaBeamSpotProducer(), IsolatedParticlesGeneratedJets::analyze(), edm::AnalyzerWrapper< T >::AnalyzerWrapper(), BCToEFilter::BCToEFilter(), BeamMonitor::BeamMonitor(), BeamMonitorBx::BeamMonitorBx(), BeamSpotAnalyzer::BeamSpotAnalyzer(), FastTSGFromL2Muon::beginRun(), DTTrigTest::beginRun(), CaloCleaner< T >::CaloCleaner(), CandIsoDepositProducer::CandIsoDepositProducer(), CandIsolatorFromDeposits::CandIsolatorFromDeposits(), ConfigurableAnalysis::ConfigurableAnalysis(), CorrectedECALPFClusterProducer::CorrectedECALPFClusterProducer(), CosmicsMuonIdProducer::CosmicsMuonIdProducer(), CosmicSplitterValidation::CosmicSplitterValidation(), CSCDigiValidation::CSCDigiValidation(), CSCMonitorModule::CSCMonitorModule(), CSCRecHitValidation::CSCRecHitValidation(), CtfSpecialSeedGenerator::CtfSpecialSeedGenerator(), edm::DataMixingModule::DataMixingModule(), edm::OutputModule::doPreallocate(), edm::global::OutputModuleBase::doPreallocate(), edm::one::OutputModuleBase::doPreallocate(), DTTrigProd::DTTrigProd(), EcalCosmicsHists::EcalCosmicsHists(), EcalDQMonitorTask::EcalDQMonitorTask(), EcalRecHitProducer::EcalRecHitProducer(), EcalSelectiveReadoutValidation::EcalSelectiveReadoutValidation(), EcalUncalibRecHitProducer::EcalUncalibRecHitProducer(), EDMtoMEConverter::EDMtoMEConverter(), EgammaHLTFilteredSuperClusterProducer::EgammaHLTFilteredSuperClusterProducer(), EgammaHLTPixelMatchElectronProducers::EgammaHLTPixelMatchElectronProducers(), EgHLTOfflineSource::EgHLTOfflineSource(), ElectronSeedProducer::ElectronSeedProducer(), EopTreeWriter::EopTreeWriter(), EventWithHistoryEDFilter::EventWithHistoryEDFilter(), edm::FilterWrapper< T >::FilterWrapper(), FSQDiJetAve::FSQDiJetAve(), FTLRecHitProducer::FTLRecHitProducer(), FTLUncalibratedRecHitProducer::FTLUncalibratedRecHitProducer(), GEDPhotonProducer::GEDPhotonProducer(), GlobalCosmicMuonProducer::GlobalCosmicMuonProducer(), GlobalTrackQualityProducer::GlobalTrackQualityProducer(), HGCalClusterTestProducer::HGCalClusterTestProducer(), HGCalTriggerNtupleManager::HGCalTriggerNtupleManager(), HighPtTrackEcalDetIdProducer::HighPtTrackEcalDetIdProducer(), HitTripletEDProducerT< T_HitTripletGenerator >::HitTripletEDProducerT(), HLTBitAnalyzer::HLTBitAnalyzer(), HLTExoticaValidator::HLTExoticaValidator(), HLTHiggsValidator::HLTHiggsValidator(), HLTMuonIsoFilter::HLTMuonIsoFilter(), HLTMuonValidator::HLTMuonValidator(), HLTTauDQMOfflineSource::HLTTauDQMOfflineSource(), cms::CkfDebugTrackCandidateMaker::initDebugger(), InterestingTrackEcalDetIdProducer::InterestingTrackEcalDetIdProducer(), IsolatedTracksCone::IsolatedTracksCone(), JetCorrectorProducer< T >::JetCorrectorProducer(), JetMETHLTOfflineSource::JetMETHLTOfflineSource(), L1EventTreeProducer::L1EventTreeProducer(), L1GlobalTrigger::L1GlobalTrigger(), L1MuGlobalMuonTrigger::L1MuGlobalMuonTrigger(), l1t::L1TDigiToRaw::L1TDigiToRaw(), L2MuonIsolationProducer::L2MuonIsolationProducer(), L3MuonCombinedRelativeIsolationProducer::L3MuonCombinedRelativeIsolationProducer(), L3MuonIsolationProducer::L3MuonIsolationProducer(), LogMessageMonitor::LogMessageMonitor(), pat::helper::ManyThingsToValueMaps< Adaptor, Collection, value_type >::ManyThingsToValueMaps(), pat::PATMETSlimmer::maybeReadShifts(), edm::MixingModule::MixingModule(), pat::ModifiedObjectProducer< T >::ModifiedObjectProducer(), MuIsoDepositProducer::MuIsoDepositProducer(), MultiplicityCorrelator::MultiplicityCorrelator(), MultiplicityInvestigator::MultiplicityInvestigator(), MultiplicityTimeCorrelations::MultiplicityTimeCorrelations(), MultiTrackValidator::MultiTrackValidator(), MuonAssociatorEDProducer::MuonAssociatorEDProducer(), MuonIdProducer::MuonIdProducer(), cms::MuonMETValueMapProducer::MuonMETValueMapProducer(), MuonProducer::MuonProducer(), MuonSeedGenerator::MuonSeedGenerator(), MuonSeedProducer::MuonSeedProducer(), MuonShowerInformationProducer::MuonShowerInformationProducer(), MuonTimingProducer::MuonTimingProducer(), MuonToTrackingParticleAssociatorEDProducer::MuonToTrackingParticleAssociatorEDProducer(), MuPFIsoEmbedder::MuPFIsoEmbedder(), MVAValueMapProducer< ParticleType >::MVAValueMapProducer(), OccupancyPlots::OccupancyPlots(), edm::OutputModule::OutputModule(), edm::global::OutputModuleBase::OutputModuleBase(), edm::one::OutputModuleBase::OutputModuleBase(), pat::PATCleaner< PATObjType >::PATCleaner(), pat::PATCompositeCandidateProducer::PATCompositeCandidateProducer(), pat::PATElectronProducer::PATElectronProducer(), pat::PATElectronSlimmer::PATElectronSlimmer(), pat::PATGenericParticleProducer::PATGenericParticleProducer(), pat::PATJetProducer::PATJetProducer(), pat::PATJetSlimmer::PATJetSlimmer(), pat::PATJetUpdater::PATJetUpdater(), pat::PATMETProducer::PATMETProducer(), pat::PATMuonProducer::PATMuonProducer(), pat::PATMuonSlimmer::PATMuonSlimmer(), pat::PATPFParticleProducer::PATPFParticleProducer(), pat::PATPhotonProducer::PATPhotonProducer(), pat::PATPhotonSlimmer::PATPhotonSlimmer(), pat::PATTauProducer::PATTauProducer(), pat::PATTauSlimmer::PATTauSlimmer(), PFCandIsolatorFromDeposits::PFCandIsolatorFromDeposits(), PFClusterProducer::PFClusterProducer(), citk::PFIsolationSumProducer::PFIsolationSumProducer(), citk::PFIsolationSumProducerForPUPPI::PFIsolationSumProducerForPUPPI(), PFRecHitProducer::PFRecHitProducer(), PFRecoTauChargedHadronProducer::PFRecoTauChargedHadronProducer(), PFRecoTauDiscriminationByNProngs::PFRecoTauDiscriminationByNProngs(), PFTauPrimaryVertexProducer::PFTauPrimaryVertexProducer(), PhotonConversionTrajectorySeedProducerFromQuadruplets::PhotonConversionTrajectorySeedProducerFromQuadruplets(), PhotonConversionTrajectorySeedProducerFromSingleLeg::PhotonConversionTrajectorySeedProducerFromSingleLeg(), PhotonProducer::PhotonProducer(), PixelQuadrupletMergerEDProducer::PixelQuadrupletMergerEDProducer(), PixelTracksProducer::PixelTracksProducer(), PlottingDevice::PlottingDevice(), RecoTauCleanerImpl< Prod >::RecoTauCleanerImpl(), RecoTauPiZeroProducer::RecoTauPiZeroProducer(), RecoTauProducer::RecoTauProducer(), ReduceHcalRecHitCollectionProducer::ReduceHcalRecHitCollectionProducer(), SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator >::SeedCreatorFromRegionHitsEDProducerT(), SeedGeneratorFromRegionHitsEDProducer::SeedGeneratorFromRegionHitsEDProducer(), SeedMultiplicityAnalyzer::SeedMultiplicityAnalyzer(), SETMuonSeedProducer::SETMuonSeedProducer(), SingleTopTChannelLeptonDQM::SingleTopTChannelLeptonDQM(), SingleTopTChannelLeptonDQM_miniAOD::SingleTopTChannelLeptonDQM_miniAOD(), SiPixelPhase1Base::SiPixelPhase1Base(), SiPixelRawToDigi::SiPixelRawToDigi(), SiStripDCSFilter::SiStripDCSFilter(), SiStripMonitorCluster::SiStripMonitorCluster(), SiStripMonitorDigi::SiStripMonitorDigi(), SiStripMonitorTrack::SiStripMonitorTrack(), edm::SubProcess::SubProcess(), TagProbeFitTreeProducer::TagProbeFitTreeProducer(), Tau3MuSkim::Tau3MuSkim(), TauTagValidation::TauTagValidation(), cms::TCMETProducer::TCMETProducer(), TopDiLeptonHLTOfflineDQM::TopDiLeptonHLTOfflineDQM(), TopDiLeptonOfflineDQM::TopDiLeptonOfflineDQM(), TopSingleLeptonDQM::TopSingleLeptonDQM(), TopSingleLeptonDQM_miniAOD::TopSingleLeptonDQM_miniAOD(), TopSingleLeptonHLTOfflineDQM::TopSingleLeptonHLTOfflineDQM(), TrackingMonitor::TrackingMonitor(), TrackingRecHitProducer::TrackingRecHitProducer(), TrajectorySeedProducer::TrajectorySeedProducer(), TSGFromL1Muon::TSGFromL1Muon(), TSGFromL2Muon::TSGFromL2Muon(), TtDilepEvtSolutionMaker::TtDilepEvtSolutionMaker(), TtSemiEvtSolutionMaker::TtSemiEvtSolutionMaker(), Type2CorrectionProducer::Type2CorrectionProducer(), VersionedIdProducer< PhysicsObjectPtr, SelectorType >::VersionedIdProducer(), and VirtualJetProducer::VirtualJetProducer().

72  {
73  ConsumesCollector c{this};
74  return c;
75 }
std::vector< ConsumesInfo > EDConsumerBase::consumesInfo ( ) const

Definition at line 484 of file EDConsumerBase.cc.

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

484  {
485 
486  // Use this to eliminate duplicate entries related
487  // to consumesMany items where only the type was specified
488  // and the there are multiple matches. In these cases the
489  // label, instance, and process will be empty.
490  std::set<edm::TypeID> alreadySeenTypes;
491 
492  std::vector<ConsumesInfo> result;
493  auto itAlways = m_tokenInfo.begin<kAlwaysGets>();
494  auto itKind = m_tokenInfo.begin<kKind>();
495  auto itLabels = m_tokenInfo.begin<kLabels>();
496  for(auto itInfo = m_tokenInfo.begin<kLookupInfo>(),itEnd = m_tokenInfo.end<kLookupInfo>();
497  itInfo != itEnd; ++itInfo,++itKind,++itLabels, ++itAlways) {
498 
499  const unsigned int labelStart = itLabels->m_startOfModuleLabel;
500  const char* consumedModuleLabel = &(m_tokenLabels[labelStart]);
501  const char* consumedInstance = consumedModuleLabel+itLabels->m_deltaToProductInstance;
502  const char* consumedProcessName = consumedModuleLabel+itLabels->m_deltaToProcessName;
503 
504  // consumesMany case
505  if(*consumedModuleLabel == '\0') {
506  if(!alreadySeenTypes.insert(itInfo->m_type).second) {
507  continue;
508  }
509  }
510 
511  // Just copy the information into the ConsumesInfo data structure
512  result.emplace_back(itInfo->m_type,
513  consumedModuleLabel,
514  consumedInstance,
515  consumedProcessName,
516  itInfo->m_branchType,
517  *itKind,
518  *itAlways,
519  itInfo->m_index.skipCurrentProcess());
520  }
521  return result;
522 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
std::vector< char > m_tokenLabels
template<typename ProductType , BranchType B = InEvent>
void edm::EDConsumerBase::consumesMany ( )
inlineprotected

Definition at line 131 of file EDConsumerBase.h.

131  {
132  TypeToGet tid=TypeToGet::make<ProductType>();
133  consumesMany<B>(tid);
134  }
void edm::EDConsumerBase::consumesMany ( const TypeToGet id)
inlineprotected

Definition at line 136 of file EDConsumerBase.h.

References hcalTTPDigis_cfi::id.

136  {
137  consumesMany<InEvent>(id);
138  }
template<BranchType B>
void edm::EDConsumerBase::consumesMany ( const TypeToGet id)
inlineprotected

Definition at line 141 of file EDConsumerBase.h.

References TtFullHadDaughter::B, checkIfEmpty(), recordConsumes(), GlobalPosition_Frontier_DevDB_cff::tag, throwBadToken(), throwBranchMismatch(), throwConsumesCallAfterFrozen(), and throwTypeMismatch().

141  {
142  recordConsumes(B,id,edm::InputTag{},true);
143  }
unsigned int recordConsumes(BranchType iBranch, TypeToGet const &iType, edm::InputTag const &iTag, bool iAlwaysGets)
static const std::string B
ProductResolverIndexAndSkipBit EDConsumerBase::indexFrom ( EDGetToken  iToken,
BranchType  iBranch,
TypeID const &  iType 
) const

Definition at line 200 of file EDConsumerBase.cc.

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

Referenced by EDConsumerBase(), and edm::PrincipalGetAdapter::getByToken_().

201 {
202  if(unlikely(iToken.index()>=m_tokenInfo.size())) {
203  throwBadToken(iType,iToken);
204  }
205  const auto& info = m_tokenInfo.get<kLookupInfo>(iToken.index());
206  if (likely(iBranch == info.m_branchType)) {
207  if (likely(iType == info.m_type)) {
208  return info.m_index;
209  } else {
210  throwTypeMismatch(iType, iToken);
211  }
212  } else {
213  throwBranchMismatch(iBranch,iToken);
214  }
216 }
static const TGPicture * info(bool iBackgroundIsBlack)
void throwTypeMismatch(edm::TypeID const &, EDGetToken) const
void throwBadToken(edm::TypeID const &iType, EDGetToken iToken) const
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
#define unlikely(x)
#define likely(x)
void throwBranchMismatch(BranchType, EDGetToken) const
unsigned int index() const
Definition: EDGetToken.h:46
void EDConsumerBase::itemsMayGet ( BranchType  iBranch,
std::vector< ProductResolverIndexAndSkipBit > &  oIndices 
) const

Definition at line 255 of file EDConsumerBase.cc.

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

Referenced by EDConsumerBase(), and updateLookup().

256 {
257  //how many are we adding?
258  unsigned int count=0;
259  {
260  auto itAlwaysGet = m_tokenInfo.begin<kAlwaysGets>();
261  for(auto it = m_tokenInfo.begin<kLookupInfo>(),
262  itEnd = m_tokenInfo.end<kLookupInfo>();
263  it != itEnd; ++it,++itAlwaysGet) {
264  if(iBranch==it->m_branchType) {
265  if (it->m_index.productResolverIndex() != ProductResolverIndexInvalid) {
266  if(not *itAlwaysGet) {
267  ++count;
268  }
269  }
270  }
271  }
272  }
273  oIndices.reserve(oIndices.size()+count);
274  {
275  auto itAlwaysGet = m_tokenInfo.begin<kAlwaysGets>();
276  for(auto it = m_tokenInfo.begin<kLookupInfo>(),
277  itEnd = m_tokenInfo.end<kLookupInfo>();
278  it != itEnd; ++it,++itAlwaysGet) {
279  if(iBranch==it->m_branchType) {
280  if (it->m_index.productResolverIndex() != ProductResolverIndexInvalid) {
281  if(not *itAlwaysGet) {
282  oIndices.push_back(it->m_index);
283  }
284  }
285  }
286  }
287  }
288 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
void EDConsumerBase::itemsToGet ( BranchType  iBranch,
std::vector< ProductResolverIndexAndSkipBit > &  oIndices 
) const

Definition at line 219 of file EDConsumerBase.cc.

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

Referenced by EDConsumerBase(), and updateLookup().

220 {
221  //how many are we adding?
222  unsigned int count=0;
223  {
224  auto itAlwaysGet = m_tokenInfo.begin<kAlwaysGets>();
225  for(auto it = m_tokenInfo.begin<kLookupInfo>(),
226  itEnd = m_tokenInfo.end<kLookupInfo>();
227  it != itEnd; ++it,++itAlwaysGet) {
228  if(iBranch==it->m_branchType) {
229  if (it->m_index.productResolverIndex() != ProductResolverIndexInvalid) {
230  if(*itAlwaysGet) {
231  ++count;
232  }
233  }
234  }
235  }
236  }
237  oIndices.reserve(oIndices.size()+count);
238  {
239  auto itAlwaysGet = m_tokenInfo.begin<kAlwaysGets>();
240  for(auto it = m_tokenInfo.begin<kLookupInfo>(),
241  itEnd = m_tokenInfo.end<kLookupInfo>();
242  it != itEnd; ++it,++itAlwaysGet) {
243  if(iBranch==it->m_branchType) {
244  if (it->m_index.productResolverIndex() != ProductResolverIndexInvalid) {
245  if(*itAlwaysGet) {
246  oIndices.push_back(it->m_index);
247  }
248  }
249  }
250  }
251  }
252 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
std::vector<ProductResolverIndexAndSkipBit> const& edm::EDConsumerBase::itemsToGetFrom ( BranchType  iType) const
inline

Definition at line 70 of file EDConsumerBase.h.

References itemsToGetFromBranch_, registeredToConsume(), registeredToConsumeMany(), and updateLookup().

70 { return itemsToGetFromBranch_[iType]; }
std::array< std::vector< ProductResolverIndexAndSkipBit >, edm::NumBranchTypes > itemsToGetFromBranch_
void EDConsumerBase::labelsForToken ( EDGetToken  iToken,
Labels oLabels 
) const

Definition at line 291 of file EDConsumerBase.cc.

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

Referenced by EgammaBasicClusters::analyze(), AlCaElectronsTest::analyze(), SiPixelHitEfficiencySource::analyze(), EnergyScaleAnalyzer::analyze(), SiPixelTrackResidualSource::analyze(), HLTScalers::analyze(), EgammaObjects::analyzeElectrons(), EgammaObjects::analyzePhotons(), ElectronTagProbeAnalyzer::bookHistograms(), TkAlCaRecoMonitor::bookHistograms(), ElectronAnalyzer::bookHistograms(), 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(), MuonSimHitsValidAnalyzer::MuonSimHitsValidAnalyzer(), TrackRefitter::produce(), HIPixelTrackFilterProducer::produce(), GenTrackMatcher::produce(), ReducedESRecHitCollectionProducer::produce(), HIProtoTrackFilterProducer::produce(), EcalEBTrigPrimProducer::produce(), ReducedRecHitCollectionProducer::produce(), SeedClusterRemoverPhase2::produce(), SeedClusterRemover::produce(), EcalTrigPrimProducer::produce(), HITrackClusterRemover::produce(), cms::CosmicTrackFinder::produce(), and edm::PrincipalGetAdapter::throwAmbiguousException().

292 {
293  unsigned int index = iToken.index();
294  auto labels = m_tokenInfo.get<kLabels>(index);
295  unsigned int start = labels.m_startOfModuleLabel;
296  oLabels.module = &(m_tokenLabels[start]);
297  oLabels.productInstance = oLabels.module+labels.m_deltaToProductInstance;
298  oLabels.process = oLabels.module+labels.m_deltaToProcessName;
299 }
Definition: start.py:1
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
std::vector< char > m_tokenLabels
unsigned int index() const
Definition: EDGetToken.h:46
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT<ProductType> edm::EDConsumerBase::mayConsume ( edm::InputTag const &  tag)
inlineprotected

Definition at line 116 of file EDConsumerBase.h.

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

Referenced by cms::PFMETProducer::PFMETProducer().

116  {
117  TypeToGet tid=TypeToGet::make<ProductType>();
118  return EDGetTokenT<ProductType>{recordConsumes(B, tid, checkIfEmpty(tag), false)};
119  }
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 121 of file EDConsumerBase.h.

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

121  {
122  return mayConsume<InEvent>(id,tag);
123  }
template<BranchType B>
EDGetToken edm::EDConsumerBase::mayConsume ( const TypeToGet id,
edm::InputTag const &  tag 
)
inlineprotected

Definition at line 126 of file EDConsumerBase.h.

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

126  {
127  return EDGetToken{recordConsumes(B,id,checkIfEmpty(tag),false)};
128  }
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::vector< ModuleDescription const * > &  modules,
ProductRegistry const &  preg,
std::map< std::string, ModuleDescription const * > const &  labelsToDesc,
std::string const &  processName 
) const

Definition at line 427 of file EDConsumerBase.cc.

References edm::ProductResolverIndexHelper::index(), edm::InEvent, kKind, kLabels, kLookupInfo, m_tokenInfo, m_tokenLabels, patRefSel_triggerMatching_cfi::matches, ErrorSummaryFilter_cfi::modules, edm::ProductRegistry::productLookup(), edm::ProductResolverIndexInvalid, and edm::ProductResolverIndexHelper::relatedIndexes().

430  {
431 
432  ProductResolverIndexHelper const& iHelper = *preg.productLookup(InEvent);
433 
434  std::set<std::string> alreadyFound;
435 
436  auto itKind = m_tokenInfo.begin<kKind>();
437  auto itLabels = m_tokenInfo.begin<kLabels>();
438  for(auto itInfo = m_tokenInfo.begin<kLookupInfo>(),itEnd = m_tokenInfo.end<kLookupInfo>();
439  itInfo != itEnd; ++itInfo,++itKind,++itLabels) {
440 
441  if(itInfo->m_branchType == InEvent and
442  (not itInfo->m_index.skipCurrentProcess())) {
443 
444  const unsigned int labelStart = itLabels->m_startOfModuleLabel;
445  const char* consumedModuleLabel = &(m_tokenLabels[labelStart]);
446  const char* consumedProcessName = consumedModuleLabel+itLabels->m_deltaToProcessName;
447 
448  if(*consumedModuleLabel != '\0') { // not a consumesMany
449  if(*consumedProcessName != '\0') { // process name is specified in consumes call
450  if (processName == consumedProcessName &&
451  iHelper.index(*itKind,
452  itInfo->m_type,
453  consumedModuleLabel,
454  consumedModuleLabel+itLabels->m_deltaToProductInstance,
455  consumedModuleLabel+itLabels->m_deltaToProcessName) != ProductResolverIndexInvalid) {
456  insertFoundModuleLabel(consumedModuleLabel, modules, alreadyFound, labelsToDesc, preg);
457  }
458  } else { // process name was empty
459  auto matches = iHelper.relatedIndexes(*itKind,
460  itInfo->m_type,
461  consumedModuleLabel,
462  consumedModuleLabel+itLabels->m_deltaToProductInstance);
463  for(unsigned int j = 0; j < matches.numberOfMatches(); ++j) {
464  if(processName == matches.processName(j)) {
465  insertFoundModuleLabel(consumedModuleLabel, modules, alreadyFound, labelsToDesc, preg);
466  }
467  }
468  }
469  // consumesMany case
470  } else if(itInfo->m_index.productResolverIndex() == ProductResolverIndexInvalid) {
471  auto matches = iHelper.relatedIndexes(*itKind,
472  itInfo->m_type);
473  for(unsigned int j = 0; j < matches.numberOfMatches(); ++j) {
474  if(processName == matches.processName(j)) {
475  insertFoundModuleLabel(matches.moduleLabel(j), modules, alreadyFound, labelsToDesc, preg);
476  }
477  }
478  }
479  }
480  }
481 }
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
ProductResolverIndex index(KindOfType kindOfType, TypeID const &typeID, char const *moduleLabel, char const *instance, char const *process=0) const
EDConsumerBase const& edm::EDConsumerBase::operator= ( EDConsumerBase const &  )
delete

Referenced by EDConsumerBase().

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

References frozen_, diffTreeTool::index, edm::InputTag::instance(), edm::TypeToGet::kind(), edm::InputTag::label(), funct::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().

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

References kLookupInfo, m_tokenInfo, and edm::PRODUCT_TYPE.

Referenced by edm::Principal::findProductByLabel(), and itemsToGetFrom().

303 {
304  for(auto it = m_tokenInfo.begin<kLookupInfo>(),
305  itEnd = m_tokenInfo.end<kLookupInfo>();
306  it != itEnd; ++it) {
307  if(it->m_index.productResolverIndex() == iIndex and
308  it->m_index.skipCurrentProcess() == skipCurrentProcess and
309  it->m_branchType == iBranch) {
310  return true;
311  }
312  }
313  //TEMPORARY: Remember so we do not have to do this again
314  //non thread-safe
315  EDConsumerBase* nonConstThis = const_cast<EDConsumerBase*>(this);
316  nonConstThis->m_tokenInfo.emplace_back(TokenLookupInfo{TypeID{}, iIndex, skipCurrentProcess, iBranch},
317  true,
318  LabelPlacement{0,0,0},
319  PRODUCT_TYPE);
320 
321  return false;
322 }
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 325 of file EDConsumerBase.cc.

References kLookupInfo, m_tokenInfo, edm::PRODUCT_TYPE, and edm::ProductResolverIndexInvalid.

Referenced by edm::Principal::getManyByType(), and itemsToGetFrom().

326 {
327  for(auto it = m_tokenInfo.begin<kLookupInfo>(),
328  itEnd = m_tokenInfo.end<kLookupInfo>();
329  it != itEnd; ++it) {
330  //consumesMany entries do not have their index resolved
331  if(it->m_index.productResolverIndex() == ProductResolverIndexInvalid and
332  it->m_type == iType and
333  it->m_branchType == iBranch) {
334  return true;
335  }
336  }
337  //TEMPORARY: Remember so we do not have to do this again
338  //non thread-safe
339  EDConsumerBase* nonConstThis = const_cast<EDConsumerBase*>(this);
340  nonConstThis->m_tokenInfo.emplace_back(TokenLookupInfo{iType,ProductResolverIndexInvalid, false, iBranch},
341  true,
342  LabelPlacement{0,0,0},
343  PRODUCT_TYPE);
344  return false;
345 
346 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
void EDConsumerBase::throwBadToken ( edm::TypeID const &  iType,
EDGetToken  iToken 
) const
private

Definition at line 360 of file EDConsumerBase.cc.

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

Referenced by consumesMany(), and indexFrom().

361 {
362  if(iToken.isUninitialized()) {
363  throw cms::Exception("BadToken")<<"A get using a EDGetToken with the C++ type '"<<iType.className()<<"' was made using an uninitialized token.\n Please check that the variable is being initialized from a 'consumes' call.";
364  }
365  throw cms::Exception("BadToken")<<"A get using a EDGetToken with the C++ type '"<<iType.className()<<"' was made using a token with a value "<<iToken.index()<<" which is beyond the range used by this module.\n Please check that the variable is being initialized from a 'consumes' call from this module.\n You can not share EDGetToken values between modules.";
366 }
bool isUninitialized() const
Definition: EDGetToken.h:47
unsigned int index() const
Definition: EDGetToken.h:46
void EDConsumerBase::throwBranchMismatch ( BranchType  iBranch,
EDGetToken  iToken 
) const
private

Definition at line 355 of file EDConsumerBase.cc.

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

Referenced by consumesMany(), and indexFrom().

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

Definition at line 369 of file EDConsumerBase.cc.

References edm::ProductRegistry::aliasToOriginal(), Exception, AlCaHLTBitMon_QueryRunRegistry::string, edmPickEvents::target, and edm::TypeToGet::type().

Referenced by consumesMany(), and recordConsumes().

369  {
370  throw cms::Exception("LogicError") << "A module declared it consumes a product after its constructor.\n"
371  << "This must be done in the contructor\n"
372  << "The product type was: " << typeToGet.type() << "\n"
373  << "and " << inputTag << "\n";
374 }
void EDConsumerBase::throwTypeMismatch ( edm::TypeID const &  iType,
EDGetToken  iToken 
) const
private

Definition at line 350 of file EDConsumerBase.cc.

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

Referenced by consumesMany(), and indexFrom().

351 {
352  throw cms::Exception("TypeMismatch")<<"A get using a EDGetToken used the C++ type '"<<iType.className()<<"' but the consumes call was for type '"<<m_tokenInfo.get<kLookupInfo>(iToken.index()).m_type.className()<<"'.\n Please modify either the consumes or get call so the types match.";
353 }
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
unsigned int index() const
Definition: EDGetToken.h:46
void EDConsumerBase::updateLookup ( BranchType  iBranchType,
ProductResolverIndexHelper const &  iHelper,
bool  iPrefetchMayGet 
)

Definition at line 137 of file EDConsumerBase.cc.

References frozen_, mps_fire::i, edm::ProductResolverIndexHelper::index(), diffTreeTool::index, info(), itemsMayGet(), itemsToGet(), itemsToGetFromBranch_, kAlwaysGets, callgraph::kind, kKind, kLabels, kLookupInfo, tablePrinter::labels, m_tokenInfo, m_tokenLabels, patRefSel_triggerMatching_cfi::matches, edm::ProductResolverIndexInvalid, and edm::ProductResolverIndexHelper::relatedIndexes().

Referenced by edm::SubProcess::beginJob(), and itemsToGetFrom().

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

Friends And Related Function Documentation

friend class ConsumesCollector
friend

Definition at line 95 of file EDConsumerBase.h.

template<typename T >
friend class WillGetIfMatch
friend

Definition at line 96 of file EDConsumerBase.h.

Member Data Documentation

bool edm::EDConsumerBase::frozen_
private

Definition at line 189 of file EDConsumerBase.h.

Referenced by recordConsumes(), and updateLookup().

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

Definition at line 187 of file EDConsumerBase.h.

Referenced by itemsToGetFrom(), and updateLookup().

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