ATLAS Offline Software
Loading...
Searching...
No Matches
egammaSwTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "egammaSwTool.h"
6
10
11#include "GaudiKernel/TypeNameString.h"
12
13#include <algorithm>
14
15
17 const std::string& name,
18 const IInterface* parent)
19 : AthAlgTool(type, name, parent)
20{
21
22 // declare interface
23 declareInterface<IegammaSwTool>(this);
24}
25
26StatusCode
54
55StatusCode
56egammaSwTool::execute(const EventContext& ctx, xAOD::CaloCluster* cluster) const
57{
58 ATH_MSG_DEBUG("Executing egammaSwTool");
59
60 // protection against bad clusters
61 if (cluster == nullptr)
62 return StatusCode::SUCCESS;
63
64 xAOD::CaloCluster::ClusterSize requestedSize = cluster->clusterSize();
65 switch (requestedSize) {
68 break;
69 }
72 break;
73 }
76 break;
77 }
80 break;
81 }
84 break;
85 }
88 break;
89 }
92 break;
93 }
96 break;
97 }
100 break;
101 }
102 default: {
104 "Inexisting cluster type and calibration requested: " << requestedSize);
105 return StatusCode::FAILURE;
106 }
107 }
108 return StatusCode::SUCCESS;
109}
110// ==============================================================
111// ATHENA EXECUTE METHOD for superClusters
112
113StatusCode
114egammaSwTool::execute(const EventContext& ctx,
115 xAOD::CaloCluster* cluster,
117 bool isBarrel) const
118{
119 // protection against bad clusters
120 if (cluster == nullptr) {
121 return StatusCode::SUCCESS;
122 }
123
124 if (isBarrel) {
125 switch (egType) {
129 break;
130 }
134 break;
135 }
139 break;
140 }
141 default: {
142 ATH_MSG_ERROR("Inexisting correction requested for egType: "
143 << egType << " isBarrel: " << isBarrel);
144 return StatusCode::FAILURE;
145 break;
146 }
147 }
148 } else {
149 switch (egType) {
153 break;
154 }
158 break;
159 }
163 break;
164 }
165 default: {
166 ATH_MSG_ERROR("Inexisting correction requested for egType: "
167 << egType << " isBarrel: " << isBarrel);
168 return StatusCode::FAILURE;
169 }
170 }
171 }
172 return StatusCode::SUCCESS;
173}
174
175StatusCode
176egammaSwTool::processTools(const EventContext& ctx,
177 const ToolHandleArray<CaloClusterProcessor>& tools,
178 xAOD::CaloCluster* cluster) const
179{
180 auto firstTool = tools.begin();
181 auto lastTool = tools.end();
182 // loop tools
183 for (; firstTool != lastTool; ++firstTool) {
184 ATH_CHECK((*firstTool)->execute(ctx, cluster));
185 }
186 return StatusCode::SUCCESS;
187}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
Calculate total energy, position, etc. for a given layer of a cluster.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersGam35
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersSuperClusterEle37
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersSuperClusterEle55
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersGam55
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersSuperClusterGam35
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersEle37
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersSuperClusterEle35
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersEle35
egammaSwTool(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersEconv35
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersSuperClusterGam37
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersGam37
StatusCode processTools(const EventContext &ctx, const ToolHandleArray< CaloClusterProcessor > &tools, xAOD::CaloCluster *cluster) const
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloCluster *cluster) const override final
execute method
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersEle55
a list of names for tools to correct clusters
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersSuperClusterEconv35
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersEconv55
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersSuperClusterEconv55
virtual StatusCode initialize() override
initialize method
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersSuperClusterGam55
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersSuperClusterEconv37
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersEconv37
ClusterSize clusterSize() const
Get cluster size.
ClusterSize
Enumeration to identify different cluster sizes.
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.