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:
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
edm::detail::TriggerResultsBasedEventSelector::selectors_t
std::vector< NamedEventSelector > selectors_t
Definition: TriggerResultsBasedEventSelector.h:51
Handle.h
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
edm::EDGetTokenT< TriggerResults >
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::detail::TriggerResultsBasedEventSelector::wantAllEvents_
bool wantAllEvents_
Definition: TriggerResultsBasedEventSelector.h:68
detail
Definition: ConvertingESProducerWithDependenciesT.h:23
edm::Handle< edm::TriggerResults >
edm::EventSelector
Definition: EventSelector.h:35
edm::detail::TriggerResultsBasedEventSelector::token
EDGetToken token(unsigned int index) const
Definition: TriggerResultsBasedEventSelector.h:64
edm::detail::NamedEventSelector::eventSelector_
EventSelector eventSelector_
Definition: TriggerResultsBasedEventSelector.h:44
EventSelector.h
edm::detail::TriggerResultsBasedEventSelector::TriggerResultsBasedEventSelector
TriggerResultsBasedEventSelector()
Definition: TriggerResultsBasedEventSelector.cc:114
edm::detail::NamedEventSelector::token_
EDGetTokenT< TriggerResults > token_
Definition: TriggerResultsBasedEventSelector.h:43
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::detail::TriggerResultsBasedEventSelector::selectors_
selectors_t selectors_
Definition: TriggerResultsBasedEventSelector.h:67
EventPrincipal.h
edm::detail::TriggerResultsBasedEventSelector::parsed_path_spec_t
std::pair< std::string, std::string > parsed_path_spec_t
Definition: TriggerResultsBasedEventSelector.h:52
edm::detail::TriggerResultsBasedEventSelector::setupDefault
void setupDefault()
Definition: TriggerResultsBasedEventSelector.cc:116
edm::Hash
Definition: Hash.h:43
EDGetToken.h
edm::detail::NamedEventSelector::match
bool match(TriggerResults const &product)
Definition: TriggerResultsBasedEventSelector.h:35
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
edm::detail::TriggerResultsBasedEventSelector::wantEvent
bool wantEvent(EventForOutput const &e)
Definition: TriggerResultsBasedEventSelector.cc:148
edm::detail::NamedEventSelector::inputTag_
InputTag inputTag_
Definition: TriggerResultsBasedEventSelector.h:42
edm::detail::TriggerResultsBasedEventSelector
Definition: TriggerResultsBasedEventSelector.h:47
edm::detail::NamedEventSelector::token
EDGetTokenT< TriggerResults > const & token() const
Definition: TriggerResultsBasedEventSelector.h:39
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
edm::detail::handle_t
edm::Handle< edm::TriggerResults > handle_t
Definition: TriggerResultsBasedEventSelector.h:28
edm::detail::TriggerResultsBasedEventSelector::setup
void setup(std::vector< parsed_path_spec_t > const &path_specs, std::vector< std::string > const &triggernames, std::string const &process_name, ConsumesCollector &&iC)
Definition: TriggerResultsBasedEventSelector.cc:118
edm::EDGetToken
Definition: EDGetToken.h:35
edm::EventSelector::acceptEvent
bool acceptEvent(TriggerResults const &)
Definition: EventSelector.cc:245
InputTag.h
edm::detail::configureEventSelector
bool configureEventSelector(edm::ParameterSet const &iPSet, std::string const &iProcessName, std::vector< std::string > const &iAllTriggerNames, edm::detail::TriggerResultsBasedEventSelector &oSelector, ConsumesCollector &&iC)
Definition: TriggerResultsBasedEventSelector.cc:80
edm::EventForOutput
Definition: EventForOutput.h:50
edm::detail::registerProperSelectionInfo
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)
Definition: TriggerResultsBasedEventSelector.cc:163
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
edm::detail::TriggerResultsBasedEventSelector::handle_t
detail::handle_t handle_t
Definition: TriggerResultsBasedEventSelector.h:50
ConsumesCollector.h
genParticles_cff.map
map
Definition: genParticles_cff.py:11
edm::detail::NamedEventSelector::inputTag
InputTag const & inputTag() const
Definition: TriggerResultsBasedEventSelector.h:37
HLTObjectsMonitor_cfi.TriggerResults
TriggerResults
Definition: HLTObjectsMonitor_cfi.py:9
edm::detail::TriggerResultsBasedEventSelector::numberOfTokens
unsigned int numberOfTokens() const
Definition: TriggerResultsBasedEventSelector.h:63
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
edm::TriggerResults
Definition: TriggerResults.h:35
edm::detail::NamedEventSelector::NamedEventSelector
NamedEventSelector(std::string const &n, EventSelector const &s, ConsumesCollector &&iC)
Definition: TriggerResultsBasedEventSelector.h:32
edm::detail::NamedEventSelector
Definition: TriggerResultsBasedEventSelector.h:30
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37