Event.cc
Go to the documentation of this file.
2 // vim: set sw=2 expandtab :
3 
7 
8 using namespace std;
9 using namespace fhicl;
10 
11 namespace art {
12 
13  namespace {
14 
15  // It only makes sense to track parents when putting a product onto
16  // the event. That requires a non-const Event object.
17  constexpr bool
18  record_parents(Event*)
19  {
20  return true;
21  }
22 
23  } // unnamed namespace
24 
25  Event::~Event() = default;
26 
28  : DataViewImpl{InEvent, ep, mc, record_parents(this), RangeSet::invalid()}
29  , subRun_{ep.subRunPrincipalPtr() ? new SubRun{ep.subRunPrincipal(), mc} :
30  nullptr}
31  {}
32 
33  EventID
34  Event::id() const
35  {
36  return DataViewImpl::eventID();
37  }
38 
39  SubRun const&
41  {
42  if (!subRun_) {
44  << "Tried to obtain a NULL subRun.\n";
45  }
46  return *subRun_;
47  }
48 
49  Run const&
50  Event::getRun() const
51  {
52  return getSubRun().getRun();
53  }
54 
55 } // namespace art
STL namespace.
EventID eventID() const
Definition: DataViewImpl.cc:64
Definition: Run.h:17
Run const & getRun() const
Definition: SubRun.cc:27
Run const & getRun() const
Definition: Event.cc:50
std::unique_ptr< SubRun const > const subRun_
Definition: Event.h:78
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
Definition: types.h:32
static RangeSet invalid()
Definition: RangeSet.cc:45
SubRun const & getSubRun() const
Definition: Event.cc:40
EventID id() const
Definition: Event.cc:34