ATLAS Offline Software
Loading...
Searching...
No Matches
EfficiencyPlot.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "EfficiencyPlot.h"
6#include "GaudiKernel/ITHistSvc.h"
8
9#include "TH1D.h"
10
11namespace egammaMonitoring {
12
13 EfficiencyPlot::EfficiencyPlot(std::string name, std::string folder, SmartIF<ITHistSvc> rootHistSvc ) :
14 m_name(std::move(name)),
15 m_folder(std::move(folder)),
16 m_rootHistSvc(std::move(rootHistSvc)) {
17 }
18
20
21 for (const auto &p : total->histoMap){
22 TH1D *efficiency = (TH1D*) pass->histoMap[p.first]->Clone(Form("%s_%s",m_name.c_str(),p.first.c_str()));
23 efficiency->Divide(pass->histoMap[p.first], p.second, 1, 1, "B");
24 efficiency->GetYaxis()->SetTitle("Efficiency");
25 efficiency->GetYaxis()->SetRangeUser(0,1.1);
26 efficiency->SetStats(0);
27 ATH_CHECK(m_rootHistSvc->regHist(Form("%sEff_%s", m_folder.c_str(), p.first.c_str()), efficiency));
28 }
29
30 return StatusCode::SUCCESS;
31
32 } //
33
34} // namespace
#define ATH_CHECK
Evaluate an expression and check for errors.
StatusCode divide(IHistograms *pass, IHistograms *total)
SmartIF< ITHistSvc > m_rootHistSvc
EfficiencyPlot(std::string name, std::string folder, SmartIF< ITHistSvc > rootHistSvc)
std::map< std::string, TH1D * > histoMap
Definition IHistograms.h:42
void efficiency(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
STL namespace.