From e85a34ce6e13503cf7783f2192c99206b53d77f8 Mon Sep 17 00:00:00 2001 From: Scott Snyder <scott.snyder@cern.ch> Date: Thu, 7 Feb 2019 09:19:20 +0000 Subject: [PATCH] CellMakerTool methods are const. --- .../src/CaloCellEnergyRescaler.cxx | 10 +-- .../src/CaloCellEnergyRescaler.h | 11 +-- .../src/CaloCellNeighborsAverageCorr.cxx | 9 +-- .../src/CaloCellNeighborsAverageCorr.h | 12 ++-- .../src/CaloCellPedestalCorr.cxx | 8 +-- .../src/CaloCellPedestalCorr.h | 7 +- .../CaloInterface/ICaloCellMakerTool.h | 20 +++--- .../CaloInterface/ICaloConstCellMakerTool.h | 8 ++- .../share/CaloCellFastCopyTool_test.ref | 70 +++++++++---------- .../src/CaloCellContainerCheckerTool.cxx | 12 ++-- .../src/CaloCellContainerCheckerTool.h | 8 ++- .../src/CaloCellContainerCorrectorTool.cxx | 22 +++--- .../src/CaloCellContainerCorrectorTool.h | 16 +++-- .../src/CaloCellContainerFinalizerTool.cxx | 16 ++--- .../src/CaloCellContainerFinalizerTool.h | 14 ++-- .../src/CaloCellContainerFromClusterTool.cxx | 9 +-- .../src/CaloCellContainerFromClusterTool.h | 5 +- .../src/CaloCellContainerMergerTool.cxx | 11 +-- .../CaloRec/src/CaloCellContainerMergerTool.h | 13 ++-- .../CaloRec/src/CaloCellFastCopyTool.cxx | 8 ++- .../CaloRec/src/CaloCellFastCopyTool.h | 8 ++- Calorimeter/CaloRec/src/CaloCellMaker.cxx | 7 +- .../test/CaloCellFastCopyTool_test.cxx | 5 +- .../LArCellRec/src/LArBadFebMaskingTool.cxx | 6 +- .../LArCellRec/src/LArBadFebMaskingTool.h | 5 +- .../src/LArCellBuilderFromLArHitTool.cxx | 8 +-- .../src/LArCellBuilderFromLArHitTool.h | 5 +- .../LArCellBuilderFromLArRawChannelTool.cxx | 19 ++--- .../src/LArCellBuilderFromLArRawChannelTool.h | 14 ++-- .../LArCellRec/src/LArCellDeadOTXCorr.cxx | 12 ++-- .../LArCellRec/src/LArCellDeadOTXCorr.h | 6 +- .../LArCellRec/src/LArCellGainPathology.cxx | 13 ++-- .../LArCellRec/src/LArCellGainPathology.h | 17 ++--- .../LArCellRec/src/LArCellMaskingTool.cxx | 8 +-- .../LArCellRec/src/LArCellMaskingTool.h | 12 ++-- .../LArCellRec/src/LArCellMerger.cxx | 14 ++-- LArCalorimeter/LArCellRec/src/LArCellMerger.h | 12 ++-- .../src/LArCellNoiseMaskingTool.cxx | 9 +-- .../LArCellRec/src/LArCellNoiseMaskingTool.h | 11 +-- .../src/HISubtractedCellMakerTool.cxx | 4 +- .../HIJetRec/src/HISubtractedCellMakerTool.h | 11 +-- .../FastShower/FastCaloSim/CMakeLists.txt | 1 + .../FastCaloSim/AddNoiseCellBuilderTool.h | 5 +- .../FastCaloSim/BasicCellBuilderTool.h | 6 +- .../FastCaloSim/EmptyCellBuilderTool.h | 8 ++- .../FastCaloSim/FastShowerCellBuilderTool.h | 6 +- .../src/AddNoiseCellBuilderTool.cxx | 8 +-- .../FastCaloSim/src/BasicCellBuilderTool.cxx | 8 +-- .../FastCaloSim/src/EmptyCellBuilderTool.cxx | 17 ++--- .../src/FastShowerCellBuilderTool.cxx | 11 ++- .../FastCaloSimHit/FastHitConvertTool.h | 7 +- .../FastCaloSimHit/src/FastHitConvertTool.cxx | 11 ++- .../src/NativeFastCaloSimSvc.cxx | 5 +- .../src/FastCaloSimSvcPU.cxx | 12 ++-- .../src/FastCaloSimSvcV2.cxx | 11 ++- .../src/FastCaloTool.cxx | 8 ++- .../TBRec/src/TBCellContainerFillerTool.cxx | 9 +-- .../TBRec/src/TBCellContainerFillerTool.h | 11 +-- TestBeam/TBRec/src/TBEMECXTalkToyModel.cxx | 11 +-- TestBeam/TBRec/src/TBEMECXTalkToyModel.h | 12 ++-- .../TileRecAlgs/src/TileCellCorrection.cxx | 10 +-- .../TileRecUtils/TileCellBuilder.h | 3 +- .../TileRecUtils/TileCellBuilderFromHit.h | 3 +- .../TileRecUtils/TileCellMaskingTool.h | 9 +-- .../TileRecUtils/TileCellNoiseFilter.h | 3 +- .../TileRecUtils/src/TileCellBuilder.cxx | 6 +- .../src/TileCellBuilderFromHit.cxx | 8 +-- .../TileRecUtils/src/TileCellMaskingTool.cxx | 7 +- .../TileRecUtils/src/TileCellNoiseFilter.cxx | 3 +- .../TrigCaloRec/src/TrigCaloCellMaker.cxx | 10 ++- .../TrigCaloRec/src/TrigFullCaloCellMaker.cxx | 10 ++- .../src/HICaloCellCorectionTool.cxx | 10 ++- .../TrigHIHypo/src/HICaloCellCorectionTool.h | 5 +- 73 files changed, 392 insertions(+), 357 deletions(-) mode change 100644 => 100755 Calorimeter/CaloCellCorrection/src/CaloCellNeighborsAverageCorr.h diff --git a/Calorimeter/CaloCellCorrection/src/CaloCellEnergyRescaler.cxx b/Calorimeter/CaloCellCorrection/src/CaloCellEnergyRescaler.cxx index 6492ec557b2..bc75fdb08c1 100644 --- a/Calorimeter/CaloCellCorrection/src/CaloCellEnergyRescaler.cxx +++ b/Calorimeter/CaloCellCorrection/src/CaloCellEnergyRescaler.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "CaloCellEnergyRescaler.h" @@ -10,9 +10,8 @@ CaloCellEnergyRescaler::CaloCellEnergyRescaler (const std::string& type, const std::string& name, const IInterface* parent) : - AthAlgTool(type, name, parent), + base_class (type, name, parent), m_corrValues(0) { - declareInterface<ICaloCellMakerTool>(this); declareProperty("Folder",m_key="/CALO/Ofl/CellEnergyCorr", "Key (=foldername) of AttrListCollection"); } @@ -52,7 +51,10 @@ StatusCode CaloCellEnergyRescaler::load(IOVSVC_CALLBACK_ARGS) { } -StatusCode CaloCellEnergyRescaler::process(CaloCellContainer* theCaloCellContainer) { +StatusCode +CaloCellEnergyRescaler::process (CaloCellContainer* theCaloCellContainer, + const EventContext& /*ctx*/) const +{ if (m_corrValues) { CaloCellContainer::iterator it=theCaloCellContainer->begin(); CaloCellContainer::iterator it_e=theCaloCellContainer->end(); diff --git a/Calorimeter/CaloCellCorrection/src/CaloCellEnergyRescaler.h b/Calorimeter/CaloCellCorrection/src/CaloCellEnergyRescaler.h index f432e4ddade..bbb721e1357 100644 --- a/Calorimeter/CaloCellCorrection/src/CaloCellEnergyRescaler.h +++ b/Calorimeter/CaloCellCorrection/src/CaloCellEnergyRescaler.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ //Dear emacs, this is -*-c++-*- @@ -21,16 +21,19 @@ class CaloCondBlobFlt; @brief CaloCellMakerTool to re-scale cell energies. */ -class CaloCellEnergyRescaler : public AthAlgTool, virtual public ICaloCellMakerTool { +class CaloCellEnergyRescaler + : public extends<AthAlgTool, ICaloCellMakerTool> +{ public: CaloCellEnergyRescaler (const std::string& type, const std::string& name, const IInterface* parent); ~CaloCellEnergyRescaler(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; - virtual StatusCode process( CaloCellContainer * theCellContainer) ; + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override; private: /// IOV callback method diff --git a/Calorimeter/CaloCellCorrection/src/CaloCellNeighborsAverageCorr.cxx b/Calorimeter/CaloCellCorrection/src/CaloCellNeighborsAverageCorr.cxx index 8366f111416..d25efaf6153 100755 --- a/Calorimeter/CaloCellCorrection/src/CaloCellNeighborsAverageCorr.cxx +++ b/Calorimeter/CaloCellCorrection/src/CaloCellNeighborsAverageCorr.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // **************************************************************************************** @@ -31,12 +31,11 @@ CaloCellNeighborsAverageCorr::CaloCellNeighborsAverageCorr( const std::string& type, const std::string& name, const IInterface* parent) - :AthAlgTool(type, name, parent), + :base_class(type, name, parent), m_calo_dd_man(nullptr), m_calo_id(nullptr), m_tile_id(nullptr) { - declareInterface<ICaloCellMakerTool>(this); declareProperty("testMode",m_testMode=false,"test mode"); declareProperty("skipDeadFeb", m_skipDeadFeb=true, "Skip dead LAr Febs (default = true)"); declareProperty("skipDeadLAr", m_skipDeadLAr=false, "Skip all dead LAr cells (default = false)"); @@ -78,7 +77,9 @@ StatusCode CaloCellNeighborsAverageCorr::initialize() // ============================================================================ -StatusCode CaloCellNeighborsAverageCorr::process(CaloCellContainer* theCont) +StatusCode +CaloCellNeighborsAverageCorr::process (CaloCellContainer* theCont, + const EventContext& /*ctx*/) const { ATH_MSG_VERBOSE ( " in process " ); diff --git a/Calorimeter/CaloCellCorrection/src/CaloCellNeighborsAverageCorr.h b/Calorimeter/CaloCellCorrection/src/CaloCellNeighborsAverageCorr.h old mode 100644 new mode 100755 index b26a051c5db..c3d0cc15568 --- a/Calorimeter/CaloCellCorrection/src/CaloCellNeighborsAverageCorr.h +++ b/Calorimeter/CaloCellCorrection/src/CaloCellNeighborsAverageCorr.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef CALOCELLCORRECTION_CALOCELLNEIGHBORSAVERAGECORR_H @@ -17,9 +17,8 @@ class CaloCell_ID; class TileID; //inspiration from http://alxr.usatlas.bnl.gov/lxr-stb3/source/atlas/Calorimeter/CaloRec/CaloRec/CaloCellCopyTool.h#032 -class CaloCellNeighborsAverageCorr : public AthAlgTool, - virtual public ICaloCellMakerTool - +class CaloCellNeighborsAverageCorr + : public extends<AthAlgTool, ICaloCellMakerTool> { public: @@ -32,11 +31,12 @@ public: /** initialize method */ - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /** process calo cell collection to apply corrections */ - StatusCode process( CaloCellContainer * theCellContainer); + virtual StatusCode process ( CaloCellContainer * theCellContainer, + const EventContext& ctx) const override; private: diff --git a/Calorimeter/CaloCellCorrection/src/CaloCellPedestalCorr.cxx b/Calorimeter/CaloCellCorrection/src/CaloCellPedestalCorr.cxx index 97c62d592ce..c231412b8cb 100755 --- a/Calorimeter/CaloCellCorrection/src/CaloCellPedestalCorr.cxx +++ b/Calorimeter/CaloCellCorrection/src/CaloCellPedestalCorr.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // **************************************************************************************** @@ -67,11 +67,7 @@ StatusCode CaloCellPedestalCorr::initialize() ATH_MSG_INFO( "CaloCellPedestalCorr initialize() end" ); return StatusCode::SUCCESS; } -StatusCode CaloCellPedestalCorr::process( CaloCellContainer * theCellContainer) { - //This function is a stopgap solution until all CaloCellCorrector tools are const - const EventContext& ctx = Gaudi::Hive::currentContext(); - return this->process(theCellContainer,ctx); -} + StatusCode CaloCellPedestalCorr::process( CaloCellContainer * theCellContainer, const EventContext& ctx) const { diff --git a/Calorimeter/CaloCellCorrection/src/CaloCellPedestalCorr.h b/Calorimeter/CaloCellCorrection/src/CaloCellPedestalCorr.h index f36b1e87559..4ee18dda185 100644 --- a/Calorimeter/CaloCellCorrection/src/CaloCellPedestalCorr.h +++ b/Calorimeter/CaloCellCorrection/src/CaloCellPedestalCorr.h @@ -1,6 +1,6 @@ //Dear emacs, this is -*-c++-*- /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef CALOCELLCORRECTION_CALOCELLPEDESTALCORR_H @@ -33,11 +33,8 @@ public: virtual StatusCode initialize() override; - StatusCode process( CaloCellContainer * theCellContainer) override; - - StatusCode process( CaloCellContainer * theCellContainer, - const EventContext& ctx) const; //override; + const EventContext& ctx) const override; private: // const DataHandle<CondAttrListCollection> m_noiseAttrListColl; diff --git a/Calorimeter/CaloInterface/CaloInterface/ICaloCellMakerTool.h b/Calorimeter/CaloInterface/CaloInterface/ICaloCellMakerTool.h index 1b68ed41ebf..c40985312ca 100755 --- a/Calorimeter/CaloInterface/CaloInterface/ICaloCellMakerTool.h +++ b/Calorimeter/CaloInterface/CaloInterface/ICaloCellMakerTool.h @@ -1,27 +1,29 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef CALOINTERFACE_ICALOCELLMAKERTOOL_H #define CALOINTERFACE_ICALOCELLMAKERTOOL_H -class CaloCellContainer ; +class CaloCellContainer; +class EventContext; // Includes for Gaudi #include "GaudiKernel/StatusCode.h" #include "GaudiKernel/IAlgTool.h" +#include "GaudiKernel/ThreadLocalContext.h" -static const InterfaceID IID_ICaloCellMakerTool("ICaloCellMakerTool", 1 , 0); - -class ICaloCellMakerTool: virtual public IAlgTool { - +class ICaloCellMakerTool + : virtual public IAlgTool +{ public: - // update theCellContainer, fill more cells for example - virtual StatusCode process( CaloCellContainer * theCellContainer)=0 ; + DeclareInterfaceID (ICaloCellMakerTool, 1, 0); - static const InterfaceID& interfaceID() { return IID_ICaloCellMakerTool;} + // FIXME: Remove default value from second arg. + virtual StatusCode process ( CaloCellContainer* theCellContainer, + const EventContext& ctx = Gaudi::Hive::currentContext() ) const = 0; }; #endif diff --git a/Calorimeter/CaloInterface/CaloInterface/ICaloConstCellMakerTool.h b/Calorimeter/CaloInterface/CaloInterface/ICaloConstCellMakerTool.h index 2c71befd560..842fb12406f 100644 --- a/Calorimeter/CaloInterface/CaloInterface/ICaloConstCellMakerTool.h +++ b/Calorimeter/CaloInterface/CaloInterface/ICaloConstCellMakerTool.h @@ -1,7 +1,7 @@ // This file's extension implies that it's C, but it's really -*- 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 */ // $Id$ @@ -22,6 +22,7 @@ class CaloConstCellContainer; +class EventContext; /** @@ -37,8 +38,9 @@ class ICaloConstCellMakerTool public: DeclareInterfaceID (ICaloConstCellMakerTool, 1, 0); - // update theCellContainer, fill more cells for example - virtual StatusCode process( CaloConstCellContainer* theCellContainer) = 0; + // FIXME: Remove default value from second arg. + virtual StatusCode process ( CaloConstCellContainer* theCellContainer, + const EventContext& ctx = Gaudi::Hive::currentContext() ) const = 0; }; diff --git a/Calorimeter/CaloRec/share/CaloCellFastCopyTool_test.ref b/Calorimeter/CaloRec/share/CaloCellFastCopyTool_test.ref index 49a16696c61..c974a3cc67f 100644 --- a/Calorimeter/CaloRec/share/CaloCellFastCopyTool_test.ref +++ b/Calorimeter/CaloRec/share/CaloCellFastCopyTool_test.ref @@ -4,12 +4,12 @@ Initializing Gaudi ApplicationMgr using job opts ./CaloCellFastCopyTool_test_gen JobOptionsSvc INFO Job options successfully read in from ./CaloCellFastCopyTool_test_generated.txt ApplicationMgr SUCCESS ==================================================================================================================================== - Welcome to ApplicationMgr (GaudiCoreSvc v27r1p99) - running on karma on Sun Jul 8 09:27:22 2018 + Welcome to ApplicationMgr (GaudiCoreSvc v30r3) + running on spar0102.usatlas.bnl.gov on Sat Sep 8 22:10:54 2018 ==================================================================================================================================== ApplicationMgr INFO Successfully loaded modules : StoreGate ApplicationMgr INFO Application Manager Configured successfully -ClassIDSvc INFO getRegistryEntries: read 7122 CLIDRegistry entries for module ALL +ClassIDSvc INFO getRegistryEntries: read 7296 CLIDRegistry entries for module ALL StoreGateSvc DEBUG Property update for OutputLevel : new value = 2 StoreGateSvc DEBUG Service base class initialized successfully StoreGateSvc DEBUG trying to create store SGImplSvc/StoreGateSvc_Impl @@ -22,131 +22,131 @@ ApplicationMgr INFO Application Manager Initialized successfully ApplicationMgr Ready LArMiniFCAL_ID INFO initialize_from_dict - LArCalorimeter dictionary does NOT contain miniFCAL description. Unable to initialize LArMiniFCAL_ID. test1 -ClassIDSvc INFO getRegistryEntries: read 372 CLIDRegistry entries for module ALL -StoreGateSvc_Impl DEBUG Recorded object @0x26c3bd0 with key AllCalo of type CaloCellContainer(CLID 2802) - in DataObject @0x26b6e60 +StoreGateSvc_Impl DEBUG Recorded object @0x1ec8870 with key AllCalo of type CaloCellContainer(CLID 2802) + in DataObject @0x1ea6fe0 object not modifiable when retrieved -StoreGateSvc_Impl DEBUG Retrieved const handle to object AllCalo of type CaloCellContainer(CLID 2802) +StoreGateSvc_Impl DEBUG Retrieved const pointer to object AllCalo of type CaloCellContainer(CLID 2802) +ClassIDSvc INFO getRegistryEntries: read 372 CLIDRegistry entries for module ALL CopyToolTest[1] DEBUG Property update for OutputLevel : new value = 1 CopyToolTest[1] INFO In initialize CopyToolTest[1] DEBUG Accepted calo samplings: 17; CopyToolTest[1] DEBUG Accepted sub calos: 3; CopyToolTest[1] DEBUG CaloCell hash max: 187652 CopyToolTest[1] DEBUG Number of accepted hashes: 0 -StoreGateSvc_Impl DEBUG Retrieved const handle to object AllCalo of type CaloCellContainer(CLID 2802) +StoreGateSvc_Impl DEBUG Retrieved const pointer to object AllCalo of type CaloCellContainer(CLID 2802) CopyToolTest[1] INFO In initialize CopyToolTest[1] DEBUG Accepted calo samplings: 17; CopyToolTest[1] DEBUG Accepted sub calos: 3; CopyToolTest[1] DEBUG CaloCell hash max: 187652 CopyToolTest[1] DEBUG Number of accepted hashes: 512 -StoreGateSvc_Impl DEBUG Retrieved const handle to object AllCalo of type CaloCellContainer(CLID 2802) +StoreGateSvc_Impl DEBUG Retrieved const pointer to object AllCalo of type CaloCellContainer(CLID 2802) CopyToolTest[3] DEBUG Property update for OutputLevel : new value = 1 CopyToolTest[3] INFO In initialize CopyToolTest[3] DEBUG Accepted calo samplings: 17; CopyToolTest[3] DEBUG Accepted sub calos: 3; CopyToolTest[3] DEBUG CaloCell hash max: 187652 CopyToolTest[3] DEBUG Number of accepted hashes: 0 -StoreGateSvc_Impl DEBUG Retrieved const handle to object AllCalo of type CaloCellContainer(CLID 2802) +StoreGateSvc_Impl DEBUG Retrieved const pointer to object AllCalo of type CaloCellContainer(CLID 2802) CopyToolTest[4] DEBUG Property update for OutputLevel : new value = 1 CopyToolTest[4] INFO In initialize CopyToolTest[4] DEBUG Accepted calo samplings: 17; CopyToolTest[4] DEBUG Accepted sub calos: 3; CopyToolTest[4] DEBUG CaloCell hash max: 187652 CopyToolTest[4] DEBUG Number of accepted hashes: 512 -StoreGateSvc_Impl DEBUG Retrieved const handle to object AllCalo of type CaloCellContainer(CLID 2802) +StoreGateSvc_Impl DEBUG Retrieved const pointer to object AllCalo of type CaloCellContainer(CLID 2802) CopyToolTest[13] DEBUG Property update for OutputLevel : new value = 1 CopyToolTest[13] INFO In initialize CopyToolTest[13] DEBUG Accepted calo samplings: 17; CopyToolTest[13] DEBUG Accepted sub calos: 3; CopyToolTest[13] DEBUG CaloCell hash max: 187652 CopyToolTest[13] DEBUG Number of accepted hashes: 0 -CopyToolTest[13] ERROR ../src/CaloCellFastCopyTool.cxx:333 (StatusCode CaloCellFastCopyTool::dispatchCopy(const CaloCellContainer*, CaloCellContainer*) const): code 0: Can't copy to a non-const view container. -CopyToolTest[13] FATAL ../src/CaloCellFastCopyTool.cxx:116 (StatusCode CaloCellFastCopyTool::process(CaloCellContainer*)): code 0: dispatchCopy (srcCont.cptr(), theCont) -StoreGateSvc_Impl DEBUG Retrieved const handle to object AllCalo of type CaloCellContainer(CLID 2802) +CopyToolTest[13] ERROR /usatlas/u/snyder/usatlasdata/atlas-master-mt/Calorimeter/CaloRec/src/CaloCellFastCopyTool.cxx:335 (StatusCode CaloCellFastCopyTool::dispatchCopy(const CaloCellContainer*, CaloCellContainer*) const): code 0: Can't copy to a non-const view container. +CopyToolTest[13] FATAL /usatlas/u/snyder/usatlasdata/atlas-master-mt/Calorimeter/CaloRec/src/CaloCellFastCopyTool.cxx:117 (StatusCode CaloCellFastCopyTool::process(CaloCellContainer*, const EventContext&) const): code 0: dispatchCopy (srcCont.cptr(), theCont) +StoreGateSvc_Impl DEBUG Retrieved const pointer to object AllCalo of type CaloCellContainer(CLID 2802) CopyToolTest[14] DEBUG Property update for OutputLevel : new value = 1 CopyToolTest[14] INFO In initialize CopyToolTest[14] DEBUG Accepted calo samplings: 17; CopyToolTest[14] DEBUG Accepted sub calos: 3; CopyToolTest[14] DEBUG CaloCell hash max: 187652 CopyToolTest[14] DEBUG Number of accepted hashes: 512 -CopyToolTest[14] ERROR ../src/CaloCellFastCopyTool.cxx:322 (StatusCode CaloCellFastCopyTool::dispatchCopy(const CaloCellContainer*, CaloCellContainer*) const): code 0: Can't copy to a non-const view container. -CopyToolTest[14] FATAL ../src/CaloCellFastCopyTool.cxx:116 (StatusCode CaloCellFastCopyTool::process(CaloCellContainer*)): code 0: dispatchCopy (srcCont.cptr(), theCont) -StoreGateSvc_Impl DEBUG Retrieved const handle to object AllCalo of type CaloCellContainer(CLID 2802) +CopyToolTest[14] ERROR /usatlas/u/snyder/usatlasdata/atlas-master-mt/Calorimeter/CaloRec/src/CaloCellFastCopyTool.cxx:324 (StatusCode CaloCellFastCopyTool::dispatchCopy(const CaloCellContainer*, CaloCellContainer*) const): code 0: Can't copy to a non-const view container. +CopyToolTest[14] FATAL /usatlas/u/snyder/usatlasdata/atlas-master-mt/Calorimeter/CaloRec/src/CaloCellFastCopyTool.cxx:117 (StatusCode CaloCellFastCopyTool::process(CaloCellContainer*, const EventContext&) const): code 0: dispatchCopy (srcCont.cptr(), theCont) +StoreGateSvc_Impl DEBUG Retrieved const pointer to object AllCalo of type CaloCellContainer(CLID 2802) CopyToolTest[15] DEBUG Property update for OutputLevel : new value = 1 CopyToolTest[15] INFO In initialize CopyToolTest[15] DEBUG Accepted calo samplings: 17; CopyToolTest[15] DEBUG Accepted sub calos: 3; CopyToolTest[15] DEBUG CaloCell hash max: 187652 CopyToolTest[15] DEBUG Number of accepted hashes: 0 -CopyToolTest[15] ERROR ../src/CaloCellFastCopyTool.cxx:333 (StatusCode CaloCellFastCopyTool::dispatchCopy(const CaloCellContainer*, CaloCellContainer*) const): code 0: Can't copy to a non-const view container. -CopyToolTest[15] FATAL ../src/CaloCellFastCopyTool.cxx:116 (StatusCode CaloCellFastCopyTool::process(CaloCellContainer*)): code 0: dispatchCopy (srcCont.cptr(), theCont) -StoreGateSvc_Impl DEBUG Retrieved const handle to object AllCalo of type CaloCellContainer(CLID 2802) +CopyToolTest[15] ERROR /usatlas/u/snyder/usatlasdata/atlas-master-mt/Calorimeter/CaloRec/src/CaloCellFastCopyTool.cxx:335 (StatusCode CaloCellFastCopyTool::dispatchCopy(const CaloCellContainer*, CaloCellContainer*) const): code 0: Can't copy to a non-const view container. +CopyToolTest[15] FATAL /usatlas/u/snyder/usatlasdata/atlas-master-mt/Calorimeter/CaloRec/src/CaloCellFastCopyTool.cxx:117 (StatusCode CaloCellFastCopyTool::process(CaloCellContainer*, const EventContext&) const): code 0: dispatchCopy (srcCont.cptr(), theCont) +StoreGateSvc_Impl DEBUG Retrieved const pointer to object AllCalo of type CaloCellContainer(CLID 2802) CopyToolTest[16] DEBUG Property update for OutputLevel : new value = 1 CopyToolTest[16] INFO In initialize CopyToolTest[16] DEBUG Accepted calo samplings: 17; CopyToolTest[16] DEBUG Accepted sub calos: 3; CopyToolTest[16] DEBUG CaloCell hash max: 187652 CopyToolTest[16] DEBUG Number of accepted hashes: 512 -CopyToolTest[16] ERROR ../src/CaloCellFastCopyTool.cxx:322 (StatusCode CaloCellFastCopyTool::dispatchCopy(const CaloCellContainer*, CaloCellContainer*) const): code 0: Can't copy to a non-const view container. -CopyToolTest[16] FATAL ../src/CaloCellFastCopyTool.cxx:116 (StatusCode CaloCellFastCopyTool::process(CaloCellContainer*)): code 0: dispatchCopy (srcCont.cptr(), theCont) -StoreGateSvc_Impl DEBUG Retrieved const handle to object AllCalo of type CaloCellContainer(CLID 2802) +CopyToolTest[16] ERROR /usatlas/u/snyder/usatlasdata/atlas-master-mt/Calorimeter/CaloRec/src/CaloCellFastCopyTool.cxx:324 (StatusCode CaloCellFastCopyTool::dispatchCopy(const CaloCellContainer*, CaloCellContainer*) const): code 0: Can't copy to a non-const view container. +CopyToolTest[16] FATAL /usatlas/u/snyder/usatlasdata/atlas-master-mt/Calorimeter/CaloRec/src/CaloCellFastCopyTool.cxx:117 (StatusCode CaloCellFastCopyTool::process(CaloCellContainer*, const EventContext&) const): code 0: dispatchCopy (srcCont.cptr(), theCont) +StoreGateSvc_Impl DEBUG Retrieved const pointer to object AllCalo of type CaloCellContainer(CLID 2802) CopyToolTest[5] DEBUG Property update for OutputLevel : new value = 1 CopyToolTest[5] INFO In initialize CopyToolTest[5] DEBUG Accepted calo samplings: 17; CopyToolTest[5] DEBUG Accepted sub calos: 3; CopyToolTest[5] DEBUG CaloCell hash max: 187652 CopyToolTest[5] DEBUG Number of accepted hashes: 0 -StoreGateSvc_Impl DEBUG Retrieved const handle to object AllCalo of type CaloCellContainer(CLID 2802) +StoreGateSvc_Impl DEBUG Retrieved const pointer to object AllCalo of type CaloCellContainer(CLID 2802) CopyToolTest[6] DEBUG Property update for OutputLevel : new value = 1 CopyToolTest[6] INFO In initialize CopyToolTest[6] DEBUG Accepted calo samplings: 17; CopyToolTest[6] DEBUG Accepted sub calos: 3; CopyToolTest[6] DEBUG CaloCell hash max: 187652 CopyToolTest[6] DEBUG Number of accepted hashes: 512 -StoreGateSvc_Impl DEBUG Retrieved const handle to object AllCalo of type CaloCellContainer(CLID 2802) +StoreGateSvc_Impl DEBUG Retrieved const pointer to object AllCalo of type CaloCellContainer(CLID 2802) CopyToolTest[7] DEBUG Property update for OutputLevel : new value = 1 CopyToolTest[7] INFO In initialize CopyToolTest[7] DEBUG Accepted calo samplings: 17; CopyToolTest[7] DEBUG Accepted sub calos: 3; CopyToolTest[7] DEBUG CaloCell hash max: 187652 CopyToolTest[7] DEBUG Number of accepted hashes: 0 -StoreGateSvc_Impl DEBUG Retrieved const handle to object AllCalo of type CaloCellContainer(CLID 2802) +StoreGateSvc_Impl DEBUG Retrieved const pointer to object AllCalo of type CaloCellContainer(CLID 2802) CopyToolTest[8] DEBUG Property update for OutputLevel : new value = 1 CopyToolTest[8] INFO In initialize CopyToolTest[8] DEBUG Accepted calo samplings: 17; CopyToolTest[8] DEBUG Accepted sub calos: 3; CopyToolTest[8] DEBUG CaloCell hash max: 187652 CopyToolTest[8] DEBUG Number of accepted hashes: 512 -StoreGateSvc_Impl DEBUG Retrieved const handle to object AllCalo of type CaloCellContainer(CLID 2802) +StoreGateSvc_Impl DEBUG Retrieved const pointer to object AllCalo of type CaloCellContainer(CLID 2802) CopyToolTest[9] DEBUG Property update for OutputLevel : new value = 1 CopyToolTest[9] INFO In initialize CopyToolTest[9] DEBUG Accepted calo samplings: 17; CopyToolTest[9] DEBUG Accepted sub calos: 3; CopyToolTest[9] DEBUG CaloCell hash max: 187652 CopyToolTest[9] DEBUG Number of accepted hashes: 0 -StoreGateSvc_Impl DEBUG Retrieved const handle to object AllCalo of type CaloCellContainer(CLID 2802) +StoreGateSvc_Impl DEBUG Retrieved const pointer to object AllCalo of type CaloCellContainer(CLID 2802) CopyToolTest[10] DEBUG Property update for OutputLevel : new value = 1 CopyToolTest[10] INFO In initialize CopyToolTest[10] DEBUG Accepted calo samplings: 17; CopyToolTest[10] DEBUG Accepted sub calos: 3; CopyToolTest[10] DEBUG CaloCell hash max: 187652 CopyToolTest[10] DEBUG Number of accepted hashes: 512 -StoreGateSvc_Impl DEBUG Retrieved const handle to object AllCalo of type CaloCellContainer(CLID 2802) +StoreGateSvc_Impl DEBUG Retrieved const pointer to object AllCalo of type CaloCellContainer(CLID 2802) CopyToolTest[11] DEBUG Property update for OutputLevel : new value = 1 CopyToolTest[11] INFO In initialize CopyToolTest[11] DEBUG Accepted calo samplings: 17; CopyToolTest[11] DEBUG Accepted sub calos: 3; CopyToolTest[11] DEBUG CaloCell hash max: 187652 CopyToolTest[11] DEBUG Number of accepted hashes: 0 -StoreGateSvc_Impl DEBUG Retrieved const handle to object AllCalo of type CaloCellContainer(CLID 2802) +StoreGateSvc_Impl DEBUG Retrieved const pointer to object AllCalo of type CaloCellContainer(CLID 2802) CopyToolTest[12] DEBUG Property update for OutputLevel : new value = 1 CopyToolTest[12] INFO In initialize CopyToolTest[12] DEBUG Accepted calo samplings: 17; CopyToolTest[12] DEBUG Accepted sub calos: 3; CopyToolTest[12] DEBUG CaloCell hash max: 187652 CopyToolTest[12] DEBUG Number of accepted hashes: 512 -StoreGateSvc_Impl DEBUG Recorded object @0x26ea280 with key AllCalloFull of type CaloCellContainer(CLID 2802) - in DataObject @0x4debd90 +StoreGateSvc_Impl DEBUG Recorded object @0x1ecc0c0 with key AllCalloFull of type CaloCellContainer(CLID 2802) + in DataObject @0x45cb870 object not modifiable when retrieved CopyToolTest[9] INFO In initialize CopyToolTest[9] DEBUG Accepted calo samplings: 17; @@ -159,9 +159,9 @@ CopyToolTest[9] DEBUG Accepted sub calos: 3; CopyToolTest[9] DEBUG CaloCell hash max: 187652 CopyToolTest[9] DEBUG Number of accepted hashes: 0 StoreGateSvc_Impl WARNING setupProxy:: error setting up proxy for key AllCalloFull and clid 2802 - Pre-existing valid DataProxy @0x2761d30 found in Store for key AllCalloFull with clid 2802 -StoreGateSvc_Impl WARNING record_impl: Problem setting up the proxy for object @0x4df2780 - recorded with key AllCalloFull of type CaloCellContainer (CLID 2802) in DataObject @0x7325850 + Pre-existing valid DataProxy @0x45cb940 found in Store for key AllCalloFull with clid 2802 +StoreGateSvc_Impl WARNING record_impl: Problem setting up the proxy for object @0x45cbad0 + recorded with key AllCalloFull of type CaloCellContainer (CLID 2802) in DataObject @0x6b05390 CopyToolTest[10] INFO In initialize CopyToolTest[10] DEBUG Accepted calo samplings: 17; CopyToolTest[10] DEBUG Accepted sub calos: 3; diff --git a/Calorimeter/CaloRec/src/CaloCellContainerCheckerTool.cxx b/Calorimeter/CaloRec/src/CaloCellContainerCheckerTool.cxx index 73391ac9039..8f88541213f 100644 --- a/Calorimeter/CaloRec/src/CaloCellContainerCheckerTool.cxx +++ b/Calorimeter/CaloRec/src/CaloCellContainerCheckerTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /******************************************************************** @@ -56,16 +56,18 @@ StatusCode CaloCellContainerCheckerTool::initialize() { StatusCode -CaloCellContainerCheckerTool::process (CaloCellContainer* theCont) +CaloCellContainerCheckerTool::process (CaloCellContainer* theCont, + const EventContext& ctx) const { - return doProcess (theCont, Gaudi::Hive::currentContext()); + return doProcess (theCont, ctx); } StatusCode -CaloCellContainerCheckerTool::process (CaloConstCellContainer* theCont) +CaloCellContainerCheckerTool::process (CaloConstCellContainer* theCont, + const EventContext& ctx) const { - return doProcess (theCont->asDataVector(), Gaudi::Hive::currentContext()); + return doProcess (theCont->asDataVector(), ctx); } diff --git a/Calorimeter/CaloRec/src/CaloCellContainerCheckerTool.h b/Calorimeter/CaloRec/src/CaloCellContainerCheckerTool.h index 3154b3e9ee5..7e285ffffca 100644 --- a/Calorimeter/CaloRec/src/CaloCellContainerCheckerTool.h +++ b/Calorimeter/CaloRec/src/CaloCellContainerCheckerTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ //Dear emacs, this is -*-c++-*- @@ -23,8 +23,10 @@ public: virtual StatusCode initialize() override; - virtual StatusCode process (CaloCellContainer* theCellContainer) override; - virtual StatusCode process (CaloConstCellContainer* theCellContainer) override; + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override; + virtual StatusCode process (CaloConstCellContainer* theCellContainer, + const EventContext& ctx) const override; private: StatusCode doProcess (const CaloCellContainer* theCellContainer, diff --git a/Calorimeter/CaloRec/src/CaloCellContainerCorrectorTool.cxx b/Calorimeter/CaloRec/src/CaloCellContainerCorrectorTool.cxx index aa5f2b5a0ed..a77b65bc47f 100644 --- a/Calorimeter/CaloRec/src/CaloCellContainerCorrectorTool.cxx +++ b/Calorimeter/CaloRec/src/CaloCellContainerCorrectorTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /******************************************************************** @@ -18,7 +18,6 @@ PURPOSE: Apply cell correction to CaloCellContainer #include "CaloEvent/CaloCellContainer.h" #include "CaloEvent/CaloCell.h" #include "CaloIdentifier/CaloCell_ID.h" -#include "GaudiKernel/ThreadLocalContext.h" ///////////////////////////////////////////////////////////////////// @@ -29,10 +28,9 @@ CaloCellContainerCorrectorTool::CaloCellContainerCorrectorTool( const std::string& type, const std::string& name, const IInterface* parent) - :AthAlgTool(type, name, parent), + :base_class(type, name, parent), m_caloSelection(false) { - declareInterface<ICaloCellMakerTool>(this); declareProperty("CaloNums",m_caloNums); declareProperty("CellCorrectionToolNames",m_cellCorrectionTools); m_caloNums.clear(); @@ -87,14 +85,16 @@ StatusCode CaloCellContainerCorrectorTool::initialize() { } -StatusCode CaloCellContainerCorrectorTool::process(CaloCellContainer * theCont ) +StatusCode +CaloCellContainerCorrectorTool::process (CaloCellContainer* theCont, + const EventContext& ctx) const { if (!m_caloSelection) { // no selection mode (faster) CaloCellContainer::iterator itrCellBeg=theCont->begin(); CaloCellContainer::iterator itrCellEnd=theCont->end(); - StatusCode sc = processOnCellIterators(itrCellBeg, itrCellEnd ); + StatusCode sc = processOnCellIterators(itrCellBeg, itrCellEnd, ctx ); if (sc.isFailure()) msg(MSG::WARNING) << "Failure from processOnCellIterators" << endmsg ; }else { @@ -113,7 +113,7 @@ StatusCode CaloCellContainerCorrectorTool::process(CaloCellContainer * theCont ) << *itrCalo << endmsg ; } else { - StatusCode sc=processOnCellIterators(itrCellBeg, itrCellEnd ); + StatusCode sc=processOnCellIterators(itrCellBeg, itrCellEnd, ctx ); if (sc.isFailure()) msg(MSG::WARNING) << "Failure from processOnCellIterators for calo " << static_cast<int> (caloNum) @@ -131,10 +131,12 @@ StatusCode CaloCellContainerCorrectorTool::process(CaloCellContainer * theCont ) return StatusCode::SUCCESS ; } -StatusCode CaloCellContainerCorrectorTool::processOnCellIterators(const CaloCellContainer::iterator & itrCellBeg, const CaloCellContainer::iterator & itrCellEnd ) -{ - const EventContext& ctx = Gaudi::Hive::currentContext(); +StatusCode +CaloCellContainerCorrectorTool::processOnCellIterators(const CaloCellContainer::iterator & itrCellBeg, + const CaloCellContainer::iterator & itrCellEnd, + const EventContext& ctx) const +{ // not clear what s the best way to do the loop CaloCellContainer::iterator itrCell; diff --git a/Calorimeter/CaloRec/src/CaloCellContainerCorrectorTool.h b/Calorimeter/CaloRec/src/CaloCellContainerCorrectorTool.h index eb80cfd1f71..ccb2752ec54 100644 --- a/Calorimeter/CaloRec/src/CaloCellContainerCorrectorTool.h +++ b/Calorimeter/CaloRec/src/CaloCellContainerCorrectorTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef CALOREC_CALOCELLCONTAINERCORRECTORTOOL_H @@ -13,9 +13,8 @@ class StoreGateSvc; #include "GaudiKernel/ToolHandle.h" -class CaloCellContainerCorrectorTool: public AthAlgTool, - virtual public ICaloCellMakerTool - +class CaloCellContainerCorrectorTool + : public extends<AthAlgTool, ICaloCellMakerTool> { public: CaloCellContainerCorrectorTool(const std::string& type, @@ -25,9 +24,10 @@ public: typedef ToolHandleArray<CaloCellCorrection> ::iterator CellCorrectionToolIterator; - virtual StatusCode initialize() ; + virtual StatusCode initialize() override; // update theCellContainer - virtual StatusCode process( CaloCellContainer * theCellContainer) ; + virtual StatusCode process ( CaloCellContainer* theCellContainer, + const EventContext& ctx ) const override; private: @@ -40,7 +40,9 @@ public: bool m_caloSelection ; - StatusCode processOnCellIterators(const CaloCellContainer::iterator & itrCellBeg, const CaloCellContainer::iterator & itrCellEnd ); + StatusCode processOnCellIterators(const CaloCellContainer::iterator & itrCellBeg, + const CaloCellContainer::iterator & itrCellEnd, + const EventContext& ctx) const; }; diff --git a/Calorimeter/CaloRec/src/CaloCellContainerFinalizerTool.cxx b/Calorimeter/CaloRec/src/CaloCellContainerFinalizerTool.cxx index 22c33e88490..076aaeb93ca 100644 --- a/Calorimeter/CaloRec/src/CaloCellContainerFinalizerTool.cxx +++ b/Calorimeter/CaloRec/src/CaloCellContainerFinalizerTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /******************************************************************** @@ -38,11 +38,9 @@ CaloCellContainerFinalizerTool::CaloCellContainerFinalizerTool( const std::string& type, const std::string& name, const IInterface* parent) - :AthAlgTool(type, name, parent), - m_theCaloCCIDM(nullptr) + :base_class (type, name, parent), + m_theCaloCCIDM (nullptr) { - declareInterface<ICaloCellMakerTool>(this); - declareInterface<ICaloConstCellMakerTool>(this); } @@ -66,7 +64,7 @@ StatusCode CaloCellContainerFinalizerTool::initialize() } template <class CONTAINER> -StatusCode CaloCellContainerFinalizerTool::doProcess(CONTAINER* theCont ) +StatusCode CaloCellContainerFinalizerTool::doProcess(CONTAINER* theCont ) const { const unsigned int hashMax=m_theCaloCCIDM->calo_cell_hash_max(); @@ -147,7 +145,8 @@ StatusCode CaloCellContainerFinalizerTool::doProcess(CONTAINER* theCont ) StatusCode -CaloCellContainerFinalizerTool::process(CaloCellContainer * theCont ) +CaloCellContainerFinalizerTool::process (CaloCellContainer * theCont, + const EventContext& /*ctx*/) const { CHECK( doProcess (theCont) ); return StatusCode::SUCCESS; @@ -155,7 +154,8 @@ CaloCellContainerFinalizerTool::process(CaloCellContainer * theCont ) StatusCode -CaloCellContainerFinalizerTool::process(CaloConstCellContainer * theCont ) +CaloCellContainerFinalizerTool::process (CaloConstCellContainer * theCont, + const EventContext& /*ctx*/) const { // Container will automatically be locked when recorded. return doProcess (theCont); diff --git a/Calorimeter/CaloRec/src/CaloCellContainerFinalizerTool.h b/Calorimeter/CaloRec/src/CaloCellContainerFinalizerTool.h index abfea7c9a99..9e745979251 100644 --- a/Calorimeter/CaloRec/src/CaloCellContainerFinalizerTool.h +++ b/Calorimeter/CaloRec/src/CaloCellContainerFinalizerTool.h @@ -1,7 +1,7 @@ // This file's extension implies that it's C, but it's really -*- 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 */ @@ -16,9 +16,7 @@ class CaloCell_ID; class CaloCellContainerFinalizerTool - : public AthAlgTool, - virtual public ICaloCellMakerTool, - virtual public ICaloConstCellMakerTool + : public extends<AthAlgTool, ICaloCellMakerTool, ICaloConstCellMakerTool> { public: CaloCellContainerFinalizerTool(const std::string& type, @@ -29,12 +27,14 @@ public: virtual StatusCode initialize() override; // update theCellContainer - virtual StatusCode process(CaloCellContainer * theCellContainer) override; - virtual StatusCode process(CaloConstCellContainer* theCellContainer) override; + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override; + virtual StatusCode process (CaloConstCellContainer* theCellContainer, + const EventContext& ctx) const override; private: template <class CONTAINER> - StatusCode doProcess (CONTAINER* theCellContainer); + StatusCode doProcess (CONTAINER* theCellContainer) const; const CaloCell_ID* m_theCaloCCIDM; }; diff --git a/Calorimeter/CaloRec/src/CaloCellContainerFromClusterTool.cxx b/Calorimeter/CaloRec/src/CaloCellContainerFromClusterTool.cxx index 9cf1e4626af..8b7e052fc44 100644 --- a/Calorimeter/CaloRec/src/CaloCellContainerFromClusterTool.cxx +++ b/Calorimeter/CaloRec/src/CaloCellContainerFromClusterTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /******************************************************************** @@ -144,9 +144,10 @@ StatusCode CaloCellContainerFromClusterTool::initialize() { return StatusCode::SUCCESS; } -StatusCode CaloCellContainerFromClusterTool::process(CaloConstCellContainer* theCont) { - const EventContext& ctx = Gaudi::Hive::currentContext(); - +StatusCode +CaloCellContainerFromClusterTool::process (CaloConstCellContainer* theCont, + const EventContext& ctx) const +{ unsigned nCells=0; //Build bitmap to keep track which cells have been added to reducedCellContainer; std::bitset<200000> addedCellsMap; diff --git a/Calorimeter/CaloRec/src/CaloCellContainerFromClusterTool.h b/Calorimeter/CaloRec/src/CaloCellContainerFromClusterTool.h index c7c28950b20..d926fefb5c9 100644 --- a/Calorimeter/CaloRec/src/CaloCellContainerFromClusterTool.h +++ b/Calorimeter/CaloRec/src/CaloCellContainerFromClusterTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef CALOREC_CALOCELLCONTAINERFROMCLUSTERTOOL_H @@ -26,7 +26,8 @@ class CaloCellContainerFromClusterTool virtual StatusCode initialize() override; // update theCellContainer - virtual StatusCode process(CaloConstCellContainer* theCellContainer) override; + virtual StatusCode process (CaloConstCellContainer* theCellContainer, + const EventContext& ctx) const override; private: diff --git a/Calorimeter/CaloRec/src/CaloCellContainerMergerTool.cxx b/Calorimeter/CaloRec/src/CaloCellContainerMergerTool.cxx index aacb6cc0e9e..559002eb23b 100644 --- a/Calorimeter/CaloRec/src/CaloCellContainerMergerTool.cxx +++ b/Calorimeter/CaloRec/src/CaloCellContainerMergerTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /******************************************************************** @@ -30,10 +30,9 @@ CaloCellContainerMergerTool::CaloCellContainerMergerTool( const std::string& type, const std::string& name, const IInterface* parent) - :AthAlgTool(type, name, parent), + :base_class (type, name, parent), m_caloCellsKey("") { - declareInterface<ICaloCellMakerTool>(this); declareProperty ("CaloCellsName",m_caloCellsKey); declareProperty ("CaloNums",m_caloNums); m_caloNums.clear(); @@ -77,9 +76,11 @@ StatusCode CaloCellContainerMergerTool::initialize() } -StatusCode CaloCellContainerMergerTool::process(CaloCellContainer * theCont ) +StatusCode +CaloCellContainerMergerTool::process (CaloCellContainer* theCont, + const EventContext& ctx) const { - SG::ReadHandle<CaloCellContainer> theCellContainer (m_caloCellsKey); + SG::ReadHandle<CaloCellContainer> theCellContainer (m_caloCellsKey, ctx); if (!theCellContainer.isValid()) { diff --git a/Calorimeter/CaloRec/src/CaloCellContainerMergerTool.h b/Calorimeter/CaloRec/src/CaloCellContainerMergerTool.h index ce869d02d42..cc6741cb894 100644 --- a/Calorimeter/CaloRec/src/CaloCellContainerMergerTool.h +++ b/Calorimeter/CaloRec/src/CaloCellContainerMergerTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef CALOREC_CALOCELLCONTAINERMERGERTOOL_H @@ -11,11 +11,9 @@ class StoreGateSvc; #include "CaloInterface/ICaloCellMakerTool.h" -class CaloCellContainerMergerTool: public AthAlgTool, - virtual public ICaloCellMakerTool - +class CaloCellContainerMergerTool + : public extends<AthAlgTool, ICaloCellMakerTool> { - public: CaloCellContainerMergerTool(const std::string& type, @@ -23,10 +21,11 @@ public: const IInterface* parent) ; - virtual StatusCode initialize() ; + virtual StatusCode initialize() override; // update theCellContainer - virtual StatusCode process( CaloCellContainer * theCellContainer) ; + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override; private: diff --git a/Calorimeter/CaloRec/src/CaloCellFastCopyTool.cxx b/Calorimeter/CaloRec/src/CaloCellFastCopyTool.cxx index d40a92a5033..b964aca683e 100644 --- a/Calorimeter/CaloRec/src/CaloCellFastCopyTool.cxx +++ b/Calorimeter/CaloRec/src/CaloCellFastCopyTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /* @@ -108,7 +108,8 @@ StatusCode CaloCellFastCopyTool::initialize() { } -StatusCode CaloCellFastCopyTool::process(CaloCellContainer* theCont) +StatusCode CaloCellFastCopyTool::process (CaloCellContainer* theCont, + const EventContext& /*ctx*/) const { // Retrieve source cell container SG::ReadHandle<CaloCellContainer> srcCont(m_srcCellContainerKey); @@ -124,7 +125,8 @@ StatusCode CaloCellFastCopyTool::process(CaloCellContainer* theCont) } -StatusCode CaloCellFastCopyTool::process(CaloConstCellContainer* theCont) +StatusCode CaloCellFastCopyTool::process (CaloConstCellContainer* theCont, + const EventContext& /*ctx*/) const { // Retrieve source cell container SG::ReadHandle<CaloCellContainer> srcCont(m_srcCellContainerKey); diff --git a/Calorimeter/CaloRec/src/CaloCellFastCopyTool.h b/Calorimeter/CaloRec/src/CaloCellFastCopyTool.h index 833baa5cbf7..3947f42cab2 100644 --- a/Calorimeter/CaloRec/src/CaloCellFastCopyTool.h +++ b/Calorimeter/CaloRec/src/CaloCellFastCopyTool.h @@ -1,7 +1,7 @@ // This file's extension implies that it's C, but it's really -*- 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 */ /* @@ -60,8 +60,10 @@ class CaloCellFastCopyTool const IInterface* parent); virtual StatusCode initialize() override; - virtual StatusCode process(CaloCellContainer* theCellContainer) override; - virtual StatusCode process(CaloConstCellContainer* theCellContainer) override; + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override; + virtual StatusCode process (CaloConstCellContainer* theCellContainer, + const EventContext& ctx) const override; private: diff --git a/Calorimeter/CaloRec/src/CaloCellMaker.cxx b/Calorimeter/CaloRec/src/CaloCellMaker.cxx index f04d029aab2..c56c2a07f8b 100644 --- a/Calorimeter/CaloRec/src/CaloCellMaker.cxx +++ b/Calorimeter/CaloRec/src/CaloCellMaker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /******************************************************************** @@ -102,7 +102,8 @@ StatusCode CaloCellMaker::initialize() { StatusCode CaloCellMaker::execute() { - SG::WriteHandle<CaloCellContainer> caloCellsOutput(m_caloCellsOutputKey); + const EventContext& ctx = Gaudi::Hive::currentContext(); + SG::WriteHandle<CaloCellContainer> caloCellsOutput(m_caloCellsOutputKey, ctx); ATH_CHECK( caloCellsOutput.record(CxxUtils::make_unique<CaloCellContainer>(static_cast<SG::OwnershipPolicy>(m_ownPolicy))) ); @@ -118,7 +119,7 @@ StatusCode CaloCellMaker::execute() { std::string chronoName = this->name() + "_" + itrTool->name(); m_chrono->chronoStart(chronoName); - StatusCode sc = (*itrTool)->process(caloCellsOutput.ptr()); + StatusCode sc = (*itrTool)->process(caloCellsOutput.ptr(), ctx); m_chrono->chronoStop(chronoName); ATH_MSG_DEBUG( "Chrono stop : delta " diff --git a/Calorimeter/CaloRec/test/CaloCellFastCopyTool_test.cxx b/Calorimeter/CaloRec/test/CaloCellFastCopyTool_test.cxx index c4e3b2f9f57..d1eb96e49f2 100644 --- a/Calorimeter/CaloRec/test/CaloCellFastCopyTool_test.cxx +++ b/Calorimeter/CaloRec/test/CaloCellFastCopyTool_test.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /* @@ -156,7 +156,8 @@ public: StatusCode testProcess (CaloCellFastCopyTool* tool, CONT* destCont) { - return tool->process (destCont); + EventContext ctx; + return tool->process (destCont, ctx); } diff --git a/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.cxx b/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.cxx index 58edf650cd1..14f1e9cb9aa 100644 --- a/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.cxx +++ b/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /******************************************************************** @@ -124,9 +124,9 @@ StatusCode LArBadFebMaskingTool::finalize() return StatusCode::SUCCESS; } -StatusCode LArBadFebMaskingTool::process(CaloCellContainer * theCont ) +StatusCode LArBadFebMaskingTool::process (CaloCellContainer* theCont, + const EventContext& ctx) const { - const EventContext& ctx = Gaudi::Hive::currentContext(); m_evt++; diff --git a/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.h b/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.h index d797bf40802..db5a882a734 100755 --- a/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.h +++ b/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCELLREC_LArBadFebMaskingTool_H @@ -52,7 +52,8 @@ public: /** update theCellContainer, masking Feb with errors */ - virtual StatusCode process( CaloCellContainer * theCellContainer) override; + virtual StatusCode process (CaloCellContainer * theCellContainer, + const EventContext& ctx) const override; private: diff --git a/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArHitTool.cxx b/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArHitTool.cxx index 5e901989e78..4b7d616221a 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArHitTool.cxx +++ b/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArHitTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "LArCellBuilderFromLArHitTool.h" @@ -369,10 +369,10 @@ StatusCode LArCellBuilderFromLArHitTool::finalize() /////////////////////////////////////////////////////////////////// -StatusCode LArCellBuilderFromLArHitTool::process( CaloCellContainer * theCellContainer ) +StatusCode +LArCellBuilderFromLArHitTool::process ( CaloCellContainer* theCellContainer, + const EventContext& ctx) const { - const EventContext& ctx = Gaudi::Hive::currentContext(); - SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey,ctx}; const LArOnOffIdMapping* cabling(*cablingHdl); diff --git a/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArHitTool.h b/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArHitTool.h index 3f2b4d7ebcd..6f59c3c1255 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArHitTool.h +++ b/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArHitTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCELLREC_LARCELLBUILDERFROMLARHITTOOL_H @@ -91,7 +91,8 @@ public: virtual StatusCode initialize() override; virtual StatusCode finalize() override; - virtual StatusCode process( CaloCellContainer * theCellContainer) override; + virtual StatusCode process ( CaloCellContainer * theCellContainer, + const EventContext& ctx) const override; virtual void handle(const Incident&) override; private: diff --git a/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArRawChannelTool.cxx b/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArRawChannelTool.cxx index bf30de902c5..51c01abcb8f 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArRawChannelTool.cxx +++ b/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArRawChannelTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ @@ -31,7 +31,7 @@ LArCellBuilderFromLArRawChannelTool::LArCellBuilderFromLArRawChannelTool( const std::string& type, const std::string& name, const IInterface* parent) - :AthAlgTool(type, name, parent), + :base_class (type, name, parent), m_rawChannelsKey("LArRawChannels"), m_addDeadOTX(true), m_initialDataPoolSize(-1), @@ -42,7 +42,6 @@ LArCellBuilderFromLArRawChannelTool::LArCellBuilderFromLArRawChannelTool( m_caloCID(nullptr), m_missingFebKey("LArBadFeb") { - declareInterface<ICaloCellMakerTool>(this); //key of input raw channel declareProperty("RawChannelsName",m_rawChannelsKey,"Name of input container"); // bad channel tool @@ -105,14 +104,16 @@ StatusCode LArCellBuilderFromLArRawChannelTool::initialize() { // ========================================================================================== // -StatusCode LArCellBuilderFromLArRawChannelTool::process(CaloCellContainer * theCellContainer) { - +StatusCode +LArCellBuilderFromLArRawChannelTool::process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const +{ if (theCellContainer->ownPolicy() == SG::OWN_ELEMENTS) { ATH_MSG_ERROR( "Called with a CaloCellContainer with wrong ownership policy! Need a VIEW container!" ); return StatusCode::FAILURE; } - SG::ReadHandle<LArRawChannelContainer> rawColl(m_rawChannelsKey); + SG::ReadHandle<LArRawChannelContainer> rawColl(m_rawChannelsKey, ctx); if(!rawColl.isValid()) { ATH_MSG_ERROR( " Can not retrieve LArRawChannelContainer: " << m_rawChannelsKey.key() ); @@ -136,9 +137,9 @@ StatusCode LArCellBuilderFromLArRawChannelTool::process(CaloCellContainer * theC theCellContainer->clear(); } - DataPool<LArCell> pool; + DataPool<LArCell> pool (ctx); - SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl(m_cablingKey); + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl(m_cablingKey, ctx); const LArOnOffIdMapping* cabling=*cablingHdl; @@ -181,7 +182,7 @@ StatusCode LArCellBuilderFromLArRawChannelTool::process(CaloCellContainer * theC unsigned nMissingButPresent=0; if (m_addDeadOTX) { - SG::ReadCondHandle<LArBadFebCont> missingFebHdl(m_missingFebKey); + SG::ReadCondHandle<LArBadFebCont> missingFebHdl(m_missingFebKey, ctx); const LArBadFebCont::BadChanVec& allMissingFebs=(*missingFebHdl)->fullCont(); for (const LArBadFebCont::BadChanEntry& it : allMissingFebs) { diff --git a/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArRawChannelTool.h b/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArRawChannelTool.h index 6641b1c092f..d04dca9b5e4 100755 --- a/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArRawChannelTool.h +++ b/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArRawChannelTool.h @@ -1,7 +1,7 @@ //Dear emacs, this is -*- 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 */ #ifndef LARCELLREC_LARCELLBUILDERFROMLARRAWCHANNELTOOL_H @@ -52,8 +52,8 @@ class LArCell; */ -class LArCellBuilderFromLArRawChannelTool: public AthAlgTool, - virtual public ICaloCellMakerTool +class LArCellBuilderFromLArRawChannelTool + : public extends<AthAlgTool, ICaloCellMakerTool> { public: /** @@ -66,7 +66,7 @@ public: /** * @brief Destructor, deletes the MsgService. */ - ~LArCellBuilderFromLArRawChannelTool(); + virtual ~LArCellBuilderFromLArRawChannelTool(); /** * @brief Initialize method. @@ -77,15 +77,17 @@ public: * Computes the total number of cells based on the subcalo hash-range. * */ - virtual StatusCode initialize(); + virtual StatusCode initialize() override; /** * @brief process method as defined in ICaloCellMaker interface * @param theCellContainer Pointer to the CaloCellContainer we are working on + * @param ctx The event context. * @return Gaudi status code. * */ - virtual StatusCode process( CaloCellContainer * theCellContainer) ; + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override; private: diff --git a/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.cxx b/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.cxx index 5bfb7f97803..6d9d68f5b9a 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.cxx +++ b/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /** * @file LArCellDeadOTXCorr.cxx @@ -215,13 +215,9 @@ StatusCode LArCellDeadOTXCorr::initialize() // process method // -StatusCode LArCellDeadOTXCorr::process(CaloCellContainer * cellCont) { - const EventContext& ctx = Gaudi::Hive::currentContext(); - return process(cellCont,ctx); -} - -StatusCode LArCellDeadOTXCorr::process(CaloCellContainer * cellCont, - const EventContext& ctx) const { +StatusCode LArCellDeadOTXCorr::process (CaloCellContainer* cellCont, + const EventContext& ctx) const +{ ATH_MSG_DEBUG (" in process..."); SG::ReadCondHandle<LArBadFebCont> badFebHdl{m_badFebKey,ctx}; diff --git a/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.h b/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.h index ce74fb5c8ae..1b497923e16 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.h +++ b/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /** @@ -82,8 +82,8 @@ class LArCellDeadOTXCorr virtual ~LArCellDeadOTXCorr(); virtual StatusCode initialize() override; - virtual StatusCode process( CaloCellContainer * CellCont) override; - virtual StatusCode process( CaloCellContainer * CellCont, const EventContext& ctx ) const; + virtual StatusCode process ( CaloCellContainer* CellCont, + const EventContext& ctx) const override; virtual StatusCode finalize() override; using AthAlgTool::setProperty; diff --git a/LArCalorimeter/LArCellRec/src/LArCellGainPathology.cxx b/LArCalorimeter/LArCellRec/src/LArCellGainPathology.cxx index b05cf4dd6f7..71faea45566 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellGainPathology.cxx +++ b/LArCalorimeter/LArCellRec/src/LArCellGainPathology.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /******************************************************************** @@ -34,12 +34,10 @@ LArCellGainPathology::LArCellGainPathology( const std::string& type, const std::string& name, const IInterface* parent) - : AthAlgTool(type, name, parent), + : base_class (type, name, parent), m_calo_id(nullptr), m_onlineID(nullptr) { - declareInterface<ICaloCellMakerTool>(this); - } @@ -66,7 +64,8 @@ StatusCode LArCellGainPathology::finalize() return StatusCode::SUCCESS; } -StatusCode LArCellGainPathology::process(CaloCellContainer * theCont ) +StatusCode LArCellGainPathology::process (CaloCellContainer* theCont, + const EventContext& /*ctx*/) const { ATH_MSG_DEBUG (" in LArCellGainPathology::process "); @@ -98,7 +97,7 @@ StatusCode LArCellGainPathology::process(CaloCellContainer * theCont ) return StatusCode::SUCCESS; } -void LArCellGainPathology::ApplyPathology(CaloCellContainer* theCont, HWIdentifier id1, HWIdentifier id2,const LArOnOffIdMapping* cabling) +void LArCellGainPathology::ApplyPathology(CaloCellContainer* theCont, HWIdentifier id1, HWIdentifier id2,const LArOnOffIdMapping* cabling) const { CaloCell* cell1 = this->GetCell(theCont, id1,cabling); @@ -133,7 +132,7 @@ void LArCellGainPathology::ApplyPathology(CaloCellContainer* theCont, HWIdentifi } -CaloCell* LArCellGainPathology::GetCell(CaloCellContainer* theCont, HWIdentifier id,const LArOnOffIdMapping* cabling) +CaloCell* LArCellGainPathology::GetCell(CaloCellContainer* theCont, HWIdentifier id,const LArOnOffIdMapping* cabling) const { CaloCell* aCell =0; if (cabling->isOnlineConnected(id)) { diff --git a/LArCalorimeter/LArCellRec/src/LArCellGainPathology.h b/LArCalorimeter/LArCellRec/src/LArCellGainPathology.h index e296b8b5059..94e82f4f2e1 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellGainPathology.h +++ b/LArCalorimeter/LArCellRec/src/LArCellGainPathology.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCELLREC_LARCELLGAINPATHOLOGY_H @@ -26,8 +26,8 @@ class LArOnlineID; class HWIdentifier; class CaloCell; -class LArCellGainPathology: public AthAlgTool, - virtual public ICaloCellMakerTool +class LArCellGainPathology + : public extends<AthAlgTool, ICaloCellMakerTool> { public: LArCellGainPathology(const std::string& type, @@ -37,26 +37,27 @@ public: /** initialize the tool */ - virtual StatusCode initialize() ; + virtual StatusCode initialize() override; /** finalize the tool */ - virtual StatusCode finalize() ; + virtual StatusCode finalize() override; /** update theCellContainer, masking Feb with errors */ - virtual StatusCode process( CaloCellContainer * theCellContainer) ; + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override; private: /** method to apply pathology between a couple of cells */ void ApplyPathology(CaloCellContainer* theCont, HWIdentifier id1, HWIdentifier id, - const LArOnOffIdMapping* cabling); + const LArOnOffIdMapping* cabling) const; /** method to find cell from hardware id */ CaloCell* GetCell(CaloCellContainer* theCont, HWIdentifier id, - const LArOnOffIdMapping* cabling); + const LArOnOffIdMapping* cabling) const; /** handle to LAr cabling service */ diff --git a/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.cxx b/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.cxx index 3d5208feb74..7ec9c806277 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.cxx +++ b/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.cxx @@ -21,13 +21,12 @@ LArCellMaskingTool::LArCellMaskingTool( const std::string& type, const std::string& name, const IInterface* parent) - : AthAlgTool(type, name, parent), + : base_class (type, name, parent), m_onlineID(nullptr), m_offlineID(nullptr) { m_mapInitialized = false; - declareInterface<ICaloCellMakerTool>(this); //List of strings to determine detector parts to be masked. //Syntax: barrel_endcap pos_neg Feedthrough slot channel (integers separated by white space) //Feedthrough, slot, and channel can be left out. In this case all channels belonging to this @@ -156,10 +155,9 @@ StatusCode LArCellMaskingTool::fillIncludedCellsMap(const LArOnOffIdMapping* cab -StatusCode LArCellMaskingTool::process(CaloCellContainer * theCont ) +StatusCode LArCellMaskingTool::process (CaloCellContainer* theCont, + const EventContext& ctx) const { - const EventContext& ctx = Gaudi::Hive::currentContext(); - if (! m_mapInitialized) { // FIXME: Can we do this in start()? std::lock_guard<std::mutex> lock (m_mutex); diff --git a/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.h b/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.h index 4654e72b36b..8796ef46e29 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.h +++ b/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.h @@ -18,9 +18,8 @@ #include <mutex> -class LArCellMaskingTool: public AthAlgTool, - virtual public ICaloCellMakerTool - +class LArCellMaskingTool + : public extends<AthAlgTool, ICaloCellMakerTool > { public: @@ -30,12 +29,13 @@ public: const IInterface* parent) ; - virtual StatusCode initialize() ; + virtual StatusCode initialize() override; // update theCellContainer - virtual StatusCode process( CaloCellContainer * theCellContainer) ; + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override; - virtual StatusCode finalize(); + virtual StatusCode finalize() override; private: StatusCode fillIncludedCellsMap(const LArOnOffIdMapping* cabling) const; diff --git a/LArCalorimeter/LArCellRec/src/LArCellMerger.cxx b/LArCalorimeter/LArCellRec/src/LArCellMerger.cxx index 1ac5c7c3ec3..8af7d4b766c 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellMerger.cxx +++ b/LArCalorimeter/LArCellRec/src/LArCellMerger.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /******************************************************************** @@ -31,13 +31,11 @@ LArCellMerger::LArCellMerger( const std::string& type, const std::string& name, const IInterface* parent) - :AthAlgTool(type, name, parent), + :base_class (type, name, parent), m_cablingKey("LArOnOffIdMap"), m_rawChannelContainerName("LArRawChannels_digits"), m_calo_id(nullptr) { - declareInterface<ICaloCellMakerTool>(this); - declareProperty("RawChannelsName",m_rawChannelContainerName,"Name of raw channel container"); } @@ -61,12 +59,12 @@ StatusCode LArCellMerger::finalize(){ return StatusCode::SUCCESS; } -StatusCode LArCellMerger::process(CaloCellContainer * theCont ) { - +StatusCode LArCellMerger::process (CaloCellContainer* theCont, + const EventContext& ctx) const +{ ATH_MSG_DEBUG("in LArCellMerger::process"); - - SG::ReadHandle<LArRawChannelContainer> rawColl(m_rawChannelContainerName); + SG::ReadHandle<LArRawChannelContainer> rawColl(m_rawChannelContainerName, ctx); if (!rawColl.isValid()) { ATH_MSG_ERROR("Failed to retrieve LArRawChannelContainer with key " << rawColl.name()); diff --git a/LArCalorimeter/LArCellRec/src/LArCellMerger.h b/LArCalorimeter/LArCellRec/src/LArCellMerger.h index 7d588947c3d..800e7afcce3 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellMerger.h +++ b/LArCalorimeter/LArCellRec/src/LArCellMerger.h @@ -1,6 +1,6 @@ //Dear emacs, this is -*-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 */ #ifndef LARCELLREC_LARCELLMERGER_H @@ -30,11 +30,9 @@ class CaloCell_ID; class LArRawChannelContainer; -class LArCellMerger: public AthAlgTool, - virtual public ICaloCellMakerTool - +class LArCellMerger + : public extends<AthAlgTool, ICaloCellMakerTool> { - public: LArCellMerger(const std::string& type, @@ -52,8 +50,8 @@ public: /** update theCellContainer */ - virtual StatusCode process( CaloCellContainer * theCellContainer) override; //could be const if the abstract base-class were const - + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override; private: diff --git a/LArCalorimeter/LArCellRec/src/LArCellNoiseMaskingTool.cxx b/LArCalorimeter/LArCellRec/src/LArCellNoiseMaskingTool.cxx index 4cbb8907f46..a0ad76f4513 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellNoiseMaskingTool.cxx +++ b/LArCalorimeter/LArCellRec/src/LArCellNoiseMaskingTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /******************************************************************** @@ -28,14 +28,13 @@ LArCellNoiseMaskingTool::LArCellNoiseMaskingTool( const std::string& type, const std::string& name, const IInterface* parent) - :AthAlgTool(type, name, parent), + :base_class (type, name, parent), m_maskingTool(this), m_maskingSporadicTool(this), m_qualityCut(65536), m_maskNoise(true), m_maskSporadic(true) { - declareInterface<ICaloCellMakerTool>(this); declareProperty("MaskingTool",m_maskingTool,"Tool handle for noisy/dead channel masking"); declareProperty("MaskingSporadicTool",m_maskingSporadicTool,"Tool handle for sporadic noisy channel masking"); declareProperty("qualityCut",m_qualityCut,"Quality cut for sporadic noise channel"); @@ -77,7 +76,9 @@ StatusCode LArCellNoiseMaskingTool::initialize() return StatusCode::SUCCESS; } -StatusCode LArCellNoiseMaskingTool::process(CaloCellContainer * theCont ) +StatusCode +LArCellNoiseMaskingTool::process (CaloCellContainer * theCont, + const EventContext& /*ctx*/) const { StatusCode returnSc = StatusCode::SUCCESS ; diff --git a/LArCalorimeter/LArCellRec/src/LArCellNoiseMaskingTool.h b/LArCalorimeter/LArCellRec/src/LArCellNoiseMaskingTool.h index def55d24556..2685befbe0a 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellNoiseMaskingTool.h +++ b/LArCalorimeter/LArCellRec/src/LArCellNoiseMaskingTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef LARCELLREC_LARCELLNOISEMASKINGTOOL_H @@ -10,8 +10,8 @@ #include "CaloInterface/ICaloCellMakerTool.h" #include "LArRecConditions/ILArBadChannelMasker.h" -class LArCellNoiseMaskingTool: public AthAlgTool, - virtual public ICaloCellMakerTool +class LArCellNoiseMaskingTool + : public extends<AthAlgTool, ICaloCellMakerTool> { public: LArCellNoiseMaskingTool(const std::string& type, @@ -19,10 +19,11 @@ public: const IInterface* parent) ; - virtual StatusCode initialize() ; + virtual StatusCode initialize() override; // update theCellContainer - virtual StatusCode process( CaloCellContainer * theCellContainer) ; + virtual StatusCode process (CaloCellContainer * theCellContainer, + const EventContext& ctx) const override; private: diff --git a/Reconstruction/HeavyIonRec/HIJetRec/src/HISubtractedCellMakerTool.cxx b/Reconstruction/HeavyIonRec/HIJetRec/src/HISubtractedCellMakerTool.cxx index c7f0c5560d5..f0295bf5327 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/src/HISubtractedCellMakerTool.cxx +++ b/Reconstruction/HeavyIonRec/HIJetRec/src/HISubtractedCellMakerTool.cxx @@ -28,9 +28,9 @@ StatusCode HISubtractedCellMakerTool::initialize() return StatusCode::SUCCESS; } -StatusCode HISubtractedCellMakerTool::process(CaloCellContainer* theCells) +StatusCode HISubtractedCellMakerTool::process (CaloCellContainer* theCells, + const EventContext& ctx) const { - const EventContext& ctx = Gaudi::Hive::currentContext(); if (ctx.slot() > 1) { ATH_MSG_ERROR("This tool hasn't been converted for MT."); return StatusCode::FAILURE; diff --git a/Reconstruction/HeavyIonRec/HIJetRec/src/HISubtractedCellMakerTool.h b/Reconstruction/HeavyIonRec/HIJetRec/src/HISubtractedCellMakerTool.h index 63d558337de..fca503f128b 100644 --- a/Reconstruction/HeavyIonRec/HIJetRec/src/HISubtractedCellMakerTool.h +++ b/Reconstruction/HeavyIonRec/HIJetRec/src/HISubtractedCellMakerTool.h @@ -1,9 +1,9 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ -#ifndef __HISUBTRACTEDCELLMAKERTOOL_H__ -#define __HISUBTRACTEDCELLMAKERTOOL_H__ +#ifndef HIJETREC_HISUBTRACTEDCELLMAKERTOOL_H +#define HIJETREC_HISUBTRACTEDCELLMAKERTOOL_H #include "AthenaBaseComps/AthAlgTool.h" #include "CaloInterface/ICaloCellMakerTool.h" @@ -20,8 +20,9 @@ class HISubtractedCellMakerTool : public AthAlgTool, virtual ICaloCellMakerTool public: HISubtractedCellMakerTool(const std::string& type, const std::string& name, const IInterface* parent); - StatusCode initialize(); - StatusCode process(CaloCellContainer* theCellContainer); + virtual StatusCode initialize() override; + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override; private: diff --git a/Simulation/FastShower/FastCaloSim/CMakeLists.txt b/Simulation/FastShower/FastCaloSim/CMakeLists.txt index 4c10890cb7d..1d727ea7239 100644 --- a/Simulation/FastShower/FastCaloSim/CMakeLists.txt +++ b/Simulation/FastShower/FastCaloSim/CMakeLists.txt @@ -19,6 +19,7 @@ atlas_depends_on_subdirs( PUBLIC GaudiKernel LArCalorimeter/LArRecEvent Simulation/FastSimulation/FastSimulationEvent + Simulation/FastShower/FastCaloSimAthenaPool TileCalorimeter/TileEvent Tracking/TrkEvent/TrkEventPrimitives Tracking/TrkEvent/TrkParameters diff --git a/Simulation/FastShower/FastCaloSim/FastCaloSim/AddNoiseCellBuilderTool.h b/Simulation/FastShower/FastCaloSim/FastCaloSim/AddNoiseCellBuilderTool.h index cefe33bcfac..72468798855 100755 --- a/Simulation/FastShower/FastCaloSim/FastCaloSim/AddNoiseCellBuilderTool.h +++ b/Simulation/FastShower/FastCaloSim/FastCaloSim/AddNoiseCellBuilderTool.h @@ -27,13 +27,14 @@ public: const std::string& type, const std::string& name, const IInterface* parent); - ~AddNoiseCellBuilderTool(); + virtual ~AddNoiseCellBuilderTool(); virtual StatusCode initialize() override; // update theCellContainer - virtual StatusCode process( CaloCellContainer * theCellContainer) override; + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override; private: ToolHandle<ICaloNoiseTool> m_noiseTool; //NoiseTool - public diff --git a/Simulation/FastShower/FastCaloSim/FastCaloSim/BasicCellBuilderTool.h b/Simulation/FastShower/FastCaloSim/FastCaloSim/BasicCellBuilderTool.h index 77d5800d1fd..711b45a6bdb 100755 --- a/Simulation/FastShower/FastCaloSim/FastCaloSim/BasicCellBuilderTool.h +++ b/Simulation/FastShower/FastCaloSim/FastCaloSim/BasicCellBuilderTool.h @@ -155,13 +155,14 @@ public: const std::string& name, const IInterface* parent); - ~BasicCellBuilderTool(); + virtual ~BasicCellBuilderTool(); virtual StatusCode initialize() override; // update theCellContainer - virtual StatusCode process( CaloCellContainer * theCellContainer) override; + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override; protected: void init_all_maps(); @@ -176,7 +177,6 @@ protected: void addCell(CaloCellContainer * theCellContainer, int etabin, int phibin, double energy, cellinfo_map& map ); Identifier m_id; - int m_nEvent; double m_phi0_em; double m_phi0_had; diff --git a/Simulation/FastShower/FastCaloSim/FastCaloSim/EmptyCellBuilderTool.h b/Simulation/FastShower/FastCaloSim/FastCaloSim/EmptyCellBuilderTool.h index 745454324a3..38bc4e84626 100755 --- a/Simulation/FastShower/FastCaloSim/FastCaloSim/EmptyCellBuilderTool.h +++ b/Simulation/FastShower/FastCaloSim/FastCaloSim/EmptyCellBuilderTool.h @@ -22,12 +22,14 @@ public: ~EmptyCellBuilderTool(); - virtual StatusCode initialize(); + virtual StatusCode initialize() override; // update theCellContainer - virtual StatusCode process( CaloCellContainer * theCellContainer) ; + virtual StatusCode process (CaloCellContainer * theCellContainer, + const EventContext& ctx) const override; private: - void create_empty_calo(CaloCellContainer * theCellContainer); + void create_empty_calo(const EventContext& ctx, + CaloCellContainer * theCellContainer) const; }; diff --git a/Simulation/FastShower/FastCaloSim/FastCaloSim/FastShowerCellBuilderTool.h b/Simulation/FastShower/FastCaloSim/FastCaloSim/FastShowerCellBuilderTool.h index 9e6a05ff2dd..5a19792348b 100755 --- a/Simulation/FastShower/FastCaloSim/FastCaloSim/FastShowerCellBuilderTool.h +++ b/Simulation/FastShower/FastCaloSim/FastCaloSim/FastShowerCellBuilderTool.h @@ -98,14 +98,16 @@ public: virtual StatusCode initialize() override final; // update theCellContainer - virtual StatusCode process(CaloCellContainer* theCellContainer) override final; + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override final; StatusCode setupEvent (const EventContext& ctx, TRandom3& rndm) const; StatusCode releaseEvent (Stats& stats) const; // the actual simulation code for one particle can run standalone without process(CaloCellContainer* theCellContainer), // but setupEvent() should be called before the first particle and releaseEvent() after the last particle StatusCode process_particle(CaloCellContainer* theCellContainer, std::vector<Trk::HitInfo>* hitVector, - Amg::Vector3D initMom, double mass, int pdgId, int barcode, + const Amg::Vector3D& initMom, + double mass, int pdgId, int barcode, FastShowerInfoContainer* fastShowerInfoContainer, TRandom3& rndm, Stats& stats, diff --git a/Simulation/FastShower/FastCaloSim/src/AddNoiseCellBuilderTool.cxx b/Simulation/FastShower/FastCaloSim/src/AddNoiseCellBuilderTool.cxx index f0df8386a57..d0f932a2c7f 100755 --- a/Simulation/FastShower/FastCaloSim/src/AddNoiseCellBuilderTool.cxx +++ b/Simulation/FastShower/FastCaloSim/src/AddNoiseCellBuilderTool.cxx @@ -58,7 +58,9 @@ StatusCode AddNoiseCellBuilderTool::initialize() return StatusCode::SUCCESS; } -StatusCode AddNoiseCellBuilderTool::process(CaloCellContainer * theCellContainer) +StatusCode +AddNoiseCellBuilderTool::process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const { m_rndmSvc->print(m_randomEngineName); //m_randomEngine->showStatus(); @@ -67,9 +69,7 @@ StatusCode AddNoiseCellBuilderTool::process(CaloCellContainer * theCellContainer rseed=(unsigned int)( CLHEP::RandFlat::shoot(m_randomEngine) * std::numeric_limits<unsigned int>::max() ); } - ATH_MSG_INFO("Executing start calo size=" <<theCellContainer->size()<<" Event="<<m_nEvent/*<<" rseed="<<rseed*/); - - ++m_nEvent; + ATH_MSG_INFO("Executing start calo size=" <<theCellContainer->size()<<" Event="<<ctx.evt()/*<<" rseed="<<rseed*/); double E_tot=0; double Et_tot=0; diff --git a/Simulation/FastShower/FastCaloSim/src/BasicCellBuilderTool.cxx b/Simulation/FastShower/FastCaloSim/src/BasicCellBuilderTool.cxx index c5404585215..30551e72666 100755 --- a/Simulation/FastShower/FastCaloSim/src/BasicCellBuilderTool.cxx +++ b/Simulation/FastShower/FastCaloSim/src/BasicCellBuilderTool.cxx @@ -20,7 +20,6 @@ BasicCellBuilderTool::BasicCellBuilderTool( const std::string& name, const IInterface* parent) :base_class(type, name, parent), - m_nEvent(0), m_caloDDM(0), m_caloCID(0), m_atlas_id(0) @@ -105,8 +104,6 @@ StatusCode BasicCellBuilderTool::initialize() // pointer to detector manager: m_atlas_id = (m_caloDDM->getCalo_Mgr())->getEM_ID(); - m_nEvent=0; - return StatusCode::SUCCESS; } @@ -857,10 +854,11 @@ void BasicCellBuilderTool::findCells(cellinfo_vec & cell_vec, double eta_min, do -StatusCode BasicCellBuilderTool::process(CaloCellContainer * theCellContainer) +StatusCode +BasicCellBuilderTool::process (CaloCellContainer* theCellContainer, + const EventContext& /*ctx*/) const { ATH_MSG_INFO("Executing start size=" <<theCellContainer->size()); - ++m_nEvent; // addCell0101(theCellContainer,48,10,300000,m_em_map); // addCell0101(theCellContainer,52,10,100000,m_em_map); diff --git a/Simulation/FastShower/FastCaloSim/src/EmptyCellBuilderTool.cxx b/Simulation/FastShower/FastCaloSim/src/EmptyCellBuilderTool.cxx index 054ed9d8893..44d894db31e 100755 --- a/Simulation/FastShower/FastCaloSim/src/EmptyCellBuilderTool.cxx +++ b/Simulation/FastShower/FastCaloSim/src/EmptyCellBuilderTool.cxx @@ -7,11 +7,6 @@ #include "AthAllocators/DataPool.h" -#include "GaudiKernel/ISvcLocator.h" -#include "GaudiKernel/StatusCode.h" -#include "GaudiKernel/MsgStream.h" -#include "StoreGate/StoreGateSvc.h" - #include "CaloEvent/CaloCell.h" #include "CaloEvent/CaloCellContainer.h" #include "TileEvent/TileCell.h" @@ -43,22 +38,24 @@ StatusCode EmptyCellBuilderTool::initialize() return sc; } -StatusCode EmptyCellBuilderTool::process(CaloCellContainer * theCellContainer) +StatusCode +EmptyCellBuilderTool::process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const { MsgStream log( msgSvc(), name() ); - create_empty_calo(theCellContainer); + create_empty_calo(ctx, theCellContainer); - ++m_nEvent; // log << MSG::INFO << "Executing finished calo size=" <<theCellContainer->size()<< endmsg; return StatusCode::SUCCESS; } -void EmptyCellBuilderTool::create_empty_calo(CaloCellContainer * theCellContainer) +void EmptyCellBuilderTool::create_empty_calo(const EventContext& ctx, + CaloCellContainer * theCellContainer) const { MsgStream log( msgSvc(), name() ); - ATH_MSG_DEBUG("Executing start calo size=" <<theCellContainer->size()<<" Event="<<m_nEvent); + ATH_MSG_DEBUG("Executing start calo size=" <<theCellContainer->size()<<" Event="<<ctx.evt()); bool check_exist=false; if(theCellContainer->size()>0) { check_exist=true; diff --git a/Simulation/FastShower/FastCaloSim/src/FastShowerCellBuilderTool.cxx b/Simulation/FastShower/FastCaloSim/src/FastShowerCellBuilderTool.cxx index b8e20225b95..eaa1cdff923 100755 --- a/Simulation/FastShower/FastCaloSim/src/FastShowerCellBuilderTool.cxx +++ b/Simulation/FastShower/FastCaloSim/src/FastShowerCellBuilderTool.cxx @@ -1170,7 +1170,7 @@ FastShowerCellBuilderTool::get_calo_surface(std::vector<Trk::HitInfo>* hitVector StatusCode FastShowerCellBuilderTool::process_particle(CaloCellContainer* theCellContainer, std::vector<Trk::HitInfo>* hitVector, - Amg::Vector3D initMom, + const Amg::Vector3D& initMom, double mass, int pdgid, int barcode, @@ -1894,8 +1894,7 @@ FastShowerCellBuilderTool::process_particle(CaloCellContainer* theCellContainer, if(ecell==0) continue; elayertot3+=ecell; - // is there a other way to get a non const pointer? - CaloCell* theCaloCell=(CaloCell*)(theCellContainer->findCell(cell->calo_hash())); + CaloCell* theCaloCell=theCellContainer->findCell(cell->calo_hash()); if(theCaloCell) { // log << MSG::VERBOSE << "found calo cell : eta=" <<theCaloCell->caloDDE()->eta()<<" phi="<<theCaloCell->caloDDE()->phi()<<" overlap="<<iter->second<<"old e=" <<theCaloCell->energy()<< " ; new e=" <<theCaloCell->energy()+energy*iter->second<< endmsg; theCaloCell->setEnergy(theCaloCell->energy()+ecell); @@ -2290,10 +2289,10 @@ void FastShowerCellBuilderTool::init_shape_correction() } } -StatusCode FastShowerCellBuilderTool::process(CaloCellContainer* theCellContainer) +StatusCode +FastShowerCellBuilderTool::process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const { - const EventContext& ctx = Gaudi::Hive::currentContext(); - ATH_MSG_DEBUG("Executing start calo size=" <<theCellContainer->size()<<" Event="<<ctx.evt()); TRandom3 rndm; diff --git a/Simulation/FastShower/FastCaloSimHit/FastCaloSimHit/FastHitConvertTool.h b/Simulation/FastShower/FastCaloSimHit/FastCaloSimHit/FastHitConvertTool.h index 8e0c0d1c8a9..2f049450fd9 100644 --- a/Simulation/FastShower/FastCaloSimHit/FastCaloSimHit/FastHitConvertTool.h +++ b/Simulation/FastShower/FastCaloSimHit/FastCaloSimHit/FastHitConvertTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -56,9 +56,12 @@ public: /** standard Athena-Algorithm method */ virtual StatusCode initialize() override final; /** standard Athena-Algorithm method */ - virtual StatusCode process(CaloCellContainer *theCellContainer) override; + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override; private: + StatusCode process_nc (CaloCellContainer *theCellContainer); + StatusCode initEvent(); StatusCode finaliseEvent(); StatusCode hitConstruction(CaloCellContainer *theCellCont); diff --git a/Simulation/FastShower/FastCaloSimHit/src/FastHitConvertTool.cxx b/Simulation/FastShower/FastCaloSimHit/src/FastHitConvertTool.cxx index ff8086b56bf..09e63267118 100644 --- a/Simulation/FastShower/FastCaloSimHit/src/FastHitConvertTool.cxx +++ b/Simulation/FastShower/FastCaloSimHit/src/FastHitConvertTool.cxx @@ -103,7 +103,16 @@ StatusCode FastHitConvertTool::initialize() return StatusCode::SUCCESS; } -StatusCode FastHitConvertTool::process(CaloCellContainer *theCellContainer) +StatusCode FastHitConvertTool::process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const +{ + if (ctx.slot() > 1) { + ATH_MSG_ERROR ("FastHitConvertTool doesn't work with MT."); + return StatusCode::FAILURE; + } + return const_cast<FastHitConvertTool*>(this)->process_nc (theCellContainer); +} +StatusCode FastHitConvertTool::process_nc(CaloCellContainer *theCellContainer) { const EventContext& ctx = Gaudi::Hive::currentContext(); if (ctx.slot() > 1) { diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/NativeFastCaloSimSvc.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/NativeFastCaloSimSvc.cxx index a51d2b7d668..e87f0a5849a 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/NativeFastCaloSimSvc.cxx +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/src/NativeFastCaloSimSvc.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -156,6 +156,7 @@ StatusCode ISF::NativeFastCaloSimSvc::setupEvent() m_theContainer = const_cast<CaloCellContainer *> (theConstContainer); } + const EventContext& ctx = Gaudi::Hive::currentContext(); // loop on setup tools ToolHandleArray<ICaloCellMakerTool>::iterator itrTool=m_caloCellMakerTools_setup.begin(); ToolHandleArray<ICaloCellMakerTool>::iterator endTool=m_caloCellMakerTools_setup.end(); @@ -164,7 +165,7 @@ StatusCode ISF::NativeFastCaloSimSvc::setupEvent() std::string chronoName=this->name()+"_"+ itrTool->name(); if (m_chrono) m_chrono -> chronoStart( chronoName); - StatusCode sc = (*itrTool)->process(m_theContainer); + StatusCode sc = (*itrTool)->process(m_theContainer, ctx); if (m_chrono) { m_chrono -> chronoStop( chronoName ); ATH_MSG_DEBUG( m_screenOutputPrefix << "Chrono stop : delta " << m_chrono->chronoDelta (chronoName,IChronoStatSvc::USER ) * CLHEP::microsecond / CLHEP::second << " second " ); diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcPU.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcPU.cxx index 81bd1de5382..bf28329366b 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcPU.cxx +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcPU.cxx @@ -164,6 +164,7 @@ StatusCode ISF::FastCaloSimSvcPU::finalize() StatusCode ISF::FastCaloSimSvcPU::setupEvent() { + const EventContext& ctx = Gaudi::Hive::currentContext(); ATH_MSG_INFO ( m_screenOutputPrefix << "now doing FastCaloSimSvcPU setupEvent"); //std::cout<< "now doing FastCaloSimSvcPU setupEvent"<<std::endl; @@ -257,7 +258,7 @@ StatusCode ISF::FastCaloSimSvcPU::setupEvent() ATH_MSG_INFO( m_screenOutputPrefix << "FastCaloSimSvcPU do tool "<<itrTool->name()<<" on m_Container"); //std::cout<<"FastCaloSimSvcPU do tool "<<itrTool->name()<<" on m_Container"<<std::endl; - StatusCode sc = (*itrTool)->process(m_theContainer); + StatusCode sc = (*itrTool)->process (m_theContainer, ctx); if(sc.isFailure()) { ATH_MSG_ERROR( m_screenOutputPrefix << "Error executing tool " << itrTool->name() ); @@ -286,7 +287,7 @@ StatusCode ISF::FastCaloSimSvcPU::setupEvent() ATH_MSG_INFO( m_screenOutputPrefix << "now doing loop on simulate tools" ); //std::cout<<"now doing loop on simulate tools"<<std::endl; - + // loop on simulate tools itrTool=m_caloCellMakerTools_simulate.begin(); endTool=m_caloCellMakerTools_simulate.end(); @@ -296,7 +297,6 @@ StatusCode ISF::FastCaloSimSvcPU::setupEvent() FastShowerCellBuilderTool* fcs=dynamic_cast< FastShowerCellBuilderTool* >(&(*(*itrTool))); if(fcs) { - const EventContext& ctx = Gaudi::Hive::currentContext(); if(fcs->setupEvent(ctx, m_rndm).isFailure()) { ATH_MSG_ERROR( m_screenOutputPrefix << "Error executing tool " << itrTool->name() << " in setupEvent"); @@ -312,7 +312,7 @@ StatusCode ISF::FastCaloSimSvcPU::setupEvent() StatusCode ISF::FastCaloSimSvcPU::releaseEvent() { - + const EventContext& ctx = Gaudi::Hive::currentContext(); ATH_MSG_INFO ( m_screenOutputPrefix << "now doing FastCaloSimSvcPU releaseEvent"); //std::cout<<"now doing FastCaloSimSvcPU releaseEvent"<<std::endl; @@ -416,7 +416,7 @@ StatusCode ISF::FastCaloSimSvcPU::releaseEvent() ATH_MSG_VERBOSE( m_screenOutputPrefix << "Calling tool " << itrTool->name() ); //process all particles in a truth container, writes all output into the cell container - if( fcs->process(m_theContainer).isFailure() ) + if( fcs->process(m_theContainer, ctx).isFailure() ) { ATH_MSG_WARNING( m_screenOutputPrefix << "batch simulation of FastCaloSim particles failed" ); return StatusCode::FAILURE; @@ -542,6 +542,7 @@ StatusCode ISF::FastCaloSimSvcPU::simulate(const ISF::ISFParticle& isfp, McEvent StatusCode ISF::FastCaloSimSvcPU::processOneParticle( const ISF::ISFParticle& isfp) { + const EventContext& ctx = Gaudi::Hive::currentContext(); ATH_MSG_INFO ( m_screenOutputPrefix << "now doing FastCaloSimSvcPU processOneParticle. Simulating pdgid = "<< isfp.pdgCode()); //std::cout<<"now doing FastCaloSimSvcPU processOneParticle. Simulating pdgid = "<< isfp.pdgCode()<<std::endl; @@ -569,7 +570,6 @@ StatusCode ISF::FastCaloSimSvcPU::processOneParticle( const ISF::ISFParticle& is // loop on tools FastShowerCellBuilderTool::Stats stats; - const EventContext& ctx = Gaudi::Hive::currentContext(); for(;itrTool!=endTool;++itrTool) { FastShowerCellBuilderTool* fcs=dynamic_cast< FastShowerCellBuilderTool* >(&(*(*itrTool))); diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcV2.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcV2.cxx index a87a7fbd445..4453fba2782 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcV2.cxx +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloSimSvcV2.cxx @@ -127,6 +127,7 @@ StatusCode ISF::FastCaloSimSvcV2::finalize() StatusCode ISF::FastCaloSimSvcV2::setupEvent() { + const EventContext& ctx = Gaudi::Hive::currentContext(); ATH_MSG_VERBOSE(m_screenOutputPrefix << "setupEvent NEW EVENT!"); m_theContainer = new CaloCellContainer(SG::VIEW_ELEMENTS); @@ -140,13 +141,11 @@ StatusCode ISF::FastCaloSimSvcV2::setupEvent() CHECK( m_caloCellMakerToolsSetup.retrieve() ); ATH_MSG_DEBUG( "Successfully retrieve CaloCellMakerTools: " << m_caloCellMakerToolsSetup ); - ToolHandleArray<ICaloCellMakerTool>::iterator itrTool = m_caloCellMakerToolsSetup.begin(); - ToolHandleArray<ICaloCellMakerTool>::iterator endTool = m_caloCellMakerToolsSetup.end(); - for (; itrTool != endTool; ++itrTool) + for (const ToolHandle<ICaloCellMakerTool>& tool : m_caloCellMakerToolsSetup) { - std::string chronoName=this->name()+"_"+ itrTool->name(); + std::string chronoName=this->name()+"_"+ tool.name(); if (m_chrono) m_chrono->chronoStart(chronoName); - StatusCode sc = (*itrTool)->process(m_theContainer); + StatusCode sc = tool->process(m_theContainer, ctx); if (m_chrono) { m_chrono->chronoStop(chronoName); ATH_MSG_DEBUG( m_screenOutputPrefix << "Chrono stop : delta " << m_chrono->chronoDelta (chronoName,IChronoStatSvc::USER) * CLHEP::microsecond / CLHEP::second << " second " ); @@ -154,7 +153,7 @@ StatusCode ISF::FastCaloSimSvcV2::setupEvent() if (sc.isFailure()) { - ATH_MSG_ERROR( m_screenOutputPrefix << "Error executing tool " << itrTool->name() ); + ATH_MSG_ERROR( m_screenOutputPrefix << "Error executing tool " << tool.name() ); return StatusCode::FAILURE; } } diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloTool.cxx b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloTool.cxx index dc013b1a49a..9434e19bf14 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloTool.cxx +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimServices/src/FastCaloTool.cxx @@ -165,6 +165,7 @@ StatusCode ISF::FastCaloTool::setupEvent() StatusCode ISF::FastCaloTool::commonSetup() { + const EventContext& ctx = Gaudi::Hive::currentContext(); // loop on setup tools for ( auto tool : m_caloCellMakerTools_setup) { ATH_MSG_DEBUG( "Calling tool " << tool->name() ); @@ -183,10 +184,9 @@ StatusCode ISF::FastCaloTool::commonSetup() } // loop on simulate tools - for ( auto tool : m_caloCellMakerTools_simulate) { + for ( const ToolHandle<ICaloCellMakerTool>& tool : m_caloCellMakerTools_simulate) { FastShowerCellBuilderTool* fcs=dynamic_cast< FastShowerCellBuilderTool* >(&(*tool)); if(fcs) { - const EventContext& ctx = Gaudi::Hive::currentContext(); if(fcs->setupEvent(ctx, m_rndm).isFailure()) { ATH_MSG_ERROR( "Error executing tool " << tool->name() << " in setupEvent"); return StatusCode::FAILURE; @@ -404,6 +404,8 @@ StatusCode ISF::FastCaloTool::releaseEventST() // the return value StatusCode sc = StatusCode::SUCCESS; + const EventContext& ctx = Gaudi::Hive::currentContext(); + // (1.) batch processing of all particles from McTruth // (for MC12 parametrization) // @@ -419,7 +421,7 @@ StatusCode ISF::FastCaloTool::releaseEventST() ATH_MSG_VERBOSE( "Calling tool " << tool->name() ); - if( fcs->process(m_theContainer).isFailure()) { + if( fcs->process(m_theContainer, ctx).isFailure()) { ATH_MSG_WARNING( "batch simulation of FastCaloSim particles failed" ); sc = StatusCode::FAILURE; } diff --git a/TestBeam/TBRec/src/TBCellContainerFillerTool.cxx b/TestBeam/TBRec/src/TBCellContainerFillerTool.cxx index 46cbfa08feb..81f5dda7e9c 100644 --- a/TestBeam/TBRec/src/TBCellContainerFillerTool.cxx +++ b/TestBeam/TBRec/src/TBCellContainerFillerTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "TBCellContainerFillerTool.h" @@ -16,11 +16,10 @@ TBCellContainerFillerTool::TBCellContainerFillerTool( const std::string& type, const std::string& name, const IInterface* parent) - :AthAlgTool(type, name, parent) , + :base_class (type, name, parent) , m_theCaloDDM(0), m_theCaloCCIDM(0), m_onlineHelper(0), m_hashMax(0) { - declareInterface<ICaloCellMakerTool>(this); } @@ -43,7 +42,9 @@ StatusCode TBCellContainerFillerTool::initialize() return StatusCode::SUCCESS; } -StatusCode TBCellContainerFillerTool::process(CaloCellContainer * theCont ) +StatusCode +TBCellContainerFillerTool::process (CaloCellContainer* theCont, + const EventContext& /*ctx*/) const { StatusCode returnSc = StatusCode::SUCCESS ; diff --git a/TestBeam/TBRec/src/TBCellContainerFillerTool.h b/TestBeam/TBRec/src/TBCellContainerFillerTool.h index a9d19e21085..231b3c202c8 100644 --- a/TestBeam/TBRec/src/TBCellContainerFillerTool.h +++ b/TestBeam/TBRec/src/TBCellContainerFillerTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef TBREC_TBCELLCONTAINERFILLERTOOL_H @@ -17,18 +17,19 @@ class CaloCell_ID; class LArCablingService; class LArOnlineID; -class TBCellContainerFillerTool: public AthAlgTool, virtual public ICaloCellMakerTool +class TBCellContainerFillerTool + : public extends<AthAlgTool, ICaloCellMakerTool> { - public: TBCellContainerFillerTool(const std::string& type, const std::string& name, const IInterface* parent) ; - virtual StatusCode initialize() ; + virtual StatusCode initialize() override; // update theCellContainer - virtual StatusCode process( CaloCellContainer * theCellContainer) ; + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override; private: const CaloDetDescrManager *m_theCaloDDM; diff --git a/TestBeam/TBRec/src/TBEMECXTalkToyModel.cxx b/TestBeam/TBRec/src/TBEMECXTalkToyModel.cxx index 59ea1221a4b..f2da3160ec0 100644 --- a/TestBeam/TBRec/src/TBEMECXTalkToyModel.cxx +++ b/TestBeam/TBRec/src/TBEMECXTalkToyModel.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /******************************************************************** @@ -34,12 +34,11 @@ TBEMECXTalkToyModel::TBEMECXTalkToyModel( const std::string& type, const std::string& name, const IInterface* parent) - :AthAlgTool(type, name, parent), + :base_class (type, name, parent), m_caloSelection(false), m_calo_dd_man(nullptr), m_calo_id(nullptr) { - declareInterface<ICaloCellMakerTool>(this); declareProperty("CaloNums",m_caloNums); declareProperty("XTalkScaleLong", m_xtalkScaleLong); declareProperty("XTalkScaleEta", m_xtalkScaleEta); @@ -98,7 +97,8 @@ StatusCode TBEMECXTalkToyModel::initialize() } -StatusCode TBEMECXTalkToyModel::process(CaloCellContainer * theCont ) +StatusCode TBEMECXTalkToyModel::process (CaloCellContainer* theCont, + const EventContext& /*ctx*/) const { StatusCode sc; @@ -138,7 +138,8 @@ StatusCode TBEMECXTalkToyModel::process(CaloCellContainer * theCont ) return StatusCode::SUCCESS ; } -StatusCode TBEMECXTalkToyModel::processOnCellIterators(const CaloCellContainer::iterator & itrCellBeg, const CaloCellContainer::iterator & itrCellEnd ) +StatusCode TBEMECXTalkToyModel::processOnCellIterators(const CaloCellContainer::iterator & itrCellBeg, + const CaloCellContainer::iterator & itrCellEnd ) const { unsigned int myCellHashOffset[CaloCell_ID::NSUBCALO]; std::set<int> m_validCalos; diff --git a/TestBeam/TBRec/src/TBEMECXTalkToyModel.h b/TestBeam/TBRec/src/TBEMECXTalkToyModel.h index 18252de837f..3a0d91eb41b 100644 --- a/TestBeam/TBRec/src/TBEMECXTalkToyModel.h +++ b/TestBeam/TBRec/src/TBEMECXTalkToyModel.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef TBREC_TBEMECXTALKTOYMODEL_H @@ -16,9 +16,8 @@ class StoreGateSvc; class CaloDetDescrManager; -class TBEMECXTalkToyModel: public AthAlgTool, - virtual public ICaloCellMakerTool - +class TBEMECXTalkToyModel + : public extends<AthAlgTool, ICaloCellMakerTool> { public: TBEMECXTalkToyModel(const std::string& type, @@ -27,7 +26,8 @@ public: virtual StatusCode initialize() override; // update theCellContainer - virtual StatusCode process( CaloCellContainer * theCellContainer) override; + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override; private: @@ -46,7 +46,7 @@ public: float m_xtalkScaleEta; float m_xtalkScaleEMEC2Eta; - StatusCode processOnCellIterators(const CaloCellContainer::iterator & itrCellBeg, const CaloCellContainer::iterator & itrCellEnd ); + StatusCode processOnCellIterators(const CaloCellContainer::iterator & itrCellBeg, const CaloCellContainer::iterator & itrCellEnd ) const; }; diff --git a/TileCalorimeter/TileRecAlgs/src/TileCellCorrection.cxx b/TileCalorimeter/TileRecAlgs/src/TileCellCorrection.cxx index b2104e98d5f..2ede3dea85f 100644 --- a/TileCalorimeter/TileRecAlgs/src/TileCellCorrection.cxx +++ b/TileCalorimeter/TileRecAlgs/src/TileCellCorrection.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ @@ -177,7 +177,7 @@ StatusCode TileCellCorrection::finalize() { /**************************************************************************** * Implementation of Incident listener ****************************************************************************/ -void TileCellCorrection::handle(const Incident& /* inc */) { +void TileCellCorrection::handle(const Incident& inc ) { bool verbose = msgLvl(MSG::VERBOSE); @@ -458,7 +458,7 @@ void TileCellCorrection::handle(const Incident& /* inc */) { msg(MSG::VERBOSE) << "Before cell masking total energy = " << energy << endmsg; } - if (m_tileCellMaskingTool->process((CaloCellContainer *) caloCellContainer).isFailure()) { + if (m_tileCellMaskingTool->process((CaloCellContainer *) caloCellContainer, inc.context()).isFailure()) { ATH_MSG_ERROR( " failed to run TileCellMaskingTool " ); } } @@ -470,7 +470,7 @@ void TileCellCorrection::handle(const Incident& /* inc */) { msg(MSG::VERBOSE) << "Before noise filter total energy = " << energy << endmsg; } - if (m_tileCellNoiseFilter->process((CaloCellContainer*) caloCellContainer).isFailure()) { + if (m_tileCellNoiseFilter->process((CaloCellContainer*) caloCellContainer, inc.context()).isFailure()) { ATH_MSG_ERROR( " failed to run TileCellNoiseFilter " ); } } @@ -483,7 +483,7 @@ void TileCellCorrection::handle(const Incident& /* inc */) { << " total energy = " << energy << endmsg; } - if (m_tileCellNeighborsTool->process((CaloCellContainer *) caloCellContainer).isFailure()) { + if (m_tileCellNeighborsTool->process((CaloCellContainer *) caloCellContainer, inc.context()).isFailure()) { ATH_MSG_ERROR( " failed to run CaloCellNeighborsAverageCorr " ); } } diff --git a/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellBuilder.h b/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellBuilder.h index f029d483268..1b7f8aafbfb 100644 --- a/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellBuilder.h +++ b/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellBuilder.h @@ -115,7 +115,8 @@ class TileCellBuilder virtual StatusCode finalize() override; /// method to process all raw channels and store them in container - virtual StatusCode process(CaloCellContainer* theCellContainer) override; + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override; void reset(bool fullSizeCont, bool printReset = true); //!< Method to reset the options of the TileCellContainer diff --git a/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellBuilderFromHit.h b/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellBuilderFromHit.h index e0b653a6ac1..c07a79b066c 100644 --- a/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellBuilderFromHit.h +++ b/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellBuilderFromHit.h @@ -87,7 +87,8 @@ class TileCellBuilderFromHit virtual StatusCode finalize() override; /// method to process all raw channels and store them in container - virtual StatusCode process(CaloCellContainer* theCellContainer) override; + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override; //AlgTool InterfaceID static const InterfaceID& interfaceID(); diff --git a/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellMaskingTool.h b/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellMaskingTool.h index f2c85b06036..17a4b82da93 100644 --- a/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellMaskingTool.h +++ b/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellMaskingTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef TILECELLMASKINGTOOL_H @@ -28,9 +28,10 @@ class TileCellMaskingTool: public AthAlgTool, virtual public ICaloCellMakerTool , const std::string& name , const IInterface* parent); - virtual StatusCode initialize(); - virtual StatusCode process(CaloCellContainer * theCellContainer); - virtual StatusCode finalize(); + virtual StatusCode initialize() override; + virtual StatusCode process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const override; + virtual StatusCode finalize() override; virtual bool channel_is_good(HWIdentifier & hwid); diff --git a/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellNoiseFilter.h b/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellNoiseFilter.h index 3f0b8be31ee..ab4c9b757ae 100644 --- a/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellNoiseFilter.h +++ b/TileCalorimeter/TileRecUtils/TileRecUtils/TileCellNoiseFilter.h @@ -54,7 +54,8 @@ class TileCellNoiseFilter: public extends<AthAlgTool, ICaloCellMakerTool> { StatusCode finalize() override; /** proceed the coherent noise subtraction algorithm and correct Tile cell energies */ - virtual StatusCode process (CaloCellContainer* cellcoll) override; + virtual StatusCode process (CaloCellContainer* cellcoll, + const EventContext& ctx) const override; private: diff --git a/TileCalorimeter/TileRecUtils/src/TileCellBuilder.cxx b/TileCalorimeter/TileRecUtils/src/TileCellBuilder.cxx index ee8d28b9e08..bb910cc45b1 100644 --- a/TileCalorimeter/TileRecUtils/src/TileCellBuilder.cxx +++ b/TileCalorimeter/TileRecUtils/src/TileCellBuilder.cxx @@ -268,9 +268,9 @@ StatusCode TileCellBuilder::finalize() { return StatusCode::SUCCESS; } -StatusCode TileCellBuilder::process(CaloCellContainer * theCellContainer) { - const EventContext& ctx = Gaudi::Hive::currentContext(); - +StatusCode TileCellBuilder::process (CaloCellContainer* theCellContainer, + const EventContext& ctx) const +{ //** //* Get TileRawChannels //** diff --git a/TileCalorimeter/TileRecUtils/src/TileCellBuilderFromHit.cxx b/TileCalorimeter/TileRecUtils/src/TileCellBuilderFromHit.cxx index 7562651a66d..963b1073879 100644 --- a/TileCalorimeter/TileRecUtils/src/TileCellBuilderFromHit.cxx +++ b/TileCalorimeter/TileRecUtils/src/TileCellBuilderFromHit.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ @@ -209,9 +209,9 @@ StatusCode TileCellBuilderFromHit::finalize() { return StatusCode::SUCCESS; } -StatusCode TileCellBuilderFromHit::process(CaloCellContainer * theCellContainer) { - const EventContext& ctx = Gaudi::Hive::currentContext(); - +StatusCode TileCellBuilderFromHit::process (CaloCellContainer * theCellContainer, + const EventContext& ctx) const +{ //** //* Get TileHits //** diff --git a/TileCalorimeter/TileRecUtils/src/TileCellMaskingTool.cxx b/TileCalorimeter/TileRecUtils/src/TileCellMaskingTool.cxx index 09b61075ffe..4a349f41b26 100644 --- a/TileCalorimeter/TileRecUtils/src/TileCellMaskingTool.cxx +++ b/TileCalorimeter/TileRecUtils/src/TileCellMaskingTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // Gaudi includes @@ -162,8 +162,9 @@ void TileCellMaskingTool::killer(std::string component, int ros, int drw, int in /////////////////////////////////////////////////////////////////////////////// -StatusCode TileCellMaskingTool::process(CaloCellContainer* theCont) { - +StatusCode TileCellMaskingTool::process (CaloCellContainer* theCont, + const EventContext& /*ctx*/) const +{ int n_cells = 0, n_masked_1 = 0, n_masked_2 = 0, n_masked_12 = 0; double ene_before = 0.0, ene_after = 0.0; diff --git a/TileCalorimeter/TileRecUtils/src/TileCellNoiseFilter.cxx b/TileCalorimeter/TileRecUtils/src/TileCellNoiseFilter.cxx index acaefe1abe4..540d09f94c5 100644 --- a/TileCalorimeter/TileRecUtils/src/TileCellNoiseFilter.cxx +++ b/TileCalorimeter/TileRecUtils/src/TileCellNoiseFilter.cxx @@ -87,7 +87,8 @@ StatusCode TileCellNoiseFilter::initialize() { // ============================================================================ // process container -StatusCode TileCellNoiseFilter::process (CaloCellContainer* cellcoll) +StatusCode TileCellNoiseFilter::process (CaloCellContainer* cellcoll, + const EventContext& /*ctx*/) const { ATH_MSG_DEBUG("in process()"); diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigCaloCellMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigCaloCellMaker.cxx index cfbe138d3ba..01cc7f2ade8 100755 --- a/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigCaloCellMaker.cxx +++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigCaloCellMaker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // ******************************************************************** @@ -396,13 +396,11 @@ HLT::ErrorCode TrigCaloCellMaker::hltExecute(const HLT::TriggerElement* inputTE, // Looping over cell container tools... this could be used for calibrations... - std::vector<ICaloCellMakerTool*> ::const_iterator itrcont=m_containerTools.begin(); - std::vector<ICaloCellMakerTool*> ::const_iterator endcont=m_containerTools.end(); - index=0; - for (; itrcont!=endcont; ++itrcont) { + const EventContext& ctx = Gaudi::Hive::currentContext(); + for (const ICaloCellMakerTool* tool : m_containerTools) { if (timerSvc()) m_timer[2+index]->start(); - if ( (*itrcont)->process(m_caloCellContainer).isFailure() ) { + if ( tool->process (m_caloCellContainer, ctx).isFailure() ) { //msg() << MSG::ERROR << "Error executing tool " << m_containerToolNames[index] << endmsg; msg() << MSG::ERROR << "Error executing container tool " << endmsg; } diff --git a/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigFullCaloCellMaker.cxx b/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigFullCaloCellMaker.cxx index afa51fed36c..2b8f17a9aa0 100755 --- a/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigFullCaloCellMaker.cxx +++ b/Trigger/TrigAlgorithms/TrigCaloRec/src/TrigFullCaloCellMaker.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ // ******************************************************************** @@ -270,12 +270,10 @@ HLT::ErrorCode TrigFullCaloCellMaker::hltExecute( std::vector<std::vector<HLT::T // Looping over cell container tools... this could be used for calibrations... - std::vector<ICaloCellMakerTool*> ::const_iterator itrcont=m_containerTools.begin(); - std::vector<ICaloCellMakerTool*> ::const_iterator endcont=m_containerTools.end(); - index=0; - for (; itrcont!=endcont; ++itrcont) { - if ( (*itrcont)->process(m_pCaloCellContainer).isFailure() ) { + const EventContext& ctx = Gaudi::Hive::currentContext(); + for (const ICaloCellMakerTool* tool : m_containerTools) { + if ( tool->process (m_pCaloCellContainer, ctx).isFailure() ) { //msg() << MSG::ERROR << "Error executing tool " << m_containerToolNames[index] << endmsg; msg() << MSG::ERROR << "Error executing container tool " << endmsg; } else { diff --git a/Trigger/TrigHypothesis/TrigHIHypo/src/HICaloCellCorectionTool.cxx b/Trigger/TrigHypothesis/TrigHIHypo/src/HICaloCellCorectionTool.cxx index 77891cc0857..ec0c20bd521 100644 --- a/Trigger/TrigHypothesis/TrigHIHypo/src/HICaloCellCorectionTool.cxx +++ b/Trigger/TrigHypothesis/TrigHIHypo/src/HICaloCellCorectionTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ @@ -21,11 +21,9 @@ StatusCode HICaloCellCorectionTool::initialize() return StatusCode::SUCCESS; } -StatusCode HICaloCellCorectionTool::process(CaloCellContainer* cells){ - const EventContext& ctx = Gaudi::Hive::currentContext(); - - // ATH_MSG_INFO( evtStore()->dump() ); - +StatusCode HICaloCellCorectionTool::process (CaloCellContainer* cells, + const EventContext& ctx) const +{ SG::ReadHandle<xAOD::HIEventShapeContainer> eventShape (m_eventShapeKey, ctx); CaloCellContainer clone(SG::VIEW_ELEMENTS); // this is not newed as it will be disposed at the return from this fucntion diff --git a/Trigger/TrigHypothesis/TrigHIHypo/src/HICaloCellCorectionTool.h b/Trigger/TrigHypothesis/TrigHIHypo/src/HICaloCellCorectionTool.h index 5f9d3523adf..cf829dd7631 100644 --- a/Trigger/TrigHypothesis/TrigHIHypo/src/HICaloCellCorectionTool.h +++ b/Trigger/TrigHypothesis/TrigHIHypo/src/HICaloCellCorectionTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef HICALOCELLCORECTIONTOOL_H @@ -24,7 +24,8 @@ class HICaloCellCorectionTool virtual ~HICaloCellCorectionTool(){}; virtual StatusCode initialize() override; - virtual StatusCode process(CaloCellContainer* cellContainer) override; + virtual StatusCode process (CaloCellContainer* cellContainer, + const EventContext& ctx) const override; private: SG::ReadHandleKey<xAOD::HIEventShapeContainer> m_eventShapeKey; -- GitLab