11 virtual void endJob()
override ;
35 selectorPath_(pset.getUntrackedParameter<std::
string> (
"SelectorPath",
"")),
36 weightTags_(pset.getUntrackedParameter<std::vector<edm::InputTag> > (
"WeightTags")) {
46 edm::LogVerbatim(
"SimpleSystematicsAnalysis") <<
"Uncertainties will be determined for the following tags: ";
62 edm::LogVerbatim(
"SimpleSystematicsAnalysis") <<
"NO SELECTED EVENTS => NO RESULTS";
66 edm::LogVerbatim(
"SimpleSystematicsAnalysis") <<
"\n>>>> Begin of Weight systematics summary >>>>";
69 edm::LogVerbatim(
"SimpleSystematicsAnalysis") <<
"Total number of selected data: " <<
selectedEvents_ <<
" [events], corresponding to acceptance: [" << originalAcceptance*100 <<
" +- " << 100*
sqrt( originalAcceptance*(1.-originalAcceptance)/
originalEvents_) <<
"] %";
74 double acc_central = 0.;
75 double acc2_central = 0.;
83 edm::LogVerbatim(
"SimpleSystematicsAnalysis") <<
"\tAcceptance after reweighting: [" << acc_central*100 <<
" +- " <<
86 double xi = acc_central-originalAcceptance;
87 double deltaxi = (acc2_central-(originalAcceptance+2*xi+xi*xi))/
originalEvents_;
88 if (deltaxi>0) deltaxi =
sqrt(deltaxi);
else deltaxi = 0.;
89 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";
92 edm::LogVerbatim(
"SimpleSystematicsAnalysis") <<
">>>> End of Weight systematics summary >>>>";
100 bool selectedEvent =
false;
103 edm::LogError(
"SimpleSystematicsAnalysis") <<
">>> TRIGGER collection does not exist !!!";
109 bool pathFound = (pathIndex<trigNames.
size());
111 if (triggerResults->accept(pathIndex)) selectedEvent =
true;
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
std::string selectorPath_
#define DEFINE_FWK_MODULE(type)
virtual ~SimpleSystematicsAnalyzer()
Strings::size_type size() const
unsigned int selectedEvents_
unsigned int triggerIndex(std::string const &name) const
virtual void beginJob() override
virtual bool filter(edm::Event &, const edm::EventSetup &) override
std::vector< double > weightedEvents_
static std::string const triggerResults
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
static const char *const trigNames[]
virtual void endJob() override
unsigned int originalEvents_
std::vector< double > weighted2SelectedEvents_
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)