ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
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_DEBUG
(
"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
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
Jet.h
NumJetVarTool.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
NumJetVarTool::NumJetVarTool
NumJetVarTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
NumJetVarTool.cxx:9
NumJetVarTool::value
virtual float value(const xAOD::JetContainer &) const
the value of the variable for a given Event
Definition
NumJetVarTool.cxx:26
NumJetVarTool::m_etaMax
Gaudi::Property< float > m_etaMax
Definition
NumJetVarTool.h:34
NumJetVarTool::m_failureOnMissingContainer
bool m_failureOnMissingContainer
Definition
NumJetVarTool.h:36
NumJetVarTool::initialize
virtual StatusCode initialize()
Definition
NumJetVarTool.cxx:18
NumJetVarTool::m_etCut
Gaudi::Property< float > m_etCut
Definition
NumJetVarTool.h:32
NumJetVarTool::m_ptCut
Gaudi::Property< float > m_ptCut
Definition
NumJetVarTool.h:31
NumJetVarTool::m_etaMin
Gaudi::Property< float > m_etaMin
Definition
NumJetVarTool.h:33
jet
Definition
JetCalibTools_PlotJESFactors.cxx:23
xAOD::Jet
Jet_v1 Jet
Definition of the current "jet version".
Definition
Event/xAOD/xAODJet/xAODJet/Jet.h:17
xAOD::JetContainer
JetContainer_v1 JetContainer
Definition of the current "jet container version".
Definition
JetContainer.h:17
type
Generated on
for ATLAS Offline Software by
1.17.0