#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, TypeID const &containedTypeID, std::vector< TypeID > *baseTypesOfContainedType) |
ProductResolverIndex | insert (TypeID const &typeID, char const *moduleLabel, char const *instance, char const *process) |
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, char const *moduleLabel, char const *instance) const |
Matches | relatedIndexes (KindOfType kindOfType, TypeID const &typeID) 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 93 of file ProductResolverIndexHelper.h.
using edm::ProductResolverIndexHelper::ModulesToIndiciesMap = std::unordered_multimap<std::string, std::tuple<TypeID const*, const char*, ProductResolverIndex> > |
Definition at line 128 of file ProductResolverIndexHelper.h.
edm::ProductResolverIndexHelper::ProductResolverIndexHelper | ( | ) |
Definition at line 101 of file ProductResolverIndexHelper.cc.
|
inline |
Definition at line 227 of file ProductResolverIndexHelper.h.
References beginElements_.
ProductResolverIndex edm::ProductResolverIndexHelper::index | ( | KindOfType | kindOfType, |
TypeID const & | typeID, | ||
char const * | moduleLabel, | ||
char const * | instance, | ||
char const * | process = nullptr |
||
) | const |
Definition at line 107 of file ProductResolverIndexHelper.cc.
References indexAndNames_, indexToIndexAndNames(), instance, SiStripPI::max, HerwigMaxPtPartonFilter_cfi::moduleLabel, LaserDQM_cfg::process, and edm::ProductResolverIndexInvalid.
Referenced by edm::TransformerBase::extendUpdateLookup(), edm::Principal::findProductByLabel(), edm::PrincipalGetAdapter::getBranchDescription(), and edm::EDConsumerBase::updateLookup().
|
inline |
Definition at line 230 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 448 of file ProductResolverIndexHelper.cc.
References bigNamesContainer_, indexAndNames_, indexToType(), instance, 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 534 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 581 of file ProductResolverIndexHelper.cc.
References beginElements_, bigNamesContainer_, mps_fire::i, indexAndNames(), indexAndNames_, dqmiolumiharvest::j, MainPageGenerator::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, | ||
TypeID const & | containedTypeID, | ||
std::vector< TypeID > * | baseTypesOfContainedType | ||
) |
Definition at line 207 of file ProductResolverIndexHelper.cc.
References edm::ProductResolverIndexHelper::Item::clearProcess(), edm::ELEMENT_TYPE, Exception, instance, B2GTnPMonitor_cfi::item, items_, edm::errors::LogicError, HerwigMaxPtPartonFilter_cfi::moduleLabel, nextIndexValue_, LaserDQM_cfg::process, edm::PRODUCT_TYPE, edm::ProductResolverIndexAmbiguous, edm::ProductResolverIndexHelper::Item::setIndex(), and edm::TypeID::typeInfo().
Referenced by SequenceTypes.Schedule::_replaceIfHeldDirectly(), and insert().
ProductResolverIndex edm::ProductResolverIndexHelper::insert | ( | TypeID const & | typeID, |
char const * | moduleLabel, | ||
char const * | instance, | ||
char const * | process | ||
) |
Definition at line 291 of file ProductResolverIndexHelper.cc.
References edm::productholderindexhelper::getContainedType(), insert(), instance, HerwigMaxPtPartonFilter_cfi::moduleLabel, LaserDQM_cfg::process, and edm::public_base_classes().
Referenced by SequenceTypes.Schedule::_replaceIfHeldDirectly().
std::vector< std::string > const & edm::ProductResolverIndexHelper::lookupProcessNames | ( | ) | const |
Definition at line 440 of file ProductResolverIndexHelper.cc.
References Exception, items_, edm::errors::LogicError, and lookupProcessNames_.
|
inline |
Definition at line 255 of file ProductResolverIndexHelper.h.
References nextIndexValue_.
void edm::ProductResolverIndexHelper::print | ( | std::ostream & | os | ) | const |
Definition at line 698 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 557 of file ProductResolverIndexHelper.cc.
References SiStripPI::max, AlCaHLTBitMon_ParallelJobs::p, LaserDQM_cfg::process, and processNames_.
Referenced by indexToIndexAndNames(), and setFrozen().
|
inline |
Definition at line 231 of file ProductResolverIndexHelper.h.
References processNames_.
|
inline |
Definition at line 229 of file ProductResolverIndexHelper.h.
References ranges_.
ProductResolverIndexHelper::Matches edm::ProductResolverIndexHelper::relatedIndexes | ( | KindOfType | kindOfType, |
TypeID const & | typeID, | ||
char const * | moduleLabel, | ||
char const * | instance | ||
) | const |
Definition at line 171 of file ProductResolverIndexHelper.cc.
References indexAndNames_, indexToIndexAndNames(), instance, dqmiolumiharvest::j, SiStripPI::max, HerwigMaxPtPartonFilter_cfi::moduleLabel, and mitigatedMETSequence_cff::U.
ProductResolverIndexHelper::Matches edm::ProductResolverIndexHelper::relatedIndexes | ( | KindOfType | kindOfType, |
TypeID const & | typeID | ||
) | const |
Definition at line 190 of file ProductResolverIndexHelper.cc.
References indexToType(), SiStripPI::max, FastTimerService_cff::range, and ranges_.
void edm::ProductResolverIndexHelper::sanityCheck | ( | ) | const |
Definition at line 600 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 306 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 |
Definition at line 228 of file ProductResolverIndexHelper.h.
References sortedTypeIDs_.
|
private |
Definition at line 268 of file ProductResolverIndexHelper.h.
Referenced by beginElements(), indexToType(), indiciesForModulesInProcess(), print(), and setFrozen().
|
private |
Definition at line 306 of file ProductResolverIndexHelper.h.
Referenced by indexToIndexAndNames(), indiciesForModulesInProcess(), print(), sanityCheck(), and setFrozen().
|
private |
Definition at line 294 of file ProductResolverIndexHelper.h.
Referenced by index(), indexAndNames(), indexToIndexAndNames(), indiciesForModulesInProcess(), edm::ProductResolverIndexHelper::Matches::Matches(), print(), relatedIndexes(), sanityCheck(), and setFrozen().
|
private |
Definition at line 345 of file ProductResolverIndexHelper.h.
Referenced by insert(), lookupProcessNames(), print(), and setFrozen().
|
private |
Definition at line 311 of file ProductResolverIndexHelper.h.
Referenced by lookupProcessNames(), and setFrozen().
|
private |
Definition at line 263 of file ProductResolverIndexHelper.h.
Referenced by insert(), nextIndexValue(), print(), and sanityCheck().
|
private |
Definition at line 347 of file ProductResolverIndexHelper.h.
Referenced by print(), and setFrozen().
|
private |
Definition at line 307 of file ProductResolverIndexHelper.h.
Referenced by indiciesForModulesInProcess(), print(), processIndex(), processNames(), sanityCheck(), and setFrozen().
|
private |
Definition at line 282 of file ProductResolverIndexHelper.h.
Referenced by indexToIndexAndNames(), indiciesForModulesInProcess(), print(), ranges(), relatedIndexes(), sanityCheck(), and setFrozen().
|
private |
Definition at line 275 of file ProductResolverIndexHelper.h.
Referenced by indexToType(), indiciesForModulesInProcess(), print(), sanityCheck(), setFrozen(), and sortedTypeIDs().