7 #include <Math/VectorUtil.h> 16 for (
unsigned int i = 0;
i<gensize; ++
i) {
18 if (lepton.
status()!=3)
continue;
20 if (
abs(leptonId)!=11 &&
abs(leptonId)!=13 &&
abs(leptonId)!=15)
continue;
24 if (bosonId!=23 && bosonId!=24)
continue;
25 double bosonMass = boson->
mass();
26 double leptonMass = lepton.
mass();
27 double leptonEnergy = lepton.
energy();
28 double cosLeptonTheta =
cos(lepton.
theta());
29 double sinLeptonTheta =
sin(lepton.
theta());
30 double leptonPhi = lepton.
phi();
40 trueKey = otherleptonKey;
46 for (
unsigned int j = 0; j<nDaughters; ++j) {
48 if (photon->
pdgId()!=22)
continue;
49 double photonEnergy = photon->
energy();
50 double cosPhotonTheta =
cos(photon->
theta());
51 double sinPhotonTheta =
sin(photon->
theta());
52 double photonPhi = photon->
phi();
53 double costheta = sinLeptonTheta*sinPhotonTheta*
cos(leptonPhi-photonPhi)
54 + cosLeptonTheta*cosPhotonTheta;
58 double betaLepton =
sqrt(1-
pow(leptonMass/leptonEnergy,2));
59 double delta = - 8*photonEnergy *(1-betaLepton*costheta)
61 / (1-
pow(leptonMass/bosonMass,2))
62 / (4-
pow(leptonMass/bosonMass,2))
63 * leptonEnergy * (
pow(leptonMass,2)/bosonMass+2*photonEnergy);
64 weight *= (1 +
delta);
81 const double alphapi = 1/137.036/
M_PI;
82 const double mass_e = 0.0005;
83 const double mass_mu = 0.106;
84 const double mass_tau = 1.777;
85 const double mass_Z = 91.2;
86 if (pt>mass_e) pigaga += alphapi * (2*
log(pt/mass_e)/3.-5./9.);
87 if (pt>mass_mu) pigaga += alphapi * (2*
log(pt/mass_mu)/3.-5./9.);
88 if (pt>mass_tau) pigaga += alphapi * (2*
log(pt/mass_tau)/3.-5./9.);
97 A = 0.0; B = 0.0023092; C = 3.9925370;
99 A = 0.0; B = 0.0022333; C = 4.2191779;
101 A = 0.0; B = 0.0024402; C = 3.2496684;
102 }
else if (pt<10.0) {
103 A = 0.0; B = 0.0027340; C = 2.0995092;
104 }
else if (pt<mass_Z) {
105 A = 0.0010485; B = 0.0029431; C = 1.0;
106 }
else if (pt<10000.) {
107 A = 0.0012234; B = 0.0029237; C = 1.0;
109 A = 0.0016894; B = 0.0028984; C = 1.0;
111 pigaga += A + B*
log(1.+C*pt*pt);
114 return 1./(1.-pigaga);
virtual double mass() const final
mass
daughters::value_type daughterRef(size_type i) const
reference to daughter at given position
Sin< T >::type sin(const T &t)
virtual int status() const final
status word
virtual double phi() const final
momentum azimuthal angle
virtual double theta() const final
momentum polar angle
virtual double energy() const =0
energy
virtual size_t numberOfMothers() const
number of mothers
virtual int pdgId() const =0
PDG identifier.
virtual size_t numberOfDaughters() const
number of daughters
virtual const Candidate * daughter(size_type) const
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
Cos< T >::type cos(const T &t)
virtual int pdgId() const final
PDG identifier.
virtual double energy() const final
energy
Abs< T >::type abs(const T &t)
TAKEN FROM http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW/ElectroWeakAnalysis/Utilities/src/PdfWeig...
std::vector< reco::GenParticle > genParticles_
virtual double theta() const =0
momentum polar angle
virtual double mass() const =0
mass
double alphaRatio(double) const
virtual double phi() const =0
momentum azimuthal angle
virtual const Candidate * mother(size_type=0) const
return mother at a given position, i = 0, ... numberOfMothers() - 1 (read only mode) ...
Power< A, B >::type pow(const A &a, const B &b)