LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
EventObserverBase.h
Go to the documentation of this file.
1 #ifndef art_Framework_Core_EventObserverBase_h
2 #define art_Framework_Core_EventObserverBase_h
3 
4 // Common base class for module which do not modify events, such as
5 // OutputModule and EDAnalyzer.
6 
13 
14 #include <string>
15 
16 namespace art {
17  class EventObserverBase;
18  class MasterProductRegistry;
19  class ModuleDescription;
20 }
21 
23 public:
24  bool
25  modifiesEvent() const
26  {
27  return false;
28  }
29 
30  // FIXME: One could obviate the need for this trivial implementation
31  // by putting some type logic in WorkerT.
32  void
35  ModuleDescription const&)
36  {}
37  //
38  // SelectEvents handling
39  //
40  std::string const&
41  processName() const
42  {
43  return process_name_;
44  }
45  bool
46  wantAllEvents() const
47  {
48  return wantAllEvents_;
49  }
50  bool
51  wantEvent(Event const& e)
52  {
53  return selectors_.wantEvent(e);
54  }
57  {
58  return selector_config_id_;
59  }
61  getTriggerResults(Event const& e) const
62  {
64  }
65 
66 protected:
67  struct EOConfig {
69  fhicl::Name("SelectEvents"),
70  fhicl::Comment("The following parameter is a user-provided list\n"
71  "of filter paths. The default list is empty."),
72  std::vector<std::string>{}};
73  };
74 
75  explicit EventObserverBase(std::vector<std::string> const& paths,
76  fhicl::ParameterSet const& config);
77  explicit EventObserverBase(fhicl::ParameterSet const& config);
80  {
81  return selectors_;
82  }
83 
84 private:
85  // True if no selectors configured.
86  bool wantAllEvents_{false};
87  // The process and event selectors, as specified by the SelectEvents
88  // configuration parameter.
90  std::string process_name_{};
91  // ID of the ParameterSet that configured the event selector
92  // subsystem.
94 
95  void init_(std::vector<std::string> const& paths);
96 };
97 
98 #endif /* art_Framework_Core_EventObserverBase_h */
99 
100 // Local Variables:
101 // mode: c++
102 // End:
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
bool wantEvent(Event const &e)
void init_(std::vector< std::string > const &paths)
std::vector< BranchDescription > ProductDescriptions
art::Handle< art::TriggerResults > getTriggerResults(Event const &e) const
fhicl::Sequence< std::string > selectEvents
fhicl::ParameterSetID selector_config_id_
detail::CachedProducts & cachedProducts()
fhicl::ParameterSetID selectorConfig() const
void registerProducts(MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
HLT enums.
EventObserverBase(std::vector< std::string > const &paths, fhicl::ParameterSet const &config)
Float_t e
Definition: plot.C:34
std::string const & processName() const
bool wantEvent(Event const &)