ATLAS Offline Software
Loading...
Searching...
No Matches
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
14
15// STL includes
16
17// FrameWork includes
18#include "Gaudi/Property.h"
20
21
22namespace ClusterMatching {
23
24 // Destructor
27 = default;
28
29 // Athena Algorithm's Hooks
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
42 ATH_MSG_ERROR("Invalid configuration of cluster sortin method");
43 return StatusCode::FAILURE;
44 }
45
46 return StatusCode::SUCCESS;
47 }
48
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
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) {
68 break;
70 break;
72 break;
73 default:
74 ATH_MSG_WARNING("Invalid cluster sorting method configured!");
75 return StatusCode::SUCCESS;
76 }
77
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
static Double_t a
ToolHandle< ICaloClusterMatchingTool > m_clusterMatch
virtual StatusCode execute(const EventContext &ctx) const
virtual ~CaloClusterMatchLinkAlg()
Destructor:
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clusterKey
SG::WriteDecorHandleKey< xAOD::CaloClusterContainer > m_elementLinkName
SG::WriteDecorHandle< xAOD::CaloClusterContainer, std::vector< ElementLink< xAOD::CaloClusterContainer > > > elementLinkDecorHandle_t
static bool gtrMatchedEFrac(const tcmatch_pair &a, const tcmatch_pair &b)
static bool gtrClusterE(const tcmatch_pair &a, const tcmatch_pair &b)
std::pair< const xAOD::CaloCluster *, float > tcmatch_pair
static bool gtrMatchedE(const tcmatch_pair &a, const tcmatch_pair &b)
setBGCode setTAP setLVL2ErrorBits bool