15 #include <Math/VectorUtil.h>
28 virtual void endJob()
override ;
60 std::auto_ptr<double>
weight (
new double);
65 unsigned int gensize = genParticles->size();
66 for (
unsigned int i = 0;
i<gensize; ++
i) {
68 if (lepton.
status()!=3)
continue;
69 int leptonId = lepton.
pdgId();
70 if (
abs(leptonId)!=11 &&
abs(leptonId)!=13 &&
abs(leptonId)!=15)
continue;
74 if (bosonId!=23 && bosonId!=24)
continue;
75 double bosonMass = boson->
mass();
76 double leptonMass = lepton.
mass();
77 double leptonEnergy = lepton.
energy();
78 double cosLeptonTheta =
cos(lepton.
theta());
79 double sinLeptonTheta =
sin(lepton.
theta());
80 double leptonPhi = lepton.
phi();
88 if (otherlepton.
pdgId()!=leptonId)
continue;
90 trueKey = otherleptonKey;
96 for (
unsigned int j = 0;
j<nDaughters; ++
j) {
98 if (photon->
pdgId()!=22)
continue;
99 double photonEnergy = photon->
energy();
100 double cosPhotonTheta =
cos(photon->
theta());
101 double sinPhotonTheta =
sin(photon->
theta());
102 double photonPhi = photon->
phi();
103 double costheta = sinLeptonTheta*sinPhotonTheta*
cos(leptonPhi-photonPhi)
104 + cosLeptonTheta*cosPhotonTheta;
108 double betaLepton =
sqrt(1-
pow(leptonMass/leptonEnergy,2));
109 double delta = - 8*photonEnergy *(1-betaLepton*costheta)
111 / (1-
pow(leptonMass/bosonMass,2))
112 / (4-
pow(leptonMass/bosonMass,2))
113 * leptonEnergy * (
pow(leptonMass,2)/bosonMass+2*photonEnergy);
114 (*weight) *= (1 +
delta);
131 const double alphapi = 1/137.036/
M_PI;
132 const double mass_e = 0.0005;
133 const double mass_mu = 0.106;
134 const double mass_tau = 1.777;
135 const double mass_Z = 91.2;
136 if (pt>mass_e) pigaga += alphapi * (2*
log(pt/mass_e)/3.-5./9.);
137 if (pt>mass_mu) pigaga += alphapi * (2*
log(pt/mass_mu)/3.-5./9.);
138 if (pt>mass_tau) pigaga += alphapi * (2*
log(pt/mass_tau)/3.-5./9.);
147 A = 0.0; B = 0.0023092; C = 3.9925370;
149 A = 0.0; B = 0.0022333; C = 4.2191779;
151 A = 0.0; B = 0.0024402; C = 3.2496684;
152 }
else if (pt<10.0) {
153 A = 0.0; B = 0.0027340; C = 2.0995092;
154 }
else if (pt<mass_Z) {
155 A = 0.0010485; B = 0.0029431; C = 1.0;
156 }
else if (pt<10000.) {
157 A = 0.0012234; B = 0.0029237; C = 1.0;
159 A = 0.0016894; B = 0.0028984; C = 1.0;
161 pigaga += A + B*
log(1.+C*pt*pt);
164 return 1./(1.-pigaga);
virtual double energy() const GCC11_FINAL
energy
T getUntrackedParameter(std::string const &, T const &) const
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
virtual int pdgId() const GCC11_FINAL
PDG identifier.
#define DEFINE_FWK_MODULE(type)
Sin< T >::type sin(const T &t)
virtual float phi() const =0
momentum azimuthal angle
virtual double theta() const GCC11_FINAL
momentum polar angle
double alphaRatio(double)
FSRWeightProducer(const edm::ParameterSet &)
virtual float phi() const GCC11_FINAL
momentum azimuthal angle
virtual int status() const GCC11_FINAL
status word
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)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual int pdgId() const =0
PDG identifier.
virtual float mass() const GCC11_FINAL
mass
virtual void produce(edm::Event &, const edm::EventSetup &) override
virtual void beginJob() override
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)
virtual void endJob() override