TriggerNamesService.h
Go to the documentation of this file.
1 #ifndef art_Framework_Services_System_TriggerNamesService_h
2 #define art_Framework_Services_System_TriggerNamesService_h
3 // vim: set sw=2 expandtab :
4 
5 //
6 // TriggerNamesService
7 //
8 // This service makes the trigger names available. They are provided in
9 // the same order that the pass/fail status of these triggers is recorded
10 // in the TriggerResults object. These trigger names are the names of
11 // the paths that appear in the configuration (excluding end paths). The
12 // order is the same as in the configuration.
13 //
14 // There are also accessors for the end path names.
15 //
16 // There are other accessors for other trigger related information from
17 // the job configuration: the process name, whether a report on trigger
18 // results was requested and the parameter set containing the list of
19 // trigger paths.
20 //
21 // Almost all the functions return information related to the current
22 // process only. The second getTrigPaths function is an exception.
23 // It will return the trigger path names from previous processes.
24 //
25 
31 #include "fhiclcpp/fwd.h"
32 
33 #include <functional>
34 #include <string>
35 #include <vector>
36 
37 namespace art {
38  class ActivityRegistry;
39 
40  namespace detail {
41  using entry_selector_t = std::function<bool(PathSpec const&)>;
42  }
43 
45  public:
46  TriggerNamesService(fhicl::ParameterSet const& trigger_paths_pset,
47  fhicl::ParameterSet const& physics_pset);
48 
49  // For all processes
50  TriggerResults const& triggerResults(
51  Event const& e,
52  std::string const& process_name = "current_process") const;
53 
54  std::map<std::string, HLTPathStatus> pathResults(
55  Event const& e,
56  std::string const& process_name = "current_process") const;
57 
58  // Current process only
59  std::string const& getProcessName() const;
60  std::vector<std::string> const& getTrigPaths() const;
61  std::string const& getTrigPath(PathID const id) const;
62  PathID findTrigPath(std::string const& name) const;
63  std::vector<std::string> const& getTrigPathModules(
64  std::string const& name) const;
65  std::vector<std::string> const& getTrigPathModules(PathID id) const;
66 
67  // - Expert only
68  size_t index_for(PathID id) const;
69 
70  struct DataPerProcess {
71  std::vector<PathSpec> triggerPathSpecs{};
72  std::vector<std::string> triggerPathNames{};
73  std::vector<std::vector<std::string>> moduleNames{};
74  };
75 
76  private:
77  size_t index_(detail::entry_selector_t selector) const;
78  DataPerProcess const& currentData_() const;
79 
80  std::map<std::string, DataPerProcess> mutable dataPerProcess_;
81  };
82 
83 } // namespace art
84 
86 
87 #endif /* art_Framework_Services_System_TriggerNamesService_h */
88 
89 // Local Variables:
90 // mode: c++
91 // End:
static QCString name
Definition: declinfo.cpp:673
std::string string
Definition: nybbler.cc:12
std::function< bool(PathSpec const &)> entry_selector_t
const double e
#define DECLARE_ART_SYSTEM_SERVICE(svc, scope)
std::map< std::string, DataPerProcess > dataPerProcess_