CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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> >();
51  edm::ValueMap<bool>::Filler filler(*valMap);
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)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
def move
Definition: eostools.py:511
tuple handle
Definition: patZpeak.py:23
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool isValid() const
Definition: HandleBase.h:70
void add(std::string const &label, ParameterSetDescription const &psetDescription)
tuple config
parse the configuration file
StringCutObjectSelector< ObjType, true > selection_
edm::EDGetTokenT< ObjCollType > token_