19 using namespace HepMC;
42 pdfWeightOffset_(
cfg.getParameter<unsigned
int>(
"pdfWeightOffset")),
43 nPdfWeights_(
cfg.getParameter<unsigned
int>(
"nPdfWeights")),
44 nPdfEigWeights_(
cfg.getParameter<unsigned
int>(
"nPdfEigWeights")),
45 pdfweights_(nPdfWeights_),
46 pdfeigweights_(nPdfEigWeights_) {
48 tree_ = fs->
make<TTree>(
"tree",
"");
50 tree_->Branch(
"pdfrep", &pdfweights_);
51 tree_->Branch(
"pdfeig", &pdfeigweights_);
52 tree_->Branch(
"weight", &weight_);
55 pdfweightshelper_.
Init(nPdfWeights_, nPdfEigWeights_, mc2hessianCSV);
67 double nomlheweight =
lheInfo->weights()[0].wgt;
72 weight_ = genInfo->
weight();
75 std::vector<double> inpdfweights(nPdfWeights_);
76 for (
unsigned int ipdf = 0; ipdf < nPdfWeights_; ++ipdf) {
77 unsigned int iwgt = ipdf + pdfWeightOffset_;
80 pdfweights_[ipdf] =
lheInfo->weights()[iwgt].wgt * weight_ / nomlheweight;
83 inpdfweights[ipdf] =
lheInfo->weights()[iwgt].wgt;
86 std::vector<double> outpdfweights(nPdfEigWeights_);
88 pdfweightshelper_.
DoMC2Hessian(nomlheweight, inpdfweights.data(), outpdfweights.data());
90 for (
unsigned int iwgt = 0; iwgt < nPdfEigWeights_; ++iwgt) {
91 double wgtval = outpdfweights[iwgt];
94 pdfeigweights_[iwgt] = wgtval * weight_ / nomlheweight;