15 #include <Math/VectorUtil.h> 27 virtual void endJob()
override ;
59 unsigned int gensize = genParticles->size();
61 std::unique_ptr<double>
weight (
new double);
70 for (
unsigned int i = 0;
i<gensize; ++
i) {
73 if (status!=3)
continue;
76 if (status==3 && (partId==23||
abs(partId)==24)) {
77 boson = &(*genParticles)[
i];
87 for (
unsigned int i = 0;
i<gensize; ++
i) {
91 if (status!=1)
continue;
93 if (partId!=22)
continue;
97 if (mother->
status()!=3)
continue;
98 int mId = mother->
pdgId();
99 if (
abs(mId)>6 && mId!=2212)
continue;
102 if (keyD==parton1Key || keyD==parton2Key) {
111 if (boson && photon) {
113 double s = smom.M2();
114 double sqrts = smom.M();
117 ROOT::Math::Boost cmboost(smom.BoostToCM());
119 double pcostheta = ( smom.x()*photonCM.x()
120 + smom.y()*photonCM.y()
121 + smom.z()*photonCM.z() ) / smom.P();
124 double t = - sqrts * (photonCM.t()-pcostheta);
125 double MV = boson->
mass();
126 double u = MV*MV - s -
t;
127 (*weight) = 1. - 2*t*u/(s*s+MV*MV*MV*MV);
virtual void endJob() override
T getUntrackedParameter(std::string const &, T const &) const
~ISRGammaWeightProducer()
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
edm::EDGetTokenT< reco::GenParticleCollection > genToken_
virtual double mass() const final
mass
daughters::value_type daughterRef(size_type i) const
reference to daughter at given position
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
virtual void beginJob() override
virtual int status() const final
status word
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
virtual size_t numberOfMothers() const
number of mothers
virtual void produce(edm::Event &, const edm::EventSetup &) override
ISRGammaWeightProducer(const edm::ParameterSet &)
virtual size_t numberOfDaughters() const
number of daughters
virtual int pdgId() const final
PDG identifier.
Abs< T >::type abs(const T &t)
daughters::value_type motherRef(size_type i=0) const
reference to mother at given position
std::vector< double > isrBinEdges_
std::vector< double > ptWeights_
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector