![]() |
![]() |
#include <IOMC/HZZ4lFilter/src/HZZ4lFilter.cc>
Public Member Functions | |
HZZ4lFilter (const edm::ParameterSet &) | |
~HZZ4lFilter () | |
Private Member Functions | |
virtual bool | filter (edm::Event &, const edm::EventSetup &) |
Private Attributes | |
std::string | label_ |
double | maxEtaElectronMuon |
double | minPtElectronMuon |
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 40 of file HZZ4lFilter.h.
HZZ4lFilter::HZZ4lFilter | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 37 of file HZZ4lFilter.cc.
: label_(iConfig.getUntrackedParameter("moduleLabel",std::string("generator"))), minPtElectronMuon(iConfig.getUntrackedParameter("MinPtElectronMuon", 0.)), maxEtaElectronMuon(iConfig.getUntrackedParameter("MaxEtaElectronMuon", 10.)) { //now do what ever initialization is needed }
HZZ4lFilter::~HZZ4lFilter | ( | ) |
Definition at line 47 of file HZZ4lFilter.cc.
{ // do anything here that needs to be done at desctruction time // (e.g. close files, deallocate resources etc.) }
bool HZZ4lFilter::filter | ( | edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDFilter.
Definition at line 62 of file HZZ4lFilter.cc.
References abs, edm::Event::getByLabel(), label_, maxEtaElectronMuon, minPtElectronMuon, and L1TEmulatorMonitor_cff::p.
{ using namespace edm; bool accepted = false; int nLeptons = 0; Handle< HepMCProduct > evt; iEvent.getByLabel(label_, evt); const HepMC::GenEvent * myGenEvent = evt->GetEvent(); for ( HepMC::GenEvent::particle_const_iterator p = myGenEvent->particles_begin(); p != myGenEvent->particles_end(); ++p ) { if ( (*p)->status()!=1 ) continue; if ((*p)->momentum().perp() > minPtElectronMuon && fabs((*p)->momentum().eta()) < maxEtaElectronMuon) { if ( abs((*p)->pdg_id()) == 11 || abs((*p)->pdg_id()) == 13 ) nLeptons++; } if (nLeptons == 3) { accepted = true; break; } } delete myGenEvent; if (accepted) { return true; } else { return false; } }
std::string HZZ4lFilter::label_ [private] |
Definition at line 51 of file HZZ4lFilter.h.
Referenced by filter().
double HZZ4lFilter::maxEtaElectronMuon [private] |
Definition at line 54 of file HZZ4lFilter.h.
Referenced by filter().
double HZZ4lFilter::minPtElectronMuon [private] |
Definition at line 53 of file HZZ4lFilter.h.
Referenced by filter().