@@ -31,16 +31,31 @@ art::SourceHelper::throwIfProductsNotRegistered_() const
3131}
3232
3333art::ProcessHistoryID
34- art::SourceHelper::processHistoryID_ (BranchType const bt,
35- ProcessConfiguration const & pc) const
34+ art::SourceHelper::updatedProcessHistoryID_ (
35+ ProcessHistoryID const & processHistoryID,
36+ BranchType const bt,
37+ ProcessConfiguration const & pc) const
3638{
37- art::ProcessHistory processHistory{};
3839 // If no products are present for this branch type, we do not
39- // register the process history.
40+ // update the process history.
4041 if (presentProducts_->descriptions (bt).empty ()) {
41- return processHistory. id () ;
42+ return processHistoryID ;
4243 }
4344
45+ art::ProcessHistory processHistory{};
46+ if (processHistoryID.isValid ()) {
47+ bool const found =
48+ ProcessHistoryRegistry::get (processHistoryID, processHistory);
49+ if (!found) {
50+ throw Exception (
51+ errors::LogicError,
52+ " Error while attempting to create principal from SourceHelper.\n " )
53+ << " The provided process-history ID\n "
54+ << " " << processHistory << ' \n '
55+ << " does not correspond to a known process history.\n "
56+ " Please contact artists@fnal.gov for guidance." ;
57+ }
58+ }
4459 processHistory.push_back (pc);
4560 auto const phid = processHistory.id ();
4661 art::ProcessHistoryRegistry::emplace (phid, processHistory);
@@ -60,8 +75,8 @@ art::SourceHelper::makePrincipal_(typename T::Auxiliary aux) const
6075{
6176 throwIfProductsNotRegistered_ ();
6277 constexpr auto branch_type = T::branch_type;
63- aux.setProcessHistoryID (
64- processHistoryID_ ( branch_type, md_.processConfiguration ()));
78+ aux.setProcessHistoryID (updatedProcessHistoryID_ (
79+ aux. processHistoryID (), branch_type, md_.processConfiguration ()));
6580 auto principal =
6681 new T{aux, md_.processConfiguration (), &presentProducts_->get (branch_type)};
6782 if (aux.processHistoryID ().isValid ()) {
0 commit comments