CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
edm::detail::TriggerResultsBasedEventSelector Class Reference

#include <TriggerResultsBasedEventSelector.h>

Public Types

typedef detail::handle_t handle_t
 
typedef std::pair< std::string, std::string > parsed_path_spec_t
 
typedef std::vector< NamedEventSelectorselectors_t
 

Public Member Functions

unsigned int numberOfTokens () const
 
void setup (std::vector< parsed_path_spec_t > const &path_specs, std::vector< std::string > const &triggernames, std::string const &process_name, ConsumesCollector &&iC)
 
void setupDefault ()
 
EDGetToken token (unsigned int index) const
 
 TriggerResultsBasedEventSelector ()
 
bool wantEvent (EventForOutput const &e)
 

Private Attributes

selectors_t selectors_
 
bool wantAllEvents_
 

Detailed Description

Definition at line 47 of file TriggerResultsBasedEventSelector.h.

Member Typedef Documentation

Definition at line 50 of file TriggerResultsBasedEventSelector.h.

typedef std::pair<std::string, std::string> edm::detail::TriggerResultsBasedEventSelector::parsed_path_spec_t

Definition at line 52 of file TriggerResultsBasedEventSelector.h.

Definition at line 51 of file TriggerResultsBasedEventSelector.h.

Constructor & Destructor Documentation

edm::detail::TriggerResultsBasedEventSelector::TriggerResultsBasedEventSelector ( )

Member Function Documentation

unsigned int edm::detail::TriggerResultsBasedEventSelector::numberOfTokens ( ) const
inline
void edm::detail::TriggerResultsBasedEventSelector::setup ( std::vector< parsed_path_spec_t > const &  path_specs,
std::vector< std::string > const &  triggernames,
std::string const &  process_name,
ConsumesCollector &&  iC 
)

Definition at line 118 of file TriggerResultsBasedEventSelector.cc.

References eostools::move(), callgraph::path, and selectors_.

Referenced by edm::detail::configureEventSelector().

121  {
122  // paths_for_process maps each PROCESS names to a sequence of
123  // PATH names
124  std::map<std::string, std::vector<std::string> > paths_for_process;
125  for (auto const& path_spec : path_specs) {
126  // Default to current process if none specified
127  if (path_spec.second.empty()) {
128  paths_for_process[process_name].push_back(path_spec.first);
129  } else {
130  paths_for_process[path_spec.second].push_back(path_spec.first);
131  }
132  }
133  // Now go through all the PROCESS names, and create a
134  // NamedEventSelector for each.
135  for (auto const& path : paths_for_process) {
136  // For the current process we know the trigger names
137  // from the configuration file
138  if (path.first == process_name) {
139  selectors_.emplace_back(path.first, EventSelector(path.second, triggernames), std::move(iC));
140  } else {
141  // For previous processes we do not know the trigger
142  // names yet.
143  selectors_.emplace_back(path.first, EventSelector(path.second), std::move(iC));
144  }
145  }
146  }
A selector of events.
Definition: EventSelector.h:16
def move(src, dest)
Definition: eostools.py:511
void edm::detail::TriggerResultsBasedEventSelector::setupDefault ( )
EDGetToken edm::detail::TriggerResultsBasedEventSelector::token ( unsigned int  index) const
inline
bool edm::detail::TriggerResultsBasedEventSelector::wantEvent ( EventForOutput const &  e)

Definition at line 148 of file TriggerResultsBasedEventSelector.cc.

References edm::OccurrenceForOutput::getByToken(), cmsBatch::handle, edm::match(), selectors_, and wantAllEvents_.

Referenced by edm::SubProcess::doEventAsync().

148  {
149  if (wantAllEvents_) {
150  return true;
151  }
152  for (auto& selector : selectors_) {
154  ev.getByToken<TriggerResults>(selector.token(), handle);
155  bool match = selector.match(*handle);
156  if (match) {
157  return true;
158  }
159  }
160  return false;
161  }
bool ev
std::string match(BranchDescription const &a, BranchDescription const &b, std::string const &fileName)

Member Data Documentation

selectors_t edm::detail::TriggerResultsBasedEventSelector::selectors_
private

Definition at line 67 of file TriggerResultsBasedEventSelector.h.

Referenced by setup(), and wantEvent().

bool edm::detail::TriggerResultsBasedEventSelector::wantAllEvents_
private

Definition at line 68 of file TriggerResultsBasedEventSelector.h.

Referenced by setupDefault(), and wantEvent().