81 if (iTag.
label().empty()) {
98 const size_t labelSize = iTag.
label().size();
99 const size_t productInstanceSize = iTag.
instance().size();
101 unsigned short delta1 = labelSize+1;
102 unsigned short delta2 = labelSize+2+productInstanceSize;
108 const size_t additionalSize =
110 labelSize+productInstanceSize+3 :
111 labelSize+productInstanceSize+iTag.
process().size()+3;
125 if (!skipCurrentProcess) {
145 itInfo != itEnd; ++itInfo,++itKind,++itLabels) {
146 if(itInfo->m_branchType == iBranchType) {
147 const unsigned int labelStart = itLabels->m_startOfModuleLabel;
152 moduleLabel+itLabels->m_deltaToProductInstance,
153 moduleLabel+itLabels->m_deltaToProcessName),
154 itInfo->m_index.skipCurrentProcess());
164 if(
info.m_branchType == iBranchType &&
175 for(
unsigned int j=0;
j!=matches.numberOfMatches();++
j) {
177 if(matches.isFullyResolved(
j)) {
178 auto index =matches.index(
j);
220 unsigned int count=0;
225 it != itEnd; ++it,++itAlwaysGet) {
226 if(iBranch==it->m_branchType) {
235 oIndices.reserve(oIndices.size()+
count);
240 it != itEnd; ++it,++itAlwaysGet) {
241 if(iBranch==it->m_branchType) {
244 oIndices.push_back(it->m_index);
256 unsigned int count=0;
261 it != itEnd; ++it,++itAlwaysGet) {
262 if(iBranch==it->m_branchType) {
264 if(not *itAlwaysGet) {
271 oIndices.reserve(oIndices.size()+
count);
276 it != itEnd; ++it,++itAlwaysGet) {
277 if(iBranch==it->m_branchType) {
279 if(not *itAlwaysGet) {
280 oIndices.push_back(it->m_index);
305 if(it->m_index.productHolderIndex() == iIndex and
306 it->m_index.skipCurrentProcess() == skipCurrentProcess and
307 it->m_branchType == iBranch) {
330 it->m_type == iType and
331 it->m_branchType == iBranch) {
350 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.";
361 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.";
363 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.";
368 throw cms::Exception(
"LogicError") <<
"A module declared it consumes a product after its constructor.\n"
369 <<
"This must be done in the contructor\n"
370 <<
"The product type was: " << typeToGet.
type() <<
"\n"
371 <<
"and " << inputTag <<
"\n";
375 struct CharStarComp {
376 bool operator()(
const char* iLHS,
const char* iRHS)
const {
377 return strcmp(iLHS,iRHS) < 0;
386 std::vector<char const*>& oModuleLabels)
const {
387 std::set<char const*, CharStarComp> uniqueModules;
390 if(not
info.m_index.skipCurrentProcess()) {
392 unsigned int const start =
labels.m_startOfModuleLabel;
395 LogAbsolute(
"ModuleDependency") <<
"ModuleDependency '" << iModuleLabel <<
396 "' may consume product of type '" <<
info.m_type.className() <<
399 ':' << processName <<
"'";;
401 if((not processName)
or processName[0]==0
or iProcessName ==
processName) {
407 oModuleLabels = std::vector<const char*>(uniqueModules.begin(),uniqueModules.end());
413 insertFoundModuleLabel(
const char* consumedModuleLabel,
414 std::vector<ModuleDescription const*>&
modules,
415 std::set<std::string>& alreadyFound,
416 std::map<std::string, ModuleDescription const*>
const& labelsToDesc,
420 auto it = labelsToDesc.find(consumedModuleLabel);
421 if(it != labelsToDesc.end()) {
422 if(alreadyFound.insert(consumedModuleLabel).second) {
423 modules.push_back(it->second);
428 std::vector<std::pair<std::string, std::string> >
const& aliasToOriginal = preg.
aliasToOriginal();
430 auto iter = std::lower_bound(aliasToOriginal.begin(), aliasToOriginal.end(),
target);
431 if(iter != aliasToOriginal.end() && iter->first == consumedModuleLabel) {
433 std::string const& originalModuleLabel = iter->second;
434 auto iter2 = labelsToDesc.find(originalModuleLabel);
435 if(iter2 != labelsToDesc.end()) {
436 if(alreadyFound.insert(originalModuleLabel).second) {
437 modules.push_back(iter2->second);
447 <<
"Couldn't find ModuleDescription for the consumed module label: "
456 std::map<std::string, ModuleDescription const*>
const& labelsToDesc,
461 std::set<std::string> alreadyFound;
466 itInfo != itEnd; ++itInfo,++itKind,++itLabels) {
468 if(itInfo->m_branchType ==
InEvent) {
470 const unsigned int labelStart = itLabels->m_startOfModuleLabel;
471 const char* consumedModuleLabel = &(
m_tokenLabels[labelStart]);
472 const char* consumedProcessName = consumedModuleLabel+itLabels->m_deltaToProcessName;
474 if(*consumedModuleLabel !=
'\0') {
475 if(*consumedProcessName !=
'\0') {
476 if (processName == consumedProcessName &&
477 iHelper.
index(*itKind,
480 consumedModuleLabel+itLabels->m_deltaToProductInstance,
482 insertFoundModuleLabel(consumedModuleLabel, modules, alreadyFound, labelsToDesc, preg);
488 consumedModuleLabel+itLabels->m_deltaToProductInstance);
489 for(
unsigned int j = 0;
j <
matches.numberOfMatches(); ++
j) {
490 if(processName ==
matches.processName(
j)) {
491 insertFoundModuleLabel(consumedModuleLabel, modules, alreadyFound, labelsToDesc, preg);
499 for(
unsigned int j = 0;
j <
matches.numberOfMatches(); ++
j) {
500 if(processName ==
matches.processName(
j)) {
509 std::vector<ConsumesInfo>
516 std::set<edm::TypeID> alreadySeenTypes;
518 std::vector<ConsumesInfo>
result;
523 itInfo != itEnd; ++itInfo,++itKind,++itLabels, ++itAlways) {
525 const unsigned int labelStart = itLabels->m_startOfModuleLabel;
526 const char* consumedModuleLabel = &(
m_tokenLabels[labelStart]);
527 const char* consumedInstance = consumedModuleLabel+itLabels->m_deltaToProductInstance;
528 const char* consumedProcessName = consumedModuleLabel+itLabels->m_deltaToProcessName;
531 if(*consumedModuleLabel ==
'\0') {
532 if(!alreadySeenTypes.insert(itInfo->m_type).second) {
538 result.emplace_back(itInfo->m_type,
542 itInfo->m_branchType,
545 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
ProductHolderIndexAndSkipBit indexFrom(EDGetToken, BranchType, TypeID const &) const
std::shared_ptr< ProductHolderIndexHelper const > productLookup(BranchType branchType) const
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
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
char const * productInstance
bool registeredToConsume(ProductHolderIndex, bool, BranchType) const
TypeID const & type() const
void modulesDependentUpon(std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
std::vector< ProductHolderIndexAndSkipBit > itemsToGetFromEvent_
std::string const & className() const
unsigned int index() const