43 <<
"Principal::" << where <<
": no product with given branch id: "<< bid <<
"\n";
50 <<
"Principal::" << where <<
": Product on branch " << branchName <<
" occurs twice in the same event.\n";
54 boost::shared_ptr<cms::Exception>
59 *exception <<
"Principal::" << where <<
": Found zero products matching all criteria\nLooking for type: " << productType <<
"\n"
60 <<
"Looking for module label: " << label <<
"\n" <<
"Looking for productInstanceName: " << instance <<
"\n"
61 << (process.empty() ?
"" :
"Looking for process: ") << process <<
"\n";
63 *exception <<
"Principal::" << where <<
": Found zero products matching all criteria\nLooking for a container with elements of type: " << productType <<
"\n"
64 <<
"Looking for module label: " << label <<
"\n" <<
"Looking for productInstanceName: " << instance <<
"\n"
65 << (process.empty() ?
"" :
"Looking for process: ") << process <<
"\n";
74 exception <<
"Principal::" << where <<
": The product matching all criteria\nLooking for type: " << productType <<
"\n"
75 <<
"Looking for module label: " << label <<
"\n" <<
"Looking for productInstanceName: " << instance <<
"\n"
76 << (process.empty() ?
"" :
"Looking for process: ") << process <<
"\n"
77 <<
"Was already deleted. This means there is a configuration error.\n"
78 <<
"The module which is asking for this data must be configured to state that it will read this data.";
86 exception <<
"Principal::" << where <<
": More than 1 product matches all criteria\nLooking for type: " << productType <<
"\n"
87 <<
"Looking for module label: " << label <<
"\n" <<
"Looking for productInstanceName: " << instance <<
"\n"
88 << (process.empty() ?
"" :
"Looking for process: ") << process <<
"\n"
89 <<
"This can only occur with get function calls using a Handle<View> argument.\n"
90 <<
"Try a get not using a View or change the instance name of one of the products";
104 boost::shared_ptr<ProductHolderIndexHelper const> productLookup,
111 processConfiguration_(&pc),
114 productLookup_(productLookup),
115 lookupProcessOrder_(productLookup->lookupProcessNames().
size(), 0),
119 historyAppender_(historyAppender) {
127 bool hasAliases =
false;
128 for(
auto const&
prod : prodsList) {
152 for(
auto const&
prod : prodsList) {
164 std::vector<std::string>
const& lookupProcessNames =
productLookup_->lookupProcessNames();
166 std::vector<bool> ambiguous(lookupProcessNames.size(),
false);
168 std::vector<TypeID>
const& sortedTypeIDs =
productLookup_->sortedTypeIDs();
170 std::vector<ProductHolderIndexHelper::IndexAndNames>
const& indexAndNames =
productLookup_->indexAndNames();
171 std::vector<char>
const& processNamesCharArray =
productLookup_->processNames();
173 if (!sortedTypeIDs.empty()) {
175 for(
unsigned int k = 0, kEnd = sortedTypeIDs.size();
k < kEnd; ++
k) {
177 for (
unsigned int i = range.
begin();
i < range.
end(); ++
i) {
181 boost::shared_ptr<ProductHolderBase> newHolder(
new NoProcessProductHolder(matchingHolders, ambiguous,
this));
184 ambiguous.assign(lookupProcessNames.size(),
false);
186 productHolderIndex = product.
index();
189 auto iter =
std::find(lookupProcessNames.begin(), lookupProcessNames.end(),
process);
190 assert(iter != lookupProcessNames.end());
194 assert(
k >= beginElements);
195 ambiguous.at(iter - lookupProcessNames.begin()) =
true;
197 matchingHolders.at(iter - lookupProcessNames.begin()) = iMatchingIndex;
202 boost::shared_ptr<ProductHolderBase> newHolder(
new NoProcessProductHolder(matchingHolders, ambiguous,
this));
216 for(
auto const&
prod : *
this) {
217 if(
prod->singleProduct() &&
218 !
prod->productUnavailable() &&
220 !
prod->branchDescription().dropped()) {
231 for(
auto const&
prod : prodsList) {
284 for(
auto const&
prod : *
this) {
285 prod->resetProductData();
293 assert(
nullptr != phb);
320 inputProcessHistory = registry->
getMapped(hist);
321 if (inputProcessHistory == 0) {
323 <<
"Principal::fillPrincipal\n"
324 <<
"Input ProcessHistory not found in registry\n"
325 <<
"Contact a Framework developer\n";
335 std::vector<std::string>
const& lookupProcessNames =
productLookup_->lookupProcessNames();
340 iter != iEnd; ++iter) {
341 auto nameIter =
std::find(lookupProcessNames.begin(), lookupProcessNames.end(), iter->processName());
342 if (nameIter == lookupProcessNames.end()) {
387 <<
"addProductOrThrow: Problem found while adding product, "
388 <<
"product already exists for ("
414 if(resolveProd && !phb->productUnavailable()) {
427 boost::shared_ptr<cms::Exception> whyFailed =
443 boost::shared_ptr<cms::Exception> whyFailed =
454 bool skipCurrentProcess,
455 bool& ambiguous)
const {
458 assert(0!=productHolder.get());
460 ProductData const* productData = productHolder->resolveProduct(resolveStatus, skipCurrentProcess);
465 if(productData == 0) {
475 assert(results.empty());
481 if (matches.numberOfMatches() == 0) {
486 results.reserve(matches.numberOfMatches());
511 std::vector<ProductHolderBase const*> holders;
513 for(
unsigned int i = 0;
i < matches.numberOfMatches(); ++
i) {
517 if(!matches.isFullyResolved(
i)) {
518 if(!holders.empty()) {
525 assert(productHolder);
526 holders.push_back(productHolder);
530 if(!holders.empty()) {
543 iter != iEnd; ++iter) {
545 for (
auto productHolder : holders) {
555 if(productHolder->productWasDeleted()) {
564 if(!productHolder->productUnavailable()) {
569 if(productHolder->product() && !productHolder->productUnavailable() && !productHolder->onDemand()) {
572 results.push_back(bh);
591 char const* processName = inputTag.
process().c_str();
592 if (skipCurrentProcess) {
598 inputTag.
label().c_str(),
619 ProductData const* productData = productHolder->resolveProduct(resolveStatus, skipCurrentProcess);
653 ProductData const* productData = productHolder->resolveProduct(resolveStatus,
false);
666 if(productData ==
nullptr) {
678 if (phb->productWasDeleted()) {
681 phb->productInstanceName(),
684 if(!phb->provenance() || (!phb->product() && !phb->productProvenancePtr())) {
687 return OutputHandle(
WrapperHolder(phb->product().get(), phb->productData().getInterface()), &phb->branchDescription(), phb->productProvenancePtr());
697 if(phb->onDemand()) {
702 if(phb->onDemand()) {
706 return *phb->provenance();
715 for(
auto const& productHolder : *
this) {
716 if(productHolder->singleProduct() && productHolder->provenanceAvailable() && !productHolder->branchDescription().isAlias()) {
719 if(productHolder->provenance()->product().present()) {
720 provenances.push_back(productHolder->provenance());
728 for(
auto const&
prod : bids) {
788 for(
auto const&
prod :
preg_->productList()) {
const_reverse_iterator rbegin() const
std::string const & processName() const
void resolveProduct(ProductHolderBase const &phb, bool fillOnDemand) const
ProductRegistry const & productRegistry() const
Matches relatedIndexes(KindOfType kindOfType, TypeID const &typeID, char const *moduleLabel, char const *instance) const
void addUnscheduledProduct(boost::shared_ptr< ConstBranchDescription > bd)
BranchType const & branchType() const
static const ProcessHistory emptyProcessHistory_
HistoryAppender * historyAppender_
ConstProductPtr getProductByIndex(ProductHolderIndex const &oid, bool resolveProd, bool fillOnDemand) const
void putOrMerge(WrapperOwningHolder const &prod, ProductHolderBase const *productHolder) const
static void throwNotFoundException(char const *where, TypeID const &productType, InputTag const &tag)
static PFTauRenderPlugin instance
ConstBranchDescription const & branchDescription() const
ProductHolderIndex index() const
static ThreadSafeRegistry * instance()
static void throwProductDeletedException(ProductID const &pid, edm::EventPrincipal::ConstProductPtr const phb)
ProductHolderIndex index(KindOfType kindOfType, TypeID const &typeID, char const *moduleLabel, char const *instance, char const *process=0) const
ConstProductPtr getProductHolder(BranchID const &oid, bool resolveProd, bool fillOnDemand) const
std::map< BranchKey, BranchDescription > ProductList
ProcessHistoryID processHistoryID_
void mergeReaders(DelayedReader *other)
void getAllProvenance(std::vector< Provenance const * > &provenances) const
static void throwCorruptionException(char const *where, std::string const &branchName)
void checkUniquenessAndType(WrapperOwningHolder const &prod, ProductHolderBase const *productHolder) const
bool getMapped(key_type const &k, value_type &result) const
void addScheduledProduct(boost::shared_ptr< ConstBranchDescription > bd)
void getManyByType(TypeID const &typeID, BasicHandleVec &results) const
CachedHistory const & appendToProcessHistory(ProcessHistoryID const &inputPHID, ProcessConfiguration const &pc)
boost::shared_ptr< ProductRegistry const > preg_
ProcessHistory const * processHistoryPtr_
Principal(boost::shared_ptr< ProductRegistry const > reg, boost::shared_ptr< ProductHolderIndexHelper const > productLookup, ProcessConfiguration const &pc, BranchType bt, HistoryAppender *historyAppender)
std::string const & friendlyClassName() const
unsigned int ProductHolderIndex
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
boost::shared_ptr< ProductHolderBase > SharedProductPtr
void checkType(WrapperOwningHolder const &prod) const
boost::shared_ptr< void const > product() const
void addInputProduct(boost::shared_ptr< ConstBranchDescription > bd)
static void throwAmbiguousException(const char *where, TypeID const &productType, std::string const &label, std::string const &instance, std::string const &process)
ProductList const & productList() const
U second(std::pair< T, U > const &p)
ProcessHistoryID const & processHistoryID() const
std::vector< unsigned int > lookupProcessOrder_
void findProducts(std::vector< ProductHolderBase const * > const &holders, TypeID const &typeID, BasicHandleVec &results) const
const_reverse_iterator rend() const
std::string const & moduleLabel() const
BasicHandle getByLabel(KindOfType kindOfType, TypeID const &typeID, InputTag const &inputTag) const
boost::shared_ptr< ProductHolderIndexHelper const > productLookup_
std::string const & productInstanceName() const
BranchType const & branchType() const
ProductHolderCollection productHolders_
void addProduct_(std::auto_ptr< ProductHolderBase > phb)
BasicHandle getByToken(KindOfType kindOfType, TypeID const &typeID, ProductHolderIndex index, bool skipCurrentProcess, bool &ambiguous) const
void checkDictionaries(std::string const &name, bool noComponents=false)
unsigned int numberOfMatches() const
BranchID const & branchID() const
ProcessHistoryID orderProcessHistoryID_
void mergeProduct(WrapperOwningHolder const &edp, ProductProvenance &productProvenance)
void addAliasedProduct(boost::shared_ptr< ConstBranchDescription > bd)
unsigned int begin() const
OutputHandle getForOutput(BranchID const &bid, bool getProd) const
BranchID const & branchID() const
Hash< ProcessHistoryType > ProcessHistoryID
void throwMissingDictionariesException()
std::set< void const * > productPtrs_
DelayedReader * reader() const
static void maybeThrowMissingDictionaryException(TypeID const &productType, bool isElement, std::vector< std::string > const &missingDictionaries)
std::string const & className() const
static boost::shared_ptr< cms::Exception > makeNotFoundException(char const *where, KindOfType kindOfType, TypeID const &productType, std::string const &label, std::string const &instance, std::string const &process)
bool putOrMergeProduct() const
std::string wrappedClassName(std::string const &iFullName)
ProductData const * findProductByLabel(KindOfType kindOfType, TypeID const &typeID, InputTag const &inputTag) const
virtual WrapperHolder getIt(ProductID const &) const
void resetBranchDescription(boost::shared_ptr< ConstBranchDescription > bd)
std::string const & branchName() const
void addProductOrThrow(std::auto_ptr< ProductHolderBase > phb)
ProductHolderBase const * ConstProductPtr
virtual bool unscheduledFill(std::string const &moduleLabel) const =0
bool adjustToNewProductRegistry(ProductRegistry const ®)
std::string const & className() const
void putProduct(WrapperOwningHolder const &edp, ProductProvenance const &productProvenance)
ProductData const * findProductByTag(TypeID const &typeID, InputTag const &tag) const
void fillPrincipal(ProcessHistoryID const &hist, DelayedReader *reader)
bool binary_search_all(ForwardSequence const &s, Datum const &d)
wrappers for std::binary_search
unsigned int startInProcessNames() const
void adjustIndexesAfterProductRegistryAddition()
static void throwProductNotFoundException(char const *where, errors::ErrorCodes error, BranchID const &bid)
void const * wrapper() const
void addSourceProduct(boost::shared_ptr< ConstBranchDescription > bd)
ProcessHistory const * processHistory() const
void reset(double vett[256])
Provenance getProvenance(BranchID const &bid) const
void recombine(Principal &other, std::vector< BranchID > const &bids)
ProcessHistory const * inputProcessHistory() const
ProcessConfiguration const * processConfiguration_
tuple size
Write out results.
std::vector< BasicHandle > BasicHandleVec
ProductHolderBase * getExistingProduct(BranchID const &branchID)
std::string const & moduleLabel() const
ProductHolderIndexHelper const & productLookup() const
void deleteProduct(BranchID const &id)