EventSelector.h
Go to the documentation of this file.
1 #ifndef art_Framework_Core_EventSelector_h
2 #define art_Framework_Core_EventSelector_h
3 // vim: set sw=2 expandtab :
4 
9 
10 #include <memory>
11 #include <string>
12 #include <vector>
13 
14 namespace art {
15  class EventSelector {
16  public:
17  EventSelector(std::vector<std::string> const& pathspecs,
18  std::vector<std::string> const& trigger_path_names);
19  explicit EventSelector(std::vector<std::string> const& pathspecs);
20 
21  bool wantAll() const;
22  bool acceptEvent(TriggerResults const&);
23  std::shared_ptr<TriggerResults> maskTriggerResults(
24  TriggerResults const& inputResults);
25 
26  private:
27  struct BitInfo {
28  BitInfo(unsigned const pos, bool const state)
29  : pos_{pos}, accept_state_{state}
30  {}
31  unsigned int pos_{};
32  bool accept_state_{false};
33  };
34 
35  void init(std::vector<std::string> const& paths,
36  std::vector<std::string> const& triggernames);
37  bool acceptOneBit(std::vector<BitInfo> const&,
38  HLTGlobalStatus const&,
39  hlt::HLTState const& s = hlt::Ready) const;
40  bool acceptAllBits(std::vector<BitInfo> const&,
41  HLTGlobalStatus const&) const;
42  bool containsExceptions(HLTGlobalStatus const&) const;
43  bool selectionDecision(HLTGlobalStatus const&) const;
44 
45  static std::vector<std::vector<std::string>::const_iterator>
46  matching_triggers(std::vector<std::string> const& trigs,
47  std::string const&);
48  static bool identical(std::vector<bool> const&, std::vector<bool> const&);
49  static bool identical(EventSelector const&,
50  EventSelector const&,
51  unsigned int);
52  static std::vector<bool> expandDecisionList(std::vector<BitInfo> const&,
53  bool PassOrFail,
54  unsigned int);
55  static bool overlapping(std::vector<bool> const&, std::vector<bool> const&);
56  static bool subset(std::vector<bool> const&, std::vector<bool> const&);
57  static std::vector<bool> combine(std::vector<bool> const&,
58  std::vector<bool> const&);
59 
60  bool accept_all_{false};
61  std::vector<BitInfo> absolute_acceptors_{};
62  std::vector<BitInfo> conditional_acceptors_{};
63  std::vector<BitInfo> exception_acceptors_{};
64  std::vector<std::vector<BitInfo>> all_must_fail_{};
65  std::vector<std::vector<BitInfo>> all_must_fail_noex_{};
67  bool psetID_initialized_{false};
69  std::vector<std::string> pathspecs_{};
71  bool notStarPresent_{false};
72  };
73 
74 } // namespace art
75 
76 #endif /* art_Framework_Core_EventSelector_h */
77 
78 // Local Variables:
79 // mode: c++
80 // End:
static std::vector< bool > expandDecisionList(std::vector< BitInfo > const &, bool PassOrFail, unsigned int)
void init(std::vector< std::string > const &paths, std::vector< std::string > const &triggernames)
static bool identical(std::vector< bool > const &, std::vector< bool > const &)
std::vector< std::vector< BitInfo > > all_must_fail_noex_
Definition: EventSelector.h:65
EventSelector(std::vector< std::string > const &pathspecs, std::vector< std::string > const &trigger_path_names)
HLTState
Definition: HLTenums.h:6
std::vector< BitInfo > exception_acceptors_
Definition: EventSelector.h:63
std::vector< std::vector< BitInfo > > all_must_fail_
Definition: EventSelector.h:64
bool containsExceptions(HLTGlobalStatus const &) const
static bool subset(std::vector< bool > const &, std::vector< bool > const &)
const XML_Char * s
Definition: expat.h:262
static bool overlapping(std::vector< bool > const &, std::vector< bool > const &)
bool force_results_from_current_process_
Definition: EventSelector.h:66
bool selectionDecision(HLTGlobalStatus const &) const
BitInfo(unsigned const pos, bool const state)
Definition: EventSelector.h:28
std::shared_ptr< TriggerResults > maskTriggerResults(TriggerResults const &inputResults)
static std::vector< bool > combine(std::vector< bool > const &, std::vector< bool > const &)
std::vector< std::string > pathspecs_
Definition: EventSelector.h:69
static std::vector< std::vector< std::string >::const_iterator > matching_triggers(std::vector< std::string > const &trigs, std::string const &)
std::vector< BitInfo > absolute_acceptors_
Definition: EventSelector.h:61
Service to store calibration data products (CDP) in the SQLite3 metadatabase of a file...
Definition: FillParentInfo.h:8
bool wantAll() const
bool acceptOneBit(std::vector< BitInfo > const &, HLTGlobalStatus const &, hlt::HLTState const &s=hlt::Ready) const
std::vector< BitInfo > conditional_acceptors_
Definition: EventSelector.h:62
bool acceptAllBits(std::vector< BitInfo > const &, HLTGlobalStatus const &) const
fhicl::ParameterSetID psetID_
Definition: EventSelector.h:68
bool acceptEvent(TriggerResults const &)
enum BeamMode string