LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
EventObserverBase.cc
Go to the documentation of this file.
2 
8 
9 #include <string>
10 #include <vector>
11 
12 using namespace std;
13 
15 
16 namespace art {
17 
18  EventObserverBase::EventObserverBase(vector<string> const& paths,
19  fhicl::ParameterSet const& pset)
20  : selector_config_id_{pset.id()}
21  {
22  init_(paths);
23  }
24 
26  : selector_config_id_{pset.id()}
27  {
28  auto const& paths = pset.get<vector<string>>("SelectEvents", {});
29  init_(paths);
30  }
31 
32  void
33  EventObserverBase::init_(vector<string> const& paths)
34  {
36  process_name_ = TNS->getProcessName();
37  vector<string> const& trigPaths = TNS->getTrigPaths();
38  if (paths.empty()) {
39  // No event selection criteria given, we want all events.
40  wantAllEvents_ = true;
41  selectors_.setupDefault(trigPaths);
42  return;
43  }
44  // Parse the event selection criteria into
45  // (process, trigger name list) pairs.
46  vector<pair<string, string>> PPS(paths.size());
47  for (size_t i = 0; i < paths.size(); ++i) {
48  detail::parse_path_spec(paths[i], PPS[i]);
49  }
50  selectors_.setup(PPS, trigPaths, process_name_);
51  }
52 
53 } // namespace art
detail::CachedProducts selectors_
STL namespace.
void init_(std::vector< std::string > const &paths)
void parse_path_spec(std::string path_spec, std::pair< std::string, std::string > &output)
void setup(std::vector< std::pair< std::string, std::string >> const &path_specs, std::vector< std::string > const &trigger_names, std::string const &process_name)
fhicl::ParameterSetID selector_config_id_
ParameterSetID id() const
HLT enums.
EventObserverBase(std::vector< std::string > const &paths, fhicl::ParameterSet const &config)
void setupDefault(std::vector< std::string > const &trigger_names)