44 void initPDFSet(
int nset,
int setid,
int member = 0);
47 double xfx(
int nset,
double x,
double Q,
int fl);
48 double getXmin(
int nset,
int member);
49 double getXmax(
int nset,
int member);
50 double getQ2min(
int nset,
int member);
51 double getQ2max(
int nset,
int member);
57 : lheTag_(pset.getParameter<edm::
InputTag>(
"lheSrc")), _newECMS(pset.getParameter<double>(
"NewECMS")) {
58 std::stringstream labelStr;
62 produces<GenEventInfoProduct>(
_label);
74 _pdfset = lheRun->heprup().PDFSUP.first;
76 _origECMS = lheRun->heprup().EBMUP.first + lheRun->heprup().EBMUP.second;
80 throw cms::Exception(
"LHECOMWeightProducer") <<
"You cannot reweight COM energy to a higher than original energy ";
100 float Q = lheevent->hepeup().SCALUP;
102 int id1 = lheevent->hepeup().IDUP[0];
103 double x1 = fabs(lheevent->hepeup().PUP[0][2] / (
_origECMS / 2));
104 double x1prime = fabs(lheevent->hepeup().PUP[0][2] / (
_newECMS / 2));
106 int id2 = lheevent->hepeup().IDUP[1];
107 double x2 = fabs(lheevent->hepeup().PUP[1][2] / (
_origECMS / 2));
108 double x2prime = fabs(lheevent->hepeup().PUP[1][2] / (
_newECMS / 2));
110 LogTrace(
"LHECOMWeightProducer") <<
"*******LHECOMWeightProducer*******\n"
111 <<
" Q : " << Q <<
"\n"
112 <<
" id1: " << id1 <<
"\n"
113 <<
" x1 : " << x1 <<
"\n"
114 <<
" x1': " << x1prime <<
"\n"
115 <<
" id2: " << id2 <<
"\n"
116 <<
" x2 : " << x2 <<
"\n"
117 <<
" x2': " << x2prime;
131 double newpdf1 =
LHAPDF::xfx(1, x1prime, Q, id1) / x1prime;
132 double newpdf2 =
LHAPDF::xfx(1, x2prime, Q, id2) / x2prime;
133 LogTrace(
"LHECOMWeightProducer") <<
" xfx1 : " << oldpdf1 <<
"\n"
134 <<
" xfx2 : " << oldpdf2 <<
"\n"
135 <<
" xfx1': " << newpdf1 <<
"\n"
136 <<
" xfx2': " << newpdf2 <<
"\n"
137 <<
" weight:" << (newpdf1 / oldpdf1) * (newpdf2 / oldpdf2);
138 double weight = (newpdf1 / oldpdf1) * (newpdf2 / oldpdf2);
bool getByLabel(std::string const &label, Handle< PROD > &result) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
#define DEFINE_FWK_MODULE(type)
double getXmax(int nset, int member)
double getQ2max(int nset, int member)
static constexpr int verbose
void extrapolate(bool extrapolate=true)
void beginRun(edm::Run const &run, const edm::EventSetup &es) override
double getXmin(int nset, int member)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
~LHECOMWeightProducer() override
Log< level::Info, false > LogInfo
void initPDFSet(int nset, int setid, int member=0)
LHECOMWeightProducer(const edm::ParameterSet &)
double xfx(int nset, double x, double Q, int fl)
void produce(edm::Event &, const edm::EventSetup &) override
double getQ2min(int nset, int member)
void usePDFMember(int nset, int member)