@@ -121,7 +121,6 @@ namespace edm {
121121 std::unique_ptr<InputSource> makeInput (unsigned int moduleIndex,
122122 ParameterSet& params,
123123 CommonParams const & common,
124- std::shared_ptr<SignallingProductRegistry> preg,
125124 std::shared_ptr<BranchIDListHelper> branchIDListHelper,
126125 std::shared_ptr<ProcessBlockHelper> const & processBlockHelper,
127126 std::shared_ptr<ThinnedAssociationsHelper> thinnedAssociationsHelper,
@@ -166,7 +165,6 @@ namespace edm {
166165 moduleIndex);
167166
168167 InputSourceDescription isdesc (md,
169- preg,
170168 branchIDListHelper,
171169 processBlockHelper,
172170 thinnedAssociationsHelper,
@@ -182,8 +180,7 @@ namespace edm {
182180 // even if we have an exception, send the signal
183181 std::shared_ptr<int > sentry (nullptr , [areg, &md](void *) { areg->postSourceConstructionSignal_ (md); });
184182 convertException::wrap ([&]() {
185- input = std::unique_ptr<InputSource>(
186- InputSourceFactory::get ()->makeInputSource (*main_input, *preg, isdesc).release ());
183+ input = InputSourceFactory::get ()->makeInputSource (*main_input, isdesc);
187184 input->preEventReadFromSourceSignal_ .connect (std::cref (areg->preEventReadFromSourceSignal_ ));
188185 input->postEventReadFromSourceSignal_ .connect (std::cref (areg->postEventReadFromSourceSignal_ ));
189186 });
@@ -489,7 +486,6 @@ namespace edm {
489486 tbb::task_group group;
490487
491488 // initialize the input source
492- auto tempReg = std::make_shared<SignallingProductRegistry>();
493489 auto sourceID = ModuleDescription::getUniqueID ();
494490
495491 group.run ([&, this ]() {
@@ -500,12 +496,11 @@ namespace edm {
500496 items.initModules (*parameterSet, tns, preallocations_, &processContext_, moduleTypeResolverMaker_.get ());
501497 });
502498
503- group.run ([&, this , tempReg ]() {
499+ group.run ([&, this ]() {
504500 ServiceRegistry::Operate operate (serviceToken_);
505501 input_ = makeInput (sourceID,
506502 *parameterSet,
507503 *common,
508- /* items.preg(),*/ tempReg,
509504 items.branchIDListHelper (),
510505 get_underlying_safe (processBlockHelper_),
511506 items.thinnedAssociationsHelper (),
@@ -515,9 +510,7 @@ namespace edm {
515510 });
516511
517512 group.wait ();
518- items.preg ()->addFromInput (*tempReg);
519- input_->switchTo (items.preg ());
520-
513+ items.preg ()->addFromInput (input_->productRegistry ());
521514 {
522515 auto const & tns = ServiceRegistry::instance ().get <service::TriggerNamesService>();
523516 schedule_ = items.finishSchedule (std::move (*madeModules),
@@ -726,7 +719,7 @@ namespace edm {
726719 espController_->finishConfiguration ();
727720 actReg_->eventSetupConfigurationSignal_ (esp_->recordsToResolverIndices (), processContext_);
728721 try {
729- convertException::wrap ([&]() { input_->doBeginJob (); });
722+ convertException::wrap ([&]() { input_->doBeginJob (*preg_ ); });
730723 } catch (cms::Exception& ex) {
731724 ex.addContext (" Calling beginJob for the source" );
732725 throw ;
@@ -1014,7 +1007,6 @@ namespace edm {
10141007
10151008 void EventProcessor::readFile () {
10161009 FDEBUG (1 ) << " \t readFile\n " ;
1017- size_t size = preg_->size ();
10181010 SendSourceTerminationSignalIfException sentry (actReg_.get ());
10191011
10201012 if (streamRunActive_ > 0 ) {
@@ -1027,6 +1019,9 @@ namespace edm {
10271019 }
10281020
10291021 fb_ = input_->readFile ();
1022+ // incase the input's registry changed
1023+ const size_t size = preg_->size ();
1024+ preg_->merge (input_->productRegistry (), fb_ ? fb_->fileName () : std::string ());
10301025 if (size < preg_->size ()) {
10311026 principalCache_.adjustIndexesAfterProductRegistryAddition ();
10321027 }
0 commit comments