ATLAS Offline Software
Reconstruction
RecoTools
ParticlesInConeTools
src
FlowElementsInConeTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// FlowElementsInConeTool
7
//
8
// (c) ATLAS software
10
11
//<<<<<< INCLUDES >>>>>>
12
#include "
FlowElementsInConeTool.h
"
13
14
namespace
xAOD
{
15
16
//<<<<<< CLASS STRUCTURE INITIALIZATION >>>>>>
17
18
FlowElementsInConeTool::FlowElementsInConeTool
(
const
std::string&
type
,
const
std::string&
name
,
const
IInterface*
parent
)
19
:
AthAlgTool
(
type
,
name
,
parent
)
20
{
21
declareInterface<IFlowElementsInConeTool>(
this
);
22
}
23
24
FlowElementsInConeTool::~FlowElementsInConeTool
() =
default
;
25
26
//<<<<<< PUBLIC MEMBER FUNCTION DEFINITIONS >>>>>>
27
28
StatusCode
FlowElementsInConeTool::initialize
() {
29
ATH_CHECK
(
m_pfokey
.initialize());
30
return
StatusCode::SUCCESS;
31
}
32
33
StatusCode
FlowElementsInConeTool::finalize
() {
34
return
StatusCode::SUCCESS;
35
}
36
37
const
FlowElementsInConeTool::LookUpTable
*
38
FlowElementsInConeTool::getTable
()
const
39
{
40
const
std::string tableName =
name
() +
"LookUpTable"
;
41
SG::ReadHandle<LookUpTable>
rh (tableName);
42
if
(rh.
isValid
())
43
return
&*rh;
44
45
46
SG::ReadHandle<FlowElementContainer>
pfos(
m_pfokey
);
47
if
( !pfos.
isValid
() ) {
48
ATH_MSG_WARNING
(
"Unable to open pflow container with key "
<<
m_pfokey
.key());
49
return
nullptr
;
50
}
51
auto
lut
= std::make_unique<LookUpTable>();
52
lut
->init(*pfos);
53
SG::WriteHandle<LookUpTable>
wh
(tableName);
54
return
wh
.put (std::move (
lut
),
true
);
55
}
56
57
bool
FlowElementsInConeTool::particlesInCone
(
float
eta,
float
phi
,
float
dr
, std::vector<const FlowElement*>&
output
)
const
{
58
60
const
LookUpTable
*
lut
=
getTable
();
61
return
lut
->iParticlesInCone( eta,
phi
,
dr
,
output
);
62
}
63
}
// end of namespace
xAOD::name
name
Definition:
TriggerMenuJson_v1.cxx:29
xAOD::FlowElementsInConeTool::particlesInCone
bool particlesInCone(float eta, float phi, float dr, std::vector< const FlowElement * > &output) const override
IFlowElementsInConeTool interface.
Definition:
FlowElementsInConeTool.cxx:57
xAOD::FlowElementsInConeTool::finalize
StatusCode finalize() override
finalize
Definition:
FlowElementsInConeTool.cxx:33
SG::ReadHandle
Definition:
StoreGate/StoreGate/ReadHandle.h:70
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition:
ICaloAffectedTool.h:24
python.TurnDataReader.dr
dr
Definition:
TurnDataReader.py:112
ITkPixEncoding::lut
constexpr auto lut(Generator &&f)
Definition:
ITkPixQCoreEncodingLUT.h:19
xAOD::FlowElementsInConeTool::FlowElementsInConeTool
FlowElementsInConeTool(const std::string &type, const std::string &name, const IInterface *parent)
constructor
Definition:
FlowElementsInConeTool.cxx:18
xAOD::phi
setEt phi
Definition:
TrigEMCluster_v1.cxx:29
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
test_pyathena.parent
parent
Definition:
test_pyathena.py:15
parseDir.wh
wh
Definition:
parseDir.py:46
ATH_CHECK
#define ATH_CHECK
Definition:
AthCheckMacros.h:40
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
merge.output
output
Definition:
merge.py:17
xAOD::FlowElementsInConeTool::initialize
StatusCode initialize() override
initialize
Definition:
FlowElementsInConeTool.cxx:28
FlowElementsInConeTool.h
xAOD::FlowElementsInConeTool::~FlowElementsInConeTool
~FlowElementsInConeTool(void)
destructor
SG::WriteHandle
Definition:
StoreGate/StoreGate/WriteHandle.h:76
xAOD::FlowElementsInConeTool::m_pfokey
SG::ReadHandleKey< FlowElementContainer > m_pfokey
to retrieve pflow objects
Definition:
FlowElementsInConeTool.h:43
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition:
AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition:
CaloScaleNoiseConfig.py:78
xAOD::IParticlesLookUpTable
2D look up table for iParticles
Definition:
IParticlesLookUpTable.h:17
xAOD::FlowElementsInConeTool::getTable
const LookUpTable * getTable() const
Definition:
FlowElementsInConeTool.cxx:38
AthAlgTool
Definition:
AthAlgTool.h:26
Generated on Thu Nov 7 2024 21:15:21 for ATLAS Offline Software by
1.8.18