LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
art::detail::ProcessAndEventSelectors Class Reference

#include "ProcessAndEventSelectors.h"

Public Member Functions

 ProcessAndEventSelectors (std::vector< std::pair< std::string, std::string >> const &path_specs, std::string const &process_name)
 
bool matchEvent (ScheduleID const id, Event const &e) const
 
art::Handle< art::TriggerResultsgetOneTriggerResults (Event const &) const
 

Private Attributes

std::vector< ProcessAndEventSelectorsel_ {}
 

Detailed Description

Definition at line 30 of file ProcessAndEventSelectors.h.

Constructor & Destructor Documentation

art::detail::ProcessAndEventSelectors::ProcessAndEventSelectors ( std::vector< std::pair< std::string, std::string >> const &  path_specs,
std::string const &  process_name 
)

Definition at line 43 of file ProcessAndEventSelectors.cc.

References art::detail::path_specs().

46  {
47  // Turn the passed path specs into a map of process name to
48  // a vector of trigger names.
49  map<string, vector<string>> paths_for_process;
50  for (auto const& [proc_name, path_names] : path_specs) {
51  auto const& pname = proc_name.empty() ? process_name : proc_name;
52  paths_for_process[pname].push_back(path_names);
53  }
54  // Now go through all the process names found, and create an event
55  // selector for each one.
56  for (auto const& [pname, paths] : paths_for_process) {
57  sel_.emplace_back(pname, EventSelector{paths});
58  }
59  }
std::vector< ProcessAndEventSelector > sel_

Member Function Documentation

Handle< TriggerResults > art::detail::ProcessAndEventSelectors::getOneTriggerResults ( Event const &  ev) const

Definition at line 71 of file ProcessAndEventSelectors.cc.

72  {
73  for (auto& val : sel_) {
74  if (auto h = val.triggerResults(ev); h.isValid()) {
75  return h;
76  }
77  }
78  return Handle<TriggerResults>{};
79  }
std::vector< ProcessAndEventSelector > sel_
bool art::detail::ProcessAndEventSelectors::matchEvent ( ScheduleID const  id,
Event const &  e 
) const

Definition at line 62 of file ProcessAndEventSelectors.cc.

References util::begin(), util::empty(), and util::end().

64  {
65  assert(not empty(sel_));
66  return std::any_of(
67  begin(sel_), end(sel_), [id, &e](auto& val) { return val.match(id, e); });
68  }
std::vector< ProcessAndEventSelector > sel_
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:69
Float_t e
Definition: plot.C:35
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:109

Member Data Documentation

std::vector<ProcessAndEventSelector> art::detail::ProcessAndEventSelectors::sel_ {}
private

Definition at line 40 of file ProcessAndEventSelectors.h.


The documentation for this class was generated from the following files: