ATLAS Offline Software
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 
11 PFMomentCalculatorTool::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 */
22  ATH_CHECK(m_clusterMomentsMaker.retrieve());
23 
24  /* Retrieve the cluster calib hit moments maker */
26  else m_clusterCalibHitMomentsMaker2.disable();
27 
28  return StatusCode::SUCCESS;
29 }
30 
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 
45  if (m_useCalibHitTruth){
46  ATH_CHECK(m_clusterCalibHitMomentsMaker2->execute(tempClusterContainer.get()));
47  }
48 
49  return StatusCode::SUCCESS;
50 }
51 
52 StatusCode PFMomentCalculatorTool::finalize(){ return StatusCode::SUCCESS; }
53 
54 
CaloClusterKineHelper.h
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::PFMomentCalculatorTool
PFMomentCalculatorTool(const std::string &type, const std::string &name, const IInterface *parent)
Definition: PFMomentCalculatorTool.cxx:11
PFMomentCalculatorTool::initialize
virtual StatusCode initialize() override
Definition: PFMomentCalculatorTool.cxx:16
PFMomentCalculatorTool::m_clusterCalibHitMomentsMaker2
ToolHandle< CaloClusterCollectionProcessor > m_clusterCalibHitMomentsMaker2
Tool to calculate calibration hit truth cluster moments.
Definition: PFMomentCalculatorTool.h:41
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
PFMomentCalculatorTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
PFMomentCalculatorTool::finalize
virtual StatusCode finalize() override
Definition: PFMomentCalculatorTool.cxx:52
eflowRecCluster.h
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
eflowCaloObject.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
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::execute
virtual StatusCode execute(eflowCaloObjectContainer &theEflowCaloObjectContainer) override
Definition: PFMomentCalculatorTool.cxx:31
PFMomentCalculatorTool::m_useCalibHitTruth
Gaudi::Property< bool > m_useCalibHitTruth
Toggle usage of calibration hit truth - false by default.
Definition: PFMomentCalculatorTool.h:47
eflowCaloObjectContainer
Definition: eflowCaloObject.h:100