HLTPathStatus.h
Go to the documentation of this file.
1 #ifndef canvas_Persistency_Common_HLTPathStatus_h
2 #define canvas_Persistency_Common_HLTPathStatus_h
3 // vim: set sw=2 expandtab :
4 
5 //
6 // The status of a single HLT trigger (single trigger path consisting
7 // of modules on the path). Initially, the status is Ready (meaning
8 // that this trigger path has not run yet for this event). If all
9 // modules on the path pass (accept) the event, then the state is
10 // Pass. If any module on the path fails (rejects) the event, then
11 // the state of the whole trigger path is Fail. If any module on the
12 // path throws an unhandled error, then the trigger state is
13 // Exception. For the latter two cases, the Fw skips further
14 // processing of modules along this path, ie, path processing is
15 // aborted.
16 //
17 // The index of the module on the path, 0 to n-1 for a path with n
18 // modules issuing the decision for the path is recorded. For
19 // accepted events, this is simply the index of the last module on
20 // the path, ie, n-1.
21 //
22 // Note that n is limited, due to packing, to at most 2^(16-2)=16384.
23 //
24 
26 
27 #include <cstddef>
28 #include <cstdint>
29 
30 namespace art {
31  class HLTPathStatus {
32  public:
34  HLTPathStatus();
35  explicit HLTPathStatus(hlt::HLTState const state);
36  explicit HLTPathStatus(hlt::HLTState const state, std::size_t const index);
37 
38  // Get state of path.
39  hlt::HLTState state() const;
40  // Get index of module on path providing status.
41  // This will either be the index of the last module on the
42  // path, or the index of the module that rejected or threw.
43  unsigned int index() const;
44  // Reset this path.
45  void reset();
46  // Was this path run?
47  bool wasrun() const;
48  // Has this path accepted the event? If the path was not run, the
49  // answer is true.
50  bool accept() const;
51  // has this path encountered an error (exception)?
52  bool error() const;
53 
54  private:
55  // packed status of trigger path
56  // bits 15:2 (0-16383): index of module on path making path decision
57  // bits 1:0 (0-3): HLT state
58  std::uint16_t status_{hlt::Ready};
59  };
60 
61 } // namespace art
62 
63 #endif /* canvas_Persistency_Common_HLTPathStatus_h */
64 
65 // Local Variables:
66 // mode: c++
67 // End:
bool error() const
bool wasrun() const
HLTState
Definition: HLTenums.h:6
unsigned int index() const
bool accept() const
std::uint16_t status_
Definition: HLTPathStatus.h:58
hlt::HLTState state() const