ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetMonitoring
src
JetMonitoringTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
JetMonitoringTool.h
"
6
#include "
xAODJet/JetContainer.h
"
7
8
JetMonitoringTool::JetMonitoringTool
(
const
std::string&
type
,
9
const
std::string& name,
10
const
IInterface* parent ):
11
ManagedMonitorToolBase
(
type
, name, parent )
12
,
m_htools
(this)
13
// , m_interval(HistoGroupBase::all)
14
,
m_interval
(
HistoGroupBase
::
lumiBlock
)
15
{
16
17
declareProperty
(
"HistoTools"
,
m_htools
);
18
declareProperty
(
"HistoDir"
,
m_histoDir
=
"Jets/"
);
19
declareProperty
(
"IntervalType"
,
m_interval
);
20
}
21
22
// Destructor
24
JetMonitoringTool::~JetMonitoringTool
()
25
=
default
;
26
27
// Athena algtool's Hooks
29
StatusCode
JetMonitoringTool::initialize
()
30
{
31
// ATH_MSG_INFO ("Initializing " << name() << "...");
32
ATH_CHECK
(
ManagedMonitorToolBase::initialize
());
33
CHECK
(
m_htools
.retrieve() );
34
35
// All subtools in JetMonitoringTool must act on the same container.
36
// Force it so the histo naming done by the subtool is correct.
37
std::string prefix =
m_histoDir
;
38
for
(
auto
jtool :
m_htools
){
39
jtool->prefixHistoDir( prefix );
40
}
41
return
StatusCode::SUCCESS;
42
}
43
44
StatusCode
JetMonitoringTool::bookHistograms
()
45
{
46
/* ATH_MSG_INFO ("Booking hists " << name() << "...");
47
ATH_MSG_INFO (" Tools size = " << m_htools.size() << "...");*/
48
49
// loop over tools : for each tool, register its histos
50
for
(
auto
jtool :
m_htools
){
51
ATH_MSG_DEBUG
(
" Building histos for tool "
<< jtool->name() );
52
jtool->setInterval((
HistoGroupBase::Interval_t
)
m_interval
);
53
if
( jtool->buildHistos() != 0 )
continue
;
54
55
// retrieve histos and their paths
56
const
auto
& hdata = jtool->bookedHistograms();
57
// loop over histos
58
for
(
const
auto
& hd : hdata){
59
ATH_MSG_DEBUG
(
"Initializing "
<< hd.hist <<
" name= "
<< hd.hist->GetName() <<
" path="
<< hd.path <<
"..."
<< hd.interval <<
" dir="
<<hd.hist->GetDirectory());
60
ATH_CHECK
(
regHist
(hd.hist,hd.path, (
Interval_t
) hd.interval));
61
ATH_MSG_DEBUG
(
" -->> "
<< hd.hist->GetName() <<
" dir="
<<hd.hist->GetDirectory() <<
" "
<< hd.hist->kCanDelete );
62
}
// loop over histos
63
}
// loop over tools
64
65
return
StatusCode::SUCCESS;
66
}
67
68
StatusCode
JetMonitoringTool::fillHistograms
(
const
EventContext&
/*ctx*/
)
69
{
70
ATH_MSG_DEBUG
(
"Filling hists "
<< name() <<
"..."
);
71
73
int
count
= 0;
74
for
(
auto
jtool :
m_htools
){
75
count
+= jtool->fillHistos();
76
}
77
78
return
count
==0 ? StatusCode::SUCCESS : StatusCode::FAILURE ;
79
}
80
81
StatusCode
JetMonitoringTool::procHistograms
()
82
{
83
// ATH_MSG_INFO ("Finalising hists " << name() << "...");
84
// m_oMuonValidationPlots.finalize();
85
return
StatusCode::SUCCESS;
86
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
JetContainer.h
JetMonitoringTool.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
HistoGroupBase
A base class for dual-use tools managing and filling a list of histograms.
Definition
HistoGroupBase.h:27
HistoGroupBase::Interval_t
Interval_t
Redefinition of fill intervals as in ManagedMonitorToolBase.
Definition
HistoGroupBase.h:37
JetMonitoringTool::initialize
virtual StatusCode initialize()
Definition
JetMonitoringTool.cxx:29
JetMonitoringTool::m_interval
int m_interval
Default monitoring interval for all children tools.
Definition
JetMonitoringTool.h:60
JetMonitoringTool::~JetMonitoringTool
virtual ~JetMonitoringTool()
Destructor:
JetMonitoringTool::m_histoDir
std::string m_histoDir
Directory under which all histos filled by this tool will live.
Definition
JetMonitoringTool.h:57
JetMonitoringTool::JetMonitoringTool
JetMonitoringTool()
Default constructor:
JetMonitoringTool::procHistograms
virtual StatusCode procHistograms()
An inheriting class should either override this function or finalHists().
Definition
JetMonitoringTool.cxx:81
JetMonitoringTool::m_htools
ToolHandleArray< JetContainerHistoFiller > m_htools
Definition
JetMonitoringTool.h:54
JetMonitoringTool::bookHistograms
virtual StatusCode bookHistograms()
An inheriting class should either override this function or bookHists().
Definition
JetMonitoringTool.cxx:44
JetMonitoringTool::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx)
An inheriting class should either override this function or fillHists().
Definition
JetMonitoringTool.cxx:68
ManagedMonitorToolBase::regHist
virtual StatusCode regHist(TH1 *h, const std::string &system, Interval_t interval, MgmtAttr_t histo_mgmt=ATTRIB_MANAGED, const std::string &chain="", const std::string &merge="")
Registers a TH1 (including TH2, TH3, and TProfile) to be included in the output stream using logical ...
Definition
ManagedMonitorToolBase.cxx:1345
ManagedMonitorToolBase::Interval_t
Interval_t
An enumeration describing how detailed a particular monitoring object is.
Definition
ManagedMonitorToolBase.h:114
ManagedMonitorToolBase::lumiBlock
@ lumiBlock
Definition
ManagedMonitorToolBase.h:114
ManagedMonitorToolBase::ManagedMonitorToolBase
ManagedMonitorToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition
ManagedMonitorToolBase.cxx:339
ManagedMonitorToolBase::initialize
virtual StatusCode initialize()
Definition
ManagedMonitorToolBase.cxx:617
count
int count(std::string s, const std::string ®x)
count how many occurances of a regx are in a string
Definition
hcg.cxx:148
type
Generated on
for ATLAS Offline Software by
1.17.0