10 token_(consumes<
edm::
HepMCProduct>(
edm::InputTag(iConfig.getUntrackedParameter(
"moduleLabel",
std::
string(
"generator")),
"unsmeared"))),
11 etaMuMax(iConfig.getUntrackedParameter<double>(
"MaxMuonEta", 2.5)),
12 ptMuMin(iConfig.getUntrackedParameter<double>(
"MinMuonPt", 3.5)),
13 ptZMin(iConfig.getUntrackedParameter<double>(
"MinZPt")),
14 ptZMax(iConfig.getUntrackedParameter<double>(
"MaxZPt")),
15 maxnumberofeventsinrun(iConfig.getUntrackedParameter<
int>(
"MaxEvents",10000))
41 std::vector<const HepMC::GenParticle *>
mu;
43 for ( HepMC::GenEvent::particle_const_iterator
p = myGenEvent->particles_begin();
p != myGenEvent->particles_end(); ++
p ) {
45 if (
std::abs((*p)->pdg_id())==13 && (*p)->status()==1 )
47 if(mu.size()>1)
break;
52 if(mu.size() != 2)
return false;
54 if(mu[0]->
pdg_id()*(mu[1]->pdg_id()) > 0) {
60 if(mu[0]->momentum().perp()<
ptMuMin || mu[1]->momentum().perp()<
ptMuMin)
return false;
64 if(std::fabs(mu[0]->momentum().
eta()) >
etaMuMax)
return false;
65 if(std::fabs(mu[1]->momentum().
eta()) >
etaMuMax)
return false;
68 double mmup = mu[0]->generatedMass();
69 double mmum = mu[1]->generatedMass();
70 double pxZ = mu[0]->momentum().x()+mu[1]->momentum().x();
71 double pyZ = mu[0]->momentum().y()+mu[1]->momentum().y();
72 double pzZ = mu[0]->momentum().z()+mu[1]->momentum().z();
74 double pmup2 = mu[0]->momentum().x()*mu[0]->momentum().x()+
75 mu[0]->momentum().y()*mu[0]->momentum().y()+
76 mu[0]->momentum().z()*mu[0]->momentum().z();
77 double pmum2 = mu[1]->momentum().x()*mu[1]->momentum().x()+
78 mu[1]->momentum().y()*mu[1]->momentum().y()+
79 mu[1]->momentum().z()*mu[1]->momentum().z();
80 double emup =
sqrt(pmup2+mmup*mmup);
81 double emum =
sqrt(pmum2+mmum*mmum);
83 double massZ =
sqrt((emup+emum)*(emup+emum)-pxZ*pxZ-pyZ*pyZ-pzZ*pzZ);
88 if(std::fabs(massZ-
m_z)>
dm_z)
return false;
97 double ptZ = tot_mom.pt();
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~PythiaFilterZJetWithOutBg() override
edm::EDGetTokenT< edm::HepMCProduct > token_
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Abs< T >::type abs(const T &t)
const HepMC::GenEvent * GetEvent() const
bool accepted(std::vector< std::string_view > const &, std::string_view)
bool filter(edm::Event &, const edm::EventSetup &) override
PythiaFilterZJetWithOutBg(const edm::ParameterSet &)