@@ -9,9 +9,11 @@ class L1TauTriggerFilterObjectProducer : public HLTFilter {
99public:
1010 explicit L1TauTriggerFilterObjectProducer (const edm::ParameterSet& cfg)
1111 : HLTFilter(cfg),
12- tausToken_(consumes<l1t::TauBxCollection>(cfg.getParameter<edm::InputTag>(" taus" ))),
12+ tausSrc_(cfg.getParameter<edm::InputTag>(" taus" )),
13+ tausToken_(consumes<l1t::TauBxCollection>(tausSrc_)),
1314 selectedBx_(cfg.getParameter<std::vector<int >>(" selectedBx" )),
1415 minPt_(cfg.getParameter<double >(" minPt" )),
16+ minHwIso_(cfg.getParameter<int >(" minHwIso" )),
1517 nExpected_(cfg.getParameter<int >(" nExpected" )) {}
1618
1719 static void fillDescriptions (edm::ConfigurationDescriptions& descriptions) {
@@ -21,13 +23,16 @@ class L1TauTriggerFilterObjectProducer : public HLTFilter {
2123 desc.add <std::vector<int >>(" selectedBx" , std::vector<int >())
2224 ->setComment (" bunch crossings to select, empty means all" );
2325 desc.add <double >(" minPt" , 0 )->setComment (" select taus with pt > minPt. minPt=0 means no pt cut" );
26+ desc.add <int >(" minHwIso" , 0 )->setComment (" select taus with hwIso >= minHwIso. minHwIso=0 means no hwIso cut" );
2427 desc.add <int >(" nExpected" , 0 )->setComment (" minimal number of taus per event to pass the filter" );
2528 descriptions.addWithDefaultLabel (desc);
2629 }
2730
2831 bool hltFilter (edm::Event& event,
2932 const edm::EventSetup& eventsetup,
3033 trigger::TriggerFilterObjectWithRefs& filterproduct) const override {
34+ if (saveTags ())
35+ filterproduct.addCollectionTag (tausSrc_);
3136 const auto & taus = event.getHandle (tausToken_);
3237 int nPassed = 0 ;
3338 for (int bx_index = taus->getFirstBX (); bx_index <= taus->getLastBX (); ++bx_index) {
@@ -36,7 +41,7 @@ class L1TauTriggerFilterObjectProducer : public HLTFilter {
3641 const unsigned bx_index_shift = taus->begin (bx_index) - taus->begin ();
3742 unsigned index_in_bx = 0 ;
3843 for (auto it = taus->begin (bx_index); it != taus->end (bx_index); ++it, ++index_in_bx) {
39- if (it->pt () <= minPt_)
44+ if (it->pt () <= minPt_ || it-> hwIso () < minHwIso_ )
4045 continue ;
4146 const l1t::TauRef tauRef (taus, bx_index_shift + index_in_bx);
4247 filterproduct.addObject (trigger::TriggerL1Tau, tauRef);
@@ -47,9 +52,11 @@ class L1TauTriggerFilterObjectProducer : public HLTFilter {
4752 }
4853
4954private:
55+ const edm::InputTag tausSrc_;
5056 const edm::EDGetTokenT<l1t::TauBxCollection> tausToken_;
5157 const std::vector<int > selectedBx_;
5258 const double minPt_;
59+ const int minHwIso_;
5360 const int nExpected_;
5461};
5562
0 commit comments