LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
HLTPathStatus.cc
Go to the documentation of this file.
2 // vim: set sw=2 expandtab :
3 
5 #include "cetlib/pow.h"
6 
7 #include <cassert>
8 #include <cstddef>
9 #include <cstdint>
10 
11 namespace {
12  constexpr auto path_size [[maybe_unused]] = cet::pow<14, size_t>(2);
13 }
14 
15 namespace art {
16 
18  HLTPathStatus::HLTPathStatus() = default;
19 
21  : HLTPathStatus{state, 0}
22  {}
23 
25  : status_{
26  static_cast<std::uint16_t>(index << 2 | static_cast<size_t>(state))}
27  {
28  assert(state < hlt::HLTState::N_STATES);
29  assert(index < path_size);
30  }
31 
34  {
35  return static_cast<hlt::HLTState>(status_ & 0x03);
36  }
37 
38  unsigned
40  {
41  return static_cast<unsigned>(status_ >> 2);
42  }
43 
44  void
46  {
47  status_ = 0;
48  }
49 
50  bool
52  {
53  return state() != hlt::Ready;
54  }
55 
56  bool
58  {
59  return !wasrun() || (state() == hlt::Pass);
60  }
61 
62  bool
64  {
65  return state() == hlt::Exception;
66  }
67 
68 } // namespace art
bool error() const
bool wasrun() const
HLTState
Definition: HLTenums.h:6
unsigned int index() const
bool accept() const
Definition: MVAAlg.h:12
std::uint16_t status_
Definition: HLTPathStatus.h:58
hlt::HLTState state() const