CMS 3D CMS Logo

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>()}},
42  nextIndexValues_(),
43  branchIDToIndex_() {
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 
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() && branchesMustMatch == BranchDescription::Strict) {
277  differences << "Branch '" << j->second.branchName() << "' is in previous files\n";
278  differences << " but not in file '" << fileName << "'.\n";
279  }
280  ++j;
281  } else {
282  std::string difs = match(j->second, i->second, fileName);
283  if (difs.empty()) {
284  j->second.merge(i->second);
285  } else {
286  differences << difs;
287  }
288  ++i;
289  ++j;
290  }
291  }
292  return differences.str();
293  }
294 
295  void ProductRegistry::initializeLookupTables(std::set<TypeID> const* productTypesConsumed,
296  std::set<TypeID> const* elementTypesConsumed,
297  std::string const* processName) {
298  std::map<TypeID, TypeID> containedTypeMap;
299  std::map<TypeID, std::vector<TypeWithDict>> containedTypeToBaseTypesMap;
300 
301  std::vector<std::string> missingDictionaries;
302  std::vector<std::string> branchNamesForMissing;
303  std::vector<std::string> producedTypes;
304 
306 
307  for (auto const& product : productList_) {
308  auto const& desc = product.second;
309 
311 
312  if (desc.produced() && !desc.transient()) {
313  setProductProduced(desc.branchType());
314  }
315 
316  //only do the following if the data is supposed to be available in the event
317  if (desc.present()) {
318  // Check dictionaries (we already checked for the produced ones earlier somewhere else).
319  // We have to have the dictionaries to properly setup the lookup tables for support of
320  // Views. Also we need them to determine which present products are declared to be
321  // consumed in the case where the consumed type is a View<T>.
322  if (!desc.produced()) {
323  if (!checkDictionary(missingDictionaries, desc.className(), desc.unwrappedType())) {
324  checkDictionaryOfWrappedType(missingDictionaries, desc.className());
325  branchNamesForMissing.emplace_back(desc.branchName());
326  producedTypes.emplace_back(desc.className() + std::string(" (read from input)"));
327  continue;
328  }
329  }
330  TypeID typeID(desc.unwrappedType().typeInfo());
331 
332  auto iterContainedType = containedTypeMap.find(typeID);
333  bool alreadySawThisType = (iterContainedType != containedTypeMap.end());
334 
335  if (!desc.produced() && !alreadySawThisType) {
336  if (!checkDictionary(missingDictionaries, desc.wrappedName(), desc.wrappedType())) {
337  branchNamesForMissing.emplace_back(desc.branchName());
338  producedTypes.emplace_back(desc.className() + std::string(" (read from input)"));
339  continue;
340  }
341  }
342 
343  TypeID wrappedTypeID(desc.wrappedType().typeInfo());
344 
345  TypeID containedTypeID;
346  if (alreadySawThisType) {
347  containedTypeID = iterContainedType->second;
348  } else {
349  containedTypeID = productholderindexhelper::getContainedTypeFromWrapper(wrappedTypeID, typeID.className());
350  }
351  bool hasContainedType = (containedTypeID != TypeID(typeid(void)) && containedTypeID != TypeID());
352 
353  std::vector<TypeWithDict>* baseTypesOfContainedType = nullptr;
354 
355  if (!alreadySawThisType) {
356  bool alreadyCheckedConstituents = desc.produced() && !desc.transient();
357  if (!alreadyCheckedConstituents && !desc.transient()) {
358  // This checks dictionaries of the wrapped class and all its constituent classes
359  if (!checkClassDictionaries(missingDictionaries, desc.wrappedName(), desc.wrappedType())) {
360  branchNamesForMissing.emplace_back(desc.branchName());
361  producedTypes.emplace_back(desc.className() + std::string(" (read from input)"));
362  continue;
363  }
364  }
365 
366  if (hasContainedType) {
367  auto iterBaseTypes = containedTypeToBaseTypesMap.find(containedTypeID);
368  if (iterBaseTypes == containedTypeToBaseTypesMap.end()) {
369  std::vector<TypeWithDict> baseTypes;
370  if (!public_base_classes(missingDictionaries, containedTypeID, baseTypes)) {
371  branchNamesForMissing.emplace_back(desc.branchName());
372  if (desc.produced()) {
373  producedTypes.emplace_back(desc.className() + std::string(" (produced in current process)"));
374  } else {
375  producedTypes.emplace_back(desc.className() + std::string(" (read from input)"));
376  }
377  continue;
378  }
379  iterBaseTypes = containedTypeToBaseTypesMap.insert(std::make_pair(containedTypeID, baseTypes)).first;
380  }
381  baseTypesOfContainedType = &iterBaseTypes->second;
382  }
383 
384  // Do this after the dictionary checks of constituents so the list of branch names for missing types
385  // is complete
386  containedTypeMap.emplace(typeID, containedTypeID);
387  } else {
388  if (hasContainedType) {
389  auto iterBaseTypes = containedTypeToBaseTypesMap.find(containedTypeID);
390  if (iterBaseTypes != containedTypeToBaseTypesMap.end()) {
391  baseTypesOfContainedType = &iterBaseTypes->second;
392  }
393  }
394  }
395 
396  if (productTypesConsumed != nullptr && !desc.produced()) {
397  bool mainTypeConsumed = (productTypesConsumed->find(typeID) != productTypesConsumed->end());
398  bool containedTypeConsumed =
399  hasContainedType && (elementTypesConsumed->find(containedTypeID) != elementTypesConsumed->end());
400  if (hasContainedType && !containedTypeConsumed && baseTypesOfContainedType != nullptr) {
401  for (TypeWithDict const& baseType : *baseTypesOfContainedType) {
402  if (elementTypesConsumed->find(TypeID(baseType.typeInfo())) != elementTypesConsumed->end()) {
403  containedTypeConsumed = true;
404  break;
405  }
406  }
407  }
408  if (!containedTypeConsumed) {
409  if (mainTypeConsumed) {
410  // The main type is consumed, but either
411  // there is no contained type, or if there is,
412  // neither it nor any of its base classes are consumed.
413  // Set the contained type, if there is one, to void,
414  if (hasContainedType) {
415  containedTypeID = TypeID(typeid(void));
416  }
417  } else {
418  // The main type is not consumed, and either
419  // there is no contained type, or if there is,
420  // neither it nor any of its base classes are consumed.
421  // Don't insert anything in the lookup tables.
422  continue;
423  }
424  }
425  }
427  ->insert(typeID,
428  desc.moduleLabel().c_str(),
429  desc.productInstanceName().c_str(),
430  desc.processName().c_str(),
431  containedTypeID,
432  baseTypesOfContainedType);
433 
434  transient_.branchIDToIndex_[desc.branchID()] = index;
435  }
436  }
437  if (!missingDictionaries.empty()) {
438  std::string context("Calling ProductRegistry::initializeLookupTables");
439  throwMissingDictionariesException(missingDictionaries, context, producedTypes, branchNamesForMissing);
440  }
441 
442  for (auto& iterProductLookup : transient_.productLookups_) {
443  iterProductLookup->setFrozen();
444  }
445 
446  unsigned int indexIntoNextIndexValue = 0;
447  for (auto const& iterProductLookup : transient_.productLookups_) {
448  transient_.nextIndexValues_[indexIntoNextIndexValue] = iterProductLookup->nextIndexValue();
449  ++indexIntoNextIndexValue;
450  }
451 
452  for (auto const& product : productList_) {
453  auto const& desc = product.second;
454  if (transient_.branchIDToIndex_.find(desc.branchID()) == transient_.branchIDToIndex_.end()) {
455  transient_.branchIDToIndex_[desc.branchID()] = getNextIndexValue(desc.branchType());
456  ++nextIndexValue(desc.branchType());
457  }
458  }
460  productTypesConsumed, elementTypesConsumed, containedTypeMap, containedTypeToBaseTypesMap);
461 
462  addElementTypesForAliases(elementTypesConsumed, containedTypeMap, containedTypeToBaseTypesMap);
463  }
464 
466  std::set<TypeID> const* elementTypesConsumed,
467  std::map<TypeID, TypeID> const& containedTypeMap,
468  std::map<TypeID, std::vector<TypeWithDict>> const& containedTypeToBaseTypesMap) {
469  Transients::AliasToOriginalVector elementAliases;
470  for (auto& item : transient_.aliasToOriginal_) {
471  auto iterContainedType = containedTypeMap.find(std::get<Transients::kType>(item));
472  if (iterContainedType == containedTypeMap.end()) {
474  ex << "containedTypeMap did not contain " << std::get<Transients::kType>(item).className()
475  << " that is used in EDAlias " << std::get<Transients::kModuleLabel>(item)
476  << ".\nThis should not happen, contact framework developers";
477  ex.addContext("Calling ProductRegistry::initializeLookupTables()");
478  throw ex;
479  }
480  auto const& containedTypeID = iterContainedType->second;
481  bool const hasContainedType = (containedTypeID != TypeID(typeid(void)) && containedTypeID != TypeID());
482  if (not hasContainedType) {
483  continue;
484  }
485 
486  if (elementTypesConsumed->find(containedTypeID) != elementTypesConsumed->end()) {
487  elementAliases.emplace_back(ELEMENT_TYPE,
488  containedTypeID,
489  std::get<Transients::kModuleLabel>(item),
490  std::get<Transients::kProductInstanceName>(item),
491  std::get<Transients::kAliasForModuleLabel>(item));
492  }
493 
494  auto iterBaseTypes = containedTypeToBaseTypesMap.find(containedTypeID);
495  if (iterBaseTypes == containedTypeToBaseTypesMap.end()) {
496  continue;
497  }
498  for (TypeWithDict const& baseType : iterBaseTypes->second) {
499  TypeID baseTypeID(baseType.typeInfo());
500  if (elementTypesConsumed->find(baseTypeID) != elementTypesConsumed->end()) {
501  elementAliases.emplace_back(ELEMENT_TYPE,
502  baseTypeID,
503  std::get<Transients::kModuleLabel>(item),
504  std::get<Transients::kProductInstanceName>(item),
505  std::get<Transients::kAliasForModuleLabel>(item));
506  }
507  }
508  }
510  std::make_move_iterator(elementAliases.begin()),
511  std::make_move_iterator(elementAliases.end()));
512  }
513 
515  std::set<TypeID> const* productTypesConsumed,
516  std::set<TypeID> const* elementTypesConsumed,
517  std::map<TypeID, TypeID> const& containedTypeMap,
518  std::map<TypeID, std::vector<TypeWithDict>>& containedTypeToBaseTypesMap) {
519  std::vector<std::string> missingDictionaries;
520  std::set<std::string> consumedTypesWithMissingDictionaries;
521 
522  if (productTypesConsumed) {
523  // Check dictionaries for all classes declared to be consumed
524  for (auto const& consumedTypeID : *productTypesConsumed) {
525  // We use the containedTypeMap to see which types have already
526  // had their dictionaries checked. We do not waste time rechecking
527  // those dictionaries.
528  if (containedTypeMap.find(consumedTypeID) == containedTypeMap.end()) {
529  std::string wrappedName = wrappedClassName(consumedTypeID.className());
530  TypeWithDict wrappedType = TypeWithDict::byName(wrappedName);
531  if (!checkDictionary(missingDictionaries, wrappedName, wrappedType)) {
532  checkDictionary(missingDictionaries, consumedTypeID);
533  consumedTypesWithMissingDictionaries.emplace(consumedTypeID.className());
534  continue;
535  }
536  bool transient = false;
537  TDictAttributeMap* wp = wrappedType.getClass()->GetAttributeMap();
538  if (wp && wp->HasKey("persistent") && !strcmp(wp->GetPropertyAsString("persistent"), "false")) {
539  transient = true;
540  }
541  if (transient) {
542  if (!checkDictionary(missingDictionaries, consumedTypeID)) {
543  consumedTypesWithMissingDictionaries.emplace(consumedTypeID.className());
544  }
545 
547  TypeID(wrappedType.typeInfo()), consumedTypeID.className());
548  bool hasContainedType = (containedTypeID != TypeID(typeid(void)) && containedTypeID != TypeID());
549  if (hasContainedType) {
550  if (containedTypeToBaseTypesMap.find(containedTypeID) == containedTypeToBaseTypesMap.end()) {
551  std::vector<TypeWithDict> bases;
552  // Run this to check for missing dictionaries, bases is not really used
553  if (!public_base_classes(missingDictionaries, containedTypeID, bases)) {
554  consumedTypesWithMissingDictionaries.emplace(consumedTypeID.className());
555  }
556  containedTypeToBaseTypesMap.insert(std::make_pair(containedTypeID, bases));
557  }
558  }
559  } else {
560  if (!checkClassDictionaries(missingDictionaries, wrappedName, wrappedType)) {
561  consumedTypesWithMissingDictionaries.emplace(consumedTypeID.className());
562  }
563  }
564  }
565  }
566  if (!missingDictionaries.empty()) {
567  std::string context(
568  "Calling ProductRegistry::initializeLookupTables, checking dictionaries for consumed products");
569  throwMissingDictionariesException(missingDictionaries, context, consumedTypesWithMissingDictionaries, false);
570  }
571  }
572 
573  if (elementTypesConsumed) {
574  missingDictionaries.clear();
575  consumedTypesWithMissingDictionaries.clear();
576  for (auto const& consumedTypeID : *elementTypesConsumed) {
577  if (containedTypeToBaseTypesMap.find(consumedTypeID) == containedTypeToBaseTypesMap.end()) {
578  std::vector<TypeWithDict> bases;
579  // Run this to check for missing dictionaries, bases is not really used
580  if (!public_base_classes(missingDictionaries, consumedTypeID, bases)) {
581  consumedTypesWithMissingDictionaries.emplace(consumedTypeID.className());
582  }
583  }
584  }
585  if (!missingDictionaries.empty()) {
586  std::string context(
587  "Calling ProductRegistry::initializeLookupTables, checking dictionaries for elements of products consumed "
588  "using View");
589  throwMissingDictionariesException(missingDictionaries, context, consumedTypesWithMissingDictionaries, true);
590  }
591  }
592  }
593 
595  std::string const* processName) const {
596  if (processName && !desc.produced() && (*processName == desc.processName())) {
597  throw Exception(errors::Configuration, "Duplicate Process Name.\n")
598  << "The process name " << *processName << " was previously used for products in the input.\n"
599  << "Please modify the configuration file to use a distinct process name.\n"
600  << "Alternately, drop all input products using that process name and the\n"
601  << "descendants of those products.\n";
602  }
603  }
604 
606  std::map<BranchID, ProductResolverIndex>::const_iterator itFind = transient_.branchIDToIndex_.find(iID);
607  if (itFind == transient_.branchIDToIndex_.end()) {
609  }
610  return itFind->second;
611  }
612 
613  std::vector<std::string> ProductRegistry::aliasToModules(KindOfType kindOfType,
614  TypeID const& type,
615  std::string_view moduleLabel,
616  std::string_view productInstanceName) const {
617  auto aliasFields = [](auto const& item) {
618  return std::tie(std::get<Transients::kKind>(item),
619  std::get<Transients::kType>(item),
620  std::get<Transients::kModuleLabel>(item),
621  std::get<Transients::kProductInstanceName>(item));
622  };
623  auto const target = std::tuple(kindOfType, type, moduleLabel, productInstanceName);
624  auto found =
627  target,
628  [aliasFields](auto const& item, auto const& target) { return aliasFields(item) < target; });
629  std::vector<std::string> ret;
630  for (; found != transient_.aliasToOriginal_.end() and aliasFields(*found) == target; ++found) {
631  ret.emplace_back(std::get<Transients::kAliasForModuleLabel>(*found));
632  }
633  return ret;
634  }
635 
636  void ProductRegistry::print(std::ostream& os) const {
637  for (auto const& product : productList_) {
638  os << product.second << "\n-----\n";
639  }
640  }
641 
643  return transient_.nextIndexValues_[branchType];
644  }
645 
647  return transient_.nextIndexValues_[branchType];
648  }
649 } // namespace edm
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:542
edm::TypeWithDict::byName
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:74
ProductResolverIndexHelper.h
edm::ProductRegistry::checkDictionariesOfConsumedTypes
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)
Definition: ProductRegistry.cc:514
edm::ProductResolverIndex
unsigned int ProductResolverIndex
Definition: ProductResolverIndex.h:8
mps_fire.i
i
Definition: mps_fire.py:428
edm::throwMissingDictionariesException
void throwMissingDictionariesException(std::vector< std::string > &missingDictionaries, std::string const &context)
Definition: DictionaryTools.cc:193
edm::ProductRegistry::indexFrom
ProductResolverIndex indexFrom(BranchID const &iID) const
Definition: ProductRegistry.cc:605
edm::ProductRegistry::allBranchNames
std::vector< std::string > allBranchNames() const
Definition: ProductRegistry.cc:189
funct::false
false
Definition: Factorize.h:29
cms::Exception::addContext
void addContext(std::string const &context)
Definition: Exception.cc:165
edm::ProductRegistry::transient_
Transients transient_
Definition: ProductRegistry.h:191
edm::PRODUCT_TYPE
Definition: ProductKindOfType.h:5
edm::ProductRegistry::setFrozen
void setFrozen(bool initializeLookupInfo=true)
Definition: ProductRegistry.cc:153
edm::ProductRegistry::Transients::productLookups_
std::array< edm::propagate_const< std::shared_ptr< ProductResolverIndexHelper > >, NumBranchTypes > productLookups_
Definition: ProductRegistry.h:151
edm::sort_all
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
Definition: Algorithms.h:92
bd
deep_tau::DeepTauBase::BasicDiscriminator bd
Definition: DeepTauId.cc:1082
edm::errors::LogicError
Definition: EDMException.h:37
pfClustersFromHGC3DClusters_cfi.wp
wp
Definition: pfClustersFromHGC3DClusters_cfi.py:20
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ProductRegistry::size
ProductList::size_type size() const
Definition: ProductRegistry.h:109
deep_tau::DeepTauBase::BasicDiscriminator
BasicDiscriminator
Definition: DeepTauBase.h:115
edm::ProductRegistry::checkForDuplicateProcessName
void checkForDuplicateProcessName(BranchDescription const &desc, std::string const *processName) const
Definition: ProductRegistry.cc:594
callgraph.previous
previous
Definition: callgraph.py:62
Algorithms.h
edm::ProductRegistry::updateFromInput
void updateFromInput(ProductList const &other)
Definition: ProductRegistry.cc:209
cms::cuda::assert
assert(be >=bs)
TypeID.h
edm::ProductRegistry::productLookup
std::shared_ptr< ProductResolverIndexHelper const > productLookup(BranchType branchType) const
Definition: ProductRegistry.cc:145
edm::ProductRegistry::Transients::nextIndexValues_
std::array< ProductResolverIndex, NumBranchTypes > nextIndexValues_
Definition: ProductRegistry.h:153
edm::combinable
bool combinable(BranchDescription const &a, BranchDescription const &b)
Definition: BranchDescription.cc:340
TypeWithDict.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::ProductRegistry::getNextIndexValue
ProductResolverIndex const & getNextIndexValue(BranchType branchType) const
Definition: ProductRegistry.cc:642
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
edm::BranchDescription::Strict
Definition: BranchDescription.h:36
edm::checkDictionaryOfWrappedType
bool checkDictionaryOfWrappedType(std::vector< std::string > &missingDictionaries, TypeID const &unwrappedTypeID)
Definition: DictionaryTools.cc:80
edm::ProductRegistry::print
void print(std::ostream &os) const
Definition: ProductRegistry.cc:636
newFWLiteAna.found
found
Definition: newFWLiteAna.py:118
edm::productholderindexhelper::getContainedTypeFromWrapper
TypeID getContainedTypeFromWrapper(TypeID const &wrappedtypeID, std::string const &className)
Definition: ProductResolverIndexHelper.cc:19
edm::BranchType
BranchType
Definition: BranchType.h:11
edm::checkClassDictionaries
bool checkClassDictionaries(std::vector< std::string > &missingDictionaries, TypeID const &typeID)
Definition: DictionaryTools.cc:102
edm::Exception
Definition: EDMException.h:77
edm::ProductRegistry
Definition: ProductRegistry.h:37
EDMException.h
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::ProductRegistry::Transients::aliasToOriginal_
AliasToOriginalVector aliasToOriginal_
Definition: ProductRegistry.h:159
edm::ProductRegistry::anyProducts
bool anyProducts(BranchType const brType) const
Definition: ProductRegistry.cc:135
edm::BranchDescription::processName
std::string const & processName() const
Definition: BranchDescription.h:73
edm::BranchID
Definition: BranchID.h:14
dumpMFGeometry_cfg.prod
prod
Definition: dumpMFGeometry_cfg.py:24
edm::ProductRegistry::Transients::Transients
Transients()
Definition: ProductRegistry.cc:34
edm::BranchDescription::unwrappedTypeID
TypeID unwrappedTypeID() const
Definition: BranchDescription.h:98
edm::BranchDescription::MatchMode
MatchMode
Definition: BranchDescription.h:36
trackingPlots.other
other
Definition: trackingPlots.py:1460
edm::InEvent
Definition: BranchType.h:11
dqmdumpme.k
k
Definition: dqmdumpme.py:60
edm::ProductRegistry::throwIfFrozen
void throwIfFrozen() const
Definition: ProductRegistry.cc:173
edm::ProductRegistry::addProduct
void addProduct(BranchDescription const &productdesc, bool iFromListener=false)
Definition: ProductRegistry.cc:68
edm::ProductRegistry::throwIfNotFrozen
void throwIfNotFrozen() const
Definition: ProductRegistry.cc:180
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ProductRegistry::copyProduct
void copyProduct(BranchDescription const &productdesc)
Definition: ProductRegistry.cc:122
edm::ProductRegistry::Transients::branchIDToIndex_
std::map< BranchID, ProductResolverIndex > branchIDToIndex_
Definition: ProductRegistry.h:155
pfDeepBoostedJetPreprocessParams_cfi.lower_bound
lower_bound
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:15
edm::ProductRegistry::ProductList
std::map< BranchKey, BranchDescription > ProductList
Definition: ProductRegistry.h:39
edm::ProductRegistry::Transients::reset
void reset()
Definition: ProductRegistry.cc:48
edm::TypeWithDict
Definition: TypeWithDict.h:38
edm::TypeWithDict::typeInfo
std::type_info const & typeInfo() const
Definition: TypeWithDict.cc:357
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
jetUpdater_cfi.sort
sort
Definition: jetUpdater_cfi.py:29
edm::ProductResolverIndexInvalid
Definition: ProductResolverIndex.h:16
edm::ProductRegistry::Transients::AliasToOriginalVector
std::vector< std::tuple< KindOfType, TypeID, std::string, std::string, std::string > > AliasToOriginalVector
Definition: ProductRegistry.h:158
edm::ProductRegistry::ProductRegistry
ProductRegistry()
Definition: ProductRegistry.cc:32
edm::ProductRegistry::allBranchDescriptions
std::vector< BranchDescription const * > allBranchDescriptions() const
Definition: ProductRegistry.cc:199
edm::BranchDescription::branchType
BranchType const & branchType() const
Definition: BranchDescription.h:122
edm::ProductRegistry::addLabelAlias
void addLabelAlias(BranchDescription const &productdesc, std::string const &labelAlias, std::string const &instanceAlias)
Definition: ProductRegistry.cc:108
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
edm::wrappedClassName
std::string wrappedClassName(std::string const &iFullName)
Definition: WrappedClassName.cc:4
edm::BranchDescription::produced
bool produced() const
Definition: BranchDescription.h:82
edm::ProductRegistry::productList_
ProductList productList_
Definition: ProductRegistry.h:190
edm::ProductRegistry::setProductProduced
void setProductProduced(BranchType branchType)
Definition: ProductRegistry.h:163
SimL1EmulatorRepack_CalouGT_cff.processName
processName
Definition: SimL1EmulatorRepack_CalouGT_cff.py:17
edm::TypeID::className
std::string const & className() const
Definition: TypeID.cc:40
edm::ProductRegistry::initializeLookupTables
void initializeLookupTables(std::set< TypeID > const *productTypesConsumed, std::set< TypeID > const *elementTypesConsumed, std::string const *processName)
Definition: ProductRegistry.cc:295
WrappedClassName.h
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
edm::TypeID
Definition: TypeID.h:22
edm::ProductRegistry::productList
ProductList const & productList() const
Definition: ProductRegistry.h:76
edm::KindOfType
KindOfType
Definition: ProductKindOfType.h:5
edm::match
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)
Definition: BranchDescription.cc:351
edm::public_base_classes
bool public_base_classes(std::vector< std::string > &missingDictionaries, TypeID const &typeID, std::vector< TypeWithDict > &baseTypes)
Definition: DictionaryTools.cc:319
edm::ELEMENT_TYPE
Definition: ProductKindOfType.h:5
edm::BranchDescription::moduleLabel
std::string const & moduleLabel() const
Definition: BranchDescription.h:72
edm::ProductRegistry::addCalled
virtual void addCalled(BranchDescription const &, bool iFromListener)
Definition: ProductRegistry.cc:187
Exception
Definition: hltDiff.cc:245
edm::eventsetup::heterocontainer::insert
bool insert(Storage &iStorage, ItemType *iItem, const IdTag &iIdTag)
Definition: HCMethods.h:50
edm::BranchID::isValid
bool isValid() const
Definition: BranchID.h:22
edm::ProductRegistry::aliasToModules
std::vector< std::string > aliasToModules(KindOfType kindOfType, TypeID const &type, std::string_view moduleLabel, std::string_view productInstanceName) const
Definition: ProductRegistry.cc:613
edm::ProductRegistry::frozen
bool frozen() const
Definition: ProductRegistry.h:140
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
filterCSVwithJSON.target
target
Definition: filterCSVwithJSON.py:32
edm::BranchDescription
Definition: BranchDescription.h:32
edm::checkDictionary
bool checkDictionary(std::vector< std::string > &missingDictionaries, TypeID const &typeID)
Definition: DictionaryTools.cc:67
mps_fire.result
result
Definition: mps_fire.py:311
edm::ProductRegistry::nextIndexValue
ProductResolverIndex & nextIndexValue(BranchType branchType)
Definition: ProductRegistry.cc:646
genParticles_cff.map
map
Definition: genParticles_cff.py:11
edm::ProductRegistry::merge
std::string merge(ProductRegistry const &other, std::string const &fileName, BranchDescription::MatchMode branchesMustMatch=BranchDescription::Permissive)
Definition: ProductRegistry.cc:250
edm::ProductRegistry::addElementTypesForAliases
void addElementTypesForAliases(std::set< TypeID > const *elementTypesConsumed, std::map< TypeID, TypeID > const &containedTypeMap, std::map< TypeID, std::vector< TypeWithDict >> const &containedTypeToBaseTypesMap)
Definition: ProductRegistry.cc:465
HerwigMaxPtPartonFilter_cfi.moduleLabel
moduleLabel
Definition: HerwigMaxPtPartonFilter_cfi.py:4
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
DictionaryTools.h
edm::BranchDescription::branchID
BranchID const & branchID() const
Definition: BranchDescription.h:74
edm::ProductRegistry::freezeIt
void freezeIt(bool frozen=true)
Definition: ProductRegistry.h:168
edm::ProductRegistry::setUnscheduledProducts
void setUnscheduledProducts(std::set< std::string > const &unscheduledLabels)
Definition: ProductRegistry.cc:221
edm::errors::Configuration
Definition: EDMException.h:36
edm::BranchKey
Definition: BranchKey.h:17
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37