CMS 3D CMS Logo

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