ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
RecoTools
ParticlesInConeTools
src
PFlowObjectsInConeTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// PFlowObjectsInConeTool
7
//
8
// (c) ATLAS software
10
11
//<<<<<< INCLUDES >>>>>>
12
#include "
PFlowObjectsInConeTool.h
"
13
#include "
PFlowUtils/PFODefs.h
"
14
15
namespace
xAOD
{
16
17
//<<<<<< CLASS STRUCTURE INITIALIZATION >>>>>>
18
19
PFlowObjectsInConeTool::PFlowObjectsInConeTool
(
const
std::string&
type
,
const
std::string&
name
,
const
IInterface* parent)
20
:
AthAlgTool
(
type
,
name
, parent)
21
{
22
declareInterface<IPFlowObjectsInConeTool>(
this
);
23
}
24
25
PFlowObjectsInConeTool::~PFlowObjectsInConeTool
() =
default
;
26
27
//<<<<<< PUBLIC MEMBER FUNCTION DEFINITIONS >>>>>>
28
29
StatusCode
PFlowObjectsInConeTool::initialize
() {
30
ATH_CHECK
(
m_pfokey
.initialize());
31
return
StatusCode::SUCCESS;
32
}
33
34
StatusCode
PFlowObjectsInConeTool::finalize
() {
35
return
StatusCode::SUCCESS;
36
}
37
38
const
PFlowObjectsInConeTool::LookUpTable
*
39
PFlowObjectsInConeTool::getTable
()
const
40
{
41
const
std::string tableName =
name
() +
"LookUpTable"
;
42
SG::ReadHandle<LookUpTable>
rh (tableName);
43
if
(rh.
isValid
())
44
return
&*rh;
45
46
47
SG::ReadHandle<PFOContainer>
pfos(
m_pfokey
);
48
if
( !pfos.
isValid
() ) {
49
ATH_MSG_WARNING
(
"Unable to open pflow container with key "
<<
m_pfokey
.key());
50
return
nullptr
;
51
}
52
auto
lut = std::make_unique<LookUpTable>();
53
lut->init(*pfos);
54
SG::WriteHandle<LookUpTable>
wh (tableName);
55
return
wh.put (std::move (lut),
true
);
56
}
57
58
bool
PFlowObjectsInConeTool::particlesInCone
(
float
eta
,
float
phi
,
float
dr, std::vector<const PFO*>& output )
const
{
59
61
const
LookUpTable
* lut =
getTable
();
62
return
lut->iParticlesInCone(
eta
,
phi
, dr, output );
63
}
64
}
// 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:46
PFlowObjectsInConeTool.h
PFODefs.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::PFlowObjectsInConeTool::getTable
const LookUpTable * getTable() const
Definition
PFlowObjectsInConeTool.cxx:39
xAOD::PFlowObjectsInConeTool::PFlowObjectsInConeTool
PFlowObjectsInConeTool(const std::string &type, const std::string &name, const IInterface *parent)
constructor
Definition
PFlowObjectsInConeTool.cxx:19
xAOD::PFlowObjectsInConeTool::particlesInCone
bool particlesInCone(float eta, float phi, float dr, std::vector< const PFO * > &output) const override
IPFlowObjectsInConeTool interface.
Definition
PFlowObjectsInConeTool.cxx:58
xAOD::PFlowObjectsInConeTool::initialize
StatusCode initialize() override
initialize
Definition
PFlowObjectsInConeTool.cxx:29
xAOD::PFlowObjectsInConeTool::LookUpTable
IParticlesLookUpTable< PFO > LookUpTable
Definition
PFlowObjectsInConeTool.h:37
xAOD::PFlowObjectsInConeTool::~PFlowObjectsInConeTool
~PFlowObjectsInConeTool(void)
destructor
xAOD::PFlowObjectsInConeTool::finalize
StatusCode finalize() override
finalize
Definition
PFlowObjectsInConeTool.cxx:34
xAOD::PFlowObjectsInConeTool::m_pfokey
SG::ReadHandleKey< PFOContainer > m_pfokey
to retrieve pflow objects
Definition
PFlowObjectsInConeTool.h:43
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