59 std::auto_ptr<double>
weight (
new double);
64 unsigned int gensize = genParticles->size();
65 for (
unsigned int i = 0;
i<gensize; ++
i) {
67 if (lepton.
status()!=3)
continue;
68 int leptonId = lepton.
pdgId();
69 if (
abs(leptonId)!=11 &&
abs(leptonId)!=13 &&
abs(leptonId)!=15)
continue;
73 if (bosonId!=23 && bosonId!=24)
continue;
74 double bosonMass = boson->
mass();
75 double leptonMass = lepton.
mass();
76 double leptonEnergy = lepton.
energy();
77 double cosLeptonTheta =
cos(lepton.
theta());
78 double sinLeptonTheta =
sin(lepton.
theta());
79 double leptonPhi = lepton.
phi();
87 if (otherlepton.
pdgId()!=leptonId)
continue;
89 trueKey = otherleptonKey;
95 for (
unsigned int j = 0;
j<nDaughters; ++
j) {
97 if (photon->
pdgId()!=22)
continue;
98 double photonEnergy = photon->
energy();
99 double cosPhotonTheta =
cos(photon->
theta());
100 double sinPhotonTheta =
sin(photon->
theta());
101 double photonPhi = photon->
phi();
102 double costheta = sinLeptonTheta*sinPhotonTheta*
cos(leptonPhi-photonPhi)
103 + cosLeptonTheta*cosPhotonTheta;
107 double betaLepton =
sqrt(1-
pow(leptonMass/leptonEnergy,2));
108 double delta = - 8*photonEnergy *(1-betaLepton*costheta)
110 / (1-
pow(leptonMass/bosonMass,2))
111 / (4-
pow(leptonMass/bosonMass,2))
112 * leptonEnergy * (
pow(leptonMass,2)/bosonMass+2*photonEnergy);
113 (*weight) *= (1 +
delta);
virtual int pdgId() const
PDG identifier.
virtual double energy() const =0
energy
virtual float mass() const =0
mass
daughters::value_type daughterRef(size_type i) const
reference to daughter at given position
bool getByToken(EDGetToken token, Handle< PROD > &result) const
virtual int status() const
status word
virtual float phi() const
momentum azimuthal angle
Sin< T >::type sin(const T &t)
virtual float phi() const =0
momentum azimuthal angle
double alphaRatio(double)
virtual double energy() const
energy
virtual double theta() const =0
momentum polar angle
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual size_t numberOfMothers() const
number of mothers
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)
Abs< T >::type abs(const T &t)
virtual double theta() const
momentum polar angle
virtual int pdgId() const =0
PDG identifier.
virtual float mass() const
mass
edm::EDGetTokenT< reco::GenParticleCollection > genToken_
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)