CMS 3D CMS Logo

HLTDQMObjSelector.cc
Go to the documentation of this file.
10 
11 template <typename ObjType, typename ObjCollType>
13 public:
15  void produce(edm::Event&, edm::EventSetup const&) override;
16  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
17 
18 private:
21 };
22 
23 template <typename ObjType, typename ObjCollType>
25  : token_(consumes<ObjCollType>(config.getParameter<edm::InputTag>("objs"))),
26  selection_(config.getParameter<std::string>("selection")) {
27  produces<edm::ValueMap<bool> >();
28 }
29 
30 template <typename ObjType, typename ObjCollType>
33  desc.add<edm::InputTag>("objs", edm::InputTag(""));
34  desc.add<std::string>("selection", "et > 5");
35  descriptions.add("hltDQMObjSelector", desc);
36 }
37 
38 template <typename ObjType, typename ObjCollType>
41  event.getByToken(token_, handle);
42 
43  if (!handle.isValid())
44  return;
45 
46  std::vector<bool> selResults;
47  for (auto& obj : *handle) {
48  selResults.push_back(selection_(obj));
49  }
50  auto valMap = std::make_unique<edm::ValueMap<bool> >();
52  filler.insert(handle, selResults.begin(), selResults.end());
53  filler.fill();
54  event.put(std::move(valMap));
55 }
56 
void produce(edm::Event &, edm::EventSetup const &) override
HLTDQMObjSelector(const edm::ParameterSet &config)
Definition: config.py:1
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HLT enums.
StringCutObjectSelector< ObjType, true > selection_
edm::EDGetTokenT< ObjCollType > token_
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1