ATLAS Offline Software
Loading...
Searching...
No Matches
PFMomentCalculatorTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
8
10
11PFMomentCalculatorTool::PFMomentCalculatorTool(const std::string& type,const std::string& name,const IInterface* parent) :
12 base_class( type, name, parent)
13{
14}
15
17
18 /* Retrieve the cluster collection tool */
20
21 /* Retrieve the cluster moments maker */
23
24 /* Retrieve the cluster calib hit moments maker */
26 else m_clusterCalibHitMomentsMaker2.disable();
27
28 return StatusCode::SUCCESS;
29}
30
31StatusCode PFMomentCalculatorTool::execute(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(tempClusterContainer.get()));
44
46 ATH_CHECK(m_clusterCalibHitMomentsMaker2->execute(tempClusterContainer.get()));
47 }
48
49 return StatusCode::SUCCESS;
50}
51
52StatusCode PFMomentCalculatorTool::finalize(){ return StatusCode::SUCCESS; }
53
54
#define ATH_CHECK
Evaluate an expression and check for errors.
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.
Gaudi::Property< bool > m_useCalibHitTruth
Toggle usage of calibration hit truth - false by default.
PFMomentCalculatorTool(const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode execute(eflowCaloObjectContainer &theEflowCaloObjectContainer) override
Gaudi::Property< bool > m_LCMode
Toggle whether we are in LC mode - false by default.
ToolHandle< CaloClusterCollectionProcessor > m_clusterMomentsMaker
Tool to calculate cluster moments.
virtual StatusCode finalize() override
ToolHandle< IPFClusterCollectionTool > m_clusterCollectionTool
Tool to put all clusters into a temporary container - then we use this to calculate moments,...
ToolHandle< CaloClusterCollectionProcessor > m_clusterCalibHitMomentsMaker2
Tool to calculate calibration hit truth cluster moments.
virtual StatusCode initialize() override