ATLAS Offline Software
Loading...
Searching...
No Matches
Reconstruction
egamma
egammaValidation
src
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, SmartIF<ITHistSvc> rootHistSvc ) :
14
m_name
(
std
::move(name)),
15
m_folder
(
std
::move(folder)),
16
m_rootHistSvc
(
std
::move(rootHistSvc)) {
17
}
18
19
StatusCode
EfficiencyPlot::divide
(
IHistograms
*pass,
IHistograms
* total) {
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
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
Check.h
EfficiencyPlot.h
egammaMonitoring::EfficiencyPlot::divide
StatusCode divide(IHistograms *pass, IHistograms *total)
Definition
EfficiencyPlot.cxx:19
egammaMonitoring::EfficiencyPlot::m_rootHistSvc
SmartIF< ITHistSvc > m_rootHistSvc
Definition
EfficiencyPlot.h:26
egammaMonitoring::EfficiencyPlot::m_folder
std::string m_folder
Definition
EfficiencyPlot.h:25
egammaMonitoring::EfficiencyPlot::EfficiencyPlot
EfficiencyPlot(std::string name, std::string folder, SmartIF< ITHistSvc > rootHistSvc)
Definition
EfficiencyPlot.cxx:13
egammaMonitoring::EfficiencyPlot::m_name
std::string m_name
Definition
EfficiencyPlot.h:24
egammaMonitoring::IHistograms
Definition
IHistograms.h:21
egammaMonitoring::IHistograms::histoMap
std::map< std::string, TH1D * > histoMap
Definition
IHistograms.h:42
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
egammaMonitoring
Definition
ClusterHistograms.h:19
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.14.0