12 virtual void endJob()
override ;
39 selectorPath_(pset.getUntrackedParameter<std::
string> (
"SelectorPath",
"")),
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;
93 double deltaxi = (acc2_central-(originalAcceptance+2*xi+xi*xi))/
originalEvents_;
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;
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
std::string selectorPath_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
virtual ~SimpleSystematicsAnalyzer()
Strings::size_type size() const
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 >
triggerResultsToken_(consumes< edm::TriggerResults >(edm::InputTag("TriggerResults")))
unsigned int selectedEvents_
unsigned int triggerIndex(std::string const &name) const
virtual void beginJob() override
std::vector< edm::EDGetTokenT< double > > weightTokens_
virtual bool filter(edm::Event &, const edm::EventSetup &) override
std::vector< double > weightedEvents_
static std::string const triggerResults
static const char *const trigNames[]
virtual void endJob() override
unsigned int originalEvents_
std::vector< double > weighted2SelectedEvents_
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken_
SimpleSystematicsAnalyzer(const edm::ParameterSet &pset)
std::vector< double > weightedSelectedEvents_
std::vector< edm::InputTag > weightTags_
Power< A, B >::type pow(const A &a, const B &b)