ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
Jet
JetMonitoring
Root
JetContainerHistoFiller.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
JetMonitoring/JetContainerHistoFiller.h
"
6
7
JetContainerHistoFiller::JetContainerHistoFiller
(
const
std::string& n) :
HistoGroupBase
(n)
8
,
m_histoTools
(this)
9
{
10
declareInterface<JetContainerHistoFiller>(
this
);
11
declareProperty
(
"HistoTools"
,
m_histoTools
);
12
13
}
14
15
StatusCode
JetContainerHistoFiller::initialize
() {
16
17
CHECK
(
m_histoTools
.retrieve() );
18
19
if
(
m_jetContainerName
.empty()) {
20
ATH_MSG_ERROR
(
"Jet Container name not set. Please set the JetContainer property"
);
21
return
StatusCode::FAILURE;
22
}
23
CHECK
(
m_jetContainerName
.initialize() );
24
CHECK
(
m_EventInfoKey
.initialize() );
25
26
if
(
m_histoDir
.empty())
m_histoDir
=
m_jetContainerName
.key()+
"/"
;
27
28
return
StatusCode::SUCCESS;
29
}
30
31
32
33
int
JetContainerHistoFiller::fillHistos
(){
34
35
ATH_MSG_DEBUG
(
"Filling hists "
<< name() <<
"..."
<<
m_jetContainerName
.key());
36
37
SG::ReadHandle<xAOD::EventInfo>
evtInfo{
m_EventInfoKey
};
38
if
(!evtInfo.
isValid
()) {
39
ATH_MSG_DEBUG
(
"Unable to retrieve xAOD::EventInfo"
);
40
return
1;
41
}
42
43
//LAr event veto: skip events rejected by LAr
44
if
(evtInfo->errorState(
xAOD::EventInfo::LAr
)==
xAOD::EventInfo::Error
){
45
ATH_MSG_DEBUG
(
"SKIP for LAR error"
);
46
return
1;
47
}
48
49
SG::ReadHandle<xAOD::JetContainer>
jCont{
m_jetContainerName
};
50
if
( !jCont.
isValid
() ) {
51
ATH_MSG_DEBUG
(
" No container "
<<
m_jetContainerName
.key()<<
" in Evt store. Returning."
);
52
return
0;
53
}
54
55
float
weight = evtInfo->beamSpotWeight();
56
58
int
count
= 0;
59
for
(
auto
jtool :
m_histoTools
){
60
ATH_MSG_DEBUG
(
"Filling hists "
<< jtool->name() <<
"..."
<< jCont);
61
62
count
+= jtool->fillHistosFromContainer(*jCont, weight);
63
}
64
65
return
count
;
66
}
67
68
void
JetContainerHistoFiller::setInterval
(
Interval_t
ityp,
bool
force ){
69
// propagate interval to sub-tools
70
for
(
auto
jtool :
m_histoTools
){
71
jtool->setInterval(ityp,force);
72
}
73
}
74
75
76
int
JetContainerHistoFiller::buildHistos
(){
77
int
count
=0;
78
79
ATH_MSG_DEBUG
(
"Building hists "
);
80
81
// ask subtools to build their histos
82
for
(
auto
jtool :
m_histoTools
){
83
count
+=jtool->buildHistos();
84
ATH_MSG_DEBUG
(
" *** Built hist : "
<<jtool->name() );
85
86
// keep a pointer to histos :
87
const
auto
& hdata = jtool->bookedHistograms();
88
for
(
const
auto
& hd : hdata ){
89
m_vBookedHistograms
.push_back(hd);
90
}
91
}
92
return
count
;
93
}
94
95
96
int
JetContainerHistoFiller::finalizeHistos
(){
97
int
count
= 0;
98
for
(
auto
jtool :
m_histoTools
){
99
count
+=jtool->finalizeHistos();
100
}
101
return
count
;
102
}
103
104
void
JetContainerHistoFiller::prefixHistoDir
(
const
std::string & preDir){
105
for
(
auto
jtool :
m_histoTools
){
106
jtool->prefixHistoDir(preDir+
m_histoDir
);
107
}
108
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
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
JetContainerHistoFiller.h
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
HistoGroupBase::m_histoDir
std::string m_histoDir
The path where histos in this group leave.
Definition
HistoGroupBase.h:93
HistoGroupBase::m_vBookedHistograms
std::vector< HistData > m_vBookedHistograms
The list of histos in this group.
Definition
HistoGroupBase.h:90
HistoGroupBase::Interval_t
Interval_t
Redefinition of fill intervals as in ManagedMonitorToolBase.
Definition
HistoGroupBase.h:37
HistoGroupBase::HistoGroupBase
HistoGroupBase(const std::string &t)
Definition
HistoGroupBase.cxx:10
JetContainerHistoFiller::m_histoTools
ToolHandleArray< JetHistoBase > m_histoTools
The list of histogramming tools.
Definition
JetContainerHistoFiller.h:59
JetContainerHistoFiller::initialize
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
Definition
JetContainerHistoFiller.cxx:15
JetContainerHistoFiller::buildHistos
virtual int buildHistos()
Definition
JetContainerHistoFiller.cxx:76
JetContainerHistoFiller::JetContainerHistoFiller
JetContainerHistoFiller(const std::string &t)
Definition
JetContainerHistoFiller.cxx:7
JetContainerHistoFiller::fillHistos
virtual int fillHistos()
Definition
JetContainerHistoFiller.cxx:33
JetContainerHistoFiller::m_EventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKey
Definition
JetContainerHistoFiller.h:62
JetContainerHistoFiller::m_jetContainerName
SG::ReadHandleKey< xAOD::JetContainer > m_jetContainerName
the jet container to build histos from
Definition
JetContainerHistoFiller.h:61
JetContainerHistoFiller::finalizeHistos
virtual int finalizeHistos()
Definition
JetContainerHistoFiller.cxx:96
JetContainerHistoFiller::prefixHistoDir
virtual void prefixHistoDir(const std::string &preDir)
redefine from base class to forward prefix path to sub histos
Definition
JetContainerHistoFiller.cxx:104
JetContainerHistoFiller::setInterval
virtual void setInterval(Interval_t ityp, bool force=false)
Definition
JetContainerHistoFiller.cxx:68
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
xAOD::EventInfo_v1::LAr
@ LAr
The LAr calorimeter.
Definition
EventInfo_v1.h:335
xAOD::EventInfo_v1::Error
@ Error
The sub-detector issued an error.
Definition
EventInfo_v1.h:349
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
Generated on
for ATLAS Offline Software by
1.17.0