ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
RecoTools
CaloClusterMatching
src
CaloClusterMatchLinkAlg.cxx
Go to the documentation of this file.
1
2
3
/*
4
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
// CaloClusterMatchLinkAlg.cxx
8
// Implementation file for class CaloClusterMatchLinkAlg
9
// Author: S.Binet<binet@cern.ch>
11
12
// CaloClusterMatching includes
13
#include "
CaloClusterMatchLinkAlg.h
"
14
15
// STL includes
16
17
// FrameWork includes
18
#include "Gaudi/Property.h"
19
#include "
CaloClusterMatching/TopoClusterMap.h
"
20
21
22
namespace
ClusterMatching
{
23
24
// Destructor
26
CaloClusterMatchLinkAlg::~CaloClusterMatchLinkAlg
()
27
=
default
;
28
29
// Athena Algorithm's Hooks
31
StatusCode
CaloClusterMatchLinkAlg::initialize
()
32
{
33
ATH_MSG_INFO
(
"Initializing "
<<
name
() <<
"..."
);
34
35
ATH_CHECK
(
m_clusterKey
.initialize() );
36
37
ATH_CHECK
(
m_elementLinkName
.initialize() );
38
39
ATH_CHECK
(
m_clusterMatch
.retrieve() );
40
41
if
(
m_clusterSortMethod<0 || m_clusterSortMethod>
ClusterMatching::MatchedEFrac
) {
42
ATH_MSG_ERROR
(
"Invalid configuration of cluster sortin method"
);
43
return
StatusCode::FAILURE;
44
}
45
46
return
StatusCode::SUCCESS;
47
}
48
49
StatusCode
CaloClusterMatchLinkAlg::finalize
()
50
{
51
ATH_MSG_INFO
(
"Finalizing "
<<
name
() <<
"..."
);
52
53
return
StatusCode::SUCCESS;
54
}
55
56
StatusCode
CaloClusterMatchLinkAlg::execute
(
const
EventContext& ctx)
const
57
{
58
ATH_MSG_DEBUG
(
"Executing "
<<
name
() <<
"..."
);
59
60
SG::ReadHandle<xAOD::CaloClusterContainer>
clustersToDecorate (
m_clusterKey
, ctx);
61
62
TopoClusterMap
tcmap;
63
ATH_CHECK
(
m_clusterMatch
->fillClusterMap(ctx,tcmap) );
64
65
bool
(*gtrthan)(
const
tcmatch_pair
&
a
,
const
tcmatch_pair
& b)=
nullptr
;
66
switch
(
m_clusterSortMethod
) {
67
case
ClusterE
: gtrthan =
ClusterMatching::gtrClusterE
;
68
break
;
69
case
MatchedE
: gtrthan =
ClusterMatching::gtrMatchedE
;
70
break
;
71
case
MatchedEFrac
: gtrthan =
ClusterMatching::gtrMatchedEFrac
;
72
break
;
73
default
:
74
ATH_MSG_WARNING
(
"Invalid cluster sorting method configured!"
);
75
return
StatusCode::SUCCESS;
76
}
77
78
ICaloClusterMatchingTool::elementLinkDecorHandle_t
elementLinkDec (
m_elementLinkName
, ctx);
79
for
(
const
auto
*
const
cl : *clustersToDecorate) {
80
ATH_CHECK
(
m_clusterMatch
->linkMatchedClusters(elementLinkDec, *cl, tcmap,
m_useLeadCellEtaPhi
, gtrthan) );
81
}
82
83
return
StatusCode::SUCCESS;
84
}
85
86
}
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
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CaloClusterMatchLinkAlg.h
a
static Double_t a
Definition
LArPhysWaveHECTool.cxx:38
TopoClusterMap.h
ClusterMatching::CaloClusterMatchLinkAlg::initialize
virtual StatusCode initialize()
Definition
CaloClusterMatchLinkAlg.cxx:31
ClusterMatching::CaloClusterMatchLinkAlg::m_clusterSortMethod
Gaudi::Property< int > m_clusterSortMethod
Definition
CaloClusterMatchLinkAlg.h:49
ClusterMatching::CaloClusterMatchLinkAlg::finalize
virtual StatusCode finalize()
Definition
CaloClusterMatchLinkAlg.cxx:49
ClusterMatching::CaloClusterMatchLinkAlg::m_clusterMatch
ToolHandle< ICaloClusterMatchingTool > m_clusterMatch
Definition
CaloClusterMatchLinkAlg.h:50
ClusterMatching::CaloClusterMatchLinkAlg::execute
virtual StatusCode execute(const EventContext &ctx) const
Definition
CaloClusterMatchLinkAlg.cxx:56
ClusterMatching::CaloClusterMatchLinkAlg::~CaloClusterMatchLinkAlg
virtual ~CaloClusterMatchLinkAlg()
Destructor:
ClusterMatching::CaloClusterMatchLinkAlg::m_clusterKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterKey
Definition
CaloClusterMatchLinkAlg.h:47
ClusterMatching::CaloClusterMatchLinkAlg::m_elementLinkName
SG::WriteDecorHandleKey< xAOD::CaloClusterContainer > m_elementLinkName
Definition
CaloClusterMatchLinkAlg.h:53
ClusterMatching::CaloClusterMatchLinkAlg::m_useLeadCellEtaPhi
Gaudi::Property< bool > m_useLeadCellEtaPhi
Definition
CaloClusterMatchLinkAlg.h:48
ICaloClusterMatchingTool::elementLinkDecorHandle_t
SG::WriteDecorHandle< xAOD::CaloClusterContainer, std::vector< ElementLink< xAOD::CaloClusterContainer > > > elementLinkDecorHandle_t
Definition
ICaloClusterMatchingTool.h:47
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
TopoClusterMap
Definition
TopoClusterMap.h:11
ClusterMatching
Definition
ICaloClusterMatchingTool.h:26
ClusterMatching::MatchedE
@ MatchedE
Definition
ICaloClusterMatchingTool.h:35
ClusterMatching::ClusterE
@ ClusterE
Definition
ICaloClusterMatchingTool.h:34
ClusterMatching::MatchedEFrac
@ MatchedEFrac
Definition
ICaloClusterMatchingTool.h:36
ClusterMatching::gtrMatchedEFrac
static bool gtrMatchedEFrac(const tcmatch_pair &a, const tcmatch_pair &b)
Definition
ICaloClusterMatchingTool.h:31
ClusterMatching::gtrClusterE
static bool gtrClusterE(const tcmatch_pair &a, const tcmatch_pair &b)
Definition
ICaloClusterMatchingTool.h:29
ClusterMatching::tcmatch_pair
std::pair< const xAOD::CaloCluster *, float > tcmatch_pair
Definition
ICaloClusterMatchingTool.h:27
ClusterMatching::gtrMatchedE
static bool gtrMatchedE(const tcmatch_pair &a, const tcmatch_pair &b)
Definition
ICaloClusterMatchingTool.h:30
xAOD::name
name
Definition
TriggerMenuJson_v1.cxx:29
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition
TrigDecision_v1.cxx:60
Generated on
for ATLAS Offline Software by
1.17.0