ATLAS Offline Software
Reconstruction
Jet
JetJvtEfficiency
Root
JvtSelectionTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
JetJvtEfficiency/JvtSelectionTool.h
"
6
#include "
AsgDataHandles/ReadDecorHandle.h
"
7
8
namespace
{
9
const
static
std::map<std::string, float> pflowWPMap{{
"Medium"
, 0.2}, {
"Tight"
, 0.5}};
10
const
static
std::map<std::string, float> topoWPMap{
11
{
"Loose"
, 0.11}, {
"Medium"
, 0.59}, {
"Tight"
, 0.91}};
12
}
// namespace
13
14
namespace
CP
{
15
16
StatusCode
JvtSelectionTool::initialize
() {
17
ATH_MSG_WARNING
(
"Jvt is deprecated, please move to using NNJvt"
);
18
ATH_CHECK
(
JvtSelectionToolBase::initialize
());
19
20
m_jvtAcc
=
SG::ConstAccessor<float>
(
m_jvtMoment
.key());
21
if
(
m_jetContainer
.empty()) {
22
ATH_MSG_WARNING
(
"No JetContainer set. This behaviour is deprecated"
);
23
ATH_CHECK
(
m_jvtMoment
.initialize(
false
));
24
}
25
else
{
26
m_jvtMoment
=
m_jetContainer
+
"."
+
m_jvtMoment
.key();
27
ATH_CHECK
(
m_jvtMoment
.initialize());
28
}
29
30
if
(
m_wp
!=
"Custom"
) {
31
if
(
m_wp
==
"Default"
)
32
m_wp
=
m_isPFlow
.value() ?
"Tight"
:
"Medium"
;
33
m_jvtCutBorder
= (!
m_isPFlow
.value() &&
m_wp
==
"Medium"
) ? 0.11 : -2.;
34
const
auto
&map =
m_isPFlow
.value() ? pflowWPMap : topoWPMap;
35
auto
itr = map.find(
m_wp
);
36
if
(itr == map.end()) {
37
ATH_MSG_ERROR
(
"Invalid Jvt working point name"
);
38
return
StatusCode::FAILURE;
39
}
40
m_jvtCut
= itr->second;
41
}
42
43
return
StatusCode::SUCCESS;
44
}
45
46
bool
JvtSelectionTool::select
(
const
xAOD::IParticle
*
jet
)
const
{
47
float
eta =
m_etaAcc
(*
jet
);
48
if
(std::abs(eta) > 2.4 && std::abs(eta) < 2.5)
49
return
m_jvtAcc
(*
jet
) >
m_jvtCutBorder
;
50
else
51
return
m_jvtAcc
(*
jet
) >
m_jvtCut
;
52
}
53
54
}
// namespace CP
CP::JvtSelectionTool::select
virtual bool select(const xAOD::IParticle *jet) const override
Definition:
JvtSelectionTool.cxx:46
CP::JvtSelectionTool::m_jvtAcc
SG::ConstAccessor< float > m_jvtAcc
Definition:
JvtSelectionTool.h:45
JvtSelectionTool.h
CP::JvtSelectionTool::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition:
JvtSelectionTool.cxx:16
CP::JvtSelectionTool::m_wp
Gaudi::Property< std::string > m_wp
Definition:
JvtSelectionTool.h:30
CP::JvtSelectionTool::m_jetContainer
Gaudi::Property< std::string > m_jetContainer
Definition:
JvtSelectionTool.h:23
CP::JvtSelectionTool::m_jvtCut
Gaudi::Property< float > m_jvtCut
Definition:
JvtSelectionTool.h:36
CP::JvtSelectionTool::m_jvtMoment
SG::ReadDecorHandleKey< xAOD::JetContainer > m_jvtMoment
Definition:
JvtSelectionTool.h:37
SG::ConstAccessor< float >
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition:
Event/xAOD/xAODBase/xAODBase/IParticle.h:41
CP
Select isolated Photons, Electrons and Muons.
Definition:
Control/xAODRootAccess/xAODRootAccess/TEvent.h:48
jet
Definition:
JetCalibTools_PlotJESFactors.cxx:23
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition:
AthMsgStreamMacros.h:33
CP::JvtSelectionToolBase::initialize
virtual StatusCode initialize() override
Dummy implementation of the initialisation function.
Definition:
JvtSelectionToolBase.cxx:9
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_CHECK
#define ATH_CHECK
Definition:
AthCheckMacros.h:40
CP::JvtSelectionTool::m_jvtCutBorder
Gaudi::Property< float > m_jvtCutBorder
Definition:
JvtSelectionTool.h:33
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition:
AthMsgStreamMacros.h:32
ReadDecorHandle.h
Handle class for reading a decoration on an object.
CP::JvtSelectionTool::m_isPFlow
Gaudi::Property< bool > m_isPFlow
Definition:
JvtSelectionTool.h:26
CP::JvtSelectionToolBase::m_etaAcc
SG::ConstAccessor< float > m_etaAcc
Definition:
JvtSelectionToolBase.h:44
Generated on Thu Nov 7 2024 21:18:40 for ATLAS Offline Software by
1.8.18