Skip to content

Commit

Permalink
Disable ROOT automatic class parsing while checking for missing dicti…
Browse files Browse the repository at this point in the history
…onaries
  • Loading branch information
fwyzard committed Dec 10, 2024
1 parent 48600da commit 5d0a065
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
3 changes: 2 additions & 1 deletion DataFormats/Provenance/interface/ProductRegistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ namespace edm {

void setFrozen(std::set<TypeID> const& productTypesConsumed,
std::set<TypeID> const& elementTypesConsumed,
std::string const& processName);
std::string const& processName,
bool disableRootAutoParsing = false);

void setUnscheduledProducts(std::set<std::string> const& unscheduledLabels);

Expand Down
16 changes: 12 additions & 4 deletions DataFormats/Provenance/src/ProductRegistry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@

#include "DataFormats/Provenance/interface/ProductResolverIndexHelper.h"

#include "FWCore/Reflection/interface/DictionaryTools.h"
#include "FWCore/Reflection/interface/SetClassParsing.h"
#include "FWCore/Reflection/interface/TypeWithDict.h"
#include "FWCore/Utilities/interface/Algorithms.h"
#include "FWCore/Utilities/interface/EDMException.h"
#include "FWCore/Reflection/interface/DictionaryTools.h"
#include "FWCore/Utilities/interface/TypeID.h"
#include "FWCore/Reflection/interface/TypeWithDict.h"
#include "FWCore/Utilities/interface/WrappedClassName.h"

#include "TDictAttributeMap.h"
Expand Down Expand Up @@ -162,11 +163,18 @@ namespace edm {

void ProductRegistry::setFrozen(std::set<TypeID> const& productTypesConsumed,
std::set<TypeID> const& elementTypesConsumed,
std::string const& processName) {
std::string const& processName,
bool disableRootAutoParsing) {
if (frozen())
return;
freezeIt();
initializeLookupTables(&productTypesConsumed, &elementTypesConsumed, &processName);
if (disableRootAutoParsing) {
// disable ROOT automatic class parsing while checking for missing dictionaries
edm::SetClassParsing guard(false);
initializeLookupTables(&productTypesConsumed, &elementTypesConsumed, &processName);
} else {
initializeLookupTables(&productTypesConsumed, &elementTypesConsumed, &processName);
}
sort_all(transient_.aliasToOriginal_);
}

Expand Down
2 changes: 1 addition & 1 deletion FWCore/Framework/src/Schedule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ namespace edm {
}
// The RandomNumberGeneratorService is not a module, yet it consumes.
{ RngEDConsumer rngConsumer = RngEDConsumer(productTypesConsumed); }
preg.setFrozen(productTypesConsumed, elementTypesConsumed, processConfiguration->processName());
preg.setFrozen(productTypesConsumed, elementTypesConsumed, processConfiguration->processName(), true);
}

for (auto& c : all_output_communicators_) {
Expand Down
2 changes: 1 addition & 1 deletion FWCore/Framework/test/productregistry.cppunit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ void testProductRegistry::testAddAlias() {
simpleVecBranch_->unwrappedTypeID(),
simpleDerivedVecBranch_->unwrappedTypeID()};
std::set<edm::TypeID> elementTypesConsumed{intBranch_->unwrappedTypeID(), edm::TypeID(typeid(edmtest::Simple))};
reg.setFrozen(productTypesConsumed, elementTypesConsumed, "TEST");
reg.setFrozen(productTypesConsumed, elementTypesConsumed, "TEST", true);
{
auto notFound = reg.aliasToModules(edm::PRODUCT_TYPE, intBranch_->unwrappedTypeID(), "alias", "instance");
CPPUNIT_ASSERT(notFound.empty());
Expand Down

0 comments on commit 5d0a065

Please sign in to comment.