File indexing completed on 2023-03-17 10:53:45
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #include <memory>
0022
0023
0024 #include "FWCore/Framework/interface/Frameworkfwd.h"
0025 #include "FWCore/Framework/interface/stream/EDFilter.h"
0026
0027 #include "FWCore/Framework/interface/Event.h"
0028 #include "FWCore/Framework/interface/MakerMacros.h"
0029
0030 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0031
0032 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
0033
0034
0035
0036
0037
0038 class HcalHPDFilter : public edm::stream::EDFilter<> {
0039 public:
0040 explicit HcalHPDFilter(const edm::ParameterSet&);
0041 ~HcalHPDFilter() override;
0042
0043 private:
0044 bool filter(edm::Event&, const edm::EventSetup&) override;
0045
0046
0047 };
0048
0049
0050
0051
0052 HcalHPDFilter::HcalHPDFilter(const edm::ParameterSet& iConfig) {
0053
0054 }
0055
0056 HcalHPDFilter::~HcalHPDFilter() {}
0057
0058
0059
0060
0061
0062
0063 bool HcalHPDFilter::filter(edm::Event& iEvent, const edm::EventSetup& iSetup) {
0064 using namespace edm;
0065
0066 Handle<HBHERecHitCollection> hbhe;
0067 iEvent.getByLabel("hbhereco", hbhe);
0068 const HBHERecHitCollection Hithbhe = *(hbhe.product());
0069
0070 for (HBHERecHitCollection::const_iterator hhit = Hithbhe.begin(); hhit != Hithbhe.end(); hhit++) {
0071 if (hhit->energy() > 5.)
0072 return true;
0073 }
0074 return false;
0075 }
0076
0077
0078 DEFINE_FWK_MODULE(HcalHPDFilter);