diff --git a/Reconstruction/MET/METReconstruction/METReconstruction/METCaloRegionsTool.h b/Reconstruction/MET/METReconstruction/METReconstruction/METCaloRegionsTool.h index e2d3f8af1246a86ad19c14b6ce20c10f3a0faaea..bc27b932fe88e02db39df2e2428c9e57d3e5ff97 100644 --- a/Reconstruction/MET/METReconstruction/METReconstruction/METCaloRegionsTool.h +++ b/Reconstruction/MET/METReconstruction/METReconstruction/METCaloRegionsTool.h @@ -1,7 +1,7 @@ ///////////////////////// -*- C++ -*- ///////////////////////////// /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // METCaloRegionsTool.h @@ -23,7 +23,7 @@ // FrameWork includes #include "AsgTools/ToolHandle.h" #include "AsgTools/AsgTool.h" -#include "StoreGate/DataHandle.h" +#include "StoreGate/ReadCondHandleKey.h" // MET EDM @@ -123,7 +123,6 @@ namespace met{ // Default constructor: METCaloRegionsTool(); - // Tool handle for CaloNoiseTool #if defined(XAOD_STANDALONE) || defined(XAOD_ANALYSIS) #else SG::ReadCondHandleKey<CaloNoise> m_noiseCDOKey{this,"CaloNoiseKey","totalNoise","SG Key of CaloNoise data object"}; diff --git a/Reconstruction/MET/METReconstruction/Root/METCaloRegionsTool.cxx b/Reconstruction/MET/METReconstruction/Root/METCaloRegionsTool.cxx index 5f2a420521ba3f4331fae5c81af0992c1b6296b5..4a45221c973267e606c2ea3a75342f96bf5e9b6b 100644 --- a/Reconstruction/MET/METReconstruction/Root/METCaloRegionsTool.cxx +++ b/Reconstruction/MET/METReconstruction/Root/METCaloRegionsTool.cxx @@ -1,7 +1,7 @@ ///////////////////////// -*- C++ -*- ///////////////////////////// /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // METCaloRegionsTool.cxx @@ -71,13 +71,12 @@ namespace met { { ATH_MSG_DEBUG("Initializing " << name() << "..."); - StatusCode sc = StatusCode::SUCCESS; #if defined(XAOD_STANDALONE) || defined(XAOD_ANALYSIS) #else ATH_CHECK( m_noiseCDOKey.initialize() ); #endif - return sc; + return StatusCode::SUCCESS; } StatusCode METCaloRegionsTool::finalize() @@ -238,16 +237,15 @@ namespace met { SG::ReadCondHandle<CaloNoise> noiseHdl{m_noiseCDOKey}; const CaloNoise* noiseCDO=*noiseHdl; // Loop over all cells - for( CaloCellContainer::const_iterator iCell=caloCellContainer->begin(); - iCell!=caloCellContainer->end(); ++iCell ) { + for (const CaloCell* cell : *caloCellContainer) { // Retrieve the sampling - CaloSampling::CaloSample sample = (CaloSampling::CaloSample) (*iCell)->caloDDE()->getSampling(); + CaloSampling::CaloSample sample = (CaloSampling::CaloSample) cell->caloDDE()->getSampling(); // Calculate Et/phi - double e_cell = (*iCell)->energy(); - double et_cell = e_cell/cosh((*iCell)->eta()); - double phi_cell = (*iCell)->phi(); + double e_cell = cell->energy(); + double et_cell = e_cell/cosh(cell->eta()); + double phi_cell = cell->phi(); // Find the associated MET MissingET* metTerm = findMetTerm(metContainer, sample); @@ -266,7 +264,7 @@ namespace met { #if defined(XAOD_STANDALONE) || defined(XAOD_ANALYSIS) double noise_cell = 0; #else - double noise_cell = noiseCDO->getNoise((*iCell)->ID(),(*iCell)->gain()); + double noise_cell = noiseCDO->getNoise(cell->ID(),cell->gain()); #endif // All cells metContainer->at(REGIONS_TOTAL)->add(et_cell*cos(phi_cell), diff --git a/Reconstruction/MET/METReconstruction/python/METRecoConfig.py b/Reconstruction/MET/METReconstruction/python/METRecoConfig.py index 7b760fe9e041939015c4ebb31a7ab0d279c2f519..4b90746432a11c397a496480e043630f4f09f941 100644 --- a/Reconstruction/MET/METReconstruction/python/METRecoConfig.py +++ b/Reconstruction/MET/METReconstruction/python/METRecoConfig.py @@ -111,6 +111,8 @@ def getBuilder(config,suffix,doTracks,doCells,doTriggerMET,doOriginCorrClus): config.inputKey = defaultInputKey['Truth'] config.outputKey = config.objType if suffix == 'Calo': + from CaloTools.CaloNoiseCondAlg import CaloNoiseCondAlg + CaloNoiseCondAlg ('totalNoise') tool = CfgMgr.met__METCaloRegionsTool('MET_CaloRegionsTool') if doCells: tool.UseCells = True