CMS 3D CMS Logo

Principal.cc
Go to the documentation of this file.
1 
5 
15 #include "ProductResolvers.h"
21 
23 
24 #include <algorithm>
25 #include <cstring>
26 #include <limits>
27 #include <sstream>
28 #include <stdexcept>
29 #include <typeinfo>
30 #include <atomic>
31 
32 namespace edm {
33 
35 
36  static std::string appendCurrentProcessIfAlias(std::string const& processFromInputTag,
37  std::string const& currentProcess) {
38  if (processFromInputTag == InputTag::kCurrentProcess) {
39  std::string returnValue = processFromInputTag;
40  returnValue += " (";
41  returnValue += currentProcess;
42  returnValue += ")";
43  return returnValue;
44  }
45  return processFromInputTag;
46  }
47 
48  static void throwProductNotFoundException(char const* where, errors::ErrorCodes error, BranchID const& bid) {
49  throw Exception(error, "InvalidID") << "Principal::" << where << ": no product with given branch id: " << bid
50  << "\n";
51  }
52 
53  static std::shared_ptr<cms::Exception> makeNotFoundException(char const* where,
54  KindOfType kindOfType,
55  TypeID const& productType,
56  std::string const& label,
57  std::string const& instance,
58  std::string const& process) {
59  std::shared_ptr<cms::Exception> exception = std::make_shared<Exception>(errors::ProductNotFound);
60  if (kindOfType == PRODUCT_TYPE) {
61  *exception << "Principal::" << where
62  << ": Found zero products matching all criteria\nLooking for type: " << productType << "\n"
63  << "Looking for module label: " << label << "\n"
64  << "Looking for productInstanceName: " << instance << "\n"
65  << (process.empty() ? "" : "Looking for process: ") << process << "\n";
66  } else {
67  *exception << "Principal::" << where
68  << ": Found zero products matching all criteria\nLooking for a container with elements of type: "
69  << productType << "\n"
70  << "Looking for module label: " << label << "\n"
71  << "Looking for productInstanceName: " << instance << "\n"
72  << (process.empty() ? "" : "Looking for process: ") << process << "\n";
73  }
74  return exception;
75  }
76 
77  static void throwAmbiguousException(const char* where,
78  TypeID const& productType,
79  std::string const& label,
80  std::string const& instance,
81  std::string const& process) {
82  cms::Exception exception("AmbiguousProduct");
83  exception << "Principal::" << where
84  << ": More than 1 product matches all criteria\nLooking for type: " << productType << "\n"
85  << "Looking for module label: " << label << "\n"
86  << "Looking for productInstanceName: " << instance << "\n"
87  << (process.empty() ? "" : "Looking for process: ") << process << "\n"
88  << "This can only occur with get function calls using a Handle<View> argument.\n"
89  << "Try a get not using a View or change the instance name of one of the products";
90  throw exception;
91  }
92 
93  namespace {
94  void failedToRegisterConsumesMany(edm::TypeID const& iType) {
95  cms::Exception exception("GetManyWithoutRegistration");
96  exception << "::getManyByType called for " << iType
97  << " without a corresponding consumesMany being called for this module. \n";
98  throw exception;
99  }
100 
101  void failedToRegisterConsumes(KindOfType kindOfType,
102  TypeID const& productType,
103  std::string const& moduleLabel,
104  std::string const& productInstanceName,
105  std::string const& processName) {
106  cms::Exception exception("GetByLabelWithoutRegistration");
107  exception << "::getByLabel without corresponding call to consumes or mayConsumes for this module.\n"
108  << (kindOfType == PRODUCT_TYPE ? " type: " : " type: edm::View<") << productType
109  << (kindOfType == PRODUCT_TYPE ? "\n module label: " : ">\n module label: ") << moduleLabel
110  << "\n product instance name: '" << productInstanceName << "'\n process name: '" << processName
111  << "'\n";
112  throw exception;
113  }
114  } // namespace
115 
116  //0 means unset
117  static std::atomic<Principal::CacheIdentifier_t> s_nextIdentifier{1};
119  return s_nextIdentifier.fetch_add(1, std::memory_order_acq_rel);
120  }
121 
122  Principal::Principal(std::shared_ptr<ProductRegistry const> reg,
123  std::shared_ptr<ProductResolverIndexHelper const> productLookup,
124  ProcessConfiguration const& pc,
125  BranchType bt,
126  HistoryAppender* historyAppender,
127  bool isForPrimaryProcess)
128  : EDProductGetter(),
129  processHistoryPtr_(),
130  processHistoryID_(),
131  processHistoryIDBeforeConfig_(),
132  processConfiguration_(&pc),
133  productResolvers_(),
134  preg_(reg),
135  productLookup_(productLookup),
136  lookupProcessOrder_(productLookup->lookupProcessNames().size(), 0),
137  reader_(),
138  branchType_(bt),
139  historyAppender_(historyAppender),
140  cacheIdentifier_(nextIdentifier()) {
141  productResolvers_.resize(reg->getNextIndexValue(bt));
142  //Now that these have been set, we can create the list of Branches we need.
143  std::string const source("source");
144  ProductRegistry::ProductList const& prodsList = reg->productList();
145  // The constructor of an alias product holder takes as an argument the product holder for which it is an alias.
146  // So, the non-alias product holders must be created first.
147  // Therefore, on this first pass, skip current EDAliases.
148  bool hasAliases = false;
149  bool hasSwitchAliases = false;
150  for (auto const& prod : prodsList) {
151  BranchDescription const& bd = prod.second;
152  if (bd.branchType() == branchType_) {
153  if (isForPrimaryProcess or bd.processName() == pc.processName()) {
154  if (bd.isAlias()) {
155  hasAliases = true;
156  } else if (bd.isSwitchAlias()) {
157  hasSwitchAliases = true;
158  } else {
159  auto cbd = std::make_shared<BranchDescription const>(bd);
160  if (bd.produced()) {
161  if (bd.moduleLabel() == source) {
162  addSourceProduct(cbd);
163  } else if (bd.onDemand()) {
166  } else {
167  addScheduledProduct(cbd);
168  }
169  } else {
170  if (bd.onDemand()) {
172  } else {
174  }
175  }
176  }
177  } else {
178  //We are in a SubProcess and this branch is from the parent
179  auto cbd = std::make_shared<BranchDescription const>(bd);
181  }
182  }
183  }
184  // Now process any EDAliases
185  if (hasAliases) {
186  for (auto const& prod : prodsList) {
187  BranchDescription const& bd = prod.second;
188  if (bd.isAlias() && bd.branchType() == branchType_) {
189  addAliasedProduct(std::make_shared<BranchDescription const>(bd));
190  }
191  }
192  }
193  // Finally process any SwitchProducer aliases
194  if (hasSwitchAliases) {
195  for (auto const& prod : prodsList) {
196  BranchDescription const& bd = prod.second;
197  if (bd.isSwitchAlias() && bd.branchType() == branchType_) {
199  auto cbd = std::make_shared<BranchDescription const>(bd);
200  // Need different implementation for SwitchProducers not
201  // in any Path (onDemand) and for those in a Path in order
202  // to prevent the switch-aliased-for EDProducers from
203  // being run when the SwitchProducer is in a Path after a
204  // failing EDFilter.
205  if (bd.onDemand()) {
207  } else {
209  }
210  }
211  }
212  }
213 
214  // Now create the ProductResolvers that search in reverse process
215  // order and are used for queries where the process name is the
216  // empty string
217  std::vector<std::string> const& lookupProcessNames = productLookup_->lookupProcessNames();
218  std::vector<ProductResolverIndex> matchingHolders(lookupProcessNames.size(), ProductResolverIndexInvalid);
219  std::vector<bool> ambiguous(lookupProcessNames.size(), false);
220  unsigned int beginElements = productLookup_->beginElements();
221  std::vector<TypeID> const& sortedTypeIDs = productLookup_->sortedTypeIDs();
222  std::vector<ProductResolverIndexHelper::Range> const& ranges = productLookup_->ranges();
223  std::vector<ProductResolverIndexHelper::IndexAndNames> const& indexAndNames = productLookup_->indexAndNames();
224  std::vector<char> const& processNamesCharArray = productLookup_->processNames();
225 
226  unsigned int numberOfMatches = 0;
228  if (!sortedTypeIDs.empty()) {
229  ProductResolverIndex productResolverIndex = ProductResolverIndexInvalid;
230  for (unsigned int k = 0, kEnd = sortedTypeIDs.size(); k < kEnd; ++k) {
232  for (unsigned int i = range.begin(); i < range.end(); ++i) {
233  ProductResolverIndexHelper::IndexAndNames const& product = indexAndNames.at(i);
234  if (product.startInProcessNames() == 0) {
235  if (productResolverIndex != ProductResolverIndexInvalid) {
236  if ((numberOfMatches == 1) and (lastMatchIndex != ProductResolverIndexAmbiguous)) {
237  //only one choice so use a special resolver
238  productResolvers_.at(productResolverIndex) =
239  std::make_shared<SingleChoiceNoProcessProductResolver>(lastMatchIndex);
240  } else {
241  bool productMadeAtEnd = false;
242  //Need to know if the product from this processes is added at end of transition
243  for (unsigned int j = 0; j < matchingHolders.size(); ++j) {
244  if ((not ambiguous[j]) and ProductResolverIndexInvalid != matchingHolders[j] and
245  productResolvers_[matchingHolders[j]]->branchDescription().availableOnlyAtEndTransition()) {
246  productMadeAtEnd = true;
247  break;
248  }
249  }
250  std::shared_ptr<ProductResolverBase> newHolder =
251  std::make_shared<NoProcessProductResolver>(matchingHolders, ambiguous, productMadeAtEnd);
252  productResolvers_.at(productResolverIndex) = newHolder;
253  }
254  matchingHolders.assign(lookupProcessNames.size(), ProductResolverIndexInvalid);
255  ambiguous.assign(lookupProcessNames.size(), false);
256  numberOfMatches = 0;
257  lastMatchIndex = ProductResolverIndexInvalid;
258  }
259  productResolverIndex = product.index();
260  } else {
261  std::string process(&processNamesCharArray.at(product.startInProcessNames()));
262  auto iter = std::find(lookupProcessNames.begin(), lookupProcessNames.end(), process);
263  assert(iter != lookupProcessNames.end());
264  ProductResolverIndex iMatchingIndex = product.index();
265  lastMatchIndex = iMatchingIndex;
266  assert(iMatchingIndex != ProductResolverIndexInvalid);
267  ++numberOfMatches;
268  if (iMatchingIndex == ProductResolverIndexAmbiguous) {
269  assert(k >= beginElements);
270  ambiguous.at(iter - lookupProcessNames.begin()) = true;
271  } else {
272  matchingHolders.at(iter - lookupProcessNames.begin()) = iMatchingIndex;
273  }
274  }
275  }
276  }
277  //Need to know if the product from this processes is added at end of transition
278  if ((numberOfMatches == 1) and (lastMatchIndex != ProductResolverIndexAmbiguous)) {
279  //only one choice so use a special resolver
280  productResolvers_.at(productResolverIndex) =
281  std::make_shared<SingleChoiceNoProcessProductResolver>(lastMatchIndex);
282  } else {
283  bool productMadeAtEnd = false;
284  for (unsigned int i = 0; i < matchingHolders.size(); ++i) {
285  if ((not ambiguous[i]) and ProductResolverIndexInvalid != matchingHolders[i] and
286  productResolvers_[matchingHolders[i]]->branchDescription().availableOnlyAtEndTransition()) {
287  productMadeAtEnd = true;
288  break;
289  }
290  }
291  std::shared_ptr<ProductResolverBase> newHolder =
292  std::make_shared<NoProcessProductResolver>(matchingHolders, ambiguous, productMadeAtEnd);
293  productResolvers_.at(productResolverIndex) = newHolder;
294  }
295  }
296  }
297 
299 
300  // Number of products in the Principal.
301  // For products in an input file and not yet read in due to delayed read,
302  // this routine assumes a real product is there.
303  size_t Principal::size() const {
304  size_t size = 0U;
305  for (auto const& prod : *this) {
306  if (prod->singleProduct() && // Not a NoProcessProductResolver
307  !prod->productUnavailable() && !prod->unscheduledWasNotRun() && !prod->branchDescription().dropped()) {
308  ++size;
309  }
310  }
311  return size;
312  }
313 
314  // adjust provenance for input products after new input file has been merged
316  ProductRegistry::ProductList const& prodsList = reg.productList();
317  for (auto const& prod : prodsList) {
318  BranchDescription const& bd = prod.second;
319  if (!bd.produced() && (bd.branchType() == branchType_)) {
320  auto cbd = std::make_shared<BranchDescription const>(bd);
321  auto phb = getExistingProduct(cbd->branchID());
322  if (phb == nullptr || phb->branchDescription().branchName() != cbd->branchName()) {
323  return false;
324  }
325  phb->resetBranchDescription(cbd);
326  }
327  }
328  return true;
329  }
330 
331  void Principal::addScheduledProduct(std::shared_ptr<BranchDescription const> bd) {
332  auto phb = std::make_unique<PuttableProductResolver>(std::move(bd));
334  }
335 
336  void Principal::addSourceProduct(std::shared_ptr<BranchDescription const> bd) {
337  auto phb = std::make_unique<PuttableProductResolver>(std::move(bd));
339  }
340 
341  void Principal::addDelayedReaderInputProduct(std::shared_ptr<BranchDescription const> bd) {
342  addProductOrThrow(std::make_unique<DelayedReaderInputProductResolver>(std::move(bd)));
343  }
344 
345  void Principal::addPutOnReadInputProduct(std::shared_ptr<BranchDescription const> bd) {
346  addProductOrThrow(std::make_unique<PutOnReadInputProductResolver>(std::move(bd)));
347  }
348 
349  void Principal::addUnscheduledProduct(std::shared_ptr<BranchDescription const> bd) {
350  addProductOrThrow(std::make_unique<UnscheduledProductResolver>(std::move(bd)));
351  }
352 
353  void Principal::addAliasedProduct(std::shared_ptr<BranchDescription const> bd) {
354  ProductResolverIndex index = preg_->indexFrom(bd->originalBranchID());
356 
357  addProductOrThrow(std::make_unique<AliasProductResolver>(
358  std::move(bd), dynamic_cast<DataManagingOrAliasProductResolver&>(*productResolvers_[index])));
359  }
360 
361  void Principal::addSwitchProducerProduct(std::shared_ptr<BranchDescription const> bd) {
362  ProductResolverIndex index = preg_->indexFrom(bd->switchAliasForBranchID());
364 
365  addProductOrThrow(std::make_unique<SwitchProducerProductResolver>(
366  std::move(bd), dynamic_cast<DataManagingOrAliasProductResolver&>(*productResolvers_[index])));
367  }
368 
369  void Principal::addSwitchAliasProduct(std::shared_ptr<BranchDescription const> bd) {
370  ProductResolverIndex index = preg_->indexFrom(bd->switchAliasForBranchID());
372 
373  addProductOrThrow(std::make_unique<SwitchAliasProductResolver>(
374  std::move(bd), dynamic_cast<DataManagingOrAliasProductResolver&>(*productResolvers_[index])));
375  }
376 
377  void Principal::addParentProcessProduct(std::shared_ptr<BranchDescription const> bd) {
378  addProductOrThrow(std::make_unique<ParentProcessProductResolver>(std::move(bd)));
379  }
380 
381  // "Zero" the principal so it can be reused for another Event.
383  //We do not clear the product history information
384  // because it rarely changes and recalculating takes
385  // time.
386  reader_ = nullptr;
387  for (auto& prod : *this) {
388  prod->resetProductData();
389  }
390  }
391 
392  void Principal::deleteProduct(BranchID const& id) const {
393  auto phb = getExistingProduct(id);
394  assert(nullptr != phb);
395  phb->unsafe_deleteProduct();
396  }
397 
399  applyToResolvers([&iConfigure](ProductResolverBase* iResolver) { iResolver->setupUnscheduled(iConfigure); });
400  }
401 
403  //increment identifier here since clearPrincipal isn't called for Run/Lumi
405  if (reader) {
406  reader_ = reader;
407  }
408  }
409 
410  // Set the principal for the Event, Lumi, or Run.
412  ProcessHistory const* processHistory,
415 
416  if (historyAppender_ && productRegistry().anyProductProduced()) {
421  }
422  } else {
423  std::shared_ptr<ProcessHistory const> inputProcessHistory;
425  if (hist.isValid()) {
426  //does not own the pointer
427  auto noDel = [](void const*) {};
428  inputProcessHistory = std::shared_ptr<ProcessHistory const>(processHistory, noDel);
429  if (inputProcessHistory.get() == nullptr) {
430  throw Exception(errors::LogicError) << "Principal::fillPrincipal\n"
431  << "Input ProcessHistory not found in registry\n"
432  << "Contact a Framework developer\n";
433  }
434  } else {
435  //Since this is static we don't want it deleted
436  inputProcessHistory = std::shared_ptr<ProcessHistory const>(&s_emptyProcessHistory, [](void const*) {});
437  //no need to do any ordering since it is empty
439  }
441  processHistoryPtr_ = inputProcessHistory;
443  }
444  }
445 
447  std::vector<std::string> const& lookupProcessNames = productLookup_->lookupProcessNames();
448  lookupProcessOrder_.assign(lookupProcessNames.size(), 0);
449  unsigned int k = 0;
450 
451  // We loop over processes in reverse order of the ProcessHistory.
452  // If any entries in the product lookup tables are associated with
453  // the process we add it to the vector of processes in the order
454  // the lookup should be performed. There is one exception though,
455  // We start with the current process even if it is not in the ProcessHistory.
456  // The current process might be needed but not be in the process
457  // history if all the products produced in the current process are
458  // transient.
459  {
460  auto nameIterCurrentProcess =
461  std::find(lookupProcessNames.begin(), lookupProcessNames.end(), processConfiguration_->processName());
462  if (nameIterCurrentProcess != lookupProcessNames.end()) {
463  lookupProcessOrder_.at(k) = nameIterCurrentProcess - lookupProcessNames.begin();
464  ++k;
465  }
466  }
467 
468  // We just looked for the current process so skip it if
469  // it is in the ProcessHistory.
470  auto iter = processHistoryPtr_->rbegin();
471  if (iter->processName() == processConfiguration_->processName()) {
472  ++iter;
473  }
474 
475  for (auto iEnd = processHistoryPtr_->rend(); iter != iEnd; ++iter) {
476  auto nameIter = std::find(lookupProcessNames.begin(), lookupProcessNames.end(), iter->processName());
477  if (nameIter == lookupProcessNames.end()) {
478  continue;
479  }
480  lookupProcessOrder_.at(k) = nameIter - lookupProcessNames.begin();
481  ++k;
482  }
484  }
485  }
486 
487  // Set the principal for the ProcessBlock
488  void Principal::fillPrincipal(std::string const& processNameOfBlock, DelayedReader* reader) {
490 
491  std::vector<std::string> const& lookupProcessNames = productLookup_->lookupProcessNames();
492  lookupProcessOrder_.assign(lookupProcessNames.size(), 0);
493  if (!lookupProcessOrder_.empty()) {
494  auto iter = std::find(lookupProcessNames.begin(), lookupProcessNames.end(), processNameOfBlock);
495  if (iter != lookupProcessNames.end()) {
496  lookupProcessOrder_[0] = iter - lookupProcessNames.begin();
497  }
498  }
499  }
500 
502  return const_cast<ProductResolverBase*>(const_cast<const Principal*>(this)->getExistingProduct(branchID));
503  }
504 
506  ProductResolverIndex index = preg_->indexFrom(branchID);
508  return productResolvers_.at(index).get();
509  }
510 
512  auto phb = getExistingProduct(productResolver.branchDescription().branchID());
513  if (nullptr != phb && BranchKey(productResolver.branchDescription()) != BranchKey(phb->branchDescription())) {
514  BranchDescription const& newProduct = phb->branchDescription();
515  BranchDescription const& existing = productResolver.branchDescription();
516  if (newProduct.branchName() != existing.branchName() && newProduct.branchID() == existing.branchID()) {
517  throw cms::Exception("HashCollision")
518  << "Principal::getExistingProduct\n"
519  << " Branch " << newProduct.branchName() << " has same branch ID as branch " << existing.branchName()
520  << "\n"
521  << "Workaround: change process name or product instance name of " << newProduct.branchName() << "\n";
522  } else {
523  assert(nullptr == phb || BranchKey(productResolver.branchDescription()) == BranchKey(phb->branchDescription()));
524  }
525  }
526  return phb;
527  }
528 
529  void Principal::addProduct_(std::unique_ptr<ProductResolverBase> productResolver) {
530  BranchDescription const& bd = productResolver->branchDescription();
531  assert(!bd.className().empty());
532  assert(!bd.friendlyClassName().empty());
533  assert(!bd.moduleLabel().empty());
534  assert(!bd.processName().empty());
535  SharedProductPtr phb(productResolver.release());
536 
537  ProductResolverIndex index = preg_->indexFrom(bd.branchID());
539  productResolvers_[index] = phb;
540  }
541 
542  void Principal::addProductOrThrow(std::unique_ptr<ProductResolverBase> productResolver) {
543  ProductResolverBase const* phb = getExistingProduct(*productResolver);
544  if (phb != nullptr) {
545  BranchDescription const& bd = productResolver->branchDescription();
546  throw Exception(errors::InsertFailure, "AlreadyPresent")
547  << "addProductOrThrow: Problem found while adding product, "
548  << "product already exists for (" << bd.friendlyClassName() << "," << bd.moduleLabel() << ","
549  << bd.productInstanceName() << "," << bd.processName() << ")\n";
550  }
551  addProduct_(std::move(productResolver));
552  }
553 
555  ProductResolverIndex index = preg_->indexFrom(bid);
557  return ConstProductResolverPtr();
558  }
560  }
561 
564  return phb;
565  }
566 
568  TypeID const& typeID,
569  InputTag const& inputTag,
570  EDConsumerBase const* consumer,
572  ModuleCallingContext const* mcc) const {
573  // Not implemented for ProcessBlocks, it might work though, not tested
574  // The other getByLabel function is used for ProcessBlocks by TestProcessor
576 
577  ProductData const* result = findProductByLabel(kindOfType, typeID, inputTag, consumer, sra, mcc);
578  if (result == nullptr) {
579  return BasicHandle(makeHandleExceptionFactory([=]() -> std::shared_ptr<cms::Exception> {
580  return makeNotFoundException(
581  "getByLabel",
582  kindOfType,
583  typeID,
584  inputTag.label(),
585  inputTag.instance(),
587  }));
588  }
589  return BasicHandle(result->wrapper(), &(result->provenance()));
590  }
591 
593  TypeID const& typeID,
594  std::string const& label,
595  std::string const& instance,
596  std::string const& process,
597  EDConsumerBase const* consumer,
599  ModuleCallingContext const* mcc) const {
600  ProductData const* result = findProductByLabel(kindOfType, typeID, label, instance, process, consumer, sra, mcc);
601  if (result == nullptr) {
602  return BasicHandle(makeHandleExceptionFactory([=]() -> std::shared_ptr<cms::Exception> {
603  return makeNotFoundException("getByLabel", kindOfType, typeID, label, instance, process);
604  }));
605  }
606  return BasicHandle(result->wrapper(), &(result->provenance()));
607  }
608 
610  TypeID const&,
612  bool skipCurrentProcess,
613  bool& ambiguous,
615  ModuleCallingContext const* mcc) const {
617  auto& productResolver = productResolvers_[index];
618  assert(nullptr != productResolver.get());
619  auto resolution = productResolver->resolveProduct(*this, skipCurrentProcess, sra, mcc);
620  if (resolution.isAmbiguous()) {
621  ambiguous = true;
622  //The caller is looking explicitly for this case
623  // and uses the extra data at the caller to setup the exception
624  return BasicHandle::makeInvalid();
625  }
626  auto productData = resolution.data();
627  if (productData == nullptr) {
628  //The caller is looking explicitly for this case
629  // and uses the extra data at the caller to setup the exception
630  return BasicHandle::makeInvalid();
631  }
632  return BasicHandle(productData->wrapper(), &(productData->provenance()));
633  }
634 
637  bool skipCurrentProcess,
638  ServiceToken const& token,
639  ModuleCallingContext const* mcc) const {
640  auto const& productResolver = productResolvers_.at(index);
641  assert(nullptr != productResolver.get());
642  productResolver->prefetchAsync(task, *this, skipCurrentProcess, token, nullptr, mcc);
643  }
644 
645  void Principal::getManyByType(TypeID const& typeID,
647  EDConsumerBase const* consumer,
649  ModuleCallingContext const* mcc) const {
650  // Not implemented for ProcessBlocks
652 
653  assert(results.empty());
654 
655  if (UNLIKELY(consumer and (not consumer->registeredToConsumeMany(typeID, branchType())))) {
656  failedToRegisterConsumesMany(typeID);
657  }
658 
659  // This finds the indexes to all the ProductResolver's matching the type
661 
662  if (matches.numberOfMatches() == 0) {
663  return;
664  }
665 
666  results.reserve(matches.numberOfMatches());
667 
668  // Loop over the ProductResolvers. Add the products that are actually
669  // present into the results. This will also trigger delayed reading,
670  // on demand production, and check for deleted products as appropriate.
671 
672  // Over the years the code that uses getManyByType has grown to depend
673  // on the ordering of the results. The order originally was just an
674  // accident of how previous versions of the code were written, but
675  // here we have to go through some extra effort to preserve that ordering.
676 
677  // We build a list of holders that match a particular label and instance.
678  // When that list is complete we call findProducts, which loops over
679  // that list in reverse order of the ProcessHistory (starts with the
680  // most recent). Then we clear the list and repeat this until all the
681  // matching label and instance subsets have been dealt with.
682 
683  // Note that the function isFullyResolved returns true for the ProductResolvers
684  // that are associated with an empty process name. Those are the ones that
685  // know how to search for the most recent process name matching
686  // a label and instance. We do not need these for getManyByType and
687  // skip them. In addition to skipping them, we make use of the fact
688  // that they mark the beginning of each subset of holders with the same
689  // label and instance. They tell us when to call findProducts.
690 
691  std::vector<ProductResolverBase const*> holders;
692 
693  for (unsigned int i = 0; i < matches.numberOfMatches(); ++i) {
695 
696  if (!matches.isFullyResolved(i)) {
697  if (!holders.empty()) {
698  // Process the ones with a particular module label and instance
699  findProducts(holders, typeID, results, sra, mcc);
700  holders.clear();
701  }
702  } else {
703  ProductResolverBase const* productResolver = productResolvers_.at(index).get();
704  assert(productResolver);
705  holders.push_back(productResolver);
706  }
707  }
708  // Do not miss the last subset of products
709  if (!holders.empty()) {
710  findProducts(holders, typeID, results, sra, mcc);
711  }
712  return;
713  }
714 
715  void Principal::findProducts(std::vector<ProductResolverBase const*> const& holders,
716  TypeID const&,
719  ModuleCallingContext const* mcc) const {
720  for (auto iter = processHistoryPtr_->rbegin(), iEnd = processHistoryPtr_->rend(); iter != iEnd; ++iter) {
721  std::string const& process = iter->processName();
722  for (auto productResolver : holders) {
723  BranchDescription const& bd = productResolver->branchDescription();
724  if (process == bd.processName()) {
725  // Ignore aliases to avoid matching the same product multiple times.
726  if (bd.isAnyAlias()) {
727  continue;
728  }
729 
730  ProductData const* productData = productResolver->resolveProduct(*this, false, sra, mcc).data();
731  if (productData) {
732  // Skip product if not available.
733  results.emplace_back(productData->wrapper(), &(productData->provenance()));
734  }
735  }
736  }
737  }
738  }
739 
741  TypeID const& typeID,
742  InputTag const& inputTag,
743  EDConsumerBase const* consumer,
745  ModuleCallingContext const* mcc) const {
746  bool skipCurrentProcess = inputTag.willSkipCurrentProcess();
747 
749 
751  char const* processName = inputTag.process().c_str();
752  if (skipCurrentProcess) {
753  processName = "\0";
754  } else if (inputTag.process() == InputTag::kCurrentProcess) {
756  }
757 
758  index =
759  productLookup().index(kindOfType, typeID, inputTag.label().c_str(), inputTag.instance().c_str(), processName);
760 
762  throwAmbiguousException("findProductByLabel",
763  typeID,
764  inputTag.label(),
765  inputTag.instance(),
767  } else if (index == ProductResolverIndexInvalid) {
768  return nullptr;
769  }
770  inputTag.tryToCacheIndex(index, typeID, branchType(), &productRegistry());
771  }
772  if (UNLIKELY(consumer and (not consumer->registeredToConsume(index, skipCurrentProcess, branchType())))) {
773  failedToRegisterConsumes(kindOfType,
774  typeID,
775  inputTag.label(),
776  inputTag.instance(),
778  }
779 
780  auto const& productResolver = productResolvers_[index];
781 
782  auto resolution = productResolver->resolveProduct(*this, skipCurrentProcess, sra, mcc);
783  if (resolution.isAmbiguous()) {
784  throwAmbiguousException("findProductByLabel",
785  typeID,
786  inputTag.label(),
787  inputTag.instance(),
789  }
790  return resolution.data();
791  }
792 
794  TypeID const& typeID,
795  std::string const& label,
796  std::string const& instance,
797  std::string const& process,
798  EDConsumerBase const* consumer,
800  ModuleCallingContext const* mcc) const {
802  productLookup().index(kindOfType, typeID, label.c_str(), instance.c_str(), process.c_str());
803 
805  throwAmbiguousException("findProductByLabel", typeID, label, instance, process);
806  } else if (index == ProductResolverIndexInvalid) {
807  return nullptr;
808  }
809 
810  if (UNLIKELY(consumer and (not consumer->registeredToConsume(index, false, branchType())))) {
811  failedToRegisterConsumes(kindOfType, typeID, label, instance, process);
812  }
813 
814  auto const& productResolver = productResolvers_[index];
815 
816  auto resolution = productResolver->resolveProduct(*this, false, sra, mcc);
817  if (resolution.isAmbiguous()) {
818  throwAmbiguousException("findProductByLabel", typeID, label, instance, process);
819  }
820  return resolution.data();
821  }
822 
824  InputTag const& tag,
825  ModuleCallingContext const* mcc) const {
826  // Not implemented for ProcessBlocks
828 
829  ProductData const* productData = findProductByLabel(PRODUCT_TYPE, typeID, tag, nullptr, nullptr, mcc);
830  return productData;
831  }
832 
833  Provenance const& Principal::getProvenance(BranchID const& bid) const {
835  if (phb == nullptr) {
837  }
838 
839  if (phb->unscheduledWasNotRun()) {
841  << "Requesting provenance from unrun EDProducer. The requested branch ID was: " << bid;
842  }
843  return *phb->provenance();
844  }
845 
848  if (phb == nullptr) {
849  throwProductNotFoundException("getStableProvenance", errors::ProductNotFound, bid);
850  }
851  //NOTE: in all implementations, this never returns a nullptr
852  return *phb->stableProvenance();
853  }
854 
855  // This one is mostly for test printout purposes
856  // No attempt to trigger on demand execution
857  // Skips provenance when the EDProduct is not there
858  void Principal::getAllProvenance(std::vector<Provenance const*>& provenances) const {
859  provenances.clear();
860  for (auto const& productResolver : *this) {
861  if (productResolver->singleProduct() && productResolver->provenanceAvailable() &&
862  !productResolver->branchDescription().isAnyAlias()) {
863  // We do not attempt to get the event/lumi/run status from the provenance,
864  // because the per event provenance may have been dropped.
865  if (productResolver->provenance()->branchDescription().present()) {
866  provenances.push_back(productResolver->provenance());
867  }
868  }
869  }
870  }
871 
872  // This one is also mostly for test printout purposes
873  // No attempt to trigger on demand execution
874  // Skips provenance for dropped branches.
875  void Principal::getAllStableProvenance(std::vector<StableProvenance const*>& provenances) const {
876  provenances.clear();
877  for (auto const& productResolver : *this) {
878  if (productResolver->singleProduct() && !productResolver->branchDescription().isAnyAlias()) {
879  if (productResolver->stableProvenance()->branchDescription().present()) {
880  provenances.push_back(productResolver->stableProvenance());
881  }
882  }
883  }
884  }
885 
886  void Principal::recombine(Principal& other, std::vector<BranchID> const& bids) {
887  for (auto& prod : bids) {
888  ProductResolverIndex index = preg_->indexFrom(prod);
890  ProductResolverIndex indexO = other.preg_->indexFrom(prod);
892  get_underlying_safe(productResolvers_[index]).swap(get_underlying_safe(other.productResolvers_[indexO]));
893  }
894  reader_->mergeReaders(other.reader());
895  }
896 
897  WrapperBase const* Principal::getIt(ProductID const&) const {
898  assert(false);
899  return nullptr;
900  }
901 
902  std::optional<std::tuple<WrapperBase const*, unsigned int>> Principal::getThinnedProduct(ProductID const&,
903  unsigned int) const {
904  assert(false);
905  return std::nullopt;
906  }
907 
909  std::vector<WrapperBase const*>&,
910  std::vector<unsigned int>&) const {
911  assert(false);
912  }
913 
915  assert(false);
916  return std::monostate{};
917  }
918 
919  void Principal::put_(std::unique_ptr<WrapperBase> prod, ProductResolverBase const* phb) const {
920  dynamic_cast<ProductPutterBase const*>(phb)->putProduct(std::move(prod));
921  }
922 
923  void Principal::put_(BranchDescription const& bd, std::unique_ptr<WrapperBase> edp) const {
924  if (edp.get() == nullptr) {
925  throw edm::Exception(edm::errors::InsertFailure, "Null Pointer")
926  << "put: Cannot put because unique_ptr to product is null."
927  << "\n";
928  }
929  auto phb = getExistingProduct(bd.branchID());
930  assert(phb);
931  // ProductResolver assumes ownership
932  put_(std::move(edp), phb);
933  }
934 
936  if (preg_->getNextIndexValue(branchType_) != productResolvers_.size()) {
937  bool changed = false;
938  productResolvers_.resize(preg_->getNextIndexValue(branchType_));
939  for (auto const& prod : preg_->productList()) {
940  BranchDescription const& bd = prod.second;
941  if (bd.branchType() == branchType_) {
942  ProductResolverIndex index = preg_->indexFrom(bd.branchID());
944  if (!productResolvers_[index]) {
945  // no product holder. Must add one. The new entry must be an input product holder.
946  assert(!bd.produced());
947  auto cbd = std::make_shared<BranchDescription const>(bd);
948  if (bd.onDemand()) {
950  } else {
952  }
953  changed = true;
954  }
955  }
956  }
957  if (changed) {
958  changedIndexes_();
959  }
960  }
961  assert(preg_->getNextIndexValue(branchType_) == productResolvers_.size());
962  }
963 
965  if (not reader()) {
966  return;
967  }
968 
969  for (auto& prod : *this) {
970  prod->retrieveAndMerge(*this, mergeableRunProductMetadata);
971  }
972  }
973 } // namespace edm
Likely.h
edm::SharedResourcesAcquirer
Definition: SharedResourcesAcquirer.h:34
edm::source
static const std::string source("source")
diffTwoXMLs.ranges
string ranges
Definition: diffTwoXMLs.py:79
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
edm::InputTag::kCurrentProcess
static const std::string kCurrentProcess
Definition: InputTag.h:54
ProductResolverIndexHelper.h
edm::ProductResolverIndex
unsigned int ProductResolverIndex
Definition: ProductResolverIndex.h:8
mps_fire.i
i
Definition: mps_fire.py:428
edm::appendCurrentProcessIfAlias
static std::string appendCurrentProcessIfAlias(std::string const &processFromInputTag, std::string const &currentProcess)
Definition: Principal.cc:36
edm::Principal::findProducts
void findProducts(std::vector< ProductResolverBase const * > const &holders, TypeID const &typeID, BasicHandleVec &results, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: Principal.cc:715
MessageLogger.h
edm::Principal::put_
void put_(BranchDescription const &bd, std::unique_ptr< WrapperBase > edp) const
Definition: Principal.cc:923
FunctorHandleExceptionFactory.h
edm::PRODUCT_TYPE
Definition: ProductKindOfType.h:5
edm::BasicHandle
Definition: BasicHandle.h:43
edm::errors::LogicError
Definition: EDMException.h:37
edm::s_nextIdentifier
static std::atomic< Principal::CacheIdentifier_t > s_nextIdentifier
Definition: Principal.cc:117
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::Principal::readAllFromSourceAndMergeImmediately
void readAllFromSourceAndMergeImmediately(MergeableRunProductMetadata const *mergeableRunProductMetadata=nullptr)
Definition: Principal.cc:964
edm::ProductData::wrapper
WrapperBase const * wrapper() const
Definition: ProductData.h:35
deep_tau::DeepTauBase::BasicDiscriminator
BasicDiscriminator
Definition: DeepTauBase.h:115
edm::Principal::adjustToNewProductRegistry
bool adjustToNewProductRegistry(ProductRegistry const &reg)
Definition: Principal.cc:315
ProductResolverIndex.h
edm::ProductResolverIndexHelper::Range
Definition: ProductResolverIndexHelper.h:199
oniaPATMuonsWithTrigger_cff.matches
matches
Definition: oniaPATMuonsWithTrigger_cff.py:77
edm::Principal::ConstProductResolverPtr
ProductResolverBase const * ConstProductResolverPtr
Definition: Principal.h:62
edm::Principal::findProductByTag
ProductData const * findProductByTag(TypeID const &typeID, InputTag const &tag, ModuleCallingContext const *mcc) const
Definition: Principal.cc:823
dqmPostProcessing_online.existing
existing
Definition: dqmPostProcessing_online.py:126
cms::cuda::assert
assert(be >=bs)
TypeID.h
edm::Principal
Definition: Principal.h:56
edm::ProductResolverIndexHelper::index
ProductResolverIndex index(KindOfType kindOfType, TypeID const &typeID, char const *moduleLabel, char const *instance, char const *process=nullptr) const
Definition: ProductResolverIndexHelper.cc:81
bookConverter.results
results
Definition: bookConverter.py:144
edm::errors::ErrorCodes
ErrorCodes
Definition: EDMException.h:22
DelayedReader.h
edm::get_underlying_safe
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
Definition: get_underlying_safe.h:41
ProductRegistry.h
edm::Principal::addSwitchProducerProduct
void addSwitchProducerProduct(std::shared_ptr< BranchDescription const > bd)
Definition: Principal.cc:361
edm::ProductResolverIndexHelper::relatedIndexes
Matches relatedIndexes(KindOfType kindOfType, TypeID const &typeID, char const *moduleLabel, char const *instance) const
Definition: ProductResolverIndexHelper.cc:153
edm::Principal::processHistory
ProcessHistory const & processHistory() const
Definition: Principal.h:140
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
relativeConstraints.error
error
Definition: relativeConstraints.py:53
edm::Principal::getThinnedKeyFrom
OptionalThinnedKey getThinnedKeyFrom(ProductID const &parent, unsigned int key, ProductID const &thinned) const override
Definition: Principal.cc:914
edm::Principal::recombine
void recombine(Principal &other, std::vector< BranchID > const &bids)
Definition: Principal.cc:886
edm::ProductResolverIndexHelper::Matches
Definition: ProductResolverIndexHelper.h:127
edm::DelayedReader::mergeReaders
void mergeReaders(DelayedReader *other)
Definition: DelayedReader.h:36
edm::Principal::getProductResolverByIndex
ConstProductResolverPtr getProductResolverByIndex(ProductResolverIndex const &oid) const
Definition: Principal.cc:562
edm::BranchType
BranchType
Definition: BranchType.h:11
edm::ProductData::provenance
Provenance const & provenance() const
Definition: ProductData.h:33
edm::Principal::addParentProcessProduct
void addParentProcessProduct(std::shared_ptr< BranchDescription const > bd)
Definition: Principal.cc:377
edm::Principal::adjustIndexesAfterProductRegistryAddition
void adjustIndexesAfterProductRegistryAddition()
Definition: Principal.cc:935
edm::Principal::addScheduledProduct
void addScheduledProduct(std::shared_ptr< BranchDescription const > bd)
Definition: Principal.cc:331
edm::makeHandleExceptionFactory
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
Definition: FunctorHandleExceptionFactory.h:45
edm::ProductRegistry
Definition: ProductRegistry.h:37
EDMException.h
edm::EDProductGetter
Definition: EDProductGetter.h:41
edm::errors::ProductNotFound
Definition: EDMException.h:33
edm::ServiceToken
Definition: ServiceToken.h:42
edm::InProcess
Definition: BranchType.h:11
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
edm::EDConsumerBase
Definition: EDConsumerBase.h:71
edm::Principal::getThinnedProducts
void getThinnedProducts(ProductID const &, std::vector< WrapperBase const * > &, std::vector< unsigned int > &) const override
Definition: Principal.cc:908
edm::Principal::getAllProvenance
void getAllProvenance(std::vector< Provenance const * > &provenances) const
Definition: Principal.cc:858
ProcessConfiguration.h
GlobalPosition_Frontier_DevDB_cff.tag
tag
Definition: GlobalPosition_Frontier_DevDB_cff.py:11
DQM.reader
reader
Definition: DQM.py:105
edm::Principal::getProvenance
Provenance const & getProvenance(BranchID const &bid) const
Definition: Principal.cc:833
edm::ProductResolverIndexHelper::IndexAndNames
Definition: ProductResolverIndexHelper.h:210
edm::BranchID
Definition: BranchID.h:14
edm::Principal::reader
DelayedReader * reader() const
Definition: Principal.h:187
TrackValidation_cff.task
task
Definition: TrackValidation_cff.py:252
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
edm::Principal::getAllStableProvenance
void getAllStableProvenance(std::vector< StableProvenance const * > &provenances) const
Definition: Principal.cc:875
edm::Principal::BasicHandleVec
std::vector< BasicHandle > BasicHandleVec
Definition: Principal.h:63
edm::Principal::branchType
BranchType const & branchType() const
Definition: Principal.h:181
edm::Principal::processHistoryIDBeforeConfig_
ProcessHistoryID processHistoryIDBeforeConfig_
Definition: Principal.h:272
edm::MergeableRunProductMetadata
Definition: MergeableRunProductMetadata.h:52
L1TObjectsTimingClient_cff.resolution
resolution
Definition: L1TObjectsTimingClient_cff.py:52
edm::errors::InsertFailure
Definition: EDMException.h:35
edm::Principal::CacheIdentifier_t
unsigned long CacheIdentifier_t
Definition: Principal.h:184
edm::Principal::getProductResolver
ConstProductResolverPtr getProductResolver(BranchID const &oid) const
Definition: Principal.cc:554
edm::Hash< ProcessHistoryType >
trackingPlots.other
other
Definition: trackingPlots.py:1460
edm::InEvent
Definition: BranchType.h:11
dqmdumpme.k
k
Definition: dqmdumpme.py:60
edm::ProcessConfiguration::processName
std::string const & processName() const
Definition: ProcessConfiguration.h:24
ProductPutterBase.h
edm::Principal::productRegistry
ProductRegistry const & productRegistry() const
Definition: Principal.h:146
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::Principal::reader_
DelayedReader * reader_
Definition: Principal.h:289
edm::Principal::productLookup
ProductResolverIndexHelper const & productLookup() const
Definition: Principal.h:148
HistoryAppender.h
Principal.h
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
edm::makeNotFoundException
static std::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)
Definition: Principal.cc:53
edm::BasicHandle::makeInvalid
static BasicHandle makeInvalid()
Definition: BasicHandle.h:93
edm::ProductRegistry::ProductList
std::map< BranchKey, BranchDescription > ProductList
Definition: ProductRegistry.h:39
EDConsumerBase.h
edm::ProductResolverIndexHelper::IndexAndNames::index
ProductResolverIndex index() const
Definition: ProductResolverIndexHelper.h:214
edm::WaitingTaskHolder
Definition: WaitingTaskHolder.h:32
edm::Principal::fillPrincipal
void fillPrincipal(DelayedReader *reader)
Definition: Principal.cc:402
edm::StableProvenance
Definition: StableProvenance.h:30
edm::Principal::processHistoryPtr_
std::shared_ptr< ProcessHistory const > processHistoryPtr_
Definition: Principal.h:269
gpuVertexFinder::hist
__shared__ Hist hist
Definition: gpuClusterTracksDBSCAN.h:48
LaserDQM_cfg.process
process
Definition: LaserDQM_cfg.py:3
edm::Principal::processConfiguration_
ProcessConfiguration const * processConfiguration_
Definition: Principal.h:274
edm::ProductResolverIndexInvalid
Definition: ProductResolverIndex.h:16
edm::Principal::addSwitchAliasProduct
void addSwitchAliasProduct(std::shared_ptr< BranchDescription const > bd)
Definition: Principal.cc:369
edm::Principal::setupUnscheduled
void setupUnscheduled(UnscheduledConfigurator const &)
Definition: Principal.cc:398
edm::Principal::getStableProvenance
StableProvenance const & getStableProvenance(BranchID const &bid) const
Definition: Principal.cc:846
edm::WrapperBase
Definition: WrapperBase.h:23
edm::Principal::getThinnedProduct
std::optional< std::tuple< WrapperBase const *, unsigned int > > getThinnedProduct(ProductID const &, unsigned int) const override
Definition: Principal.cc:902
edm::BranchDescription::branchName
std::string const & branchName() const
Definition: BranchDescription.h:120
edm::Principal::getExistingProduct
ProductResolverBase * getExistingProduct(BranchID const &branchID)
Definition: Principal.cc:501
edm::Principal::branchType_
BranchType branchType_
Definition: Principal.h:291
edm::UnscheduledConfigurator
Definition: UnscheduledConfigurator.h:32
edm::HistoryAppender
Definition: HistoryAppender.h:13
edm::ProductResolverBase::resetBranchDescription
void resetBranchDescription(std::shared_ptr< BranchDescription const > bd)
Definition: ProductResolverBase.h:116
edm::Principal::clearPrincipal
void clearPrincipal()
Definition: Principal.cc:382
edm::Principal::SharedProductPtr
std::shared_ptr< ProductResolverBase > SharedProductPtr
Definition: Principal.h:66
instance
static PFTauRenderPlugin instance
Definition: PFTauRenderPlugin.cc:70
edm::ProductResolverIndexAmbiguous
Definition: ProductResolverIndex.h:18
SimL1EmulatorRepack_CalouGT_cff.processName
processName
Definition: SimL1EmulatorRepack_CalouGT_cff.py:17
edm::Principal::addAliasedProduct
void addAliasedProduct(std::shared_ptr< BranchDescription const > bd)
Definition: Principal.cc:353
edm::OptionalThinnedKey
std::variant< unsigned int, detail::GetThinnedKeyFromExceptionFactory, std::monostate > OptionalThinnedKey
Definition: EDProductGetter.h:39
edm::Principal::getByToken
BasicHandle getByToken(KindOfType kindOfType, TypeID const &typeID, ProductResolverIndex index, bool skipCurrentProcess, bool &ambiguous, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: Principal.cc:609
WrappedClassName.h
edm::TypeID
Definition: TypeID.h:22
edm::Principal::productResolvers_
ProductResolverCollection productResolvers_
Definition: Principal.h:277
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ProductResolverBase::branchDescription
BranchDescription const & branchDescription() const
Definition: ProductResolverBase.h:110
edm::ProductRegistry::productList
ProductList const & productList() const
Definition: ProductRegistry.h:76
edm::nextIdentifier
static Principal::CacheIdentifier_t nextIdentifier()
Definition: Principal.cc:118
edm::throwAmbiguousException
static void throwAmbiguousException(const char *where, TypeID const &productType, std::string const &label, std::string const &instance, std::string const &process)
Definition: Principal.cc:77
edm::KindOfType
KindOfType
Definition: ProductKindOfType.h:5
edm::Principal::getManyByType
void getManyByType(TypeID const &typeID, BasicHandleVec &results, EDConsumerBase const *consumes, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: Principal.cc:645
edm::ProductResolverBase
Definition: ProductResolverBase.h:34
edm::Principal::size
size_t size() const
Definition: Principal.cc:303
Exception
Definition: hltDiff.cc:245
edm::Principal::productLookup_
std::shared_ptr< ProductResolverIndexHelper const > productLookup_
Definition: Principal.h:282
edm::ProductData
Definition: ProductData.h:20
edm::Principal::addProduct_
void addProduct_(std::unique_ptr< ProductResolverBase > phb)
Definition: Principal.cc:529
ProductResolvers.h
ProductDeletedException.h
or
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::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
edm::DelayedReader
Definition: DelayedReader.h:29
edm::Principal::processHistoryID_
ProcessHistoryID processHistoryID_
Definition: Principal.h:271
edm::Principal::getByLabel
BasicHandle getByLabel(KindOfType kindOfType, TypeID const &typeID, InputTag const &inputTag, EDConsumerBase const *consumes, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: Principal.cc:567
edm::ProductResolverBase::setupUnscheduled
virtual void setupUnscheduled(UnscheduledConfigurator const &)
Definition: ProductResolverBase.cc:43
OfflineOutput_cfi.consumer
consumer
Definition: OfflineOutput_cfi.py:3
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
edm::Principal::~Principal
~Principal() override
Definition: Principal.cc:298
edm::Principal::applyToResolvers
void applyToResolvers(F iFunc)
Definition: Principal.h:215
edm::Principal::changedIndexes_
virtual void changedIndexes_()
Definition: Principal.h:223
edm::BranchDescription
Definition: BranchDescription.h:32
edm::Principal::addSourceProduct
void addSourceProduct(std::shared_ptr< BranchDescription const > bd)
Definition: Principal.cc:336
mps_fire.result
result
Definition: mps_fire.py:311
cms::Exception
Definition: Exception.h:70
edm::ProcessHistory
Definition: ProcessHistory.h:13
edm::Principal::findProductByLabel
ProductData const * findProductByLabel(KindOfType kindOfType, TypeID const &typeID, InputTag const &inputTag, EDConsumerBase const *consumer, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: Principal.cc:740
edm::Principal::prefetchAsync
void prefetchAsync(WaitingTaskHolder waitTask, ProductResolverIndex index, bool skipCurrentProcess, ServiceToken const &token, ModuleCallingContext const *mcc) const
Definition: Principal.cc:635
HerwigMaxPtPartonFilter_cfi.moduleLabel
moduleLabel
Definition: HerwigMaxPtPartonFilter_cfi.py:4
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::throwProductNotFoundException
static void throwProductNotFoundException(char const *where, errors::ErrorCodes error, BranchID const &bid)
Definition: Principal.cc:48
SimL1EmulatorRepack_Full_cff.inputTag
inputTag
Definition: SimL1EmulatorRepack_Full_cff.py:56
edm::Principal::addProductOrThrow
void addProductOrThrow(std::unique_ptr< ProductResolverBase > phb)
Definition: Principal.cc:542
edm::Provenance
Definition: Provenance.h:34
edm::Principal::cacheIdentifier_
CacheIdentifier_t cacheIdentifier_
Definition: Principal.h:298
edm::Principal::lookupProcessOrder_
std::vector< unsigned int > lookupProcessOrder_
Definition: Principal.h:284
edm::Principal::deleteProduct
void deleteProduct(BranchID const &id) const
Definition: Principal.cc:392
edm::Principal::historyAppender_
edm::propagate_const< HistoryAppender * > historyAppender_
Definition: Principal.h:296
edm::BranchDescription::branchID
BranchID const & branchID() const
Definition: BranchDescription.h:74
edm::Principal::getIt
WrapperBase const * getIt(ProductID const &) const override
Definition: Principal.cc:897
edm::Principal::addUnscheduledProduct
void addUnscheduledProduct(std::shared_ptr< BranchDescription const > bd)
Definition: Principal.cc:349
edm::Principal::Principal
Principal(std::shared_ptr< ProductRegistry const > reg, std::shared_ptr< ProductResolverIndexHelper const > productLookup, ProcessConfiguration const &pc, BranchType bt, HistoryAppender *historyAppender, bool isForPrimaryProcess=true)
Definition: Principal.cc:122
edm::ProductResolverIndexHelper::IndexAndNames::startInProcessNames
unsigned int startInProcessNames() const
Definition: ProductResolverIndexHelper.h:216
edm::InputTag
Definition: InputTag.h:15
edm::errors::UnimplementedFeature
Definition: EDMException.h:38
label
const char * label
Definition: PFTauDecayModeTools.cc:11
edm::ProductID
Definition: ProductID.h:27
edm::ProcessConfiguration
Definition: ProcessConfiguration.h:14
edm::Principal::orderProcessHistoryID_
ProcessHistoryID orderProcessHistoryID_
Definition: Principal.h:285
edm::BranchKey
Definition: BranchKey.h:17
edm::Principal::addDelayedReaderInputProduct
void addDelayedReaderInputProduct(std::shared_ptr< BranchDescription const > bd)
Definition: Principal.cc:341
edm::s_emptyProcessHistory
static const ProcessHistory s_emptyProcessHistory
Definition: Principal.cc:34
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443
edm::Principal::addPutOnReadInputProduct
void addPutOnReadInputProduct(std::shared_ptr< BranchDescription const > bd)
Definition: Principal.cc:345
edm::Principal::preg_
std::shared_ptr< ProductRegistry const > preg_
Definition: Principal.h:281
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316