CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HCALHighEnergyFilter.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HCALHighEnergyFilter
4 // Class: HCALHighEnergyFilter
5 //
13 //
14 // Original Author: Kenneth Case Rossato
15 // Created: Tue Aug 19 16:13:10 CEST 2008
16 // $Id: HCALHighEnergyFilter.cc,v 1.4 2010/02/17 22:40:55 wdd Exp $
17 //
18 //
19 
20 
21 // system include files
22 #include <memory>
23 
24 // user include files
27 
30 
32 
34 
36 //#include "DataFormats/L1Trigger/interface/L1JetParticle.h"
37 //#include "DataFormats/L1Trigger/interface/L1JetParticleFwd.h"
39 
40 #include <string>
41 
42 //
43 // class declaration
44 //
45 
46 using namespace edm;
47 //using namespace l1extra;
48 
50  public:
51  explicit HCALHighEnergyFilter(const edm::ParameterSet&);
53 
54  private:
55  virtual void beginJob() override ;
56  virtual bool filter(edm::Event&, const edm::EventSetup&) override;
57  virtual void endJob() override ;
58  // bool jetGood(L1JetParticleCollection::const_iterator &);
59  bool jetGood(reco::CaloJetCollection::const_iterator &);
60  // ----------member data ---------------------------
61 
62  // edm::InputTag centralTag, tauTag;
64  double jet_threshold;
65  double eta_cut;
66 };
67 
68 //
69 // constants, enums and typedefs
70 //
71 
72 //
73 // static data member definitions
74 //
75 
76 //
77 // constructors and destructor
78 //
80  :
81  // centralTag(iConfig.getUntrackedParameter<edm::InputTag>("CentralJets")),
82  // tauTag(iConfig.getUntrackedParameter<edm::InputTag>("TauJets")),
83  jet_tag(iConfig.getParameter<edm::InputTag>("JetTag")),
84  jet_threshold(iConfig.getParameter<double>("JetThreshold")),
85  eta_cut(iConfig.getParameter<double>("EtaCut"))
86 {
87  //now do what ever initialization is needed
88 
89 }
90 
91 
93 {
94 
95  // do anything here that needs to be done at desctruction time
96  // (e.g. close files, deallocate resources etc.)
97 
98 }
99 
100 
101 //
102 // member functions
103 //
104 
105 bool
106 //HCALHighEnergyFilter::jetGood(L1JetParticleCollection::const_iterator &cit) {
107 HCALHighEnergyFilter::jetGood(reco::CaloJetCollection::const_iterator &cit) {
108  if (cit->energy() >= jet_threshold && std::fabs(cit->eta()) <= eta_cut)
109  return true;
110  return false;
111 }
112 
113 // ------------ method called on each new Event ------------
114 bool
116 {
117  using namespace edm;
118 
119  //Handle<L1JetParticleCollection> JetsCentral;
120  //iEvent.getByLabel(centralTag,JetsCentral);
121 
122  //Handle<L1JetParticleCollection> JetsTau;
123  //iEvent.getByLabel(tauTag,JetsTau);
124 
126  iEvent.getByLabel(jet_tag, Jets);
127 
128  /*
129  for (L1JetParticleCollection::const_iterator cit = JetsCentral->begin();
130  cit != JetsCentral->end(); cit++) {
131  if (jetGood(cit)) return true;
132  }
133 
134  for (L1JetParticleCollection::const_iterator cit = JetsTau->begin();
135  cit != JetsTau->end(); cit++) {
136  if (jetGood(cit)) return true;
137  }
138  */
139 
140  for (reco::CaloJetCollection::const_iterator cit = Jets->begin();
141  cit != Jets->end(); cit++) {
142  if (jetGood(cit)) return true;
143  }
144 
145  return false;
146 }
147 
148 // ------------ method called once each job just before starting event loop ------------
149 void
151 {
152 }
153 
154 // ------------ method called once each job just after ending the event loop ------------
155 void
157 }
158 
159 //define this as a plug-in
virtual void beginJob() override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
HCALHighEnergyFilter(const edm::ParameterSet &)
void beginJob()
Definition: Breakpoints.cc:15
int iEvent
Definition: GenABIO.cc:230
tuple Jets
Definition: METSkim_cff.py:17
virtual bool filter(edm::Event &, const edm::EventSetup &) override
virtual void endJob() override
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:420
bool jetGood(reco::CaloJetCollection::const_iterator &)