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 private:
20 
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 {
28  produces<edm::ValueMap<bool> >();
29 }
30 
31 template<typename ObjType,typename ObjCollType>
33 {
35  desc.add<edm::InputTag>("objs", edm::InputTag(""));
36  desc.add<std::string>("selection","et > 5");
37  descriptions.add("hltDQMObjSelector", desc);
38 }
39 
40 template<typename ObjType,typename ObjCollType>
42 {
44  event.getByToken(token_,handle);
45 
46  if(!handle.isValid()) return;
47 
48  std::vector<bool> selResults;
49  for(auto& obj : *handle){
50  selResults.push_back(selection_(obj));
51  }
52  auto valMap = std::make_unique<edm::ValueMap<bool> >();
54  filler.insert(handle, selResults.begin(), selResults.end());
55  filler.fill();
56  event.put(std::move(valMap));
57 }
58 
59 
void produce(edm::Event &, edm::EventSetup const &) override
HLTDQMObjSelector(const edm::ParameterSet &config)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
def setup(process, global_tag, zero_tesla=False)
Definition: GeneralSetup.py:1
Definition: config.py:1
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool isValid() const
Definition: HandleBase.h:74
StringCutObjectSelector< ObjType, true > selection_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HLT enums.
edm::EDGetTokenT< ObjCollType > token_
def move(src, dest)
Definition: eostools.py:510
Definition: event.py:1