ATLAS Offline Software
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
xAOD::name
name
Definition:
TriggerMenuJson_v1.cxx:29
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
SG::ReadHandle
Definition:
StoreGate/StoreGate/ReadHandle.h:70
xAOD::TrackParticlesInConeTool::TrackParticlesInConeTool
TrackParticlesInConeTool(const std::string &type, const std::string &name, const IInterface *parent)
constructor
Definition:
TrackParticlesInConeTool.cxx:15
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition:
ICaloAffectedTool.h:24
xAOD::TrackParticlesInConeTool::getTable
const LookUpTable * getTable() const
Definition:
TrackParticlesInConeTool.cxx:33
python.TurnDataReader.dr
dr
Definition:
TurnDataReader.py:112
xAOD::TrackParticlesInConeTool::~TrackParticlesInConeTool
virtual ~TrackParticlesInConeTool(void)
destructor
ITkPixEncoding::lut
constexpr auto lut(Generator &&f)
Definition:
ITkPixQCoreEncodingLUT.h:19
xAOD::TrackParticlesInConeTool::finalize
virtual StatusCode finalize() override
finalize
Definition:
TrackParticlesInConeTool.cxx:28
xAOD::phi
setEt phi
Definition:
TrigEMCluster_v1.cxx:29
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition:
AthMsgStreamMacros.h:33
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?
xAOD::TrackParticlesInConeTool::m_indetTrackParticleLocation
SG::ReadHandleKey< TrackParticleContainer > m_indetTrackParticleLocation
ID track collection name.
Definition:
TrackParticlesInConeTool.h:45
merge.output
output
Definition:
merge.py:17
SG::WriteHandle
Definition:
StoreGate/StoreGate/WriteHandle.h:76
python.CaloScaleNoiseConfig.type
type
Definition:
CaloScaleNoiseConfig.py:78
xAOD::IParticlesLookUpTable
2D look up table for iParticles
Definition:
IParticlesLookUpTable.h:17
TrackParticlesInConeTool.h
AthAlgTool
Definition:
AthAlgTool.h:26
xAOD::TrackParticlesInConeTool::initialize
virtual StatusCode initialize() override
initialize
Definition:
TrackParticlesInConeTool.cxx:23
Generated on Thu Nov 7 2024 21:29:06 for ATLAS Offline Software by
1.8.18