16 #include <Math/VectorUtil.h>
29 virtual void endJob()
override ;
45 double xfx(
int nset,
double x,
double Q,
int fl);
46 double getXmin(
int nset,
int member);
47 double getXmax(
int nset,
int member);
48 double getQ2min(
int nset,
int member);
49 double getQ2max(
int nset,
int member);
55 fixPOWHEG_(pset.getUntrackedParameter<std::
string> (
"FixPOWHEG",
"")),
56 useFirstAsDefault_(pset.getUntrackedParameter<bool>(
"useFirstAsDefault",
false)),
57 genTag_(pset.getUntrackedParameter<edm::
InputTag> (
"GenTag", edm::
InputTag(
"genParticles"))),
59 pdfInfoTag_(pset.getUntrackedParameter<edm::
InputTag> (
"PdfInfoTag", edm::
InputTag(
"generator"))),
61 pdfSetNames_(pset.getUntrackedParameter<std::vector<std::
string> > (
"PdfSetNames"))
106 float Q = pdfstuff->pdf()->scalePDF;
108 int id1 = pdfstuff->pdf()->
id.first;
109 double x1 = pdfstuff->pdf()->x.first;
110 double pdf1 = pdfstuff->pdf()->xPDF.first;
112 int id2 = pdfstuff->pdf()->
id.second;
113 double x2 = pdfstuff->pdf()->x.second;
114 double pdf2 = pdfstuff->pdf()->xPDF.second;
128 unsigned int gensize = genParticles->size();
130 for(
unsigned int i = 0;
i<gensize; ++
i) {
133 if (status!=3)
continue;
134 int id = part.
pdgId();
135 if (
id!=23 &&
abs(
id)!=24)
continue;
136 mboson = part.
mass();
139 Q =
sqrt(mboson*mboson+Q*Q);
147 std::auto_ptr<std::vector<double> >
weights (
new std::vector<double>);
148 unsigned int nweights = 1;
150 weights->reserve(nweights);
152 for (
unsigned int i=0;
i<nweights; ++
i) {
156 weights->push_back(newpdf1/pdf1*newpdf2/pdf2);
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< reco::GenParticleCollection > genToken_
virtual void beginJob() override
void initPDFSet(int nset, const std::string &filename, int member=0)
std::vector< std::string > pdfSetNames_
virtual int status() const final
status word
T x() const
Cartesian x coordinate.
double getXmax(int nset, int member)
double getQ2max(int nset, int member)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void extrapolate(bool extrapolate=true)
Abs< T >::type abs(const T &t)
double getXmin(int nset, int member)
virtual double mass() const final
mass
PdfWeightProducer(const edm::ParameterSet &)
edm::EDGetTokenT< GenEventInfoProduct > pdfInfoToken_
edm::InputTag pdfInfoTag_
virtual void produce(edm::Event &, const edm::EventSetup &) override
std::vector< std::string > pdfShortNames_
virtual int pdgId() const final
PDG identifier.
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
double xfx(int nset, double x, double Q, int fl)
volatile std::atomic< bool > shutdown_flag false
double getQ2min(int nset, int member)
void usePDFMember(int nset, int member)
virtual void endJob() override