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;
178 double deltaxi = (acc2_central - (originalAcceptance + 2 * xi + xi *
xi)) /
originalEvents_;
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());
282 if (triggerResults->
accept(pathIndex))
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) {
std::vector< edm::EDGetTokenT< std::vector< double > > > pdfWeightTokens_
std::vector< edm::InputTag > pdfWeightTags_
std::string selectorPath_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool accept() const
Has at least one path accepted the event?
PdfSystematicsAnalyzer(const edm::ParameterSet &pset)
~PdfSystematicsAnalyzer() override
std::vector< double > weightedSelectedEvents_
Strings::size_type size() const
std::vector< double > weightedEvents_
unsigned int selectedEvents_
bool filter(edm::Event &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
unsigned int triggerIndex(std::string const &name) const
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
std::vector< double > weighted2SelectedEvents_
static std::string const triggerResults
static const char *const trigNames[]
auto vector_transform(std::vector< InputType > const &input, Function predicate) -> std::vector< typename std::remove_cv< typename std::remove_reference< decltype(predicate(input.front()))>::type >::type >
std::vector< int > pdfStart_
unsigned int originalEvents_
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override