#include <NJetsMC.cc>
Public Member Functions | |
NJetsMC (const edm::ParameterSet &) | |
~NJetsMC () | |
Private Member Functions | |
virtual void | beginJob () |
virtual void | endJob () |
virtual bool | filter (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
edm::InputTag | GenHandle_ |
double | minpt_ |
Int_t | njets_ |
Description: Filter for DPS MC generation.
Implementation: [Notes on implementation]
Definition at line 51 of file NJetsMC.cc.
NJetsMC::NJetsMC | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 70 of file NJetsMC.cc.
: GenHandle_(iConfig.getUntrackedParameter<InputTag>("GenTag")), njets_(iConfig.getParameter<int32_t>("Njets")), minpt_(iConfig.getParameter<double>("MinPt")) { }
NJetsMC::~NJetsMC | ( | ) |
Definition at line 78 of file NJetsMC.cc.
{ }
void NJetsMC::beginJob | ( | void | ) | [private, virtual] |
void NJetsMC::endJob | ( | void | ) | [private, virtual] |
bool NJetsMC::filter | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDFilter.
Definition at line 82 of file NJetsMC.cc.
References prof2calltree::count, GenHandle_, jetmet_cfg::GenJets, edm::Event::getByLabel(), minpt_, njets_, reco::LeafCandidate::pt(), and query::result.
{ using namespace edm; Handle<reco::GenJetCollection> GenJets; iEvent.getByLabel(GenHandle_, GenJets); Int_t count = 0; bool result = false; for(GenJetCollection::const_iterator iJet = GenJets->begin(); iJet != GenJets->end(); ++iJet) { reco::GenJet myJet = reco::GenJet(*iJet); if(myJet.pt() > minpt_) ++count; } if( count >= njets_ ) result = true; return result; }
edm::InputTag NJetsMC::GenHandle_ [private] |
Definition at line 64 of file NJetsMC.cc.
Referenced by filter().
double NJetsMC::minpt_ [private] |
Definition at line 66 of file NJetsMC.cc.
Referenced by filter().
Int_t NJetsMC::njets_ [private] |
Definition at line 65 of file NJetsMC.cc.
Referenced by filter().