ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
RecoTools
ParticlesInConeTools
src
CaloClustersInConeTool.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
// CaloClustersInConeTool
7
//
8
// (c) ATLAS software
10
11
#include "
CaloClustersInConeTool.h
"
12
#include "
StoreGate/ReadHandle.h
"
13
#include "
StoreGate/WriteHandle.h
"
14
15
namespace
xAOD
{
16
17
CaloClustersInConeTool::CaloClustersInConeTool
(
const
std::string&
type
,
const
std::string&
name
,
const
IInterface* parent)
18
:
AthAlgTool
(
type
,
name
, parent)
19
{
20
declareInterface<ICaloClustersInConeTool>(
this
);
21
}
22
23
CaloClustersInConeTool::~CaloClustersInConeTool
()
24
=
default
;
25
26
StatusCode
CaloClustersInConeTool::initialize
() {
27
ATH_CHECK
(
m_caloClusterLocation
.initialize());
28
return
StatusCode::SUCCESS;
29
}
30
31
StatusCode
CaloClustersInConeTool::finalize
() {
32
return
StatusCode::SUCCESS;
33
}
34
35
const
CaloClustersInConeTool::LookUpTable
*
36
CaloClustersInConeTool::getTable
()
const
37
{
38
const
std::string tableName =
name
() +
"LookUpTable"
;
39
SG::ReadHandle<LookUpTable>
rh (tableName);
40
if
(rh.
isValid
())
41
return
&*rh;
42
43
44
SG::ReadHandle<CaloClusterContainer>
caloClusters(
m_caloClusterLocation
);
45
if
(!caloClusters.
isValid
()) {
46
ATH_MSG_ERROR
(
"Was not able to access the calo cluster container "
<<
m_caloClusterLocation
.key());
47
return
nullptr
;
48
}
49
auto
lut = std::make_unique<LookUpTable>();
50
lut->init(*caloClusters);
51
SG::WriteHandle<LookUpTable>
wh (tableName);
52
return
wh.put (std::move (lut),
true
);
53
}
54
55
bool
CaloClustersInConeTool::particlesInCone
(
float
eta
,
float
phi
,
float
dr, std::vector< const CaloCluster*>& output )
const
{
57
const
LookUpTable
* lut =
getTable
();
58
59
return
lut->iParticlesInCone(
eta
,
phi
, dr, output );
60
}
61
62
bool
CaloClustersInConeTool::particlesInCone
(
float
eta
,
float
phi
,
float
dr, std::vector<
ElementLink<CaloClusterContainer>
>& output )
const
{
64
const
LookUpTable
* lut =
getTable
();
65
66
return
lut->iParticlesInCone(
eta
,
phi
, dr, output );
67
}
68
}
// 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
CaloClustersInConeTool.h
ReadHandle.h
Handle class for reading from StoreGate.
WriteHandle.h
Handle class for recording to StoreGate.
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
ElementLink
ElementLink implementation for ROOT usage.
Definition
A/AthLinks/ElementLink.h:40
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::CaloClustersInConeTool::~CaloClustersInConeTool
virtual ~CaloClustersInConeTool(void)
destructor
xAOD::CaloClustersInConeTool::finalize
virtual StatusCode finalize() override
finalize
Definition
CaloClustersInConeTool.cxx:31
xAOD::CaloClustersInConeTool::CaloClustersInConeTool
CaloClustersInConeTool(const std::string &type, const std::string &name, const IInterface *parent)
constructor
Definition
CaloClustersInConeTool.cxx:17
xAOD::CaloClustersInConeTool::getTable
const LookUpTable * getTable() const
Definition
CaloClustersInConeTool.cxx:36
xAOD::CaloClustersInConeTool::m_caloClusterLocation
SG::ReadHandleKey< CaloClusterContainer > m_caloClusterLocation
ID track collection name.
Definition
CaloClustersInConeTool.h:47
xAOD::CaloClustersInConeTool::particlesInCone
virtual bool particlesInCone(float eta, float phi, float dr, std::vector< const CaloCluster * > &output) const override
ICaloClustersInConeTool interface.
Definition
CaloClustersInConeTool.cxx:55
xAOD::CaloClustersInConeTool::LookUpTable
IParticlesLookUpTable< CaloCluster > LookUpTable
Definition
CaloClustersInConeTool.h:40
xAOD::CaloClustersInConeTool::initialize
virtual StatusCode initialize() override
initialize
Definition
CaloClustersInConeTool.cxx:26
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