LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
EventPrincipal.cc
Go to the documentation of this file.
2 // vim: set sw=2:
3 
10 #include "cetlib/container_algorithms.h"
11 
12 #include <algorithm>
13 #include <utility>
14 
15 using namespace cet;
16 using namespace std;
17 
18 namespace art {
19 
20  EventPrincipal::EventPrincipal(
21  EventAuxiliary const& aux,
22  ProcessConfiguration const& pc,
23  cet::exempt_ptr<ProductTable const> presentProducts,
24  std::shared_ptr<History> history,
25  std::unique_ptr<BranchMapper>&& mapper,
26  std::unique_ptr<DelayedReader>&& rtrv,
27  bool const lastInSubRun)
28  : Principal{pc,
29  history->processHistoryID(),
30  presentProducts,
31  std::move(mapper),
32  std::move(rtrv)}
33  , aux_{aux}
34  , history_{history}
35  , lastInSubRun_{lastInSubRun}
36  {
38  cet::exempt_ptr<EDProductGetterFinder const>{this});
39  if (ProductMetaData::instance().productProduced(InEvent)) {
41  }
42  }
43 
44  SubRunPrincipal const&
46  {
47  if (!subRunPrincipal_) {
49  << "Tried to obtain a NULL subRunPrincipal.\n";
50  }
51  return *subRunPrincipal_;
52  }
53 
54  void
56  {
57  if (getGroup(pd.productID()) != nullptr) {
59  "EventPrincipal::throwIfExistingGroup")
60  << "Problem found while adding product provenance: "
61  << "product already exists for (" << pd.friendlyClassName() << ","
62  << pd.moduleLabel() << "," << pd.productInstanceName() << ","
63  << pd.processName() << "," << pd.branchType() << ")\n";
64  }
65  }
66 
67  void
69  {
73  }
74 
75  void
77  std::unique_ptr<EDProduct>&& edp,
78  BranchDescription const& pd,
79  std::unique_ptr<ProductProvenance const>&& productProvenance)
80  {
81  assert(edp);
82  branchMapper().insert(std::move(productProvenance));
85  pd, pd.productID(), RangeSet::invalid(), std::move(edp)));
86  }
87 
90  {
91  return history_->eventSelectionIDs();
92  }
93 
94 } // namespace art
SubRunPrincipal const & subRunPrincipal() const
void setGroupFinder(cet::exempt_ptr< EDProductGetterFinder const > ep)
Definition: DelayedReader.h:38
void put(std::unique_ptr< EDProduct > &&edp, BranchDescription const &pd, std::unique_ptr< ProductProvenance const > &&productProvenance)
EventAuxiliary aux_
void throwIfExistingGroup(BranchDescription const &pd) const
EventSelectionIDVector const & eventSelectionIDs() const
EventAuxiliary const & aux() const
STL namespace.
cet::exempt_ptr< Group const > getGroup(ProductID const pid) const
Definition: Principal.cc:525
History const & history() const
DelayedReader & productReader()
Definition: Principal.h:198
std::vector< EventSelectionID > EventSelectionIDVector
void addToProcessHistory()
Definition: Principal.cc:80
BranchMapper const & branchMapper() const
Definition: Principal.h:144
static ProductMetaData const & instance()
cet::exempt_ptr< SubRunPrincipal const > subRunPrincipal_
std::string const & moduleLabel() const
result_t insert(std::unique_ptr< ProductProvenance const > &&)
Definition: BranchMapper.cc:24
BranchType branchType() const
ProductID productID() const
virtual void fillGroup(BranchDescription const &)=0
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
void fillGroup(BranchDescription const &) override
static RangeSet invalid()
Definition: RangeSet.cc:46
std::string const & productInstanceName() const
HLT enums.
std::string const & processName() const
std::shared_ptr< History > history_
std::string const & friendlyClassName() const
std::unique_ptr< Group > make_group(BranchDescription const &, ProductID const &, RangeSet &&)
Definition: GroupFactory.h:44