ATLAS Offline Software
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 
16 egammaSwTool::egammaSwTool(const std::string& type,
17  const std::string& name,
18  const IInterface* parent)
20 {
21 
22  // declare interface
23  declareInterface<IegammaSwTool>(this);
24 }
25 
28 {
32  //
36  //
40  // SuperCluster
44  //
48  //
52  return StatusCode::SUCCESS;
53 }
54 
56 egammaSwTool::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 
114 egammaSwTool::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 
176 egammaSwTool::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 }
xAOD::CaloCluster_v1::ClusterSize
ClusterSize
Enumeration to identify different cluster sizes.
Definition: CaloCluster_v1.h:86
xAOD::EgammaParameters::convertedPhoton
@ convertedPhoton
Definition: EgammaEnums.h:20
egammaSwTool::m_clusterCorrectionPointersSuperClusterEle55
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersSuperClusterEle55
Definition: egammaSwTool.h:123
egammaSwTool::m_clusterCorrectionPointersSuperClusterEle35
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersSuperClusterEle35
Definition: egammaSwTool.h:104
xAOD::CaloCluster_v1::SW_37Econv
@ SW_37Econv
Definition: CaloCluster_v1.h:98
egammaSwTool::m_clusterCorrectionPointersEle55
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersEle55
a list of names for tools to correct clusters
Definition: egammaSwTool.h:57
xAOD::CaloCluster_v1::SW_55gam
@ SW_55gam
Definition: CaloCluster_v1.h:92
egammaSwTool::m_clusterCorrectionPointersGam37
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersGam37
Definition: egammaSwTool.h:82
xAOD::CaloCluster_v1::SW_37gam
@ SW_37gam
Definition: CaloCluster_v1.h:94
xAOD::EgammaParameters::EgammaType
EgammaType
Definition: EgammaEnums.h:17
xAOD::CaloCluster_v1::SW_37ele
@ SW_37ele
Definition: CaloCluster_v1.h:90
egammaSwTool::m_clusterCorrectionPointersSuperClusterGam37
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersSuperClusterGam37
Definition: egammaSwTool.h:148
xAOD::CaloCluster_v1::clusterSize
ClusterSize clusterSize() const
Get cluster size.
Definition: CaloCluster_v1.cxx:364
egammaSwTool::execute
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloCluster *cluster) const override final
execute method
Definition: egammaSwTool.cxx:56
xAOD::CaloCluster_v1::SW_55Econv
@ SW_55Econv
Definition: CaloCluster_v1.h:96
xAOD::CaloCluster_v1
Description of a calorimeter cluster.
Definition: CaloCluster_v1.h:59
egammaSwTool::m_clusterCorrectionPointersEconv55
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersEconv55
Definition: egammaSwTool.h:87
egammaSwTool::processTools
StatusCode processTools(const EventContext &ctx, const ToolHandleArray< CaloClusterProcessor > &tools, xAOD::CaloCluster *cluster) const
Definition: egammaSwTool.cxx:176
egammaSwTool::m_clusterCorrectionPointersGam55
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersGam55
Definition: egammaSwTool.h:77
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
CaloCluster.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::CaloCluster_v1::SW_35gam
@ SW_35gam
Definition: CaloCluster_v1.h:93
egammaSwTool::m_clusterCorrectionPointersSuperClusterGam35
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersSuperClusterGam35
Definition: egammaSwTool.h:116
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
egammaSwTool::m_clusterCorrectionPointersGam35
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersGam35
Definition: egammaSwTool.h:72
egammaSwTool::initialize
virtual StatusCode initialize() override
initialize method
Definition: egammaSwTool.cxx:27
tools
Definition: DataQuality/ZLumiScripts/python/tools/__init__.py:1
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
xAOD::CaloCluster_v1::SW_55ele
@ SW_55ele
Definition: CaloCluster_v1.h:88
egammaSwTool::egammaSwTool
egammaSwTool(const std::string &type, const std::string &name, const IInterface *parent)
Default constructor.
Definition: egammaSwTool.cxx:16
egammaSwTool::m_clusterCorrectionPointersEle35
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersEle35
Definition: egammaSwTool.h:62
xAOD::CaloCluster_v1::SW_35Econv
@ SW_35Econv
Definition: CaloCluster_v1.h:97
CaloClusterStoreHelper.h
egammaSwTool::m_clusterCorrectionPointersSuperClusterEconv37
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersSuperClusterEconv37
Definition: egammaSwTool.h:154
egammaSwTool::m_clusterCorrectionPointersSuperClusterEle37
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersSuperClusterEle37
Definition: egammaSwTool.h:142
egammaSwTool::m_clusterCorrectionPointersEconv37
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersEconv37
Definition: egammaSwTool.h:97
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
xAOD::EgammaParameters::electron
@ electron
Definition: EgammaEnums.h:18
python.LArCondContChannels.isBarrel
isBarrel
Definition: LArCondContChannels.py:659
egammaSwTool::m_clusterCorrectionPointersEconv35
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersEconv35
Definition: egammaSwTool.h:92
egammaSwTool::m_clusterCorrectionPointersSuperClusterGam55
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersSuperClusterGam55
Definition: egammaSwTool.h:129
egammaSwTool::m_clusterCorrectionPointersSuperClusterEconv35
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersSuperClusterEconv35
Definition: egammaSwTool.h:110
egammaSwTool.h
egammaSwTool::m_clusterCorrectionPointersSuperClusterEconv55
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersSuperClusterEconv55
Definition: egammaSwTool.h:135
egammaSwTool::m_clusterCorrectionPointersEle37
ToolHandleArray< CaloClusterProcessor > m_clusterCorrectionPointersEle37
Definition: egammaSwTool.h:67
xAOD::CaloCluster_v1::SW_35ele
@ SW_35ele
Definition: CaloCluster_v1.h:89
AthAlgTool
Definition: AthAlgTool.h:26
CaloLayerCalculator.h
Calculate total energy, position, etc. for a given layer of a cluster.
xAOD::EgammaParameters::unconvertedPhoton
@ unconvertedPhoton
Definition: EgammaEnums.h:19