CMS 3D CMS Logo

L1Filter.cc
Go to the documentation of this file.
2 
6 
10 
13 
16 
19 
20 #include <iostream>
21 #include <string>
22 
23 class L1Filter : public edm::EDFilter {
24 public:
25  explicit L1Filter(edm::ParameterSet const &);
26 
27  ~L1Filter() override;
28 
29  bool filter(edm::Event &e, edm::EventSetup const &c) override;
30  void endJob() override;
31 
32 private:
36  std::vector<std::string> algos_;
37 };
38 
40  : inputTag_(ps.getParameter<edm::InputTag>("inputTag")),
41  useAODRecord_(ps.getParameter<bool>("useAODRecord")),
42  useFinalDecision_(ps.getParameter<bool>("useFinalDecision")),
43  algos_(ps.getParameter<std::vector<std::string>>("algorithms")) {}
44 
46 
48 
49  // get menu
51  evSetup.get<L1GtTriggerMenuRcd>().get(menuRcd);
52  const L1GtTriggerMenu *menu = menuRcd.product();
53 
54  bool passed = false;
55  std::vector<std::string>::const_iterator algo;
56 
57  if (useAODRecord_) {
59  iEvent.getByLabel(inputTag_, gtRecord);
60  const DecisionWord dWord = gtRecord->decisionWord();
61 
63  passed = gtRecord->decision();
64  else {
65  for (algo = algos_.begin(); algo != algos_.end(); ++algo) {
66  passed |= menu->gtAlgorithmResult((*algo), dWord);
67  }
68  }
69  } else {
71  iEvent.getByLabel(inputTag_, gtRecord);
72  const DecisionWord dWord = gtRecord->decisionWord();
73 
75  passed = gtRecord->decision();
76  else {
77  for (algo = algos_.begin(); algo != algos_.end(); ++algo) {
78  passed |= menu->gtAlgorithmResult((*algo), dWord);
79  }
80  }
81  }
82 
83  return passed;
84 }
85 
87 
89 
bool filter(edm::Event &e, edm::EventSetup const &c) override
Definition: L1Filter.cc:47
bool useFinalDecision_
Definition: L1Filter.cc:35
~L1Filter() override
Definition: L1Filter.cc:45
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
const bool decision() const
std::vector< bool > DecisionWord
typedefs
const bool decision(int bxInEventValue) const
const bool gtAlgorithmResult(const std::string &algName, const std::vector< bool > &decWord) const
void endJob() override
Definition: L1Filter.cc:86
bool useAODRecord_
Definition: L1Filter.cc:34
const DecisionWord decisionWord() const
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:480
const DecisionWord & decisionWord(int bxInEventValue) const
L1Filter(edm::ParameterSet const &)
Definition: L1Filter.cc:39
edm::InputTag inputTag_
Definition: L1Filter.cc:33
HLT enums.
T get() const
Definition: EventSetup.h:71
T const * product() const
Definition: ESHandle.h:86
std::vector< std::string > algos_
Definition: L1Filter.cc:36