23 using namespace fhicl;
33 return [id](
art::PathSpec const& spec) {
return spec.path_id == id; };
46 "An error occurred while retrieving the trigger paths for process '" +
47 process_name +
"'.\n"};
54 auto const spec_strs =
55 trigger_paths_pset.
get<std::vector<std::string>>(
"trigger_paths");
59 std::vector<std::vector<std::string>> module_names;
60 for (
auto const& spec_str : specs) {
61 trigger_path_names.push_back(spec_str.name);
62 module_names.push_back(physics_pset.
get<vector<string>>(spec_str.name));
64 return {
move(specs),
move(trigger_path_names),
move(module_names)};
70 TriggerNamesService::TriggerNamesService(
74 dataPerProcess_.try_emplace(
75 getProcessName(), data_for_process(trigger_paths_pset, physics_pset));
79 TriggerNamesService::currentData_()
const 81 return dataPerProcess_.at(getProcessName());
87 TriggerNamesService::triggerResults(
Event const&
e,
91 if (not e.
getByLabel(
"TriggerResults",
"", process_name, h)) {
92 throw lookup_exception(process_name) << *h.
whyFailed();
97 std::map<std::string, HLTPathStatus>
98 TriggerNamesService::pathResults(
Event const&
e,
101 auto const& tr = triggerResults(e, process_name);
103 process_name ==
"current_process" ? getProcessName() : process_name;
105 auto it = dataPerProcess_.find(process_name);
106 if (it ==
cend(dataPerProcess_)) {
109 throw lookup_exception(pname)
110 <<
"Could not locate process configuration for the process '" << pname
112 <<
"This can happen if the ParameterSets were dropped on input.\n" 113 <<
"Please contact artists@fnal.gov for guidance.\n";
118 auto data = data_for_process(trigger_pset,
120 it = dataPerProcess_.try_emplace(process_name,
std::move(data)).first;
123 auto const&
names = it->second.triggerPathNames;
126 std::map<std::string, HLTPathStatus>
result;
127 for (
size_t i = 0,
n = tr.size(); i !=
n; ++i) {
128 result.try_emplace(
names[i], tr.at(i));
136 TriggerNamesService::getProcessName()
const 141 vector<string>
const&
142 TriggerNamesService::getTrigPaths()
const 144 return currentData_().triggerPathNames;
148 TriggerNamesService::getTrigPath(
PathID const id)
const 150 auto const i = index_for(
id);
151 if (i == invalid_entry) {
153 <<
"A path name could not be found corresponding to path ID " 156 return currentData_().triggerPathSpecs[i].name;
159 vector<string>
const&
160 TriggerNamesService::getTrigPathModules(
string const&
name)
const 162 auto const& modules = currentData_().moduleNames;
163 return modules.at(index_(for_(name)));
166 vector<string>
const&
167 TriggerNamesService::getTrigPathModules(
PathID const id)
const 169 auto const& modules = currentData_().moduleNames;
170 return modules.at(index_for(
id));
174 TriggerNamesService::index_for(
PathID const id)
const 176 return index_(for_(
id));
182 auto const&
path_specs = currentData_().triggerPathSpecs;
186 auto it = std::find_if(
b,
e, matched_entry);
188 return invalid_entry;
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
decltype(auto) constexpr cend(T &&obj)
ADL-aware version of std::cend.
ProcessHistory const & processHistory() const
static collection_type const & get() noexcept
std::string to_string(Protection p)
std::function< bool(PathSpec const &)> entry_selector_t
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
std::vector< PathSpec > path_specs(std::vector< std::string > const &path_spec_strs)
T get(std::string const &key) const
Strings const trigger_path_names
double distance(double x1, double y1, double z1, double x2, double y2, double z2)
static int max(int a, int b)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::optional< ProcessConfiguration > getConfigurationForProcess(std::string const &name) const
std::string const & processName() const
art::TriggerNamesService::DataPerProcess DataPerProcess
std::shared_ptr< art::Exception const > whyFailed() const
std::vector< art::PathSpec > path_specs(std::vector< ModuleSpec > const &selection_override_entries, std::string const &path_selection_override)
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
static Globals * instance()
static std::vector< std::string > const names