80 if (iTag.
label().empty()) {
97 const size_t labelSize = iTag.
label().size();
98 const size_t productInstanceSize = iTag.
instance().size();
100 unsigned short delta1 = labelSize+1;
101 unsigned short delta2 = labelSize+2+productInstanceSize;
107 const size_t additionalSize =
109 labelSize+productInstanceSize+3 :
110 labelSize+productInstanceSize+iTag.
process().size()+3;
124 if (!skipCurrentProcess) {
144 itInfo != itEnd; ++itInfo,++itKind,++itLabels) {
145 if(itInfo->m_branchType == iBranchType) {
146 const unsigned int labelStart = itLabels->m_startOfModuleLabel;
151 moduleLabel+itLabels->m_deltaToProductInstance,
152 moduleLabel+itLabels->m_deltaToProcessName),
153 itInfo->m_index.skipCurrentProcess());
163 if(
info.m_branchType == iBranchType &&
174 for(
unsigned int j=0;
j!=matches.numberOfMatches();++
j) {
176 if(matches.isFullyResolved(
j)) {
177 auto index =matches.index(
j);
219 unsigned int count=0;
224 it != itEnd; ++it,++itAlwaysGet) {
225 if(iBranch==it->m_branchType) {
234 oIndices.reserve(oIndices.size()+
count);
239 it != itEnd; ++it,++itAlwaysGet) {
240 if(iBranch==it->m_branchType) {
243 oIndices.push_back(it->m_index);
255 unsigned int count=0;
260 it != itEnd; ++it,++itAlwaysGet) {
261 if(iBranch==it->m_branchType) {
263 if(not *itAlwaysGet) {
270 oIndices.reserve(oIndices.size()+
count);
275 it != itEnd; ++it,++itAlwaysGet) {
276 if(iBranch==it->m_branchType) {
278 if(not *itAlwaysGet) {
279 oIndices.push_back(it->m_index);
304 if(it->m_index.productHolderIndex() == iIndex and
305 it->m_index.skipCurrentProcess() == skipCurrentProcess and
306 it->m_branchType == iBranch) {
329 it->m_type == iType and
330 it->m_branchType == iBranch) {
349 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.";
360 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.";
362 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.";
367 throw cms::Exception(
"LogicError") <<
"A module declared it consumes a product after its constructor.\n"
368 <<
"This must be done in the contructor\n"
369 <<
"The product type was: " << typeToGet.
type() <<
"\n"
370 <<
"and " << inputTag <<
"\n";
374 struct CharStarComp {
375 bool operator()(
const char* iLHS,
const char* iRHS)
const {
376 return strcmp(iLHS,iRHS) < 0;
383 std::vector<const char*>& oModuleLabels)
const {
384 std::set<const char*, CharStarComp> uniqueModules;
387 if( not
info.m_index.skipCurrentProcess() ) {
391 if( (not processName)
or processName[0]==0
or
398 oModuleLabels = std::vector<const char*>(uniqueModules.begin(),uniqueModules.end());
404 insertFoundModuleLabel(
const char* consumedModuleLabel,
405 std::vector<ModuleDescription const*>&
modules,
406 std::set<std::string>& alreadyFound,
407 std::map<std::string, ModuleDescription const*>
const& labelsToDesc,
411 auto it = labelsToDesc.find(consumedModuleLabel);
412 if(it != labelsToDesc.end()) {
413 if(alreadyFound.insert(consumedModuleLabel).second) {
414 modules.push_back(it->second);
419 std::vector<std::pair<std::string, std::string> >
const& aliasToOriginal = preg.
aliasToOriginal();
421 auto iter = std::lower_bound(aliasToOriginal.begin(), aliasToOriginal.end(),
target);
422 if(
iter != aliasToOriginal.end() &&
iter->first == consumedModuleLabel) {
425 auto iter2 = labelsToDesc.find(originalModuleLabel);
426 if(iter2 != labelsToDesc.end()) {
427 if(alreadyFound.insert(originalModuleLabel).second) {
428 modules.push_back(iter2->second);
438 <<
"Couldn't find ModuleDescription for the consumed module label: "
447 std::map<std::string, ModuleDescription const*>
const& labelsToDesc,
452 std::set<std::string> alreadyFound;
457 itInfo != itEnd; ++itInfo,++itKind,++itLabels) {
459 if(itInfo->m_branchType ==
InEvent) {
461 const unsigned int labelStart = itLabels->m_startOfModuleLabel;
462 const char* consumedModuleLabel = &(
m_tokenLabels[labelStart]);
463 const char* consumedProcessName = consumedModuleLabel+itLabels->m_deltaToProcessName;
465 if(*consumedModuleLabel !=
'\0') {
466 if(*consumedProcessName !=
'\0') {
467 if (processName == consumedProcessName &&
468 iHelper.
index(*itKind,
471 consumedModuleLabel+itLabels->m_deltaToProductInstance,
473 insertFoundModuleLabel(consumedModuleLabel, modules, alreadyFound, labelsToDesc, preg);
479 consumedModuleLabel+itLabels->m_deltaToProductInstance);
480 for(
unsigned int j = 0;
j < matches.numberOfMatches(); ++
j) {
481 if(processName == matches.processName(
j)) {
482 insertFoundModuleLabel(consumedModuleLabel, modules, alreadyFound, labelsToDesc, preg);
490 for(
unsigned int j = 0;
j < matches.numberOfMatches(); ++
j) {
491 if(processName == matches.processName(
j)) {
492 insertFoundModuleLabel(matches.moduleLabel(
j),
modules, alreadyFound, labelsToDesc,
preg);
500 std::vector<ConsumesInfo>
507 std::set<edm::TypeID> alreadySeenTypes;
509 std::vector<ConsumesInfo>
result;
514 itInfo != itEnd; ++itInfo,++itKind,++itLabels, ++itAlways) {
516 const unsigned int labelStart = itLabels->m_startOfModuleLabel;
517 const char* consumedModuleLabel = &(
m_tokenLabels[labelStart]);
518 const char* consumedInstance = consumedModuleLabel+itLabels->m_deltaToProductInstance;
519 const char* consumedProcessName = consumedModuleLabel+itLabels->m_deltaToProcessName;
522 if(*consumedModuleLabel ==
'\0') {
523 if(!alreadySeenTypes.insert(itInfo->m_type).second) {
529 result.emplace_back(itInfo->m_type,
533 itInfo->m_branchType,
536 itInfo->m_index.skipCurrentProcess());
Matches relatedIndexes(KindOfType kindOfType, TypeID const &typeID, char const *moduleLabel, char const *instance) const
tuple start
Check for commandline option errors.
std::vector< ConsumesInfo > consumesInfo() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
void updateLookup(BranchType iBranchType, ProductHolderIndexHelper const &)
ProductHolderIndex index(KindOfType kindOfType, TypeID const &typeID, char const *moduleLabel, char const *instance, char const *process=0) const
void itemsToGet(BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
void itemsMayGet(BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
void throwTypeMismatch(edm::TypeID const &, EDGetToken) const
void throwBadToken(edm::TypeID const &iType, EDGetToken iToken) const
std::shared_ptr< ProductHolderIndexHelper > const & productLookup(BranchType branchType) const
ProductHolderIndexAndSkipBit indexFrom(EDGetToken, BranchType, TypeID const &) const
const char * productInstance
unsigned int ProductHolderIndex
void throwConsumesCallAfterFrozen(TypeToGet const &, InputTag const &) const
edm::SoATuple< TokenLookupInfo, bool, LabelPlacement, edm::KindOfType > m_tokenInfo
void modulesWhoseProductsAreConsumed(std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
unsigned int recordConsumes(BranchType iBranch, TypeToGet const &iType, edm::InputTag const &iTag, bool iAlwaysGets)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void throwBranchMismatch(BranchType, EDGetToken) const
bool isUninitialized() const
std::vector< char > m_tokenLabels
void modulesDependentUpon(const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
edm::InputTag const & checkIfEmpty(edm::InputTag const &tag)
static const edm::InputTag kWasEmpty("@EmptyLabel@")
std::vector< std::pair< std::string, std::string > > const & aliasToOriginal() const
bool registeredToConsumeMany(TypeID const &, BranchType) const
virtual ~EDConsumerBase()
std::string const & BranchTypeToString(BranchType const &branchType)
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
bool registeredToConsume(ProductHolderIndex, bool, BranchType) const
TypeID const & type() const
std::vector< ProductHolderIndexAndSkipBit > itemsToGetFromEvent_
std::string const & className() const
unsigned int index() const