CMS 3D CMS Logo

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 
22 
23 namespace edm {
24  class EventForOutput;
25  class TriggerResults;
26 
27  namespace detail {
29 
31  public:
33  inputTag_("TriggerResults", "", n),
34  token_(iC.consumes<TriggerResults>(inputTag_)),
36  { }
37 
38  bool match(TriggerResults const& product) {
39  return eventSelector_.acceptEvent(product);
40  }
41 
42  InputTag const& inputTag() const {
43  return inputTag_;
44  }
45 
47  return token_;
48  }
49  private:
53  };
54 
56  public:
59  typedef std::vector<NamedEventSelector> selectors_t;
60  typedef std::pair<std::string, std::string> parsed_path_spec_t;
61 
62  void setupDefault();
63 
64  void setup(std::vector<parsed_path_spec_t> const& path_specs,
65  std::vector<std::string> const& triggernames,
66  std::string const& process_name,
67  ConsumesCollector&& iC);
68 
69  bool wantEvent(EventForOutput const& e);
70 
71  unsigned int numberOfTokens() const { return selectors_.size();}
72  EDGetToken token(unsigned int index) const {return selectors_[index].token();}
73  private:
74  selectors_t selectors_;
76  };
77 
81  bool configureEventSelector(edm::ParameterSet const& iPSet,
82  std::string const& iProcessName,
83  std::vector<std::string> const& iAllTriggerNames,
85  ConsumesCollector&& iC);
90  std::string const& iLabel,
91  std::map<std::string, std::vector<std::pair<std::string, int> > > const& outputModulePathPositions,
92  bool anyProductProduced);
93 
94  }
95 }
96 
97 #endif
NamedEventSelector(std::string const &n, EventSelector const &s, ConsumesCollector &&iC)
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
EDGetTokenT< TriggerResults > const & token() const
bool match(TriggerResults const &product)
bool acceptEvent(TriggerResults const &)
bool configureEventSelector(edm::ParameterSet const &iPSet, std::string const &iProcessName, std::vector< std::string > const &iAllTriggerNames, edm::detail::TriggerResultsBasedEventSelector &oSelector, ConsumesCollector &&iC)
std::pair< std::string, std::string > parsed_path_spec_t
HLT enums.
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)