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 
78  // Clear the cache
79  void clear();
80 
81  private:
82  typedef selectors_t::iterator iter;
83 
84  // Get all TriggerResults objects for the process names we're
85  // interested in.
87 
88  bool fillDone_;
91  };
92 
93  class TRBESSentry {
94  public:
97  p.clear();
98  }
99  private:
101 
102  TRBESSentry(TRBESSentry const&) = delete;
103  TRBESSentry& operator=(TRBESSentry const&) = delete;
104  };
105 
106 
110  bool configureEventSelector(edm::ParameterSet const& iPSet,
111  std::string const& iProcessName,
112  std::vector<std::string> const& iAllTriggerNames,
118  std::string const& iLabel,
119  std::map<std::string, std::vector<std::pair<std::string, int> > > const& outputModulePathPositions,
120  bool anyProductProduced);
121 
122  }
123 }
124 
125 #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
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)