Skip to content

Commit

Permalink
Merge pull request #18022 from wddgit/from-CMSSW_9_1_X_2017-03-20-2300
Browse files Browse the repository at this point in the history
Fix problem introduced by recent PR #17950 related to dropOnInput
  • Loading branch information
cmsbuild committed Mar 22, 2017
2 parents 1e88593 + 7132cfa commit c3b387a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 14 deletions.
5 changes: 3 additions & 2 deletions FWCore/Framework/interface/GetterOfProducts.h
Expand Up @@ -132,8 +132,9 @@ namespace edm {

void operator()(edm::BranchDescription const& branchDescription) {

if (branchDescription.unwrappedTypeID() == edm::TypeID(typeid(T)) &&
branchDescription.branchType() == branchType_) {
if (branchDescription.dropped()) return;
if (branchDescription.branchType() == branchType_ &&
branchDescription.unwrappedTypeID() == edm::TypeID(typeid(T))) {

auto const& token =matcher_(branchDescription);
if (not token.isUninitialized()) {
Expand Down
4 changes: 0 additions & 4 deletions FWCore/Integration/test/testRunMergeTEST11_cfg.py
Expand Up @@ -39,7 +39,6 @@
'm1', 'm2', 'm3',
'makeThingToBeDropped',
'makeThingToBeDropped1',
'makeThingToBeDropped2',
'thingWithMergeProducer',
'tryNoPut'
),
Expand All @@ -61,7 +60,6 @@
'm1', 'm2', 'm3',
'makeThingToBeDropped',
'makeThingToBeDropped1',
'makeThingToBeDropped2',
'thingWithMergeProducer',
'tryNoPut'
),
Expand All @@ -84,7 +82,6 @@
'm1','m1', 'm2','m2', 'm3','m3',
'makeThingToBeDropped','makeThingToBeDropped',
'makeThingToBeDropped1','makeThingToBeDropped1',
'makeThingToBeDropped2',
'thingWithMergeProducer','thingWithMergeProducer',
'tryNoPut','tryNoPut'
),
Expand All @@ -108,7 +105,6 @@
'm1','m1', 'm2','m2', 'm3','m3',
'makeThingToBeDropped','makeThingToBeDropped',
'makeThingToBeDropped1','makeThingToBeDropped1',
'makeThingToBeDropped2',
'thingWithMergeProducer','thingWithMergeProducer',
'tryNoPut','tryNoPut'
),
Expand Down
18 changes: 10 additions & 8 deletions IOPool/Input/src/RootFile.cc
Expand Up @@ -1749,15 +1749,17 @@ namespace edm {
for(ProductRegistry::ProductList::iterator it = prodList.begin(), itEnd = prodList.end(); it != itEnd;) {
BranchDescription const& prod = it->second;
bool drop = branchesToDrop.find(prod.branchID()) != branchesToDropEnd;
if(drop && !prod.dropped()) {
if(productSelector.selected(prod) && prod.unwrappedType() != typeid(ThinnedAssociation)) {
LogWarning("RootFile")
<< "Branch '" << prod.branchName() << "' is being dropped from the input\n"
<< "of file '" << file_ << "' because it is dependent on a branch\n"
<< "that was explicitly dropped.\n";
if(drop) {
if(!prod.dropped()) {
if(productSelector.selected(prod) && prod.unwrappedType() != typeid(ThinnedAssociation)) {
LogWarning("RootFile")
<< "Branch '" << prod.branchName() << "' is being dropped from the input\n"
<< "of file '" << file_ << "' because it is dependent on a branch\n"
<< "that was explicitly dropped.\n";
}
treePointers_[prod.branchType()]->dropBranch(newBranchToOldBranch(prod.branchName()));
hasNewlyDroppedBranch_[prod.branchType()] = true;
}
treePointers_[prod.branchType()]->dropBranch(newBranchToOldBranch(prod.branchName()));
hasNewlyDroppedBranch_[prod.branchType()] = true;
ProductRegistry::ProductList::iterator icopy = it;
++it;
prodList.erase(icopy);
Expand Down

0 comments on commit c3b387a

Please sign in to comment.