CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TriggerResultsBasedEventSelector.h
Go to the documentation of this file.
1 #ifndef FWCore_Framework_TriggerResultsBasedEventSelector_h
2 #define FWCore_Framework_TriggerResultsBasedEventSelector_h
3 
4 // -------------------------------------------------------------------
5 //
6 // TriggerResultsBasedEventSelector: This class is used by OutputModule to interact with
7 // the TriggerResults objects upon which the decision to write out an
8 // event is made.
9 //
10 // -------------------------------------------------------------------
11 #include <string>
12 #include <utility>
13 #include <vector>
14 #include <map>
15 
20 
21 namespace edm
22 {
23  class ModuleCallingContext;
24 
25  namespace detail
26  {
28 
30  {
31  public:
33  inputTag_("TriggerResults", "", n),
34  eventSelector_(s),
35  product_()
36  { }
37 
38  void fill(EventPrincipal const& e, ModuleCallingContext const* mcc);
39 
40  bool match()
41  {
43  }
44 
45  handle_t product() const
46  {
47  return product_;
48  }
49 
50  void clear()
51  {
52  product_ = handle_t();
53  }
54 
55  private:
59  };
60 
62  {
63  public:
66  typedef std::vector<NamedEventSelector> selectors_t;
68  typedef std::pair<std::string, std::string> parsed_path_spec_t;
69 
70  void setupDefault(std::vector<std::string> const& triggernames);
71 
72  void setup(std::vector<parsed_path_spec_t> const& path_specs,
73  std::vector<std::string> const& triggernames,
74  const std::string& process_name);
75 
76  bool wantEvent(EventPrincipal const& e, ModuleCallingContext const*);
77 
79 
80  // Clear the cache
81  void clear();
82 
83  private:
84  typedef selectors_t::iterator iter;
85 
86  // Get all TriggerResults objects for the process names we're
87  // interested in.
89 
90  // If we have only one handle cached, return it; otherwise throw.
92 
93 
94  bool fillDone_;
97  };
98 
99  class TRBESSentry {
100  public:
103  p.clear();
104  }
105  private:
107 
108  TRBESSentry(TRBESSentry const&) = delete;
109  TRBESSentry& operator=(TRBESSentry const&) = delete;
110  };
111 
112 
116  bool configureEventSelector(edm::ParameterSet const& iPSet,
117  std::string const& iProcessName,
118  std::vector<std::string> const& iAllTriggerNames,
124  std::string const& iLabel,
125  std::map<std::string, std::vector<std::pair<std::string, int> > > const& outputModulePathPositions,
126  bool anyProductProduced);
127 
128  }
129 }
130 
131 #endif
TRBESSentry & operator=(TRBESSentry const &)=delete
void fill(EventPrincipal const &e, ModuleCallingContext const *mcc)
bool ev
size_type fill(EventPrincipal const &ev, ModuleCallingContext const *)
uint16_t size_type
void setupDefault(std::vector< std::string > const &triggernames)
bool acceptEvent(TriggerResults const &)
void setup(std::vector< parsed_path_spec_t > const &path_specs, std::vector< std::string > const &triggernames, const std::string &process_name)
NamedEventSelector(std::string const &n, EventSelector const &s)
detail::TriggerResultsBasedEventSelector & p
handle_t getOneTriggerResults(EventPrincipal const &e, ModuleCallingContext const *)
std::pair< std::string, std::string > parsed_path_spec_t
bool wantEvent(EventPrincipal const &e, ModuleCallingContext const *)
edm::Handle< edm::TriggerResults > handle_t
ParameterSetID registerProperSelectionInfo(edm::ParameterSet const &iInitial, std::string const &iLabel, std::map< std::string, std::vector< std::pair< std::string, int > > > const &outputModulePathPositions, bool anyProductProduced)
bool configureEventSelector(edm::ParameterSet const &iPSet, std::string const &iProcessName, std::vector< std::string > const &iAllTriggerNames, edm::detail::TriggerResultsBasedEventSelector &oSelector)
TRBESSentry(detail::TriggerResultsBasedEventSelector &prods)