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), token_(iC.consumes<TriggerResults>(inputTag_)), eventSelector_(s) {}
34 
35  bool match(TriggerResults const& product) { return eventSelector_.acceptEvent(product); }
36 
37  InputTag const& inputTag() const { return inputTag_; }
38 
39  EDGetTokenT<TriggerResults> const& token() const { return token_; }
40 
41  private:
45  };
46 
48  public:
51  typedef std::vector<NamedEventSelector> selectors_t;
52  typedef std::pair<std::string, std::string> parsed_path_spec_t;
53 
54  void setupDefault();
55 
56  void setup(std::vector<parsed_path_spec_t> const& path_specs,
57  std::vector<std::string> const& triggernames,
58  std::string const& process_name,
59  ConsumesCollector&& iC);
60 
61  bool wantEvent(EventForOutput const& e);
62 
63  unsigned int numberOfTokens() const { return selectors_.size(); }
64  EDGetToken token(unsigned int index) const { return selectors_[index].token(); }
65 
66  private:
67  selectors_t selectors_;
69  };
70 
74  bool configureEventSelector(edm::ParameterSet const& iPSet,
75  std::string const& iProcessName,
76  std::vector<std::string> const& iAllTriggerNames,
78  ConsumesCollector&& iC);
83  edm::ParameterSet const& iInitial,
84  std::string const& iLabel,
85  std::map<std::string, std::vector<std::pair<std::string, int> > > const& outputModulePathPositions,
86  bool anyProductProduced);
87 
88  } // namespace detail
89 } // namespace edm
90 
91 #endif
NamedEventSelector(std::string const &n, EventSelector const &s, ConsumesCollector &&iC)
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:2
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)