ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
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
eta
Scalar eta() const
pseudorapidity method
Definition
AmgMatrixBasePlugin.h:83
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
FlowElementsInConeTool.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
xAOD::FlowElementsInConeTool::FlowElementsInConeTool
FlowElementsInConeTool(const std::string &type, const std::string &name, const IInterface *parent)
constructor
Definition
FlowElementsInConeTool.cxx:18
xAOD::FlowElementsInConeTool::initialize
StatusCode initialize() override
initialize
Definition
FlowElementsInConeTool.cxx:28
xAOD::FlowElementsInConeTool::LookUpTable
IParticlesLookUpTable< FlowElement > LookUpTable
Definition
FlowElementsInConeTool.h:37
xAOD::FlowElementsInConeTool::m_pfokey
SG::ReadHandleKey< FlowElementContainer > m_pfokey
to retrieve pflow objects
Definition
FlowElementsInConeTool.h:43
xAOD::FlowElementsInConeTool::getTable
const LookUpTable * getTable() const
Definition
FlowElementsInConeTool.cxx:38
xAOD::FlowElementsInConeTool::finalize
StatusCode finalize() override
finalize
Definition
FlowElementsInConeTool.cxx:33
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::~FlowElementsInConeTool
~FlowElementsInConeTool(void)
destructor
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition
ICaloAffectedTool.h:24
xAOD::name
name
Definition
TriggerMenuJson_v1.cxx:29
xAOD::phi
setEt phi
Definition
TrigEMCluster_v1.cxx:29
type
Generated on
for ATLAS Offline Software by
1.17.0