ATLAS Offline Software
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"
7 #include "AsgMessaging/Check.h"
8 
9 #include "TH1D.h"
10 
11 namespace egammaMonitoring {
12 
13  EfficiencyPlot::EfficiencyPlot(std::string name, std::string folder, ITHistSvc * &rootHistSvc ) :
14  m_name(std::move(name)),
15  m_folder(std::move(folder)),
16  m_rootHistSvc(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
egammaMonitoring::IHistograms
Definition: IHistograms.h:18
egammaMonitoring::EfficiencyPlot::EfficiencyPlot
EfficiencyPlot(std::string name, std::string folder, ITHistSvc *&rootHistSvc)
Definition: EfficiencyPlot.cxx:13
Check.h
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
egammaMonitoring::EfficiencyPlot::m_folder
std::string m_folder
Definition: EfficiencyPlot.h:23
TH1D
Definition: rootspy.cxx:342
efficiency
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="")
Definition: dependence.cxx:128
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
EfficiencyPlot.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
egammaMonitoring
Definition: ClusterHistograms.h:16
egammaMonitoring::EfficiencyPlot::m_rootHistSvc
ITHistSvc * m_rootHistSvc
Definition: EfficiencyPlot.h:24
egammaMonitoring::EfficiencyPlot::divide
StatusCode divide(IHistograms *pass, IHistograms *total)
Definition: EfficiencyPlot.cxx:19
CaloCondBlobAlgs_fillNoiseFromASCII.folder
folder
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:56
egammaMonitoring::EfficiencyPlot::m_name
std::string m_name
Definition: EfficiencyPlot.h:22
egammaMonitoring::IHistograms::histoMap
std::map< std::string, TH1D * > histoMap
Definition: IHistograms.h:37