ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
RecoTools
ParticlesInConeTools
src
TrackParticlesInConeTool.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
// TrackParticlesInConeTool
7
//
8
// (c) ATLAS software
10
11
#include "
TrackParticlesInConeTool.h
"
12
13
namespace
xAOD
{
14
15
TrackParticlesInConeTool::TrackParticlesInConeTool
(
const
std::string&
type
,
const
std::string&
name
,
const
IInterface* parent)
16
:
AthAlgTool
(
type
,
name
, parent)
17
{
18
declareInterface<ITrackParticlesInConeTool>(
this
);
19
}
20
21
TrackParticlesInConeTool::~TrackParticlesInConeTool
() =
default
;
22
23
StatusCode
TrackParticlesInConeTool::initialize
() {
24
ATH_CHECK
(
m_indetTrackParticleLocation
.initialize());
25
return
StatusCode::SUCCESS;
26
}
27
28
StatusCode
TrackParticlesInConeTool::finalize
() {
29
return
StatusCode::SUCCESS;
30
}
31
32
const
TrackParticlesInConeTool::LookUpTable
*
33
TrackParticlesInConeTool::getTable
()
const
34
{
35
const
std::string tableName =
name
() +
"LookUpTable"
;
36
SG::ReadHandle<LookUpTable>
rh (tableName);
37
if
(rh.
isValid
())
38
return
&*rh;
39
40
SG::ReadHandle<TrackParticleContainer>
indetTrackParticles(
m_indetTrackParticleLocation
);
41
if
( !indetTrackParticles.
isValid
() ) {
42
ATH_MSG_ERROR
(
"Could not open the TrackParticle container with key "
43
<<
m_indetTrackParticleLocation
.key());
44
return
nullptr
;
45
}
46
auto
lut = std::make_unique<LookUpTable>();
47
lut->init(*indetTrackParticles);
48
SG::WriteHandle<LookUpTable>
wh (tableName);
49
return
wh.put (std::move (lut),
true
);
50
}
51
52
bool
TrackParticlesInConeTool::particlesInCone
(
float
eta
,
float
phi
,
float
dr, std::vector< const TrackParticle*>& output )
const
{
53
55
const
LookUpTable
* lut =
getTable
();
56
return
lut->iParticlesInCone(
eta
,
phi
, dr, output );
57
}
58
}
// 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_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
TrackParticlesInConeTool.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::TrackParticlesInConeTool::TrackParticlesInConeTool
TrackParticlesInConeTool(const std::string &type, const std::string &name, const IInterface *parent)
constructor
Definition
TrackParticlesInConeTool.cxx:15
xAOD::TrackParticlesInConeTool::particlesInCone
virtual bool particlesInCone(float eta, float phi, float dr, std::vector< const TrackParticle * > &output) const override
ITrackParticlesInConeTool interface.
Definition
TrackParticlesInConeTool.cxx:52
xAOD::TrackParticlesInConeTool::finalize
virtual StatusCode finalize() override
finalize
Definition
TrackParticlesInConeTool.cxx:28
xAOD::TrackParticlesInConeTool::m_indetTrackParticleLocation
SG::ReadHandleKey< TrackParticleContainer > m_indetTrackParticleLocation
ID track collection name.
Definition
TrackParticlesInConeTool.h:45
xAOD::TrackParticlesInConeTool::LookUpTable
IParticlesLookUpTable< TrackParticle > LookUpTable
Definition
TrackParticlesInConeTool.h:38
xAOD::TrackParticlesInConeTool::initialize
virtual StatusCode initialize() override
initialize
Definition
TrackParticlesInConeTool.cxx:23
xAOD::TrackParticlesInConeTool::~TrackParticlesInConeTool
virtual ~TrackParticlesInConeTool(void)
destructor
xAOD::TrackParticlesInConeTool::getTable
const LookUpTable * getTable() const
Definition
TrackParticlesInConeTool.cxx:33
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