4 #include "TLorentzVector.h"
10 token_(consumes<edm::
HepMCProduct>(iConfig.getUntrackedParameter(
"moduleLabel",edm::
InputTag(
"generator",
"unsmeared")))),
11 minDileptonMass(iConfig.getUntrackedParameter(
"MinDileptonMass", 0.)),
12 minZgMass(iConfig.getUntrackedParameter(
"MinZgMass", 0.))
24 bool accepted =
false;
27 const HepMC::GenEvent * myGenEvent = evt->GetEvent();
29 vector<TLorentzVector> Lepton; Lepton.clear();
32 for ( HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
33 p != myGenEvent->particles_end(); ++
p ) {
34 if ((*p)->status() == 1 && (
abs((*p)->pdg_id()) == 11 ||
abs((*p)->pdg_id()) == 13 ||
abs((*p)->pdg_id()) == 15)) {
35 TLorentzVector LeptP((*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz(), (*p)->momentum().e());
36 Lepton.push_back(LeptP);
38 if (
abs((*p)->pdg_id()) == 22 && (*p)->status() == 1) {
39 TLorentzVector PhotP((*p)->momentum().px(), (*p)->momentum().py(), (*p)->momentum().pz(), (*p)->momentum().e());
44 if (Lepton.size() > 1 && (Lepton[0]+Lepton[1]).M() >
minDileptonMass ) {
bool getByToken(EDGetToken token, Handle< PROD > &result) const
ZgMassFilter(const edm::ParameterSet &)
edm::EDGetTokenT< edm::HepMCProduct > token_
Abs< T >::type abs(const T &t)
virtual bool filter(edm::Event &, const edm::EventSetup &)