Classes | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
art::Observer Class Reference

#include <Observer.h>

Inheritance diagram for art::Observer:
art::ModuleBase art::detail::Analyzer art::OutputModule art::EDAnalyzer art::ReplicatedAnalyzer art::SharedAnalyzer art::FileDumperOutput art::ProvenanceCheckerOutput art::ProvenanceDumper< DETAIL, Enable > art::ProvenanceDumper< DETAIL, std::void_t< typename DETAIL::Config > > art::test::PMTestOutput arttest::EventProcessorTestOutput

Classes

struct  EOConfig
 

Public Member Functions

 ~Observer () noexcept
 
 Observer (Observer const &)=delete
 
 Observer (Observer &&)=delete
 
Observeroperator= (Observer const &)=delete
 
Observeroperator= (Observer &&)=delete
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
void fillDescriptions (ModuleDescription const &)
 
fhicl::ParameterSetID selectorConfig () const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Protected Member Functions

std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &select_paths, std::vector< std::string > const &reject_paths, fhicl::ParameterSet const &config)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Private Attributes

bool wantAllEvents_
 
std::string process_name_
 
std::optional< detail::ProcessAndEventSelectorsselectors_
 
std::optional< detail::ProcessAndEventSelectorsrejectors_
 
fhicl::ParameterSetID selector_config_id_
 

Detailed Description

Definition at line 20 of file Observer.h.

Constructor & Destructor Documentation

art::Observer::~Observer ( )
defaultnoexcept
art::Observer::Observer ( Observer const &  )
delete
art::Observer::Observer ( Observer &&  )
delete
art::Observer::Observer ( fhicl::ParameterSet const &  config)
explicitprotected

Definition at line 43 of file Observer.cc.

44  : Observer{pset.get<vector<string>>("SelectEvents", {}),
45  pset.get<vector<string>>("RejectEvents", {}),
46  pset}
47  {}
Observer(Observer const &)=delete
art::Observer::Observer ( std::vector< std::string > const &  select_paths,
std::vector< std::string > const &  reject_paths,
fhicl::ParameterSet const &  config 
)
explicitprotected

Definition at line 49 of file Observer.cc.

52  : wantAllEvents_{empty(select_paths) and empty(reject_paths)}
54  , selectors_{make_selectors(select_paths, process_name_)}
55  , rejectors_{make_selectors(reject_paths, process_name_)}
56  , selector_config_id_{pset.id()}
57  {}
bool wantAllEvents_
Definition: Observer.h:82
std::string process_name_
Definition: Observer.h:83
fhicl::ParameterSetID selector_config_id_
Definition: Observer.h:90
std::string const & processName() const
Definition: Globals.cc:48
std::optional< detail::ProcessAndEventSelectors > rejectors_
Definition: Observer.h:87
static Globals * instance()
Definition: Globals.cc:17
std::optional< detail::ProcessAndEventSelectors > selectors_
Definition: Observer.h:86
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
Definition: StdUtils.h:97

Member Function Documentation

void art::Observer::fillDescriptions ( ModuleDescription const &  )

Definition at line 64 of file Observer.cc.

65  {}
Handle< TriggerResults > art::Observer::getTriggerResults ( Event const &  e) const
protected

Definition at line 92 of file Observer.cc.

93  {
94  if (selectors_) {
95  return selectors_->getOneTriggerResults(e);
96  }
97 
98  // The following applies for cases where no SelectEvents entries
99  // exist.
100  Handle<TriggerResults> h;
101  if (e.get(empty_process_name, h)) {
102  return h;
103  }
104  return Handle<TriggerResults>{};
105  }
const double e
std::optional< detail::ProcessAndEventSelectors > selectors_
Definition: Observer.h:86
Observer& art::Observer::operator= ( Observer const &  )
delete
Observer& art::Observer::operator= ( Observer &&  )
delete
string const & art::Observer::processName ( ) const
protected

Definition at line 68 of file Observer.cc.

69  {
70  return process_name_;
71  }
std::string process_name_
Definition: Observer.h:83
void art::Observer::registerProducts ( ProductDescriptions ,
ModuleDescription const &   
)

Definition at line 60 of file Observer.cc.

61  {}
fhicl::ParameterSetID art::Observer::selectorConfig ( ) const

Definition at line 86 of file Observer.cc.

87  {
88  return selector_config_id_;
89  }
fhicl::ParameterSetID selector_config_id_
Definition: Observer.h:90
bool art::Observer::wantAllEvents ( ) const
inlineprotectednoexcept

Definition at line 37 of file Observer.h.

38  {
39  return wantAllEvents_;
40  }
bool wantAllEvents_
Definition: Observer.h:82
bool art::Observer::wantEvent ( ScheduleID  id,
Event const &  e 
) const
protected

Definition at line 74 of file Observer.cc.

75  {
76  if (wantAllEvents_) {
77  return true;
78  }
79  bool const select_event = selectors_ ? selectors_->matchEvent(id, e) : true;
80  bool const reject_event =
81  rejectors_ ? rejectors_->matchEvent(id, e) : false;
82  return select_event and not reject_event;
83  }
bool wantAllEvents_
Definition: Observer.h:82
const double e
std::optional< detail::ProcessAndEventSelectors > rejectors_
Definition: Observer.h:87
std::optional< detail::ProcessAndEventSelectors > selectors_
Definition: Observer.h:86

Member Data Documentation

std::string art::Observer::process_name_
private

Definition at line 83 of file Observer.h.

std::optional<detail::ProcessAndEventSelectors> art::Observer::rejectors_
private

Definition at line 87 of file Observer.h.

fhicl::ParameterSetID art::Observer::selector_config_id_
private

Definition at line 90 of file Observer.h.

std::optional<detail::ProcessAndEventSelectors> art::Observer::selectors_
private

Definition at line 86 of file Observer.h.

bool art::Observer::wantAllEvents_
private

Definition at line 82 of file Observer.h.


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