diff --git a/TileCalorimeter/TileConditions/TileConditions/ITileCellNoiseTool.h b/TileCalorimeter/TileConditions/TileConditions/ITileCellNoiseTool.h index bb53c93f5231d3f9b524fe1bdad33758390f5d70..3dc49696cb8a972b835e87e2fd51a3050d83ebfe 100644 --- a/TileCalorimeter/TileConditions/TileConditions/ITileCellNoiseTool.h +++ b/TileCalorimeter/TileConditions/TileConditions/ITileCellNoiseTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef TILECONDITIONS_ITILECELLNOISETOOL_H @@ -17,13 +17,9 @@ class ITileCellNoiseTool : virtual public IAlgTool { virtual ~ITileCellNoiseTool() {} - static const InterfaceID& interfaceID() { - static const InterfaceID IID_ITileCellNoiseTool("ITileCellNoiseTool", 1 , 0); - return IID_ITileCellNoiseTool; - } - virtual float getCellNoise(const Identifier& cell_id, CaloGain::CaloGain caloGain) const = 0; - + + DeclareInterfaceID(ITileCellNoiseTool, 1, 0); }; #endif diff --git a/TileCalorimeter/TileConditions/TileConditions/ITileCondToolOfc.h b/TileCalorimeter/TileConditions/TileConditions/ITileCondToolOfc.h index d50bfab5c5f5583996a4561aa8c7ea3658f5c161..d7edbd5efa30bafd6a2f20f324ab2012e7696b17 100644 --- a/TileCalorimeter/TileConditions/TileConditions/ITileCondToolOfc.h +++ b/TileCalorimeter/TileConditions/TileConditions/ITileCondToolOfc.h @@ -22,15 +22,12 @@ class ITileCondToolOfc : public virtual IAlgTool { virtual ~ITileCondToolOfc() {} - static const InterfaceID& interfaceID() { - static const InterfaceID IID_ITileCondToolOfc("ITileCondToolOfc", 1 , 0); - return IID_ITileCondToolOfc; - } - virtual const TileOfcWeightsStruct * getOfcWeights(unsigned int drawerIdx, unsigned int channel, unsigned int adc, float& phase, bool of2) = 0 ; virtual int getNSamples(void) = 0 ; + DeclareInterfaceID(ITileCondToolOfc, 1, 0); + }; #endif diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCellNoiseTool.h b/TileCalorimeter/TileConditions/TileConditions/TileCellNoiseTool.h index b5fb6633459dff6ce6e4e626cd072a3248136291..63c3ecc14986f769d8b73c5ef2a84adc8af1a83b 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileCellNoiseTool.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileCellNoiseTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef TILECONDITIONS_TILECELLNOISETOOL_H @@ -7,6 +7,8 @@ // Tile includes #include "TileConditions/ITileCellNoiseTool.h" +#include "TileConditions/TileCondIdTransforms.h" +#include "TileConditions/ITileCondToolNoise.h" // Athena includes #include "AthenaBaseComps/AthAlgTool.h" @@ -19,14 +21,11 @@ // Forward declaration class TileCablingSvc; -class TileCondIdTransforms; -class ITileCondToolNoise; -class TileCellNoiseTool: public AthAlgTool - , virtual public ITileCellNoiseTool { +class TileCellNoiseTool: public extends<AthAlgTool, ITileCellNoiseTool> { + public: - static const InterfaceID& interfaceID(); TileCellNoiseTool(const std::string& type, const std::string& name, const IInterface* parent); virtual ~TileCellNoiseTool(); @@ -39,8 +38,11 @@ class TileCellNoiseTool: public AthAlgTool //=== used tools ServiceHandle<TileCablingSvc> m_tileCabling; - ToolHandle<TileCondIdTransforms> m_tileIdTrans; - ToolHandle<ITileCondToolNoise> m_tileToolNoise; + ToolHandle<TileCondIdTransforms> m_tileIdTrans{this, + "TileCondIdTransforms", "TileCondIdTransforms", "Tile Id transform helper tool"}; + + ToolHandle<ITileCondToolNoise> m_tileToolNoise{this, + "TileCondToolNoise", "TileCondToolNoiseSample", "Tile cell noise tool"}; }; diff --git a/TileCalorimeter/TileConditions/TileConditions/TileCondToolOfc.h b/TileCalorimeter/TileConditions/TileConditions/TileCondToolOfc.h index 2490c76d4a518cad459fc81a42610a66775099e9..6c86eeff86c5f41bd88b401303a9218097a17d4a 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileCondToolOfc.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileCondToolOfc.h @@ -14,7 +14,6 @@ // Tile includes #include "TileConditions/ITileCondToolOfc.h" #include "TileConditions/TileInfo.h" -// #include "TileConditions/TileCondToolNoiseSample.h" #include "TileConditions/TileCondToolAutoCr.h" #include "TileConditions/TileCondToolPulseShape.h" @@ -39,7 +38,8 @@ class IdContext; * Optionally, it can create cache table of OFCs with 1-ns step to minimize * CPU time. Also, by request, unity A/C matrix can be used. */ -class TileCondToolOfc: public AthAlgTool, public ITileCondToolOfc { +class TileCondToolOfc: public extends<AthAlgTool, ITileCondToolOfc> { + public: TileCondToolOfc(const std::string& type, const std::string& name, const IInterface* parent); @@ -47,7 +47,6 @@ class TileCondToolOfc: public AthAlgTool, public ITileCondToolOfc { StatusCode initialize(); StatusCode finalize(); - static const InterfaceID& interfaceID(); void CalcWeights(unsigned int drawerIdx, unsigned int channel, int gain, float phase, bool of2); @@ -72,9 +71,12 @@ class TileCondToolOfc: public AthAlgTool, public ITileCondToolOfc { typedef std::map<int, std::unique_ptr<TileOfcWeightsStruct> > OfcPhaseCache; std::vector<std::unique_ptr<OfcPhaseCache> > m_ofc_phase_cache; - ToolHandle<TileCondToolPulseShape> m_tileToolPulseShape; - ToolHandle<TileCondToolAutoCr> m_tileToolAutoCr; - // ToolHandle<TileCondToolNoiseSample> m_tileToolNoiseSample; + ToolHandle<TileCondToolPulseShape> m_tileToolPulseShape{this, + "TileCondToolPulseShape", "TileCondToolPulseShape", "Tile pulse shape tool"}; + + ToolHandle<TileCondToolAutoCr> m_tileToolAutoCr{this, + "TileCondToolAutoCr", "TileCondToolAutoCr", "Tile auto correlation matrix tool"}; + const TileInfo* m_tileInfo; TileOfcWeightsStruct m_weights; diff --git a/TileCalorimeter/TileConditions/src/TileCellNoiseTool.cxx b/TileCalorimeter/TileConditions/src/TileCellNoiseTool.cxx index abf865ba8ee8a99f5855fe78c485ea4ef8c6257d..aafc6f5a2348c309c64edd3ee37992999d0fa433 100644 --- a/TileCalorimeter/TileConditions/src/TileCellNoiseTool.cxx +++ b/TileCalorimeter/TileConditions/src/TileCellNoiseTool.cxx @@ -1,13 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ // Tile includes #include "TileConditions/TileCellNoiseTool.h" -#include "TileConditions/ITileCondToolNoise.h" #include "TileConditions/TileCablingSvc.h" -#include "TileConditions/TileCondIdTransforms.h" #include "TileConditions/Exception.h" // Athena includes @@ -16,26 +14,14 @@ #include <cmath> #include <algorithm> -// -//____________________________________________________________________ -static const InterfaceID IID_TileCellNoiseTool("TileCellNoiseTool", 1, 0); -const InterfaceID& -TileCellNoiseTool::interfaceID() { - return IID_TileCellNoiseTool; -} // //____________________________________________________________________ TileCellNoiseTool::TileCellNoiseTool(const std::string& type, const std::string& name, - const IInterface* parent) - : AthAlgTool(type, name, parent) + const IInterface* parent) + : base_class(type, name, parent) , m_tileCabling("TileCablingSvc", name) - , m_tileIdTrans("TileCondIdTransforms") - , m_tileToolNoise("TileCondToolNoiseSample") { - declareInterface<ITileCellNoiseTool>(this); - declareInterface<TileCellNoiseTool>(this); - declareProperty("NoiseSource", m_tileToolNoise, "Source for cell noise computation"); } // diff --git a/TileCalorimeter/TileConditions/src/TileCondToolOfc.cxx b/TileCalorimeter/TileConditions/src/TileCondToolOfc.cxx index 4d475036242360ba7b1b440ea2c5ef861d70979c..73964c04169aabe52b958bedc64a8d12ebebb70d 100644 --- a/TileCalorimeter/TileConditions/src/TileCondToolOfc.cxx +++ b/TileCalorimeter/TileConditions/src/TileCondToolOfc.cxx @@ -2,40 +2,28 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// Athena includes -#include "AthenaKernel/errorcheck.h" - // Tile includes #include "TileConditions/TileCondToolOfc.h" #include "TileConditions/TileCablingService.h" #include "TileConditions/TileCablingSvc.h" +// Athena includes +#include "AthenaKernel/errorcheck.h" -// -//____________________________________________________________________ -const InterfaceID& TileCondToolOfc::interfaceID() { - return ITileCondToolOfc::interfaceID(); -} // //____________________________________________________________________ TileCondToolOfc::TileCondToolOfc(const std::string& type, const std::string& name, - const IInterface* parent) - : AthAlgTool(type, name, parent) - , m_tileToolPulseShape("TileCondToolPulseShape") - , m_tileToolAutoCr("TileCondToolAutoCr") -// , m_tileToolNoiseSample("TileCondToolNoiseSample") + const IInterface* parent) + : base_class(type, name, parent) , m_tileInfo(0) , m_maxChannels(0) , m_maxGains(0) , m_drawerCacheSize(0) { - declareInterface<ITileCondToolOfc>(this); declareProperty("nSamples", m_nSamples = 7, "number of samples used in the run"); declareProperty("OptFilterDeltaCorrelation", m_deltaCorrelation = false , "true=> use delta correlation; false=>use calculation obtained from data"); - declareProperty("TileCondToolPulseShape", m_tileToolPulseShape); - declareProperty("TileCondToolAutoCr", m_tileToolAutoCr); declareProperty("CacheSize", m_cache = 0, ">0 create cache; ==0 calculate on-fly"); m_t0Sample = (m_nSamples - 1) / 2; @@ -54,16 +42,16 @@ StatusCode TileCondToolOfc::initialize() { ATH_MSG_INFO( "In initialize()" ); //=== Get TileCondToolPulseShape - CHECK( m_tileToolPulseShape.retrieve() ); + ATH_CHECK( m_tileToolPulseShape.retrieve() ); if (!m_deltaCorrelation) { - CHECK(m_tileToolAutoCr.retrieve()); + ATH_CHECK(m_tileToolAutoCr.retrieve()); } else { m_tileToolAutoCr.disable(); } //==== TileInfo - CHECK( detStore()->retrieve(m_tileInfo, "TileInfo") ); + ATH_CHECK( detStore()->retrieve(m_tileInfo, "TileInfo") ); if (m_nSamples != m_tileInfo->NdigitSamples()) { ATH_MSG_WARNING( "Changing number of samples from " << m_nSamples @@ -89,7 +77,7 @@ StatusCode TileCondToolOfc::initialize() { //=== Initialize max values ServiceHandle<TileCablingSvc> cablingSvc("TileCablingSvc", name()); - CHECK( cablingSvc.retrieve()); + ATH_CHECK( cablingSvc.retrieve()); const TileCablingService* cabling = cablingSvc->cablingService(); if (!cabling) {