diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserDefaultCalibTool.h b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserDefaultCalibTool.h index df52a945e1fd61cd02444e5cb975461f5769933a..a65829244a79afe6223894d2f1d1bf00e6909c0d 100644 --- a/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserDefaultCalibTool.h +++ b/TileCalorimeter/TileCalib/TileCalibAlgs/TileCalibAlgs/TileLaserDefaultCalibTool.h @@ -5,19 +5,22 @@ #ifndef TILECALIBALG_TILELASERDEFAULTCALIBTOOL_H #define TILECALIBALG_TILELASERDEFAULTCALIBTOOL_H -#include "AthenaBaseComps/AthAlgTool.h" +// Tile includes #include "TileCalibAlgs/ITileCalibTool.h" #include "TileEvent/TileDQstatus.h" -#include "StoreGate/ReadHandleKey.h" -#include <string> -#include <map> -#include <cmath> - #include "TileConditions/TileCablingService.h" #include "TileConditions/TileCondToolEmscale.h" #include "TileConditions/ITileBadChanTool.h" +#include "TileConditions/ITileDCSTool.h" +// Athena includes +#include "AthenaBaseComps/AthAlgTool.h" +#include "StoreGate/ReadHandleKey.h" + +#include <string> +#include <map> +#include <cmath> #define NDIODES 10 @@ -39,7 +42,6 @@ class TileLaserObject; class TileHWID; class TFile; class RunningStat; -class TileDCSSvc; class ITileStuckBitsProbsTool; class TileLaserDefaultCalibTool : public AthAlgTool, virtual public ITileCalibTool @@ -74,8 +76,7 @@ class TileLaserDefaultCalibTool : public AthAlgTool, virtual public ITileCalibTo ToolHandle<ITileStuckBitsProbsTool> m_stuckBitsProbs; SG::ReadHandleKey<TileDQstatus> m_dqStatusKey; - ServiceHandle<TileDCSSvc> m_tileDCSSvc; //!< Pointer to TileDCSSvc - + ToolHandle<ITileDCSTool> m_tileDCS{this, "TileDCSTool", "TileDCSTool", "Tile DCS tool"}; // Parameter which will end up in the ROOTuple // diff --git a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserDefaultCalibTool.cxx b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserDefaultCalibTool.cxx index 614effeabff42477a1502002899f6b447b833c4e..650d7f9bf165d24394c456e2f6f8866d57e0023a 100644 --- a/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserDefaultCalibTool.cxx +++ b/TileCalorimeter/TileCalib/TileCalibAlgs/src/TileLaserDefaultCalibTool.cxx @@ -2,7 +2,15 @@ Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ +// Tile includes #include "TileCalibAlgs/TileLaserDefaultCalibTool.h" +#include "TileEvent/TileRawChannelContainer.h" +#include "TileEvent/TileLaserObject.h" +#include "TileConditions/TileCablingService.h" +#include "TileCalibBlobObjs/TileCalibUtils.h" +#include "TileConditions/ITileBadChanTool.h" +#include "TileMonitoring/ITileStuckBitsProbsTool.h" + #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/Service.h" @@ -13,14 +21,6 @@ #include "Identifier/HWIdentifier.h" #include "StoreGate/ReadHandle.h" -#include "TileEvent/TileRawChannelContainer.h" -#include "TileEvent/TileLaserObject.h" -#include "TileConditions/TileCablingService.h" -#include "TileCalibBlobObjs/TileCalibUtils.h" -#include "TileConditions/ITileBadChanTool.h" -#include "TileConditions/TileDCSSvc.h" - -#include "TileMonitoring/ITileStuckBitsProbsTool.h" #include "TFile.h" #include "TTree.h" @@ -46,7 +46,6 @@ TileLaserDefaultCalibTool::TileLaserDefaultCalibTool(const std::string& type, co m_tileToolEmscale("TileCondToolEmscale"), m_tileBadChanTool("TileBadChanTool"), m_stuckBitsProbs(""), - m_tileDCSSvc("TileDCSSvc",name), m_toolRunNo(0), m_ADC_problem(0), m_las_filter(0), @@ -123,7 +122,6 @@ TileLaserDefaultCalibTool::TileLaserDefaultCalibTool(const std::string& type, co declareProperty("rawChannelContainer", m_rawChannelContainerName=""); declareProperty("laserObjContainer", m_laserContainerName=""); declareProperty("pisaMethod2", m_pisaMethod2=true); - declareProperty("TileDCSSvc",m_tileDCSSvc); declareProperty("StuckBitsProbsTool", m_stuckBitsProbs); declareProperty("TileDQstatus", m_dqStatusKey = "TileDQstatus"); } // TileLaserDefaultCalibTool::TileLaserDefaultCalibTool @@ -273,9 +271,9 @@ StatusCode TileLaserDefaultCalibTool::initialize(){ ATH_CHECK( m_tileBadChanTool.retrieve() ); - ATH_CHECK( m_tileDCSSvc.retrieve() ); + ATH_CHECK( m_tileDCS.retrieve() ); - CHECK( m_dqStatusKey.initialize() ); + ATH_CHECK( m_dqStatusKey.initialize() ); return StatusCode::SUCCESS; } @@ -895,11 +893,9 @@ StatusCode TileLaserDefaultCalibTool::finalizeCalculations(){ for(int part=0; part<NPARTITIONS; ++part){ int ros = part+1; for(int drawer=0; drawer<NDRAWERS; ++drawer){ - int module = drawer+1; for(int channel=0; channel<NCHANNELS; ++channel){ - int pmt = abs(m_cabling->channel2hole(ros,channel)); - m_HV[part][drawer][channel] = m_tileDCSSvc->getDCSHV(ros, module, pmt); - m_HVSet[part][drawer][channel] = m_tileDCSSvc->getDCSHVSET(ros, module, pmt); + m_HV[part][drawer][channel] = m_tileDCS->getChannelHV(ros, drawer, channel); + m_HVSet[part][drawer][channel] = m_tileDCS->getChannelHVSet(ros, drawer, channel); } // channel } // drawers } // partitions diff --git a/TileCalorimeter/TileConditions/TileConditions/TileConditionsDict.h b/TileCalorimeter/TileConditions/TileConditions/TileConditionsDict.h index 454b91d3dbc179243791d17f702d42e64b3b469a..d5ba3b83097023593be0e311ea9af6585e07d307 100644 --- a/TileCalorimeter/TileConditions/TileConditions/TileConditionsDict.h +++ b/TileCalorimeter/TileConditions/TileConditions/TileConditionsDict.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 */ @@ -9,6 +9,5 @@ #include "TileConditions/TileBadChanTool.h" #include "TileConditions/TileCablingService.h" #include "TileConditions/TileCablingSvc.h" -#include "TileConditions/TileDCSSvc.h" -#endif +#endif // TILECONDITIONS_TILECONDITIONSDICT_H diff --git a/TileCalorimeter/TileConditions/TileConditions/TileDCSSvc.h b/TileCalorimeter/TileConditions/TileConditions/TileDCSSvc.h deleted file mode 100644 index e1376a8d04e15a0bfd56f4948bae3d78b001f386..0000000000000000000000000000000000000000 --- a/TileCalorimeter/TileConditions/TileConditions/TileDCSSvc.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef TILECONDITIONS_TILECONDDCS_H -#define TILECONDITIONS_TILECONDDCS_H - -// Tile includes -#include "TileConditions/ITileDCSTool.h" -#include "TileConditions/TileCablingSvc.h" - -// Athena includes -#include "AthenaBaseComps/AthService.h" - -// Gaudi includes -#include "GaudiKernel/ToolHandle.h" - -// Forward declaration -class TileCablingService; - - -template <class TYPE> class SvcFactory; - - -//Class to provide DCS information about modules from the COOL database -class TileDCSSvc: virtual public AthService { - friend class SvcFactory<TileDCSSvc>; - - public: - static const InterfaceID& interfaceID(); /*as in TileCablingSvc.h*/ - TileDCSSvc( const std::string& name, ISvcLocator* pSvcLocator ); - virtual ~TileDCSSvc(){ /*do nothing*/} - virtual StatusCode initialize(); - virtual StatusCode finalize(); - StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface); - - enum TileDCSStatus {NON_EXISTING=0, UNKNOWN=1, - OK_DRAWER=10, OK_KNOWNBADPMT, OK, - WARNING_DRAWER=20, WARNING_KNOWNBADPMT, WARNING, - ALERT_DRAWER=30, ALERT_KNOWNBADPMT, ALERT}; - - // these 3 methods return values found in COOL - // and they use ros=1,2,3,4, module and pmt as parameter, all three starts from "1", like in DCS - float getDCSHV (int ros, int module, int pmt) const; - float getDCSHVSET (int ros, int module, int pmt) const; - int getDCSSTATES (int ros, int module) const; - - // these 3 methods return status values which can be used to detect bad PMTs - // ros=1,2,3,4 as usual, while drawer and channel starts from "0" - TileDCSStatus getDCSHVSTATUS (int ros, int drawer, int channel) const; // status for HV deviation - TileDCSStatus getDCSSTATUS (int ros, int drawer) const; // status of drawer voltages - TileDCSStatus getDCSSTATUS (int ros, int drawer, int channel) const; - - bool statusHVIsBad (int ros, int drawer, int channel) const; - bool statusIsBad (int ros, int drawer) const; - bool statusIsBad (int ros, int drawer, int channel) const; - - int getNcalls() const { return m_ncalls; } // how many times callBack was triggered - - std::string partitionName(int ros) {return m_partName[ros];} - - private: - - ToolHandle<ITileDCSTool> m_dcsTool{this, "TileDCSTool", "TileDCSTool", "Tile DCS tool"}; - - int m_ncalls; - - const TileCablingService* m_cabling; - - int m_pmt2channel[2][68]; - - std::vector<std::string> m_partName; - - int m_version; -}; - -#endif diff --git a/TileCalorimeter/TileConditions/TileConditions/selection.xml b/TileCalorimeter/TileConditions/TileConditions/selection.xml index f73dffa515be83249e464ad07b86a9b8938498ff..046fd44f3b72c48cff4710b423365f86889d2647 100644 --- a/TileCalorimeter/TileConditions/TileConditions/selection.xml +++ b/TileCalorimeter/TileConditions/TileConditions/selection.xml @@ -4,6 +4,5 @@ <class name="ITileBadChanTool" /> <class name="TileCablingService" /> <class name="TileCablingSvc" /> -<class name="TileDCSSvc" /> </lcgdict> diff --git a/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py b/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py index 884160686ac1affb7a97e7d7f99cd6e394d7f497..9b4be31c564737078f1e12b7f3176f703b759506 100644 --- a/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py +++ b/TileCalorimeter/TileConditions/python/TileInfoConfigurator.py @@ -391,7 +391,7 @@ class _TileInfoConfigurator( TileInfoLoader ): return self._coolDCSIsConfigured = True - ## #=== ensure the availability of TileDCSSvc + ## #=== ensure the availability of TileDCS information from AthenaCommon.GlobalFlags import globalflags from AthenaCommon.AthenaCommonFlags import athenaCommonFlags TileUseDCS = (not athenaCommonFlags.isOnline()) and globalflags.DataSource()=='data' @@ -414,20 +414,6 @@ class _TileInfoConfigurator( TileInfoLoader ): ReadSTATES = useSTATUS, TileDCS = dcs) - from AthenaCommon.AppMgr import ServiceMgr as svcMgr - if TileUseDCS and not hasattr(svcMgr, "TileDCSSvc"): - - self._msg.info("Adding TileDCSSvc to ServiceMgr") - svcMgr += CfgMgr.TileDCSSvc() - - from IOVDbSvc.CondDB import conddb - if (conddb.GetInstance() == 'CONDBR2'): - self._msg.info("setting up TileDCSSvc for RUN2") - svcMgr.TileDCSSvc.Version=2 - else: - self._msg.info("setting up TileDCSSvc for RUN1") - svcMgr.TileDCSSvc.Version=1 - #_______________________________________________________________ def setupCOOLDspThreshold(self, defTag = "", dbConnection = ""): diff --git a/TileCalorimeter/TileConditions/src/TileDCSSvc.cxx b/TileCalorimeter/TileConditions/src/TileDCSSvc.cxx deleted file mode 100644 index 1f9a3b14657f492fb136a01402a40abbf6b5fc02..0000000000000000000000000000000000000000 --- a/TileCalorimeter/TileConditions/src/TileDCSSvc.cxx +++ /dev/null @@ -1,132 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// Tile includes -//#include "TileCalibBlobObjs/TileCalibUtils.h" -#include "TileConditions/TileDCSSvc.h" -//#include "src/TileDCSTool.h" -#include "TileConditions/TileCablingService.h" - -// Athena includes -#include "AthenaKernel/errorcheck.h" - -// Gaudi includes -#include "GaudiKernel/ServiceHandle.h" - - -static const InterfaceID IID_TileDCSSvc("TileDCSSvc", 1, 0); -const InterfaceID& TileDCSSvc::interfaceID() { - return IID_TileDCSSvc; -} - -TileDCSSvc::TileDCSSvc(const std::string& name, ISvcLocator* pSvcLocator) - : AthService(name, pSvcLocator) - , m_cabling(nullptr) - , m_version(2) -{ - - declareProperty("Version", m_version); // 1 - RUN1 conditions DB, 2 - RUN2 conditions - - m_partName.push_back("AUX"); - m_partName.push_back("LBA"); - m_partName.push_back("LBC"); - m_partName.push_back("EBA"); - m_partName.push_back("EBC"); - - m_ncalls = 0; - -} - -//_____________________________________________________________________________ -StatusCode TileDCSSvc::queryInterface(const InterfaceID& riid, void** ppvInterface) { - if (TileDCSSvc::interfaceID().versionMatch(riid)) { - *ppvInterface = dynamic_cast<TileDCSSvc*>(this); - } else { - return AthService::queryInterface(riid, ppvInterface); - } - addRef(); - return StatusCode::SUCCESS; -} - -//_____________________________________________________________________________ -StatusCode TileDCSSvc::initialize() { - - //=== get TileDCSTool - ATH_CHECK( m_dcsTool.retrieve()); - - //=== get TileCablingSvc - ServiceHandle<TileCablingSvc> cablingSvc("TileCablingSvc", name()); - ATH_CHECK( cablingSvc.retrieve()); - - //=== cache pointers to cabling helpers - m_cabling = cablingSvc->cablingService(); - if (!m_cabling) { - ATH_MSG_ERROR( "Pointer to TileCablingService is zero: " << m_cabling); - return StatusCode::FAILURE; - } - - for (int i = 0; i < 2; ++i) { - int ros = i + 2; - int channel = 0; - for (; channel < 48; ++channel) { - int pmt = std::abs(m_cabling->channel2hole(ros, channel)); - m_pmt2channel[i][pmt - 1] = channel; // note - pmt-1 is used as index - } - for (; channel < 68; ++channel) { - m_pmt2channel[i][channel] = channel; - } - } - - - return StatusCode::SUCCESS; -} - -//_____________________________________________________________________________ -StatusCode TileDCSSvc::finalize() { - return StatusCode::SUCCESS; -} - -float TileDCSSvc::getDCSHV(int ros, int module, int pmt) const { - int lb_eb = (ros > 2) ? 1 : 0; - int channel = m_pmt2channel[lb_eb][pmt - 1]; - return m_dcsTool->getChannelHV(ros, module - 1, channel); -} - -float TileDCSSvc::getDCSHVSET(int ros, int module, int pmt) const { - int lb_eb = (ros > 2) ? 1 : 0; - int channel = m_pmt2channel[lb_eb][pmt - 1]; - return m_dcsTool->getChannelHVSet(ros, module - 1, channel); -} - -int TileDCSSvc::getDCSSTATES (int ros, int module) const { - return m_dcsTool->getDrawerStates(ros, module - 1); -} - - -//_____________________________________________________________________________ -TileDCSSvc::TileDCSStatus TileDCSSvc::getDCSHVSTATUS(int ros, int drawer, int channel) const { - return static_cast<TileDCSSvc::TileDCSStatus>(m_dcsTool->getDCSHVStatus(ros, drawer, channel)); -} - -//_____________________________________________________________________________ -TileDCSSvc::TileDCSStatus TileDCSSvc::getDCSSTATUS(int ros, int drawer) const { - return static_cast<TileDCSSvc::TileDCSStatus>(m_dcsTool->getDCSStatus(ros, drawer)); -} - - -TileDCSSvc::TileDCSStatus TileDCSSvc::getDCSSTATUS(int ros, int drawer, int channel) const { - return static_cast<TileDCSSvc::TileDCSStatus>(m_dcsTool->getDCSStatus(ros, drawer, channel)); -} - -bool TileDCSSvc::statusHVIsBad (int ros, int drawer, int channel) const { - return m_dcsTool->isStatusHVBad(ros, drawer, channel); -} - -bool TileDCSSvc::statusIsBad (int ros, int drawer) const { - return m_dcsTool->isStatusBad(ros, drawer); -} - -bool TileDCSSvc::statusIsBad (int ros, int drawer, int channel) const { - return m_dcsTool->isStatusBad(ros, drawer, channel); -} diff --git a/TileCalorimeter/TileConditions/src/components/TileConditions_entries.cxx b/TileCalorimeter/TileConditions/src/components/TileConditions_entries.cxx index d01cd28ba62d6c786bf39787a76c0fcb6eecdabb..befe4ae12555c29e33ea485cfb15c1e51a1c8dbc 100644 --- a/TileCalorimeter/TileConditions/src/components/TileConditions_entries.cxx +++ b/TileCalorimeter/TileConditions/src/components/TileConditions_entries.cxx @@ -19,7 +19,6 @@ #include "TileConditions/TileCondToolNoiseSample.h" #include "TileConditions/TileCondToolNoiseRawChn.h" #include "TileConditions/TileCondProxyWrapper.h" -#include "TileConditions/TileDCSSvc.h" #include "TileConditions/TileCondDCS_Data.h" #include "TileConditions/TileCondToolAutoCr.h" #include "TileConditions/TileCondToolTMDB.h" @@ -32,7 +31,6 @@ DECLARE_COMPONENT( TileInfoLoader ) DECLARE_COMPONENT( TileCablingSvc ) -DECLARE_COMPONENT( TileDCSSvc ) DECLARE_COMPONENT( TileCondIdTransforms ) DECLARE_COMPONENT( TileBadChanTool ) DECLARE_COMPONENT( TileBadChanLegacyTool ) diff --git a/TileCalorimeter/TileMonitoring/TileMonitoring/TileDQFragLWMonTool.h b/TileCalorimeter/TileMonitoring/TileMonitoring/TileDQFragLWMonTool.h index 8bb51de01a19c9071e3dfae7b086507d0f596132..038073f4f1343aec6cb4f58397efebba5e219d3d 100644 --- a/TileCalorimeter/TileMonitoring/TileMonitoring/TileDQFragLWMonTool.h +++ b/TileCalorimeter/TileMonitoring/TileMonitoring/TileDQFragLWMonTool.h @@ -16,12 +16,12 @@ #include "TileMonitoring/TileFatherMonTool.h" #include "TileEvent/TileDQstatus.h" +#include "TileConditions/ITileDCSTool.h" #include "StoreGate/ReadHandleKey.h" #include <array> class ITileBadChanTool; -class TileDCSSvc; class TileDQstatus; class TileRawChannel; class TileRawChannelCollection; @@ -67,7 +67,7 @@ class TileDQFragLWMonTool: public TileFatherMonTool { void fillBadDrawer(void); ToolHandle<ITileBadChanTool> m_tileBadChanTool; //!< Tile Bad Channel tool - ServiceHandle<TileDCSSvc> m_tileDCSSvc; //!< Pointer to TileDCSSvc + ToolHandle<ITileDCSTool> m_tileDCS{this, "TileDCSTool", "TileDCSTool", "Tile DCS tool"}; /*---------------------------------------------------------*/ /* properties*/ @@ -84,7 +84,7 @@ class TileDQFragLWMonTool: public TileFatherMonTool { bool m_skipMasked; bool m_skipGapCells; bool m_doOnline; - bool m_checkDCS; //!< if false, do not use TileDCSSvc at all + bool m_checkDCS; //!< if false, do not use TileDCS at all /* njunior@cern.ch */ const TileDQstatus* m_dqStatus; diff --git a/TileCalorimeter/TileMonitoring/TileMonitoring/TileDQFragMonTool.h b/TileCalorimeter/TileMonitoring/TileMonitoring/TileDQFragMonTool.h index 9b92b57ae14cbade8f25fc3bc540f96334a88754..a826333dffa4718b3c14b2b8d53669083dde888d 100644 --- a/TileCalorimeter/TileMonitoring/TileMonitoring/TileDQFragMonTool.h +++ b/TileCalorimeter/TileMonitoring/TileMonitoring/TileDQFragMonTool.h @@ -16,12 +16,12 @@ #include "TileMonitoring/TileFatherMonTool.h" #include "TileEvent/TileDQstatus.h" +#include "TileConditions/ITileDCSTool.h" #include "StoreGate/ReadHandleKey.h" #include <array> class ITileBadChanTool; -class TileDCSSvc; class TileDQstatus; class TileRawChannel; class TileRawChannelCollection; @@ -72,7 +72,7 @@ class TileDQFragMonTool: public TileFatherMonTool { void fillBadDrawer(void); ToolHandle<ITileBadChanTool> m_tileBadChanTool; //!< Tile Bad Channel tool - ServiceHandle<TileDCSSvc> m_tileDCSSvc; //!< Pointer to TileDCSSvc + ToolHandle<ITileDCSTool> m_tileDCS{this, "TileDCSTool", "TileDCSTool", "Tile DCS tool"}; /*---------------------------------------------------------*/ /* properties*/ @@ -90,7 +90,7 @@ class TileDQFragMonTool: public TileFatherMonTool { bool m_skipGapCells; bool m_doPlots; bool m_doOnline; - bool m_checkDCS; //!< if false, do not use TileDCSSvc at all + bool m_checkDCS; //!< if false, do not use TileDCSTool at all /* njunior@cern.ch */ const TileDQstatus* m_dqStatus; diff --git a/TileCalorimeter/TileMonitoring/TileMonitoring/TileDigiNoiseMonTool.h b/TileCalorimeter/TileMonitoring/TileMonitoring/TileDigiNoiseMonTool.h index e3fe1ff4268376c7831bc9e43c63d713cf9f1be1..731b13ee799b4d3d53c8e64e6bff2ec094137282 100644 --- a/TileCalorimeter/TileMonitoring/TileMonitoring/TileDigiNoiseMonTool.h +++ b/TileCalorimeter/TileMonitoring/TileMonitoring/TileDigiNoiseMonTool.h @@ -75,7 +75,7 @@ class TileDigiNoiseMonTool : public TileFatherMonTool { bool m_fillPedestalDifference; std::vector<uint32_t> m_triggerTypes; SG::ReadHandleKey<TileDQstatus> m_DQstatusKey; - ToolHandle<ITileDCSTool> m_tileDCS; + ToolHandle<ITileDCSTool> m_tileDCS{this, "TileDCSTool", "TileDCSTool", "Tile DCS tool"}; bool m_checkDCS; bool m_histogramsNotBooked; }; diff --git a/TileCalorimeter/TileMonitoring/TileMonitoring/TileRawChannelNoiseMonTool.h b/TileCalorimeter/TileMonitoring/TileMonitoring/TileRawChannelNoiseMonTool.h index ec1803fab2f1c30462ae57ae0e7f6b52f5e48d46..b23cbff23c92e2053e767df4d8980d7ae4ec8939 100644 --- a/TileCalorimeter/TileMonitoring/TileMonitoring/TileRawChannelNoiseMonTool.h +++ b/TileCalorimeter/TileMonitoring/TileMonitoring/TileRawChannelNoiseMonTool.h @@ -19,12 +19,13 @@ // To perform the double gaussian fit use the option: m_do2gfit=true // ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -#ifndef TILERAWCHANNELMONTOOL_H -#define TILERAWCHANNELMONTOOL_H +#ifndef TILEMONITORING_TILERAWCHANNELNOISEMONTOOL_H +#define TILEMONITORING_TILERAWCHANNELNOISEMONTOOL_H #include "TileMonitoring/TileFatherMonTool.h" #include "TileEvent/TileDQstatus.h" #include "TileConditions/ITileDCSTool.h" + #include "StoreGate/ReadHandleKey.h" class ITileBadChanTool; @@ -100,8 +101,8 @@ class TileRawChannelNoiseMonTool: public TileFatherMonTool { int m_nbins; unsigned int m_minimumEventsNumberToFit; SG::ReadHandleKey<TileDQstatus> m_DQstatusKey; - ToolHandle<ITileDCSTool> m_tileDCS; + ToolHandle<ITileDCSTool> m_tileDCS{this, "TileDCSTool", "TileDCSTool", "Tile DCS tool"}; bool m_checkDCS; }; -#endif +#endif // TILEMONITORING_TILERAWCHANNELNOISEMONTOOL_H diff --git a/TileCalorimeter/TileMonitoring/TileMonitoring/TileRawChannelTimeMonTool.h b/TileCalorimeter/TileMonitoring/TileMonitoring/TileRawChannelTimeMonTool.h index f37d570d9c37a13e87d7ec6f29ad8b2fd6c8fe96..e47e02e75b58d725882cb31995bed0d566e8ce14 100644 --- a/TileCalorimeter/TileMonitoring/TileMonitoring/TileRawChannelTimeMonTool.h +++ b/TileCalorimeter/TileMonitoring/TileMonitoring/TileRawChannelTimeMonTool.h @@ -98,7 +98,7 @@ class TileRawChannelTimeMonTool: public TileFatherMonTool { std::vector<std::pair<int, int> > m_timeDifferenceBetweenROS; int m_nLumiblocks; SG::ReadHandleKey<TileDQstatus> m_DQstatusKey; - ToolHandle<ITileDCSTool> m_tileDCS; + ToolHandle<ITileDCSTool> m_tileDCS{this, "TileDCSTool", "TileDCSTool", "Tile DCS tool"}; bool m_checkDCS; }; diff --git a/TileCalorimeter/TileMonitoring/share/TileMon_jobOptions.py b/TileCalorimeter/TileMonitoring/share/TileMon_jobOptions.py index e92bb48ca012c7a18e2c8f4644a885c525fe5e29..d05a9904271eab82d72a7dbdcfc90a29e1e5e49e 100644 --- a/TileCalorimeter/TileMonitoring/share/TileMon_jobOptions.py +++ b/TileCalorimeter/TileMonitoring/share/TileMon_jobOptions.py @@ -11,6 +11,10 @@ from AthenaCommon.BeamFlags import jobproperties from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() +from AthenaCommon.AlgSequence import AthSequencer +condSequence = AthSequencer("AthCondSeq") +tileCheckDCS = hasattr(condSequence, 'TileDCSCondAlg') + from AthenaMonitoring.DQMonFlags import DQMonFlags if not 'rec' in dir(): @@ -204,7 +208,7 @@ if tileRawMon: , TriggerChain = "HLT_noalg_cosmiccalo_L1RD1_EMPTY" , TrigDecisionTool = getattr(ToolSvc, DQMonFlags.nameTrigDecTool()) if DQMonFlags.useTrigger() else "" , TriggerTypes = [ 0x82 ] - , CheckDCS = hasattr(ServiceMgr, "TileDCSSvc")) + , CheckDCS = tileCheckDCS) if globalflags.InputFormat() == 'pool': TileDigiNoiseMon.TileDigitsContainer = 'TileDigitsFlt' @@ -221,7 +225,7 @@ if tileRawMon: , SkipMasked = True , SkipGapCells = True , doOnline = athenaCommonFlags.isOnline() - , CheckDCS = hasattr(ServiceMgr, "TileDCSSvc") + , CheckDCS = tileCheckDCS , histoPathBase = "/Tile/DMUErrors") diff --git a/TileCalorimeter/TileMonitoring/share/TileMon_standalone_jobOptions.py b/TileCalorimeter/TileMonitoring/share/TileMon_standalone_jobOptions.py index daf82eae4d0f7e80feda5eaf7e3899d49ffd504e..ea8339d1d63886abaeaa926a1d667d9c2183650c 100644 --- a/TileCalorimeter/TileMonitoring/share/TileMon_standalone_jobOptions.py +++ b/TileCalorimeter/TileMonitoring/share/TileMon_standalone_jobOptions.py @@ -4,11 +4,13 @@ # #============================================================== - - from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() +from AthenaCommon.AlgSequence import AthSequencer +condSequence = AthSequencer("AthCondSeq") +tileCheckDCS = hasattr(condSequence, 'TileDCSCondAlg') + from AthenaCommon.AppMgr import ServiceMgr as svcMgr from AthenaCommon import CfgMgr @@ -40,7 +42,7 @@ toolSvc += CfgMgr.TileDQFragMonTool(name = 'TileDQFragM , SkipGapCells = True , doOnline = athenaCommonFlags.isOnline() , doPlots = False - , CheckDCS = hasattr(svcMgr, "TileDCSSvc") + , CheckDCS = tileCheckDCS , histoPathBase = "Tile/DMUErrors") ManagedAthenaTileMon.AthenaMonTools += [ toolSvc.TileDQFragMon ] diff --git a/TileCalorimeter/TileMonitoring/src/TileDQFragLWMonTool.cxx b/TileCalorimeter/TileMonitoring/src/TileDQFragLWMonTool.cxx index 2dcafa1660892b875cca94c27ab57a5435e8165e..8ba59e80e914d0caddcda2ac753b0cb426f59e5a 100644 --- a/TileCalorimeter/TileMonitoring/src/TileDQFragLWMonTool.cxx +++ b/TileCalorimeter/TileMonitoring/src/TileDQFragLWMonTool.cxx @@ -16,7 +16,6 @@ #include "TileCalibBlobObjs/TileCalibUtils.h" #include "TileConditions/ITileBadChanTool.h" -#include "TileConditions/TileDCSSvc.h" #include "TileEvent/TileDigitsContainer.h" #include "TileEvent/TileRawChannelContainer.h" #include "TileRecUtils/TileRawChannelBuilder.h" @@ -35,7 +34,6 @@ TileDQFragLWMonTool::TileDQFragLWMonTool(const std::string & type, const std::string & name, const IInterface* parent) : TileFatherMonTool(type, name, parent) , m_tileBadChanTool("TileBadChanTool") - , m_tileDCSSvc("TileDCSSvc",name) , m_dqStatus(0) , m_globalErrCount{} , m_global{} @@ -151,14 +149,16 @@ StatusCode TileDQFragLWMonTool:: initialize() { ATH_MSG_INFO( "in initialize()" ); - CHECK( m_tileBadChanTool.retrieve() ); + ATH_CHECK( m_tileBadChanTool.retrieve() ); - CHECK( TileFatherMonTool::initialize() ); + ATH_CHECK( TileFatherMonTool::initialize() ); - CHECK( m_DQstatusKey.initialize() ); + ATH_CHECK( m_DQstatusKey.initialize() ); if (m_checkDCS) { - CHECK( m_tileDCSSvc.retrieve() ); + ATH_CHECK( m_tileDCS.retrieve() ); + } else { + m_tileDCS.disable(); } return StatusCode::SUCCESS; @@ -460,7 +460,7 @@ void TileDQFragLWMonTool::fillBadDrawer() { if ((pedestal > 80000. || quality > m_qualityCut) && !(m_tileBadChanTool->getAdcStatus(adcId).isBad() - || (m_checkDCS && m_tileDCSSvc->statusIsBad(ROS, drawer, channel)))) { + || (m_checkDCS && m_tileDCS->isStatusBad(ROS, drawer, channel)))) { m_badPulseQuality[partition]->Fill(module, channel); @@ -660,13 +660,13 @@ void TileDQFragLWMonTool::fillErrorsHistograms(unsigned int ros, unsigned int dr unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros + 1, drawer); if (m_checkDCS - && ((m_tileDCSSvc->statusIsBad(ros + 1, drawer, ichn) + && ((m_tileDCS->isStatusBad(ros + 1, drawer, ichn) && !m_tileBadChanTool->getChannelStatus(drawerIdx, ichn).contains(TileBchPrbs::NoHV) && !m_tileBadChanTool->getChannelStatus(drawerIdx, ichn).contains(TileBchPrbs::WrongHV)) - || (m_tileDCSSvc->statusIsBad(ros + 1, drawer, ichn + 1) + || (m_tileDCS->isStatusBad(ros + 1, drawer, ichn + 1) && !m_tileBadChanTool->getChannelStatus(drawerIdx, ichn + 1).contains(TileBchPrbs::NoHV) && !m_tileBadChanTool->getChannelStatus(drawerIdx, ichn + 1).contains(TileBchPrbs::WrongHV)) - || (m_tileDCSSvc->statusIsBad(ros + 1, drawer, ichn + 2) + || (m_tileDCS->isStatusBad(ros + 1, drawer, ichn + 2) && !m_tileBadChanTool->getChannelStatus(drawerIdx, ichn + 2).contains(TileBchPrbs::NoHV) && !m_tileBadChanTool->getChannelStatus(drawerIdx, ichn + 2).contains(TileBchPrbs::WrongHV)))) { @@ -830,8 +830,8 @@ bool TileDQFragLWMonTool::isModuleDCSgood(unsigned int partition, unsigned int d /*---------------------------------------------------------*/ if (m_checkDCS) { - TileDCSSvc::TileDCSStatus Status = m_tileDCSSvc->getDCSSTATUS(partition, drawer); - if (Status > TileDCSSvc::WARNING) { + TileDCSState::TileDCSStatus status = m_tileDCS->getDCSStatus(partition, drawer); + if (status > TileDCSState::WARNING) { return false; } else { return true; diff --git a/TileCalorimeter/TileMonitoring/src/TileDQFragMonTool.cxx b/TileCalorimeter/TileMonitoring/src/TileDQFragMonTool.cxx index 735278be199e3ed6a509c05c6dfa9ab85eddc318..92213e54e9d688c69f42c76561de2e16ab92a180 100644 --- a/TileCalorimeter/TileMonitoring/src/TileDQFragMonTool.cxx +++ b/TileCalorimeter/TileMonitoring/src/TileDQFragMonTool.cxx @@ -16,7 +16,6 @@ #include "TileCalibBlobObjs/TileCalibUtils.h" #include "TileConditions/ITileBadChanTool.h" -#include "TileConditions/TileDCSSvc.h" #include "TileEvent/TileDigitsContainer.h" #include "TileEvent/TileRawChannelContainer.h" #include "TileRecUtils/TileRawChannelBuilder.h" @@ -40,7 +39,6 @@ TileDQFragMonTool::TileDQFragMonTool(const std::string & type, const std::string & name, const IInterface* parent) : TileFatherMonTool(type, name, parent) , m_tileBadChanTool("TileBadChanTool") - , m_tileDCSSvc("TileDCSSvc",name) , m_dqStatus(0) , m_last_lb(0) , m_globalErrCount{} @@ -214,15 +212,18 @@ StatusCode TileDQFragMonTool:: initialize() { ATH_MSG_INFO( "in initialize()" ); - CHECK( m_tileBadChanTool.retrieve() ); + ATH_CHECK( m_tileBadChanTool.retrieve() ); - CHECK( TileFatherMonTool::initialize() ); + ATH_CHECK( TileFatherMonTool::initialize() ); if (m_checkDCS) { - CHECK( m_tileDCSSvc.retrieve() ); + ATH_CHECK( m_tileDCS.retrieve() ); + } else { + m_tileDCS.disable(); } - CHECK( m_DQstatusKey.initialize() ); + + ATH_CHECK( m_DQstatusKey.initialize() ); return StatusCode::SUCCESS; @@ -523,7 +524,7 @@ void TileDQFragMonTool::fillBadDrawer() { int drawer = fragId & 0x3F; // range 0-63 int ROS = fragId >> 8; // range 1-4 bool drbad = true; - if (m_checkDCS) drbad = m_tileDCSSvc->statusIsBad(ROS, drawer); + if (m_checkDCS) drbad = m_tileDCS->isStatusBad(ROS, drawer); if (!drbad) ++nBadDrNM; } @@ -585,7 +586,7 @@ void TileDQFragMonTool::fillBadDrawer() { if ((pedestal > 80000. || quality > m_qualityCut) && !(m_tileBadChanTool->getAdcStatus(adcId).isBad() - || (m_checkDCS && m_tileDCSSvc->statusIsBad(ROS, drawer, channel)))) { + || (m_checkDCS && m_tileDCS->isStatusBad(ROS, drawer, channel)))) { m_badPulseQuality[partition]->Fill(module, channel); @@ -804,13 +805,13 @@ void TileDQFragMonTool::fillErrHist(int ros, int drawer) { unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros + 1, drawer); if (m_checkDCS - && ((m_tileDCSSvc->statusIsBad(ros + 1, drawer, ichn) + && ((m_tileDCS->isStatusBad(ros + 1, drawer, ichn) && !m_tileBadChanTool->getChannelStatus(drawerIdx, ichn).contains(TileBchPrbs::NoHV) && !m_tileBadChanTool->getChannelStatus(drawerIdx, ichn).contains(TileBchPrbs::WrongHV)) - || (m_tileDCSSvc->statusIsBad(ros + 1, drawer, ichn + 1) + || (m_tileDCS->isStatusBad(ros + 1, drawer, ichn + 1) && !m_tileBadChanTool->getChannelStatus(drawerIdx, ichn + 1).contains(TileBchPrbs::NoHV) && !m_tileBadChanTool->getChannelStatus(drawerIdx, ichn + 1).contains(TileBchPrbs::WrongHV)) - || (m_tileDCSSvc->statusIsBad(ros + 1, drawer, ichn + 2) + || (m_tileDCS->isStatusBad(ros + 1, drawer, ichn + 2) && !m_tileBadChanTool->getChannelStatus(drawerIdx, ichn + 2).contains(TileBchPrbs::NoHV) && !m_tileBadChanTool->getChannelStatus(drawerIdx, ichn + 2).contains(TileBchPrbs::WrongHV)))) { @@ -1101,8 +1102,8 @@ bool TileDQFragMonTool::isModuleDCSgood(int partition, int drawer) const { /*---------------------------------------------------------*/ if (m_checkDCS) { - TileDCSSvc::TileDCSStatus Status = m_tileDCSSvc->getDCSSTATUS(partition, drawer); - if (Status > TileDCSSvc::WARNING) { + TileDCSState::TileDCSStatus status = m_tileDCS->getDCSStatus(partition, drawer); + if (status > TileDCSState::WARNING) { return false; } else { return true; diff --git a/TileCalorimeter/TileMonitoring/src/TileDigiNoiseMonTool.cxx b/TileCalorimeter/TileMonitoring/src/TileDigiNoiseMonTool.cxx index 3601d6b9fce3ec33c63e2111e393ea36fa72e823..cc1d8031a20b0a7028f0d94a7628d8549809d8bc 100644 --- a/TileCalorimeter/TileMonitoring/src/TileDigiNoiseMonTool.cxx +++ b/TileCalorimeter/TileMonitoring/src/TileDigiNoiseMonTool.cxx @@ -18,15 +18,16 @@ // // ******************************************************************** -#include "xAODEventInfo/EventInfo.h" - +// Tile includes #include "TileMonitoring/TileDigiNoiseMonTool.h" - #include "TileEvent/TileDigitsContainer.h" #include "TileEvent/TileRawChannelContainer.h" #include "TileCalibBlobObjs/TileCalibUtils.h" #include "TileConditions/TileBadChanTool.h" #include "TileConditions/TileCondToolNoiseSample.h" + +// Athena includes +#include "xAODEventInfo/EventInfo.h" #include "StoreGate/ReadHandle.h" #include <iostream> @@ -42,7 +43,6 @@ TileDigiNoiseMonTool::TileDigiNoiseMonTool(const std::string & type, const std:: , m_tileToolNoiseSample("TileCondToolNoiseSample") , m_DQstatus(0) , m_nEventsProcessed(0) - , m_tileDCS("TileDCSTool") , m_histogramsNotBooked(true) /*---------------------------------------------------------*/ { @@ -58,7 +58,6 @@ TileDigiNoiseMonTool::TileDigiNoiseMonTool(const std::string & type, const std:: declareProperty("FillPedestalDifference", m_fillPedestalDifference = true); declareProperty("TriggerTypes", m_triggerTypes); declareProperty("TileDQstatus", m_DQstatusKey = "TileDQstatus"); - declareProperty("TileDCSTool", m_tileDCS); declareProperty("CheckDCS", m_checkDCS = false); m_path = "/Tile/DigiNoise"; //ROOT File relative directory @@ -77,8 +76,8 @@ StatusCode TileDigiNoiseMonTool:: initialize() { ATH_MSG_INFO( "in initialize()" ); - CHECK(m_tileBadChanTool.retrieve()); - if (m_fillEmtyFromDB || m_fillPedestalDifference) CHECK(m_tileToolNoiseSample.retrieve()); + ATH_CHECK(m_tileBadChanTool.retrieve()); + if (m_fillEmtyFromDB || m_fillPedestalDifference) ATH_CHECK(m_tileToolNoiseSample.retrieve()); memset(m_sumPed1, 0, sizeof(m_sumPed1)); memset(m_sumPed2, 0, sizeof(m_sumPed2)); @@ -98,12 +97,11 @@ StatusCode TileDigiNoiseMonTool:: initialize() { msg(MSG::INFO) << endmsg; } - CHECK( m_DQstatusKey.initialize() ); + ATH_CHECK( m_DQstatusKey.initialize() ); if (m_checkDCS) { - CHECK( m_tileDCS.retrieve() ); - } - else { + ATH_CHECK( m_tileDCS.retrieve() ); + } else { m_tileDCS.disable(); } @@ -217,12 +215,12 @@ StatusCode TileDigiNoiseMonTool::fillHistograms() { if (m_triggerTypes.empty() || std::find( m_triggerTypes.begin(), m_triggerTypes.end(), m_lvl1info) != m_triggerTypes.end()) { - if (m_histogramsNotBooked) CHECK( bookNoiseHistograms() ); + if (m_histogramsNotBooked) ATH_CHECK( bookNoiseHistograms() ); m_DQstatus = SG::makeHandle (m_DQstatusKey).get(); const TileDigitsContainer* digitsContainer; - CHECK( evtStore()->retrieve(digitsContainer, m_digitsContainerName) ); + ATH_CHECK( evtStore()->retrieve(digitsContainer, m_digitsContainerName) ); for (const TileDigitsCollection* digitsCollection : *digitsContainer) { diff --git a/TileCalorimeter/TileMonitoring/src/TileRawChannelNoiseMonTool.cxx b/TileCalorimeter/TileMonitoring/src/TileRawChannelNoiseMonTool.cxx index 0c37fde070f51b81c6dc7be66873e3b224363150..9b38986f2b90650bf467e79edd39a422baea3166 100644 --- a/TileCalorimeter/TileMonitoring/src/TileRawChannelNoiseMonTool.cxx +++ b/TileCalorimeter/TileMonitoring/src/TileRawChannelNoiseMonTool.cxx @@ -18,12 +18,11 @@ // // ******************************************************************** -#include "xAODEventInfo/EventInfo.h" +// Tile includes #include "TileMonitoring/TileRawChannelNoiseMonTool.h" #include "TileMonitoring/PairBuilder.h" - #include "TileCalibBlobObjs/TileCalibUtils.h" #include "TileIdentifier/TileHWID.h" #include "TileIdentifier/TileRawChannelUnit.h" @@ -33,8 +32,12 @@ #include "TileEvent/TileCell.h" #include "TileEvent/TileRawChannelContainer.h" + +// Athena includes +#include "xAODEventInfo/EventInfo.h" #include "StoreGate/ReadHandle.h" + #include "TH1F.h" #include "TH2F.h" #include "TF1.h" @@ -65,7 +68,6 @@ TileRawChannelNoiseMonTool::TileRawChannelNoiseMonTool(const std::string & type, , m_gain(1) , m_nEventsProcessed(0) , m_minimumEventsNumberToFit(100) - , m_tileDCS("TileDCSTool") /*---------------------------------------------------------*/ { declareInterface<IMonitorToolBase>(this); @@ -87,7 +89,6 @@ TileRawChannelNoiseMonTool::TileRawChannelNoiseMonTool(const std::string & type, declareProperty("TriggerTypes", m_triggerTypes); declareProperty("MinimumEventsNumberToFit", m_minimumEventsNumberToFit); declareProperty("TileDQstatus", m_DQstatusKey = "TileDQstatus"); - declareProperty("TileDCSTool", m_tileDCS); declareProperty("CheckDCS", m_checkDCS = false); m_path = "/Tile/RawChannelNoise"; @@ -106,7 +107,7 @@ StatusCode TileRawChannelNoiseMonTool::initialize() { ATH_MSG_INFO("in initialize() - m_path = " << m_path); //=== get TileBadChanTool - CHECK(m_tileBadChanTool.retrieve()); + ATH_CHECK(m_tileBadChanTool.retrieve()); if (m_gainName == "HG"){ m_gain = 1; @@ -129,12 +130,11 @@ StatusCode TileRawChannelNoiseMonTool::initialize() { msg(MSG::INFO) << endmsg; } - CHECK( m_DQstatusKey.initialize() ); + ATH_CHECK( m_DQstatusKey.initialize() ); if (m_checkDCS) { - CHECK( m_tileDCS.retrieve() ); - } - else { + ATH_CHECK( m_tileDCS.retrieve() ); + } else { m_tileDCS.disable(); } @@ -502,7 +502,7 @@ StatusCode TileRawChannelNoiseMonTool::fillHistoPerRawChannel() { m_DQstatus = SG::makeHandle (m_DQstatusKey).get(); const TileRawChannelContainer* rawChannelContainer; - CHECK(evtStore()->retrieve(rawChannelContainer, m_rawChannelContainerName)); + ATH_CHECK(evtStore()->retrieve(rawChannelContainer, m_rawChannelContainerName)); // What is the unit used to store info in the RawChannelContainer ? TileRawChannelUnit::UNIT RChUnit = rawChannelContainer->get_unit(); @@ -515,7 +515,7 @@ StatusCode TileRawChannelNoiseMonTool::fillHistoPerRawChannel() { std::string module_name; const TileRawChannelContainer* rawChannelContainerDSP(nullptr); - CHECK(evtStore()->retrieve(rawChannelContainerDSP, m_rawChannelContainerDspName)); + ATH_CHECK(evtStore()->retrieve(rawChannelContainerDSP, m_rawChannelContainerDspName)); // Loop over the containers @@ -620,7 +620,7 @@ StatusCode TileRawChannelNoiseMonTool::fillHistograms() { if (m_triggerTypes.empty() || std::find( m_triggerTypes.begin(), m_triggerTypes.end(), m_lvl1info) != m_triggerTypes.end()) { - CHECK(fillHistoPerRawChannel()); + ATH_CHECK(fillHistoPerRawChannel()); } if ((m_summaryUpdateFrequency > 0) diff --git a/TileCalorimeter/TileMonitoring/src/TileRawChannelTimeMonTool.cxx b/TileCalorimeter/TileMonitoring/src/TileRawChannelTimeMonTool.cxx index b8f1d1878ac64c58f4fb42ec812593178ba02675..e2c0d12cff42d1b5f805a0e2282626b756d7fedd 100644 --- a/TileCalorimeter/TileMonitoring/src/TileRawChannelTimeMonTool.cxx +++ b/TileCalorimeter/TileMonitoring/src/TileRawChannelTimeMonTool.cxx @@ -12,11 +12,14 @@ // // ******************************************************************** +// Tile includes #include "TileMonitoring/TileRawChannelTimeMonTool.h" #include "TileCalibBlobObjs/TileCalibUtils.h" #include "TileConditions/ITileBadChanTool.h" #include "TileEvent/TileRawChannelContainer.h" + +// Athena includes #include "StoreGate/ReadHandle.h" #include "TProfile.h" @@ -51,7 +54,6 @@ TileRawChannelTimeMonTool::TileRawChannelTimeMonTool(const std::string & type, c , m_partitionTimeCorrection{{0}} , m_timeDifferenceBetweenROS{{1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}} , m_nLumiblocks(3000) - , m_tileDCS("TileDCSTool") /*---------------------------------------------------------*/ { declareInterface<IMonitorToolBase>(this); @@ -70,7 +72,6 @@ TileRawChannelTimeMonTool::TileRawChannelTimeMonTool(const std::string & type, c declareProperty("TimeCorrectionEBC", m_timeCorrectionEBC); declareProperty("NumberOfLumiblocks", m_nLumiblocks = 3000); declareProperty("TileDQstatus", m_DQstatusKey = "TileDQstatus"); - declareProperty("TileDCSTool", m_tileDCS); declareProperty("CheckDCS", m_checkDCS = false); m_path = "/Tile/RawChannelTime"; @@ -89,7 +90,7 @@ StatusCode TileRawChannelTimeMonTool::initialize() ATH_MSG_INFO("in initialize()"); - CHECK(m_tileBadChanTool.retrieve()); + ATH_CHECK(m_tileBadChanTool.retrieve()); m_nEvents = 0; m_thresholds[0] = m_lowGainThreshold; @@ -101,14 +102,13 @@ StatusCode TileRawChannelTimeMonTool::initialize() m_timeCorrectionEBA, m_timeCorrectionEBC}}; - CHECK(TileFatherMonTool::initialize()); + ATH_CHECK(TileFatherMonTool::initialize()); - CHECK( m_DQstatusKey.initialize() ); + ATH_CHECK( m_DQstatusKey.initialize() ); if (m_checkDCS) { - CHECK( m_tileDCS.retrieve() ); - } - else { + ATH_CHECK( m_tileDCS.retrieve() ); + } else { m_tileDCS.disable(); } @@ -246,7 +246,7 @@ StatusCode TileRawChannelTimeMonTool::fillHists() int32_t current_lumiblock = getLumiBlock(); const TileRawChannelContainer* RawChannelCnt; - CHECK(evtStore()->retrieve(RawChannelCnt, m_contName)); + ATH_CHECK(evtStore()->retrieve(RawChannelCnt, m_contName)); std::vector<double> avgTimePerPart(TileCalibUtils::MAX_ROS, 0.0); std::vector<double> sumTimeCh(TileCalibUtils::MAX_ROS, 0.0); diff --git a/TileCalorimeter/TileRec/TileRec/TileAANtuple.h b/TileCalorimeter/TileRec/TileRec/TileAANtuple.h index e7e9b1e636763a1282e80418934d46847cc0daa0..69e6722f896f0e1f5cf2e736b2edf362c0189779 100755 --- a/TileCalorimeter/TileRec/TileRec/TileAANtuple.h +++ b/TileCalorimeter/TileRec/TileRec/TileAANtuple.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 */ //**************************************************************************** @@ -39,21 +39,22 @@ /// /// //**************************************************************************** -#ifndef TileAANtuple_H -#define TileAANtuple_H +#ifndef TILEREC_TILEAANTUPLE_H +#define TILEREC_TILEAANTUPLE_H -// Gauid includes -#include "GaudiKernel/ToolHandle.h" -#include "GaudiKernel/ServiceHandle.h" +// Tile includes +#include "TileConditions/TileCablingService.h" +#include "TileIdentifier/TileRawChannelUnit.h" +#include "TileEvent/TileLaserObject.h" +#include "TileConditions/ITileDCSTool.h" // Athena includes #include "AthenaKernel/IOVSvcDefs.h" #include "AthenaBaseComps/AthAlgorithm.h" -// Tile includes -#include "TileConditions/TileCablingService.h" -#include "TileIdentifier/TileRawChannelUnit.h" -#include "TileEvent/TileLaserObject.h" +// Gauid includes +#include "GaudiKernel/ToolHandle.h" +#include "GaudiKernel/ServiceHandle.h" #include <string> #include <stdint.h> @@ -82,7 +83,6 @@ class TileBeamInfoProvider; class TileBeamElemContByteStreamCnv; class ITileBadChanTool; class TileCondToolEmscale; -class TileDCSSvc; class TileL2Builder; class ITHistSvc; @@ -348,7 +348,7 @@ class TileAANtuple : public AthAlgorithm { int m_finalUnit; //!< calibrate everything to this level bool m_calibMode; //!< If data should be put in calib mode bool m_compareMode; //!< If two sets of data should be compared (e.g. frag4 and frag5) - bool m_checkDCS; //!< if false, do not use TileDCSSvc at all + bool m_checkDCS; //!< if false, do not use TileDCS at all int m_DCSBranches; //!< mask like 110101 - which DCS branches to fill // energy units @@ -363,7 +363,6 @@ class TileAANtuple : public AthAlgorithm { // The ntuple TTree* m_ntuplePtr; TTree* m_DCSntuplePtr; - int m_DCScounter; // handle to THistSvc ServiceHandle<ITHistSvc> m_thistSvc; @@ -384,7 +383,7 @@ class TileAANtuple : public AthAlgorithm { TileBeamElemContByteStreamCnv* m_beamCnv; - ServiceHandle<TileDCSSvc> m_tileDCSSvc; //!< Pointer to TileDCSSvc + ToolHandle<ITileDCSTool> m_tileDCS{this, "TileDCSTool", "TileDCSTool", "Tile DCS tool"}; // variables to check SumEt in frag5 ToolHandle<TileL2Builder> m_l2Builder; //<! Pointer to TileL2Builder @@ -402,4 +401,4 @@ class TileAANtuple : public AthAlgorithm { int m_skipEvents; }; -#endif +#endif // TILEREC_TILEAANTUPLE_H diff --git a/TileCalorimeter/TileRec/src/TileAANtuple.cxx b/TileCalorimeter/TileRec/src/TileAANtuple.cxx index 069b40c5057d7f86b280688eb1b87f94d4cfa6ca..0fcc904c00e78a8001e3536f2bd8d3508d9d3403 100755 --- a/TileCalorimeter/TileRec/src/TileAANtuple.cxx +++ b/TileCalorimeter/TileRec/src/TileAANtuple.cxx @@ -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 */ ///***************************************************************************** @@ -17,26 +17,12 @@ // //***************************************************************************** -// Gaudi includes -#include "GaudiKernel/ITHistSvc.h" - -//Atlas include -#include "AthenaKernel/errorcheck.h" -#include "xAODEventInfo/EventInfo.h" - -// Calo includes -#include "CaloDetDescr/CaloDetDescrElement.h" -#include "CaloDetDescr/MbtsDetDescrManager.h" -#include "Identifier/IdentifierHash.h" -#include "CaloIdentifier/TileID.h" - //Tile includes #include "TileRec/TileAANtuple.h" #include "TileIdentifier/TileHWID.h" #include "TileCalibBlobObjs/TileCalibUtils.h" #include "TileConditions/TileCablingService.h" #include "TileConditions/ITileBadChanTool.h" -#include "TileConditions/TileDCSSvc.h" #include "TileDetDescr/TileDetDescrManager.h" #include "TileConditions/TileCondToolEmscale.h" #include "TileEvent/TileDigitsContainer.h" @@ -49,6 +35,19 @@ #include "TileByteStream/TileBeamElemContByteStreamCnv.h" #include "TileL2Algs/TileL2Builder.h" +// Calo includes +#include "CaloDetDescr/CaloDetDescrElement.h" +#include "CaloDetDescr/MbtsDetDescrManager.h" +#include "Identifier/IdentifierHash.h" +#include "CaloIdentifier/TileID.h" + +//Atlas include +#include "AthenaKernel/errorcheck.h" +#include "xAODEventInfo/EventInfo.h" + +// Gaudi includes +#include "GaudiKernel/ITHistSvc.h" + #include "TTree.h" #include <iomanip> #include "boost/date_time/local_time/local_time.hpp" @@ -191,7 +190,6 @@ TileAANtuple::TileAANtuple(std::string name, ISvcLocator* pSvcLocator) , m_tileToolEmscale("TileCondToolEmscale") , m_beamInfo("TileBeamInfoProvider/TileBeamInfoProvider") , m_beamCnv(0) -, m_tileDCSSvc("TileDCSSvc",name) , m_l2Builder() , m_sumEt_xx() , m_sumEz_xx() @@ -205,7 +203,6 @@ TileAANtuple::TileAANtuple(std::string name, ISvcLocator* pSvcLocator) , m_bad() { declareProperty("TileCondToolEmscale", m_tileToolEmscale); - declareProperty("TileDCSSvc", m_tileDCSSvc); declareProperty("TileDigitsContainer", m_digitsContainer = "TileDigitsCnt"); declareProperty("TileDigitsContainerFlt", m_fltDigitsContainer = "" /* "TileDigitsFlt" */); declareProperty("TileBeamElemContainer", m_beamElemContainer = "TileBeamElemCnt"); @@ -239,7 +236,6 @@ TileAANtuple::TileAANtuple(std::string name, ISvcLocator* pSvcLocator) declareProperty("SkipEvents", m_skipEvents = 0); m_evtNr = -1; - m_DCScounter = 0; // LASERII memset(m_chan, 0, sizeof(m_chan)); @@ -283,42 +279,44 @@ StatusCode TileAANtuple::initialize() { m_cabling = TileCablingService::getInstance(); // retrieve TileDetDescr Manager det store - CHECK( detStore()->retrieve(m_tileMgr) ); + ATH_CHECK( detStore()->retrieve(m_tileMgr) ); // retrieve TileID helper from det store - CHECK( detStore()->retrieve(m_tileID) ); - CHECK( detStore()->retrieve(m_tileHWID) ); + ATH_CHECK( detStore()->retrieve(m_tileID) ); + ATH_CHECK( detStore()->retrieve(m_tileHWID) ); - //=== get TileDCSSvc + //=== get TileDCSTool if (m_checkDCS) { - CHECK( m_tileDCSSvc.retrieve() ); + ATH_CHECK( m_tileDCS.retrieve() ); + } else { + m_tileDCS.disable(); } //=== get TileBadChanTool - CHECK( m_tileBadChanTool.retrieve() ); + ATH_CHECK( m_tileBadChanTool.retrieve() ); //=== get TileCondToolEmscale - CHECK( m_tileToolEmscale.retrieve() ); + ATH_CHECK( m_tileToolEmscale.retrieve() ); //=== get TileBeamInfo - CHECK( m_beamInfo.retrieve() ); + ATH_CHECK( m_beamInfo.retrieve() ); //=== get TileL2Builder if (m_compareMode) { - CHECK( m_l2Builder.retrieve() ); + ATH_CHECK( m_l2Builder.retrieve() ); } //=== change properties of TileBeamInfo - to make sure that all parameters are consistent if (m_beamElemContainer.size() > 0) { - CHECK( m_beamInfo->setProperty("TileBeamElemContainer",m_beamElemContainer) ); + ATH_CHECK( m_beamInfo->setProperty("TileBeamElemContainer",m_beamElemContainer) ); } if (m_digitsContainer.size() > 0) { - CHECK( m_beamInfo->setProperty("TileDigitsContainer",m_digitsContainer) ); + ATH_CHECK( m_beamInfo->setProperty("TileDigitsContainer",m_digitsContainer) ); } if (m_dspRawChannelContainer.size() > 0) { - CHECK( m_beamInfo->setProperty("TileRawChannelContainer",m_dspRawChannelContainer) ); + ATH_CHECK( m_beamInfo->setProperty("TileRawChannelContainer",m_dspRawChannelContainer) ); } ATH_MSG_INFO( "initialization completed" ) ; @@ -379,7 +377,7 @@ StatusCode TileAANtuple::ntuple_initialize() { // set event number to 0 before first event m_evtNr = 0; - CHECK( m_thistSvc.retrieve() ); + ATH_CHECK( m_thistSvc.retrieve() ); if(initNTuple().isFailure()) { ATH_MSG_ERROR( " Error during ntuple initialization" ); @@ -546,7 +544,7 @@ StatusCode TileAANtuple::storeLaser() { ATH_MSG_DEBUG("TileAANtuple::storeLaser()"); const TileLaserObject* laserObj; - CHECK( evtStore()->retrieve(laserObj, m_laserObject) ); + ATH_CHECK( evtStore()->retrieve(laserObj, m_laserObject) ); m_las_BCID = laserObj->getBCID(); @@ -721,7 +719,7 @@ TileAANtuple::storeRawChannels(std::string containerId // get named container const TileRawChannelContainer* rcCnt; - CHECK( evtStore()->retrieve(rcCnt, containerId) ); + ATH_CHECK( evtStore()->retrieve(rcCnt, containerId) ); ATH_MSG_VERBOSE( "Conteiner ID " << containerId ); TileRawChannelUnit::UNIT rChUnit = rcCnt->get_unit(); @@ -890,7 +888,7 @@ TileAANtuple::storeRawChannels(std::string containerId if (m_compareMode && dspCont) { const TileL2Container* l2Cnt; - CHECK( evtStore()->retrieve(l2Cnt, "TileL2Cnt") ); + ATH_CHECK( evtStore()->retrieve(l2Cnt, "TileL2Cnt") ); TileL2Container::const_iterator it = l2Cnt->begin(); TileL2Container::const_iterator end= l2Cnt->end(); @@ -923,7 +921,7 @@ TileAANtuple::storeMFRawChannels(std::string containerId // get named container const TileRawChannelContainer* rcCnt; - CHECK( evtStore()->retrieve(rcCnt, containerId) ); + ATH_CHECK( evtStore()->retrieve(rcCnt, containerId) ); TileRawChannelUnit::UNIT rChUnit = rcCnt->get_unit(); ATH_MSG_VERBOSE( "RawChannel unit is " << rChUnit ); @@ -1094,7 +1092,7 @@ TileAANtuple::storeMFRawChannels(std::string containerId if (m_compareMode && dspCont) { const TileL2Container* l2Cnt; - CHECK( evtStore()->retrieve(l2Cnt, "TileL2Cnt") ); + ATH_CHECK( evtStore()->retrieve(l2Cnt, "TileL2Cnt") ); TileL2Container::const_iterator it = l2Cnt->begin(); TileL2Container::const_iterator end= l2Cnt->end(); @@ -1125,7 +1123,7 @@ TileAANtuple::storeDigits(std::string containerId // Read Digits from TES const TileDigitsContainer* digitsCnt; - CHECK( evtStore()->retrieve(digitsCnt, containerId) ); + ATH_CHECK( evtStore()->retrieve(digitsCnt, containerId) ); bool emptyColl = true; @@ -1304,7 +1302,7 @@ StatusCode TileAANtuple::storeTMDBDecision() { ATH_MSG_VERBOSE( "reading TMDB decision from " << m_tileMuRcvContainer ); const TileMuonReceiverContainer *decisionCnt; - CHECK( evtStore()->retrieve(decisionCnt, m_tileMuRcvContainer) ); + ATH_CHECK( evtStore()->retrieve(decisionCnt, m_tileMuRcvContainer) ); TileMuonReceiverContainer::const_iterator it = decisionCnt->begin(); TileMuonReceiverContainer::const_iterator itLast = decisionCnt->end(); @@ -1360,7 +1358,7 @@ StatusCode TileAANtuple::storeTMDBDigits() { ATH_MSG_VERBOSE( "reading TMDB digits from " << m_tileMuRcvDigitsContainer ); const TileDigitsContainer* digitsCnt; - CHECK( evtStore()->retrieve(digitsCnt, m_tileMuRcvDigitsContainer) ); + ATH_CHECK( evtStore()->retrieve(digitsCnt, m_tileMuRcvDigitsContainer) ); TileDigitsContainer::const_iterator itColl1 = (*digitsCnt).begin(); TileDigitsContainer::const_iterator itCollEnd1 = (*digitsCnt).end(); @@ -1432,7 +1430,7 @@ StatusCode TileAANtuple::storeTMDBRawChannel() { ATH_MSG_VERBOSE( "reading TMDB energies from " << m_tileMuRcvRawChannelContainer ); const TileRawChannelContainer* rcCnt; - CHECK( evtStore()->retrieve(rcCnt, m_tileMuRcvRawChannelContainer) ); + ATH_CHECK( evtStore()->retrieve(rcCnt, m_tileMuRcvRawChannelContainer) ); TileRawChannelContainer::const_iterator itColl2 = (*rcCnt).begin(); TileRawChannelContainer::const_iterator itCollEnd2 = (*rcCnt).end(); @@ -1520,7 +1518,7 @@ TileAANtuple::initNTuple(void) { CISPAR_addBranch(); if (m_laserObject.size() > 0) { const TileLaserObject* laserObj; - CHECK( evtStore()->retrieve(laserObj, m_laserObject) ); + ATH_CHECK( evtStore()->retrieve(laserObj, m_laserObject) ); m_las_version = laserObj->getVersion(); LASER_addBranch(); } @@ -2425,102 +2423,94 @@ void TileAANtuple::DCS_addBranch() { } } -StatusCode TileAANtuple::storeDCS() -{ - if (m_DCScounter != m_tileDCSSvc->getNcalls()) { - - ATH_MSG_DEBUG( "Filling DCS ntuple: cnt=" << m_DCScounter - <<" evtCnt=" << m_evtNr - << " evt=" << m_evt - << " lumi=" << m_lumiBlock << " " << m_dateTime ); - - m_DCScounter = m_tileDCSSvc->getNcalls(); - - CLEAR(m_TEMP); - CLEAR(m_HV); - CLEAR(m_HVSET); - CLEAR(m_DRSTATES); - CLEAR(m_HVSTATUS); - CLEAR(m_DRSTATUS); - CLEAR(m_CHSTATUS); - - m_nBadDr = 0; - m_nBadHV = 0; - m_nBadDCS = 0; - m_nBadDB = 0; - m_nBadTotal = 0; - for (int ROS = 1; ROS < 5; ++ROS) { - int rosI = ROS - 1; +StatusCode TileAANtuple::storeDCS() { + + ATH_MSG_DEBUG( "Filling DCS ntuple:" + <<" evtCnt=" << m_evtNr + << " evt=" << m_evt + << " lumi=" << m_lumiBlock << " " << m_dateTime ); + + CLEAR(m_TEMP); + CLEAR(m_HV); + CLEAR(m_HVSET); + CLEAR(m_DRSTATES); + CLEAR(m_HVSTATUS); + CLEAR(m_DRSTATUS); + CLEAR(m_CHSTATUS); + + m_nBadDr = 0; + m_nBadHV = 0; + m_nBadDCS = 0; + m_nBadDB = 0; + m_nBadTotal = 0; + for (int ROS = 1; ROS < 5; ++ROS) { + int rosI = ROS - 1; - for (int drawer = 0; drawer < 64; ++drawer) { - int module = drawer + 1; - m_DRSTATES[rosI][drawer] = m_tileDCSSvc->getDCSSTATES(ROS, module); - m_DRSTATUS[rosI][drawer] = m_tileDCSSvc->getDCSSTATUS(ROS, drawer); - bool drbad = m_tileDCSSvc->statusIsBad(ROS, drawer); + for (int drawer = 0; drawer < 64; ++drawer) { + m_DRSTATES[rosI][drawer] = m_tileDCS->getDrawerStates(ROS, drawer); + m_DRSTATUS[rosI][drawer] = m_tileDCS->getDCSStatus(ROS, drawer); + bool drbad = m_tileDCS->isStatusBad(ROS, drawer); - if (drbad) { - ++m_nBadDr; - } + if (drbad) { + ++m_nBadDr; + } - if (msgLvl(MSG::VERBOSE) || m_DRSTATUS[rosI][drawer] != TileDCSSvc::OK_DRAWER) { - ATH_MSG_VERBOSE( "Module=" << m_tileDCSSvc->partitionName(ROS) - << std::setw(2) << std::setfill('0') << module - << " DRSTATES=" << m_DRSTATES[rosI][drawer] - << " DRSTATUS=" << m_DRSTATUS[rosI][drawer] - << " => " << ((drbad) ? "bad" : "good") ); - } + if (msgLvl(MSG::VERBOSE) || m_DRSTATUS[rosI][drawer] != TileDCSState::OK_DRAWER) { + ATH_MSG_VERBOSE( "Module=" << TileCalibUtils::getDrawerString(ROS, drawer) + << " DRSTATES=" << m_DRSTATES[rosI][drawer] + << " DRSTATUS=" << m_DRSTATUS[rosI][drawer] + << " => " << ((drbad) ? "bad" : "good") ); + } - unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ROS,drawer); - for (int channel=0; channel<48; ++channel){ - TileBchStatus chStat = m_tileBadChanTool->getChannelStatus(drawerIdx,channel); - int pmt=abs(m_cabling->channel2hole(ROS,channel)); - m_HV[rosI][drawer][channel] = m_tileDCSSvc->getDCSHV(ROS, module, pmt); - m_HVSET[rosI][drawer][channel] = m_tileDCSSvc->getDCSHVSET(ROS, module, pmt); - m_HVSTATUS[rosI][drawer][channel] = m_tileDCSSvc->getDCSHVSTATUS(ROS, drawer, channel); - m_CHSTATUS[rosI][drawer][channel] = m_tileDCSSvc->getDCSSTATUS(ROS, drawer, channel) + unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ROS,drawer); + for (int channel=0; channel<48; ++channel){ + TileBchStatus chStat = m_tileBadChanTool->getChannelStatus(drawerIdx,channel); + int pmt=abs(m_cabling->channel2hole(ROS,channel)); + m_HV[rosI][drawer][channel] = m_tileDCS->getChannelHV(ROS, drawer, channel); + m_HVSET[rosI][drawer][channel] = m_tileDCS->getChannelHVSet(ROS, drawer, channel); + m_HVSTATUS[rosI][drawer][channel] = m_tileDCS->getDCSHVStatus(ROS, drawer, channel); + m_CHSTATUS[rosI][drawer][channel] = m_tileDCS->getDCSStatus(ROS, drawer, channel) + 100 * m_tileBadChanTool->encodeStatus(chStat); - bool chbad=m_tileDCSSvc->statusIsBad(ROS,drawer,channel); + bool chbad = m_tileDCS->isStatusBad(ROS, drawer, channel); - if (chbad || chStat.isBad()) { - ++m_nBadTotal; - if (chbad) ++m_nBadDCS; - if (chStat.isBad()) ++m_nBadDB; - } + if (chbad || chStat.isBad()) { + ++m_nBadTotal; + if (chbad) ++m_nBadDCS; + if (chStat.isBad()) ++m_nBadDB; + } - if (m_tileDCSSvc->statusHVIsBad(ROS,drawer,channel)) { - ++m_nBadHV; - } + if (m_tileDCS->isStatusHVBad(ROS, drawer, channel)) { + ++m_nBadHV; + } - if (msgLvl(MSG::VERBOSE) || (chbad && !drbad)) { - ATH_MSG_VERBOSE( "Module=" << m_tileDCSSvc->partitionName(ROS) - << std::setw(2) << std::setfill('0') << module - << " channel=" << channel << " pmt=" << pmt - << " HV=" << m_HV[rosI][drawer][channel] - << " HVSET=" << m_HVSET[rosI][drawer][channel] - << " HVSTATUS=" << m_HVSTATUS[rosI][drawer][channel] - << " CHSTATUS=" << m_CHSTATUS[rosI][drawer][channel] - << " => " << ((chbad) ? "bad" : "good") ); - } + if (msgLvl(MSG::VERBOSE) || (chbad && !drbad)) { + ATH_MSG_VERBOSE( "Module=" << TileCalibUtils::getDrawerString(ROS, drawer) + << " channel=" << channel << " pmt=" << pmt + << " HV=" << m_HV[rosI][drawer][channel] + << " HVSET=" << m_HVSET[rosI][drawer][channel] + << " HVSTATUS=" << m_HVSTATUS[rosI][drawer][channel] + << " CHSTATUS=" << m_CHSTATUS[rosI][drawer][channel] + << " => " << ((chbad) ? "bad" : "good") ); } + } - for (int ind=0; ind<7; ++ind){ - m_TEMP[rosI][drawer][ind] = m_tileDCSSvc->getDCSHV(ROS, module, ind+49); - ATH_MSG_VERBOSE( "Module=" << m_tileDCSSvc->partitionName(ROS) - << std::setw(2) << std::setfill('0') << module - << " TEMP" << ind+1 << "=" << m_TEMP[rosI][drawer][ind] ); + for (int ind=0; ind<7; ++ind){ + m_TEMP[rosI][drawer][ind] = m_tileDCS->getChannelHV(ROS, drawer, ind+49); + ATH_MSG_VERBOSE( "Module=" << TileCalibUtils::getDrawerString(ROS, drawer) + << " TEMP" << ind+1 << "=" << m_TEMP[rosI][drawer][ind] ); - } } } + } - ATH_MSG_DEBUG( "BAD status in DCS: nBadDr=" << m_nBadDr - << " nBadHV=" << m_nBadHV - << " nBadDCS=" << m_nBadDCS - << " nBadDB=" << m_nBadDB - << " nBadTotal=" << m_nBadTotal ); + ATH_MSG_DEBUG( "BAD status in DCS: nBadDr=" << m_nBadDr + << " nBadHV=" << m_nBadHV + << " nBadDCS=" << m_nBadDCS + << " nBadDB=" << m_nBadDB + << " nBadTotal=" << m_nBadTotal ); - m_DCSntuplePtr->Fill(); - } + m_DCSntuplePtr->Fill(); + return StatusCode::SUCCESS; } diff --git a/TileCalorimeter/TileRecAlgs/src/TileCellSelector.cxx b/TileCalorimeter/TileRecAlgs/src/TileCellSelector.cxx index b72e98da9b4f59e6ff47507c1c55080ad289d816..aeb8e3781025145b5648a38ee67feaa22576c0c9 100644 --- a/TileCalorimeter/TileRecAlgs/src/TileCellSelector.cxx +++ b/TileCalorimeter/TileRecAlgs/src/TileCellSelector.cxx @@ -11,7 +11,6 @@ #include "TileCalibBlobObjs/TileCalibUtils.h" #include "TileConditions/TileCablingService.h" #include "TileConditions/ITileBadChanTool.h" -#include "TileConditions/TileDCSSvc.h" // Calo includes #include "CaloIdentifier/TileID.h" @@ -53,7 +52,6 @@ TileCellSelector::TileCellSelector(const std::string& name, ISvcLocator* pSvcLoc , m_tileHWID(0) , m_cabling(0) , m_tileBadChanTool("TileBadChanTool") - , m_tileDCSSvc("TileDCSSvc",name) , m_runNum(0) , m_lumiBlock(0) , m_evtNum(0) @@ -142,15 +140,17 @@ StatusCode TileCellSelector::initialize() { ATH_CHECK( m_eventInfoKey.initialize() ); - CHECK(detStore()->retrieve(m_tileID, "TileID")); - CHECK(detStore()->retrieve(m_tileHWID, "TileHWID")); + ATH_CHECK(detStore()->retrieve(m_tileID, "TileID")); + ATH_CHECK(detStore()->retrieve(m_tileHWID, "TileHWID")); m_cabling = TileCablingService::getInstance(); - CHECK(m_tileBadChanTool.retrieve()); + ATH_CHECK(m_tileBadChanTool.retrieve()); if (m_checkDCS) { - CHECK(m_tileDCSSvc.retrieve()); + ATH_CHECK(m_tileDCS.retrieve()); + } else { + m_tileDCS.disable(); } ATH_MSG_INFO( "Cell container " @@ -320,7 +320,7 @@ StatusCode TileCellSelector::initialize() { m_drawerToSkip.resize(1+TileCalibUtils::getDrawerIdx(4,63),false); } - CHECK( m_dqStatusKey.initialize() ); + ATH_CHECK( m_dqStatusKey.initialize() ); return StatusCode::SUCCESS; } @@ -449,7 +449,7 @@ StatusCode TileCellSelector::execute() { int drmax = 65; for (int dr = 0; dr < drmax; ++dr) { int drawer = dr % 64; - if (m_tileDCSSvc->getDCSSTATUS(ros, drawer) == TileDCSSvc::ALERT_DRAWER) { + if (m_tileDCS->getDCSStatus(ros, drawer) == TileDCSState::ALERT_DRAWER) { if (m1 < 0) m1 = dr; m2 = dr; if (dr < 64) allmod.push_back((ros << 8) + dr); @@ -1194,7 +1194,7 @@ StatusCode TileCellSelector::execute() { int adc = m_tileHWID->adc(adcId); m_chanBad[hash] = m_tileBadChanTool->getAdcStatus(drawerIdx,channel,adc).isBad() || (DQstatus && !DQstatus->isAdcDQgood(ros,drawer,channel,adc)) || - (m_checkDCS && m_tileDCSSvc->getDCSSTATUS(ros,drawer,channel) > TileDCSSvc::WARNING); + (m_checkDCS && m_tileDCS->getDCSStatus(ros, drawer, channel) > TileDCSState::WARNING); } if (allowAmpCheck) { @@ -1426,7 +1426,7 @@ StatusCode TileCellSelector::execute() { ++nChBad; ++nChBadDmu[dmu]; } - } else if (m_checkDCS && m_tileDCSSvc->getDCSSTATUS(ros,drawer,channel) > TileDCSSvc::WARNING) { + } else if (m_checkDCS && m_tileDCS->getDCSStatus(ros, drawer, channel) > TileDCSState::WARNING) { badname = " BADDCS"; } else if (m_tileBadChanTool->getAdcStatus(drawerIdx,channel,adc).isBad()) { badname = " BADDB"; @@ -1788,7 +1788,7 @@ StatusCode TileCellSelector::execute() { badname = " BADDB"; } else if (DQstatus && !DQstatus->isAdcDQgood(ros, drawer, channel, adc)) { badname = " BADDQ"; - } else if (m_checkDCS && m_tileDCSSvc->getDCSSTATUS(ros, drawer, channel) > TileDCSSvc::WARNING) { + } else if (m_checkDCS && m_tileDCS->getDCSStatus(ros, drawer, channel) > TileDCSState::WARNING) { badname = " BADDCS"; } else if (m_chanBad[hash]) { if (badFromCell) { diff --git a/TileCalorimeter/TileRecAlgs/src/TileCellSelector.h b/TileCalorimeter/TileRecAlgs/src/TileCellSelector.h index 12cac4a132bfc976bb19e616cec092b7d432c2bc..c4356cddcec21a64415a9bd57000fba5a5949c7a 100644 --- a/TileCalorimeter/TileRecAlgs/src/TileCellSelector.h +++ b/TileCalorimeter/TileRecAlgs/src/TileCellSelector.h @@ -11,6 +11,7 @@ #include "TileEvent/TileDigitsContainer.h" #include "TileEvent/TileRawChannelContainer.h" #include "TileEvent/TileDQstatus.h" +#include "TileConditions/ITileDCSTool.h" // Calo includes #include "CaloEvent/CaloCellContainer.h" @@ -31,7 +32,6 @@ class TileHWID; class TileCell; class TileCablingService; class ITileBadChanTool; -class TileDCSSvc; ///////////////////////////////////////////////////////////////////////////// @@ -69,7 +69,7 @@ class TileCellSelector: public AthAlgorithm { const TileCablingService* m_cabling; ToolHandle<ITileBadChanTool> m_tileBadChanTool; //!< Tile Bad Channel tool SG::ReadHandleKey<TileDQstatus> m_dqStatusKey; - ServiceHandle<TileDCSSvc> m_tileDCSSvc; //!< Pointer to TileDCSSvc + ToolHandle<ITileDCSTool> m_tileDCS{this, "TileDCSTool", "TileDCSTool", "Tile DCS tool"}; unsigned int m_runNum; unsigned int m_lumiBlock; diff --git a/TileCalorimeter/TileRecUtils/python/TileRawChannelGetter.py b/TileCalorimeter/TileRecUtils/python/TileRawChannelGetter.py index dd28988cdc05e0d4083d528ad1a41450ed1d6578..0b58c45b3921778b6a8f54155e64bde872f052cd 100644 --- a/TileCalorimeter/TileRecUtils/python/TileRawChannelGetter.py +++ b/TileCalorimeter/TileRecUtils/python/TileRawChannelGetter.py @@ -56,7 +56,10 @@ class TileRawChannelGetter ( Configured) : from TileRecUtils.TileRecFlags import jobproperties from TileRecUtils.TileRecUtilsConf import TileBeamInfoProvider theTileBeamInfoProvider = TileBeamInfoProvider() - if hasattr( ServiceMgr, "TileDCSSvc" ): + + from AthenaCommon.AlgSequence import AthSequencer + condSequence = AthSequencer("AthCondSeq") + if hasattr(condSequence, 'TileDCSCondAlg'): theTileBeamInfoProvider.CheckDCS = True # true for real data, false for MC - GlobalFlags.DataSource.is_data() diff --git a/TileCalorimeter/TileRecUtils/python/TileRawChannelGetter_DigiHSTruth.py b/TileCalorimeter/TileRecUtils/python/TileRawChannelGetter_DigiHSTruth.py index 136d6fa045b2527620313982a72e9f507bbe6683..2bf19b5c5a2e5ba0592e5930c85c67e15206d568 100644 --- a/TileCalorimeter/TileRecUtils/python/TileRawChannelGetter_DigiHSTruth.py +++ b/TileCalorimeter/TileRecUtils/python/TileRawChannelGetter_DigiHSTruth.py @@ -52,7 +52,10 @@ class TileRawChannelGetter_DigiHSTruth ( Configured) : from TileRecUtils.TileRecFlags import jobproperties from TileRecUtils.TileRecUtilsConf import TileBeamInfoProvider theTileBeamInfoProvider = TileBeamInfoProvider() - if hasattr( ServiceMgr, "TileDCSSvc" ): + + from AthenaCommon.AlgSequence import AthSequencer + condSequence = AthSequencer("AthCondSeq") + if hasattr(condSequence, 'TileDCSCondAlg'): theTileBeamInfoProvider.CheckDCS = True # true for nominal ATLAS configuration - GlobalFlags.DetGeo.is_atlas()