ATLAS Offline Software
Reconstruction
Jet
JetMonitoring
src
NumJetVarTool.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/NumJetVarTool.h
"
6
#include "
xAODJet/Jet.h
"
7
8
9
NumJetVarTool::NumJetVarTool
(
const
std::string &
type
,
const
std::string &
name
,
const
IInterface*
parent
):
10
AthAlgTool
(
type
,
name
,
parent
)
11
, m_failureOnMissingContainer(false)
12
{
13
declareInterface<IEventHistoVarTool>(
this
);
14
declareProperty
(
"FailureOnMissingContainer"
,
m_failureOnMissingContainer
);
15
16
}
17
18
StatusCode
NumJetVarTool::initialize
() {
19
20
ATH_MSG_INFO
(
"Counting number of jets with PtCut: "
<<
m_ptCut
<<
", EtCut: "
<<
m_etCut
<<
", EtaMin: "
<<
m_etaMin
<<
", EtaMax: "
<<
m_etaMax
);
21
22
return
StatusCode::SUCCESS;
23
24
}
25
26
float
NumJetVarTool::value
(
const
xAOD::JetContainer
&
jets
)
const
{
27
28
if
(
jets
.empty() ) {
29
if
(
m_failureOnMissingContainer
){
30
ATH_MSG_ERROR
(
"Input JetContainer could not be found or is empty"
);
31
return
0.;
32
}
else
{
33
ATH_MSG_DEBUG
(
"Input JetContainer could not be found or is empty"
);
34
return
0.;
35
}
36
}
37
38
float
njets = 0.;
39
for
(
const
xAOD::Jet
*
jet
:
jets
) {
40
if
(
jet
->pt() >=
m_ptCut
*1000. &&
jet
->p4().Et() >=
m_etCut
*1000. && fabs(
jet
->eta()) >=
m_etaMin
&& fabs(
jet
->eta()) <=
m_etaMax
) {
41
njets++;
42
}
43
}
44
return
njets;
45
}
NumJetVarTool::value
virtual float value(const xAOD::JetContainer &) const
the value of the variable for a given Event
Definition:
NumJetVarTool.cxx:26
Jet.h
NumJetVarTool::initialize
virtual StatusCode initialize()
Definition:
NumJetVarTool.cxx:18
NumJetVarTool.h
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition:
AthMsgStreamMacros.h:31
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition:
AthCommonDataStore.h:145
NumJetVarTool::m_etaMin
Gaudi::Property< float > m_etaMin
Definition:
NumJetVarTool.h:33
NumJetVarTool::m_etaMax
Gaudi::Property< float > m_etaMax
Definition:
NumJetVarTool.h:34
NumJetVarTool::m_etCut
Gaudi::Property< float > m_etCut
Definition:
NumJetVarTool.h:32
jet
Definition:
JetCalibTools_PlotJESFactors.cxx:23
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition:
AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition:
AthMsgStreamMacros.h:29
test_pyathena.parent
parent
Definition:
test_pyathena.py:15
DataVector
Derived DataVector<T>.
Definition:
DataVector.h:581
NumJetVarTool::NumJetVarTool
NumJetVarTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition:
NumJetVarTool.cxx:9
name
std::string name
Definition:
Control/AthContainers/Root/debug.cxx:221
NumJetVarTool::m_ptCut
Gaudi::Property< float > m_ptCut
Definition:
NumJetVarTool.h:31
xAOD::Jet_v1
Class describing a jet.
Definition:
Jet_v1.h:57
NumJetVarTool::m_failureOnMissingContainer
bool m_failureOnMissingContainer
Definition:
NumJetVarTool.h:36
python.CaloScaleNoiseConfig.type
type
Definition:
CaloScaleNoiseConfig.py:78
defineDB.jets
list jets
Definition:
JetTagCalibration/share/defineDB.py:24
AthAlgTool
Definition:
AthAlgTool.h:26
Generated on Thu Nov 7 2024 21:22:58 for ATLAS Offline Software by
1.8.18