CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ProductRegistry.cc
Go to the documentation of this file.
1 
11 
13 
20 
21 #include "TDictAttributeMap.h"
22 
23 #include <cassert>
24 #include <iterator>
25 #include <limits>
26 #include <set>
27 #include <sstream>
28 #include <ostream>
29 
30 namespace edm {
31 
32  ProductRegistry::ProductRegistry() : productList_(), transient_() {}
33 
35  : frozen_(false),
36  productProduced_(),
37  anyProductProduced_(false),
38  productLookups_{{std::make_unique<ProductResolverIndexHelper>(),
39  std::make_unique<ProductResolverIndexHelper>(),
40  std::make_unique<ProductResolverIndexHelper>(),
41  std::make_unique<ProductResolverIndexHelper>()}},
44  for (bool& isProduced : productProduced_)
45  isProduced = false;
46  }
47 
49  frozen_ = false;
50  for (bool& isProduced : productProduced_)
51  isProduced = false;
52  anyProductProduced_ = false;
53 
54  // propagate_const<T> has no reset() function
55  for (auto& iterProductLookup : productLookups_) {
56  iterProductLookup = std::make_unique<ProductResolverIndexHelper>();
57  }
58  nextIndexValues_.fill(0);
59 
60  branchIDToIndex_.clear();
61  }
62 
64  : productList_(productList), transient_() {
65  freezeIt(toBeFrozen);
66  }
67 
68  void ProductRegistry::addProduct(BranchDescription const& productDesc, bool fromListener) {
69  assert(productDesc.produced());
70  throwIfFrozen();
71  std::pair<ProductList::iterator, bool> ret =
72  productList_.insert(std::make_pair(BranchKey(productDesc), productDesc));
73  if (!ret.second) {
74  auto const& previous = *productList_.find(BranchKey(productDesc));
75  if (previous.second.produced()) {
76  // Duplicate registration in current process
77  throw Exception(errors::LogicError, "Duplicate Product Identifier")
78  << "\nThe Framework requires a unique branch name for each product\n"
79  << "which consists of four parts: a friendly class name, module label,\n"
80  << "product instance name, and process name. A product has been\n"
81  << "registered with a duplicate branch name. The most common way\n"
82  << "to fix this error is to modify the product instance name in\n"
83  << "one of the offending 'produces' function calls. Another fix\n"
84  << "would be to delete one of them if they are for the same product.\n\n"
85  << " friendly class name = " << previous.second.friendlyClassName() << "\n"
86  << " module label = " << previous.second.moduleLabel() << "\n"
87  << " product instance name = " << previous.second.productInstanceName() << "\n"
88  << " process name = " << previous.second.processName() << "\n\n"
89  << "The following additional information is not used as part of\n"
90  << "the unique branch identifier.\n\n"
91  << " branch types = " << previous.second.branchType() << " " << productDesc.branchType() << "\n"
92  << " class name = " << previous.second.fullClassName() << "\n\n"
93  << "Note that if the four parts of the branch name are the same,\n"
94  << "then this error will occur even if the branch types differ!\n\n";
95  } else {
96  // Duplicate registration in previous process
97  throw Exception(errors::Configuration, "Duplicate Process Name.\n")
98  << "The process name " << productDesc.processName() << " was previously used for products in the input.\n"
99  << "This has caused branch name conflicts between input products and new products.\n"
100  << "Please modify the configuration file to use a distinct process name.\n"
101  << "Alternately, drop all input products using that process name and the\n"
102  << "descendants of those products.\n";
103  }
104  }
105  addCalled(productDesc, fromListener);
106  }
107 
109  std::string const& labelAlias,
110  std::string const& instanceAlias) {
111  assert(productDesc.produced());
112  assert(productDesc.branchID().isValid());
113  throwIfFrozen();
114  BranchDescription bd(productDesc, labelAlias, instanceAlias);
115  std::pair<ProductList::iterator, bool> ret = productList_.insert(std::make_pair(BranchKey(bd), bd));
116  assert(ret.second);
117  transient_.aliasToOriginal_.emplace_back(
118  PRODUCT_TYPE, productDesc.unwrappedTypeID(), labelAlias, instanceAlias, productDesc.moduleLabel());
119  addCalled(bd, false);
120  }
121 
123  assert(!productDesc.produced());
124  throwIfFrozen();
125  BranchKey k = BranchKey(productDesc);
126  ProductList::iterator iter = productList_.find(k);
127  if (iter == productList_.end()) {
128  productList_.insert(std::make_pair(k, productDesc));
129  } else {
130  assert(combinable(iter->second, productDesc));
131  iter->second.merge(productDesc);
132  }
133  }
134 
137  for (ProductList::const_iterator it = productList_.begin(), itEnd = productList_.end(); it != itEnd; ++it) {
138  if (it->second.branchType() == brType) {
139  return true;
140  }
141  }
142  return false;
143  }
144 
145  std::shared_ptr<ProductResolverIndexHelper const> ProductRegistry::productLookup(BranchType branchType) const {
146  return get_underlying_safe(transient_.productLookups_[branchType]);
147  }
148 
149  std::shared_ptr<ProductResolverIndexHelper> ProductRegistry::productLookup(BranchType branchType) {
150  return get_underlying_safe(transient_.productLookups_[branchType]);
151  }
152 
153  void ProductRegistry::setFrozen(bool initializeLookupInfo) {
154  if (frozen())
155  return;
156  freezeIt();
157  if (initializeLookupInfo) {
158  initializeLookupTables(nullptr, nullptr, nullptr);
159  }
161  }
162 
163  void ProductRegistry::setFrozen(std::set<TypeID> const& productTypesConsumed,
164  std::set<TypeID> const& elementTypesConsumed,
165  std::string const& processName) {
166  if (frozen())
167  return;
168  freezeIt();
169  initializeLookupTables(&productTypesConsumed, &elementTypesConsumed, &processName);
171  }
172 
174  if (frozen()) {
175  throw cms::Exception("ProductRegistry", "throwIfFrozen")
176  << "cannot modify the ProductRegistry because it is frozen\n";
177  }
178  }
179 
181  if (!frozen()) {
182  throw cms::Exception("ProductRegistry", "throwIfNotFrozen")
183  << "cannot read the ProductRegistry because it is not yet frozen\n";
184  }
185  }
186 
188 
189  std::vector<std::string> ProductRegistry::allBranchNames() const {
190  std::vector<std::string> result;
191  result.reserve(productList().size());
192 
193  for (auto const& product : productList()) {
194  result.push_back(product.second.branchName());
195  }
196  return result;
197  }
198 
199  std::vector<BranchDescription const*> ProductRegistry::allBranchDescriptions() const {
200  std::vector<BranchDescription const*> result;
201  result.reserve(productList().size());
202 
203  for (auto const& product : productList()) {
204  result.push_back(&product.second);
205  }
206  return result;
207  }
208 
210  for (auto const& product : other) {
211  copyProduct(product.second);
212  }
213  }
214 
215  void ProductRegistry::updateFromInput(std::vector<BranchDescription> const& other) {
216  for (BranchDescription const& branchDescription : other) {
217  copyProduct(branchDescription);
218  }
219  }
220 
221  void ProductRegistry::setUnscheduledProducts(std::set<std::string> const& unscheduledLabels) {
222  throwIfFrozen();
223 
224  bool hasAliases = false;
225  std::vector<BranchID> onDemandIDs;
226  for (auto& prod : productList_) {
227  if (prod.second.produced() && prod.second.branchType() == InEvent &&
228  unscheduledLabels.end() != unscheduledLabels.find(prod.second.moduleLabel())) {
229  prod.second.setOnDemand(true);
230  onDemandIDs.push_back(prod.second.branchID());
231  }
232  if (prod.second.produced() && prod.second.isAlias()) {
233  hasAliases = true;
234  }
235  }
236 
237  // Need to loop over EDAliases to set their on-demand flag based on the pointed-to branch
238  if (hasAliases) {
239  std::sort(onDemandIDs.begin(), onDemandIDs.end());
240  for (auto& prod : productList_) {
241  if (prod.second.isAlias()) {
242  if (std::binary_search(onDemandIDs.begin(), onDemandIDs.end(), prod.second.aliasForBranchID())) {
243  prod.second.setOnDemand(true);
244  }
245  }
246  }
247  }
248  }
249 
251  std::string const& fileName,
252  BranchDescription::MatchMode branchesMustMatch) {
253  std::ostringstream differences;
254 
255  ProductRegistry::ProductList::iterator j = productList_.begin();
256  ProductRegistry::ProductList::iterator s = productList_.end();
257  ProductRegistry::ProductList::const_iterator i = other.productList().begin();
258  ProductRegistry::ProductList::const_iterator e = other.productList().end();
259 
260  // Loop over entries in the main product registry.
261  while (j != s || i != e) {
262  if (j != s && j->second.produced()) {
263  // Ignore branches just produced (i.e. not in input file).
264  ++j;
265  } else if (j == s || (i != e && i->first < j->first)) {
266  if (i->second.present()) {
267  differences << "Branch '" << i->second.branchName() << "' is in file '" << fileName << "'\n";
268  differences << " but not in previous files.\n";
269  } else {
270  productList_.insert(*i);
271  transient_.branchIDToIndex_[i->second.branchID()] = getNextIndexValue(i->second.branchType());
272  ++nextIndexValue(i->second.branchType());
273  }
274  ++i;
275  } else if (i == e || (j != s && j->first < i->first)) {
276  if (j->second.present() &&
277  (branchesMustMatch == BranchDescription::Strict || j->second.branchType() == InProcess)) {
278  differences << "Branch '" << j->second.branchName() << "' is in previous files\n";
279  differences << " but not in file '" << fileName << "'.\n";
280  }
281  ++j;
282  } else {
283  std::string difs = match(j->second, i->second, fileName);
284  if (difs.empty()) {
285  j->second.merge(i->second);
286  } else {
287  differences << difs;
288  }
289  ++i;
290  ++j;
291  }
292  }
293  return differences.str();
294  }
295 
296  void ProductRegistry::initializeLookupTables(std::set<TypeID> const* productTypesConsumed,
297  std::set<TypeID> const* elementTypesConsumed,
298  std::string const* processName) {
299  std::map<TypeID, TypeID> containedTypeMap;
300  std::map<TypeID, std::vector<TypeWithDict>> containedTypeToBaseTypesMap;
301 
302  std::vector<std::string> missingDictionaries;
303  std::vector<std::string> branchNamesForMissing;
304  std::vector<std::string> producedTypes;
305 
307 
308  for (auto const& product : productList_) {
309  auto const& desc = product.second;
310 
311  checkForDuplicateProcessName(desc, processName);
312 
313  if (desc.produced() && !desc.transient()) {
314  setProductProduced(desc.branchType());
315  }
316 
317  //only do the following if the data is supposed to be available in the event
318  if (desc.present()) {
319  // Check dictionaries (we already checked for the produced ones earlier somewhere else).
320  // We have to have the dictionaries to properly setup the lookup tables for support of
321  // Views. Also we need them to determine which present products are declared to be
322  // consumed in the case where the consumed type is a View<T>.
323  if (!desc.produced()) {
324  if (!checkDictionary(missingDictionaries, desc.className(), desc.unwrappedType())) {
325  checkDictionaryOfWrappedType(missingDictionaries, desc.className());
326  branchNamesForMissing.emplace_back(desc.branchName());
327  producedTypes.emplace_back(desc.className() + std::string(" (read from input)"));
328  continue;
329  }
330  }
331  TypeID typeID(desc.unwrappedType().typeInfo());
332 
333  auto iterContainedType = containedTypeMap.find(typeID);
334  bool alreadySawThisType = (iterContainedType != containedTypeMap.end());
335 
336  if (!desc.produced() && !alreadySawThisType) {
337  if (!checkDictionary(missingDictionaries, desc.wrappedName(), desc.wrappedType())) {
338  branchNamesForMissing.emplace_back(desc.branchName());
339  producedTypes.emplace_back(desc.className() + std::string(" (read from input)"));
340  continue;
341  }
342  }
343 
344  TypeID wrappedTypeID(desc.wrappedType().typeInfo());
345 
346  TypeID containedTypeID;
347  if (alreadySawThisType) {
348  containedTypeID = iterContainedType->second;
349  } else {
350  containedTypeID = productholderindexhelper::getContainedTypeFromWrapper(wrappedTypeID, typeID.className());
351  }
352  bool hasContainedType = (containedTypeID != TypeID(typeid(void)) && containedTypeID != TypeID());
353 
354  std::vector<TypeWithDict>* baseTypesOfContainedType = nullptr;
355 
356  if (!alreadySawThisType) {
357  bool alreadyCheckedConstituents = desc.produced() && !desc.transient();
358  if (!alreadyCheckedConstituents && !desc.transient()) {
359  // This checks dictionaries of the wrapped class and all its constituent classes
360  if (!checkClassDictionaries(missingDictionaries, desc.wrappedName(), desc.wrappedType())) {
361  branchNamesForMissing.emplace_back(desc.branchName());
362  producedTypes.emplace_back(desc.className() + std::string(" (read from input)"));
363  continue;
364  }
365  }
366 
367  if (hasContainedType) {
368  auto iterBaseTypes = containedTypeToBaseTypesMap.find(containedTypeID);
369  if (iterBaseTypes == containedTypeToBaseTypesMap.end()) {
370  std::vector<TypeWithDict> baseTypes;
371  if (!public_base_classes(missingDictionaries, containedTypeID, baseTypes)) {
372  branchNamesForMissing.emplace_back(desc.branchName());
373  if (desc.produced()) {
374  producedTypes.emplace_back(desc.className() + std::string(" (produced in current process)"));
375  } else {
376  producedTypes.emplace_back(desc.className() + std::string(" (read from input)"));
377  }
378  continue;
379  }
380  iterBaseTypes = containedTypeToBaseTypesMap.insert(std::make_pair(containedTypeID, baseTypes)).first;
381  }
382  baseTypesOfContainedType = &iterBaseTypes->second;
383  }
384 
385  // Do this after the dictionary checks of constituents so the list of branch names for missing types
386  // is complete
387  containedTypeMap.emplace(typeID, containedTypeID);
388  } else {
389  if (hasContainedType) {
390  auto iterBaseTypes = containedTypeToBaseTypesMap.find(containedTypeID);
391  if (iterBaseTypes != containedTypeToBaseTypesMap.end()) {
392  baseTypesOfContainedType = &iterBaseTypes->second;
393  }
394  }
395  }
396 
397  if (productTypesConsumed != nullptr && !desc.produced()) {
398  bool mainTypeConsumed = (productTypesConsumed->find(typeID) != productTypesConsumed->end());
399  bool containedTypeConsumed =
400  hasContainedType && (elementTypesConsumed->find(containedTypeID) != elementTypesConsumed->end());
401  if (hasContainedType && !containedTypeConsumed && baseTypesOfContainedType != nullptr) {
402  for (TypeWithDict const& baseType : *baseTypesOfContainedType) {
403  if (elementTypesConsumed->find(TypeID(baseType.typeInfo())) != elementTypesConsumed->end()) {
404  containedTypeConsumed = true;
405  break;
406  }
407  }
408  }
409  if (!containedTypeConsumed) {
410  if (mainTypeConsumed) {
411  // The main type is consumed, but either
412  // there is no contained type, or if there is,
413  // neither it nor any of its base classes are consumed.
414  // Set the contained type, if there is one, to void,
415  if (hasContainedType) {
416  containedTypeID = TypeID(typeid(void));
417  }
418  } else {
419  // The main type is not consumed, and either
420  // there is no contained type, or if there is,
421  // neither it nor any of its base classes are consumed.
422  // Don't insert anything in the lookup tables.
423  continue;
424  }
425  }
426  }
428  ->insert(typeID,
429  desc.moduleLabel().c_str(),
430  desc.productInstanceName().c_str(),
431  desc.processName().c_str(),
432  containedTypeID,
433  baseTypesOfContainedType);
434 
435  transient_.branchIDToIndex_[desc.branchID()] = index;
436  }
437  }
438  if (!missingDictionaries.empty()) {
439  std::string context("Calling ProductRegistry::initializeLookupTables");
440  throwMissingDictionariesException(missingDictionaries, context, producedTypes, branchNamesForMissing);
441  }
442 
443  for (auto& iterProductLookup : transient_.productLookups_) {
444  iterProductLookup->setFrozen();
445  }
446 
447  unsigned int indexIntoNextIndexValue = 0;
448  for (auto const& iterProductLookup : transient_.productLookups_) {
449  transient_.nextIndexValues_[indexIntoNextIndexValue] = iterProductLookup->nextIndexValue();
450  ++indexIntoNextIndexValue;
451  }
452 
453  for (auto const& product : productList_) {
454  auto const& desc = product.second;
455  if (transient_.branchIDToIndex_.find(desc.branchID()) == transient_.branchIDToIndex_.end()) {
456  transient_.branchIDToIndex_[desc.branchID()] = getNextIndexValue(desc.branchType());
457  ++nextIndexValue(desc.branchType());
458  }
459  }
461  productTypesConsumed, elementTypesConsumed, containedTypeMap, containedTypeToBaseTypesMap);
462 
463  addElementTypesForAliases(elementTypesConsumed, containedTypeMap, containedTypeToBaseTypesMap);
464  }
465 
467  std::set<TypeID> const* elementTypesConsumed,
468  std::map<TypeID, TypeID> const& containedTypeMap,
469  std::map<TypeID, std::vector<TypeWithDict>> const& containedTypeToBaseTypesMap) {
470  Transients::AliasToOriginalVector elementAliases;
471  for (auto& item : transient_.aliasToOriginal_) {
472  auto iterContainedType = containedTypeMap.find(std::get<Transients::kType>(item));
473  if (iterContainedType == containedTypeMap.end()) {
475  ex << "containedTypeMap did not contain " << std::get<Transients::kType>(item).className()
476  << " that is used in EDAlias " << std::get<Transients::kModuleLabel>(item)
477  << ".\nThis should not happen, contact framework developers";
478  ex.addContext("Calling ProductRegistry::initializeLookupTables()");
479  throw ex;
480  }
481  auto const& containedTypeID = iterContainedType->second;
482  bool const hasContainedType = (containedTypeID != TypeID(typeid(void)) && containedTypeID != TypeID());
483  if (not hasContainedType) {
484  continue;
485  }
486 
487  if (elementTypesConsumed->find(containedTypeID) != elementTypesConsumed->end()) {
488  elementAliases.emplace_back(ELEMENT_TYPE,
489  containedTypeID,
490  std::get<Transients::kModuleLabel>(item),
491  std::get<Transients::kProductInstanceName>(item),
492  std::get<Transients::kAliasForModuleLabel>(item));
493  }
494 
495  auto iterBaseTypes = containedTypeToBaseTypesMap.find(containedTypeID);
496  if (iterBaseTypes == containedTypeToBaseTypesMap.end()) {
497  continue;
498  }
499  for (TypeWithDict const& baseType : iterBaseTypes->second) {
500  TypeID baseTypeID(baseType.typeInfo());
501  if (elementTypesConsumed->find(baseTypeID) != elementTypesConsumed->end()) {
502  elementAliases.emplace_back(ELEMENT_TYPE,
503  baseTypeID,
504  std::get<Transients::kModuleLabel>(item),
505  std::get<Transients::kProductInstanceName>(item),
506  std::get<Transients::kAliasForModuleLabel>(item));
507  }
508  }
509  }
511  std::make_move_iterator(elementAliases.begin()),
512  std::make_move_iterator(elementAliases.end()));
513  }
514 
516  std::set<TypeID> const* productTypesConsumed,
517  std::set<TypeID> const* elementTypesConsumed,
518  std::map<TypeID, TypeID> const& containedTypeMap,
519  std::map<TypeID, std::vector<TypeWithDict>>& containedTypeToBaseTypesMap) {
520  std::vector<std::string> missingDictionaries;
521  std::set<std::string> consumedTypesWithMissingDictionaries;
522 
523  if (productTypesConsumed) {
524  // Check dictionaries for all classes declared to be consumed
525  for (auto const& consumedTypeID : *productTypesConsumed) {
526  // We use the containedTypeMap to see which types have already
527  // had their dictionaries checked. We do not waste time rechecking
528  // those dictionaries.
529  if (containedTypeMap.find(consumedTypeID) == containedTypeMap.end()) {
530  std::string wrappedName = wrappedClassName(consumedTypeID.className());
531  TypeWithDict wrappedType = TypeWithDict::byName(wrappedName);
532  if (!checkDictionary(missingDictionaries, wrappedName, wrappedType)) {
533  checkDictionary(missingDictionaries, consumedTypeID);
534  consumedTypesWithMissingDictionaries.emplace(consumedTypeID.className());
535  continue;
536  }
537  bool transient = false;
538  TDictAttributeMap* wp = wrappedType.getClass()->GetAttributeMap();
539  if (wp && wp->HasKey("persistent") && !strcmp(wp->GetPropertyAsString("persistent"), "false")) {
540  transient = true;
541  }
542  if (transient) {
543  if (!checkDictionary(missingDictionaries, consumedTypeID)) {
544  consumedTypesWithMissingDictionaries.emplace(consumedTypeID.className());
545  }
546 
548  TypeID(wrappedType.typeInfo()), consumedTypeID.className());
549  bool hasContainedType = (containedTypeID != TypeID(typeid(void)) && containedTypeID != TypeID());
550  if (hasContainedType) {
551  if (containedTypeToBaseTypesMap.find(containedTypeID) == containedTypeToBaseTypesMap.end()) {
552  std::vector<TypeWithDict> bases;
553  // Run this to check for missing dictionaries, bases is not really used
554  if (!public_base_classes(missingDictionaries, containedTypeID, bases)) {
555  consumedTypesWithMissingDictionaries.emplace(consumedTypeID.className());
556  }
557  containedTypeToBaseTypesMap.insert(std::make_pair(containedTypeID, bases));
558  }
559  }
560  } else {
561  if (!checkClassDictionaries(missingDictionaries, wrappedName, wrappedType)) {
562  consumedTypesWithMissingDictionaries.emplace(consumedTypeID.className());
563  }
564  }
565  }
566  }
567  if (!missingDictionaries.empty()) {
569  "Calling ProductRegistry::initializeLookupTables, checking dictionaries for consumed products");
570  throwMissingDictionariesException(missingDictionaries, context, consumedTypesWithMissingDictionaries, false);
571  }
572  }
573 
574  if (elementTypesConsumed) {
575  missingDictionaries.clear();
576  consumedTypesWithMissingDictionaries.clear();
577  for (auto const& consumedTypeID : *elementTypesConsumed) {
578  if (containedTypeToBaseTypesMap.find(consumedTypeID) == containedTypeToBaseTypesMap.end()) {
579  std::vector<TypeWithDict> bases;
580  // Run this to check for missing dictionaries, bases is not really used
581  if (!public_base_classes(missingDictionaries, consumedTypeID, bases)) {
582  consumedTypesWithMissingDictionaries.emplace(consumedTypeID.className());
583  }
584  }
585  }
586  if (!missingDictionaries.empty()) {
588  "Calling ProductRegistry::initializeLookupTables, checking dictionaries for elements of products consumed "
589  "using View");
590  throwMissingDictionariesException(missingDictionaries, context, consumedTypesWithMissingDictionaries, true);
591  }
592  }
593  }
594 
596  std::string const* processName) const {
597  if (processName && !desc.produced() && (*processName == desc.processName())) {
598  throw Exception(errors::Configuration, "Duplicate Process Name.\n")
599  << "The process name " << *processName << " was previously used for products in the input.\n"
600  << "Please modify the configuration file to use a distinct process name.\n"
601  << "Alternately, drop all input products using that process name and the\n"
602  << "descendants of those products.\n";
603  }
604  }
605 
607  std::map<BranchID, ProductResolverIndex>::const_iterator itFind = transient_.branchIDToIndex_.find(iID);
608  if (itFind == transient_.branchIDToIndex_.end()) {
610  }
611  return itFind->second;
612  }
613 
614  std::vector<std::string> ProductRegistry::aliasToModules(KindOfType kindOfType,
615  TypeID const& type,
616  std::string_view moduleLabel,
617  std::string_view productInstanceName) const {
618  auto aliasFields = [](auto const& item) {
619  return std::tie(std::get<Transients::kKind>(item),
620  std::get<Transients::kType>(item),
621  std::get<Transients::kModuleLabel>(item),
622  std::get<Transients::kProductInstanceName>(item));
623  };
624  auto const target = std::tuple(kindOfType, type, moduleLabel, productInstanceName);
625  auto found =
628  target,
629  [aliasFields](auto const& item, auto const& target) { return aliasFields(item) < target; });
630  std::vector<std::string> ret;
631  for (; found != transient_.aliasToOriginal_.end() and aliasFields(*found) == target; ++found) {
632  ret.emplace_back(std::get<Transients::kAliasForModuleLabel>(*found));
633  }
634  return ret;
635  }
636 
637  void ProductRegistry::print(std::ostream& os) const {
638  for (auto const& product : productList_) {
639  os << product.second << "\n-----\n";
640  }
641  }
642 
644  return transient_.nextIndexValues_[branchType];
645  }
646 
648  return transient_.nextIndexValues_[branchType];
649  }
650 } // namespace edm
nextIndexValues_()
tuple ret
prodAgent to be discontinued
void setProductProduced(BranchType branchType)
BranchType const & branchType() const
void throwMissingDictionariesException(std::vector< std::string > &missingDictionaries, std::string const &context)
unsigned int ProductResolverIndex
std::vector< std::tuple< KindOfType, TypeID, std::string, std::string, std::string >> AliasToOriginalVector
void throwIfNotFrozen() const
TypeID getContainedTypeFromWrapper(TypeID const &wrappedtypeID, std::string const &className)
std::vector< std::string > allBranchNames() const
std::map< BranchKey, BranchDescription > ProductList
bool public_base_classes(std::vector< std::string > &missingDictionaries, TypeID const &typeID, std::vector< TypeWithDict > &baseTypes)
bool anyProducts(BranchType const brType) const
void addElementTypesForAliases(std::set< TypeID > const *elementTypesConsumed, std::map< TypeID, TypeID > const &containedTypeMap, std::map< TypeID, std::vector< TypeWithDict >> const &containedTypeToBaseTypesMap)
std::string const & processName() const
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
ProductList::size_type size() const
bool isValid() const
Definition: BranchID.h:22
assert(be >=bs)
void addLabelAlias(BranchDescription const &productdesc, std::string const &labelAlias, std::string const &instanceAlias)
AliasToOriginalVector aliasToOriginal_
BranchType
Definition: BranchType.h:11
tuple previous
Definition: callgraph.py:103
virtual void addCalled(BranchDescription const &, bool iFromListener)
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:74
tuple result
Definition: mps_fire.py:311
ProductList const & productList() const
deep_tau::DeepTauBase::BasicDiscriminator bd
Definition: DeepTauId.cc:1082
void initializeLookupTables(std::set< TypeID > const *productTypesConsumed, std::set< TypeID > const *elementTypesConsumed, std::string const *processName)
std::string const & moduleLabel() const
bool combinable(BranchDescription const &a, BranchDescription const &b)
bool checkDictionary(std::vector< std::string > &missingDictionaries, TypeID const &typeID)
void setUnscheduledProducts(std::set< std::string > const &unscheduledLabels)
TypeID unwrappedTypeID() const
void checkForDuplicateProcessName(BranchDescription const &desc, std::string const *processName) const
ProductResolverIndex & nextIndexValue(BranchType branchType)
bool checkClassDictionaries(std::vector< std::string > &missingDictionaries, TypeID const &typeID)
std::vector< BranchDescription const * > allBranchDescriptions() const
std::string merge(ProductRegistry const &other, std::string const &fileName, BranchDescription::MatchMode branchesMustMatch=BranchDescription::Permissive)
BranchID const & branchID() const
std::type_info const & typeInfo() const
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:50
void setFrozen(bool initializeLookupInfo=true)
void freezeIt(bool frozen=true)
void print(std::ostream &os) const
void checkDictionariesOfConsumedTypes(std::set< TypeID > const *productTypesConsumed, std::set< TypeID > const *elementTypesConsumed, std::map< TypeID, TypeID > const &containedTypeMap, std::map< TypeID, std::vector< TypeWithDict >> &containedTypeToBaseTypesMap)
std::array< ProductResolverIndex, NumBranchTypes > nextIndexValues_
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:92
std::array< edm::propagate_const< std::shared_ptr< ProductResolverIndexHelper > >, NumBranchTypes > productLookups_
std::string wrappedClassName(std::string const &iFullName)
void addContext(std::string const &context)
Definition: Exception.cc:165
branchIDToIndex_()
std::shared_ptr< ProductResolverIndexHelper const > productLookup(BranchType branchType) const
ProductResolverIndex const & getNextIndexValue(BranchType branchType) const
__host__ __device__ constexpr RandomIt lower_bound(RandomIt first, RandomIt last, const T &value, Compare comp={})
void throwIfFrozen() const
std::string const & className() const
Definition: TypeID.cc:40
void updateFromInput(ProductList const &other)
bool checkDictionaryOfWrappedType(std::vector< std::string > &missingDictionaries, TypeID const &unwrappedTypeID)
std::vector< std::string > aliasToModules(KindOfType kindOfType, TypeID const &type, std::string_view moduleLabel, std::string_view productInstanceName) const
ProductResolverIndex indexFrom(BranchID const &iID) const
void addProduct(BranchDescription const &productdesc, bool iFromListener=false)
std::map< BranchID, ProductResolverIndex > branchIDToIndex_
std::string className(const T &t)
Definition: ClassName.h:31
void copyProduct(BranchDescription const &productdesc)
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)