#include <HLTrigger/HLTfilters/interface/HLT1CaloJetEnergy.h>
Public Member Functions | |
virtual bool | filter (edm::Event &, const edm::EventSetup &) |
HLT1CaloJetEnergy (const edm::ParameterSet &) | |
~HLT1CaloJetEnergy () | |
Private Attributes | |
edm::InputTag | inputTag_ |
double | max_Eta_ |
double | min_E_ |
int | min_N_ |
bool | saveTag_ |
See header file for documentation.
Definition at line 25 of file HLT1CaloJetEnergy.h.
HLT1CaloJetEnergy::HLT1CaloJetEnergy | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 29 of file HLT1CaloJetEnergy.cc.
References edm::InputTag::encode(), inputTag_, LogDebug, max_Eta_, min_E_, and min_N_.
00029 : 00030 inputTag_ (iConfig.getParameter<edm::InputTag>("inputTag")), 00031 saveTag_ (iConfig.getUntrackedParameter<bool>("saveTag",false)), 00032 min_E_ (iConfig.getParameter<double> ("MinE" )), 00033 max_Eta_ (iConfig.getParameter<double> ("MaxEta" )), 00034 min_N_ (iConfig.getParameter<int> ("MinN" )) 00035 { 00036 LogDebug("") << "Input/ecut/etacut/ncut : " 00037 << inputTag_.encode() << " " 00038 << min_E_ << " " 00039 << max_Eta_ << " " 00040 << min_N_ ; 00041 00042 //register your products 00043 produces<trigger::TriggerFilterObjectWithRefs>(); 00044 }
HLT1CaloJetEnergy::~HLT1CaloJetEnergy | ( | ) |
bool HLT1CaloJetEnergy::filter | ( | edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
Implements HLTFilter.
Definition at line 56 of file HLT1CaloJetEnergy.cc.
References edm::Event::getByLabel(), i, inputTag_, pfTauBenchmarkGeneric_cfi::jets, max_Eta_, min_E_, min_N_, module(), n, path(), edm::Event::put(), HcalSimpleRecAlgoImpl::reco(), saveTag_, std, and trigger::TriggerJet.
00057 { 00058 using namespace std; 00059 using namespace edm; 00060 using namespace reco; 00061 using namespace trigger; 00062 00063 // All HLT filters must create and fill an HLT filter object, 00064 // recording any reconstructed physics objects satisfying (or not) 00065 // this HLT filter, and place it in the Event. 00066 00067 // The filter object 00068 auto_ptr<TriggerFilterObjectWithRefs> 00069 filterobject (new TriggerFilterObjectWithRefs(path(),module())); 00070 if (saveTag_) filterobject->addCollectionTag(inputTag_); 00071 // Ref to Candidate object to be recorded in filter object 00072 Ref<CaloJetCollection> ref; 00073 00074 00075 // get hold of collection of objects 00076 Handle<CaloJetCollection> jets; 00077 iEvent.getByLabel (inputTag_,jets); 00078 00079 // look at all objects, check cuts and add to filter object 00080 int n(0); 00081 CaloJetCollection::const_iterator i ( jets->begin() ); 00082 for (; i!=jets->end(); i++) { 00083 if ( i->energy() >= min_E_ && 00084 i->eta() <= max_Eta_ ) { 00085 n++; 00086 ref=Ref<CaloJetCollection>(jets,distance(jets->begin(),i)); 00087 filterobject->addObject(TriggerJet,ref); 00088 } 00089 } 00090 00091 // filter decision 00092 bool accept(n>=min_N_); 00093 00094 // put filter object into the Event 00095 iEvent.put(filterobject); 00096 00097 return accept; 00098 }
edm::InputTag HLT1CaloJetEnergy::inputTag_ [private] |
double HLT1CaloJetEnergy::max_Eta_ [private] |
double HLT1CaloJetEnergy::min_E_ [private] |
int HLT1CaloJetEnergy::min_N_ [private] |
bool HLT1CaloJetEnergy::saveTag_ [private] |