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);
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"))
40 std::size_t
pos = subfolder.rfind(
'/');
41 if(pos == std::string::npos)
44 if(subfolder.compare(pos, 4,
"HLT_") == 0) {
45 LogDebug(
"HLTTauDQMOffline") <<
"Processing path " << subfolder.substr(pos);
54 if(!eventsPerFilter) {
55 LogDebug(
"HLTTauDQMOffline") <<
"ME " << folder <<
"/EventsPerFilter not found";
63 const TAxis *xaxis = eventsPerFilter->
getTH1F()->GetXaxis();
72 LogDebug(
"HLTTauDQMOffline") <<
"HLTTauPostProcessor: Encountered denominator < numerator with efficiency plot EfficiencyRefPrevious in folder " << folder <<
", bin " <<
i <<
" numerator " << eventsPerFilter->
getBinContent(
i) <<
" denominator " << eventsPerFilter->
getBinContent(
i-1);
76 const float efficiency = std::get<0>(effErr);
77 const float err = std::get<1>(effErr);
79 prev->SetBinContent(
i-1, efficiency);
80 prev->SetBinEntries(
i-1, 1);
81 prev->SetBinError(
i-1,
std::sqrt(efficiency*efficiency + err*err));
~HLTTauPostProcessor() override
MonitorElement * bookProfile(Args &&...args)
MonitorElement * get(const std::string &path)
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)
void dqmEndJob(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter) override
HLTTauPostProcessor(const edm::ParameterSet &)
bin
set the eta bin as selection string.
bool dirExists(const std::string &path)
void setCurrentFolder(const std::string &fullpath)
void plotFilterEfficiencies(DQMStore::IBooker &iBooker, DQMStore::IGetter &iGetter, const std::string &folder) const
TH1F * getTH1F(void) const
std::vector< std::string > getSubdirs(void)
void setCurrentFolder(const std::string &fullpath)
double getBinContent(int binx) const
get content of bin (1-D)
TProfile * getTProfile(void) const
int getNbinsX(void) const
get # of bins in X-axis
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
const std::string dqmBaseFolder_