ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Reconstruction
eflowRec
src
PFMomentCalculatorTool.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 "
PFMomentCalculatorTool.h
"
6
#include "
eflowCaloObject.h
"
7
#include "
eflowRecCluster.h
"
8
9
#include "
xAODCaloEvent/CaloClusterKineHelper.h
"
10
11
PFMomentCalculatorTool::PFMomentCalculatorTool
(
const
std::string&
type
,
const
std::string& name,
const
IInterface* parent) :
12
base_class(
type
, name, parent)
13
{
14
}
15
16
StatusCode
PFMomentCalculatorTool::initialize
(){
17
18
/* Retrieve the cluster collection tool */
19
ATH_CHECK
(
m_clusterCollectionTool
.retrieve());
20
21
/* Retrieve the cluster moments maker */
22
ATH_CHECK
(
m_clusterMomentsMaker
.retrieve());
23
24
/* Retrieve the cluster calib hit moments maker */
25
if
(
m_useCalibHitTruth
)
ATH_CHECK
(
m_clusterCalibHitMomentsMaker2
.retrieve());
26
else
m_clusterCalibHitMomentsMaker2
.disable();
27
28
return
StatusCode::SUCCESS;
29
}
30
31
StatusCode
PFMomentCalculatorTool::execute
(
const
EventContext& ctx,
eflowCaloObjectContainer
& theEflowCaloObjectContainer) {
32
33
/* Collect all the clusters in a temporary container (with VIEW_ELEMENTS!) */
34
bool
useNonModifiedClusters =
true
;
35
if
(
true
==
m_LCMode
) useNonModifiedClusters =
false
;
36
std::unique_ptr<xAOD::CaloClusterContainer> tempClusterContainer =
m_clusterCollectionTool
->execute(theEflowCaloObjectContainer, useNonModifiedClusters);
37
38
/* Set the layer energies */
39
/* This must be set before the cluster moment calculations, which use the layer energies */
40
for
(
auto
cluster : *tempClusterContainer)
CaloClusterKineHelper::calculateKine
(cluster,
true
,
true
);
41
42
/* Remake the cluster moments */
43
ATH_CHECK
(
m_clusterMomentsMaker
->execute(ctx, tempClusterContainer.get()));
44
45
if
(
m_useCalibHitTruth
){
46
ATH_CHECK
(
m_clusterCalibHitMomentsMaker2
->execute(ctx, tempClusterContainer.get()));
47
}
48
49
return
StatusCode::SUCCESS;
50
}
51
52
StatusCode
PFMomentCalculatorTool::finalize
(){
return
StatusCode::SUCCESS; }
53
54
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
CaloClusterKineHelper.h
PFMomentCalculatorTool.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
PFMomentCalculatorTool::m_useCalibHitTruth
Gaudi::Property< bool > m_useCalibHitTruth
Toggle usage of calibration hit truth - false by default.
Definition
PFMomentCalculatorTool.h:47
PFMomentCalculatorTool::PFMomentCalculatorTool
PFMomentCalculatorTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition
PFMomentCalculatorTool.cxx:11
PFMomentCalculatorTool::m_LCMode
Gaudi::Property< bool > m_LCMode
Toggle whether we are in LC mode - false by default.
Definition
PFMomentCalculatorTool.h:44
PFMomentCalculatorTool::m_clusterMomentsMaker
ToolHandle< CaloClusterCollectionProcessor > m_clusterMomentsMaker
Tool to calculate cluster moments.
Definition
PFMomentCalculatorTool.h:38
PFMomentCalculatorTool::finalize
virtual StatusCode finalize() override
Definition
PFMomentCalculatorTool.cxx:52
PFMomentCalculatorTool::m_clusterCollectionTool
ToolHandle< IPFClusterCollectionTool > m_clusterCollectionTool
Tool to put all clusters into a temporary container - then we use this to calculate moments,...
Definition
PFMomentCalculatorTool.h:35
PFMomentCalculatorTool::m_clusterCalibHitMomentsMaker2
ToolHandle< CaloClusterCollectionProcessor > m_clusterCalibHitMomentsMaker2
Tool to calculate calibration hit truth cluster moments.
Definition
PFMomentCalculatorTool.h:41
PFMomentCalculatorTool::initialize
virtual StatusCode initialize() override
Definition
PFMomentCalculatorTool.cxx:16
PFMomentCalculatorTool::execute
virtual StatusCode execute(const EventContext &ctx, eflowCaloObjectContainer &theEflowCaloObjectContainer) override
Definition
PFMomentCalculatorTool.cxx:31
eflowCaloObjectContainer
Definition
eflowCaloObject.h:102
eflowCaloObject.h
eflowRecCluster.h
type
Generated on
for ATLAS Offline Software by
1.17.0