15 #include <Math/VectorUtil.h> 59 std::unique_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;
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();
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);
130 const double alphapi = 1/137.036/
M_PI;
131 const double mass_e = 0.0005;
132 const double mass_mu = 0.106;
133 const double mass_tau = 1.777;
134 const double mass_Z = 91.2;
135 if (pt>mass_e) pigaga += alphapi * (2*
log(pt/mass_e)/3.-5./9.);
136 if (pt>mass_mu) pigaga += alphapi * (2*
log(pt/mass_mu)/3.-5./9.);
137 if (pt>mass_tau) pigaga += alphapi * (2*
log(pt/mass_tau)/3.-5./9.);
146 A = 0.0; B = 0.0023092; C = 3.9925370;
148 A = 0.0; B = 0.0022333; C = 4.2191779;
150 A = 0.0; B = 0.0024402; C = 3.2496684;
151 }
else if (pt<10.0) {
152 A = 0.0; B = 0.0027340; C = 2.0995092;
153 }
else if (pt<mass_Z) {
154 A = 0.0010485; B = 0.0029431; C = 1.0;
155 }
else if (pt<10000.) {
156 A = 0.0012234; B = 0.0029237; C = 1.0;
158 A = 0.0016894; B = 0.0028984; C = 1.0;
160 pigaga += A + B*
log(1.+C*pt*pt);
163 return 1./(1.-pigaga);
int pdgId() const final
PDG identifier.
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
T getUntrackedParameter(std::string const &, T const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
daughters::value_type daughterRef(size_type i) const
reference to daughter at given position
double theta() const final
momentum polar angle
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
Sin< T >::type sin(const T &t)
size_t numberOfMothers() const override
number of mothers
~FSRWeightProducer() override
double alphaRatio(double)
FSRWeightProducer(const edm::ParameterSet &)
virtual double energy() const =0
energy
virtual int pdgId() const =0
PDG identifier.
Cos< T >::type cos(const T &t)
double energy() const final
energy
Abs< T >::type abs(const T &t)
static const std::string B
virtual double theta() const =0
momentum polar angle
virtual double mass() const =0
mass
size_t numberOfDaughters() const override
number of daughters
void produce(edm::Event &, const edm::EventSetup &) override
int status() const final
status word
double phi() const final
momentum azimuthal angle
edm::EDGetTokenT< reco::GenParticleCollection > genToken_
virtual double phi() const =0
momentum azimuthal angle
Power< A, B >::type pow(const A &a, const B &b)
const Candidate * mother(size_type=0) const override
return mother at a given position, i = 0, ... numberOfMothers() - 1 (read only mode) ...
double mass() const final
mass