#include <ProductResolverIndexHelper.h>
Classes | |
class | IndexAndNames |
class | Item |
class | Matches |
class | Range |
Public Types | |
using | ModulesToIndiciesMap = std::unordered_multimap< std::string, std::tuple< TypeID const *, const char *, ProductResolverIndex > > |
Public Member Functions | |
unsigned int | beginElements () const |
ProductResolverIndex | index (KindOfType kindOfType, TypeID const &typeID, char const *moduleLabel, char const *instance, char const *process=nullptr) const |
std::vector< IndexAndNames > const & | indexAndNames () const |
unsigned int | indexToIndexAndNames (KindOfType kindOfType, TypeID const &typeID, char const *moduleLabel, char const *instance, char const *process) const |
unsigned int | indexToType (KindOfType kindOfType, TypeID const &typeID) const |
ModulesToIndiciesMap | indiciesForModulesInProcess (const std::string &iProcessName) const |
ProductResolverIndex | insert (TypeID const &typeID, char const *moduleLabel, char const *instance, char const *process) |
ProductResolverIndex | insert (TypeID const &typeID, char const *moduleLabel, char const *instance, char const *process, TypeID const &containedTypeID, std::vector< TypeWithDict > *baseTypesOfContainedType) |
std::vector< std::string > const & | lookupProcessNames () const |
ProductResolverIndex | nextIndexValue () const |
void | print (std::ostream &os) const |
unsigned int | processIndex (char const *process) const |
std::vector< char > const & | processNames () const |
ProductResolverIndexHelper () | |
std::vector< Range > const & | ranges () const |
Matches | relatedIndexes (KindOfType kindOfType, TypeID const &typeID) const |
Matches | relatedIndexes (KindOfType kindOfType, TypeID const &typeID, char const *moduleLabel, char const *instance) const |
void | sanityCheck () const |
void | setFrozen () |
std::vector< TypeID > const & | sortedTypeIDs () const |
Private Attributes | |
unsigned int | beginElements_ |
std::vector< char > | bigNamesContainer_ |
std::vector< IndexAndNames > | indexAndNames_ |
edm::propagate_const< std::unique_ptr< std::set< Item > > > | items_ |
std::vector< std::string > | lookupProcessNames_ |
ProductResolverIndex | nextIndexValue_ |
edm::propagate_const< std::unique_ptr< std::set< std::string > > > | processItems_ |
std::vector< char > | processNames_ |
std::vector< Range > | ranges_ |
std::vector< TypeID > | sortedTypeIDs_ |
This class assigns and gets the ProductResolverIndex associated with a type, module label, instance, and process. The ProductResolverIndex is used to tell the Principal where to store a ProductResolver and how to find it quickly.
One can also look up the same ProductResolverIndex's using the type or base type of an element in a container in the product (if the product is a container). In this case the KindOfType argument to the Principal::getByLabel function is ELEMENT_TYPE, whereas normally it is PRODUCT_TYPE.
There are also special ProductResolverIndex's generated where the process name is empty. These indexes refer to a special ProductResolvers that search for a matching product from the most recent process that has a matching type, label and instance. There is ProductResolverIndex generated for each type/label/instance combination which has at least one entry in the tables in this class. Both PRODUCT_TYPEs and ELEMENT_TYPEs get these special ProductResolvers.
The ProductResolverIndex for a particular product will not change during a process after the ProductRegistry has been frozen. Nor will any of the other member data of this class. Multiple threads can access it concurrently without problems. The ProductResolverIndexes can be safely cached in InputTags and possibly other places, because they never change within a process. The ProductResolverIndex for a particular product is not intended to be persistent and will be different in different processes.
The ProductResolverIndex is used to order the placement of the ProductResolvers in the Principal that are either present in the input or produced in the current process. Be aware that there are other ProductResolvers for products that come after ProductResolvers placed by this class. For example, the placement of dropped products is not handled by this class, instead by the ProductRegistry. The reason for this distinction is that those other ProductResolvers can change and be added as a process runs. The content of this class never changes after the ProductRegistry is frozen.
Definition at line 89 of file ProductResolverIndexHelper.h.
using edm::ProductResolverIndexHelper::ModulesToIndiciesMap = std::unordered_multimap<std::string, std::tuple<TypeID const*, const char*, ProductResolverIndex> > |
Definition at line 124 of file ProductResolverIndexHelper.h.
edm::ProductResolverIndexHelper::ProductResolverIndexHelper | ( | ) |
Definition at line 75 of file ProductResolverIndexHelper.cc.
|
inline |
ProductResolverIndex edm::ProductResolverIndexHelper::index | ( | KindOfType | kindOfType, |
TypeID const & | typeID, | ||
char const * | moduleLabel, | ||
char const * | instance, | ||
char const * | process = nullptr |
||
) | const |
Definition at line 81 of file ProductResolverIndexHelper.cc.
References indexAndNames_, indexToIndexAndNames(), instance, SiStripPI::max, HerwigMaxPtPartonFilter_cfi::moduleLabel, LaserDQM_cfg::process, and edm::ProductResolverIndexInvalid.
Referenced by edm::Principal::findProductByLabel(), edm::PrincipalGetAdapter::getBranchDescription(), BeautifulSoup.PageElement::insert(), edm::EDConsumerBase::modulesWhoseProductsAreConsumed(), and edm::EDConsumerBase::updateLookup().
|
inline |
Definition at line 226 of file ProductResolverIndexHelper.h.
References indexAndNames_.
Referenced by indiciesForModulesInProcess().
unsigned int edm::ProductResolverIndexHelper::indexToIndexAndNames | ( | KindOfType | kindOfType, |
TypeID const & | typeID, | ||
char const * | moduleLabel, | ||
char const * | instance, | ||
char const * | process | ||
) | const |
Definition at line 420 of file ProductResolverIndexHelper.cc.
References begin, bigNamesContainer_, end, indexAndNames_, indexToType(), instance, MuonErrorMatrixAdjuster_cfi::instanceName, label, SiStripPI::max, HerwigMaxPtPartonFilter_cfi::moduleLabel, LaserDQM_cfg::process, processIndex(), FastTimerService_cff::range, and ranges_.
Referenced by index(), and relatedIndexes().
unsigned int edm::ProductResolverIndexHelper::indexToType | ( | KindOfType | kindOfType, |
TypeID const & | typeID | ||
) | const |
Definition at line 506 of file ProductResolverIndexHelper.cc.
References beginElements_, edm::ELEMENT_TYPE, SiStripPI::max, and sortedTypeIDs_.
Referenced by indexToIndexAndNames(), and relatedIndexes().
ProductResolverIndexHelper::ModulesToIndiciesMap edm::ProductResolverIndexHelper::indiciesForModulesInProcess | ( | const std::string & | iProcessName | ) | const |
Definition at line 553 of file ProductResolverIndexHelper.cc.
References beginElements_, bigNamesContainer_, mps_fire::i, indexAndNames(), indexAndNames_, dqmiolumiharvest::j, cmsLHEtoEOSManager::l, processNames_, FastTimerService_cff::range, ranges_, mps_fire::result, and sortedTypeIDs_.
ProductResolverIndex edm::ProductResolverIndexHelper::insert | ( | TypeID const & | typeID, |
char const * | moduleLabel, | ||
char const * | instance, | ||
char const * | process | ||
) |
Definition at line 263 of file ProductResolverIndexHelper.cc.
References edm::productholderindexhelper::getContainedType(), insert(), instance, HerwigMaxPtPartonFilter_cfi::moduleLabel, LaserDQM_cfg::process, and edm::public_base_classes().
Referenced by BeautifulSoup.PageElement::append().
ProductResolverIndex edm::ProductResolverIndexHelper::insert | ( | TypeID const & | typeID, |
char const * | moduleLabel, | ||
char const * | instance, | ||
char const * | process, | ||
TypeID const & | containedTypeID, | ||
std::vector< TypeWithDict > * | baseTypesOfContainedType | ||
) |
Definition at line 178 of file ProductResolverIndexHelper.cc.
References edm::ELEMENT_TYPE, Exception, instance, B2GTnPMonitor_cfi::item, items_, edm::errors::LogicError, HerwigMaxPtPartonFilter_cfi::moduleLabel, nextIndexValue_, LaserDQM_cfg::process, edm::PRODUCT_TYPE, edm::ProductResolverIndexAmbiguous, and edm::TypeID::typeInfo().
Referenced by BeautifulSoup.PageElement::append(), and insert().
std::vector< std::string > const & edm::ProductResolverIndexHelper::lookupProcessNames | ( | ) | const |
Definition at line 412 of file ProductResolverIndexHelper.cc.
References Exception, items_, edm::errors::LogicError, and lookupProcessNames_.
|
inline |
void edm::ProductResolverIndexHelper::print | ( | std::ostream & | os | ) | const |
Definition at line 670 of file ProductResolverIndexHelper.cc.
References beginElements_, bigNamesContainer_, gather_cfg::cout, mps_fire::i, indexAndNames_, B2GTnPMonitor_cfi::item, items_, nextIndexValue_, processItems_, processNames_, ranges_, and sortedTypeIDs_.
unsigned int edm::ProductResolverIndexHelper::processIndex | ( | char const * | process | ) | const |
Definition at line 529 of file ProductResolverIndexHelper.cc.
References begin, SiStripPI::max, AlCaHLTBitMon_ParallelJobs::p, LaserDQM_cfg::process, and processNames_.
Referenced by indexToIndexAndNames(), and setFrozen().
|
inline |
|
inline |
ProductResolverIndexHelper::Matches edm::ProductResolverIndexHelper::relatedIndexes | ( | KindOfType | kindOfType, |
TypeID const & | typeID | ||
) | const |
Definition at line 161 of file ProductResolverIndexHelper.cc.
References indexToType(), SiStripPI::max, FastTimerService_cff::range, and ranges_.
ProductResolverIndexHelper::Matches edm::ProductResolverIndexHelper::relatedIndexes | ( | KindOfType | kindOfType, |
TypeID const & | typeID, | ||
char const * | moduleLabel, | ||
char const * | instance | ||
) | const |
Definition at line 142 of file ProductResolverIndexHelper.cc.
References indexAndNames_, indexToIndexAndNames(), instance, dqmiolumiharvest::j, SiStripPI::max, HerwigMaxPtPartonFilter_cfi::moduleLabel, and mitigatedMETSequence_cff::U.
Referenced by edm::Principal::getManyByType(), edm::EDConsumerBase::modulesWhoseProductsAreConsumed(), and edm::EDConsumerBase::updateLookup().
void edm::ProductResolverIndexHelper::sanityCheck | ( | ) | const |
Definition at line 572 of file ProductResolverIndexHelper.cc.
References bigNamesContainer_, Exception, indexAndNames_, dqmiolumiharvest::j, edm::errors::LogicError, nextIndexValue_, processNames_, edm::ProductResolverIndexAmbiguous, FastTimerService_cff::range, ranges_, and sortedTypeIDs_.
Referenced by setFrozen().
void edm::ProductResolverIndexHelper::setFrozen | ( | ) |
Definition at line 278 of file ProductResolverIndexHelper.cc.
References beginElements_, bigNamesContainer_, HltBtagPostValidation_cff::c, edm::ELEMENT_TYPE, Exception, indexAndNames_, B2GTnPMonitor_cfi::item, items_, dqmiolumiharvest::j, edm::errors::LogicError, lookupProcessNames_, SiStripPI::max, processIndex(), processItems_, processNames_, edm::PRODUCT_TYPE, ranges_, sanityCheck(), sortedTypeIDs_, and AlCaHLTBitMon_QueryRunRegistry::string.
|
inline |
|
private |
Definition at line 264 of file ProductResolverIndexHelper.h.
Referenced by beginElements(), indexToType(), indiciesForModulesInProcess(), print(), and setFrozen().
|
private |
Definition at line 302 of file ProductResolverIndexHelper.h.
Referenced by indexToIndexAndNames(), indiciesForModulesInProcess(), print(), sanityCheck(), and setFrozen().
|
private |
Definition at line 290 of file ProductResolverIndexHelper.h.
Referenced by index(), indexAndNames(), indexToIndexAndNames(), indiciesForModulesInProcess(), edm::ProductResolverIndexHelper::Matches::Matches(), print(), relatedIndexes(), sanityCheck(), and setFrozen().
|
private |
Definition at line 341 of file ProductResolverIndexHelper.h.
Referenced by insert(), lookupProcessNames(), print(), and setFrozen().
|
private |
Definition at line 307 of file ProductResolverIndexHelper.h.
Referenced by lookupProcessNames(), and setFrozen().
|
private |
Definition at line 259 of file ProductResolverIndexHelper.h.
Referenced by insert(), nextIndexValue(), print(), and sanityCheck().
|
private |
Definition at line 343 of file ProductResolverIndexHelper.h.
Referenced by print(), and setFrozen().
|
private |
Definition at line 303 of file ProductResolverIndexHelper.h.
Referenced by indiciesForModulesInProcess(), print(), processIndex(), processNames(), sanityCheck(), and setFrozen().
|
private |
Definition at line 278 of file ProductResolverIndexHelper.h.
Referenced by indexToIndexAndNames(), indiciesForModulesInProcess(), print(), ranges(), relatedIndexes(), sanityCheck(), and setFrozen().
|
private |
Definition at line 271 of file ProductResolverIndexHelper.h.
Referenced by indexToType(), indiciesForModulesInProcess(), print(), sanityCheck(), setFrozen(), and sortedTypeIDs().