ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
eflowRec
src
PFUnifiedMomentCalculatorTool.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
PFUnifiedMomentCalculatorTool.h
"
6
#include "
PFData.h
"
7
#include "
eflowCaloObject.h
"
8
#include "
eflowRecCluster.h
"
9
10
#include "
xAODCaloEvent/CaloClusterKineHelper.h
"
11
12
PFUnifiedMomentCalculatorTool::PFUnifiedMomentCalculatorTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent) :
13
base_class(
type
, name, parent)
14
{
15
}
16
17
StatusCode
PFUnifiedMomentCalculatorTool::initialize
(){
18
19
/* Retrieve the cluster collection tool */
20
ATH_CHECK
(
m_clusterCollectionTool
.retrieve());
21
22
/* Retrieve the cluster moments maker */
23
ATH_CHECK
(
m_clusterMomentsMaker
.retrieve());
24
25
/* Retrieve the cluster calib hit moments maker */
26
if
(
m_useCalibHitTruth
)
ATH_CHECK
(
m_clusterCalibHitMomentsMaker2
.retrieve());
27
else
m_clusterCalibHitMomentsMaker2
.disable();
28
29
return
StatusCode::SUCCESS;
30
}
31
32
StatusCode
PFUnifiedMomentCalculatorTool::processPFlowData
(
const
EventContext& ctx,
PFData
&thePFData)
const
{
33
34
if
(!thePFData.
caloObjects
) {
35
ATH_MSG_ERROR
(
"PFData::caloObjects is null; caller must set it before invoking the moment calculator tool"
);
36
return
StatusCode::FAILURE;
37
}
38
39
eflowCaloObjectContainer
*theEflowCaloObjectContainer = thePFData.
caloObjects
;
40
41
/* Collect all the clusters in a temporary container (with VIEW_ELEMENTS!) */
42
bool
useNonModifiedClusters =
true
;
43
if
(
true
==
m_LCMode
) useNonModifiedClusters =
false
;
44
std::unique_ptr<xAOD::CaloClusterContainer> tempClusterContainer =
m_clusterCollectionTool
->execute(*theEflowCaloObjectContainer, useNonModifiedClusters);
45
46
/* Set the layer energies */
47
/* This must be set before the cluster moment calculations, which use the layer energies */
48
for
(
auto
cluster : *tempClusterContainer)
CaloClusterKineHelper::calculateKine
(cluster,
true
,
true
);
49
50
/* Remake the cluster moments */
51
ATH_CHECK
(
m_clusterMomentsMaker
->execute(ctx, tempClusterContainer.get()));
52
53
if
(
m_useCalibHitTruth
){
54
ATH_CHECK
(
m_clusterCalibHitMomentsMaker2
->execute(ctx, tempClusterContainer.get()));
55
}
56
57
return
StatusCode::SUCCESS;
58
}
59
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
CaloClusterKineHelper.h
PFData.h
PFUnifiedMomentCalculatorTool.h
CaloClusterKineHelper::calculateKine
static void calculateKine(xAOD::CaloCluster *clu, const bool useweight=true, const bool updateLayers=true, const bool useGPUCriteria=false)
Helper class to calculate cluster kinematics based on cells.
Definition
CaloClusterKineHelper.cxx:223
PFUnifiedMomentCalculatorTool::m_LCMode
Gaudi::Property< bool > m_LCMode
Toggle whether we are in LC mode - false by default.
Definition
PFUnifiedMomentCalculatorTool.h:42
PFUnifiedMomentCalculatorTool::m_useCalibHitTruth
Gaudi::Property< bool > m_useCalibHitTruth
Toggle usage of calibration hit truth - false by default.
Definition
PFUnifiedMomentCalculatorTool.h:45
PFUnifiedMomentCalculatorTool::m_clusterMomentsMaker
ToolHandle< CaloClusterCollectionProcessor > m_clusterMomentsMaker
Tool to calculate cluster moments.
Definition
PFUnifiedMomentCalculatorTool.h:36
PFUnifiedMomentCalculatorTool::m_clusterCollectionTool
ToolHandle< IPFClusterCollectionTool > m_clusterCollectionTool
Tool to put all clusters into a temporary container - then we use this to calculate moments,...
Definition
PFUnifiedMomentCalculatorTool.h:33
PFUnifiedMomentCalculatorTool::initialize
virtual StatusCode initialize() override
Definition
PFUnifiedMomentCalculatorTool.cxx:17
PFUnifiedMomentCalculatorTool::processPFlowData
virtual StatusCode processPFlowData(const EventContext &ctx, PFData &thePFData) const override
Definition
PFUnifiedMomentCalculatorTool.cxx:32
PFUnifiedMomentCalculatorTool::m_clusterCalibHitMomentsMaker2
ToolHandle< CaloClusterCollectionProcessor > m_clusterCalibHitMomentsMaker2
Tool to calculate calibration hit truth cluster moments.
Definition
PFUnifiedMomentCalculatorTool.h:39
PFUnifiedMomentCalculatorTool::PFUnifiedMomentCalculatorTool
PFUnifiedMomentCalculatorTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
PFUnifiedMomentCalculatorTool.cxx:12
eflowCaloObjectContainer
Definition
eflowCaloObject.h:102
eflowCaloObject.h
eflowRecCluster.h
type
PFData
Definition
PFData.h:16
PFData::caloObjects
eflowCaloObjectContainer * caloObjects
Definition
PFData.h:17
Generated on
for ATLAS Offline Software by
1.17.0