Skip to content

Commit b34ea0a

Browse files
committed
SecondaryEventProvider builds module directly
Moved to building directly just like in the framework proper.
1 parent 9e65e5d commit b34ea0a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Mixing/Base/src/SecondaryEventProvider.cc

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "FWCore/Framework/interface/SignallingProductRegistryFiller.h"
99
#include "FWCore/Framework/interface/ModuleRegistry.h"
1010
#include "FWCore/Framework/interface/ModuleRegistryUtilities.h"
11+
#include "FWCore/Framework/interface/maker/MakeModuleParams.h"
1112
#include "FWCore/ParameterSet/interface/ParameterSet.h"
1213
#include "FWCore/Utilities/interface/StreamID.h"
1314
#include "FWCore/Utilities/interface/make_sentry.h"
@@ -68,8 +69,18 @@ namespace edm {
6869
const PreallocationConfiguration preallocConfig;
6970
for (auto& pset : psets) {
7071
std::string label = pset.getParameter<std::string>("@module_label");
71-
workerManager_.addToUnscheduledWorkers(
72-
pset, preg, &preallocConfig, processConfiguration, label, unscheduledLabels, shouldBeUsedLabels);
72+
MakeModuleParams params(&pset, preg, &preallocConfig, processConfiguration);
73+
auto module = moduleRegistry_->getModule(params,
74+
label,
75+
activityRegistry_->preModuleConstructionSignal_,
76+
activityRegistry_->postModuleConstructionSignal_);
77+
if (module->moduleType() != edm::maker::ModuleHolder::Type::kProducer or
78+
module->moduleType() != edm::maker::ModuleHolder::Type::kFilter) {
79+
throw edm::Exception(edm::errors::Configuration)
80+
<< "The module with label " << label << " is not an EDProducer or EDFilter so can not be run unscheduled";
81+
}
82+
workerManager_.addToUnscheduledWorkers(module->moduleDescription());
83+
unscheduledLabels.insert(label);
7384
}
7485
if (!unscheduledLabels.empty()) {
7586
preg.setUnscheduledProducts(unscheduledLabels);

0 commit comments

Comments
 (0)