41 : selectorPath_(
pset.getUntrackedParameter<
std::
string>(
"SelectorPath",
"")),
42 pdfWeightTags_(
pset.getUntrackedParameter<
std::vector<
edm::
InputTag> >(
"PdfWeightTags")),
45 triggerResultsToken_(consumes<edm::TriggerResults>(
edm::InputTag(
"TriggerResults"))) {}
54 edm::LogVerbatim(
"PDFAnalysis") <<
"PDF uncertainties will be determined for the following sets: ";
72 edm::LogVerbatim(
"PDFAnalysis") <<
"\n>>>> Begin of PDF weight systematics summary >>>>";
76 <<
" [events], corresponding to acceptance: [" << originalAcceptance * 100 <<
" +- "
80 edm::LogVerbatim(
"PDFAnalysis") <<
"\n>>>>> PDF UNCERTAINTIES ON RATE >>>>>>";
82 bool nnpdfFlag = (
pdfWeightTags_[
i].instance().substr(0, 5) ==
"NNPDF");
86 unsigned int npairs = (nmembers - 1) / 2;
90 edm::LogVerbatim(
"PDFAnalysis") <<
"\tEstimate for central PDF member: " <<
int(events_central) <<
" [events]";
95 <<
"] % relative variation with respect to original PDF";
98 edm::LogVerbatim(
"PDFAnalysis") <<
"\tNumber of eigenvectors for uncertainty estimation: " << npairs;
101 unsigned int nplus = 0;
102 unsigned int nminus = 0;
103 for (
unsigned int j = 0;
j < npairs; ++
j) {
142 wminus =
sqrt(wminus);
145 wplus /=
sqrt(nplus);
147 wminus /=
sqrt(nminus);
149 edm::LogVerbatim(
"PDFAnalysis") <<
"\tRelative uncertainty with respect to central member: +"
150 << std::setprecision(4) << 100. * wplus <<
" / -" << std::setprecision(4)
151 << 100. * wminus <<
" [%]";
153 edm::LogVerbatim(
"PDFAnalysis") <<
"\tNO eigenvectors for uncertainty estimation";
157 edm::LogVerbatim(
"PDFAnalysis") <<
"\n>>>>> PDF UNCERTAINTIES ON ACCEPTANCE >>>>>>";
159 bool nnpdfFlag = (
pdfWeightTags_[
i].instance().substr(0, 5) ==
"NNPDF");
163 unsigned int npairs = (nmembers - 1) / 2;
166 double acc_central = 0.;
167 double acc2_central = 0.;
173 edm::LogVerbatim(
"PDFAnalysis") <<
"\tEstimate for central PDF member acceptance: [" << acc_central * 100 <<
" +- "
177 double xi = acc_central - originalAcceptance;
180 deltaxi =
sqrt(deltaxi);
181 edm::LogVerbatim(
"PDFAnalysis") <<
"\ti.e. [" << std::setprecision(4) << 100 *
xi / originalAcceptance <<
" +- "
182 << std::setprecision(4) << 100 * deltaxi / originalAcceptance
183 <<
"] % relative variation with respect to the original PDF";
186 edm::LogVerbatim(
"PDFAnalysis") <<
"\tNumber of eigenvectors for uncertainty estimation: " << npairs;
189 unsigned int nplus = 0;
190 unsigned int nminus = 0;
191 for (
unsigned int j = 0;
j < npairs; ++
j) {
238 wminus =
sqrt(wminus);
241 wplus /=
sqrt(nplus);
243 wminus /=
sqrt(nminus);
245 edm::LogVerbatim(
"PDFAnalysis") <<
"\tRelative uncertainty with respect to central member: +"
246 << std::setprecision(4) << 100. * wplus <<
" / -" << std::setprecision(4)
247 << 100. * wminus <<
" [%]";
249 edm::LogVerbatim(
"PDFAnalysis") <<
"\tNO eigenvectors for uncertainty estimation";
252 edm::LogVerbatim(
"PDFAnalysis") <<
">>>> End of PDF weight systematics summary >>>>";
261 edm::LogError(
"PDFAnalysis") <<
">>> WARNING: some weights not found!";
262 edm::LogError(
"PDFAnalysis") <<
">>> But maybe OK, if you are prefiltering!";
263 edm::LogError(
"PDFAnalysis") <<
">>> If things are OK, this warning should disappear after a while!";
271 bool selectedEvent =
false;
274 edm::LogError(
"PDFAnalysis") <<
">>> TRIGGER collection does not exist !!!";
280 bool pathFound = (pathIndex <
trigNames.size());
283 selectedEvent =
true;
293 std::vector<double>
weights = (*weightHandle);
294 unsigned int nmembers =
weights.size();
298 for (
unsigned int j = 0;
j < nmembers; ++
j) {
305 for (
unsigned int j = 0;
j < nmembers; ++
j) {