5 #include "TEfficiency.h"
11 std::tuple<float, float> calcEfficiency(
float num,
float denom) {
13 return std::make_tuple(0.0
f, 0.0
f);
16 constexpr
double cl = 0.683f;
17 const float eff = num /
denom;
18 const float errDown = TEfficiency::ClopperPearson(denom, num, cl,
false);
19 const float errUp = TEfficiency::ClopperPearson(denom, num, cl,
true);
22 return std::make_tuple(eff,
std::max(eff - errDown, errUp - eff));
27 : dqmBaseFolder_(ps.getUntrackedParameter<std::
string>(
"DQMBaseFolder")) {}
38 std::size_t pos = subfolder.rfind(
'/');
39 if (pos == std::string::npos)
42 if (subfolder.compare(pos, 4,
"HLT_") == 0) {
43 LogDebug(
"HLTTauDQMOffline") <<
"Processing path " << subfolder.substr(pos);
54 if (!eventsPerFilter) {
55 LogDebug(
"HLTTauDQMOffline") <<
"ME " << folder <<
"/EventsPerFilter not found";
62 "Efficiency to previous filter",
70 const TAxis* xaxis = eventsPerFilter->
getTH1F()->GetXaxis();
77 for (
int i = 2;
i <= eventsPerFilter->
getNbinsX(); ++
i) {
79 LogDebug(
"HLTTauDQMOffline") <<
"HLTTauPostProcessor: Encountered denominator < numerator with efficiency plot "
80 "EfficiencyRefPrevious in folder "
81 << folder <<
", bin " <<
i <<
" numerator " << eventsPerFilter->
getBinContent(
i)
85 const std::tuple<float, float> effErr =
87 const float efficiency = std::get<0>(effErr);
88 const float err = std::get<1>(effErr);
90 prev->SetBinContent(
i - 1, efficiency);
91 prev->SetBinEntries(
i - 1, 1);
92 prev->SetBinError(
i - 1,
std::sqrt(efficiency * efficiency + err * err));
~HLTTauPostProcessor() override
virtual void setCurrentFolder(std::string const &fullpath)
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
virtual TH1F * getTH1F() const
virtual bool dirExists(std::string const &path) const
void dqmEndJob(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) override
HLTTauPostProcessor(const edm::ParameterSet &)
virtual int getNbinsX() const
get # of bins in X-axis
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
virtual MonitorElement * get(std::string const &fullpath) const
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
virtual double getBinContent(int binx) const
get content of bin (1-D)
virtual TProfile * getTProfile() const
void plotFilterEfficiencies(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, const std::string &folder) const
const std::string dqmBaseFolder_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)