LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Event.cc
Go to the documentation of this file.
2 // vim: set sw=2 expandtab :
3 
8 
9 namespace art {
10 
11  Event::~Event() = default;
12 
14  ModuleContext const& mc,
15  std::optional<ProductInserter> inserter)
16  : ProductRetriever{InEvent, ep, mc, inserter.has_value()}
17  , inserter_{std::move(inserter)}
18  , eventPrincipal_{ep}
19  , subRun_{ep.subRunPrincipal().makeSubRun(mc)}
20  {}
21 
22  EventID
23  Event::id() const
24  {
25  return eventPrincipal_.eventID();
26  }
27 
29  Event::run() const
30  {
31  return id().run();
32  }
33 
35  Event::subRun() const
36  {
37  return id().subRun();
38  }
39 
41  Event::event() const
42  {
43  return id().event();
44  }
45 
46  Timestamp
47  Event::time() const
48  {
49  return eventPrincipal_.time();
50  }
51 
52  bool
54  {
55  return eventPrincipal_.isReal();
56  }
57 
60  {
62  }
63 
64  ProcessHistoryID const&
66  {
68  }
69 
70  ProcessHistory const&
72  {
74  }
75 
76  SubRun const&
78  {
79  return subRun_;
80  }
81 
82  Run const&
83  Event::getRun() const
84  {
85  return getSubRun().getRun();
86  }
87 
88  void
90  {
91  assert(inserter_);
92  inserter_->commitProducts();
93  }
94 
95  void
97  bool const checkProducts,
98  std::map<TypeLabel, BranchDescription> const* expectedProducts)
99  {
100  assert(inserter_);
101  inserter_->commitProducts(
102  checkProducts, expectedProducts, ProductRetriever::retrievedPIDs());
103  }
104 
105 } // namespace art
SubRunNumber_t subRun() const
Definition: Event.cc:35
EventAuxiliary::ExperimentType ExperimentType() const
ProcessHistory const & processHistory() const
Definition: Event.cc:71
bool isRealData() const
Definition: Event.cc:53
bool isReal() const
RunNumber_t run() const
Definition: EventID.h:98
Timestamp const & time() const
Definition: Run.h:37
EventAuxiliary::ExperimentType experimentType() const
Definition: Event.cc:59
Run const & getRun() const
Definition: SubRun.cc:61
EventPrincipal const & eventPrincipal_
Definition: Event.h:96
ProcessHistoryID const & processHistoryID() const
Definition: Principal.h:148
EventID const & eventID() const
IDNumber_t< Level::SubRun > SubRunNumber_t
Definition: IDNumber.h:119
EventNumber_t event() const
Definition: Event.cc:41
Run const & getRun() const
Definition: Event.cc:83
ProcessHistory const & processHistory() const
Definition: Principal.cc:247
std::optional< ProductInserter > inserter_
Definition: Event.h:95
Event(EventPrincipal const &ep, ModuleContext const &mc, std::optional< ProductInserter > inserter=std::nullopt)
Definition: Event.cc:13
IDNumber_t< Level::Event > EventNumber_t
Definition: IDNumber.h:118
SubRun const subRun_
Definition: Event.h:97
Timestamp time() const
Definition: Event.cc:47
std::vector< ProductID > retrievedPIDs() const
Definition: MVAAlg.h:12
EventNumber_t event() const
Definition: EventID.h:116
ProcessHistoryID const & processHistoryID() const
Definition: Event.cc:65
RunNumber_t run() const
Definition: Event.cc:29
void commitProducts()
Definition: Event.cc:89
SubRun const & getSubRun() const
Definition: Event.cc:77
SubRunNumber_t subRun() const
Definition: EventID.h:110
EventID id() const
Definition: Event.cc:23
IDNumber_t< Level::Run > RunNumber_t
Definition: IDNumber.h:120