CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
< NamedEventSelector
selectors_t
 

Public Member Functions

void setup (std::vector< parsed_path_spec_t > const &path_specs, std::vector< std::string > const &triggernames, const std::string &process_name)
 
void setupDefault (std::vector< std::string > const &triggernames)
 
 TriggerResultsBasedEventSelector ()
 
bool wantEvent (EventPrincipal const &e, ModuleCallingContext const *)
 

Private Attributes

selectors_t selectors_
 

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

void edm::detail::TriggerResultsBasedEventSelector::setup ( std::vector< parsed_path_spec_t > const &  path_specs,
std::vector< std::string > const &  triggernames,
const std::string &  process_name 
)

Definition at line 132 of file TriggerResultsBasedEventSelector.cc.

References fed_dqm_sourceclient-live_cfg::path, relval_parameters_module::process_name, and selectors_.

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

134  {
135  // paths_for_process maps each PROCESS names to a sequence of
136  // PATH names
137  std::map<std::string, std::vector<std::string> > paths_for_process;
138  for (auto const& path_spec : path_specs) {
139  // Default to current process if none specified
140  if (path_spec.second == "") {
141  paths_for_process[process_name].push_back(path_spec.first);
142  }
143  else {
144  paths_for_process[path_spec.second].push_back(path_spec.first);
145  }
146  }
147  // Now go through all the PROCESS names, and create a
148  // NamedEventSelector for each.
149  for (auto const& path : paths_for_process) {
150  // For the current process we know the trigger names
151  // from the configuration file
152  if (path.first == process_name) {
153  selectors_.emplace_back(path.first, EventSelector(path.second, triggernames));
154  } else {
155  // For previous processes we do not know the trigger
156  // names yet.
157  selectors_.emplace_back(path.first, EventSelector(path.second));
158  }
159  }
160  }
A selector of events.
Definition: EventSelector.h:16
void edm::detail::TriggerResultsBasedEventSelector::setupDefault ( std::vector< std::string > const &  triggernames)

Definition at line 122 of file TriggerResultsBasedEventSelector.cc.

References mergeAndRegister::paths, and selectors_.

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

122  {
123 
124  // Set up one NamedEventSelector, with default configuration
125  std::vector<std::string> paths;
126  EventSelector es(paths, triggernames);
127  selectors_.emplace_back("", es);
128  //selectors_.push_back(NES("", EventSelector("",triggernames)));
129  }
A selector of events.
Definition: EventSelector.h:16
bool edm::detail::TriggerResultsBasedEventSelector::wantEvent ( EventPrincipal const &  e,
ModuleCallingContext const *  mcc 
)

Definition at line 163 of file TriggerResultsBasedEventSelector.cc.

References edm::convert_handle(), edm::Principal::getByLabel(), h, edm::match(), eostools::move(), edm::PRODUCT_TYPE, s_TrigResultsType, and selectors_.

163  {
164  for(auto& selector : selectors_) {
165  edm::BasicHandle h = ev.getByLabel(PRODUCT_TYPE,
167  selector.inputTag(),
168  nullptr,
169  nullptr,
170  mcc);
171  handle_t product;
172  convert_handle(std::move(h), product);
173  bool match = selector.match(*product);
174  if(match) {
175  return true;
176  }
177  }
178  return false;
179  }
static const edm::TypeID s_TrigResultsType(typeid(edm::TriggerResults))
bool ev
def move
Definition: eostools.py:510
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
void convert_handle(BasicHandle &&bh, Handle< T > &result)
Definition: ConvertHandle.h:20
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 63 of file TriggerResultsBasedEventSelector.h.

Referenced by setup(), setupDefault(), and wantEvent().