53 edm::LogVerbatim(
"SimpleSystematicsAnalysis") <<
"Uncertainties will be determined for the following tags: ";
69 edm::LogVerbatim(
"SimpleSystematicsAnalysis") <<
"NO SELECTED EVENTS => NO RESULTS";
73 edm::LogVerbatim(
"SimpleSystematicsAnalysis") <<
"\n>>>> Begin of Weight systematics summary >>>>";
77 <<
"Total number of selected data: " <<
selectedEvents_ <<
" [events], corresponding to acceptance: [" 78 << originalAcceptance * 100 <<
" +- " 84 double acc_central = 0.;
85 double acc2_central = 0.;
92 <<
"\tTotal Events after reweighting: " <<
weightedEvents_[
i] <<
" [events]";
96 <<
"\tAcceptance after reweighting: [" << acc_central * 100 <<
" +- " 97 << 100 *
sqrt((acc2_central / waverage - acc_central * acc_central) /
originalEvents_) <<
"] %";
98 double xi = acc_central - originalAcceptance;
99 double deltaxi = (acc2_central - (originalAcceptance + 2 * xi + xi *
xi)) /
originalEvents_;
101 deltaxi =
sqrt(deltaxi);
105 <<
"\ti.e. [" << std::setprecision(4) << 100 * xi / originalAcceptance <<
" +- " << std::setprecision(4)
106 << 100 * deltaxi / originalAcceptance <<
"] % relative variation with respect to the original acceptance";
108 edm::LogVerbatim(
"SimpleSystematicsAnalysis") <<
">>>> End of Weight systematics summary >>>>";
115 bool selectedEvent =
false;
118 edm::LogError(
"SimpleSystematicsAnalysis") <<
">>> TRIGGER collection does not exist !!!";
124 bool pathFound = (pathIndex < trigNames.
size());
126 if (triggerResults->
accept(pathIndex))
127 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)