15 #include <Math/VectorUtil.h>
42 double xfx(
int nset,
double x,
double Q,
int fl);
43 double getXmin(
int nset,
int member);
44 double getXmax(
int nset,
int member);
45 double getQ2min(
int nset,
int member);
46 double getQ2max(
int nset,
int member);
52 fixPOWHEG_(pset.getUntrackedParameter<std::string> (
"FixPOWHEG",
"")),
53 genTag_(pset.getUntrackedParameter<edm::InputTag> (
"GenTag", edm::InputTag(
"genParticles"))),
54 pdfInfoTag_(pset.getUntrackedParameter<edm::InputTag> (
"PdfInfoTag", edm::InputTag(
"generator"))),
55 pdfSetNames_(pset.getUntrackedParameter<std::vector<std::string> > (
"PdfSetNames"))
100 float Q = pdfstuff->pdf()->scalePDF;
102 int id1 = pdfstuff->pdf()->
id.first;
103 double x1 = pdfstuff->pdf()->x.first;
104 double pdf1 = pdfstuff->pdf()->xPDF.first;
106 int id2 = pdfstuff->pdf()->
id.second;
107 double x2 = pdfstuff->pdf()->x.second;
108 double pdf2 = pdfstuff->pdf()->xPDF.second;
117 unsigned int gensize = genParticles->size();
119 for(
unsigned int i = 0;
i<gensize; ++
i) {
122 if (status!=3)
continue;
123 int id = part.
pdgId();
124 if (
id!=23 &&
abs(
id)!=24)
continue;
125 mboson = part.
mass();
128 Q =
sqrt(mboson*mboson+Q*Q);
136 std::auto_ptr<std::vector<double> >
weights (
new std::vector<double>);
137 unsigned int nweights = 1;
139 weights->reserve(nweights);
141 for (
unsigned int i=0;
i<nweights; ++
i) {
145 weights->push_back(newpdf1/pdf1*newpdf2/pdf2);
virtual int pdgId() const
PDG identifier.
#define DEFINE_FWK_MODULE(type)
virtual int status() const
status word
virtual void produce(edm::Event &, const edm::EventSetup &)
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
void initPDFSet(int nset, const std::string &filename, int member=0)
std::vector< std::string > pdfSetNames_
double getXmax(int nset, int member)
double getQ2max(int nset, int member)
virtual double mass() const
mass
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void extrapolate(bool extrapolate=true)
double getXmin(int nset, int member)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
PdfWeightProducer(const edm::ParameterSet &)
edm::InputTag pdfInfoTag_
std::vector< std::string > pdfShortNames_
double xfx(int nset, double x, double Q, int fl)
double getQ2min(int nset, int member)
void usePDFMember(int nset, int member)