40 weightTags_(pset.getUntrackedParameter<
std::vector<
edm::InputTag> > (
"WeightTags")),
52 edm::LogVerbatim(
"SimpleSystematicsAnalysis") <<
"Uncertainties will be determined for the following tags: ";
68 edm::LogVerbatim(
"SimpleSystematicsAnalysis") <<
"NO SELECTED EVENTS => NO RESULTS";
72 edm::LogVerbatim(
"SimpleSystematicsAnalysis") <<
"\n>>>> Begin of Weight systematics summary >>>>";
75 edm::LogVerbatim(
"SimpleSystematicsAnalysis") <<
"Total number of selected data: " <<
selectedEvents_ <<
" [events], corresponding to acceptance: [" << originalAcceptance*100 <<
" +- " << 100*
sqrt( originalAcceptance*(1.-originalAcceptance)/
originalEvents_) <<
"] %";
80 double acc_central = 0.;
81 double acc2_central = 0.;
89 edm::LogVerbatim(
"SimpleSystematicsAnalysis") <<
"\tAcceptance after reweighting: [" << acc_central*100 <<
" +- " <<
92 double xi = acc_central-originalAcceptance;
94 if (deltaxi>0) deltaxi =
sqrt(deltaxi);
else deltaxi = 0.;
95 edm::LogVerbatim(
"SimpleSystematicsAnalysis") <<
"\ti.e. [" << std::setprecision(4) << 100*xi/originalAcceptance <<
" +- " << std::setprecision(4) << 100*deltaxi/originalAcceptance <<
"] % relative variation with respect to the original acceptance";
98 edm::LogVerbatim(
"SimpleSystematicsAnalysis") <<
">>>> End of Weight systematics summary >>>>";
106 bool selectedEvent =
false;
109 edm::LogError(
"SimpleSystematicsAnalysis") <<
">>> TRIGGER collection does not exist !!!";
115 bool pathFound = (pathIndex<trigNames.
size());
117 if (triggerResults->
accept(pathIndex)) selectedEvent =
true;
std::string selectorPath_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool accept() const
Has at least one path accepted the event?
Strings::size_type size() const
unsigned int selectedEvents_
#define DEFINE_FWK_MODULE(type)
unsigned int triggerIndex(std::string const &name) const
std::vector< edm::EDGetTokenT< double > > weightTokens_
bool filter(edm::Event &, const edm::EventSetup &) override
std::vector< double > weightedEvents_
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 >
unsigned int originalEvents_
std::vector< double > weighted2SelectedEvents_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
SimpleSystematicsAnalyzer(const edm::ParameterSet &pset)
std::vector< double > weightedSelectedEvents_
~SimpleSystematicsAnalyzer() override
std::vector< edm::InputTag > weightTags_
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Power< A, B >::type pow(const A &a, const B &b)