From 7447c68903afa52f9edf9bdcbb33548c470b0507 Mon Sep 17 00:00:00 2001 From: Pavol Strizenec <pavol.strizenec@cern.ch> Date: Thu, 29 Nov 2018 14:41:33 +0000 Subject: [PATCH] Remove the LArBadChanTool --- Calorimeter/CaloBadChannelTool/CMakeLists.txt | 3 +- .../CaloBadChannelTool/CaloBadChanTool.h | 5 +- .../src/CaloBadChanTool.cxx | 31 +++- .../CaloClusterCorrection/CMakeLists.txt | 3 +- .../python/CaloClusterBadChannelListCorr.py | 2 - .../src/CaloClusterBadChannelList.cxx | 2 +- .../CaloMonitoring/LArCellMonTool.h | 15 +- .../share/CaloCellVecMonCollisions_jobOpt.py | 5 - .../share/CaloCellVecMonCosmics_jobOpt.py | 5 - .../CaloMonitoring/src/LArCellMonTool.cxx | 41 +++-- Calorimeter/CaloRec/python/CaloCellGetter.py | 18 -- .../LArAffectedRegion/LArAffectedRegionAlg.h | 12 +- .../src/LArAffectedRegionAlg.cxx | 46 +++-- ...ArBadChanTool.h => LArBadChanLegacyTool.h} | 10 +- .../LArBadChannelTool/LArBadChannel2Ascii.h | 5 - .../LArBadChannelTool/LArBadChannelDBAlg.h | 7 +- .../LArBadChannelDBToolsDict.h | 2 +- .../LArBadChannelTool/LArBadChannelMasker.h | 2 +- .../LArBadChannelTool/LArBadChannelState.h | 4 +- .../LArBadChannelTimingAlg.h | 7 +- ...dChanTool.cxx => LArBadChanLegacyTool.cxx} | 74 ++++---- .../src/LArBadChannelDBAlg.cxx | 82 +++++++-- .../src/LArBadChannelTimingAlg.cxx | 52 ++++-- .../src/LArBadChannelToolTest.cxx | 72 -------- .../src/LArBadChannelToolTest.h | 30 ---- .../LArBadChannelTool/src/LArBadFeb2Ascii.cxx | 2 - .../components/LArBadChannelTool_entries.cxx | 8 +- .../LArCafJobs/LArCafJobs/LArNoiseBursts.h | 6 +- .../LArCafJobs/LArCafJobs/LArShapeDumper.h | 10 +- .../LArCafJobs/src/LArNoiseBursts.cxx | 25 +-- .../LArCafJobs/src/LArShapeDumper.cxx | 31 ++-- .../LArAutoCorrValidationAlg.h | 6 +- .../LArCalibDataQuality/LArBadChannelHunter.h | 18 +- .../LArCaliWaveValidationAlg.h | 6 +- .../LArCalibValidationAlg.h | 30 ++-- .../LArCalibValidationAlg.icc | 96 ++++++---- .../LArPedestalValidationAlg.h | 7 +- .../LArRampValidationAlg.h | 8 +- .../src/LArAutoCorrValidationAlg.cxx | 27 ++- .../src/LArBadChannelHunter.cxx | 66 ++++--- .../src/LArCaliWaveValidationAlg.cxx | 20 +-- .../src/LArPedestalValidationAlg.cxx | 18 +- .../src/LArRampValidationAlg.cxx | 28 +-- .../LArCalibTools/LArCaliWaves2Ntuple.h | 2 +- .../LArCalibTools/LArCond2NtupleBase.h | 16 +- .../src/CaloCellGroup2Ntuple.cxx | 19 +- .../LArCalibTools/src/CaloCondBlob2Ntuple.cxx | 8 +- .../LArCalibTools/src/LArCaliWaves2Ntuple.cxx | 15 +- .../LArCalibTools/src/LArCond2NtupleBase.cxx | 74 ++++---- .../src/LArHVScaleCorr2Ntuple.cxx | 8 +- .../LArCalibTools/src/LArMinBias2Ntuple.cxx | 8 +- .../src/LArMphysOverMcal2Ntuple.cxx | 9 +- .../LArCalibTools/src/LArNoise2Ntuple.cxx | 8 +- .../LArCalibTools/src/LArOFC2Ntuple.cxx | 11 +- .../LArCalibTools/src/LArRamps2Ntuple.cxx | 10 +- .../LArCalibTools/src/LArShape2Ntuple.cxx | 9 +- .../LArCalibTools/src/LArfSampl2Ntuple.cxx | 8 +- .../LArCalibTools/src/LAruA2MeV2Ntuple.cxx | 9 +- .../LArCalibUtils/LArAutoCorrExtrapolate.h | 7 +- .../LArCalibUtils/LArCalibCopyAlg.h | 1 - .../LArCalibUtils/LArCalibPatchingAlg.h | 34 ++-- .../LArCalibUtils/LArCalibPatchingAlg.icc | 82 +++++---- .../LArCalibUtils/LArCalibShortCorrector.h | 12 +- .../LArCalibUtils/LArPhysWavePredictor.h | 6 +- .../LArCalibUtils/LArRampBuilder.h | 3 - .../LArStripsCrossTalkCorrector.h | 11 +- .../LArCalibUtils/src/LArAutoCorrBuilder.cxx | 24 +-- .../src/LArAutoCorrDecoderTool.cxx | 22 +-- .../src/LArAutoCorrExtrapolate.cxx | 18 +- .../LArCalibUtils/src/LArAutoCorrMaker.cxx | 38 ++-- .../LArCalibUtils/src/LArCaliWaveBuilder.cxx | 84 ++++----- .../src/LArCalibShortCorrector.cxx | 29 +-- .../LArCalibUtils/src/LArOFCAlg.cxx | 128 ++++++------- .../LArCalibUtils/src/LArOFPhasePicker.cxx | 42 ++--- .../src/LArPedestalAutoCorrBuilder.cxx | 36 ++-- .../LArCalibUtils/src/LArPedestalBuilder.cxx | 36 ++-- .../src/LArPhysWavePredictor.cxx | 170 +++++++++--------- .../LArCalibUtils/src/LArPhysWaveShifter.cxx | 58 +++--- .../src/LArRTMParamExtractor.cxx | 110 ++++++------ .../LArCalibUtils/src/LArRampBuilder.cxx | 43 +++-- .../LArCalibUtils/src/LArShapeCorrector.cxx | 36 ++-- .../src/LArStripsCrossTalkCorrector.cxx | 150 +++++++++------- .../LArCalibUtils/src/LArWFParamTool.cxx | 66 +++---- .../share/LArCalib_BadChanTool.py | 19 -- .../LArCalib_Delay_OFC_Cali_jobOptions.py | 4 - .../LArCalib_Delay_OFC_splitter_jobOptions.py | 5 - .../share/LArCalib_Delay_jobOptions.py | 4 - .../LArCalib_Delay_splitter_jobOptions.py | 7 - .../share/LArCalib_Example_WavePatcher.py | 5 - .../share/LArCalib_Patching_jobOptions.py | 5 - .../share/LArCalib_Ramp_jobOptions.py | 3 - .../LArCalib_Ramp_splitter_jobOptions.py | 4 - .../share/LArCoverage_jobOptions.py | 7 - .../LArMonTools/share/LArFEBMon_jobOptions.py | 7 - .../LArMonTools/src/LArCosmicsMonTool.h | 2 - .../LArMonTools/src/LArCoverage.cxx | 48 ++--- LArCalorimeter/LArMonTools/src/LArCoverage.h | 9 +- LArCalorimeter/LArMonTools/src/LArFEBMon.cxx | 16 +- LArCalorimeter/LArMonTools/src/LArFEBMon.h | 5 +- .../LArCalibTest/LArCablingChecker.h | 13 +- .../LArCalibTest/src/LArCablingChecker.cxx | 44 +++-- .../JetMomentTools/JetBadChanCorrTool.h | 1 - Reconstruction/Jet/JetRecCalo/CMakeLists.txt | 4 +- .../JetRecCalo/MissingCellListTool.h | 5 +- .../JetRecCalo/src/MissingCellListTool.cxx | 14 +- .../egammaTools/src/egammaOQFlagsBuilder.h | 1 - .../TrigT2CaloCommon/src/LArCellCont.cxx | 2 +- 107 files changed, 1366 insertions(+), 1275 deletions(-) rename LArCalorimeter/LArBadChannelTool/LArBadChannelTool/{LArBadChanTool.h => LArBadChanLegacyTool.h} (94%) rename LArCalorimeter/LArBadChannelTool/src/{LArBadChanTool.cxx => LArBadChanLegacyTool.cxx} (88%) delete mode 100644 LArCalorimeter/LArBadChannelTool/src/LArBadChannelToolTest.cxx delete mode 100644 LArCalorimeter/LArBadChannelTool/src/LArBadChannelToolTest.h delete mode 100644 LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_BadChanTool.py diff --git a/Calorimeter/CaloBadChannelTool/CMakeLists.txt b/Calorimeter/CaloBadChannelTool/CMakeLists.txt index 6d305e511e6..fff88e34a54 100644 --- a/Calorimeter/CaloBadChannelTool/CMakeLists.txt +++ b/Calorimeter/CaloBadChannelTool/CMakeLists.txt @@ -10,6 +10,7 @@ atlas_depends_on_subdirs( PUBLIC Calorimeter/CaloConditions Calorimeter/CaloIdentifier Control/AthenaBaseComps + LArCalorimeter/LArRecConditions GaudiKernel PRIVATE Control/StoreGate ) @@ -18,7 +19,7 @@ atlas_depends_on_subdirs( PUBLIC atlas_add_component( CaloBadChannelTool src/*.cxx src/components/*.cxx - LINK_LIBRARIES CaloConditions CaloIdentifier AthenaBaseComps GaudiKernel StoreGateLib SGtests ) + LINK_LIBRARIES CaloConditions LArRecConditions CaloIdentifier AthenaBaseComps GaudiKernel StoreGateLib SGtests ) # Install files from the package: atlas_install_headers( CaloBadChannelTool ) diff --git a/Calorimeter/CaloBadChannelTool/CaloBadChannelTool/CaloBadChanTool.h b/Calorimeter/CaloBadChannelTool/CaloBadChannelTool/CaloBadChanTool.h index 8654daa6540..db0b28852b3 100644 --- a/Calorimeter/CaloBadChannelTool/CaloBadChannelTool/CaloBadChanTool.h +++ b/Calorimeter/CaloBadChannelTool/CaloBadChannelTool/CaloBadChanTool.h @@ -9,6 +9,9 @@ #include "CaloConditions/ICaloBadChanTool.h" #include "GaudiKernel/ToolHandle.h" #include "CaloIdentifier/CaloCell_ID.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArBadChannelCont.h" + //static const InterfaceID IID_CaloBadChanTool("CaloBadChanTool", 1 , 0); @@ -28,7 +31,7 @@ public: private: - ToolHandle<ICaloBadChanTool> m_larBCT{this, "LArBadChanTool", "LArBadChanTool", "LAr bad channel tool"}; + SG::ReadCondHandleKey<LArBadChannelCont> m_larBCKey{this, "LArBadChanKey", "LArBadChannel", "LAr bad channel SG key"}; ToolHandle<ICaloBadChanTool> m_tileBCT{this, "TileBadChanTool", "TileBadChanTool", "Tile bad channel tool"}; const CaloCell_ID* m_caloID; }; diff --git a/Calorimeter/CaloBadChannelTool/src/CaloBadChanTool.cxx b/Calorimeter/CaloBadChannelTool/src/CaloBadChanTool.cxx index 52ce2b512c9..b4ecdd6671c 100644 --- a/Calorimeter/CaloBadChannelTool/src/CaloBadChanTool.cxx +++ b/Calorimeter/CaloBadChannelTool/src/CaloBadChanTool.cxx @@ -23,12 +23,12 @@ StatusCode CaloBadChanTool::initialize() { ATH_MSG_DEBUG ("in initialize()" ); - StatusCode sc=m_larBCT.retrieve(); + StatusCode sc=m_larBCKey.initialize(); if (sc.isFailure()) { - ATH_MSG_WARNING ( "Unable to get LArBadChanTool: no LAr bad channel info will be provided " ); + ATH_MSG_WARNING ( "Unable to initialize LAr bad channels key: no LAr bad channel info will be provided " ); } else - ATH_MSG_DEBUG ( "LArBadChanTool retrieved" ); + ATH_MSG_DEBUG ( "LAr bad channels key initialized" ); sc=m_tileBCT.retrieve(); @@ -44,12 +44,29 @@ StatusCode CaloBadChanTool::initialize() CaloBadChannel CaloBadChanTool::caloStatus(Identifier id) const{ if (m_tileBCT && m_caloID->is_tile(id)) { - //(*m_log) << MSG::VERBOSE << "Calling Tile BadChannelTool ... not yet implemeted" << endmsg; return m_tileBCT->caloStatus(id); } - else if(m_larBCT && m_caloID->is_lar(id)) { - // (*m_log) << MSG::VERBOSE << "Calling LAr BadChannelTool ... not yet implemeted" << endmsg; - return m_larBCT->caloStatus(id); + else if(m_caloID->is_lar(id)) { + SG::ReadCondHandle<LArBadChannelCont> bch{m_larBCKey}; + const LArBadChannelCont* bcCont{*bch}; + if(bcCont) { + CaloBadChannel::BitWord res = 0; + LArBadChannel lbc = bcCont->offlineStatus(id); + + if ( lbc.reallyNoisy() || lbc.sporadicBurstNoise()) { + CaloBadChannel::setBit( CaloBadChannel::noisyBit, res); + } + if (lbc.deadReadout() || lbc.deadPhys()) { + CaloBadChannel::setBit( CaloBadChannel::deadBit, res); + } + else if ( ! lbc.good()) { + CaloBadChannel::setBit( CaloBadChannel::affectedBit, res); + } + return CaloBadChannel(res); + } else { + CaloBadChannel empty; + return empty; + } } else { CaloBadChannel empty; diff --git a/Calorimeter/CaloClusterCorrection/CMakeLists.txt b/Calorimeter/CaloClusterCorrection/CMakeLists.txt index 0381c4c7ad4..29b0f8c48f9 100644 --- a/Calorimeter/CaloClusterCorrection/CMakeLists.txt +++ b/Calorimeter/CaloClusterCorrection/CMakeLists.txt @@ -27,6 +27,7 @@ atlas_depends_on_subdirs( PUBLIC Calorimeter/CaloIdentifier LArCalorimeter/LArIdentifier LArCalorimeter/LArCabling + LArCalorimeter/LArRecConditions Control/AthContainers DetectorDescription/Identifier Event/EventKernel @@ -42,7 +43,7 @@ atlas_add_library( CaloClusterCorrectionLib PUBLIC_HEADERS CaloClusterCorrection PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} - LINK_LIBRARIES CaloCondBlobObjs CaloConditions CaloEvent CaloIdentifier AthenaBaseComps AthenaKernel CxxUtils AthenaPoolUtilities xAODCaloEvent GaudiKernel LArIdentifier CaloRecLib StoreGateLib SGtests LArToolsLib CaloDetDescrLib CaloUtilsLib + LINK_LIBRARIES CaloCondBlobObjs CaloConditions CaloEvent CaloIdentifier AthenaBaseComps AthenaKernel CxxUtils AthenaPoolUtilities xAODCaloEvent GaudiKernel LArIdentifier LArRecConditions CaloRecLib StoreGateLib SGtests LArToolsLib CaloDetDescrLib CaloUtilsLib PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} TestTools CaloGeoHelpers Identifier EventKernel PathResolver ) atlas_add_component( CaloClusterCorrection diff --git a/Calorimeter/CaloClusterCorrection/python/CaloClusterBadChannelListCorr.py b/Calorimeter/CaloClusterCorrection/python/CaloClusterBadChannelListCorr.py index 1996fda73af..3bb425f293b 100644 --- a/Calorimeter/CaloClusterCorrection/python/CaloClusterBadChannelListCorr.py +++ b/Calorimeter/CaloClusterCorrection/python/CaloClusterBadChannelListCorr.py @@ -4,8 +4,6 @@ def CaloClusterBadChannelListCorr() : from CaloBadChannelTool.CaloBadChannelToolConf import CaloBadChanTool theCaloBadChannelTool = CaloBadChanTool() - from AthenaCommon.AppMgr import ToolSvc - ToolSvc += theCaloBadChannelTool from CaloClusterCorrection.CaloClusterCorrectionConf import CaloClusterBadChannelList corr = CaloClusterBadChannelList() diff --git a/Calorimeter/CaloClusterCorrection/src/CaloClusterBadChannelList.cxx b/Calorimeter/CaloClusterCorrection/src/CaloClusterBadChannelList.cxx index 091d6049d18..4fefd4d089f 100755 --- a/Calorimeter/CaloClusterCorrection/src/CaloClusterBadChannelList.cxx +++ b/Calorimeter/CaloClusterCorrection/src/CaloClusterBadChannelList.cxx @@ -23,7 +23,7 @@ CaloClusterBadChannelList::CaloClusterBadChannelList(const std::string& type, const std::string& name, const IInterface* parent) : CaloClusterCorrection(type, name, parent), - m_badChannelTool("CaloBadChanTool") + m_badChannelTool("CaloBadChanTool", this) { declareProperty("badChannelTool",m_badChannelTool,"Tool handle for bad channel"); } diff --git a/Calorimeter/CaloMonitoring/CaloMonitoring/LArCellMonTool.h b/Calorimeter/CaloMonitoring/CaloMonitoring/LArCellMonTool.h index 3f0881ac91f..ea2539c5bcd 100644 --- a/Calorimeter/CaloMonitoring/CaloMonitoring/LArCellMonTool.h +++ b/Calorimeter/CaloMonitoring/CaloMonitoring/LArCellMonTool.h @@ -13,14 +13,16 @@ #include "CaloMonitoring/CaloMonToolBase.h" #include "GaudiKernel/ToolHandle.h" -#include "LArRecConditions/ILArBadChanTool.h" #include "LArRecConditions/ILArBadChannelMasker.h" #include "CaloInterface/ICalorimeterNoiseTool.h" -#include "LArCabling/LArCablingService.h" #include "LArIdentifier/LArOnlineID.h" #include "Identifier/IdentifierHash.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArBadChannelCont.h" +#include "LArCabling/LArOnOffIdMapping.h" + #include "TrigDecisionTool/TrigDecisionTool.h" #include "CaloMonitoring/LArCellBinning.h" @@ -144,7 +146,7 @@ private: //Private methods: Histogram filling StatusCode createPerJobHistograms(const CaloCellContainer* cellcont); void checkTriggerAndBeamBackground(); - void sporadicNoiseCandidate(const CaloCell* cell, const LArCellMonTool::LayerEnum iLyr,const float threshold); + void sporadicNoiseCandidate(const CaloCell* cell, const LArCellMonTool::LayerEnum iLyr,const float threshold, const LArOnOffIdMapping* cabling); //Helpers for histogram filling void getHistoCoordinates(const CaloDetDescrElement* dde, float& celleta, float& cellphi, unsigned& iLyr, unsigned& iLyrNS) const; @@ -168,7 +170,6 @@ private: // bad channel mask ToolHandle<ILArBadChannelMasker> m_badChannelMask; - ToolHandle<ILArBadChanTool> m_badChannelTool; bool m_maskKnownBadChannels; bool m_maskNoCondChannels; @@ -278,10 +279,12 @@ private: StatusCode fillOccupancyHist(LArCellMonTool::thresholdHist_t& thr); // Identifer helpers and such - ToolHandle<LArCablingService> m_LArCablingService; const LArOnlineID* m_LArOnlineIDHelper; const CaloCell_ID* m_calo_id; + + SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}; + SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"}; std::array<CaloMonitoring::LArCellBinning,MAXLAYER> m_binning; @@ -306,7 +309,7 @@ private: std::unordered_map<Identifier,SporadicNoiseCell_t,idHasher> m_sporadicNoiseCells; - void bookNoisyCellHistos(SporadicNoiseCell_t& result, const CaloDetDescrElement* dde, const PartitionEnum part, const float threshold); + void bookNoisyCellHistos(SporadicNoiseCell_t& result, const CaloDetDescrElement* dde, const PartitionEnum part, const float threshold, const LArOnOffIdMapping* cabling); std::array<TH1F*,MAXPARTITIONS> m_h_sporadicHists; std::array<unsigned,MAXPARTITIONS> m_sporadicPerPartCounter{}; diff --git a/Calorimeter/CaloMonitoring/share/CaloCellVecMonCollisions_jobOpt.py b/Calorimeter/CaloMonitoring/share/CaloCellVecMonCollisions_jobOpt.py index 2891da86e2e..ca1af5ec23c 100644 --- a/Calorimeter/CaloMonitoring/share/CaloCellVecMonCollisions_jobOpt.py +++ b/Calorimeter/CaloMonitoring/share/CaloCellVecMonCollisions_jobOpt.py @@ -30,10 +30,6 @@ theLArChanMasker.ProblemsToMask=[ ] ToolSvc+=theLArChanMasker -from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool -theLArBadChannelTool=LArBadChanTool() -ToolSvc+=theLArBadChannelTool - # All 2D plot occupancy are activate only for express and cosmiccalo @@ -66,7 +62,6 @@ LArCellMon = LArCellMonTool( metTriggerNames = "EF_xe[0-9]+.*", miscTriggerNames = "", LArBadChannelMask=theLArChanMasker, - LArBadChannelTool=theLArBadChannelTool, MaskBadChannels = False, MaskNoCondChannels = False, #doInverseMasking = False, diff --git a/Calorimeter/CaloMonitoring/share/CaloCellVecMonCosmics_jobOpt.py b/Calorimeter/CaloMonitoring/share/CaloCellVecMonCosmics_jobOpt.py index 9e0866c50f9..e3a75d0f57c 100755 --- a/Calorimeter/CaloMonitoring/share/CaloCellVecMonCosmics_jobOpt.py +++ b/Calorimeter/CaloMonitoring/share/CaloCellVecMonCosmics_jobOpt.py @@ -28,10 +28,6 @@ theLArChanMasker.ProblemsToMask=[ ] ToolSvc+=theLArChanMasker -from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool -theLArBadChannelTool=LArBadChanTool() -ToolSvc+=theLArBadChannelTool - LArCellMon = LArCellMonTool( name = "LArCellMonCosmics", @@ -56,7 +52,6 @@ LArCellMon = LArCellMonTool( metTriggerNames = "EF_xe[0-9]+.*", miscTriggerNames = "", LArBadChannelMask=theLArChanMasker, - LArBadChannelTool=theLArBadChannelTool, MaskBadChannels = False, MaskNoCondChannels = False, diff --git a/Calorimeter/CaloMonitoring/src/LArCellMonTool.cxx b/Calorimeter/CaloMonitoring/src/LArCellMonTool.cxx index 3b73d4d2f7f..f7490fae3b7 100644 --- a/Calorimeter/CaloMonitoring/src/LArCellMonTool.cxx +++ b/Calorimeter/CaloMonitoring/src/LArCellMonTool.cxx @@ -42,8 +42,6 @@ LArCellMonTool::LArCellMonTool(const std::string& type, const std::string& name, m_noiseTool("CaloNoiseTool"), m_trigDec("Trig::TrigDecisionTool/TrigDecisionTool"), m_badChannelMask("BadLArRawChannelMask",this), - m_badChannelTool("LArBadChanTool"), - m_LArCablingService("LArCablingService"), m_LArOnlineIDHelper(nullptr), m_calo_id(nullptr), m_counter_sporadic_protc(0), @@ -70,7 +68,6 @@ LArCellMonTool::LArCellMonTool(const std::string& type, const std::string& name, // Bad channel masking options declareProperty("LArBadChannelMask",m_badChannelMask,"Tool handle for LArBadChanelMasker AlgTool"); - declareProperty("LArBadChannelTool",m_badChannelTool,"Tool handle of LAr Bad-Channel tool"); declareProperty("MaskBadChannels",m_maskKnownBadChannels=false,"Do not fill histograms with values from known bad channels"); declareProperty("MaskNoCondChannels", m_maskNoCondChannels=false,"Do not fill histograms with values from cells reco'ed w/o conditions database"); @@ -155,9 +152,8 @@ StatusCode LArCellMonTool::initialize() { ATH_MSG_INFO("LArCellMonTool::initialize() start"); - //Identfier-helpers & CablingSvc + //Identfier-helpers ATH_CHECK( detStore()->retrieve(m_LArOnlineIDHelper, "LArOnlineID") ); - ATH_CHECK( m_LArCablingService.retrieve() ); ATH_CHECK( detStore()->retrieve(m_calo_id) ); // Bad channel masker tool @@ -168,13 +164,12 @@ StatusCode LArCellMonTool::initialize() { m_badChannelMask.disable(); } - // Retrieve bad channel tool + ATH_CHECK( m_cablingKey.initialize() ); + + // Bad channels key //(used for building eta phi map of known bad channels) if( m_doKnownBadChannelsVsEtaPhi) { - ATH_CHECK(m_badChannelTool.retrieve()); - } - else { - m_badChannelTool.disable(); + ATH_CHECK(m_BCKey.initialize()); } //Calonoise tool @@ -571,7 +566,7 @@ void LArCellMonTool::checkTriggerAndBeamBackground() { } -void LArCellMonTool::sporadicNoiseCandidate(const CaloCell* cell, const LArCellMonTool::LayerEnum iLyr, const float threshold) { +void LArCellMonTool::sporadicNoiseCandidate(const CaloCell* cell, const LArCellMonTool::LayerEnum iLyr, const float threshold, const LArOnOffIdMapping* cabling) { const Identifier id=cell->ID(); const PartitionEnum part=m_layerEnumtoPartitionEnum[iLyr]; @@ -587,7 +582,7 @@ void LArCellMonTool::sporadicNoiseCandidate(const CaloCell* cell, const LArCellM ++m_sporadicPerPartCounter[part]; ++m_counter_sporadic_protc; m_h_sporadicHists[part]->Fill(1.0); //FIXME Sounds like nonsense but used in webdisplay config - bookNoisyCellHistos(snc,cell->caloDDE(),part,threshold); + bookNoisyCellHistos(snc,cell->caloDDE(),part,threshold, cabling); }// end if reached m_minSporadicNoiseEventsPerCell and < m_sporadic_protection if (snc.m_h_energy) { @@ -602,9 +597,10 @@ void LArCellMonTool::sporadicNoiseCandidate(const CaloCell* cell, const LArCellM } void LArCellMonTool::bookNoisyCellHistos(SporadicNoiseCell_t& result, const CaloDetDescrElement* dde, - const PartitionEnum part, const float threshold) { + const PartitionEnum part, const float threshold, + const LArOnOffIdMapping* cabling) { - const HWIdentifier onlID=m_LArCablingService->createSignalChannelID(dde->identify()); + const HWIdentifier onlID=cabling->createSignalChannelID(dde->identify()); const int ft = m_LArOnlineIDHelper->feedthrough(onlID); const int slot = m_LArOnlineIDHelper->slot(onlID); const int channel = m_LArOnlineIDHelper->channel(onlID); @@ -658,6 +654,13 @@ StatusCode LArCellMonTool::fillHistograms(){ ATH_MSG_DEBUG("LArCellMonTool::fillHistograms() starts"); + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling{*cablingHdl}; + if(!cabling) { + ATH_MSG_ERROR( "Do not have cabling"); + return StatusCode::FAILURE; + } + const CaloCellContainer* cellCont = nullptr; ATH_CHECK(evtStore()->retrieve(cellCont, m_cellContainerName)); @@ -772,7 +775,7 @@ StatusCode LArCellMonTool::fillHistograms(){ energyThreshold = m_threshold_HECFCALEMS2S3; } if (cell->energy()> energyThreshold) { - sporadicNoiseCandidate(cell,(LayerEnum)iLyr,energyThreshold); + sporadicNoiseCandidate(cell,(LayerEnum)iLyr,energyThreshold, cabling); } }//end if m_sporadic_switch } // end if m_passBeamBackgroundRemoval @@ -1007,6 +1010,12 @@ StatusCode LArCellMonTool::createPerJobHistograms(const CaloCellContainer* cellC }//end loop over thresholds + SG::ReadCondHandle<LArBadChannelCont> readHandle{m_BCKey}; + const LArBadChannelCont *bcCont {*readHandle}; + if(m_doKnownBadChannelsVsEtaPhi && !bcCont) { + ATH_MSG_WARNING( "Do not have Bad chan container !!!" ); + return StatusCode::FAILURE; + } //filling: CaloCellContainer::const_iterator it = cellCont->begin(); @@ -1022,7 +1031,7 @@ StatusCode LArCellMonTool::createPerJobHistograms(const CaloCellContainer* cellC getHistoCoordinates(caloDDEl, celleta, cellphi, iLyr, iLyrNS); if (m_doKnownBadChannelsVsEtaPhi) { - const LArBadChannel larBadChannel = m_badChannelTool->offlineStatus(id); + const LArBadChannel larBadChannel = bcCont->offlineStatus(id); if (!larBadChannel.good()) { const uint32_t badCellWord = larBadChannel.packedData(); m_h_badChannels_etaphi[iLyr]->Fill(celleta,cellphi,badCellWord); diff --git a/Calorimeter/CaloRec/python/CaloCellGetter.py b/Calorimeter/CaloRec/python/CaloCellGetter.py index c488906aa4a..9803f547696 100644 --- a/Calorimeter/CaloRec/python/CaloCellGetter.py +++ b/Calorimeter/CaloRec/python/CaloCellGetter.py @@ -332,16 +332,6 @@ class CaloCellGetter (Configured) : print traceback.format_exc() return False - # bad channel tools - try: - from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool - theLArBadChannelTool = LArBadChanTool() - except: - mlog.error("could not access bad channel tool Quit") - print traceback.format_exc() - return False - ToolSvc += theLArBadChannelTool - if doSporadicMask: try: from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelMasker @@ -396,14 +386,6 @@ class CaloCellGetter (Configured) : return False theCaloCellMaker += theLArBadFebMaskingTool - # bad channel tools - try: - from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool - theLArBadChannelTool = LArBadChanTool() - except: - mlog.error("could not access bad channel tool Quit") - print traceback.format_exc() - return False theCaloCellMaker.CaloCellMakerToolNames += [theLArBadFebMaskingTool] # diff --git a/LArCalorimeter/LArAffectedRegion/LArAffectedRegion/LArAffectedRegionAlg.h b/LArCalorimeter/LArAffectedRegion/LArAffectedRegion/LArAffectedRegionAlg.h index e5f531d4d70..fe45517e571 100644 --- a/LArCalorimeter/LArAffectedRegion/LArAffectedRegion/LArAffectedRegionAlg.h +++ b/LArCalorimeter/LArAffectedRegion/LArAffectedRegion/LArAffectedRegionAlg.h @@ -24,10 +24,11 @@ #include "AthenaPoolUtilities/CondAttrListCollection.h" #include "IOVDbMetaDataTools/IIOVDbMetaDataTool.h" -#include "LArRecConditions/ILArBadChanTool.h" #include "LArElecCalib/ILArHVTool.h" -#include "LArCabling/LArCablingService.h" #include "CaloDetDescr/CaloDetDescrManager.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArBadChannelCont.h" +#include "LArCabling/LArOnOffIdMapping.h" class LArOnlineID; @@ -42,7 +43,7 @@ class LArAffectedRegionAlg : public AthAlgorithm,virtual public IIncidentListene StatusCode finalize(); void handle(const Incident& inc); - StatusCode updateMethod(IOVSVC_CALLBACK_ARGS); + StatusCode updateMethod(); StatusCode updateAffectedRegionsFromDB(IOVSVC_CALLBACK_ARGS); void searchNonNominalHV_EMB(); @@ -58,10 +59,11 @@ class LArAffectedRegionAlg : public AthAlgorithm,virtual public IIncidentListene //--- private: + SG::ReadCondHandleKey<LArBadFebCont> m_BFKey{this, "MissingFEBKey", "LArBadFeb", "SG key for missing FEB object"}; + SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this, "OnOffMap", "LArOnOffIdMap", "SG key for mapping object"}; + std::vector<CaloAffectedRegionInfo> m_ArrayLArAffectedRegionInfo_global; std::vector<CaloAffectedRegionInfo> m_ArrayLArAffectedRegionInfo_current_run; - ToolHandle<LArCablingService> m_larCablingSvc; - ToolHandle<ILArBadChanTool> m_BadChanTool; const DataHandle<CaloIdManager> m_caloIdMgr; ToolHandle<ILArHVTool> m_hvtool; diff --git a/LArCalorimeter/LArAffectedRegion/src/LArAffectedRegionAlg.cxx b/LArCalorimeter/LArAffectedRegion/src/LArAffectedRegionAlg.cxx index 9d44ec62e11..5988ac415f8 100644 --- a/LArCalorimeter/LArAffectedRegion/src/LArAffectedRegionAlg.cxx +++ b/LArCalorimeter/LArAffectedRegion/src/LArAffectedRegionAlg.cxx @@ -19,7 +19,6 @@ #include "GaudiKernel/MsgStream.h" #include "GaudiKernel/GaudiException.h" -#include "LArRecConditions/ILArBadChanTool.h" #include "LArRecConditions/LArBadChanBitPacking.h" #include "StoreGate/StoreGateSvc.h" @@ -72,14 +71,11 @@ LArAffectedRegionAlg::LArAffectedRegionAlg(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator), - m_larCablingSvc("LArCablingService"), - m_BadChanTool("LArBadChanTool"), m_hvtool("LArHVToolMC"), m_onlineID(NULL), m_metaDataTool("IOVDbMetaDataTool"), m_doHV(true) { - declareProperty("BadChannelTool", m_BadChanTool, "public, shared BadChannelTool"); declareProperty("ReadingFromBytestream", m_readingFromBytestream = true); declareProperty("doHV",m_doHV,"include HV non nominal regions info"); declareTool( m_metaDataTool, m_metaDataTool.typeAndName() ); @@ -89,14 +85,10 @@ LArAffectedRegionAlg::LArAffectedRegionAlg(const std::string& name, ISvcLocator* StatusCode LArAffectedRegionAlg::initialize() { ATH_MSG_INFO ( "initialize()" ); - //-------------- deals with LAr Febs - if (m_larCablingSvc.retrieve().isFailure()) { - ATH_MSG_ERROR ( "Could not retrieve LArCablingService Tool" ); - return StatusCode::FAILURE; - } - ATH_CHECK( m_metaDataTool.retrieve() ); + ATH_CHECK( m_cablingKey.initialize()); + ATH_CHECK( detStore()->retrieve(m_onlineID, "LArOnlineID") ); ATH_CHECK( detStore()->retrieve(m_caloIdMgr) ); ATH_CHECK( detStore()->retrieve(m_calodetdescrmgr) ); @@ -106,18 +98,9 @@ StatusCode LArAffectedRegionAlg::initialize() { if (m_readingFromBytestream) { - ATH_CHECK( m_BadChanTool.retrieve() ); - ATH_MSG_INFO ( m_BadChanTool.propertyName() << ": Retrieved tool " - << m_BadChanTool.type() ); - - StatusCode sc = detStore()->regFcn( &ILArBadChanTool::updateBadFebsFromDB,dynamic_cast<ILArBadChanTool*>(&(*m_BadChanTool)),&LArAffectedRegionAlg::updateMethod,this,true); + ATH_CHECK( m_BFKey.initialize() ); - if (sc.isSuccess()) - ATH_MSG_INFO ( "Registered callback for LArAffectedRegionAlg/LArAffectedRegionAlg" ); - else - ATH_MSG_WARNING ( "Cannot register Callback function for LArAffectedRegionAlg/LArAffectedRegionAlg" ); } else { // Do only when reading ESD/AOD - m_BadChanTool.disable(); if (detStore()->contains<CondAttrListCollection>("/LAR/LArAffectedRegionInfo")) { const DataHandle<CondAttrListCollection> affectedRegionH; @@ -819,15 +802,28 @@ void LArAffectedRegionAlg::searchNonNominalHV_FCAL() { // deals with LAr HV, FCA } //end status success } //========================================================================================= -StatusCode LArAffectedRegionAlg::updateMethod(IOVSVC_CALLBACK_ARGS) { //store informations on the missing Febs w/ range of eta, phi, layer +StatusCode LArAffectedRegionAlg::updateMethod() { //store informations on the missing Febs w/ range of eta, phi, layer ATH_MSG_INFO ( "updateMethod()" ); + SG::ReadCondHandle<LArBadFebCont> bfHdl{m_BFKey}; + const LArBadFebCont* bfCont{*bfHdl}; + if(!bfCont) { + ATH_MSG_ERROR( "Do not have missing FEBs " << m_BFKey.key() ); + return StatusCode::FAILURE; + } + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling{*cablingHdl}; + if(!cabling) { + ATH_MSG_ERROR( "Do not have cabling object LArOnOffIdMapping"); + return StatusCode::FAILURE; + } + std::vector<HWIdentifier>::const_iterator febid_it=m_onlineID->feb_begin(); std::vector<HWIdentifier>::const_iterator febid_end_it=m_onlineID->feb_end(); for (;febid_it!=febid_end_it;++febid_it) { - bool IsMissingFeb=m_BadChanTool->febMissing(*febid_it); + bool IsMissingFeb=(bfCont->status(*febid_it).deadAll() || bfCont->status(*febid_it).deadReadout()); if (IsMissingFeb) { //flag for special treatment for FEB that has non contiguous eta regions, so we have to separate them bool is_normal=0; //FEB without discontinuity @@ -846,8 +842,8 @@ StatusCode LArAffectedRegionAlg::updateMethod(IOVSVC_CALLBACK_ARGS) { //store in for (int icha=0;icha<chans_per_feb;icha++) { //loop on each channel of the relevant FEB HWIdentifier channelId=m_onlineID->channel_Id(*febid_it,icha); - if (m_larCablingSvc->isOnlineConnected(channelId)) { - Identifier offlineId=m_larCablingSvc->cnvToIdentifier(channelId); + if (cabling->isOnlineConnected(channelId)) { + Identifier offlineId=cabling->cnvToIdentifier(channelId); const CaloDetDescrElement* caloddElement=m_calodetdescrmgr->get_element(offlineId); CaloCell_ID::CaloSample current_layer=caloddElement->getSampling(); // calo layer @@ -975,6 +971,8 @@ StatusCode LArAffectedRegionAlg::execute() { } } + }else{ + ATH_CHECK(updateMethod()); } return StatusCode::SUCCESS; diff --git a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChanTool.h b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChanLegacyTool.h similarity index 94% rename from LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChanTool.h rename to LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChanLegacyTool.h index 68ae48c456e..00457108272 100644 --- a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChanTool.h +++ b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChanLegacyTool.h @@ -1,9 +1,9 @@ /* - 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 LArBadChanTool_H -#define LArBadChanTool_H +#ifndef LArBadChanLegacyTool_H +#define LArBadChanLegacyTool_H #include "AthenaBaseComps/AthAlgTool.h" #include "LArRecConditions/ILArBadChanTool.h" @@ -27,7 +27,7 @@ class StoreGateSvc; -class LArBadChanTool : public AthAlgTool, +class LArBadChanLegacyTool : public AthAlgTool, public ILArBadChanTool, public ICaloBadChanTool { @@ -37,7 +37,7 @@ public: typedef LArBadChanContainerHashed::BadFebEntry BadFebEntry; typedef std::vector<BadFebEntry> BadFebVec; - LArBadChanTool(const std::string& type, const std::string& name, + LArBadChanLegacyTool(const std::string& type, const std::string& name, const IInterface* parent); // to allow access to the interface diff --git a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannel2Ascii.h b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannel2Ascii.h index 457a605d624..597fe79ee0c 100644 --- a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannel2Ascii.h +++ b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannel2Ascii.h @@ -13,9 +13,7 @@ #include "LArCabling/LArOnOffIdMapping.h" #include <string> -//class LArBadChanTool; class StoreGateSvc; -class LArCablingService; class LArBadChannel2Ascii : public AthAlgorithm { @@ -30,11 +28,8 @@ public: private: - //ToolHandle< LArBadChanTool > m_BadChanTool; - //ReadCondHandleKey<LArBadChannelCont> m_BCKey; SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey; SG::ReadCondHandleKey<LArBadFebCont> m_BFKey; - //ToolHandle<LArCablingService> m_larCablingSvc; SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey; std::string m_dbFolder; diff --git a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelDBAlg.h b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelDBAlg.h index 085f11b8459..13558aaba0b 100644 --- a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelDBAlg.h +++ b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelDBAlg.h @@ -7,11 +7,11 @@ #include "AthenaBaseComps/AthAlgorithm.h" #include "GaudiKernel/ToolHandle.h" - +#include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArBadChannelCont.h" #include <string> -class LArBadChanTool; class EventInfo; class LArBadChannelDBAlg : public AthAlgorithm @@ -26,7 +26,8 @@ public: private: - ToolHandle< LArBadChanTool > m_BadChanTool; + SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey; + SG::ReadCondHandleKey<LArBadFebCont> m_BFKey; std::string m_dbFolder; std::string m_dbFebFolder; int m_mode; diff --git a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelDBToolsDict.h b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelDBToolsDict.h index 5b93c7f82ba..9db4b7695d5 100644 --- a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelDBToolsDict.h +++ b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelDBToolsDict.h @@ -14,7 +14,7 @@ #include "LArRecConditions/LArBadChanBitPacking.h" #include "LArBadChannelTool/LArBadChannelMasker.h" -#include "LArBadChannelTool/LArBadChanTool.h" +#include "LArBadChannelTool/LArBadChanLegacyTool.h" std::pair<bool,LArBadChannelEnum::ProblemType> dummy1; std::pair<HWIdentifier,LArBadFeb> dummy2; diff --git a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelMasker.h b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelMasker.h index b7902c98ce8..819f62e4f48 100644 --- a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelMasker.h +++ b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelMasker.h @@ -13,7 +13,7 @@ Author: Ryan Taylor Description: The LArBadChannelMasker tool is a very simple and - generic interface to the LArBadChanTool, and is used + generic interface to ILArBadChannelMasker, and is used to check whether cells have any of the problems specified by the user in the 'ProblemsToMask' property. diff --git a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelState.h b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelState.h index 0f27fefbd9b..ec81a825e8c 100644 --- a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelState.h +++ b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelState.h @@ -161,10 +161,10 @@ class LArBadChannelState { //void CurrentState private: - friend class LArBadChanTool; - std::vector< CoolChannelData> m_DataVec; + friend class LArBadChanLegacyTool; + // Non-const access to channel data CoolChannelData& coolChannel( int i) { return m_DataVec.at( static_cast<CoolChannelEnum>(i)); diff --git a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelTimingAlg.h b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelTimingAlg.h index 35e5a05bbda..a86f9653695 100644 --- a/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelTimingAlg.h +++ b/LArCalorimeter/LArBadChannelTool/LArBadChannelTool/LArBadChannelTimingAlg.h @@ -8,11 +8,13 @@ #include "AthenaBaseComps/AthAlgorithm.h" #include "GaudiKernel/ToolHandle.h" #include "StoreGate/DataHandle.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArBadChannelCont.h" +#include "LArCabling/LArOnOffIdMapping.h" #include "CaloIdentifier/CaloCell_ID.h" #include "LArIdentifier/LArOnlineID.h" -class LArBadChanTool; class EventInfo; class LArEM_ID; @@ -28,8 +30,7 @@ public: StatusCode finalize(); private: - - ToolHandle< LArBadChanTool > m_BadChanTool; + SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey; const CaloCell_ID* m_cellID; const DataHandle<LArOnlineID> m_onlineID; const DataHandle<LArEM_ID> m_emID; diff --git a/LArCalorimeter/LArBadChannelTool/src/LArBadChanTool.cxx b/LArCalorimeter/LArBadChannelTool/src/LArBadChanLegacyTool.cxx similarity index 88% rename from LArCalorimeter/LArBadChannelTool/src/LArBadChanTool.cxx rename to LArCalorimeter/LArBadChannelTool/src/LArBadChanLegacyTool.cxx index b1c8549903d..dd38be3b02d 100644 --- a/LArCalorimeter/LArBadChannelTool/src/LArBadChanTool.cxx +++ b/LArCalorimeter/LArBadChannelTool/src/LArBadChanLegacyTool.cxx @@ -1,8 +1,8 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ -#include "LArBadChannelTool/LArBadChanTool.h" +#include "LArBadChannelTool/LArBadChanLegacyTool.h" #include "LArBadChannelTool/LArBadChannelDecoder.h" #include "StoreGate/StoreGate.h" @@ -25,21 +25,21 @@ #include <fstream> struct BadFebEntryLess { - bool operator()(const LArBadChanTool::BadFebEntry& a, - const LArBadChanTool::BadFebEntry& b) const { + bool operator()(const LArBadChanLegacyTool::BadFebEntry& a, + const LArBadChanLegacyTool::BadFebEntry& b) const { return a.first < b.first; } }; struct BadFebEntryMerger { - LArBadChanTool::BadFebEntry operator()( const LArBadChanTool::BadFebEntry& a, - const LArBadChanTool::BadFebEntry& b) const { - return LArBadChanTool::BadFebEntry( a.first, + LArBadChanLegacyTool::BadFebEntry operator()( const LArBadChanLegacyTool::BadFebEntry& a, + const LArBadChanLegacyTool::BadFebEntry& b) const { + return LArBadChanLegacyTool::BadFebEntry( a.first, LArBadFeb( a.second.packedData() | b.second.packedData())); } }; -LArBadChanTool::LArBadChanTool(const std::string& type, const std::string& name, +LArBadChanLegacyTool::LArBadChanLegacyTool(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool( type, name, parent), m_cablingService("LArCablingService"), @@ -79,14 +79,14 @@ LArBadChanTool::LArBadChanTool(const std::string& type, const std::string& name, } -const InterfaceID& LArBadChanTool::interfaceID() +const InterfaceID& LArBadChanLegacyTool::interfaceID() { - //return ILArBadChanTool::interfaceID(); - static const InterfaceID id("LArBadChanTool", 1 , 0); + //return ILArBadChanLegacyTool::interfaceID(); + static const InterfaceID id("LArBadChanLegacyTool", 1 , 0); return id; } -StatusCode LArBadChanTool::queryInterface( const InterfaceID& riid, void** ppvIf ) +StatusCode LArBadChanLegacyTool::queryInterface( const InterfaceID& riid, void** ppvIf ) { if ( riid == ILArBadChanTool::interfaceID() ) { *ppvIf = static_cast<ILArBadChanTool*>(this); @@ -108,7 +108,7 @@ StatusCode LArBadChanTool::queryInterface( const InterfaceID& riid, void** ppvIf return AthAlgTool::queryInterface( riid, ppvIf ); } -StatusCode LArBadChanTool::initialize() +StatusCode LArBadChanLegacyTool::initialize() { ATH_MSG_DEBUG ("in initialize()" ); @@ -154,7 +154,7 @@ StatusCode LArBadChanTool::initialize() return StatusCode::SUCCESS; } -std::vector<HWIdentifier> LArBadChanTool::missingFEBs() const +std::vector<HWIdentifier> LArBadChanLegacyTool::missingFEBs() const { std::vector<HWIdentifier> result( m_BadFebs.size()); for (unsigned int i=0; i<m_BadFebs.size(); ++i) @@ -162,11 +162,11 @@ std::vector<HWIdentifier> LArBadChanTool::missingFEBs() const return result; } -void LArBadChanTool::complain() const +void LArBadChanLegacyTool::complain() const { if (!m_updatedFromDB) { // if we are here then the bad channel DB update did not take place before first use - ATH_MSG_WARNING ( "the LArBadChanTool is used without bad channel information from DB" ); + ATH_MSG_WARNING ( "the LArBadChanLegacyTool is used without bad channel information from DB" ); if (m_Updates.empty()) { ATH_MSG_WARNING ( "and it contains no bad channel information from ASCII file." ); @@ -182,7 +182,7 @@ void LArBadChanTool::complain() const } if (!m_updatedFebsFromDB) { // if we are here then the bad Feb DB update did not take place before first use - ATH_MSG_WARNING ( "the LArBadChanTool is used without missing FEB information from DB" ); + ATH_MSG_WARNING ( "the LArBadChanLegacyTool is used without missing FEB information from DB" ); if (m_BadFebUpdates.empty()) { ATH_MSG_WARNING ( "and it contains no missing FEB information from ASCII file." ); @@ -198,7 +198,7 @@ void LArBadChanTool::complain() const m_ready = true; } -bool LArBadChanTool::readASCII() +bool LArBadChanLegacyTool::readASCII() { LArBadChannelDecoder decoder(&(*m_onlineID), msg()); @@ -261,7 +261,7 @@ bool LArBadChanTool::readASCII() return true; } -LArBadChannel LArBadChanTool::status( HWIdentifier id) const { +LArBadChannel LArBadChanLegacyTool::status( HWIdentifier id) const { check(); try { return m_HwBadChan.status(id); @@ -272,7 +272,7 @@ LArBadChannel LArBadChanTool::status( HWIdentifier id) const { } } -LArBadChannel LArBadChanTool::status( const HWIdentifier& FEBid, int chan) const { +LArBadChannel LArBadChanLegacyTool::status( const HWIdentifier& FEBid, int chan) const { check(); try { return m_HwBadChan.status( FEBid, chan); @@ -283,13 +283,13 @@ LArBadChannel LArBadChanTool::status( const HWIdentifier& FEBid, int chan) const } } -void LArBadChanTool::warnInvalidFEB( const HWIdentifier& id) const +void LArBadChanLegacyTool::warnInvalidFEB( const HWIdentifier& id) const { ATH_MSG_WARNING ( "status requested for unknown HWIdentifier " << id.get_identifier32().get_compact() ); } -LArBadChannel LArBadChanTool::offlineStatus( Identifier id) const +LArBadChannel LArBadChanLegacyTool::offlineStatus( Identifier id) const { check(); @@ -298,7 +298,7 @@ LArBadChannel LArBadChanTool::offlineStatus( Identifier id) const return m_OfflineBadChan.status(id); } -CaloBadChannel LArBadChanTool::caloStatus( Identifier id) const +CaloBadChannel LArBadChanLegacyTool::caloStatus( Identifier id) const { CaloBadChannel::BitWord res = 0; LArBadChannel lbc = offlineStatus( id); @@ -318,7 +318,7 @@ CaloBadChannel LArBadChanTool::caloStatus( Identifier id) const return CaloBadChannel(res); } -void LArBadChanTool::fillOfflineInfo() const +void LArBadChanLegacyTool::fillOfflineInfo() const { m_OfflineBadChan.clear(); OfflineVec vec; @@ -349,7 +349,7 @@ void LArBadChanTool::fillOfflineInfo() const m_OfflineCacheInvalid = false; } -void LArBadChanTool::updateCache() +void LArBadChanLegacyTool::updateCache() { ATH_MSG_DEBUG ( " entering updateCache " ); @@ -367,7 +367,7 @@ void LArBadChanTool::updateCache() ATH_MSG_DEBUG ( " updateCache done " ); } -void LArBadChanTool::updateFebCache() +void LArBadChanLegacyTool::updateFebCache() { // just copy current FEB list to the cache m_HwBadChan.setBadFEBs( m_BadFebs); @@ -377,7 +377,7 @@ void LArBadChanTool::updateFebCache() } -bool LArBadChanTool::readFromDB( const DataHandle<CondAttrListCollection> collection) +bool LArBadChanLegacyTool::readFromDB( const DataHandle<CondAttrListCollection> collection) { for ( CondAttrListCollection::const_iterator i=collection->begin(); i != collection->end(); ++i) { @@ -411,7 +411,7 @@ bool LArBadChanTool::readFromDB( const DataHandle<CondAttrListCollection> collec return true; } -bool LArBadChanTool::readBadFebsFromDB() +bool LArBadChanLegacyTool::readBadFebsFromDB() { ATH_CHECK( detStore()->retrieve( m_DBBadFebColl, m_DBBadFebFolder), false ); @@ -452,7 +452,7 @@ bool LArBadChanTool::readBadFebsFromDB() } -StatusCode LArBadChanTool::updateFromDB( int&, std::list<std::string>& keylist) +StatusCode LArBadChanLegacyTool::updateFromDB( int&, std::list<std::string>& keylist) { m_State.reset(); @@ -485,7 +485,7 @@ StatusCode LArBadChanTool::updateFromDB( int&, std::list<std::string>& keylist) return StatusCode::SUCCESS; } -StatusCode LArBadChanTool::updateBadFebsFromDB(IOVSVC_CALLBACK_ARGS) +StatusCode LArBadChanLegacyTool::updateBadFebsFromDB(IOVSVC_CALLBACK_ARGS) { if (!readBadFebsFromDB()) return StatusCode::FAILURE; m_updatedFebsFromDB = true; @@ -503,7 +503,7 @@ StatusCode LArBadChanTool::updateBadFebsFromDB(IOVSVC_CALLBACK_ARGS) return StatusCode::SUCCESS; } -void LArBadChanTool::dumpHWCache() const +void LArBadChanLegacyTool::dumpHWCache() const { LArBadChanBitPacking packing; ATH_MSG_INFO ( "Begin of dump of online Id cache" ); @@ -514,7 +514,7 @@ void LArBadChanTool::dumpHWCache() const ATH_MSG_INFO ( "End of dump of online Id cache" ); } -void LArBadChanTool::applyUpdates() +void LArBadChanLegacyTool::applyUpdates() { typedef std::vector<State::BadChanEntry>::const_iterator Iter; @@ -531,7 +531,7 @@ void LArBadChanTool::applyUpdates() } } -void LArBadChanTool::applyUpdate( State::CoolChannelData& coolChan, +void LArBadChanLegacyTool::applyUpdate( State::CoolChannelData& coolChan, const State::BadChanEntry& entry) { typedef std::vector<State::BadChanEntry>::iterator Iter; @@ -548,7 +548,7 @@ void LArBadChanTool::applyUpdate( State::CoolChannelData& coolChan, } // should not be called if m_BadFebUpdates.empty() -void LArBadChanTool::applyFebUpdates() +void LArBadChanLegacyTool::applyFebUpdates() { using namespace LArBadChanImpl; typedef combined_ordered_container< BadFebVec, BadFebEntryLess > CNT; @@ -565,7 +565,7 @@ void LArBadChanTool::applyFebUpdates() } } -void LArBadChanTool::dumpAscii( const std::string& fileName) const +void LArBadChanLegacyTool::dumpAscii( const std::string& fileName) const { std::ofstream out(fileName.c_str()); LArBadChanBitPacking packing; @@ -581,7 +581,7 @@ void LArBadChanTool::dumpAscii( const std::string& fileName) const } } -void LArBadChanTool::dumpFEBsAscii( const std::string& fileName) const +void LArBadChanLegacyTool::dumpFEBsAscii( const std::string& fileName) const { std::ofstream out(fileName.c_str()); LArBadFebBitPacking packing; @@ -596,7 +596,7 @@ void LArBadChanTool::dumpFEBsAscii( const std::string& fileName) const } } -bool LArBadChanTool::prepareFebHash() +bool LArBadChanLegacyTool::prepareFebHash() { int firstFEB = m_onlineID->feb_begin()->get_identifier32().get_compact(); int prevFEB = firstFEB; diff --git a/LArCalorimeter/LArBadChannelTool/src/LArBadChannelDBAlg.cxx b/LArCalorimeter/LArBadChannelTool/src/LArBadChannelDBAlg.cxx index e73ffad85fc..1c9b247129d 100644 --- a/LArCalorimeter/LArBadChannelTool/src/LArBadChannelDBAlg.cxx +++ b/LArCalorimeter/LArBadChannelTool/src/LArBadChannelDBAlg.cxx @@ -12,15 +12,15 @@ #include "StoreGate/StoreGate.h" #include "AthenaPoolUtilities/CondAttrListCollection.h" -//#include "LArRecConditions/ILArBadChanTool.h" -#include "LArBadChannelTool/LArBadChanTool.h" #include "LArBadChannelTool/LArBadChannelDBTools.h" +#include "LArIdentifier/LArOnlineID.h" + LArBadChannelDBAlg::LArBadChannelDBAlg(const std::string& name, ISvcLocator* pSvcLocator) : - AthAlgorithm( name, pSvcLocator), - m_BadChanTool("LArBadChanTool") + AthAlgorithm( name, pSvcLocator), m_BCKey("LArBadChannel"), m_BFKey("LArBadFeb") { - declareProperty("BadChannelTool", m_BadChanTool, "public, shared BadChannelTool"); + declareProperty("BadChanKey",m_BCKey); + declareProperty("MissingFEBKey",m_BFKey); declareProperty("DBFolder",m_dbFolder="/LAR/BadChannels/BadChannels"); declareProperty("FEBFolder",m_dbFebFolder="/LAR/BadChannels/MissingFEBs"); declareProperty("WritingMode",m_mode=0,"selects information written to DB: 0 for bad channels, 1 for missing febs"); @@ -33,9 +33,12 @@ StatusCode LArBadChannelDBAlg::initialize() { ATH_MSG_INFO ( "initialize()" ); - ATH_CHECK ( m_BadChanTool.retrieve() ); - ATH_MSG_INFO ( m_BadChanTool.propertyName() << ": Retrieved tool " - << m_BadChanTool.type() ); + if(m_mode==0) { + ATH_CHECK (m_BCKey.initialize() ); + } + if(m_mode==1) { + ATH_CHECK (m_BFKey.initialize() ); + } return StatusCode::SUCCESS; } @@ -43,20 +46,73 @@ StatusCode LArBadChannelDBAlg::execute() {return StatusCode::SUCCESS;} StatusCode LArBadChannelDBAlg::finalize() { - //if (m_mode == 0) { - ATH_MSG_INFO ( "Creating AttrListCollection in folder " << m_dbFolder ); + const DataHandle<LArOnlineID> onlineID; + ATH_CHECK( detStore()->retrieve(onlineID, "LArOnlineID") ); + if (m_mode == 0) { + SG::ReadCondHandle<LArBadChannelCont> readHandle{m_BCKey}; + const LArBadChannelCont *bcCont {*readHandle}; + if ( bcCont == nullptr) { + ATH_MSG_ERROR("Failed to retrieve BadChanCont with key "<<m_BCKey.key() ); + return StatusCode::FAILURE; + } + ATH_MSG_INFO ( "Creating AttrListCollection in folder " << m_dbFolder ); + LArBadChannelState bcState; + LArBadChannelState::CoolChannelEnum coolchan; + for (const auto& entry : bcCont->fullCont()) { + const HWIdentifier hid=HWIdentifier(entry.first); + if (onlineID->isEMBchannel(hid)) { + if (onlineID->pos_neg(hid)) + coolchan = LArBadChannelState::CoolChannelEnum::EMBC; + else + coolchan = LArBadChannelState::CoolChannelEnum::EMBA; + } else if (onlineID->isEMECchannel(hid)) { + if (onlineID->pos_neg(hid)) + coolchan = LArBadChannelState::CoolChannelEnum::EMECC; + else + coolchan = LArBadChannelState::CoolChannelEnum::EMECA; + } else if (onlineID->isHECchannel(hid)) { + if (onlineID->pos_neg(hid)) + coolchan = LArBadChannelState::CoolChannelEnum::HECC; + else + coolchan = LArBadChannelState::CoolChannelEnum::HECA; + } else if (onlineID->isFCALchannel(hid)) { + if (onlineID->pos_neg(hid)) + coolchan = LArBadChannelState::CoolChannelEnum::FCALC; + else + coolchan = LArBadChannelState::CoolChannelEnum::FCALA; + } else { + ATH_MSG_WARNING ( "Wrong bad channel Id" << hid ); + continue; + } + + bcState.add(LArBadChannelDBTools::BadChanEntry(hid,entry.second),coolchan); + } + CondAttrListCollection* attrListColl = - LArBadChannelDBTools::createCoolCollection( m_BadChanTool->fullState()); + LArBadChannelDBTools::createCoolCollection(bcState); ATH_CHECK( detStore()->record( attrListColl, m_dbFolder) ); ATH_MSG_INFO ( "Creating AthenaAttributeList in folder " << m_dbFebFolder ); - const LArBadChanTool::BadFebVec& febs = m_BadChanTool->fullBadFebsState(); + } + if (m_mode == 1) { + + SG::ReadCondHandle<LArBadFebCont> readHandle{m_BFKey}; + const LArBadFebCont *bfCont {*readHandle}; + if ( bfCont == nullptr) { + ATH_MSG_ERROR("Failed to retrieve BadFebCont with key "<<m_BFKey.key() ); + return StatusCode::FAILURE; + } + LArBadChannelDBTools::BadFebVec febs; + for (const auto& entry : bfCont->fullCont()) { + const HWIdentifier hid=HWIdentifier(entry.first); + febs.emplace_back(LArBadChannelDBTools::BadFebEntry(hid,entry.second)); + } if (!febs.empty()) { AthenaAttributeList* attrList = LArBadChannelDBTools::createFebPayload( febs); ATH_CHECK( detStore()->record( attrList, m_dbFebFolder) ); } - //} + } ATH_MSG_INFO ( "exiting finalize successfully " << m_dbFebFolder ); return StatusCode::SUCCESS; diff --git a/LArCalorimeter/LArBadChannelTool/src/LArBadChannelTimingAlg.cxx b/LArCalorimeter/LArBadChannelTool/src/LArBadChannelTimingAlg.cxx index cd57c3a3401..75a4231d1ee 100644 --- a/LArCalorimeter/LArBadChannelTool/src/LArBadChannelTimingAlg.cxx +++ b/LArCalorimeter/LArBadChannelTool/src/LArBadChannelTimingAlg.cxx @@ -10,7 +10,6 @@ #include "CoralBase/AttributeListSpecification.h" #include "AthenaPoolUtilities/AthenaAttributeList.h" -#include "LArBadChannelTool/LArBadChanTool.h" #include "LArBadChannelTool/LArBadChannelDBTools.h" #include "LArRecConditions/LArBadChanBitPacking.h" #include "CaloIdentifier/LArEM_ID.h" @@ -26,11 +25,11 @@ using namespace std; LArBadChannelTimingAlg::LArBadChannelTimingAlg(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm( name, pSvcLocator), - m_BadChanTool("LArBadChanTool"), + m_BCKey("LArBadChannel"), m_cellID(0), m_reallyCheck(true) { - declareProperty("BadChannelTool", m_BadChanTool, "public, shared BadChannelTool"); + declareProperty("BadChanKey", m_BCKey); declareProperty("ReallyCheck", m_reallyCheck); } @@ -42,9 +41,7 @@ StatusCode LArBadChannelTimingAlg::initialize() { ATH_MSG_INFO ( "initialize()" ); - ATH_CHECK( m_BadChanTool.retrieve() ); - ATH_MSG_INFO ( m_BadChanTool.propertyName() << ": Retrieved tool " - << m_BadChanTool.type() ); + ATH_CHECK( m_BCKey.initialize() ); ATH_CHECK( detStore()->retrieve(m_cellID,"CaloCell_ID") ); ATH_CHECK( detStore()->retrieve(m_onlineID, "LArOnlineID") ); @@ -71,7 +68,14 @@ void LArBadChannelTimingAlg::timeOnlineAccess() { long factor = ~(1<<31); factor = factor / m_onlineID->channelHashMax() + 1; - cout << "online random scaling factor " << factor << endl; + ATH_MSG_INFO( "online random scaling factor " << factor ); + + SG::ReadCondHandle<LArBadChannelCont> readHandle{m_BCKey}; + const LArBadChannelCont *bcCont {*readHandle}; + if(!bcCont) { + ATH_MSG_WARNING( "Do not have Bad chan container " << m_BCKey.key() ); + return; + } int nbad = 0; { @@ -80,19 +84,18 @@ void LArBadChannelTimingAlg::timeOnlineAccess() long rnd = random() / factor; // int arythmetic for speed to get a rnd channel hash HWIdentifier hid( m_hwarray.at(rnd)); if ( m_reallyCheck) { - if (!m_BadChanTool->status(hid).good()) nbad++; + if (!bcCont->status(hid).good()) nbad++; } else { if (rnd > 100000) nbad++; } } } - cout << "Number of randomly found online bad channels " << nbad << endl; + ATH_MSG_INFO( "Number of randomly found online bad channels " << nbad ); } void LArBadChannelTimingAlg::fillChannelArray() { - // cout << "channelHashMax " << m_onlineID->channelHashMax() << endl; m_hwarray.resize( m_onlineID->channelHashMax()+1); Chrono chrono( chronoSvc() , "fillChannelArray" ); @@ -103,8 +106,7 @@ void LArBadChannelTimingAlg::fillChannelArray() m_hwarray.at(hash) = hit->get_identifier32().get_compact(); } - cout << "m_hwarray.size() " << m_hwarray.size() - << " capacity " << m_hwarray.capacity() << endl; + ATH_MSG_INFO( "m_hwarray.size() " << m_hwarray.size() << " capacity " << m_hwarray.capacity() ); } @@ -120,9 +122,14 @@ void LArBadChannelTimingAlg::timeOfflineAccess() long factor = ~(1<<31); factor = factor / allIDs.size() + 1; - cout << "connected offline IDs " << allIDs.size() - << " offline random scaling factor " << factor << endl; - m_BadChanTool->offlineStatus( allIDs[0]); // first call takes much longer + ATH_MSG_INFO( "connected offline IDs " << allIDs.size() << " offline random scaling factor " << factor ); + SG::ReadCondHandle<LArBadChannelCont> readHandle{m_BCKey}; + const LArBadChannelCont *bcCont {*readHandle}; + if(!bcCont) { + ATH_MSG_WARNING( "Do not have Bad chan container " << m_BCKey.key() ); + return; + } + bcCont->offlineStatus( allIDs[0]); // first call takes much longer int nbad = 0; { @@ -131,14 +138,14 @@ void LArBadChannelTimingAlg::timeOfflineAccess() long rnd = random() / factor; // int arythmetic for speed to get a rnd channel hash Identifier id( allIDs.at(rnd)); if ( m_reallyCheck) { - if (!m_BadChanTool->offlineStatus(id).good()) nbad++; + if (!bcCont->offlineStatus(id).good()) nbad++; } else { if (rnd > 100000) nbad++; } } } - cout << "Number of randomly found offline bad channels " << nbad << endl; + ATH_MSG_INFO( "Number of randomly found offline bad channels " << nbad ); } @@ -153,6 +160,13 @@ void LArBadChannelTimingAlg::timeFEBAccess() long factor = ~(1<<31); factor = factor / febVec.size() + 1; + SG::ReadCondHandle<LArBadChannelCont> readHandle{m_BCKey}; + const LArBadChannelCont *bcCont {*readHandle}; + if(!bcCont) { + ATH_MSG_WARNING( "Do not have Bad chan container " << m_BCKey.key() ); + return; + } + int nbad = 0; { Chrono chrono( chronoSvc() , "BadChanByFEB" ); @@ -161,12 +175,12 @@ void LArBadChannelTimingAlg::timeFEBAccess() int rndFEB = rnd / factor; // int arythmetic for speed to get a rnd channel hash if ( m_reallyCheck) { - if (!m_BadChanTool->status( febVec.at(rndFEB), rnd & 127).good()) nbad++; + if (!bcCont->status(HWIdentifier( febVec.at(rndFEB).get_compact() + (rnd & 127))).good()) nbad++; } else { if (rnd > 100000) nbad++; } } } - cout << "Number of randomly found bad channels by FEB " << nbad << endl; + ATH_MSG_INFO( "Number of randomly found bad channels by FEB " << nbad ); } diff --git a/LArCalorimeter/LArBadChannelTool/src/LArBadChannelToolTest.cxx b/LArCalorimeter/LArBadChannelTool/src/LArBadChannelToolTest.cxx deleted file mode 100644 index 498a4aef749..00000000000 --- a/LArCalorimeter/LArBadChannelTool/src/LArBadChannelToolTest.cxx +++ /dev/null @@ -1,72 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "LArBadChannelToolTest.h" -#include "GaudiKernel/MsgStream.h" -#include "LArRecConditions/ILArBadChanTool.h" -#include "LArRecConditions/LArBadChanBitPacking.h" -#include "LArRecConditions/LArBadFebBitPacking.h" -#include "StoreGate/StoreGateSvc.h" - -LArBadChannelToolTest::LArBadChannelToolTest(const std::string& name, ISvcLocator* pSvcLocator) : - AthAlgorithm(name, pSvcLocator), - m_BadChanTool("LArBadChanTool"), - m_Check1( 939685120), - m_Check2( 944997120) -{ - declareProperty("BadChannelTool", m_BadChanTool, "public, shared BadChannelTool"); - declareProperty( "CheckChannel1", m_Check1); - declareProperty( "CheckChannel2", m_Check2); - -} - -StatusCode LArBadChannelToolTest::initialize() { - - ATH_MSG_INFO ( "initialize()" ); - - ATH_CHECK ( m_BadChanTool.retrieve() ); - ATH_MSG_INFO ( m_BadChanTool.propertyName() << ": Retrieved tool " - << m_BadChanTool.type() ); - ATH_CHECK( detStore()->retrieve(m_onlineID, "LArOnlineID") ); - return StatusCode::SUCCESS; -} - -StatusCode LArBadChannelToolTest::execute() { - - ATH_MSG_INFO ( "execute()" ); - - LArBadChanBitPacking packing; - - ATH_MSG_INFO ( "LArBadChannel status of channel " << m_Check1 << " is " - << m_BadChanTool->status(HWIdentifier(Identifier32(m_Check1))).packedData() ); - ATH_MSG_INFO ( "LArBadChannel status of channel " << m_Check2 << " is " - << m_BadChanTool->status(HWIdentifier(Identifier32(m_Check2))).packedData() ); - - std::vector<HWIdentifier>::const_iterator beg = m_onlineID->channel_begin(); - std::vector<HWIdentifier>::const_iterator end = m_onlineID->channel_end(); - for (;beg != end; ++beg) { - LArBadChannel stat = m_BadChanTool->status( *beg); - if ( !stat.good()) { - ATH_MSG_INFO ( "LArBadChannel status of channel " << *beg << " is " - << packing.stringStatus(stat) ); - } - } - - LArBadFebBitPacking febPacking; - std::vector<HWIdentifier> mfebs = m_BadChanTool->missingFEBs(); - for (std::vector<HWIdentifier>::const_iterator ifeb=mfebs.begin(); ifeb!=mfebs.end(); ifeb++) { - ATH_MSG_INFO ( "FEB " << *ifeb << " is considered missing" ); - } - - typedef const std::vector< std::pair<HWIdentifier,LArBadFeb> > BadFebVec; - const BadFebVec& badFebs = m_BadChanTool->fullBadFebsState(); - for (BadFebVec::const_iterator i=badFebs.begin(); i!=badFebs.end(); ++i) { - LArBadFeb stat = i->second; - ATH_MSG_INFO ( "LArBadFeb status of channel " << i->first << " is " - << febPacking.stringStatus(stat) ); - } - - return StatusCode::SUCCESS; -} - diff --git a/LArCalorimeter/LArBadChannelTool/src/LArBadChannelToolTest.h b/LArCalorimeter/LArBadChannelTool/src/LArBadChannelToolTest.h deleted file mode 100644 index 873768d00d5..00000000000 --- a/LArCalorimeter/LArBadChannelTool/src/LArBadChannelToolTest.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef LArBadChannelToolTest_H -#define LArBadChannelToolTest_H - -#include "AthenaBaseComps/AthAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" -#include "StoreGate/DataHandle.h" -#include "LArIdentifier/LArOnlineID.h" - -class ILArBadChanTool; - -class LArBadChannelToolTest : public AthAlgorithm { -public: - LArBadChannelToolTest( const std::string& name, ISvcLocator* pSvcLocator ); - StatusCode initialize(); - StatusCode execute(); - //StatusCode finalize(); - -private: - ToolHandle< ILArBadChanTool > m_BadChanTool; - const DataHandle<LArOnlineID> m_onlineID; - - int m_Check1; - int m_Check2; -}; - -#endif diff --git a/LArCalorimeter/LArBadChannelTool/src/LArBadFeb2Ascii.cxx b/LArCalorimeter/LArBadChannelTool/src/LArBadFeb2Ascii.cxx index 842483d7179..f971940146c 100644 --- a/LArCalorimeter/LArBadChannelTool/src/LArBadFeb2Ascii.cxx +++ b/LArCalorimeter/LArBadChannelTool/src/LArBadFeb2Ascii.cxx @@ -6,8 +6,6 @@ #include "StoreGate/StoreGate.h" -//#include "LArRecConditions/ILArBadChanTool.h" -#include "LArBadChannelTool/LArBadChanTool.h" #include "LArBadChannelTool/LArBadChannelDBTools.h" #include "LArIdentifier/LArOnlineID.h" #include <fstream> diff --git a/LArCalorimeter/LArBadChannelTool/src/components/LArBadChannelTool_entries.cxx b/LArCalorimeter/LArBadChannelTool/src/components/LArBadChannelTool_entries.cxx index 11d0ef512da..06163018eab 100644 --- a/LArCalorimeter/LArBadChannelTool/src/components/LArBadChannelTool_entries.cxx +++ b/LArCalorimeter/LArBadChannelTool/src/components/LArBadChannelTool_entries.cxx @@ -1,8 +1,5 @@ -#include "../LArBadChannelToolTest.h" - - +#include "LArBadChannelTool/LArBadChanLegacyTool.h" #include "LArBadChannelTool/LArBadChannelMasker.h" -#include "LArBadChannelTool/LArBadChanTool.h" #include "LArBadChannelTool/LArBadChannelDBAlg.h" #include "LArBadChannelTool/LArBadChannelTimingAlg.h" #include "LArBadChannelTool/LArBadChannel2Ascii.h" @@ -10,9 +7,8 @@ #include "LArBadChannelTool/LArBadChannelCondAlg.h" #include "LArBadChannelTool/LArBadFebCondAlg.h" +DECLARE_COMPONENT( LArBadChanLegacyTool ) DECLARE_COMPONENT( LArBadChannelMasker ) -DECLARE_COMPONENT( LArBadChanTool ) -DECLARE_COMPONENT( LArBadChannelToolTest ) DECLARE_COMPONENT( LArBadChannelDBAlg ) DECLARE_COMPONENT( LArBadChannelTimingAlg ) DECLARE_COMPONENT( LArBadChannel2Ascii ) diff --git a/LArCalorimeter/LArCafJobs/LArCafJobs/LArNoiseBursts.h b/LArCalorimeter/LArCafJobs/LArCafJobs/LArNoiseBursts.h index e0bdca2f02e..df2726aef18 100755 --- a/LArCalorimeter/LArCafJobs/LArCafJobs/LArNoiseBursts.h +++ b/LArCalorimeter/LArCafJobs/LArCafJobs/LArNoiseBursts.h @@ -22,7 +22,7 @@ //#include "Identifier/HWIdentifier.h" //#include "LArElecCalib/ILArPedestal.h" //#include "LArRecConditions/ILArBadChannelMasker.h" -#include "LArBadChannelTool/LArBadChanTool.h" +#include "LArRecConditions/LArBadChannelCont.h" #include "CaloInterface/ICaloNoiseTool.h" #include "CaloInterface/ICalorimeterNoiseTool.h" #include "TrigAnalysisInterfaces/IBunchCrossingTool.h" @@ -92,7 +92,7 @@ class LArNoiseBursts : public AthAlgorithm { int GetPartitionLayerIndex(const Identifier& id); std::vector<int>* GetHVLines(const Identifier& id); - StatusCode fillCell(HWIdentifier onlID, float eCalo, float qfactor, CaloGain::CaloGain gain, const LArOnOffIdMapping* cabling); + StatusCode fillCell(HWIdentifier onlID, float eCalo, float qfactor, CaloGain::CaloGain gain, const LArOnOffIdMapping* cabling, const LArBadChannelCont* bcCont); private: @@ -101,10 +101,10 @@ class LArNoiseBursts : public AthAlgorithm { TTree* m_tree; SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey { this, "CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}; + SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey { this, "BadChanKey","LArBadChannel","SG Key of LArBadChannelCont object"}; /*Tools*/ ToolHandle<ICaloNoiseTool> m_calo_noise_tool; ToolHandle<Trig::IBunchCrossingTool> m_bc_tool; - ToolHandle<ILArBadChanTool> m_badchan_tool; ToolHandle< Trig::TrigDecisionTool > m_trigDec; diff --git a/LArCalorimeter/LArCafJobs/LArCafJobs/LArShapeDumper.h b/LArCalorimeter/LArCafJobs/LArCafJobs/LArShapeDumper.h index 810e432dd09..efcc0e6fc3c 100755 --- a/LArCalorimeter/LArCafJobs/LArCafJobs/LArShapeDumper.h +++ b/LArCalorimeter/LArCafJobs/LArCafJobs/LArShapeDumper.h @@ -17,7 +17,6 @@ #include "LArRawEvent/LArRawChannelContainer.h" #include "LArCafJobs/DataStore.h" #include "LArRawConditions/LArPhysWaveContainer.h" -#include "LArCabling/LArCablingService.h" #include "CaloIdentifier/LArEM_ID.h" #include "CaloIdentifier/LArHEC_ID.h" #include "CaloIdentifier/LArFCAL_ID.h" @@ -34,11 +33,14 @@ #include "TrigConfInterfaces/ITrigConfigSvc.h" #include "TrigAnalysisInterfaces/IBunchCrossingTool.h" #include "LArCafJobs/ILArShapeDumperTool.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArBadChannelCont.h" +#include "LArCabling/LArOnOffIdMapping.h" + class MsgStream; class StoreGateSvc; class ILArPedestal; -class ILArBadChanTool; class CaloDetDescrManager; class ILArBadChannelMasker; class ILArADC2MeVTool; @@ -96,14 +98,14 @@ class LArShapeDumper : public AthAlgorithm std::vector<std::string> m_triggerNames; ToolHandle<ILArShapeDumperTool> m_dumperTool; - ToolHandle<LArCablingService> m_larCablingSvc; ToolHandle <ICaloNoiseTool> m_caloNoiseTool; - ToolHandle<ILArBadChanTool> m_badChannelTool; ToolHandle<ILArBadChannelMasker> m_badChannelMasker; ToolHandle<ILArADC2MeVTool> m_adc2mevTool; // ToolHandle<LArOFPeakRecoTool> m_peakReco; ToolHandle<Trig::TrigDecisionTool> m_trigDec; + SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}; + SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey{this, "BadChanKey", "LArBadChannel", "SG bad channels key"}; ServiceHandle<TrigConf::ITrigConfigSvc> m_configSvc; // for tests... diff --git a/LArCalorimeter/LArCafJobs/src/LArNoiseBursts.cxx b/LArCalorimeter/LArCafJobs/src/LArNoiseBursts.cxx index f0a3119c8ba..a4344ed6148 100644 --- a/LArCalorimeter/LArCafJobs/src/LArNoiseBursts.cxx +++ b/LArCalorimeter/LArCafJobs/src/LArNoiseBursts.cxx @@ -124,7 +124,6 @@ LArNoiseBursts::LArNoiseBursts(const std::string& name, m_tree(0), m_calo_noise_tool("CaloNoiseTool/CaloNoiseToolDefault"), m_bc_tool("Trig::TrigConfBunchCrossingTool/BunchCrossingTool"), - m_badchan_tool("LArBadChanTool"), m_trigDec( "Trig::TrigDecisionTool/TrigDecisionTool" ), m_LArOnlineIDHelper(0), m_LArHVLineIDHelper(0), @@ -252,7 +251,6 @@ LArNoiseBursts::LArNoiseBursts(const std::string& name, declareProperty( "ICaloNoiseTool", m_calo_noise_tool ); declareProperty( "BCTool", m_bc_tool ); // declareProperty( "SCTClusteringTool",m_sctclustering_tool); - declareProperty( "ILArBadChanTool", m_badchan_tool ); //event cuts declareProperty("SigmaCut", m_sigmacut = 3.0); @@ -309,6 +307,7 @@ StatusCode LArNoiseBursts::initialize() { } ATH_CHECK( m_cablingKey.initialize() ); + ATH_CHECK( m_BCKey.initialize() ); // Retrieve online ID helper const DataHandle<LArOnlineID> LArOnlineIDHelper; @@ -340,11 +339,6 @@ StatusCode LArNoiseBursts::initialize() { ATH_MSG_INFO ( "Retrieved tool " << m_calo_noise_tool ); } - if(m_bc_tool.retrieve().isFailure()){ - ATH_MSG_WARNING ( "Failed to retrieve tool " << m_bc_tool ); - }else{ - ATH_MSG_INFO ( "Retrieved tool " << m_bc_tool ); - } /** get a handle on the NTuple and histogramming service */ ATH_CHECK( service("THistSvc", m_thistSvc) ); @@ -995,6 +989,13 @@ StatusCode LArNoiseBursts::doLArNoiseBursts(){ return StatusCode::SUCCESS; } + SG::ReadCondHandle<LArBadChannelCont> bcHdl(m_BCKey); + const LArBadChannelCont* bcCont=*bcHdl; + if(!bcCont) { + ATH_MSG_WARNING("Do not have bad chan info, not storing LarCellInfo "); + return StatusCode::SUCCESS; + } + // Retrieve LAr calocells container // or LArRawChannel container, whatsever available... const CaloCellContainer* caloTES=0; @@ -1049,7 +1050,7 @@ StatusCode LArNoiseBursts::doLArNoiseBursts(){ qfactor = (*caloItr)->quality(); gain = (*caloItr)->gain(); //if(qfactor > 0. || (*caloItr)->ID() == Identifier((IDENTIFIER_TYPE)0x33c9500000000000) ) ATH_MSG_DEBUG((*caloItr)->ID()<<" : "<<eCalo<<" "<<qfactor<<" "<<gain<<" prov.: "<<(*caloItr)->provenance()); - ATH_CHECK(fillCell(onlID, eCalo, qfactor, gain, cabling)); + ATH_CHECK(fillCell(onlID, eCalo, qfactor, gain, cabling, bcCont)); }//loop over cells ATH_MSG_DEBUG("Done cells "<<nlarcell); } else { @@ -1064,7 +1065,7 @@ StatusCode LArNoiseBursts::doLArNoiseBursts(){ qfactor = caloItr->quality(); gain = caloItr->gain(); //if(qfactor>0 || cabling->cnvToIdentifier((*caloItr).identify()) == Identifier((IDENTIFIER_TYPE)0x33c9500000000000) ) ATH_MSG_DEBUG(cabling->cnvToIdentifier((*caloItr).identify())<<" : "<<eCalo<<" "<<qfactor<<" "<<gain); - ATH_CHECK(fillCell(onlID, eCalo, qfactor, gain, cabling)); + ATH_CHECK(fillCell(onlID, eCalo, qfactor, gain, cabling, bcCont)); chdone.push_back(onlID); }//loop over raw channels } @@ -1081,7 +1082,7 @@ StatusCode LArNoiseBursts::doLArNoiseBursts(){ qfactor = caloItr->quality(); gain = caloItr->gain(); //if(qfactor>0 || cabling->cnvToIdentifier((*caloItr).identify()) == Identifier((IDENTIFIER_TYPE)0x33c9500000000000) ) ATH_MSG_DEBUG(cabling->cnvToIdentifier((*caloItr).identify())<<" : "<<eCalo<<" "<<qfactor<<" "<<gain); - ATH_CHECK(fillCell(onlID, eCalo, qfactor, gain, cabling)); + ATH_CHECK(fillCell(onlID, eCalo, qfactor, gain, cabling, bcCont)); }//loop over raw channels } ATH_MSG_DEBUG("Done raw chan. "<<nlarcell); @@ -1206,7 +1207,7 @@ StatusCode LArNoiseBursts::doLArNoiseBursts(){ } -StatusCode LArNoiseBursts::fillCell(HWIdentifier onlID, float eCalo, float qfactor, CaloGain::CaloGain gain, const LArOnOffIdMapping* cabling){ +StatusCode LArNoiseBursts::fillCell(HWIdentifier onlID, float eCalo, float qfactor, CaloGain::CaloGain gain, const LArOnOffIdMapping* cabling, const LArBadChannelCont* bcCont){ const Identifier idd = cabling->cnvToIdentifier(onlID); nlarcell++; IdentifierHash channelHash = m_LArOnlineIDHelper->channel_Hash(onlID); @@ -1220,7 +1221,7 @@ StatusCode LArNoiseBursts::fillCell(HWIdentifier onlID, float eCalo, float qfact //float noise = m_calo_noise_tool->elecNoiseRMS( caloDDE, gain, -1); float significance = eCalo / noise ; float eta = caloDDE->eta(); - bool badcell = ! (m_badchan_tool->status(onlID)).good(); + bool badcell = ! (bcCont->status(onlID)).good(); unsigned int partition = 0; bool is_lar_em_barrel = caloDDE->is_lar_em_barrel(); if(is_lar_em_barrel){ diff --git a/LArCalorimeter/LArCafJobs/src/LArShapeDumper.cxx b/LArCalorimeter/LArCafJobs/src/LArShapeDumper.cxx index f5ad85e8f2b..c991048d7b8 100755 --- a/LArCalorimeter/LArCafJobs/src/LArShapeDumper.cxx +++ b/LArCalorimeter/LArCafJobs/src/LArShapeDumper.cxx @@ -19,7 +19,6 @@ #include "LArRawConditions/LArAutoCorrComplete.h" #include "LArRecConditions/ILArBadChannelMasker.h" #include "LArElecCalib/ILArADC2MeVTool.h" -#include "LArRecConditions/ILArBadChanTool.h" #include "CaloDetDescr/CaloDetDescrManager.h" #include "CaloDetDescr/CaloDetDescriptor.h" @@ -67,9 +66,7 @@ LArShapeDumper::LArShapeDumper(const std::string & name, ISvcLocator * pSvcLocat m_nLArError(0), m_nNoDigits(0), m_dumperTool("LArShapeDumperTool"), - m_larCablingSvc("LArCablingService"), m_caloNoiseTool("CaloNoiseToolDefault"), - m_badChannelTool("LArBadChanTool"), m_badChannelMasker("BadChannelMasker", this), m_adc2mevTool("LArADC2MeVTool"), m_trigDec("Trig::TrigDecisionTool/TrigDecisionTool"), @@ -96,7 +93,6 @@ LArShapeDumper::LArShapeDumper(const std::string & name, ISvcLocator * pSvcLocat declareProperty("Gains", m_gainSpec = "HIGH,MEDIUM,LOW"); declareProperty("DumpDisconnected", m_dumpDisc = false); declareProperty("CaloNoiseTool", m_caloNoiseTool); - declareProperty("BadChannelTool", m_badChannelTool), declareProperty("BadChannelMasker", m_badChannelMasker); declareProperty("ADC2MeVTool", m_adc2mevTool); declareProperty("BunchCrossingTool",m_bcidTool); @@ -124,11 +120,12 @@ StatusCode LArShapeDumper::initialize() m_samples = new DataStore(); - ATH_CHECK( m_larCablingSvc.retrieve() ); + ATH_CHECK( m_cablingKey.initialize() ); + ATH_CHECK( m_BCKey.initialize() ); + ATH_CHECK( m_badChannelMasker.retrieve() ); ATH_CHECK( m_adc2mevTool.retrieve() ); ATH_CHECK( m_caloNoiseTool.retrieve() ); - ATH_CHECK( m_badChannelTool.retrieve() ); ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") ); ATH_CHECK( detStore()->retrieve(m_caloDetDescrMgr) ); @@ -307,6 +304,13 @@ StatusCode LArShapeDumper::execute() ATH_CHECK( detStore()->retrieve(m_larPedestal) ); + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling=*cablingHdl; + if(!cabling) { + ATH_MSG_ERROR( "Do not have cabling object LArOnOffIdMapping" ); + return StatusCode::FAILURE; + } + const LArOFIterResultsContainer* ofIterResult = 0; if (m_doOFCIter) { ATH_CHECK( evtStore()->retrieve(ofIterResult, "LArOFIterResult") ); @@ -336,7 +340,7 @@ StatusCode LArShapeDumper::execute() CellInfo* info = 0; if (!histCont) { HWIdentifier channelID = channel->hardwareID(); - const Identifier id = m_larCablingSvc->cnvToIdentifier(channelID); + const Identifier id = cabling->cnvToIdentifier(channelID); const CaloDetDescrElement* caloDetElement = m_caloDetDescrMgr->get_element(id); info = m_dumperTool->makeCellInfo(channelID, id, caloDetElement); if (!info) continue; @@ -354,6 +358,13 @@ StatusCode LArShapeDumper::execute() ATH_MSG_INFO ( "njpbSizes : " << larDigitContainer->size() << " " << (ofIterResult ? ofIterResult->size() : 0) << " " << rawChannelContainer->size() << " " << channelsToKeep.size() ); + + SG::ReadCondHandle<LArBadChannelCont> readHandle{m_BCKey}; + const LArBadChannelCont *bcCont {*readHandle}; + if(!bcCont) { + ATH_MSG_ERROR( "Do not have Bad chan container " << m_BCKey.key() ); + return StatusCode::FAILURE; + } for (LArDigitContainer::const_iterator digit = larDigitContainer->begin(); digit != larDigitContainer->end(); ++digit) @@ -376,7 +387,7 @@ StatusCode LArShapeDumper::execute() if (gain >= CaloGain::LARNGAIN || m_gains[gain] == false) continue; //Check if connected - const bool connected = m_larCablingSvc->isOnlineConnected(channelID); + const bool connected = cabling->isOnlineConnected(channelID); if (!connected && !m_dumpDisc) continue; // Check ADCMax selection @@ -392,7 +403,7 @@ StatusCode LArShapeDumper::execute() if (m_noiseSignifCut > 0 && fabs(maxValue) < pedestalRMS*m_noiseSignifCut) continue; } - const Identifier id = m_larCablingSvc->cnvToIdentifier(channelID); + const Identifier id = cabling->cnvToIdentifier(channelID); const CaloDetDescrElement* caloDetElement = 0; HistoryContainer* histCont = m_samples->hist_cont(hash); @@ -411,7 +422,7 @@ StatusCode LArShapeDumper::execute() if (connected) { if (!caloDetElement) caloDetElement = m_caloDetDescrMgr->get_element(id); noise = m_caloNoiseTool->getNoise(caloDetElement, ICalorimeterNoiseTool::TOTALNOISE); - status = m_badChannelTool->status(channelID).packedData(); + status = bcCont->status(channelID).packedData(); HWIdentifier febId = m_onlineHelper->feb_Id(m_onlineHelper->feedthrough_Id(channelID), m_onlineHelper->slot(channelID)); std::map<unsigned int,uint16_t>::const_iterator findError = febErrorMap.find(febId.get_identifier32().get_compact()); if (findError != febErrorMap.end()) { diff --git a/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArAutoCorrValidationAlg.h b/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArAutoCorrValidationAlg.h index 6e77c746e80..6f8698a099a 100644 --- a/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArAutoCorrValidationAlg.h +++ b/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArAutoCorrValidationAlg.h @@ -42,10 +42,10 @@ class LArAutoCorrValidationAlg: public LArAutoCorrValidationBase private: /** @brief Method to validate readout channels */ - bool validateChannel(const LArCondObj& ref, const LArCondObj& val, const HWIdentifier chid, const int gain); + bool validateChannel(const LArCondObj& ref, const LArCondObj& val, const HWIdentifier chid, const int gain, const LArOnOffIdMapping *cabling,const LArBadChannelCont *bcCont); /** @brief Summary method executed after the loop over all channels */ - StatusCode summary(); + StatusCode summary(const LArOnOffIdMapping *cabling,const LArBadChannelCont *bcCont); /** @brief Executed before the loop over all channels to reset global sums */ StatusCode preLoop(); @@ -68,7 +68,7 @@ class LArAutoCorrValidationAlg: public LArAutoCorrValidationBase //The following is for keeping track of entire FEBs /** @brief Method to compare FEB averages */ - bool febSummary(); + bool febSummary(const LArOnOffIdMapping *cabling,const LArBadChannelCont *bcCont); class DataPerFEB { public: diff --git a/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArBadChannelHunter.h b/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArBadChannelHunter.h index 00e5717d2f7..e2c3f6c0ade 100644 --- a/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArBadChannelHunter.h +++ b/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArBadChannelHunter.h @@ -21,10 +21,13 @@ #include "AthenaBaseComps/AthAlgorithm.h" #include "GaudiKernel/ToolHandle.h" -#include "LArRecConditions/ILArBadChanTool.h" #include "CaloIdentifier/CaloGain.h" -class LArCablingService; +#include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArBadChannelCont.h" +#include "LArCabling/LArOnOffIdMapping.h" +#include "LArRecConditions/LArCalibLineMapping.h" + class LArOnlineID; class CaloCell_ID; @@ -64,11 +67,10 @@ private: const LArOnlineID* m_onlineId; const CaloCell_ID* m_caloId; - /** Handle to bad-channel tool (job-Propety */ - ToolHandle<ILArBadChanTool> m_badChannelTool; - /** Handle to LArCablingService */ - ToolHandle<LArCablingService> m_larCablingSvc; + SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}; + SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey{this, "BadChanKey", "LArBadChannel", "SG bad channels key"}; + SG::ReadCondHandleKey<LArCalibLineMapping> m_CLKey{this, "CalibLineKey", "LArCalibLineMap", "SG calib line key"}; std::string m_pedKey, m_caliWaveKey; std::string m_avgTypeProp; @@ -95,9 +97,9 @@ private: AvgType m_avgType; - const std::string channelDescription(const HWIdentifier& chid, const unsigned gain=99) const; + const std::string channelDescription(const HWIdentifier& chid, const LArOnOffIdMapping *cabling, const unsigned gain=99) const; - unsigned getSymId(const HWIdentifier) const; + unsigned getSymId(const HWIdentifier, const LArOnOffIdMapping *cabling) const; class Average { public: diff --git a/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArCaliWaveValidationAlg.h b/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArCaliWaveValidationAlg.h index c9e5dbd63db..9de777df71d 100644 --- a/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArCaliWaveValidationAlg.h +++ b/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArCaliWaveValidationAlg.h @@ -44,10 +44,10 @@ class LArCaliWaveValidationAlg: public LArCaliWaveValidationBase { private: /** @brief Method to validate the pedestal single readout channels */ - bool validateChannel(const LArCondObj& ref, const LArCondObj& val, const HWIdentifier chid, const int gain); + bool validateChannel(const LArCondObj& ref, const LArCondObj& val, const HWIdentifier chid, const int gain, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont); /** @brief Summary method executed after the loop over all channels */ - StatusCode summary(); + StatusCode summary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont); /** @brief Executed before the loop over all channels to reset global sums */ StatusCode preLoop(); @@ -73,7 +73,7 @@ class LArCaliWaveValidationAlg: public LArCaliWaveValidationBase { //The following is for keeping track of entire FEBs /** @brief Method to compare FEB averages */ - bool febSummary(); + bool febSummary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont); class DataPerFEB { public: diff --git a/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArCalibValidationAlg.h b/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArCalibValidationAlg.h index f8a976408a5..d8dcd486d45 100644 --- a/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArCalibValidationAlg.h +++ b/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArCalibValidationAlg.h @@ -24,10 +24,13 @@ #include "AthenaBaseComps/AthAlgorithm.h" #include "GaudiKernel/ToolHandle.h" #include "LArRecConditions/ILArBadChannelMasker.h" -#include "LArRecConditions/ILArBadChanTool.h" -#include "LArCabling/LArCablingService.h" #include "StoreGate/StoreGateSvc.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArBadChannelCont.h" +#include "LArCabling/LArOnOffIdMapping.h" +#include "LArRecConditions/LArCalibLineMapping.h" + #include "CaloIdentifier/CaloGain.h" @@ -93,7 +96,7 @@ protected: * @param gain Gain in question * This method needs to be implemeted by the deriving algorithm */ - virtual bool validateChannel(const LArCondObj& ref, const LArCondObj& val, const HWIdentifier chid, const int gain)=0; + virtual bool validateChannel(const LArCondObj& ref, const LArCondObj& val, const HWIdentifier chid, const int gain, const LArOnOffIdMapping *cabling,const LArBadChannelCont *bcCont)=0; /** * @brief Method executed after the loop over all channels @@ -102,7 +105,7 @@ protected: * newly found bad channels. * The return value of this method is also the return value of the @c finalize method. */ - virtual StatusCode summary(); + virtual StatusCode summary(const LArOnOffIdMapping *cabling,const LArBadChannelCont *bcCont); /** * @brief Textual representation of gain and location of a certain cell or FEB @@ -113,7 +116,7 @@ protected: * Creates a string containing the Side, Barrel-EC, FT, Slot, * FEB-Channel in human-readable form */ - const std::string channelDescription(const HWIdentifier& chid, const unsigned gain=99, bool isFeb=false) const; + const std::string channelDescription(const HWIdentifier& chid, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont, const unsigned gain=99, bool isFeb=false) const; private: @@ -122,13 +125,13 @@ private: * @return False if at least one incomplete COOL channel is found, true otherwise * Calls @c patchMissingFEBs if @c m_patchMissingFebs is true */ - bool checkCoolChannelCompleteness(); + bool checkCoolChannelCompleteness(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont); /** * @brief Verify if all COOL channels in the ref container are also in val * @return False if at least one incomplete COOL channel is found, true otherwise */ - bool checkNumberOfCoolChannels() const; + bool checkNumberOfCoolChannels(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont) const; typedef std::vector<std::pair<HWIdentifier,unsigned> > FEBANDGAIN_t; /** @@ -138,11 +141,11 @@ private: * Inserts the corresponding channel from the reference container * as correction channel to the validation container */ - bool patchMissingFEBs(const FEBANDGAIN_t& febAndGain); + bool patchMissingFEBs(const FEBANDGAIN_t& febAndGain, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont); void febOutput(const HWIdentifier& febid, const unsigned gain, const unsigned nGood, const unsigned nBad); - void findFailedPatterns(); + void findFailedPatterns(const LArOnOffIdMapping *cabling,const LArBadChannelCont *bcCont); std::vector<std::string> m_gainMap; @@ -152,11 +155,12 @@ protected: int m_myMsgLvlProp; - /** Handle to bad-channel tool (job-Propety */ - ToolHandle<ILArBadChanTool> m_badChannelTool; ToolHandle<ILArBadChannelMasker> m_badChanMaskingTool; - /** Handle to LArCablingService */ - ToolHandle<LArCablingService> m_larCablingSvc; + + SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}; + SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey{this, "BadChanKey", "LArBadChannel", "SG bad channels key"}; + SG::ReadCondHandleKey<LArCalibLineMapping> m_CLKey{this, "CalibLineKey", "LArCalibLineMap", "SG calib line key"}; + // Pointers to various identifier helper classes, not used her, but // probably useful for deriving algorithm diff --git a/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArCalibValidationAlg.icc b/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArCalibValidationAlg.icc index 65b221a6fc2..fa5d5b33e89 100644 --- a/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArCalibValidationAlg.icc +++ b/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArCalibValidationAlg.icc @@ -10,10 +10,7 @@ template<class CONDITIONSCONTAINER> LArCalibValidationAlg<CONDITIONSCONTAINER>::LArCalibValidationAlg (const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name,pSvcLocator), m_myMsgLvl(MSG::ERROR), - //m_badChannelTool("LArBadChanTool"), - m_badChannelTool("LArBadChanTool"), m_badChanMaskingTool("LArBadChannelMasker"), - m_larCablingSvc("LArCablingService"), m_onlineHelper(NULL),m_emId(NULL),m_hecId(NULL),m_fcalId(NULL),m_caloId(NULL), m_reference(NULL),m_validation(NULL),m_nc_validation(NULL), m_nChecked(0),m_nFailedValidation(0),m_nValidated(0),m_nBad(0),m_nNoReference(0) { @@ -75,6 +72,9 @@ template<class CONDITIONSCONTAINER> StatusCode LArCalibValidationAlg<CONDITIONSCONTAINER>::initialize() { m_myMsgLvl=MSG::Level(m_myMsgLvlProp); if (m_patchMissingFEBs) m_checkCompleteness=true; + ATH_CHECK(m_cablingKey.initialize()); + if (m_useBCInfo) ATH_CHECK(m_BCKey.initialize()); + ATH_CHECK(m_CLKey.initialize()); return StatusCode::SUCCESS; } @@ -89,13 +89,23 @@ StatusCode LArCalibValidationAlg<CONDITIONSCONTAINER>::stop() { ATH_CHECK( detStore()->retrieve(m_caloId, "CaloCell_ID") ); /// Get bad-channel tool + const LArOnOffIdMapping* cabling=nullptr; if (m_useBCInfo) { ATH_CHECK( m_badChanMaskingTool.retrieve() ); - ATH_CHECK( m_badChannelTool.retrieve() ); + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + cabling=*cablingHdl; + if(!cabling) { + ATH_MSG_ERROR( "Do not have cabling !" ); + return StatusCode::FAILURE; + } } - ATH_CHECK( m_larCablingSvc.retrieve() ); - + SG::ReadCondHandle<LArBadChannelCont> readHandle{m_BCKey}; + const LArBadChannelCont *bcCont {*readHandle}; + if(!bcCont) { + ATH_MSG_ERROR( "Do not have Bad chan container !!!" ); + return StatusCode::FAILURE; + } /// Open files for text output if (m_chanFileName.size()>0) { @@ -163,30 +173,30 @@ StatusCode LArCalibValidationAlg<CONDITIONSCONTAINER>::stop() { for (;it!=it_e;it++) { const HWIdentifier chid = it.channelId(); // ignore empty or disconnected instances - if (it->isEmpty() || !m_larCablingSvc->isOnlineConnected(chid)) continue; + if (it->isEmpty() || !cabling->isOnlineConnected(chid)) continue; ++m_nChecked; if (m_useBCInfo) { if (m_badChanMaskingTool->cellShouldBeMasked(chid,igain)) { - ATH_MSG_DEBUG ( channelDescription(chid,igain) << " known to be bad by bad-channel tool. Ignore." ) ; + ATH_MSG_DEBUG ( channelDescription(chid,cabling,bcCont,igain) << " known to be bad by bad-channel tool. Ignore." ) ; ++m_nBad; continue; } } - //ATH_MSG_INFO( "Working on " << channelDescription(chid,gain) ); + //ATH_MSG_INFO( "Working on " << channelDescription(chid,cabling,bcCont,gain) ); const LArCondObj& val=*it; const LArCondObj& ref=m_reference->get(chid,igain); //Check if we actually got a reference channel. //If not: Consider as an error because we can't validate! if (ref.isEmpty()) { - ATH_MSG_ERROR ( "Reference for " << channelDescription(chid,igain) << " is empty!" ) ; + ATH_MSG_ERROR ( "Reference for " << channelDescription(chid,cabling,bcCont,igain) << " is empty!" ) ; //Report als missing reference as 'bad' for feb-summary m_checkedIds[igain].push_back(std::make_pair(chid,false)); ++m_nNoReference; continue; } //Call the overloaded validation method for an individual channel - const bool isGood=validateChannel(ref,val,chid,igain); + const bool isGood=validateChannel(ref,val,chid,igain,cabling,bcCont); m_checkedIds[igain].push_back(std::make_pair(chid,isGood)); if (isGood) ++m_nValidated; @@ -198,13 +208,13 @@ StatusCode LArCalibValidationAlg<CONDITIONSCONTAINER>::stop() { }//end loop over container }//end loop over gain - if (m_checkCompleteness) checkCoolChannelCompleteness(); + if (m_checkCompleteness) checkCoolChannelCompleteness(cabling,bcCont); - if (m_checkNumberOfCoolChannels) checkNumberOfCoolChannels(); + if (m_checkNumberOfCoolChannels) checkNumberOfCoolChannels(cabling,bcCont); //call summary method - findFailedPatterns(); - StatusCode sc=summary(); + findFailedPatterns(cabling, bcCont); + StatusCode sc=summary(cabling, bcCont); if (m_febFile.is_open()) m_febFile.close(); if (m_chanFile.is_open()) m_chanFile.close(); @@ -221,7 +231,7 @@ StatusCode LArCalibValidationAlg<CONDITIONSCONTAINER>::preLoop() { template<class CONDITIONSCONTAINER> -StatusCode LArCalibValidationAlg<CONDITIONSCONTAINER>::summary() { +StatusCode LArCalibValidationAlg<CONDITIONSCONTAINER>::summary(const LArOnOffIdMapping */*cabling*/, const LArBadChannelCont */*bcCont*/) { ATH_MSG_INFO ( "Checked " << m_nChecked << " channels from container \"" << m_validationKey << "\" against container \"" << m_referenceKey << "\"" ) ; @@ -250,7 +260,13 @@ StatusCode LArCalibValidationAlg<CONDITIONSCONTAINER>::summary() { template<class CONDITIONSCONTAINER> -void LArCalibValidationAlg<CONDITIONSCONTAINER>::findFailedPatterns() { +void LArCalibValidationAlg<CONDITIONSCONTAINER>::findFailedPatterns(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont) { + SG::ReadCondHandle<LArCalibLineMapping> clHdl{m_CLKey}; + const LArCalibLineMapping *clCont {*clHdl}; + if(!clCont) { + ATH_MSG_ERROR( "Do not have calib line mapping !!!" ); + return; + } unsigned gain=0; std::vector<CHECKEDID_t>::const_iterator it_gain=m_checkedIds.begin(); std::vector<CHECKEDID_t>::const_iterator it_gain_e=m_checkedIds.end(); @@ -277,7 +293,7 @@ void LArCalibValidationAlg<CONDITIONSCONTAINER>::findFailedPatterns() { statiPerFEB[febId].second++; //Fill channel status per calibLine - const std::vector<HWIdentifier>& calibIdvec=m_larCablingSvc->calibSlotLine(chid); + const std::vector<HWIdentifier>& calibIdvec=clCont->calibSlotLine(chid); for (std::vector<HWIdentifier>::const_iterator itc=calibIdvec.begin(); itc!=calibIdvec.end();itc++) if (isGood) statiPerCalibLine[*itc].first++; @@ -293,7 +309,7 @@ void LArCalibValidationAlg<CONDITIONSCONTAINER>::findFailedPatterns() { const float badFrac=float(itFEB->second.second)/(itFEB->second.first+itFEB->second.second); febOutput(itFEB->first,gain, itFEB->second.first,itFEB->second.second); if (m_printFailedPattern && badFrac>0.2) - msg() << m_myMsgLvl << channelDescription(itFEB->first,gain,true) << " has " << badFrac*100 << "% suspicious channels" << endmsg; + msg() << m_myMsgLvl << channelDescription(itFEB->first,cabling,bcCont,gain,true) << " has " << badFrac*100 << "% suspicious channels" << endmsg; } @@ -304,7 +320,7 @@ void LArCalibValidationAlg<CONDITIONSCONTAINER>::findFailedPatterns() { COUNTING_t::const_iterator itCalibLine_e=statiPerCalibLine.end(); for (;itCalibLine!=itCalibLine_e;++itCalibLine) { if (itCalibLine->second.second>=itCalibLine->second.first) {//if at least half of the readout channels belonging to a calib-line are suspicious.. - (*m_log) << m_myMsgLvl << channelDescription(itCalibLine->first,gain) <<": " << itCalibLine->second.second + (*m_log) << m_myMsgLvl << channelDescription(itCalibLine->first,cabling,bcCont,gain) <<": " << itCalibLine->second.second << " channels out of " << itCalibLine->second.first+itCalibLine->second.second << " are suspicious." << endmsg; } } @@ -344,6 +360,8 @@ void LArCalibValidationAlg<CONDITIONSCONTAINER>::febOutput(const HWIdentifier& f template<class CONDITIONSCONTAINER> const std::string LArCalibValidationAlg<CONDITIONSCONTAINER>::channelDescription(const HWIdentifier& chid, + const LArOnOffIdMapping *cabling, + const LArBadChannelCont *bcCont, const unsigned gain, bool isFeb) const { std::ostringstream output; @@ -382,7 +400,7 @@ const std::string LArCalibValidationAlg<CONDITIONSCONTAINER>::channelDescription output << ",Ch:" << m_onlineHelper->channel(chid); if (!isCalib) { try { - //if (m_larCablingSvc->isOnlineConnected(chid)) { + //if (cabling->isOnlineConnected(chid)) { if (m_onlineHelper->isFCALchannel(chid)) output << ",FCAL"; if (m_onlineHelper->isHECchannel(chid)) @@ -391,7 +409,7 @@ const std::string LArCalibValidationAlg<CONDITIONSCONTAINER>::channelDescription output << ",EMB"; if (m_onlineHelper->isEMECchannel(chid)) output << ",EMEC"; - const Identifier id=m_larCablingSvc->cnvToIdentifier(chid); + const Identifier id=cabling->cnvToIdentifier(chid); output << ",Samp:" << m_caloId->sampling(id); //Could add Eta, phi.... //}//end if is connected @@ -404,14 +422,14 @@ const std::string LArCalibValidationAlg<CONDITIONSCONTAINER>::channelDescription output << "]"; if (!isFeb && !isCalib && m_useBCInfo) - if (!(m_badChannelTool->status(chid).good())) - output << " BC [0x" << std::hex << m_badChannelTool->status(chid).packedData()<<"]" << std::dec; + if (!(bcCont->status(chid).good())) + output << " BC [0x" << std::hex << bcCont->status(chid).packedData()<<"]" << std::dec; return output.str(); } template<class CONDITIONSCONTAINER> -bool LArCalibValidationAlg<CONDITIONSCONTAINER>::checkCoolChannelCompleteness() { +bool LArCalibValidationAlg<CONDITIONSCONTAINER>::checkCoolChannelCompleteness(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont) { bool retVal=true; FEBANDGAIN_t missing; //Keep track of missing FEBs //typedef typename CONDITIONSCONTAINER::MultChanCollection MULTICHANCOLL; @@ -428,23 +446,23 @@ bool LArCalibValidationAlg<CONDITIONSCONTAINER>::checkCoolChannelCompleteness() for (;febIt!=febIt_e;++febIt) { const HWIdentifier febId(febIt->first); const typename SUBSET::ChannelVector& data=febIt->second; - ATH_MSG_DEBUG ( "Subset #" << subsetIndex << " " << channelDescription(febId,gain,true) << " has " << data.size() << " channels" ) ; + ATH_MSG_DEBUG ( "Subset #" << subsetIndex << " " << channelDescription(febId,cabling, bcCont,gain,true) << " has " << data.size() << " channels" ) ; if (data.size()==0) { if (m_patchMissingFEBs) { ATH_MSG_WARNING ( "Found incomplete COOL channel!" - << channelDescription(febId,gain,true) << " missing! Will try to patch..." ) ; + << channelDescription(febId,cabling, bcCont, gain,true) << " missing! Will try to patch..." ) ; missing.push_back(FEBANDGAIN_t::value_type(febId,gain)); //remember missing FEB/gain pair } else { retVal=false; - ATH_MSG_ERROR ( "Found incomplete COOL channel! " << channelDescription(febId,gain,true) << " missing!" ) ; + ATH_MSG_ERROR ( "Found incomplete COOL channel! " << channelDescription(febId,cabling, bcCont, gain,true) << " missing!" ) ; } } }//End loop over FEBs in subset ++subsetIndex; }//End loop over subsets in container if (missing.size()) - retVal=patchMissingFEBs(missing); + retVal=patchMissingFEBs(missing,cabling,bcCont); if (m_patchMissingFEBs && m_useCorrChannel) { const std::vector<unsigned> completedChans = m_nc_validation->completeCorrectionChannels(); @@ -464,7 +482,7 @@ bool LArCalibValidationAlg<CONDITIONSCONTAINER>::checkCoolChannelCompleteness() template<class CONDITIONSCONTAINER> -bool LArCalibValidationAlg<CONDITIONSCONTAINER>::patchMissingFEBs(const FEBANDGAIN_t& febAndGain) { +bool LArCalibValidationAlg<CONDITIONSCONTAINER>::patchMissingFEBs(const FEBANDGAIN_t& febAndGain, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont) { unsigned nGood=0; FEBANDGAIN_t::const_iterator missingIt=febAndGain.begin(); FEBANDGAIN_t::const_iterator missingIt_e=febAndGain.end(); @@ -485,8 +503,8 @@ bool LArCalibValidationAlg<CONDITIONSCONTAINER>::patchMissingFEBs(const FEBANDGA const HWIdentifier chid=m_onlineHelper->channel_Id(febId,ch); const LArCondObj& obj =m_reference->get(chid,gain); if (obj.isEmpty()) { //Can't get reference object - if (m_larCablingSvc->isOnlineConnected(chid)) { //Don't care if not connected - ATH_MSG_ERROR ( "Channel " << ch << " of missing " << channelDescription(febId,gain,true) + if (cabling->isOnlineConnected(chid)) { //Don't care if not connected + ATH_MSG_ERROR ( "Channel " << ch << " of missing " << channelDescription(febId,cabling, bcCont, gain,true) << " can't be found in reference container either." ) ; ++nMissing; }//end if isConnected @@ -495,19 +513,19 @@ bool LArCalibValidationAlg<CONDITIONSCONTAINER>::patchMissingFEBs(const FEBANDGA StatusCode sc=m_nc_validation->insertCorrection(chid,obj,gain,m_useCorrChannel); if (sc.isFailure()) { ++nMissing; - ATH_MSG_ERROR ( "Failed to insert correction for channel " << ch << " of missing " << channelDescription(febId,gain,true) ) ; + ATH_MSG_ERROR ( "Failed to insert correction for channel " << ch << " of missing " << channelDescription(febId,cabling, bcCont, gain,true) ) ; } else { - ATH_MSG_DEBUG ( "Copied channel " << ch << " of missing " << channelDescription(febId,gain,true) + ATH_MSG_DEBUG ( "Copied channel " << ch << " of missing " << channelDescription(febId,cabling, bcCont,gain,true) << " from reference container" ) ; } ++nGood; } }//end loop over channels of feb if (nMissing==0) - ATH_MSG_INFO ( "Sucessfully patched " << channelDescription(febId,gain,true) << " using values from the reference container." ) ; + ATH_MSG_INFO ( "Sucessfully patched " << channelDescription(febId,cabling,bcCont,gain,true) << " using values from the reference container." ) ; else - ATH_MSG_ERROR ( "Failed to patch all channels of FEB" << channelDescription(febId,gain,true) ) ; + ATH_MSG_ERROR ( "Failed to patch all channels of FEB" << channelDescription(febId,cabling,bcCont,gain,true) ) ; }//end loop over all pairs of missing febid and gain @@ -520,7 +538,7 @@ bool LArCalibValidationAlg<CONDITIONSCONTAINER>::patchMissingFEBs(const FEBANDGA template<class CONDITIONSCONTAINER> -bool LArCalibValidationAlg<CONDITIONSCONTAINER>::checkNumberOfCoolChannels() const { +bool LArCalibValidationAlg<CONDITIONSCONTAINER>::checkNumberOfCoolChannels(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont) const { //Map of COOL channel number and first FEB (as example) typedef std::map<unsigned,std::pair<unsigned,HWIdentifier> > CHANMAP; @@ -584,7 +602,7 @@ bool LArCalibValidationAlg<CONDITIONSCONTAINER>::checkNumberOfCoolChannels() con const HWIdentifier fId=cit->second.second; ATH_MSG_ERROR ( "COOL Channel " << cit->first << " not part of the reference container! ") ; if (fId.is_valid()) - ATH_MSG_ERROR ( "Example:" << channelDescription(fId,cit->second.first,true) ) ; + ATH_MSG_ERROR ( "Example:" << channelDescription(fId,cabling, bcCont,cit->second.first,true) ) ; else //Correction channel ATH_MSG_ERROR ( "Correction Gain=" << cit->second.first ) ; } @@ -593,7 +611,7 @@ bool LArCalibValidationAlg<CONDITIONSCONTAINER>::checkNumberOfCoolChannels() con const HWIdentifier fId=cit->second.second; ATH_MSG_ERROR ( "COOL Channel " << cit->first << " missing! ") ; if (fId.is_valid()) - ATH_MSG_ERROR ( "Example: " << channelDescription(fId,cit->second.first,true) ) ; + ATH_MSG_ERROR ( "Example: " << channelDescription(fId,cabling,bcCont,cit->second.first,true) ) ; else ATH_MSG_ERROR ( "Correction Gain=" << cit->second.first ) ; } diff --git a/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArPedestalValidationAlg.h b/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArPedestalValidationAlg.h index c1bb98dc925..37afacb7acf 100644 --- a/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArPedestalValidationAlg.h +++ b/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArPedestalValidationAlg.h @@ -48,10 +48,10 @@ class LArPedestalValidationAlg: public LArPedestalValidationBase { private: /** @brief Method to validate the pedestal single readout channels */ - bool validateChannel(const LArCondObj& ref, const LArCondObj& val, const HWIdentifier chid, const int gain); + bool validateChannel(const LArCondObj& ref, const LArCondObj& val, const HWIdentifier chid, const int gain, const LArOnOffIdMapping *cabling,const LArBadChannelCont *bcCont); /** @brief Summary method executed after the loop over all channels */ - StatusCode summary(); + StatusCode summary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont); /** @brief Executed before the loop over all channels to reset global sums */ StatusCode preLoop(); @@ -86,7 +86,8 @@ class LArPedestalValidationAlg: public LArPedestalValidationBase { //The following is for keeping track of entire FEBs /** @brief Method to compare FEB averages */ - bool febSummary(); + bool febSummary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont); + class DataPerFEB { public: diff --git a/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArRampValidationAlg.h b/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArRampValidationAlg.h index 71d865921d3..5772811f4db 100644 --- a/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArRampValidationAlg.h +++ b/LArCalorimeter/LArCalibDataQuality/LArCalibDataQuality/LArRampValidationAlg.h @@ -48,10 +48,10 @@ class LArRampValidationAlg: public LArRampValidationBase { private: /** @brief Method to validate the ramps single readout channels */ - bool validateChannel(const LArCondObj& ref, const LArCondObj& val, const HWIdentifier chid, const int gain); + bool validateChannel(const LArCondObj& ref, const LArCondObj& val, const HWIdentifier chid, const int gain, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont); /** @brief Summary method executed after the loop over all channels */ - StatusCode summary(); + StatusCode summary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont); /** @brief Executed before the loop over all channels to reset global sums */ StatusCode preLoop(); @@ -80,10 +80,10 @@ class LArRampValidationAlg: public LArRampValidationBase { //The following is for keeping track of entire FEBs /** @brief Method to compare FEB averages */ - bool febSummary(); + bool febSummary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont); //The following is used to look for channels deviating from average - bool deviateFromAvg(const LArCondObj& val, const HWIdentifier chid, const int gain); + bool deviateFromAvg(const LArCondObj& val, const HWIdentifier chid, const int gain, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont); class DataPerFEB { public: diff --git a/LArCalorimeter/LArCalibDataQuality/src/LArAutoCorrValidationAlg.cxx b/LArCalorimeter/LArCalibDataQuality/src/LArAutoCorrValidationAlg.cxx index 2e56d6336ba..14480e7b5a8 100644 --- a/LArCalorimeter/LArCalibDataQuality/src/LArAutoCorrValidationAlg.cxx +++ b/LArCalorimeter/LArCalibDataQuality/src/LArAutoCorrValidationAlg.cxx @@ -63,7 +63,7 @@ StatusCode LArAutoCorrValidationAlg::preLoop() { } -bool LArAutoCorrValidationAlg::validateChannel(const LArCondObj& ref, const LArCondObj& val, const HWIdentifier chid, const int gain) { +bool LArAutoCorrValidationAlg::validateChannel(const LArCondObj& ref, const LArCondObj& val, const HWIdentifier chid, const int gain, const LArOnOffIdMapping *cabling,const LArBadChannelCont *bcCont) { if (gain<0 || gain>2) { ATH_MSG_ERROR ( "Unexpected gain value " << gain ) ; @@ -71,18 +71,18 @@ if (gain<0 || gain>2) { } if (val.m_vAutoCorr.size()==0) { - msg() << this->m_myMsgLvl << "Empty! No AC found for " << channelDescription(chid,gain) << endmsg; + msg() << this->m_myMsgLvl << "Empty! No AC found for " << channelDescription(chid,cabling, bcCont, gain) << endmsg; return false; } if (ref.m_vAutoCorr.size()==0) { - ATH_MSG_WARNING ( "No reference value found for " << channelDescription(chid,gain) ) ; + ATH_MSG_WARNING ( "No reference value found for " << channelDescription(chid,cabling, bcCont, gain) ) ; return false; } const float covVal=val.m_vAutoCorr[0]; const float covRef=ref.m_vAutoCorr[0]; - const Identifier id=m_larCablingSvc->cnvToIdentifier(chid); + const Identifier id=cabling->cnvToIdentifier(chid); const float covTolerance=m_covTolerance.valuesForCell(id)[gain]; @@ -106,12 +106,12 @@ if (gain<0 || gain>2) { for (size_t i=0;i<s;++i) { const float covVal_i=val.m_vAutoCorr[i]; if (fabs(covVal_i)>1.0) { - msg() << this->m_myMsgLvl << "Unphysical! " << channelDescription(chid,gain) << " AutoCorr[" << i << "]: " + msg() << this->m_myMsgLvl << "Unphysical! " << channelDescription(chid, cabling, bcCont, gain) << " AutoCorr[" << i << "]: " << std::setprecision(4) << covVal_i << endmsg; return false; } if (m_checkFifthSample and i==5 and fabs(covVal_i)>0.13) { - msg() << this->m_myMsgLvl << "LARGE Autocorr sample 5 " << channelDescription(chid,gain) << " AutoCorr[" << i << "]: " << covVal_i << endmsg; + msg() << this->m_myMsgLvl << "LARGE Autocorr sample 5 " << channelDescription(chid, cabling, bcCont, gain) << " AutoCorr[" << i << "]: " << covVal_i << endmsg; return false; } if (i<m_nSamplesToCheck && i<sr) { @@ -120,7 +120,7 @@ if (gain<0 || gain>2) { if (m_nFailedValidation<m_maxmessages) { std::stringstream devMsg; devMsg.setf(std::ios::fixed,std::ios::floatfield); - devMsg << "Deviating! " << channelDescription(chid,gain) << " AutoCorr[" << i << "]: " << std::setprecision(4) << covVal_i + devMsg << "Deviating! " << channelDescription(chid, cabling, bcCont,gain) << " AutoCorr[" << i << "]: " << std::setprecision(4) << covVal_i <<" (" << covRef_i << ", " << std::setprecision(2) << ((covVal_i-covRef_i)/covRef_i)*100 << "%)"; msg() << this->m_myMsgLvl << devMsg.str() << endmsg; ATH_MSG_DEBUG ( "Covariance Tolerance: " << covTolerance ) ; @@ -135,7 +135,7 @@ if (gain<0 || gain>2) { } -bool LArAutoCorrValidationAlg::febSummary() { +bool LArAutoCorrValidationAlg::febSummary(const LArOnOffIdMapping *cabling,const LArBadChannelCont * bcCont) { unsigned nBadFebs=0; msg().precision(3); msg().setf(std::ios::fixed,std::ios::floatfield); @@ -146,13 +146,12 @@ bool LArAutoCorrValidationAlg::febSummary() { DataPerFEB& dataPerFeb=*it; dataPerFeb.covVal/=dataPerFeb.nEntries; dataPerFeb.covRef/=dataPerFeb.nEntries; - //(*m_log) << MSG::INFO << " nb of channels = " <<dataPerFeb.nEntries << " for " << channelDescription(dataPerFeb.febid, dataPerFeb.gain, true) << endmsg; - const Identifier id=m_larCablingSvc->cnvToIdentifier(dataPerFeb.chid); + const Identifier id=cabling->cnvToIdentifier(dataPerFeb.chid); const float& covToleranceFEB=m_covToleranceFEB.valuesForCell(id)[dataPerFeb.gain]; if (fabs(dataPerFeb.covVal-dataPerFeb.covRef)>covToleranceFEB){ - msg() << m_myMsgLvl << "Deviating!" << channelDescription(dataPerFeb.febid,dataPerFeb.gain,true) << "Average AutoCorr: " + msg() << m_myMsgLvl << "Deviating!" << channelDescription(dataPerFeb.febid, cabling, bcCont, dataPerFeb.gain,true) << "Average AutoCorr: " << dataPerFeb.covVal << " (" << dataPerFeb.covRef << ")" << endmsg; ++nBadFebs; } @@ -167,13 +166,13 @@ bool LArAutoCorrValidationAlg::febSummary() { return true; } } -StatusCode LArAutoCorrValidationAlg::summary() { +StatusCode LArAutoCorrValidationAlg::summary(const LArOnOffIdMapping *cabling,const LArBadChannelCont *bcCont) { StatusCode sc=StatusCode::SUCCESS; //1nd step: Check the FEB-averages: - if (m_doFebAverages && !febSummary()) + if (m_doFebAverages && !febSummary(cabling, bcCont)) sc=StatusCode::RECOVERABLE; //2nd step: Call the summary method from base-class (single-channel summary) - if (!LArAutoCorrValidationBase::summary().isSuccess()) + if (!LArAutoCorrValidationBase::summary(cabling, bcCont).isSuccess()) sc=StatusCode::RECOVERABLE; //3rd step: Check the gobal averages: if (m_nEntriesGlobal) { diff --git a/LArCalorimeter/LArCalibDataQuality/src/LArBadChannelHunter.cxx b/LArCalorimeter/LArCalibDataQuality/src/LArBadChannelHunter.cxx index 18b3c8e8d1e..b6048ffca53 100644 --- a/LArCalorimeter/LArCalibDataQuality/src/LArBadChannelHunter.cxx +++ b/LArCalorimeter/LArCalibDataQuality/src/LArBadChannelHunter.cxx @@ -10,7 +10,6 @@ #include "LArRawConditions/LArWave.h" #include "LArIdentifier/LArOnlineID.h" #include "CaloIdentifier/CaloCell_ID.h" -#include "LArCabling/LArCablingService.h" #include "LArRecConditions/LArBadChanBitPacking.h" #include "StoreGate/StoreGateSvc.h" @@ -22,11 +21,8 @@ LArBadChannelHunter::LArBadChannelHunter(const std::string& name, ISvcLocator* p AthAlgorithm(name,pSvcLocator), m_onlineId(0), m_caloId(0), - m_badChannelTool("LArBadChanTool"), - m_larCablingSvc("LArCablingService"), m_avgType(FEB) { - declareProperty("BadChannelTool", m_badChannelTool, "BadChannelTool to be used"); declareProperty("PedestalKey", m_pedKey="", "Key of the pedestal container"); declareProperty("CaliWaveKey", m_caliWaveKey="", "Key of the CaliWave container"); @@ -111,6 +107,10 @@ StatusCode LArBadChannelHunter::initialize() { return StatusCode::FAILURE; } } + ATH_CHECK( m_cablingKey.initialize() ); + ATH_CHECK( m_BCKey.initialize() ); + ATH_CHECK( m_CLKey.initialize() ); + return StatusCode::SUCCESS; } @@ -118,8 +118,6 @@ StatusCode LArBadChannelHunter::initialize() { StatusCode LArBadChannelHunter::stop() { ATH_CHECK( detStore()->retrieve(m_onlineId, "LArOnlineID") ); ATH_CHECK( detStore()->retrieve(m_caloId, "CaloCell_ID") ); - ATH_CHECK( m_badChannelTool.retrieve() ); - ATH_CHECK( m_larCablingSvc.retrieve() ); const ILArPedestal* pedestal = nullptr; ATH_CHECK( detStore()->retrieve(pedestal,m_pedKey) ); @@ -133,6 +131,24 @@ StatusCode LArBadChannelHunter::stop() { caliwavecomplete->undoCorrections(); } + SG::ReadCondHandle<LArBadChannelCont> readHandle{m_BCKey}; + const LArBadChannelCont *bcCont {*readHandle}; + if(!bcCont) { + ATH_MSG_ERROR( "Do not have Bad chan container " << m_BCKey.key() ); + return StatusCode::FAILURE; + } + SG::ReadCondHandle<LArCalibLineMapping> clHdl{m_CLKey}; + const LArCalibLineMapping *clCont {*clHdl}; + if(!clCont) { + ATH_MSG_ERROR( "Do not have calib line mapping !!!" ); + return StatusCode::FAILURE; + } + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling=*cablingHdl; + if(!cabling) { + ATH_MSG_ERROR( "Do not have cabling object LArOnOffIdMapping" ); + return StatusCode::FAILURE; + } //////////////////////////////// LArWaveHelper waveHelper; @@ -148,7 +164,7 @@ StatusCode LArBadChannelHunter::stop() { for(; itOnId!=itOnIdEnd;++itOnId){ const HWIdentifier chid = *itOnId; - if (!m_larCablingSvc->isOnlineConnected(chid)) continue; + if (!cabling->isOnlineConnected(chid)) continue; //const HWIdentifier febid= m_onlineId->feb_Id(chid); float ped=pedestal->pedestalRMS(chid,0); const LArCaliWaveVec& cwv=caliwave->get(chid,0); @@ -163,7 +179,7 @@ StatusCode LArBadChannelHunter::stop() { thisCellData.m_wid =wid; thisCellData.m_tmax=tmax; - const unsigned regId=getSymId(chid); + const unsigned regId=getSymId(chid, cabling); Average& avreg=averageMap[regId]; for(unsigned igain=CaloGain::LARHIGHGAIN; igain<CaloGain::LARNGAIN; igain++) { @@ -233,14 +249,14 @@ StatusCode LArBadChannelHunter::stop() { const CellData& thisCellData=*itcells; const HWIdentifier chid = thisCellData.m_chid; - unsigned regId=getSymId(chid); - ATH_MSG_VERBOSE ( "Checking " << channelDescription(chid) ) ; + unsigned regId=getSymId(chid, cabling); + ATH_MSG_VERBOSE ( "Checking " << channelDescription(chid, cabling) ) ; std::map<unsigned,Average>::const_iterator febit=averageMap.find(regId); if (febit==averageMap.end()) continue; const Average& avreg=febit->second; LArBadChannel problem(0); /// bad bit newly found - LArBadChannel bc = m_badChannelTool->status(chid); /// known bad bit + LArBadChannel bc = bcCont->status(chid); /// known bad bit for(unsigned igain=CaloGain::LARHIGHGAIN; igain<CaloGain::LARNGAIN; igain++) { if (avreg.m_nPed[igain]>2) {//Check if have average ped-rms for this cell & gain @@ -257,7 +273,7 @@ StatusCode LArBadChannelHunter::stop() { } if (rms==-1) - ATH_MSG_ERROR ( "No Pedestal found for " << channelDescription(chid,igain) ) ; + ATH_MSG_ERROR ( "No Pedestal found for " << channelDescription(chid,cabling, igain) ) ; else { ATH_MSG_VERBOSE ( "PedRMS, gain: " << igain << ":" << rms << " Average: " << avreg.m_avPedRMS[igain] << " Median: " << avreg.m_medPedRMS ) ; @@ -276,7 +292,7 @@ StatusCode LArBadChannelHunter::stop() { else my_status=(bc.lowNoiseHG()||bc.highNoiseHG()) ? "BC " : "NEW "; - ATH_MSG_INFO( my_status << channelDescription(chid,igain) + ATH_MSG_INFO( my_status << channelDescription(chid,cabling,igain) << " RMS: " << rms << " ( " << avreg.m_avPedRMS[igain] << " , " << float(int(10000*(rms-avreg.m_avPedRMS[igain])/avreg.m_avPedRMS[igain]))/100 <<" %) " << ", #Sig: " << float(int(100*(rms-avreg.m_avPedRMS[igain])/avreg.m_avPedRMSSD[igain]))/100 @@ -315,7 +331,7 @@ StatusCode LArBadChannelHunter::stop() { if (ampl==-1 || wid==-1) { - ATH_MSG_INFO ( "No Amplitude or Width found for " << channelDescription(chid,0) ) ; + ATH_MSG_INFO ( "No Amplitude or Width found for " << channelDescription(chid,cabling,0) ) ; packing.setBit(LArBadChannelEnum::deadReadoutBit,problem); } else { @@ -332,7 +348,7 @@ StatusCode LArBadChannelHunter::stop() { else if (fabs(tmax-avreg.m_avTmax[0])>Cut_tmax) { packing.setBit(LArBadChannelEnum::distortedBit,problem); // std::string my_status=(bc.good()) ? "NEW " : "BC "; -// log << MSG::INFO << my_status << channelDescription(chid,0) << " Tmax: " << tmax << " ( " << avreg.m_avTmax[0] << " , " +// log << MSG::INFO << my_status << channelDescription(chid,cabling,0) << " Tmax: " << tmax << " ( " << avreg.m_avTmax[0] << " , " // << float(int(10000*(tmax-avreg.m_avTmax[0])/avreg.m_avTmax[0]))/100 << " %) " // << " #Sig:" << float(int(100*(tmax-avreg.m_avTmax[0])/avreg.m_avTmaxSD[0]))/100 // << " ( " << avreg.m_avTmaxSD[0] << " ) " << endmsg; @@ -348,7 +364,7 @@ StatusCode LArBadChannelHunter::stop() { else my_status=(bc.deadReadout()||bc.deadCalib()||bc.deadPhys()||bc.distorted()||bc.shortProblem()) ? "BC " : "NEW "; - ATH_MSG_INFO ( my_status << channelDescription(chid,0) + ATH_MSG_INFO ( my_status << channelDescription(chid,cabling,0) << " Amp: " << ampl << " ( " << avreg.m_avAmpl[0] << " , " << float(int(10000*(ampl-avreg.m_avAmpl[0])/avreg.m_avAmpl[0]))/100 << " %) " << " #Sig: " << float(int(100*(ampl-avreg.m_avAmpl[0])/avreg.m_avAmplSD[0]))/100 << " ( " << avreg.m_avAmplSD[0] <<" ) " @@ -365,7 +381,7 @@ StatusCode LArBadChannelHunter::stop() { }//end if have amplitude for this cell - const std::vector<HWIdentifier>& cLids=m_larCablingSvc->calibSlotLine(chid); + const std::vector<HWIdentifier>& cLids=clCont->calibSlotLine(chid); for (unsigned i=0;i<cLids.size();i++) { goodAndBad_t& gb=calibLineMap[cLids[i]]; if (problem.deadReadout()||problem.distorted()) @@ -385,7 +401,7 @@ StatusCode LArBadChannelHunter::stop() { const goodAndBad_t& gb=itCalib->second; for (unsigned i=0;i<gb.second.size();i++) { if (gb.first==0) { - ATH_MSG_INFO ( "All channels belonging to calibLine " << channelDescription(badChanVec[gb.second[i]].first) + ATH_MSG_INFO ( "All channels belonging to calibLine " << channelDescription(badChanVec[gb.second[i]].first, cabling) << " don't respond to pulses. Assume bad calib line." ) ; packing.setBit(LArBadChannelEnum::deadReadoutBit,badChanVec[gb.second[i]].second,false); packing.setBit(LArBadChannelEnum::distortedBit,badChanVec[gb.second[i]].second,false); @@ -405,8 +421,8 @@ StatusCode LArBadChannelHunter::stop() { for(;bcvit!=bcvit_e;++bcvit) { const HWIdentifier chid=bcvit->first; const LArBadChannel bc=bcvit->second; - const HWIdentifier cLid=m_larCablingSvc->calibSlotLine(chid)[0]; - const LArBadChannel bc2=m_badChannelTool->status(chid); + const HWIdentifier cLid=clCont->calibSlotLine(chid)[0]; + const LArBadChannel bc2=bcCont->status(chid); std::string my_ps=(bc2.good())? "NEW " : "BC "; if (!bc2.good()&&m_outOnlyNew) continue; // just new outfile << m_onlineId->barrel_ec(chid) << " " @@ -426,6 +442,7 @@ StatusCode LArBadChannelHunter::stop() { } const std::string LArBadChannelHunter::channelDescription(const HWIdentifier& chid, + const LArOnOffIdMapping *cabling, const unsigned gain) const { /// the format of output is changed a bit to be consistent with the output format of @@ -454,7 +471,7 @@ const std::string LArBadChannelHunter::channelDescription(const HWIdentifier& ch output << ",Ch:" << m_onlineId->channel(chid); if (!m_onlineId->isCalibration(chid)) { try { - if (m_larCablingSvc->isOnlineConnected(chid)) { + if (cabling->isOnlineConnected(chid)) { if (m_onlineId->isFCALchannel(chid)) output << ",FCAL"; if (m_onlineId->isHECchannel(chid)) @@ -463,9 +480,6 @@ const std::string LArBadChannelHunter::channelDescription(const HWIdentifier& ch output << ",EMB"; if (m_onlineId->isEMECchannel(chid)) output << ",EMEC"; -// const Identifier id=m_larCablingSvc->cnvToIdentifier(chid); -// output << ",Samp:" << m_caloId->sampling(id); - //Could add Eta, phi.... }//end if is connected else output << ",disconnected"; @@ -640,12 +654,12 @@ void LArBadChannelHunter::Average::finish(float my_recalcPer) { -unsigned LArBadChannelHunter::getSymId(const HWIdentifier chid) const { +unsigned LArBadChannelHunter::getSymId(const HWIdentifier chid, const LArOnOffIdMapping *cabling) const { if (m_avgType==FEB) return m_onlineId->feb_Id(chid).get_identifier32().get_compact(); else { const unsigned caloRegionHashMax=m_caloId->calo_region_hash_max(); - const Identifier id=m_larCablingSvc->cnvToIdentifier(chid); + const Identifier id=cabling->cnvToIdentifier(chid); const Identifier regid=m_caloId->region_id(id); const unsigned reghash=m_caloId->calo_region_hash(regid); const int eta=m_caloId->eta(id); diff --git a/LArCalorimeter/LArCalibDataQuality/src/LArCaliWaveValidationAlg.cxx b/LArCalorimeter/LArCalibDataQuality/src/LArCaliWaveValidationAlg.cxx index 3a358efc574..b3c2576bd6d 100644 --- a/LArCalorimeter/LArCalibDataQuality/src/LArCaliWaveValidationAlg.cxx +++ b/LArCalorimeter/LArCalibDataQuality/src/LArCaliWaveValidationAlg.cxx @@ -98,7 +98,7 @@ StatusCode LArCaliWaveValidationAlg::preLoop() { return StatusCode::SUCCESS; } -bool LArCaliWaveValidationAlg::validateChannel(const LArCondObj& ref, const LArCondObj& val, const HWIdentifier chid, const int gain) { +bool LArCaliWaveValidationAlg::validateChannel(const LArCondObj& ref, const LArCondObj& val, const HWIdentifier chid, const int gain, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont) { if (gain<0 || gain>2) { ATH_MSG_ERROR ( "Unexpected gain value " << gain ) ; @@ -117,7 +117,7 @@ bool LArCaliWaveValidationAlg::validateChannel(const LArCondObj& ref, const LArC float TMaxshift=5.; - const Identifier id=m_larCablingSvc->cnvToIdentifier(chid); + const Identifier id=cabling->cnvToIdentifier(chid); const float ampTolerance=m_ampTolerance.valuesForCell(id)[gain]; const float fwhmTolerance=m_fwhmTolerance.valuesForCell(id)[gain]; @@ -161,7 +161,7 @@ bool LArCaliWaveValidationAlg::validateChannel(const LArCondObj& ref, const LArC if (fabs(TmaxVal-TmaxRef)> TMaxshift && m_timeShift==true) { retval=false; if (m_nFailedValidation<m_maxmessages) - msg() << m_myMsgLvl << "Shifted! " << channelDescription(chid,gain) << " Tmax: " << TmaxVal << " ( " << TmaxRef << " ) " << endmsg; + msg() << m_myMsgLvl << "Shifted! " << channelDescription(chid,cabling,bcCont,gain) << " Tmax: " << TmaxVal << " ( " << TmaxRef << " ) " << endmsg; } @@ -171,7 +171,7 @@ bool LArCaliWaveValidationAlg::validateChannel(const LArCondObj& ref, const LArC if (m_nFailedValidation<m_maxmessages) { msg().precision(2); msg().setf(std::ios::fixed,std::ios::floatfield); - msg() << this->m_myMsgLvl << "Deviating! " << channelDescription(chid,gain) << " Amp: " << ampVal << "( " << ampRef + msg() << this->m_myMsgLvl << "Deviating! " << channelDescription(chid,cabling,bcCont,gain) << " Amp: " << ampVal << "( " << ampRef << ", " << 100.*(ampVal-ampRef)/ampRef << " %)" << " FWHM: " << fwhmVal << " ( " << fwhmRef << ", " << 100*(fwhmVal-fwhmRef)/fwhmVal << " %)" << endmsg; ATH_MSG_DEBUG ( "Amplitude FEB tolerance: " << ampTolerance << ", FWHM FEB tolerance: " << fwhmTolerance ) ; @@ -184,7 +184,7 @@ bool LArCaliWaveValidationAlg::validateChannel(const LArCondObj& ref, const LArC } -bool LArCaliWaveValidationAlg::febSummary() { +bool LArCaliWaveValidationAlg::febSummary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont) { unsigned nBadFebs=0; @@ -200,13 +200,13 @@ bool LArCaliWaveValidationAlg::febSummary() { dataPerFeb.fwhmVal/=dataPerFeb.nEntries; dataPerFeb.fwhmRef/=dataPerFeb.nEntries; - const Identifier id=m_larCablingSvc->cnvToIdentifier(dataPerFeb.chid); + const Identifier id=cabling->cnvToIdentifier(dataPerFeb.chid); const float& ampToleranceFEB=m_ampToleranceFEB.valuesForCell(id)[dataPerFeb.gain]; const float& fwhmToleranceFEB=m_fwhmToleranceFEB.valuesForCell(id)[dataPerFeb.gain]; if (fabs(dataPerFeb.ampVal-dataPerFeb.ampRef)/dataPerFeb.ampRef*1000>ampToleranceFEB || fabs(dataPerFeb.fwhmVal-dataPerFeb.fwhmRef)/dataPerFeb.fwhmRef*1000>fwhmToleranceFEB) { - msg() << m_myMsgLvl << "Deviating! " <<channelDescription(dataPerFeb.febid,dataPerFeb.gain,true)<< "Average Amp: " << dataPerFeb.ampVal << " (" << dataPerFeb.ampRef << ")" + msg() << m_myMsgLvl << "Deviating! " <<channelDescription(dataPerFeb.febid,cabling,bcCont,dataPerFeb.gain,true)<< "Average Amp: " << dataPerFeb.ampVal << " (" << dataPerFeb.ampRef << ")" << " FWHM: " << dataPerFeb.fwhmVal << " (" << dataPerFeb.fwhmRef << ")" << endmsg; ++nBadFebs; ATH_MSG_DEBUG ( "Amplitude FEB tolerance: " << ampToleranceFEB << ", FWHM FEB tolerance: " << fwhmToleranceFEB ) ; @@ -222,13 +222,13 @@ bool LArCaliWaveValidationAlg::febSummary() { return true; } } -StatusCode LArCaliWaveValidationAlg::summary() { +StatusCode LArCaliWaveValidationAlg::summary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont) { StatusCode sc=StatusCode::SUCCESS; //1nd step: Check the FEB-averages: - if (m_doFebAverages && !febSummary()) + if (m_doFebAverages && !febSummary(cabling, bcCont)) sc=StatusCode::RECOVERABLE; //2st step: Call the summary method from base-class (single-channel summary) - if (!LArCaliWaveValidationBase::summary().isSuccess()) + if (!LArCaliWaveValidationBase::summary(cabling, bcCont).isSuccess()) sc=StatusCode::RECOVERABLE; //3rd step: Check the gobal averages: if (m_nEntriesGlobal) { diff --git a/LArCalorimeter/LArCalibDataQuality/src/LArPedestalValidationAlg.cxx b/LArCalorimeter/LArCalibDataQuality/src/LArPedestalValidationAlg.cxx index d827f0c7963..3be16834ddc 100644 --- a/LArCalorimeter/LArCalibDataQuality/src/LArPedestalValidationAlg.cxx +++ b/LArCalorimeter/LArCalibDataQuality/src/LArPedestalValidationAlg.cxx @@ -92,7 +92,7 @@ StatusCode LArPedestalValidationAlg::preLoop() { return StatusCode::SUCCESS; } -bool LArPedestalValidationAlg::validateChannel(const LArCondObj& ref, const LArCondObj& val, const HWIdentifier chid, const int gain) { +bool LArPedestalValidationAlg::validateChannel(const LArCondObj& ref, const LArCondObj& val, const HWIdentifier chid, const int gain, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont) { if (gain<0 || gain>2) { ATH_MSG_ERROR ( "Unexpected gain value " << gain ) ; @@ -105,7 +105,7 @@ bool LArPedestalValidationAlg::validateChannel(const LArCondObj& ref, const LArC const float& rmsVal=val.m_PedestalRMS; const float& rmsRef=ref.m_PedestalRMS; - const Identifier id=m_larCablingSvc->cnvToIdentifier(chid); + const Identifier id=cabling->cnvToIdentifier(chid); const float pedTolerance=m_pedTolerance.valuesForCell(id)[gain]; const float rmsTolerance=m_rmsTolerance.valuesForCell(id)[gain]; @@ -138,7 +138,7 @@ bool LArPedestalValidationAlg::validateChannel(const LArCondObj& ref, const LArC if (m_nFailedValidation<m_maxmessages) { msg().precision(2); msg().setf(std::ios::fixed,std::ios::floatfield); - msg() << this->m_myMsgLvl << "Deviating! " << channelDescription(chid,gain) << " Ped: " << val.m_Pedestal + msg() << this->m_myMsgLvl << "Deviating! " << channelDescription(chid,cabling,bcCont,gain) << " Ped: " << val.m_Pedestal << " (" << ref.m_Pedestal << ", " << val.m_Pedestal-ref.m_Pedestal << " ADC)" << " RMS: " << val.m_PedestalRMS << " (" << ref.m_PedestalRMS << ", " << ((val.m_PedestalRMS-ref.m_PedestalRMS)/ref.m_PedestalRMS)*100 << "%)" << endmsg; @@ -154,7 +154,7 @@ bool LArPedestalValidationAlg::validateChannel(const LArCondObj& ref, const LArC } -bool LArPedestalValidationAlg::febSummary() { +bool LArPedestalValidationAlg::febSummary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont) { unsigned nBadFebs=0; @@ -171,14 +171,14 @@ bool LArPedestalValidationAlg::febSummary() { dataPerFeb.rmsRef/=dataPerFeb.nEntries; - const Identifier id=m_larCablingSvc->cnvToIdentifier(dataPerFeb.chid); + const Identifier id=cabling->cnvToIdentifier(dataPerFeb.chid); const float& pedToleranceFEB=m_pedToleranceFEB.valuesForCell(id)[dataPerFeb.gain]; const float& rmsToleranceFEB=m_rmsToleranceFEB.valuesForCell(id)[dataPerFeb.gain]; if (fabs(dataPerFeb.pedVal-dataPerFeb.pedRef)>pedToleranceFEB || fabs(dataPerFeb.rmsVal-dataPerFeb.rmsRef)>rmsToleranceFEB) { - msg() << m_myMsgLvl << "Deviating!" <<channelDescription(dataPerFeb.febid, dataPerFeb.gain, true) + msg() << m_myMsgLvl << "Deviating!" <<channelDescription(dataPerFeb.febid, cabling, bcCont, dataPerFeb.gain, true) << "Average Ped: " << dataPerFeb.pedVal << " (" << dataPerFeb.pedRef << ")" << " RMS: " << dataPerFeb.rmsVal << " (" << dataPerFeb.rmsRef << ")" << endmsg; ATH_MSG_DEBUG ( "Pdestal FEB Tolerance: " << pedToleranceFEB << " RMS FEB Tolerance:" << rmsToleranceFEB ) ; @@ -195,14 +195,14 @@ bool LArPedestalValidationAlg::febSummary() { return true; } } -StatusCode LArPedestalValidationAlg::summary() { +StatusCode LArPedestalValidationAlg::summary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont) { StatusCode sc=StatusCode::SUCCESS; //1nd step: Check the FEB-averages: - if (m_doFebAverages && !febSummary()) + if (m_doFebAverages && !febSummary(cabling,bcCont)) sc=StatusCode::RECOVERABLE; //2st step: Call the summary method from base-class (single-channel summary) - if (!LArPedestalValidationBase::summary().isSuccess()) + if (!LArPedestalValidationBase::summary(cabling, bcCont).isSuccess()) sc=StatusCode::RECOVERABLE; //3rd step: Check the gobal averages: diff --git a/LArCalorimeter/LArCalibDataQuality/src/LArRampValidationAlg.cxx b/LArCalorimeter/LArCalibDataQuality/src/LArRampValidationAlg.cxx index d87a7e246d0..7bc1ef3310c 100644 --- a/LArCalorimeter/LArCalibDataQuality/src/LArRampValidationAlg.cxx +++ b/LArCalorimeter/LArCalibDataQuality/src/LArRampValidationAlg.cxx @@ -98,7 +98,7 @@ StatusCode LArRampValidationAlg::preLoop() { if (fabs(singleRamp[DACIndex].TimeMax) > m_rawrampTimeTolerance){ msg().setf(std::ios::fixed,std::ios::floatfield); msg().precision(2); - msg() << m_myMsgLvl << "Deviating! " << channelDescription((*cont_it)->channelID(),(*cont_it)->gain()) << " DeltaT=" << singleRamp[DACIndex].TimeMax << " DAC = " << singleRamp[DACIndex].DAC << endmsg; + msg() << m_myMsgLvl << "Deviating! chan= " << (*cont_it)->channelID()<< " gain= "<<(*cont_it)->gain() << " DeltaT=" << singleRamp[DACIndex].TimeMax << " DAC = " << singleRamp[DACIndex].DAC << endmsg; } break; //Stop loop after testing the m_rawrampTimeDAC DAC point } @@ -109,11 +109,11 @@ StatusCode LArRampValidationAlg::preLoop() { return StatusCode::SUCCESS; } -bool LArRampValidationAlg::validateChannel(const LArCondObj& ref, const LArCondObj& val, const HWIdentifier chid, const int gain) { +bool LArRampValidationAlg::validateChannel(const LArCondObj& ref, const LArCondObj& val, const HWIdentifier chid, const int gain, const LArOnOffIdMapping *cabling,const LArBadChannelCont *bcCont) { HWIdentifier febid=m_onlineHelper->feb_Id(chid); - Identifier offlineID = m_larCablingSvc->cnvToIdentifier(chid); + Identifier offlineID = cabling->cnvToIdentifier(chid); ++m_nEntriesGlobal; @@ -174,7 +174,7 @@ bool LArRampValidationAlg::validateChannel(const LArCondObj& ref, const LArCondO std::stringstream devMsg; devMsg.setf(std::ios::fixed,std::ios::floatfield); devMsg.precision(3); - devMsg << "Deviating! " << channelDescription(chid,gain) << " Ramp: " << val.m_vRamp[1] << " (" << ref.m_vRamp[1] << ", "; + devMsg << "Deviating! " << channelDescription(chid,cabling,bcCont,gain) << " Ramp: " << val.m_vRamp[1] << " (" << ref.m_vRamp[1] << ", "; devMsg.precision(2); devMsg << 100*(val.m_vRamp[1]-ref.m_vRamp[1])/ref.m_vRamp[1] << "%)"; msg() << this->m_myMsgLvl << devMsg.str() << endmsg; @@ -191,7 +191,7 @@ bool LArRampValidationAlg::validateChannel(const LArCondObj& ref, const LArCondO } -bool LArRampValidationAlg::febSummary() { +bool LArRampValidationAlg::febSummary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont) { // FEBs unsigned nBadFebs=0; @@ -203,16 +203,16 @@ bool LArRampValidationAlg::febSummary() { dataPerFeb.rampRef/=dataPerFeb.nEntries; ATH_MSG_DEBUG ( " nb of channels = " << dataPerFeb.nEntries - << " for FEB " << channelDescription(dataPerFeb.febid,true) ) ; + << " for FEB " << channelDescription(dataPerFeb.febid,cabling,bcCont) ) ; //Get offline identifier of channel 0 of this FEB, should be good enough ... - const Identifier id=m_larCablingSvc->cnvToIdentifier(dataPerFeb.febid); + const Identifier id=cabling->cnvToIdentifier(dataPerFeb.febid); const float& tolerance=m_toleranceFEB.valuesForCell(id)[dataPerFeb.gain]; if (fabs(dataPerFeb.rampVal-dataPerFeb.rampRef)/dataPerFeb.rampRef > tolerance){ msg().precision(3); msg().setf(std::ios::fixed,std::ios::floatfield); - msg() << m_myMsgLvl << "Deviating! " << channelDescription(dataPerFeb.febid,dataPerFeb.gain,true) << "Average Ramp: " + msg() << m_myMsgLvl << "Deviating! " << channelDescription(dataPerFeb.febid,cabling,bcCont,dataPerFeb.gain,true) << "Average Ramp: " << dataPerFeb.rampVal << " (reference: " << dataPerFeb.rampRef << ")" << endmsg; ATH_MSG_DEBUG ( "Ramp FEB average tolerance: " << tolerance ) ; ++nBadFebs; @@ -247,9 +247,9 @@ bool LArRampValidationAlg::febSummary() { */ } -bool LArRampValidationAlg::deviateFromAvg(const LArCondObj& val, const HWIdentifier chid, const int gain) { +bool LArRampValidationAlg::deviateFromAvg(const LArCondObj& val, const HWIdentifier chid, const int gain, const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont) { - Identifier offlineID = m_larCablingSvc->cnvToIdentifier(chid); + Identifier offlineID = cabling->cnvToIdentifier(chid); // Retrieve layer/eta int layer = 0; int pos_neg = 0; int eta = 0 ; int region = 0; @@ -292,7 +292,7 @@ bool LArRampValidationAlg::deviateFromAvg(const LArCondObj& val, const HWIdentif }else{ float ratio = val.m_vRamp[1]/dataPerSector.rampVal; if ( ratio > 2.){ - msg() << m_myMsgLvl << "!!! Deviating Sector channel = " <<channelDescription(chid,dataPerSector.gain) << "Ramp: " << val.m_vRamp[1] << " (Average Sector Ramp: " << dataPerSector.rampRef << ")" << endmsg; + msg() << m_myMsgLvl << "!!! Deviating Sector channel = " <<channelDescription(chid,cabling,bcCont,dataPerSector.gain) << "Ramp: " << val.m_vRamp[1] << " (Average Sector Ramp: " << dataPerSector.rampRef << ")" << endmsg; return false; } } @@ -301,13 +301,13 @@ bool LArRampValidationAlg::deviateFromAvg(const LArCondObj& val, const HWIdentif return true; } -StatusCode LArRampValidationAlg::summary() { +StatusCode LArRampValidationAlg::summary(const LArOnOffIdMapping *cabling, const LArBadChannelCont *bcCont) { StatusCode sc=StatusCode::SUCCESS; //1nd step: Check the FEB-averages: - if (m_doFebAverages && !febSummary()) + if (m_doFebAverages && !febSummary(cabling, bcCont)) sc=StatusCode::RECOVERABLE; //2nd step: Call the summary method from base-class (single-channel summary) - if (!LArRampValidationBase::summary().isSuccess()) + if (!LArRampValidationBase::summary(cabling, bcCont).isSuccess()) sc=StatusCode::RECOVERABLE; //3rd step: Check the gobal averages: if (m_nEntriesGlobal) { diff --git a/LArCalorimeter/LArCalibTools/LArCalibTools/LArCaliWaves2Ntuple.h b/LArCalorimeter/LArCalibTools/LArCalibTools/LArCaliWaves2Ntuple.h index b8027100da7..40e4032ad3a 100755 --- a/LArCalorimeter/LArCalibTools/LArCalibTools/LArCaliWaves2Ntuple.h +++ b/LArCalorimeter/LArCalibTools/LArCalibTools/LArCaliWaves2Ntuple.h @@ -37,7 +37,7 @@ class LArCaliWaves2Ntuple : public LArWaves2Ntuple StatusCode finalize(){return StatusCode::SUCCESS;} private: - bool writeEntry(const HWIdentifier chid, const unsigned gain, const LArCaliWave& wave); + bool writeEntry(const HWIdentifier chid, const unsigned gain, const LArCaliWave& wave, const LArCalibLineMapping *clCont); std::vector<std::string> m_keylist ; std::string m_ntName; diff --git a/LArCalorimeter/LArCalibTools/LArCalibTools/LArCond2NtupleBase.h b/LArCalorimeter/LArCalibTools/LArCalibTools/LArCond2NtupleBase.h index da152c06cf0..ab1a6999daa 100644 --- a/LArCalorimeter/LArCalibTools/LArCalibTools/LArCond2NtupleBase.h +++ b/LArCalorimeter/LArCalibTools/LArCalibTools/LArCond2NtupleBase.h @@ -11,15 +11,16 @@ #include "GaudiKernel/NTuple.h" #include "GaudiKernel/ToolHandle.h" -#include "LArRecConditions/ILArBadChanTool.h" -#include "LArCabling/LArCablingService.h" #include "LArCabling/LArSuperCellCablingTool.h" #include "LArElecCalib/ILArFEBTempTool.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArBadChannelCont.h" +#include "LArCabling/LArOnOffIdMapping.h" +#include "LArRecConditions/LArCalibLineMapping.h" + class HWIdentifier; class LArOnlineID_Base; -//class LArCablingService; -//class ILArBadChanTool; class StoreGateSvc; class LArEM_Base_ID; class LArHEC_Base_ID; @@ -71,9 +72,12 @@ class LArCond2NtupleBase : public AthAlgorithm { const LArFCAL_Base_ID* m_fcalId; const LArOnlineID_Base* m_onlineId; const CaloCell_ID* m_caloId; - LArCablingBase* m_larCablingSvc; - ToolHandle<ILArBadChanTool> m_badChanTool; ToolHandle<ILArFEBTempTool> m_FEBTempTool; + + SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}; + SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey{this, "BadChanKey", "LArBadChannel", "SG bad channels key"}; + SG::ReadCondHandleKey<LArCalibLineMapping> m_calibMapKey{this,"CalibMapKey","LArCalibLineMap","SG Key of calib line mapping object"}; + bool m_isSC; bool m_isFlat; bool m_OffId; diff --git a/LArCalorimeter/LArCalibTools/src/CaloCellGroup2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/CaloCellGroup2Ntuple.cxx index 5dcdbac02f2..48100dcee72 100644 --- a/LArCalorimeter/LArCalibTools/src/CaloCellGroup2Ntuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/CaloCellGroup2Ntuple.cxx @@ -57,15 +57,20 @@ StatusCode CaloCellGroup2Ntuple::stop () { m_cellGroupList.printDef(); + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling=*cablingHdl; + if(!cabling) { + ATH_MSG_WARNING( "Do not have cabling object LArOnOffIdMapping" ); + return StatusCode::FAILURE; + } - - std::vector<HWIdentifier>::const_iterator itOnId = m_onlineId->channel_begin(); - std::vector<HWIdentifier>::const_iterator itOnIdEnd = m_onlineId->channel_end(); - for(; itOnId!=itOnIdEnd;++itOnId){ + std::vector<HWIdentifier>::const_iterator itOnId = m_onlineId->channel_begin(); + std::vector<HWIdentifier>::const_iterator itOnIdEnd = m_onlineId->channel_end(); + for(; itOnId!=itOnIdEnd;++itOnId){ const HWIdentifier hwid = *itOnId; - if (m_larCablingSvc->isOnlineConnected(hwid)) { + if (cabling->isOnlineConnected(hwid)) { fillFromIdentifier(hwid); - Identifier id=m_larCablingSvc->cnvToIdentifier(hwid); + Identifier id=cabling->cnvToIdentifier(hwid); const std::vector<float>& v=m_cellGroupList.valuesForCell(id); nValues=v.size(); for (size_t i=0;i<v.size();i++) @@ -77,7 +82,7 @@ StatusCode CaloCellGroup2Ntuple::stop () { return StatusCode::FAILURE; } }//end if isConnected - }//end loop over online ID + }//end loop over online ID (*m_log) << MSG::INFO << "CaloCellGroup2Ntuple has finished." << endmsg; return StatusCode::SUCCESS; diff --git a/LArCalorimeter/LArCalibTools/src/CaloCondBlob2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/CaloCondBlob2Ntuple.cxx index e3f9ead31e4..c43b590ab7c 100644 --- a/LArCalorimeter/LArCalibTools/src/CaloCondBlob2Ntuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/CaloCondBlob2Ntuple.cxx @@ -73,6 +73,12 @@ StatusCode CaloCondBlob2Ntuple::stop () { return StatusCode::FAILURE; } + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling=*cablingHdl; + if(!cabling) { + ATH_MSG_WARNING( "Do not have cabling object LArOnOffIdMapping" ); + return StatusCode::FAILURE; + } const unsigned nChans=condBlob->getNChans(); //const usnigend nGains=condBlob->getNGains(); @@ -81,7 +87,7 @@ StatusCode CaloCondBlob2Ntuple::stop () { for(unsigned h=0;h<nChans;++h) { //add here loop over gains //const Identifier id=caloCellId->cell_id(h); - const HWIdentifier hwid=m_larCablingSvc->createSignalChannelIDFromHash(h); + const HWIdentifier hwid=cabling->createSignalChannelIDFromHash(h); fillFromIdentifier(hwid); value= condBlob->getData(h,0,0); diff --git a/LArCalorimeter/LArCalibTools/src/LArCaliWaves2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/LArCaliWaves2Ntuple.cxx index 2f7e4dadb54..b1f077ca862 100755 --- a/LArCalorimeter/LArCalibTools/src/LArCaliWaves2Ntuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/LArCaliWaves2Ntuple.cxx @@ -112,6 +112,13 @@ StatusCode LArCaliWaves2Ntuple::stop() } } + SG::ReadCondHandle<LArCalibLineMapping> clHdl{m_calibMapKey}; + const LArCalibLineMapping *clCont {*clHdl}; + if(!clCont) { + ATH_MSG_WARNING( "Do not have calib line mapping !!!" ); + return StatusCode::FAILURE; + } + for ( unsigned k=0 ; k<m_keylist.size() ; k++ ) { const std::string& key = m_keylist[k] ; @@ -156,7 +163,7 @@ StatusCode LArCaliWaves2Ntuple::stop() const LArCaliWave& wave=*cwv_it; if (wave.isEmpty()) continue; if (m_addCorrUndo) m_corrUndo=0; - bool skip=writeEntry(chid,igain,wave); + bool skip=writeEntry(chid,igain,wave,clCont); if (skip) continue; sc=ntupleSvc()->writeRecord(m_nt); if (sc!=StatusCode::SUCCESS) { @@ -181,7 +188,7 @@ StatusCode LArCaliWaves2Ntuple::stop() LArCaliWaveVec::const_iterator cwv_it_e=cwv.end(); for (;cwv_it!=cwv_it_e;++cwv_it) { const LArCaliWave& wave=*cwv_it; - bool skip=writeEntry(chid,igain,wave); + bool skip=writeEntry(chid,igain,wave,clCont); if (skip) continue; sc=ntupleSvc()->writeRecord(m_nt); if (sc!=StatusCode::SUCCESS) { @@ -199,7 +206,7 @@ StatusCode LArCaliWaves2Ntuple::stop() -bool LArCaliWaves2Ntuple::writeEntry(const HWIdentifier chid, const unsigned gain, const LArCaliWave& wave) { +bool LArCaliWaves2Ntuple::writeEntry(const HWIdentifier chid, const unsigned gain, const LArCaliWave& wave,const LArCalibLineMapping *clCont) { //call fill method of base-class fillWave(chid,wave); m_dac = wave.getDAC(); @@ -225,7 +232,7 @@ bool LArCaliWaves2Ntuple::writeEntry(const HWIdentifier chid, const unsigned gai /// HEC calibration lines if ( !m_isSC ) { - const std::vector<HWIdentifier>& calibLineV = ((LArCablingService*)m_larCablingSvc)->calibSlotLine(chid); + const std::vector<HWIdentifier>& calibLineV = clCont->calibSlotLine(chid); if ( calibLineV.size()>0 ) { (*m_log) << MSG::DEBUG << "wave.getIsPulsedInt() " << wave.getIsPulsedInt()<<" : "<< calibLineV.size()<< endmsg; for(int i=0;i<4;i++) diff --git a/LArCalorimeter/LArCalibTools/src/LArCond2NtupleBase.cxx b/LArCalorimeter/LArCalibTools/src/LArCond2NtupleBase.cxx index 4bdf5b691bc..9169e3fac4d 100644 --- a/LArCalorimeter/LArCalibTools/src/LArCond2NtupleBase.cxx +++ b/LArCalorimeter/LArCalibTools/src/LArCond2NtupleBase.cxx @@ -13,9 +13,8 @@ LArCond2NtupleBase::LArCond2NtupleBase(const std::string& name, ISvcLocator* pSvcLocator): AthAlgorithm(name, pSvcLocator), m_initialized(false), m_nt(NULL), m_log(NULL), m_detStore(NULL), m_emId(NULL), m_hecId(NULL), m_fcalId(NULL),m_onlineId(NULL),m_caloId(NULL), - m_larCablingSvc(NULL), m_badChanTool("LArBadChanTool"),m_FEBTempTool("LArFEBTempTool"), m_isSC(false) + m_FEBTempTool("LArFEBTempTool"), m_isSC(false) { - declareProperty("BadChannelTool",m_badChanTool); declareProperty("AddBadChannelInfo",m_addBC=true); declareProperty("AddFEBTempInfo",m_addFEBTemp=false); declareProperty("isSC",m_isSC); @@ -66,12 +65,6 @@ StatusCode LArCond2NtupleBase::initialize() { m_detStore= &(*detStore()); //for backward compatiblity - //StatusCode sc=service("DetectorStore",m_detStore); - //if (sc!=StatusCode::SUCCESS) { - // (*m_log) << MSG::ERROR << "Cannot get DetectorStore!" << endmsg; - // return sc; - //} - const CaloIdManager *caloIdMgr=CaloIdManager::instance() ; if ( m_isSC ){ m_emId=caloIdMgr->getEM_SuperCell_ID(); @@ -112,41 +105,19 @@ StatusCode LArCond2NtupleBase::initialize() { ATH_MSG_DEBUG("Found the LArOnlineID helper"); } - ToolHandle<LArSuperCellCablingTool> tool("LArSuperCellCablingTool"); - sc = tool.retrieve(); - if (sc!=StatusCode::SUCCESS) { - msg(MSG::ERROR) << " Can't get LArCablingSvc." << endmsg; - return sc; - } else m_larCablingSvc = (LArCablingBase*)&(*tool); - } else { // m_isSC - const LArOnlineID* ll; - sc = detStore()->retrieve(ll, "LArOnlineID"); - if (sc.isFailure()) { - msg(MSG::ERROR) << "Could not get LArOnlineID helper !" << endmsg; - return StatusCode::FAILURE; - } - else { + const LArOnlineID* ll; + sc = detStore()->retrieve(ll, "LArOnlineID"); + if (sc.isFailure()) { + msg(MSG::ERROR) << "Could not get LArOnlineID helper !" << endmsg; + return StatusCode::FAILURE; + } else { m_onlineId = (const LArOnlineID_Base*)ll; ATH_MSG_DEBUG(" Found the LArOnlineID helper. "); } - ToolHandle<LArCablingService> tool("LArCablingService"); - sc = tool.retrieve(); - if (sc!=StatusCode::SUCCESS) { - msg(MSG::ERROR) << " Can't get LArCablingSvc." << endmsg; - return sc; - } else m_larCablingSvc = (LArCablingBase*)&(*tool); } // end of m_isSC if - if (m_addBC) { - sc = m_badChanTool.retrieve(); - if (sc!=StatusCode::SUCCESS) { - msg(MSG::ERROR) << " Can't get BadChanTool." << endmsg; - return sc; - } - } - if (m_addFEBTemp) { sc = m_FEBTempTool.retrieve(); if (sc!=StatusCode::SUCCESS) { @@ -155,6 +126,10 @@ StatusCode LArCond2NtupleBase::initialize() { } } + ATH_CHECK( m_BCKey.initialize() ); + ATH_CHECK( m_cablingKey.initialize() ); + ATH_CHECK( m_calibMapKey.initialize() ); + //Online-identifier variables sc=nt->addItem("channelId",m_onlChanId,0x38000000,0x3A000000); if (sc!=StatusCode::SUCCESS) { @@ -293,6 +268,25 @@ StatusCode LArCond2NtupleBase::initialize() { bool LArCond2NtupleBase::fillFromIdentifier(const HWIdentifier& hwid) { + SG::ReadCondHandle<LArBadChannelCont> readHandle{m_BCKey}; + const LArBadChannelCont *bcCont {*readHandle}; + if(m_addBC && !bcCont) { + ATH_MSG_WARNING( "Do not have Bad chan container " << m_BCKey.key() ); + return false; + } + SG::ReadCondHandle<LArCalibLineMapping> clHdl{m_calibMapKey}; + const LArCalibLineMapping *clCont {*clHdl}; + if(!clCont) { + ATH_MSG_WARNING( "Do not have calib line mapping !!!" ); + return false; + } + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling=*cablingHdl; + if(!cabling) { + ATH_MSG_WARNING( "Do not have cabling !" ); + return false; + } + m_onlChanId = hwid.get_identifier32().get_compact(); m_barrel_ec = m_onlineId->barrel_ec(hwid); @@ -308,7 +302,7 @@ bool LArCond2NtupleBase::fillFromIdentifier(const HWIdentifier& hwid) { if ( !m_isSC) { m_calibLine=NOT_VALID; - const std::vector<HWIdentifier>& calibLineV=((LArCablingService*)m_larCablingSvc)->calibSlotLine(hwid); + const std::vector<HWIdentifier>& calibLineV=clCont->calibSlotLine(hwid); if(calibLineV.size()) m_calibLine = m_onlineId->channel(calibLineV[0]); } @@ -323,8 +317,8 @@ bool LArCond2NtupleBase::fillFromIdentifier(const HWIdentifier& hwid) { bool connected=false; try { - if (m_larCablingSvc->isOnlineConnected(hwid)) { - Identifier id=m_larCablingSvc->cnvToIdentifier(hwid); + if (cabling->isOnlineConnected(hwid)) { + Identifier id=cabling->cnvToIdentifier(hwid); if ( m_OffId ) { m_oflChanId = id.get_identifier32().get_compact(); if (m_addHash) @@ -357,7 +351,7 @@ bool LArCond2NtupleBase::fillFromIdentifier(const HWIdentifier& hwid) { }catch (LArID_Exception & except) {} //bad-channel word - if (m_addBC) m_badChanWord=m_badChanTool->status(hwid).packedData(); + if (m_addBC) m_badChanWord=bcCont->status(hwid).packedData(); // FEB temperatures if (m_addFEBTemp) { FEBTemp tv = m_FEBTempTool->getFebTemp(hwid); diff --git a/LArCalorimeter/LArCalibTools/src/LArHVScaleCorr2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/LArHVScaleCorr2Ntuple.cxx index cf4b3176074..53a4875b679 100644 --- a/LArCalorimeter/LArCalibTools/src/LArHVScaleCorr2Ntuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/LArHVScaleCorr2Ntuple.cxx @@ -38,13 +38,19 @@ StatusCode LArHVScaleCorr2Ntuple::stop() { return StatusCode::FAILURE; } + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling=*cablingHdl; + if(!cabling) { + ATH_MSG_WARNING( "Do not have cabling object LArOnOffIdMapping" ); + return StatusCode::FAILURE; + } unsigned cellCounter=0; std::vector<HWIdentifier>::const_iterator itOnId = m_onlineId->channel_begin(); std::vector<HWIdentifier>::const_iterator itOnIdEnd = m_onlineId->channel_end(); for(; itOnId!=itOnIdEnd;++itOnId){ const HWIdentifier hwid = *itOnId; - if (m_larCablingSvc->isOnlineConnected(hwid)) { + if (cabling->isOnlineConnected(hwid)) { float value=larHVScaleCorr->HVScaleCorr(hwid); if (value > ILArHVScaleCorr::ERRORCODE) { // check for ERRORCODE fillFromIdentifier(hwid); diff --git a/LArCalorimeter/LArCalibTools/src/LArMinBias2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/LArMinBias2Ntuple.cxx index 6111a8b9b22..3d097dd8410 100644 --- a/LArCalorimeter/LArCalibTools/src/LArMinBias2Ntuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/LArMinBias2Ntuple.cxx @@ -40,6 +40,12 @@ StatusCode LArMinBias2Ntuple::stop() { NTuple::Item<float> minbias; NTuple::Item<float> minbias_av; + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling=*cablingHdl; + if(!cabling) { + ATH_MSG_WARNING( "Do not have cabling object LArOnOffIdMapping" ); + return StatusCode::FAILURE; + } if(!m_isPileup) ATH_CHECK( m_nt->addItem("MinBias",minbias) ); ATH_CHECK( m_nt->addItem("MinBiasAv",minbias_av) ); @@ -49,7 +55,7 @@ StatusCode LArMinBias2Ntuple::stop() { std::vector<HWIdentifier>::const_iterator itOnIdEnd = m_onlineId->channel_end(); for(; itOnId!=itOnIdEnd;++itOnId){ const HWIdentifier hwid = *itOnId; - if ( m_larCablingSvc->isOnlineConnected(hwid)) { + if ( cabling->isOnlineConnected(hwid)) { fillFromIdentifier(hwid); if(!m_isPileup) minbias = LArMinBias->minBiasRMS(hwid); minbias_av = LArMinBiasAv->minBiasAverage(hwid); diff --git a/LArCalorimeter/LArCalibTools/src/LArMphysOverMcal2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/LArMphysOverMcal2Ntuple.cxx index 7fa4fbaa5b6..2d96cc2b1c1 100644 --- a/LArCalorimeter/LArCalibTools/src/LArMphysOverMcal2Ntuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/LArMphysOverMcal2Ntuple.cxx @@ -60,13 +60,20 @@ StatusCode LArMphysOverMcal2Ntuple::stop() { } + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling=*cablingHdl; + if(!cabling) { + ATH_MSG_WARNING( "Do not have cabling object LArOnOffIdMapping" ); + return StatusCode::FAILURE; + } + unsigned cellCounter=0; for(long igain=CaloGain::LARHIGHGAIN; igain<CaloGain::LARNGAIN; igain++) { std::vector<HWIdentifier>::const_iterator itOnId = m_onlineId->channel_begin(); std::vector<HWIdentifier>::const_iterator itOnIdEnd = m_onlineId->channel_end(); for(; itOnId!=itOnIdEnd;++itOnId){ const HWIdentifier hwid = *itOnId; - if ( m_larCablingSvc->isOnlineConnected(hwid) && !m_onlineId->isFCALchannel(hwid)) { + if ( cabling->isOnlineConnected(hwid) && !m_onlineId->isFCALchannel(hwid)) { fillFromIdentifier(hwid); cellIndex = cellCounter; gain=igain; diff --git a/LArCalorimeter/LArCalibTools/src/LArNoise2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/LArNoise2Ntuple.cxx index de49381407d..84035dcb308 100644 --- a/LArCalorimeter/LArCalibTools/src/LArNoise2Ntuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/LArNoise2Ntuple.cxx @@ -61,6 +61,12 @@ StatusCode LArNoise2Ntuple::stop() { return StatusCode::FAILURE; } + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling=*cablingHdl; + if(!cabling) { + ATH_MSG_WARNING( "Do not have cabling object LArOnOffIdMapping" ); + return StatusCode::FAILURE; + } unsigned cellCounter=0; for(long igain=CaloGain::LARHIGHGAIN; igain<CaloGain::LARNGAIN; igain++) { @@ -68,7 +74,7 @@ StatusCode LArNoise2Ntuple::stop() { std::vector<HWIdentifier>::const_iterator itOnIdEnd = m_onlineId->channel_end(); for(; itOnId!=itOnIdEnd;++itOnId){ const HWIdentifier hwid = *itOnId; - if ( m_larCablingSvc->isOnlineConnected(hwid)) { + if ( cabling->isOnlineConnected(hwid)) { fillFromIdentifier(hwid); cellIndex = cellCounter; gain=igain; diff --git a/LArCalorimeter/LArCalibTools/src/LArOFC2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/LArOFC2Ntuple.cxx index a848ae50e6d..a76e97f8e4f 100755 --- a/LArCalorimeter/LArCalibTools/src/LArOFC2Ntuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/LArOFC2Ntuple.cxx @@ -96,6 +96,13 @@ StatusCode LArOFC2Ntuple::stop() { } } + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling=*cablingHdl; + if(!cabling) { + ATH_MSG_WARNING( "Do not have cabling object LArOnOffIdMapping" ); + return StatusCode::FAILURE; + } + unsigned cellCounter=0; for ( unsigned igain=CaloGain::LARHIGHGAIN; igain<CaloGain::LARNGAIN ; ++igain ) { @@ -104,7 +111,7 @@ StatusCode LArOFC2Ntuple::stop() { if ( m_isMC ) { for (;it!=it_e;it++) { const HWIdentifier chid = *it; - if (!m_larCablingSvc->isOnlineConnected(chid)) continue; + if (!cabling->isOnlineConnected(chid)) continue; (*m_log) << MSG::VERBOSE << "Dumping OFC for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec << endmsg; ILArOFC::OFCRef_t ofc_a=m_OFCTool->OFC_a(chid,igain); @@ -131,7 +138,7 @@ StatusCode LArOFC2Ntuple::stop() { } else { // is_MC for (;it!=it_e;it++) { const HWIdentifier chid = *it; - if ( !m_larCablingSvc->isOnlineConnected(chid)) continue; + if ( !cabling->isOnlineConnected(chid)) continue; (*m_log) << MSG::VERBOSE << "Dumping OFC for channel 0x" << MSG::hex << chid.get_compact() << MSG::dec << endmsg; for (unsigned iphase=0;iphase<larOFC->nTimeBins(chid,igain);iphase++) { diff --git a/LArCalorimeter/LArCalibTools/src/LArRamps2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/LArRamps2Ntuple.cxx index 90e3e2961c1..89676728907 100755 --- a/LArCalorimeter/LArCalibTools/src/LArRamps2Ntuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/LArRamps2Ntuple.cxx @@ -296,6 +296,12 @@ StatusCode LArRamps2Ntuple::stop() { }//end-if rampComplete + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling=*cablingHdl; + if(!cabling) { + ATH_MSG_WARNING( "Do not have cabling object LArOnOffIdMapping" ); + return StatusCode::FAILURE; + } unsigned cellCounter=0; if (hasRawRampContainer) { //Loop over raw ramp container and fill ntuple @@ -353,7 +359,7 @@ StatusCode LArRamps2Ntuple::stop() { unsigned igain = (unsigned)(*cont_it)->gain(); gain = igain; if (m_addCorrUndo) corrUndo=0; - if (ramp && m_larCablingSvc->isOnlineConnected(chid)) { + if (ramp && cabling->isOnlineConnected(chid)) { //FT move to here fillFromIdentifier(chid); @@ -404,7 +410,7 @@ StatusCode LArRamps2Ntuple::stop() { std::vector<HWIdentifier>::const_iterator it_e = m_onlineId->channel_end(); for (;it!=it_e;it++) { const HWIdentifier chid=*it; - if (m_larCablingSvc->isOnlineConnected(chid)) { + if (cabling->isOnlineConnected(chid)) { gain = (long)igain; if (m_addCorrUndo) corrUndo = 0; const ILArRamp::RampRef_t rampcoeff=ramp->ADC2DAC(chid, gain); diff --git a/LArCalorimeter/LArCalibTools/src/LArShape2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/LArShape2Ntuple.cxx index 1df88891dd5..03a465a3151 100644 --- a/LArCalorimeter/LArCalibTools/src/LArShape2Ntuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/LArShape2Ntuple.cxx @@ -100,6 +100,13 @@ StatusCode LArShape2Ntuple::stop() { } } + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling=*cablingHdl; + if(!cabling) { + ATH_MSG_WARNING( "Do not have cabling object LArOnOffIdMapping" ); + return StatusCode::FAILURE; + } + unsigned cellCounter=0; for ( unsigned igain=CaloGain::LARHIGHGAIN; igain<CaloGain::LARNGAIN ; ++igain ) { @@ -107,7 +114,7 @@ StatusCode LArShape2Ntuple::stop() { std::vector<HWIdentifier>::const_iterator it_e = m_onlineId->channel_end(); for (;it!=it_e;it++) { const HWIdentifier chid = *it; - if (!m_larCablingSvc->isOnlineConnected(chid)) continue; + if (!cabling->isOnlineConnected(chid)) continue; unsigned nPhase=1; if (larShapeComplete) nPhase=larShapeComplete->nTimeBins(chid,gain); for (unsigned iphase=0;iphase<nPhase;iphase++) { diff --git a/LArCalorimeter/LArCalibTools/src/LArfSampl2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/LArfSampl2Ntuple.cxx index 308125d6ba7..54991bb012c 100644 --- a/LArCalorimeter/LArCalibTools/src/LArfSampl2Ntuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/LArfSampl2Ntuple.cxx @@ -51,13 +51,19 @@ StatusCode LArfSampl2Ntuple::stop() { return StatusCode::FAILURE; } + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling=*cablingHdl; + if(!cabling) { + ATH_MSG_WARNING( "Do not have cabling object LArOnOffIdMapping" ); + return StatusCode::FAILURE; + } unsigned cellCounter=0; std::vector<HWIdentifier>::const_iterator itOnId = m_onlineId->channel_begin(); std::vector<HWIdentifier>::const_iterator itOnIdEnd = m_onlineId->channel_end(); for(; itOnId!=itOnIdEnd;++itOnId){ const HWIdentifier hwid = *itOnId; - if ( m_larCablingSvc->isOnlineConnected(hwid)) { + if ( cabling->isOnlineConnected(hwid)) { fillFromIdentifier(hwid); cellIndex = cellCounter; fsampl = larfSampl->FSAMPL(hwid); diff --git a/LArCalorimeter/LArCalibTools/src/LAruA2MeV2Ntuple.cxx b/LArCalorimeter/LArCalibTools/src/LAruA2MeV2Ntuple.cxx index 928fafc4fcb..b732d1f88f9 100755 --- a/LArCalorimeter/LArCalibTools/src/LAruA2MeV2Ntuple.cxx +++ b/LArCalorimeter/LArCalibTools/src/LAruA2MeV2Ntuple.cxx @@ -62,12 +62,19 @@ StatusCode LAruA2MeV2Ntuple::stop() { return StatusCode::FAILURE; } + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling=*cablingHdl; + if(!cabling) { + ATH_MSG_WARNING( "Do not have cabling object LArOnOffIdMapping" ); + return StatusCode::FAILURE; + } + std::vector<HWIdentifier>::const_iterator itOnId = m_onlineId->channel_begin(); std::vector<HWIdentifier>::const_iterator itOnIdEnd = m_onlineId->channel_end(); unsigned cellCounter=0; for(; itOnId!=itOnIdEnd;++itOnId){ const HWIdentifier hwid = *itOnId; - if (m_larCablingSvc->isOnlineConnected(hwid)) { + if (cabling->isOnlineConnected(hwid)) { uA2MeV=laruA2MeVComplete->UA2MEV(hwid); if(m_DAC2uAKey != "") DAC2uA=larDAC2uAComplete->DAC2UA(hwid); fillFromIdentifier(hwid); diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArAutoCorrExtrapolate.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArAutoCorrExtrapolate.h index 60169d7b6c9..49bbe1a41c1 100755 --- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArAutoCorrExtrapolate.h +++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArAutoCorrExtrapolate.h @@ -19,10 +19,11 @@ // Include files #include "AthenaBaseComps/AthAlgorithm.h" -#include "GaudiKernel/ToolHandle.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArBadChannelCont.h" + class LArOnlineID; -class ILArBadChanTool; //----------------------------------------------------------------------- class LArAutoCorrExtrapolate : public AthAlgorithm @@ -48,6 +49,7 @@ class LArAutoCorrExtrapolate : public AthAlgorithm private: + SG::ReadCondHandleKey<LArBadFebCont> m_BFKey { this, "MissingFebsKey", "LArBadFeb", "SG Key of LArBadFebCont object"}; // Container key list std::string m_keyoutput; std::string m_keyPedestal; @@ -59,7 +61,6 @@ class LArAutoCorrExtrapolate : public AthAlgorithm const LArOnlineID* m_onlineId; - ToolHandle<ILArBadChanTool> m_badChannelTool; bool m_useBad; diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibCopyAlg.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibCopyAlg.h index ea50d74c6fc..c146795fcad 100644 --- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibCopyAlg.h +++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibCopyAlg.h @@ -20,7 +20,6 @@ #include "AthenaBaseComps/AthAlgorithm.h" #include "GaudiKernel/ToolHandle.h" -#include "LArRecConditions/ILArBadChanTool.h" #include "LArRecConditions/ILArBadChannelMasker.h" #include "LArRawConditions/LArMphysOverMcalComplete.h" #include "LArRawConditions/LArRampComplete.h" diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibPatchingAlg.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibPatchingAlg.h index 1cd9b42d603..94ad7a68a66 100644 --- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibPatchingAlg.h +++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibPatchingAlg.h @@ -20,11 +20,14 @@ #include "AthenaBaseComps/AthAlgorithm.h" #include "GaudiKernel/ToolHandle.h" -#include "LArRecConditions/ILArBadChanTool.h" #include "LArRecConditions/ILArBadChannelMasker.h" #include "LArRawConditions/LArMphysOverMcalComplete.h" #include "LArRawConditions/LArRampComplete.h" #include "LArRawConditions/LArOFCComplete.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArBadChannelCont.h" +#include "LArCabling/LArOnOffIdMapping.h" + /** @@ -88,7 +91,7 @@ private: * @return bool to tell if patching suceeded * This method is called for every channel with broken calibration line */ - bool patch(const HWIdentifier chid, const int gain); + bool patch(const HWIdentifier chid, const int gain, const LArBadChannelCont* bcCont, const LArOnOffIdMapping* cabling); /** @@ -97,7 +100,7 @@ private: * @param gain Gain in question * @patch [OUT] Reference to be filled by the average */ - bool getAverage(const HWIdentifier chid, const int gain, LArRampP1& patch, bool isphi=true); + bool getAverage(const HWIdentifier chid, const int gain, LArRampP1& patch, const LArBadChannelCont* bcCont, const LArOnOffIdMapping* cabling, bool isphi=true); /** * @brief Specialized method to average OFCs over a phi-ring @@ -105,7 +108,7 @@ private: * @param gain Gain in question * @patch [OUT] Reference to be filled by the average */ - bool getAverage(const HWIdentifier chid, const int gain, LArOFCP1& patch, bool isphi=true); + bool getAverage(const HWIdentifier chid, const int gain, LArOFCP1& patch, const LArBadChannelCont* bcCont, const LArOnOffIdMapping* cabling, bool isphi=true); @@ -124,7 +127,7 @@ private: */ //For backward compatiblity only!!! Will be removed at some point - bool getAverage(const HWIdentifier chid, const int gain, LArMphysOverMcalP1& patch, bool isphi=true); + bool getAverage(const HWIdentifier chid, const int gain, LArMphysOverMcalP1& patch, const LArBadChannelCont* bcCont, bool isphi=true); #endif @@ -135,21 +138,14 @@ private: * @param gain Gain in question * @patch [OUT] Reference to be filled by the average */ - bool getAverage(const HWIdentifier chid, const int gain, LArSingleFloatP& patch, bool isphi=true); + bool getAverage(const HWIdentifier chid, const int gain, LArSingleFloatP& patch, const LArBadChannelCont* bcCont, const LArOnOffIdMapping* cabling, bool isphi=true); #endif - //bool getAverage(const HWIdentifier chid, const int gain, LArShape& shape); - bool getAverage(const HWIdentifier,const int, LArCaliWaveVec&, bool isphi=true) ; -/* - bool getAverage(const HWIdentifier,const int, LArCaliWaveVec&) { - //Not implementend and should never be called. - assert(0); - return false; - }; -*/ + bool getAverage(const HWIdentifier,const int, LArCaliWaveVec&, const LArBadChannelCont* bcCont, const LArOnOffIdMapping* cabling, bool isphi=true) ; + /** * @brief Helper method to get a phi-ring * @return Reference to a vector of HWIdentfiers @@ -157,10 +153,10 @@ private: * @param distance Step-with in phi. 1..every channel, 2..every second channel, etc. * Probably meaningless for the FCAL */ - std::vector<HWIdentifier>& getPhiRing(const HWIdentifier chid, unsigned distance=1); + std::vector<HWIdentifier>& getPhiRing(const HWIdentifier chid, const LArBadChannelCont* bcCont, const LArOnOffIdMapping* cabling, unsigned distance=1); /* Get list of channels in the same FEB. Used for FEBAverage method */ - std::vector<HWIdentifier>& getFEBChans(const HWIdentifier chid); + std::vector<HWIdentifier>& getFEBChans(const HWIdentifier chid, const LArBadChannelCont* bcCont); StatusCode setSymlink(const LArRampComplete* ramp) const; StatusCode setSymlink(const LArOFCComplete* ofc) const; @@ -175,9 +171,9 @@ private: FEBAverage }; - ToolHandle<ILArBadChanTool> m_badChannelTool; + SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"}; + SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this, "OnOffMap", "LArOnOffIdMap", "SG key for mapping object"}; ToolHandle<ILArBadChannelMasker> m_maskingTool; - ToolHandle<LArCablingService> m_larCablingSvc; bool m_useCorrChannel; bool m_patchAllMissing; diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibPatchingAlg.icc b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibPatchingAlg.icc index efdf43d6d05..3c21a961508 100644 --- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibPatchingAlg.icc +++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibPatchingAlg.icc @@ -7,9 +7,7 @@ template<class CONDITIONSCONTAINER> LArCalibPatchingAlg<CONDITIONSCONTAINER>::LArCalibPatchingAlg (const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name,pSvcLocator), - m_badChannelTool("LArBadChanTool"), m_maskingTool("LArBadChannelMaskingTool"), - m_larCablingSvc("LArCablingService"), m_useCorrChannel(true), m_patchAllMissing(false), m_onlineHelper(0), @@ -26,8 +24,6 @@ LArCalibPatchingAlg<CONDITIONSCONTAINER>::LArCalibPatchingAlg (const std::string "Method to patch conditions for channels with broken calibration line"); declareProperty("NewContainerKey",m_newContainerKey="", "If the corrections go in a separate container put SG key here"); - declareProperty("BadChannelTool",m_badChannelTool, - "BadChannelTool to be used"); declareProperty("MaskingTool",m_maskingTool, "Masking tool to define channels that should be set to zero"); declareProperty("UseCorrChannels",m_useCorrChannel, @@ -46,6 +42,10 @@ LArCalibPatchingAlg<CONDITIONSCONTAINER>::~LArCalibPatchingAlg() { template<class CONDITIONSCONTAINER> StatusCode LArCalibPatchingAlg<CONDITIONSCONTAINER>::initialize() { + + ATH_CHECK( m_BCKey.initialize() ); + ATH_CHECK( m_cablingKey.initialize() ); + if(m_patchMethodProp=="FEBNeighbor") { m_patchMethod=FEBNeighbor; return StatusCode::SUCCESS; @@ -88,9 +88,19 @@ StatusCode LArCalibPatchingAlg<CONDITIONSCONTAINER>::stop() { ATH_CHECK( detStore()->retrieve(m_fcalId, "LArFCAL_ID") ); ATH_CHECK( detStore()->retrieve(m_caloId, "CaloCell_ID") ); - ATH_CHECK( m_badChannelTool.retrieve() ); - ATH_CHECK( m_larCablingSvc.retrieve() ); ATH_CHECK( m_maskingTool.retrieve() ); + SG::ReadCondHandle<LArBadChannelCont> readHandle{m_BCKey}; + const LArBadChannelCont *bcCont {*readHandle}; + if(!bcCont) { + ATH_MSG_ERROR( "Do not have Bad chan container !!!" ); + return StatusCode::FAILURE; + } + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling = *cablingHdl; + if(!cabling) { + ATH_MSG_ERROR( "Do not have OnOff Id mapping !!!" ); + return StatusCode::FAILURE; + } if (m_newContainerKey.size()) { //New container key give -> different containers for reading and writing @@ -121,11 +131,11 @@ StatusCode LArCalibPatchingAlg<CONDITIONSCONTAINER>::stop() { CONTIT it_e=m_contIn->end(igain); for (;it!=it_e;it++) { const HWIdentifier chid = it.channelId(); - if (!m_larCablingSvc->isOnlineConnected(chid)) continue; //Don't care about disconnected channels + if (!cabling->isOnlineConnected(chid)) continue; //Don't care about disconnected channels if (m_maskingTool->cellShouldBeMasked(chid)) { ATH_MSG_INFO ( "Found problematic channel 0x" << MSG::hex << chid.get_compact() << MSG::dec <<" Gain:" << igain << " " << m_onlineHelper->channel_name(chid) << ". Trying to patch." ); - if (patch(chid,igain)) { + if (patch(chid,igain, bcCont, cabling)) { ATH_MSG_INFO ( "Sucessfully patched channel 0x" << MSG::hex << chid.get_compact() << MSG::dec <<" Gain:" << igain ); } else { ATH_MSG_WARNING ( "Failed to patch channel 0x" << MSG::hex << chid.get_compact() << MSG::dec <<" Gain:" << igain ); @@ -138,7 +148,7 @@ StatusCode LArCalibPatchingAlg<CONDITIONSCONTAINER>::stop() { << " has no calibration but is not (yet?) flagged in the bad-channel database" ); if (m_patchAllMissing) { ATH_MSG_INFO ( "Will try to patch anyway." ); - if (patch(chid,igain)) { + if (patch(chid,igain, bcCont, cabling)) { ATH_MSG_INFO ( "Sucessfully patched channel 0x" << MSG::hex << chid.get_compact() << MSG::dec <<" Gain:" << igain ); } else { ATH_MSG_WARNING ( "Failed to patch channel 0x" << MSG::hex << chid.get_compact() << MSG::dec <<" Gain:" << igain ); @@ -165,7 +175,7 @@ StatusCode LArCalibPatchingAlg<CONDITIONSCONTAINER>::stop() { } template<class CONDITIONSCONTAINER> -bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::patch(const HWIdentifier chid, const int gain) { +bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::patch(const HWIdentifier chid, const int gain, const LArBadChannelCont* bcCont, const LArOnOffIdMapping* cabling) { if (m_patchMethod==FEBNeighbor){ const HWIdentifier febId=m_onlineHelper->feb_Id(chid); const int febChan=m_onlineHelper->channel(chid); @@ -173,7 +183,7 @@ bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::patch(const HWIdentifier chid, co if (febChan>0) { //try lower channel chid_patch=m_onlineHelper->channel_Id(febId, febChan-1); - if (m_larCablingSvc->isOnlineConnected(chid_patch) && m_badChannelTool->status(chid_patch).good()) { + if (cabling->isOnlineConnected(chid_patch) && bcCont->status(chid_patch).good()) { const LArCondObj patch=m_contIn->get(chid_patch,gain); //Should be the const-get method if (!patch.isEmpty()) { StatusCode sc=m_contOut->insertCorrection(chid,patch,gain,m_useCorrChannel); @@ -189,7 +199,7 @@ bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::patch(const HWIdentifier chid, co }//end if febChan if (febChan<(m_onlineHelper->channelInSlotMax(febId)-1)) { chid_patch=m_onlineHelper->channel_Id(febId, febChan+1); - if (m_larCablingSvc->isOnlineConnected(chid_patch) && m_badChannelTool->status(chid_patch).good()) { + if (cabling->isOnlineConnected(chid_patch) && bcCont->status(chid_patch).good()) { const LArCondObj patch=m_contIn->get(chid_patch,gain); //Should be the const-get method if (!patch.isEmpty()) { StatusCode sc=m_contOut->insertCorrection(chid,patch,gain,m_useCorrChannel); @@ -210,7 +220,7 @@ bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::patch(const HWIdentifier chid, co } else if (m_patchMethod==PhiNeighbor) { // (*m_log) << MSG::ERROR << "Patching Method 'Phi-neighbor' not yet implemented." << endmsg; try { - const Identifier id=m_larCablingSvc->cnvToIdentifier(chid); + const Identifier id=cabling->cnvToIdentifier(chid); int eta, phi, phi_min, phi_max, phi_range; Identifier regionID; regionID=m_caloId->region_id(id); @@ -236,8 +246,8 @@ bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::patch(const HWIdentifier chid, co //std::cout << "i=" << i << " Using cell with phi=" // << phi_patch << " eta=" << eta << std::endl; Identifier patch_id=m_caloId->cell_id(regionID,eta,phi_patch); - HWIdentifier chid_patch=m_larCablingSvc->createSignalChannelID(patch_id); - if (m_badChannelTool->status(chid_patch).good()) { + HWIdentifier chid_patch=cabling->createSignalChannelID(patch_id); + if (bcCont->status(chid_patch).good()) { const LArCondObj patch=m_contIn->get(chid_patch,gain); if (!patch.isEmpty()) { StatusCode sc=m_contOut->insertCorrection(chid,patch,gain,m_useCorrChannel); @@ -261,7 +271,7 @@ bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::patch(const HWIdentifier chid, co } else if (m_patchMethod==PhiAverage) { LArCondObj patch; - if (!getAverage(chid,gain,patch)){ + if (!getAverage(chid,gain,patch,bcCont,cabling)){ ATH_MSG_ERROR ( "Failed get phi-average!" ); return false; } else { @@ -272,7 +282,7 @@ bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::patch(const HWIdentifier chid, co } else if (m_patchMethod==FEBAverage) { LArCondObj patch; - if (!getAverage(chid,gain,patch,false)){ + if (!getAverage(chid,gain,patch,bcCont, cabling, false)){ ATH_MSG_ERROR ( "Failed get FEB-average!" ); return false; } else { @@ -288,11 +298,11 @@ bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::patch(const HWIdentifier chid, co template<class CONDITIONSCONTAINER> -std::vector<HWIdentifier>& LArCalibPatchingAlg<CONDITIONSCONTAINER>::getPhiRing(const HWIdentifier chid, unsigned distance) { +std::vector<HWIdentifier>& LArCalibPatchingAlg<CONDITIONSCONTAINER>::getPhiRing(const HWIdentifier chid, const LArBadChannelCont* bcCont, const LArOnOffIdMapping* cabling, unsigned distance) { if (distance==0) distance=1; m_idList.clear(); try { - const Identifier id=m_larCablingSvc->cnvToIdentifier(chid); + const Identifier id=cabling->cnvToIdentifier(chid); int eta,phi, phi_min, phi_max; Identifier regionID; regionID=m_caloId->region_id(id); @@ -323,8 +333,8 @@ std::vector<HWIdentifier>& LArCalibPatchingAlg<CONDITIONSCONTAINER>::getPhiRing( //std::cout << "i=" << i << " Adding cell with phi=" // << phi_patch << " eta=" << eta << std::endl; Identifier patch_id=m_caloId->cell_id(regionID,eta,phi_patch); - HWIdentifier chid_patch=m_larCablingSvc->createSignalChannelID(patch_id); - if (m_badChannelTool->status(chid_patch).good()) { + HWIdentifier chid_patch=cabling->createSignalChannelID(patch_id); + if (bcCont->status(chid_patch).good()) { m_idList.push_back(chid_patch); } else @@ -338,7 +348,7 @@ std::vector<HWIdentifier>& LArCalibPatchingAlg<CONDITIONSCONTAINER>::getPhiRing( } template<class CONDITIONSCONTAINER> -std::vector<HWIdentifier>& LArCalibPatchingAlg<CONDITIONSCONTAINER>::getFEBChans(const HWIdentifier chid) { +std::vector<HWIdentifier>& LArCalibPatchingAlg<CONDITIONSCONTAINER>::getFEBChans(const HWIdentifier chid, const LArBadChannelCont* bcCont) { m_idList.clear(); HWIdentifier febid = m_onlineHelper->feb_Id(chid); ATH_MSG_VERBOSE ( "Assembling list of channels for FEB=" << febid ); @@ -346,7 +356,7 @@ std::vector<HWIdentifier>& LArCalibPatchingAlg<CONDITIONSCONTAINER>::getFEBChans HWIdentifier fchan = m_onlineHelper->channel_Id(febid,i); if(fchan == chid) continue; //try { - //const Identifier id=m_larCablingSvc->cnvToIdentifier(chid); + //const Identifier id=cabling->cnvToIdentifier(chid); //if(m_onlineHelper->isEMBchannel(chid) || m_onlineHelper->isEMECchannel(chid)) { // if(!m_emId->is_connected(id)) continue; //} else if (m_onlineHelper->isHECchannel(chid)) { @@ -358,7 +368,7 @@ std::vector<HWIdentifier>& LArCalibPatchingAlg<CONDITIONSCONTAINER>::getFEBChans // ATH_MSG_ERROR ( "LArID_Exception caught!" ); //} ATH_MSG_VERBOSE ( " Adding channel =" << i ); - if (m_badChannelTool->status(fchan).good()) { + if (bcCont->status(fchan).good()) { m_idList.push_back(fchan); } else { ATH_MSG_VERBOSE ( "This channel is bad as well. Ignored." ); @@ -377,17 +387,17 @@ bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::getAverage(const HWIdentifier, co */ template<class CONDITIONSCONTAINER> -bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::getAverage(const HWIdentifier chid, const int gain, LArRampP1& patch, bool isphi) { +bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::getAverage(const HWIdentifier chid, const int gain, LArRampP1& patch, const LArBadChannelCont* bcCont, const LArOnOffIdMapping* cabling, bool isphi) { std::vector<HWIdentifier>::const_iterator it; std::vector<HWIdentifier>::const_iterator it_e; if(isphi) { - std::vector<HWIdentifier>& symCells=getPhiRing(chid); + std::vector<HWIdentifier>& symCells=getPhiRing(chid, bcCont, cabling); it = symCells.begin(); it_e=symCells.end(); } else { - std::vector<HWIdentifier>& symCells=getFEBChans(chid); + std::vector<HWIdentifier>& symCells=getFEBChans(chid, bcCont); it = symCells.begin(); it_e=symCells.end(); } @@ -439,9 +449,9 @@ bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::getAverage(const HWIdentifier chi template<class CONDITIONSCONTAINER> -bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::getAverage(const HWIdentifier chid, const int gain, LArOFCP1& patch, bool /*isphi*/) { +bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::getAverage(const HWIdentifier chid, const int gain, LArOFCP1& patch, const LArBadChannelCont* bcCont, const LArOnOffIdMapping* cabling, bool /*isphi*/) { - std::vector<HWIdentifier>& symCells=getPhiRing(chid); + std::vector<HWIdentifier>& symCells=getPhiRing(chid, bcCont, cabling); std::vector<HWIdentifier>::const_iterator it=symCells.begin(); std::vector<HWIdentifier>::const_iterator it_e=symCells.end(); @@ -517,9 +527,9 @@ bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::getAverage(const HWIdentifier chi } template<class CONDITIONSCONTAINER> -bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::getAverage(const HWIdentifier chid, const int gain, LArCaliWaveVec& patch, bool /*isphi*/) { +bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::getAverage(const HWIdentifier chid, const int gain, LArCaliWaveVec& patch,const LArBadChannelCont* bcCont, const LArOnOffIdMapping* cabling, bool /*isphi*/) { - std::vector<HWIdentifier>& symCells=getPhiRing(chid); + std::vector<HWIdentifier>& symCells=getPhiRing(chid, bcCont, cabling); std::vector<HWIdentifier>::const_iterator it=symCells.begin(); std::vector<HWIdentifier>::const_iterator it_e=symCells.end(); @@ -587,7 +597,7 @@ bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::getAverage(const HWIdentifier chi patch.clear(); for ( ; it_e != it; it++) { - ATH_MSG_DEBUG ( "Adding ch. "<<*it<<", layer: "<<m_caloId->sampling(m_larCablingSvc->cnvToIdentifier(*it))<<", region: "<<m_caloId->region(m_larCablingSvc->cnvToIdentifier(*it))<<" eta: "<<m_caloId->eta(m_larCablingSvc->cnvToIdentifier(*it))<<", phi: "<<m_caloId->phi(m_larCablingSvc->cnvToIdentifier(*it))); + ATH_MSG_DEBUG ( "Adding ch. "<<*it<<", layer: "<<m_caloId->sampling(cabling->cnvToIdentifier(*it))<<", region: "<<m_caloId->region(cabling->cnvToIdentifier(*it))<<" eta: "<<m_caloId->eta(cabling->cnvToIdentifier(*it))<<", phi: "<<m_caloId->phi(cabling->cnvToIdentifier(*it))); std::vector<LArCaliWave>::const_iterator vecit = m_contIn->get(*it,gain).begin(); std::vector<LArCaliWave>::const_iterator vecit_e = m_contIn->get(*it,gain).end(); @@ -647,9 +657,9 @@ bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::getAverage(const HWIdentifier chi #ifdef LARRAWCONDITIONS_LARMPHYSOVERMCALP template<class CONDITIONSCONTAINER> -bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::getAverage(const HWIdentifier chid, const int gain, LArMphysOverMcalP1& patch, bool isphi) { +bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::getAverage(const HWIdentifier chid, const int gain, LArMphysOverMcalP1& patch, const LArBadChannelCont* bcCont, const LArOnOffIdMapping* cabling, bool isphi) { - std::vector<HWIdentifier>& symCells=getPhiRing(chid); + std::vector<HWIdentifier>& symCells=getPhiRing(chid, bcCont, cabling); std::vector<HWIdentifier>::const_iterator it=symCells.begin(); std::vector<HWIdentifier>::const_iterator it_e=symCells.end(); @@ -677,9 +687,9 @@ bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::getAverage(const HWIdentifier chi #ifdef LARRAWCONDITIONS_LARSINGLEFLOATP template<class CONDITIONSCONTAINER> -bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::getAverage(const HWIdentifier chid, const int gain, LArSingleFloatP& patch, bool /*isphi*/) { +bool LArCalibPatchingAlg<CONDITIONSCONTAINER>::getAverage(const HWIdentifier chid, const int gain, LArSingleFloatP& patch, const LArBadChannelCont* bcCont, const LArOnOffIdMapping* cabling, bool /*isphi*/) { - std::vector<HWIdentifier>& symCells=getPhiRing(chid); + std::vector<HWIdentifier>& symCells=getPhiRing(chid, bcCont, cabling); std::vector<HWIdentifier>::const_iterator it=symCells.begin(); std::vector<HWIdentifier>::const_iterator it_e=symCells.end(); diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibShortCorrector.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibShortCorrector.h index db60271769c..fbe94046349 100644 --- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibShortCorrector.h +++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArCalibShortCorrector.h @@ -8,17 +8,17 @@ #include "AthenaBaseComps/AthAlgorithm.h" #include "GaudiKernel/ToolHandle.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArBadChannelCont.h" +#include "LArCabling/LArOnOffIdMapping.h" -#include "LArCabling/LArCablingService.h" #include "LArElecCalib/ILArPedestal.h" #include <vector> class LArAccumulatedCalibDigit; -class ILArBadChanTool; class CaloCell_ID; class LArOnlineID; -class LArCablingService; class HWIdentifier; @@ -39,9 +39,9 @@ class LArCalibShortCorrector : public AthAlgorithm//, public IIncidentListener StatusCode findShortedNeighbors(); - ToolHandle<LArCablingService> m_larCablingSvc; - ToolHandle<ILArBadChanTool> m_badChannelTool; - + SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"}; + SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this, "OnOffMap", "LArOnOffIdMap", "SG key for mapping object"}; + const LArOnlineID* m_onlineId; const CaloCell_ID* m_caloCellId; diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArPhysWavePredictor.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArPhysWavePredictor.h index 6faa9f9fed6..9da56effc92 100755 --- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArPhysWavePredictor.h +++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArPhysWavePredictor.h @@ -11,11 +11,13 @@ #include "AthenaBaseComps/AthAlgorithm.h" #include "GaudiKernel/ToolHandle.h" #include "Identifier/HWIdentifier.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArBadChannelCont.h" + #include <vector> #include <string> class ILArBadChannelMasker; -class ILArBadChanTool; class LArOnlineID; class LArPhysWavePredictor : public AthAlgorithm @@ -32,7 +34,7 @@ class LArPhysWavePredictor : public AthAlgorithm private: ToolHandle<ILArBadChannelMasker> m_maskingTool; - ToolHandle<ILArBadChanTool> m_badChanTool; + SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"}; const LArOnlineID* m_onlineHelper; bool m_testmode; diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRampBuilder.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRampBuilder.h index e717d3b3da3..2cd41cdd981 100755 --- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRampBuilder.h +++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArRampBuilder.h @@ -44,8 +44,6 @@ #include "LArElecCalib/ILArRinj.h" #include "LArRawConditions/LArCaliWaveContainer.h" -//#include "LArRecConditions/ILArBadChanTool.h" - //#include "LArCalibTriggerAccumulator.h" #include <vector> @@ -147,7 +145,6 @@ private: std::vector<std::vector<short> > m_adc0; ToolHandle<LArCablingService> m_larCablingSvc; - //ToolHandle<ILArBadChanTool> m_badChannelTool; ToolHandle< ILArBadChannelMasker> m_badChannelMask; bool m_doBadChannelMask; diff --git a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArStripsCrossTalkCorrector.h b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArStripsCrossTalkCorrector.h index ecf084916a8..e9dfb9ec8e1 100755 --- a/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArStripsCrossTalkCorrector.h +++ b/LArCalorimeter/LArCalibUtils/LArCalibUtils/LArStripsCrossTalkCorrector.h @@ -11,7 +11,9 @@ #include "GaudiKernel/ToolHandle.h" //#include "StoreGate/StoreGateSvc.h" -#include "LArCabling/LArCablingService.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArBadChannelCont.h" +#include "LArCabling/LArOnOffIdMapping.h" #include "CaloIdentifier/LArEM_ID.h" #include "LArIdentifier/LArOnlineID.h" #include "LArElecCalib/ILArPedestal.h" @@ -48,7 +50,6 @@ private: class ILArBadChannelMasker; -class ILArBadChanTool; //=================================================================================== @@ -69,8 +70,10 @@ class LArStripsCrossTalkCorrector : public AthAlgorithm StatusCode executeWithAccumulatedDigits(); StatusCode executeWithStandardDigits(); - ToolHandle<LArCablingService> m_larCablingSvc; - ToolHandle<ILArBadChanTool> m_badChannelTool; + + SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey {this, "BadChanKey", "LArBadChannel", "SG key for LArBadChan object"}; + SG::ReadCondHandleKey<LArBadFebCont> m_BFKey {this, "MissingFEBKey", "LArBadFeb", "SG key for miffing FEB object"}; + SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this, "OnOffMap", "LArOnOffIdMap", "SG key for mapping object"}; ToolHandle<ILArBadChannelMasker> m_dontUseForCorr; ToolHandle<ILArBadChannelMasker> m_dontCorrect; diff --git a/LArCalorimeter/LArCalibUtils/src/LArAutoCorrBuilder.cxx b/LArCalorimeter/LArCalibUtils/src/LArAutoCorrBuilder.cxx index 48c17450e0c..46f3d2f1062 100644 --- a/LArCalorimeter/LArCalibUtils/src/LArAutoCorrBuilder.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArAutoCorrBuilder.cxx @@ -54,12 +54,12 @@ StatusCode LArAutoCorrBuilder::stop() { // Initialize LArAutoCorrComplete StatusCode sc=larAutoCorrComplete->setGroupingType(m_groupingType,msg()); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to set groupingType for LArAutoCorrComplete object" << endmsg; + ATH_MSG_ERROR( "Failed to set groupingType for LArAutoCorrComplete object" ); return sc; } sc=larAutoCorrComplete->initialize(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed initialize LArAutoCorrComplete object" << endmsg; + ATH_MSG_ERROR( "Failed initialize LArAutoCorrComplete object" ); return sc; } @@ -93,18 +93,18 @@ StatusCode LArAutoCorrBuilder::stop() { NAutoCorr++; }//end loop over all cells - msg(MSG::DEBUG) << "Gain " << gain << " Number of cells with 0 events to compute autocorr: " << n_zero << endmsg; - msg(MSG::DEBUG) << "Gain " << gain << " Minimum number of events to compute autocorr: " << n_min << endmsg; - msg(MSG::DEBUG) << "Gain " << gain << " Maximum number of events to compute autocorr: " << n_max << endmsg; + ATH_MSG_DEBUG( "Gain " << gain << " Number of cells with 0 events to compute autocorr: " << n_zero ); + ATH_MSG_DEBUG( "Gain " << gain << " Minimum number of events to compute autocorr: " << n_min ); + ATH_MSG_DEBUG( "Gain " << gain << " Maximum number of events to compute autocorr: " << n_max ); }//end loop over gains - //msg(MSG::INFO << " Summary : Number of cells with a autocorr value computed : " << larAutoCorrComplete->totalNumberOfConditions() << endmsg; - msg(MSG::INFO) << " Summary : Number of cells with a autocorr value computed : " << NAutoCorr << endmsg; - msg(MSG::INFO) << " Summary : Number of Barrel PS cells side A or C (connected+unconnected): 3904+ 192 = 4096 " << endmsg; - msg(MSG::INFO) << " Summary : Number of Barrel cells side A or C (connected+unconnected): 50944+2304 = 53248 " << endmsg; - msg(MSG::INFO) << " Summary : Number of EMEC cells side A or C (connected+unconnected): 31872+3456 = 35328 " << endmsg; - msg(MSG::INFO) << " Summary : Number of HEC cells side A or C (connected+unconnected): 2816+ 256 = 3072 " << endmsg; - msg(MSG::INFO) << " Summary : Number of FCAL cells side A or C (connected+unconnected): 1762+ 30 = 1792 " << endmsg; + //msg(MSG::INFO << " Summary : Number of cells with a autocorr value computed : " << larAutoCorrComplete->totalNumberOfConditions() ); + ATH_MSG_INFO( " Summary : Number of cells with a autocorr value computed : " << NAutoCorr ); + ATH_MSG_INFO( " Summary : Number of Barrel PS cells side A or C (connected+unconnected): 3904+ 192 = 4096 " ); + ATH_MSG_INFO( " Summary : Number of Barrel cells side A or C (connected+unconnected): 50944+2304 = 53248 " ); + ATH_MSG_INFO( " Summary : Number of EMEC cells side A or C (connected+unconnected): 31872+3456 = 35328 " ); + ATH_MSG_INFO( " Summary : Number of HEC cells side A or C (connected+unconnected): 2816+ 256 = 3072 " ); + ATH_MSG_INFO( " Summary : Number of FCAL cells side A or C (connected+unconnected): 1762+ 30 = 1792 " ); // Record LArAutoCorrComplete ATH_CHECK( detStore()->record(std::move(larAutoCorrComplete),m_acContName) ); diff --git a/LArCalorimeter/LArCalibUtils/src/LArAutoCorrDecoderTool.cxx b/LArCalorimeter/LArCalibUtils/src/LArAutoCorrDecoderTool.cxx index 195268cbab4..faa4d51d790 100755 --- a/LArCalorimeter/LArCalibUtils/src/LArAutoCorrDecoderTool.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArAutoCorrDecoderTool.cxx @@ -36,25 +36,25 @@ StatusCode LArAutoCorrDecoderTool::initialize() StatusCode sc = detStore()->retrieve(m_onlineID,"LArOnlineID"); if (sc.isFailure()) { - msg(MSG::ERROR) << "Unable to retrieve LArOnlineID from DetectorStore" << endmsg; + ATH_MSG_ERROR( "Unable to retrieve LArOnlineID from DetectorStore" ); return StatusCode::FAILURE; } if(m_cablingService.retrieve().isFailure()){ - msg(MSG::ERROR) << "Unable to get CablingService " << endmsg; + ATH_MSG_ERROR( "Unable to get CablingService " ); return StatusCode::FAILURE; } sc=detStore()->regHandle(m_autoCorr,m_keyAutoCorr); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to register Datahandle<ILArAutoCorr> to SG key " << m_keyAutoCorr << endmsg; + ATH_MSG_ERROR( "Failed to register Datahandle<ILArAutoCorr> to SG key " << m_keyAutoCorr ); return sc; } if (m_alwaysHighGain) - msg(MSG::INFO) << "Will always return HIGH gain autocorrelation matrix for EM calo, MEDIUM for HEC and FCAL" << endmsg; + ATH_MSG_INFO( "Will always return HIGH gain autocorrelation matrix for EM calo, MEDIUM for HEC and FCAL" ); ATH_MSG_DEBUG("LArAutoCorrDecoderTool initialize() end"); return StatusCode::SUCCESS; @@ -92,11 +92,11 @@ const Eigen::MatrixXd LArAutoCorrDecoderTool::ACDiagonal( const HWIdentifier& C ILArAutoCorr::AutoCorrRef_t dbcorr = m_autoCorr->autoCorr(CellID,gain); if ( dbcorr.size()== 0 ) { // empty AutoCorr for given channel - msg(MSG::WARNING) << "Empty AutoCorr vector for channel " << m_onlineID->channel_name(CellID) << " in Gain = " << gain<< endmsg; + ATH_MSG_WARNING( "Empty AutoCorr vector for channel " << m_onlineID->channel_name(CellID) << " in Gain = " << gain); nSamples=0; } else if (dbcorr.size() < nSamples-1 ) { - msg(MSG::WARNING) << "Not enough samples in AutoCorr vector for channel " << m_onlineID->channel_name(CellID) << " in Gain = " << gain<< endmsg; + ATH_MSG_WARNING( "Not enough samples in AutoCorr vector for channel " << m_onlineID->channel_name(CellID) << " in Gain = " << gain); nSamples=1+dbcorr.size(); //The remaining values of the eigen matrix are left to 0.0 } @@ -109,7 +109,7 @@ const Eigen::MatrixXd LArAutoCorrDecoderTool::ACDiagonal( const HWIdentifier& C } }//else if m_autoCorr else { // no LArAutoCorrComplete loaded in DetStore (e.g. DB problem) :-( - msg(MSG::WARNING) << "No valid AutoCorr object loaded from DetStore" << endmsg; + ATH_MSG_WARNING( "No valid AutoCorr object loaded from DetStore" ); } ATH_MSG_DEBUG("AutoCorr matrix for channel " << m_onlineID->channel_name(CellID) @@ -137,12 +137,12 @@ const Eigen::MatrixXd LArAutoCorrDecoderTool::ACPhysics( const HWIdentifier& Ce ILArAutoCorr::AutoCorrRef_t corrdb = m_autoCorr->autoCorr(CellID,gain); if ( corrdb.size()== 0 ) { // empty AutoCorr for given channel - msg(MSG::WARNING) << "Empty AutoCorr vector for channel " << m_onlineID->channel_name(CellID) << " in Gain = " << gain<< endmsg; + ATH_MSG_WARNING( "Empty AutoCorr vector for channel " << m_onlineID->channel_name(CellID) << " in Gain = " << gain); nSamples=0; //return all-zero matrix } else if ( corrdb.size() < nSamples*(nSamples+1)/2 ) { - msg(MSG::WARNING) << "Not enough samples in AutoCorr vector for channel " << m_onlineID->channel_name(CellID) - << "in Gain = " << gain << " for AC Physics mode"<< endmsg; + ATH_MSG_WARNING( "Not enough samples in AutoCorr vector for channel " << m_onlineID->channel_name(CellID) + << "in Gain = " << gain << " for AC Physics mode"); nSamples=0;//return all-zero matrix } @@ -159,7 +159,7 @@ const Eigen::MatrixXd LArAutoCorrDecoderTool::ACPhysics( const HWIdentifier& Ce } } //end if m_autoCorr else { // no LArAutoCorrComplete loaded in DetStore (e.g. DB problem) :-( - msg(MSG::WARNING) << "No valid AutoCorr object loaded from DetStore" << endmsg; + ATH_MSG_WARNING( "No valid AutoCorr object loaded from DetStore" ); } ATH_MSG_DEBUG("AutoCorr matrix for channel " << m_onlineID->channel_name(CellID) diff --git a/LArCalorimeter/LArCalibUtils/src/LArAutoCorrExtrapolate.cxx b/LArCalorimeter/LArCalibUtils/src/LArAutoCorrExtrapolate.cxx index 41d6cae90bb..71bc5b7141a 100755 --- a/LArCalorimeter/LArCalibUtils/src/LArAutoCorrExtrapolate.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArAutoCorrExtrapolate.cxx @@ -25,15 +25,13 @@ #include "LArRawConditions/LArAutoCorrComplete.h" #include "LArRawConditions/LArPedestalComplete.h" -#include "LArRecConditions/ILArBadChanTool.h" #include "CaloIdentifier/CaloGain.h" LArAutoCorrExtrapolate::LArAutoCorrExtrapolate(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator), - m_onlineId(0), - m_badChannelTool("LArBadChanTool") + m_onlineId(0) { m_useBad=true; declareProperty("KeyOutput", m_keyoutput="LArAutoCorr"); @@ -42,7 +40,6 @@ LArAutoCorrExtrapolate::LArAutoCorrExtrapolate(const std::string& name, ISvcLoca declareProperty("keyPedInput", m_keyPedInput="PedestalElec"); declareProperty("keyRamp", m_keyRamp="LArRamp"); declareProperty("nSamples", m_Nsamples=5); - declareProperty("BadChannelTool",m_badChannelTool); } @@ -53,8 +50,8 @@ StatusCode LArAutoCorrExtrapolate::initialize() { ATH_MSG_INFO ( ">>> Initialize" ); - if (m_badChannelTool.retrieve().isFailure()) { - ATH_MSG_WARNING ( "No tool for bad channel" ); + if (m_BFKey.initialize().isFailure()) { + ATH_MSG_WARNING ( "No bad febs key" ); m_useBad=false; } @@ -94,6 +91,13 @@ StatusCode LArAutoCorrExtrapolate::stop() ATH_CHECK( detStore()->retrieve(larRamp,m_keyRamp) ); ATH_MSG_INFO ( " Got ramp from database " ); + SG::ReadCondHandle<LArBadFebCont> readHandle{m_BFKey}; + const LArBadFebCont *bfCont {*readHandle}; + if ( bfCont == nullptr) { + ATH_MSG_WARNING("Failed to retrieve BadFebCont with key "<<m_BFKey.key() ); + m_useBad=false; + } + // loop over channels std::vector<HWIdentifier>::const_iterator it = m_onlineId->channel_begin(); std::vector<HWIdentifier>::const_iterator it_e = m_onlineId->channel_end(); @@ -149,7 +153,7 @@ StatusCode LArAutoCorrExtrapolate::stop() bool recovered=false; if (corr.size()==0) { HWIdentifier febId = m_onlineId->feb_Id(hwid); - if (m_useBad && m_badChannelTool->febMissing(febId)) { + if (m_useBad && (!bfCont->status(febId).good()) ) { ATH_MSG_DEBUG ( " Known missing Feb, no physics autocorr " << m_onlineId->channel_name(hwid) << "... use electronics from db " ); } else { ATH_MSG_WARNING ( " No physics autocorr for channel " << m_onlineId->channel_name(hwid) << " .. use electronics from db" ); diff --git a/LArCalorimeter/LArCalibUtils/src/LArAutoCorrMaker.cxx b/LArCalorimeter/LArCalibUtils/src/LArAutoCorrMaker.cxx index 4366c22b9be..b56db1c4e0e 100755 --- a/LArCalorimeter/LArCalibUtils/src/LArAutoCorrMaker.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArAutoCorrMaker.cxx @@ -63,7 +63,7 @@ LArAutoCorrMaker::~LArAutoCorrMaker() StatusCode LArAutoCorrMaker::initialize() { - msg(MSG::INFO) << ">>> Initialize" << endmsg; + ATH_MSG_INFO( ">>> Initialize" ); // m_fullFolderName="/lar/"+m_folderName+"/LArPedestal"; @@ -76,21 +76,21 @@ StatusCode LArAutoCorrMaker::initialize() { m_keylist=m_keylistproperty; if (m_keylist.size()==0) { - msg(MSG::ERROR) << "Key list is empty!" << endmsg; + ATH_MSG_ERROR( "Key list is empty!" ); return StatusCode::FAILURE; } m_autocorr.setGroupingType(LArConditionsContainerBase::SingleGroup); StatusCode sc=m_autocorr.initialize(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed initialize intermediate AutoCorr object" << endmsg; + ATH_MSG_ERROR( "Failed initialize intermediate AutoCorr object" ); return sc; } if (m_bunchCrossingsFromFront>0) { sc=m_bunchCrossingTool.retrieve(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to retrieve BunchCrossingTool!" << endmsg; + ATH_MSG_ERROR( "Failed to retrieve BunchCrossingTool!" ); } } @@ -107,7 +107,7 @@ StatusCode LArAutoCorrMaker::execute() const xAOD::EventInfo* eventInfo; sc=evtStore()->retrieve( eventInfo ); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to retrieve EventInfo object!" << endmsg; + ATH_MSG_ERROR( "Failed to retrieve EventInfo object!" ); return sc; } uint32_t bcid = eventInfo->bcid(); @@ -144,7 +144,7 @@ StatusCode LArAutoCorrMaker::execute() const HWIdentifier chid=(*it)->hardwareID(); const CaloGain::CaloGain gain=(*it)->gain(); if (gain<0 || gain>CaloGain::LARNGAIN) { - msg(MSG::ERROR) << "Found odd gain number ("<< (int)gain <<")" << endmsg; + ATH_MSG_ERROR( "Found odd gain number ("<< (int)gain <<")" ); return StatusCode::FAILURE; } const std::vector<short> & samples = (*it)->samples(); @@ -187,10 +187,10 @@ StatusCode LArAutoCorrMaker::stop() //--------------------------------------------------------------------------- { StatusCode sc; - msg(MSG::INFO) << ">>> Stop()" << endmsg; + ATH_MSG_INFO( ">>> Stop()" ); if (m_keylist.size()==0) { - msg(MSG::ERROR) << "Key list is empty! No containers processed!" << endmsg; + ATH_MSG_ERROR( "Key list is empty! No containers processed!" ); return StatusCode::FAILURE; } @@ -199,13 +199,13 @@ StatusCode LArAutoCorrMaker::stop() sc=larAutoCorrComplete->setGroupingType(m_groupingType,msg()); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to set groupingType for LArAutoCorrComplete object" << endmsg; + ATH_MSG_ERROR( "Failed to set groupingType for LArAutoCorrComplete object" ); return sc; } sc=larAutoCorrComplete->initialize(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed initialize LArAutoCorrComplete object" << endmsg; + ATH_MSG_ERROR( "Failed initialize LArAutoCorrComplete object" ); return sc; } @@ -245,25 +245,25 @@ StatusCode LArAutoCorrMaker::stop() } } - msg(MSG::INFO) << "AutoCorrelation based on " << m_nEvents << " events." << endmsg; - msg(MSG::INFO) << " Summary : Number of cells with a autocorr value computed : " << larAutoCorrComplete->totalNumberOfConditions() << endmsg; - msg(MSG::INFO) << " Summary : Number of Barrel PS cells side A or C (connected+unconnected): 4096 " << endmsg; - msg(MSG::INFO) << " Summary : Number of Barrel cells side A or C (connected+unconnected): 53248 " << endmsg; - msg(MSG::INFO) << " Summary : Number of EMEC cells side A or C (connected+unconnected): 35328 " << endmsg; - msg(MSG::INFO) << " Summary : Number of HEC cells side A or C (connected+unconnected): 3072 "<< endmsg; - msg(MSG::INFO) << " Summary : Number of FCAL cells side A or C (connected+unconnected): 1792 " << endmsg; + ATH_MSG_INFO( "AutoCorrelation based on " << m_nEvents << " events." ); + ATH_MSG_INFO( " Summary : Number of cells with a autocorr value computed : " << larAutoCorrComplete->totalNumberOfConditions() ); + ATH_MSG_INFO( " Summary : Number of Barrel PS cells side A or C (connected+unconnected): 4096 " ); + ATH_MSG_INFO( " Summary : Number of Barrel cells side A or C (connected+unconnected): 53248 " ); + ATH_MSG_INFO( " Summary : Number of EMEC cells side A or C (connected+unconnected): 35328 " ); + ATH_MSG_INFO( " Summary : Number of HEC cells side A or C (connected+unconnected): 3072 "); + ATH_MSG_INFO( " Summary : Number of FCAL cells side A or C (connected+unconnected): 1792 " ); // Record LArAutoCorrComplete sc = detStore()->record(larAutoCorrComplete,m_keyoutput); if (sc != StatusCode::SUCCESS) { - msg(MSG::ERROR) << " Cannot store LArAutoCorrComplete in DetectorStore " << endmsg; + ATH_MSG_ERROR( " Cannot store LArAutoCorrComplete in DetectorStore " ); return sc; } // Make symlink sc = detStore()->symLink(larAutoCorrComplete, (ILArAutoCorr*)larAutoCorrComplete); if (sc != StatusCode::SUCCESS) { - msg(MSG::ERROR) << " Cannot make link for Data Object " << endmsg; + ATH_MSG_ERROR( " Cannot make link for Data Object " ); return sc; } diff --git a/LArCalorimeter/LArCalibUtils/src/LArCaliWaveBuilder.cxx b/LArCalorimeter/LArCalibUtils/src/LArCaliWaveBuilder.cxx index 898117c855d..12029b182f6 100755 --- a/LArCalorimeter/LArCalibUtils/src/LArCaliWaveBuilder.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArCaliWaveBuilder.cxx @@ -67,14 +67,14 @@ StatusCode LArCaliWaveBuilder::initialize() //FIXME probably useless because m_wave isn't written anywhere StatusCode sc=m_waves.setGroupingType(m_groupingType,msg()); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to set groupingType for LArCaliWave intermediate object" << endmsg; + ATH_MSG_ERROR( "Failed to set groupingType for LArCaliWave intermediate object" ); return sc; } - msg(MSG::INFO) << "Initialize intermediate Wave object" << endmsg; + ATH_MSG_INFO( "Initialize intermediate Wave object" ); sc=m_waves.initialize(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed initialize LArCaliWave intermediate object" << endmsg; + ATH_MSG_ERROR( "Failed initialize LArCaliWave intermediate object" ); return sc; } @@ -83,28 +83,28 @@ StatusCode LArCaliWaveBuilder::initialize() if (m_checkEmptyPhases) - msg(MSG::INFO) << "Empty phases check selected." << endmsg; + ATH_MSG_INFO( "Empty phases check selected." ); //Get pedestal from DetStore if (m_pedSub) { - msg(MSG::INFO) << "Pedestal subtraction selected." << endmsg; + ATH_MSG_INFO( "Pedestal subtraction selected." ); sc=detStore()->regHandle(m_larPedestal,"Pedestal"); if (sc.isFailure()) { - msg(MSG::ERROR) << "Cannot register data handle for LArPedestal object!" << endmsg; + ATH_MSG_ERROR( "Cannot register data handle for LArPedestal object!" ); return sc; } } //Get Online helper from DetStore sc=detStore()->retrieve(m_onlineID); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to retrieve LArOnlineID!" << endmsg; + ATH_MSG_ERROR( "Failed to retrieve LArOnlineID!" ); return sc; } sc=m_cablingSvc.retrieve(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to retrieve LArCablingService!" << endmsg; + ATH_MSG_ERROR( "Failed to retrieve LArCablingService!" ); return sc; } @@ -125,11 +125,11 @@ StatusCode LArCaliWaveBuilder::execute() // if ( m_event_counter < 100 || ( m_event_counter < 1000 && m_event_counter%100==0 ) || m_event_counter%1000==0 ) if ( m_event_counter < 1000 || m_event_counter%100==0 ) - msg(MSG::INFO) << "Processing event " << m_event_counter << endmsg; + ATH_MSG_INFO( "Processing event " << m_event_counter ); m_event_counter++ ; if (m_keylist.size()==0) { - msg(MSG::ERROR) << "Key list is empty! No containers to process!" << endmsg; + ATH_MSG_ERROR( "Key list is empty! No containers to process!" ); return StatusCode::FAILURE; } @@ -154,7 +154,7 @@ StatusCode LArCaliWaveBuilder::executeWithAccumulatedDigits() sc = evtStore()->retrieve(larAccumulatedCalibDigitContainer,*key_it); if (sc.isFailure()) { - msg(MSG::WARNING) << "Cannot read LArAccumulatedCalibDigitContainer from StoreGate! key=" << *key_it << endmsg; + ATH_MSG_WARNING( "Cannot read LArAccumulatedCalibDigitContainer from StoreGate! key=" << *key_it ); continue; // Try next container } @@ -163,13 +163,13 @@ StatusCode LArCaliWaveBuilder::executeWithAccumulatedDigits() if (evtStore()->contains<LArFebErrorSummary>("LArFebErrorSummary")) { sc=evtStore()->retrieve(febErrSum); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to retrieve FebErrorSummary object!" << endmsg; + ATH_MSG_ERROR( "Failed to retrieve FebErrorSummary object!" ); return sc; } } else if (m_event_counter==1) - msg(MSG::WARNING) << "No FebErrorSummaryObject found! Feb errors not checked!" << endmsg; + ATH_MSG_WARNING( "No FebErrorSummaryObject found! Feb errors not checked!" ); HWIdentifier lastFailedFEB(0); LArAccumulatedCalibDigitContainer::const_iterator it=larAccumulatedCalibDigitContainer->begin(); @@ -186,10 +186,10 @@ StatusCode LArCaliWaveBuilder::executeWithAccumulatedDigits() for (;it!=it_end; ++it) { // Loop over all cells if ( (!m_recAll) && (!(*it)->isPulsed()) ) { - msg(MSG::DEBUG) << "Non pulsed cell " << m_onlineID->channel_name((*it)->hardwareID()) << endmsg; + ATH_MSG_DEBUG( "Non pulsed cell " << m_onlineID->channel_name((*it)->hardwareID()) ); continue; // Check if cell is pulsed } - msg(MSG::DEBUG) << "Pulsed cell " << m_onlineID->channel_name((*it)->hardwareID()) << endmsg; + ATH_MSG_DEBUG( "Pulsed cell " << m_onlineID->channel_name((*it)->hardwareID()) ); HWIdentifier chid=(*it)->hardwareID(); HWIdentifier febid=m_onlineID->feb_Id(chid); if (febErrSum) { @@ -197,8 +197,8 @@ StatusCode LArCaliWaveBuilder::executeWithAccumulatedDigits() if (febErrs & m_fatalFebErrorPattern) { if (febid!=lastFailedFEB) { lastFailedFEB=febid; - msg(MSG::ERROR) << "Event " << m_event_counter << " Feb " << m_onlineID->channel_name(febid) - << " reports error(s):" << febErrSum->error_to_string(febErrs) << ". Data ignored." << endmsg; + ATH_MSG_ERROR( "Event " << m_event_counter << " Feb " << m_onlineID->channel_name(febid) + << " reports error(s):" << febErrSum->error_to_string(febErrs) << ". Data ignored." ); } continue; } @@ -206,7 +206,7 @@ StatusCode LArCaliWaveBuilder::executeWithAccumulatedDigits() CaloGain::CaloGain gain=(*it)->gain(); if (gain<0 || gain>CaloGain::LARNGAIN) { - msg(MSG::ERROR) << "Found not-matching gain number ("<< (int)gain <<")" << endmsg; + ATH_MSG_ERROR( "Found not-matching gain number ("<< (int)gain <<")" ); return StatusCode::FAILURE; } @@ -232,7 +232,7 @@ StatusCode LArCaliWaveBuilder::executeWithAccumulatedDigits() int index; for(int iLine=1;iLine<5;iLine++){ if((*it)->isPulsed(iLine)){ - msg(MSG::DEBUG) <<"GR: line pulsed true, line="<<iLine<<endmsg; + ATH_MSG_DEBUG("GR: line pulsed true, line="<<iLine); dacPulsed=(dacPulsed | (0x1 << (15+iLine))); } } @@ -273,7 +273,7 @@ StatusCode LArCaliWaveBuilder::executeWithStandardDigits() sc = evtStore()->retrieve(larCalibDigitContainer,*key_it); if (sc.isFailure()) { - msg(MSG::WARNING) << "Cannot read LArCalibDigitContainer from StoreGate! key=" << *key_it << endmsg; + ATH_MSG_WARNING( "Cannot read LArCalibDigitContainer from StoreGate! key=" << *key_it ); continue; // Try next container } @@ -281,7 +281,7 @@ StatusCode LArCaliWaveBuilder::executeWithStandardDigits() LArCalibDigitContainer::const_iterator it_end=larCalibDigitContainer->end(); if (it == it_end) { - msg(MSG::INFO) << "LArCalibDigitContainer with key=" << *key_it << " is empty " << endmsg; + ATH_MSG_INFO( "LArCalibDigitContainer with key=" << *key_it << " is empty " ); continue; // at this event LArCalibDigitContainer is empty, do not even try to loop on it... } @@ -296,7 +296,7 @@ StatusCode LArCaliWaveBuilder::executeWithStandardDigits() CaloGain::CaloGain gain=(*it)->gain(); if (gain<0 || gain>CaloGain::LARNGAIN) { - msg(MSG::ERROR) << "Found not-matching gain number ("<< (int)gain <<")" << endmsg; + ATH_MSG_ERROR( "Found not-matching gain number ("<< (int)gain <<")" ); return StatusCode::FAILURE; } @@ -333,14 +333,14 @@ StatusCode LArCaliWaveBuilder::stop() StatusCode sc=caliWaveContainer->setGroupingType(m_groupingType,msg()); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to set groupingType for LArCaliWaveContainer object" << endmsg; + ATH_MSG_ERROR( "Failed to set groupingType for LArCaliWaveContainer object" ); return sc; } - msg(MSG::INFO) << "Initialize final Wave object" << endmsg; + ATH_MSG_INFO( "Initialize final Wave object" ); sc=caliWaveContainer->initialize(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed initialize LArCaliWaveContainer object" << endmsg; + ATH_MSG_ERROR( "Failed initialize LArCaliWaveContainer object" ); return sc; } @@ -371,15 +371,15 @@ StatusCode LArCaliWaveBuilder::stop() const HWIdentifier hwId = cell_it.channelId(); if ((!m_recAll) && (!m_cablingSvc->isOnlineConnected(hwId))) { - //msg(MSG::INFO) << "Skipping disconnected channel: "<<MSG::hex<<hwId<<MSG::dec << endmsg; + //ATH_MSG_INFO( "Skipping disconnected channel: "<<MSG::hex<<hwId<<MSG::dec ); continue; //Ignore disconnected channels } const WaveMap& waveMap = (*cell_it); if (waveMap.size()==0) { - msg(MSG::INFO) << "Empty accumulated wave. Last id: " << MSG::hex - //<< lastId << " " << emId->show_to_string(lastId) << endmsg; - << lastId << " this id: "<<hwId<<MSG::dec << endmsg; + ATH_MSG_INFO( "Empty accumulated wave. Last id: " << MSG::hex + //<< lastId << " " << emId->show_to_string(lastId) ); + << lastId << " this id: "<<hwId<<MSG::dec ); continue; } @@ -401,8 +401,8 @@ StatusCode LArCaliWaveBuilder::stop() const std::vector<int>& thisTriggers = thisWave.getTriggers(); for (unsigned i=0;i<thisTriggers.size();++i) { if (thisTriggers[i]==0) { - msg(MSG::FATAL) << "Empty phase found in channel 0x" << MSG::hex << chid << MSG::dec - << "., aborting reconstruction. Sorry." << endmsg; + ATH_MSG_FATAL( "Empty phase found in channel 0x" << MSG::hex << chid << MSG::dec + << "., aborting reconstruction. Sorry." ); return StatusCode::FAILURE; } } @@ -415,14 +415,14 @@ StatusCode LArCaliWaveBuilder::stop() float pedestal = m_larPedestal->pedestal(chid,gain); if (pedestal <= (1.0+LArElecCalib::ERRORCODE)) { ATH_MSG_DEBUG("No pedestal(s) found for channel 0x" << MSG::hex << chid << MSG::dec); - msg(MSG::INFO) << "Using fake (baseline) pedestal subtraction..." << endmsg; + ATH_MSG_INFO( "Using fake (baseline) pedestal subtraction..." ); pedAve = wHelper.getBaseline(thisWave,m_baseline) ; } else { pedAve = pedestal; } } else { ATH_MSG_DEBUG("No pedestal(s) found for channel 0x" << MSG::hex << chid << MSG::dec); - msg(MSG::INFO) << "Using fake (baseline) pedestal subtraction..." << endmsg; + ATH_MSG_INFO( "Using fake (baseline) pedestal subtraction..." ); pedAve = wHelper.getBaseline(thisWave,m_baseline) ; } ATH_MSG_DEBUG("Pedestal for channel 0x" << MSG::hex << chid << MSG::dec << " is = " << pedAve << " ADC"); @@ -430,7 +430,7 @@ StatusCode LArCaliWaveBuilder::stop() double waveMax = thisWave.getSample( wHelper.getMax(thisWave) ) ; if ( (!m_recAll) && m_ADCsatur>0 && waveMax>=m_ADCsatur ) { - msg(MSG::INFO) << "Absolute ADC saturation at DAC = " << thisWave.getDAC() << " ... skip!" << endmsg ; + ATH_MSG_INFO( "Absolute ADC saturation at DAC = " << thisWave.getDAC() << " ... skip!" ) ; continue ; } else { @@ -454,17 +454,17 @@ StatusCode LArCaliWaveBuilder::stop() } //end loop over m_keyList - //msg(MSG::INFO) << " Summary : Number of cells with a CaliWave reconstructed : " << caliWaveContainer->totalNumberOfConditions() << endmsg; - msg(MSG::INFO) << " Summary : Number of cells with a CaliWave reconstructed : " << NCaliWave << endmsg; - msg(MSG::INFO) << " Summary : Number of Barrel PS cells side A or C (connected+unconnected): 3904+ 192 = 4096 " << endmsg; - msg(MSG::INFO) << " Summary : Number of Barrel cells side A or C (connected+unconnected): 50944+2304 = 53248 " << endmsg; - msg(MSG::INFO) << " Summary : Number of EMEC cells side A or C (connected+unconnected): 31872+3456 = 35328 " << endmsg; - msg(MSG::INFO) << " Summary : Number of HEC cells side A or C (connected+unconnected): 2816+ 256 = 3072 " << endmsg; - msg(MSG::INFO) << " Summary : Number of FCAL cells side A or C (connected+unconnected): 1762+ 30 = 1792 " << endmsg; + //ATH_MSG_INFO( " Summary : Number of cells with a CaliWave reconstructed : " << caliWaveContainer->totalNumberOfConditions() ); + ATH_MSG_INFO( " Summary : Number of cells with a CaliWave reconstructed : " << NCaliWave ); + ATH_MSG_INFO( " Summary : Number of Barrel PS cells side A or C (connected+unconnected): 3904+ 192 = 4096 " ); + ATH_MSG_INFO( " Summary : Number of Barrel cells side A or C (connected+unconnected): 50944+2304 = 53248 " ); + ATH_MSG_INFO( " Summary : Number of EMEC cells side A or C (connected+unconnected): 31872+3456 = 35328 " ); + ATH_MSG_INFO( " Summary : Number of HEC cells side A or C (connected+unconnected): 2816+ 256 = 3072 " ); + ATH_MSG_INFO( " Summary : Number of FCAL cells side A or C (connected+unconnected): 1762+ 30 = 1792 " ); // Record in detector store with key (m_keyoutput) ATH_CHECK( detStore()->record(std::move(caliWaveContainer), m_keyoutput) ); - msg(MSG::INFO) << "LArCaliWaveBuilder has finished." << endmsg; + ATH_MSG_INFO( "LArCaliWaveBuilder has finished." ); return StatusCode::SUCCESS; } diff --git a/LArCalorimeter/LArCalibUtils/src/LArCalibShortCorrector.cxx b/LArCalorimeter/LArCalibUtils/src/LArCalibShortCorrector.cxx index 1f3e64c818c..4f610a810dc 100644 --- a/LArCalorimeter/LArCalibUtils/src/LArCalibShortCorrector.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArCalibShortCorrector.cxx @@ -10,15 +10,11 @@ #include "CaloIdentifier/CaloGain.h" #include "CaloIdentifier/CaloCell_ID.h" #include "LArIdentifier/LArOnlineID.h" -#include "LArCabling/LArCablingService.h" -#include "LArRecConditions/ILArBadChanTool.h" #include "LArRecConditions/LArBadChannel.h" #include <math.h> LArCalibShortCorrector::LArCalibShortCorrector(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator), - m_larCablingSvc("LArCablingService"), - m_badChannelTool("LArBadChanTool"), m_onlineId(0), m_caloCellId(0) { @@ -26,7 +22,6 @@ LArCalibShortCorrector::LArCalibShortCorrector(const std::string& name, ISvcLoca "List of input keys (normally the 'HIGH','MEDIUM','LOW')"); declareProperty("PedestalKey",m_pedKey="Pedestal", "Key of the pedestal object (to be subtracted)"); - declareProperty("BadChannelTool",m_badChannelTool); m_shortsCached=false; } @@ -34,10 +29,10 @@ LArCalibShortCorrector::~LArCalibShortCorrector() { } StatusCode LArCalibShortCorrector::initialize() { + ATH_CHECK( m_BCKey.initialize() ); + ATH_CHECK( m_cablingKey.initialize() ); ATH_CHECK( detStore()->retrieve(m_onlineId, "LArOnlineID") ); ATH_CHECK( detStore()->retrieve(m_caloCellId, "CaloCell_ID") ); - ATH_CHECK( m_larCablingSvc.retrieve() ); - ATH_CHECK( m_badChannelTool.retrieve() ); ATH_CHECK( detStore()->regHandle(m_larPedestal,m_pedKey) ); return StatusCode::SUCCESS; } @@ -47,13 +42,25 @@ StatusCode LArCalibShortCorrector::findShortedNeighbors() { //Currently we have 2 pairs (one in EMBA, one in EMBC). //If we find more shorts, the simple, un-ordered vector and linear search should be //replaced by something faster + SG::ReadCondHandle<LArBadChannelCont> bcHdl{m_BCKey}; + const LArBadChannelCont* bcCont{*bcHdl}; + if(!bcCont) { + ATH_MSG_ERROR( "Do not have bad channels !" ); + return StatusCode::FAILURE; + } + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling{*cablingHdl}; + if(!cabling) { + ATH_MSG_ERROR( "Do not have cabling object LArOnOffIdMapping"); + return StatusCode::FAILURE; + } m_shortedNeighbors.clear(); //Loop over all identifers (maybe better if we would have a loop only over bad-cahnnels) std::vector<HWIdentifier>::const_iterator it = m_onlineId->channel_begin(); std::vector<HWIdentifier>::const_iterator it_e = m_onlineId->channel_end(); for(;it!=it_e;it++) { - if (m_badChannelTool->status(*it).shortProblem()) { + if (bcCont->status(*it).shortProblem()) { const HWIdentifier chid1=*it; //Already found? SHORT_IT sit=m_shortedNeighbors.begin(); @@ -62,7 +69,7 @@ StatusCode LArCalibShortCorrector::findShortedNeighbors() { ; if (sit!=sit_e) continue; //This short was already found as neighbor of another shorted cell - const Identifier id1=m_larCablingSvc->cnvToIdentifier(chid1); + const Identifier id1=cabling->cnvToIdentifier(chid1); const IdentifierHash id1_h=m_caloCellId->calo_cell_hash(id1); ATH_MSG_DEBUG ( "Channel " << chid1.get_compact() << " marked as short" ); //Find neighbor @@ -80,8 +87,8 @@ StatusCode LArCalibShortCorrector::findShortedNeighbors() { std::vector<IdentifierHash>::const_iterator nbrit=neighbors.begin(); std::vector<IdentifierHash>::const_iterator nbrit_e=neighbors.end(); for (;nbrit!=nbrit_e;++nbrit) { - const HWIdentifier chid_nbr=m_larCablingSvc->createSignalChannelIDFromHash(*nbrit); - if (m_badChannelTool->status(chid_nbr).shortProblem()) { //Found neighbor with 'short' + const HWIdentifier chid_nbr=cabling->createSignalChannelIDFromHash(*nbrit); + if (bcCont->status(chid_nbr).shortProblem()) { //Found neighbor with 'short' if (chid2.is_valid()) { ATH_MSG_ERROR ( "Found more than one neighbor with short bit set! Identifiers: " << m_onlineId->channel_name(chid1) << ", " diff --git a/LArCalorimeter/LArCalibUtils/src/LArOFCAlg.cxx b/LArCalorimeter/LArCalibUtils/src/LArOFCAlg.cxx index bb39782aa80..033bdf2a0e3 100755 --- a/LArCalorimeter/LArCalibUtils/src/LArOFCAlg.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArOFCAlg.cxx @@ -97,48 +97,48 @@ StatusCode LArOFCAlg::initialize(){ m_nPoints = m_nDelays * ( m_nSamples-1 ) + m_nPhases * m_dPhases ; if ( m_nSamples>32 ) { - msg(MSG::ERROR) << "You are not allowed to compute OFC for Nsamples = " << m_nSamples << endmsg ; + ATH_MSG_ERROR( "You are not allowed to compute OFC for Nsamples = " << m_nSamples ) ; return StatusCode::FAILURE; } StatusCode sc = m_AutoCorrDecoder.retrieve(); if (sc.isFailure()) { - msg(MSG::FATAL) << "Could not retrieve AutoCorrDecoder " << m_AutoCorrDecoder << endmsg; + ATH_MSG_FATAL( "Could not retrieve AutoCorrDecoder " << m_AutoCorrDecoder ); return StatusCode::FAILURE; } else { - msg(MSG::INFO) << "Retrieved Decoder Tool: "<< m_AutoCorrDecoder << endmsg; + ATH_MSG_INFO( "Retrieved Decoder Tool: "<< m_AutoCorrDecoder ); } if (m_computeV2) { sc = m_AutoCorrDecoderV2.retrieve(); if (sc.isFailure()) { - msg(MSG::FATAL) << "Could not retrieve AutoCorrDecoderV2 " << m_AutoCorrDecoderV2 << endmsg; + ATH_MSG_FATAL( "Could not retrieve AutoCorrDecoderV2 " << m_AutoCorrDecoderV2 ); return StatusCode::FAILURE; } else { - msg(MSG::INFO) << "Retrieved Decoder Tool: "<< m_AutoCorrDecoderV2 << endmsg; + ATH_MSG_INFO( "Retrieved Decoder Tool: "<< m_AutoCorrDecoderV2 ); } } sc = detStore()->retrieve(m_onlineID); if (sc.isFailure()) { - msg(MSG::ERROR) << "failed to retrieve LArOnlineID " << endmsg; + ATH_MSG_ERROR( "failed to retrieve LArOnlineID " ); return sc; } sc = m_cablingService.retrieve() ; if (sc.isFailure()) { - msg(MSG::ERROR) << "failed to retrieve LArCablingService " << endmsg; + ATH_MSG_ERROR( "failed to retrieve LArCablingService " ); return sc; } - msg(MSG::INFO) << " retrieved LArCablingService " << endmsg; + ATH_MSG_INFO( " retrieved LArCablingService " ); - msg(MSG::INFO) << "Number of wave points needed : " << m_nPoints << endmsg ; + ATH_MSG_INFO( "Number of wave points needed : " << m_nPoints ) ; if (m_computeV2) { - msg(MSG::INFO) << "Will compute two flavors of OFCs" << endmsg; - msg(MSG::INFO) << "Version 1: useDelta= " << m_useDelta <<", output key: " << m_ofcKey << " AutoCorrDecoder: " << m_AutoCorrDecoder.name() << endmsg; - msg(MSG::INFO) << "Version 2: useDelta= " << m_useDeltaV2 <<", output key: " << m_ofcKeyV2 << " AutoCorrDecoder: " << m_AutoCorrDecoderV2.name() << endmsg; + ATH_MSG_INFO( "Will compute two flavors of OFCs" ); + ATH_MSG_INFO( "Version 1: useDelta= " << m_useDelta <<", output key: " << m_ofcKey << " AutoCorrDecoder: " << m_AutoCorrDecoder.name() ); + ATH_MSG_INFO( "Version 2: useDelta= " << m_useDeltaV2 <<", output key: " << m_ofcKeyV2 << " AutoCorrDecoder: " << m_AutoCorrDecoderV2.name() ); } return StatusCode::SUCCESS; } @@ -149,26 +149,26 @@ StatusCode LArOFCAlg::stop() ATH_MSG_DEBUG( "In LArOFCAlg finalize()"); - msg(MSG::INFO) << "Number of samples : " << m_nSamples << endmsg ; - msg(MSG::INFO) << "Number of delays acquired : " << m_nDelays << endmsg ; - msg(MSG::INFO) << "Number of phases in OFC : " << m_nPhases << endmsg ; - msg(MSG::INFO) << "Spacing between two phases : " << m_dPhases << endmsg ; + ATH_MSG_INFO( "Number of samples : " << m_nSamples ) ; + ATH_MSG_INFO( "Number of delays acquired : " << m_nDelays ) ; + ATH_MSG_INFO( "Number of phases in OFC : " << m_nPhases ) ; + ATH_MSG_INFO( "Spacing between two phases : " << m_dPhases ) ; StatusCode sc; if (m_useDelta == 3 || m_useDeltaV2==3){ sc = detStore()->retrieve(m_calo_dd_man); if (sc.isFailure()) { - msg(MSG::ERROR) << "failed to CaloDetDescrManager " << endmsg; + ATH_MSG_ERROR( "failed to CaloDetDescrManager " ); return sc; } } if ( m_timeShift ) { if( m_timeShiftByIndex == -1 ) { - msg(MSG::INFO) << " Will use helper class for start time." << endmsg; + ATH_MSG_INFO( " Will use helper class for start time." ); } else { - msg(MSG::INFO) << " Manually shifting pulses by time index " << m_timeShiftByIndex << endmsg; + ATH_MSG_INFO( " Manually shifting pulses by time index " << m_timeShiftByIndex ); } } @@ -176,7 +176,7 @@ StatusCode LArOFCAlg::stop() if (m_larPhysWaveBinKey.size()) { sc=detStore()->retrieve(m_larPhysWaveBin,m_larPhysWaveBinKey); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to retrieve LArOFCBinComplete object with key " << m_larPhysWaveBinKey << endmsg; + ATH_MSG_ERROR( "Failed to retrieve LArOFCBinComplete object with key " << m_larPhysWaveBinKey ); return sc; } } @@ -192,13 +192,13 @@ StatusCode LArOFCAlg::stop() const AthenaAttributeList* attrList=0; sc=detStore()->retrieve(attrList, m_DSPConfigFolder); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to retrieve AthenaAttributeList with key " << m_DSPConfigFolder << endmsg; + ATH_MSG_ERROR( "Failed to retrieve AthenaAttributeList with key " << m_DSPConfigFolder ); return sc; } const coral::Blob& blob = (attrList->coralList())["febdata"].data<coral::Blob>(); if (blob.size()<3) { - msg(MSG::INFO) << "Found empty blob, nothing to do"<<endmsg; + ATH_MSG_INFO( "Found empty blob, nothing to do"); } else { m_DSPConfig = new LArDSPConfig(attrList); } @@ -207,7 +207,7 @@ StatusCode LArOFCAlg::stop() if (sc.isFailure()) return sc; if (m_allChannelData.size()==0) { - msg(MSG::ERROR) << "No input waves found" << endmsg; + ATH_MSG_ERROR( "No input waves found" ); return StatusCode::FAILURE; } @@ -238,14 +238,14 @@ StatusCode LArOFCAlg::stop() //Instanciated the functor and start parallel_for Looper looper(&m_allChannelData,this); tbb::blocked_range<size_t> range(0, m_allChannelData.size()); - msg(MSG::INFO) << "Starting parallel execution" << endmsg; + ATH_MSG_INFO( "Starting parallel execution" ); tbb::parallel_for(tbb::blocked_range<size_t>(0, m_allChannelData.size()),looper); - msg(MSG::INFO) << "Done with parallel execution" << endmsg; + ATH_MSG_INFO( "Done with parallel execution" ); } else { - msg(MSG::INFO) << "Single threaded execution" << endmsg; + ATH_MSG_INFO( "Single threaded execution" ); for (perChannelData_t& chanData : m_allChannelData) { this->process(chanData); } @@ -257,12 +257,12 @@ StatusCode LArOFCAlg::stop() LArOFCComplete *larOFCComplete=new LArOFCComplete(); sc = larOFCComplete->setGroupingType(m_groupingType,msg()); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to set groupingType for LArOFCComplete object" << endmsg; + ATH_MSG_ERROR( "Failed to set groupingType for LArOFCComplete object" ); return sc; } sc=larOFCComplete->initialize(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed initialize LArOFCComplete object" << endmsg; + ATH_MSG_ERROR( "Failed initialize LArOFCComplete object" ); return sc; } @@ -270,12 +270,12 @@ StatusCode LArOFCAlg::stop() LArOFCComplete *larOFCCompleteV2=new LArOFCComplete(); sc = larOFCComplete->setGroupingType(m_groupingType,msg()); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to set groupingType for LArOFCComplete object" << endmsg; + ATH_MSG_ERROR( "Failed to set groupingType for LArOFCComplete object" ); return sc; } sc=larOFCCompleteV2->initialize(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed initialize LArOFCComplete object" << endmsg; + ATH_MSG_ERROR( "Failed initialize LArOFCComplete object" ); return sc; } @@ -285,12 +285,12 @@ StatusCode LArOFCAlg::stop() larOFCBinComplete=new LArOFCBinComplete(); sc=larOFCBinComplete->setGroupingType(m_groupingType,msg()); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to set groupingType for LArOFCBinComplete object" << endmsg; + ATH_MSG_ERROR( "Failed to set groupingType for LArOFCBinComplete object" ); return sc; } sc = larOFCBinComplete->initialize(); if ( sc.isFailure() ) { - msg(MSG::ERROR) << "Could not initialize LArOFCComplete data object - exit!" << endmsg ; + ATH_MSG_ERROR( "Could not initialize LArOFCComplete data object - exit!" ) ; return sc ; } } @@ -301,12 +301,12 @@ StatusCode LArOFCAlg::stop() larShapeComplete = new LArShapeComplete(); sc=larShapeComplete->setGroupingType(m_groupingType,msg()); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to set groupingType for LArShapeComplete object" << endmsg; + ATH_MSG_ERROR( "Failed to set groupingType for LArShapeComplete object" ); return sc; } sc=larShapeComplete->initialize(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed initialize LArShapeComplete object" << endmsg; + ATH_MSG_ERROR( "Failed initialize LArShapeComplete object" ); return sc; } } @@ -340,52 +340,52 @@ StatusCode LArOFCAlg::stop() } // end loop over m_allChannelData - msg(MSG::INFO) << " Summary : Computed OFCs for " << nChannels << " channels * gains" << endmsg; + ATH_MSG_INFO( " Summary : Computed OFCs for " << nChannels << " channels * gains" ); if (nFailed) - msg(MSG::ERROR) << "Number of channels * gains with failed OFC verification: " << nFailed << endmsg; + ATH_MSG_ERROR( "Number of channels * gains with failed OFC verification: " << nFailed ); // record and symlink LArOFCComplete object sc = detStore()->record(larOFCComplete,m_ofcKey); if (sc.isFailure()) { - msg(MSG::ERROR) << "Could not record LArOFCComplete to DetStore with key " << m_ofcKey << endmsg; + ATH_MSG_ERROR( "Could not record LArOFCComplete to DetStore with key " << m_ofcKey ); return StatusCode::FAILURE; } - msg(MSG::INFO) << "LArOFCComplete object recorded with key " << m_ofcKey << endmsg ; + ATH_MSG_INFO( "LArOFCComplete object recorded with key " << m_ofcKey ) ; sc = detStore()->symLink(larOFCComplete,(ILArOFC*)larOFCComplete); if (sc.isFailure()) { - msg(MSG::ERROR) << "Could not symlink ILArOFC with LArOFCComplete." << endmsg; + ATH_MSG_ERROR( "Could not symlink ILArOFC with LArOFCComplete." ); return StatusCode::FAILURE; } - msg(MSG::INFO) << "Symlink with ILArOFC done" << endmsg ; + ATH_MSG_INFO( "Symlink with ILArOFC done" ) ; // record and symlink second version of LArOFCComplete object if (m_computeV2) { sc = detStore()->record(larOFCCompleteV2,m_ofcKeyV2); if (sc.isFailure()) { - msg(MSG::ERROR) << "Could not record LArOFCComplete to DetStore with key " << m_ofcKeyV2 << endmsg; + ATH_MSG_ERROR( "Could not record LArOFCComplete to DetStore with key " << m_ofcKeyV2 ); return StatusCode::FAILURE; } - msg(MSG::INFO) << "LArOFCComplete object recorded with key " << m_ofcKeyV2 << endmsg ; + ATH_MSG_INFO( "LArOFCComplete object recorded with key " << m_ofcKeyV2 ) ; sc = detStore()->symLink(larOFCCompleteV2,(ILArOFC*)larOFCCompleteV2); if (sc.isFailure()) { - msg(MSG::ERROR) << "Could not symlink ILArOFC with LArOFCComplete." << endmsg; + ATH_MSG_ERROR( "Could not symlink ILArOFC with LArOFCComplete." ); return StatusCode::FAILURE; } - msg(MSG::INFO) << "Symlink with ILArOFC done" << endmsg ; + ATH_MSG_INFO( "Symlink with ILArOFC done" ) ; } if ( m_dumpOFCfile.size()) { - msg(MSG::INFO) << "Dumping OFCs to file " << m_dumpOFCfile << endmsg ; + ATH_MSG_INFO( "Dumping OFCs to file " << m_dumpOFCfile ) ; larOFCComplete->dumpOFC(m_dumpOFCfile) ; } if (larOFCBinComplete) { sc = detStore()->record(larOFCBinComplete,m_ofcBinKey); if (sc.isFailure()) { - msg(MSG::ERROR) << "Could not record LArOFCBinCompete object" << endmsg; + ATH_MSG_ERROR( "Could not record LArOFCBinCompete object" ); return StatusCode::FAILURE; } } @@ -395,18 +395,18 @@ StatusCode LArOFCAlg::stop() ATH_MSG_DEBUG( "Trying to record LArShapeComplete object to detector store, key = " << m_shapeKey); sc = detStore()->record(larShapeComplete,m_shapeKey); if (sc.isFailure()) { - msg(MSG::ERROR) << "Could not record LArShapeComplete to DetStore with key " << m_shapeKey << endmsg; + ATH_MSG_ERROR( "Could not record LArShapeComplete to DetStore with key " << m_shapeKey ); return StatusCode::FAILURE; } - msg(MSG::INFO) << "LArShapeComplete object recorded to DetStore successfully with key " << m_shapeKey << endmsg ; + ATH_MSG_INFO( "LArShapeComplete object recorded to DetStore successfully with key " << m_shapeKey ) ; ATH_MSG_DEBUG( "Trying to symlink ILArShape with LArShapeComplete"); ILArShape* larShape = 0; sc = detStore()->symLink(larShapeComplete,larShape); if (sc.isFailure()) { - msg(MSG::ERROR) << "Could not symlink ILArShape with LArShapeComplete." << endmsg; + ATH_MSG_ERROR( "Could not symlink ILArShape with LArShapeComplete." ); return StatusCode::FAILURE; } - msg(MSG::INFO) << "ILArShape symlink with LArShapeComplete successfully" << endmsg ; + ATH_MSG_INFO( "ILArShape symlink with LArShapeComplete successfully" ) ; } @@ -419,7 +419,7 @@ void LArOFCAlg::process(perChannelData_t& chanData) const { LArWaveHelper larWaveHelper; const LArWaveCumul* nextWave=chanData.inputWave; if (!nextWave) { - msg(MSG::ERROR) << "input wave is 0" << endmsg; + ATH_MSG_ERROR( "input wave is 0" ); return; } @@ -432,8 +432,8 @@ void LArOFCAlg::process(perChannelData_t& chanData) const { // check constistency of settings if ( m_nPoints > nextWave->getSize() ) { - msg(MSG::ERROR) << "Channel " << m_onlineID->channel_name(ch_id) <<": Wave size (" << nextWave->getSize() - << ") is too small to fit your OFC request (" << m_nPoints << " points)" << endmsg ; + ATH_MSG_ERROR( "Channel " << m_onlineID->channel_name(ch_id) <<": Wave size (" << nextWave->getSize() + << ") is too small to fit your OFC request (" << m_nPoints << " points)" ) ; chanData.shortWave=true; return; } @@ -456,7 +456,7 @@ void LArOFCAlg::process(perChannelData_t& chanData) const { if (m_normalize) { const double peak = aWave.getSample( larWaveHelper.getMax(aWave) ); if ( peak == 0 ) { - msg(MSG::ERROR) << "Wave maximum is zero, skipping channel " << m_onlineID->channel_name(ch_id) << endmsg ; + ATH_MSG_ERROR( "Wave maximum is zero, skipping channel " << m_onlineID->channel_name(ch_id) ) ; return; } @@ -606,12 +606,12 @@ StatusCode LArOFCAlg::initPhysWaveContainer() { typedef LArPhysWaveContainer::ConstConditionsMapIterator WAVEIT; for (unsigned k=0 ; k<m_keylist.size() ; k++ ) { // Loop over all containers that are to be processed (e.g. different gains) - msg(MSG::INFO) << "Processing WaveContainer from StoreGate! key = " << m_keylist[k] << endmsg; + ATH_MSG_INFO( "Processing WaveContainer from StoreGate! key = " << m_keylist[k] ); const LArPhysWaveContainer* waveCnt; StatusCode sc=detStore()->retrieve(waveCnt,m_keylist[k]); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to retrieve a LArPhysWaveContainer with key " << m_keylist[k] << endmsg; + ATH_MSG_ERROR( "Failed to retrieve a LArPhysWaveContainer with key " << m_keylist[k] ); return sc; } @@ -640,7 +640,7 @@ StatusCode LArOFCAlg::initCaliWaveContainer() { typedef LArCaliWaveContainer::ConstConditionsMapIterator WAVEIT; for (unsigned k=0 ; k<m_keylist.size() ; k++ ) { // Loop over all containers that are to be processed (e.g. different gains) - msg(MSG::INFO) << "Processing WaveContainer from StoreGate! key = " << m_keylist[k] << endmsg; + ATH_MSG_INFO( "Processing WaveContainer from StoreGate! key = " << m_keylist[k] ); //Input cali-wave might come from the same job. In this case we see a non-const container in SG probably w/o corrections applied. //Try non-const retrieve: @@ -649,9 +649,9 @@ StatusCode LArOFCAlg::initCaliWaveContainer() { if (waveCnt_nc) { waveCnt=waveCnt_nc; //Retain const pointer if (!waveCnt_nc->correctionsApplied()) { - msg(MSG::INFO) << "LArCaliWaveContainer: Corrections not yet applied, applying them now..." << endmsg; + ATH_MSG_INFO( "LArCaliWaveContainer: Corrections not yet applied, applying them now..." ); if (waveCnt_nc->applyCorrections().isFailure()) { - msg(MSG::ERROR) << "Failed to apply corrections to LArCaliWaveContainer!" << endmsg; + ATH_MSG_ERROR( "Failed to apply corrections to LArCaliWaveContainer!" ); return StatusCode::FAILURE; } } @@ -659,7 +659,7 @@ StatusCode LArOFCAlg::initCaliWaveContainer() { else { waveCnt=detStore()->tryConstRetrieve<LArCaliWaveContainer>(m_keylist[k]); if (!waveCnt) { - msg(MSG::ERROR) << "Failed to retrieve a LArCaliWaveContainer with key " << m_keylist[k] << endmsg; + ATH_MSG_ERROR( "Failed to retrieve a LArCaliWaveContainer with key " << m_keylist[k] ); return StatusCode::FAILURE; } } @@ -938,14 +938,14 @@ bool LArOFCAlg::verify(const HWIdentifier chid, const std::vector<float>& OFCa, // At this point the reconstructed amplitude must be = 1 by definition, whatever the initial normalisation! ATH_MSG_VERBOSE("recAmp=" << recAmpl << " ; recTime=" << recTime); if ( fabs(1.-recAmpl) > m_errAmpl ) { - msg(MSG::WARNING) << "Applying phase " << phase << " of " << ofcversion << " to original wave yields an Amplitude of "<< recAmpl - << " instead of 1. -> Wrong OFCs? channel " << m_onlineID->channel_name(chid) << endmsg; + ATH_MSG_WARNING( "Applying phase " << phase << " of " << ofcversion << " to original wave yields an Amplitude of "<< recAmpl + << " instead of 1. -> Wrong OFCs? channel " << m_onlineID->channel_name(chid) ); this->printOFCVec(OFCa,msg()); result=true; } if ( fabs(recTime) > m_errTime ) { - msg( MSG::WARNING) << "Applying phase " << phase << " of " << ofcversion << " to original wave yields a time offset of " << recTime - << " -> Wrong OFCs? channel " << m_onlineID->channel_name(chid) << endmsg; + ATH_MSG_WARNING( "Applying phase " << phase << " of " << ofcversion << " to original wave yields a time offset of " << recTime + << " -> Wrong OFCs? channel " << m_onlineID->channel_name(chid) ); this->printOFCVec(OFCb,msg()); result=true; } diff --git a/LArCalorimeter/LArCalibUtils/src/LArOFPhasePicker.cxx b/LArCalorimeter/LArCalibUtils/src/LArOFPhasePicker.cxx index 6960eef29e3..f82afc8add7 100755 --- a/LArCalorimeter/LArCalibUtils/src/LArOFPhasePicker.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArOFPhasePicker.cxx @@ -45,8 +45,8 @@ StatusCode LArOFPhasePicker::initialize() } else if ( m_groupingName == "ExtendedSubDetector" ) { m_groupingType = LArConditionsContainerBase::ExtendedSubDetGrouping ; } else { - msg(MSG::ERROR)<< "Grouping type " << m_groupingName << " is not foreseen!" << endmsg ; - msg(MSG::ERROR)<< "Only \"Unknown\", \"SingleGroup\", \"SubDetector\", \"FeedThrough\", \"ExtendedFeedThrough\" and \"ExtendedSubDetector\" are allowed" << endmsg ; + ATH_MSG_ERROR( "Grouping type " << m_groupingName << " is not foreseen!" ) ; + ATH_MSG_ERROR( "Only \"Unknown\", \"SingleGroup\", \"SubDetector\", \"FeedThrough\", \"ExtendedFeedThrough\" and \"ExtendedSubDetector\" are allowed" ) ; return StatusCode::FAILURE ; } @@ -71,13 +71,13 @@ StatusCode LArOFPhasePicker::stop() { if (m_keyPhase.size()) { StatusCode sc=detStore()->retrieve(m_inputPhase,m_keyPhase); if (sc.isFailure()) { - msg(MSG::ERROR)<< "Failed to get input OFC phase with key " << m_keyPhase << endmsg; - msg(MSG::ERROR)<< "Will use default phase !!" << endmsg; + ATH_MSG_ERROR( "Failed to get input OFC phase with key " << m_keyPhase ); + ATH_MSG_ERROR( "Will use default phase !!" ); m_inputPhase=NULL; } } else { - msg(MSG::INFO) << "No StoreGate key for OFC bin given. Will use default phase=" << m_defaultPhase << endmsg; + ATH_MSG_INFO( "No StoreGate key for OFC bin given. Will use default phase=" << m_defaultPhase ); } @@ -97,7 +97,7 @@ StatusCode LArOFPhasePicker::pickOFC() { const LArOFCComplete* inputOFC=NULL; sc=detStore()->retrieve(inputOFC,m_keyOFC); if (sc.isFailure()) { - msg(MSG::ERROR)<< "Failed to get input OFCs with key " << m_keyOFC << endmsg; + ATH_MSG_ERROR( "Failed to get input OFCs with key " << m_keyOFC ); return sc; } @@ -105,7 +105,7 @@ StatusCode LArOFPhasePicker::pickOFC() { larOFCComplete->setGroupingType( static_cast<LArConditionsContainerBase::GroupingType>(m_groupingType)); sc = larOFCComplete->initialize(); if ( sc.isFailure() ) { - msg(MSG::ERROR)<< "Could not initialize LArOFCComplete data object - exit!" << endmsg ; + ATH_MSG_ERROR( "Could not initialize LArOFCComplete data object - exit!" ) ; return sc ; } ATH_MSG_DEBUG("Working on OFC container '"<< m_keyOFC << "' new container will be '" << m_keyOFC_new << "'"); @@ -136,12 +136,12 @@ StatusCode LArOFPhasePicker::pickOFC() { const float timeOffset=ofc.timeOffset()+m_timeOffsetCorr; //some sanity check on the OFCs if ( vOFC_a.size() == 0 || vOFC_b.size() == 0 ) { - msg(MSG::WARNING) << "OFC not found for gain "<< gain << " channel " << m_onlineID->channel_name(id) << endmsg; + ATH_MSG_WARNING( "OFC not found for gain "<< gain << " channel " << m_onlineID->channel_name(id) ); }else if ( vOFC_a.size() != vOFC_b.size() ) { - msg(MSG::WARNING) << "OFC a (" << vOFC_a.size() << ") and b (" << vOFC_b.size() << ") are not the same size for channel " - << m_onlineID->channel_name(id) << endmsg; - msg(MSG::WARNING) << "Will be not exported !!!" << endmsg; + ATH_MSG_WARNING( "OFC a (" << vOFC_a.size() << ") and b (" << vOFC_b.size() << ") are not the same size for channel " + << m_onlineID->channel_name(id) ); + ATH_MSG_WARNING( "Will be not exported !!!" ); } else { // save in new container std::vector<std::vector<float> > OFC_a; OFC_a.push_back(vOFC_a.asVector()); @@ -156,12 +156,12 @@ StatusCode LArOFPhasePicker::pickOFC() { sc = detStore()->record(larOFCComplete, m_keyOFC_new); if (sc.isFailure()) { - msg(MSG::ERROR)<< "Failed to record LArOFCComplete object with key " << m_keyOFC_new << endmsg; + ATH_MSG_ERROR( "Failed to record LArOFCComplete object with key " << m_keyOFC_new ); return sc; } sc = detStore()->symLink(larOFCComplete, (ILArOFC*)larOFCComplete); if (sc.isFailure()) { - msg(MSG::ERROR)<< "Failed to sym-link LArOFCComplete object" << endmsg; + ATH_MSG_ERROR( "Failed to sym-link LArOFCComplete object" ); return sc; } return StatusCode::SUCCESS; @@ -176,7 +176,7 @@ StatusCode LArOFPhasePicker::pickShape() const LArShapeComplete* inputShape=NULL; sc=detStore()->retrieve(inputShape,m_keyShape); if (sc.isFailure()) { - msg(MSG::ERROR)<< "Failed to get input Shapes with key " << m_keyShape << endmsg; + ATH_MSG_ERROR( "Failed to get input Shapes with key " << m_keyShape ); return sc; } @@ -184,7 +184,7 @@ StatusCode LArOFPhasePicker::pickShape() larShapeComplete->setGroupingType( static_cast<LArConditionsContainerBase::GroupingType>(m_groupingType)); sc = larShapeComplete->initialize(); if ( sc.isFailure() ) { - msg(MSG::ERROR)<< "Could not initialize LArShapeComplete data object - exit!" << endmsg ; + ATH_MSG_ERROR( "Could not initialize LArShapeComplete data object - exit!" ) ; return sc ; } @@ -216,11 +216,11 @@ StatusCode LArOFPhasePicker::pickShape() const float timeOffset=shape.timeOffset(); //some sanity check on the Shapes if ( vShape.size() == 0 || vShapeDer.size() == 0 ) { - msg(MSG::WARNING) << "Shape not found for gain "<< gain << " channel " << m_onlineID->channel_name(id) << endmsg; + ATH_MSG_WARNING( "Shape not found for gain "<< gain << " channel " << m_onlineID->channel_name(id) ); } else if ( vShape.size() != vShapeDer.size() ) { - msg(MSG::WARNING) << "Shape a (" << vShape.size() << ") and b (" << vShapeDer.size() << ") are not the same size for channel" - << m_onlineID->channel_name(id) << endmsg; - msg(MSG::WARNING) << "Will be not exported !!!" << endmsg; + ATH_MSG_WARNING( "Shape a (" << vShape.size() << ") and b (" << vShapeDer.size() << ") are not the same size for channel" + << m_onlineID->channel_name(id) ); + ATH_MSG_WARNING( "Will be not exported !!!" ); } else { // save in new container std::vector<std::vector<float> > shapeDer; std::vector<std::vector<float> > shapeAmpl; @@ -235,12 +235,12 @@ StatusCode LArOFPhasePicker::pickShape() sc = detStore()->record(larShapeComplete, m_keyShape_new); if (sc.isFailure()) { - msg(MSG::ERROR)<< "Failed to record LArShapeComplete object with key " << m_keyShape_new << endmsg; + ATH_MSG_ERROR( "Failed to record LArShapeComplete object with key " << m_keyShape_new ); return sc; } sc = detStore()->symLink(larShapeComplete, (ILArShape*)larShapeComplete); if (sc.isFailure()) { - msg(MSG::ERROR)<< "Failed to sym-link LArShapeComplete object" << endmsg; + ATH_MSG_ERROR( "Failed to sym-link LArShapeComplete object" ); return sc; } diff --git a/LArCalorimeter/LArCalibUtils/src/LArPedestalAutoCorrBuilder.cxx b/LArCalorimeter/LArCalibUtils/src/LArPedestalAutoCorrBuilder.cxx index 47b24583956..84730b17c60 100644 --- a/LArCalorimeter/LArCalibUtils/src/LArPedestalAutoCorrBuilder.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArPedestalAutoCorrBuilder.cxx @@ -51,13 +51,13 @@ StatusCode LArPedestalAutoCorrBuilder::initialize() sc = detStore()->retrieve(m_onlineHelper, "LArOnlineID"); if (sc.isFailure()) { - msg(MSG::ERROR) << "Could not get LArOnlineID helper !" << endmsg; + ATH_MSG_ERROR( "Could not get LArOnlineID helper !" ); return StatusCode::FAILURE; } if (!m_doPedestal && !m_doAutoCorr) { - msg(MSG::ERROR) << "Configuration Problem: Neither doPedstal nor doAutoCorr set!" << endmsg; + ATH_MSG_ERROR( "Configuration Problem: Neither doPedstal nor doAutoCorr set!" ); return StatusCode::FAILURE; } @@ -73,7 +73,7 @@ StatusCode LArPedestalAutoCorrBuilder::initialize() m_accu.setGroupingType(LArConditionsContainerBase::SingleGroup); sc=m_accu.initialize(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed initialize LArConditionsContainer 'm_accu'" << endmsg; + ATH_MSG_ERROR( "Failed initialize LArConditionsContainer 'm_accu'" ); return sc; } return StatusCode::SUCCESS; @@ -88,7 +88,7 @@ StatusCode LArPedestalAutoCorrBuilder::execute() StatusCode sc; ++m_event_counter; if (m_keylist.size()==0) { - msg(MSG::ERROR) << "Key list is empty! No containers processed!" << endmsg; + ATH_MSG_ERROR( "Key list is empty! No containers processed!" ); return StatusCode::FAILURE; } @@ -97,13 +97,13 @@ StatusCode LArPedestalAutoCorrBuilder::execute() if (evtStore()->contains<LArFebErrorSummary>("LArFebErrorSummary")) { sc=evtStore()->retrieve(febErrSum); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to retrieve FebErrorSummary object!" << endmsg; + ATH_MSG_ERROR( "Failed to retrieve FebErrorSummary object!" ); return sc; } } else if (m_event_counter==1) - msg(MSG::WARNING) << "No FebErrorSummaryObject found! Feb errors not checked!" << endmsg; + ATH_MSG_WARNING( "No FebErrorSummaryObject found! Feb errors not checked!" ); std::vector<std::string>::const_iterator key_it=m_keylist.begin(); @@ -139,8 +139,8 @@ StatusCode LArPedestalAutoCorrBuilder::execute() if (febErrs & m_fatalFebErrorPattern) { if (febid!=lastFailedFEB) { lastFailedFEB=febid; - msg(MSG::ERROR) << "Event " << m_event_counter << " Feb " << m_onlineHelper->channel_name(febid) - << " reports error(s):" << febErrSum->error_to_string(febErrs) << ". Data ignored." << endmsg; + ATH_MSG_ERROR( "Event " << m_event_counter << " Feb " << m_onlineHelper->channel_name(febid) + << " reports error(s):" << febErrSum->error_to_string(febErrs) << ". Data ignored." ); } continue; } //end if fatal feb error @@ -150,7 +150,7 @@ StatusCode LArPedestalAutoCorrBuilder::execute() LArAccumulatedDigit& accDg=m_accu.get(chid,gain); if (!accDg.setAddSubStep(*dg)) - msg(MSG::ERROR) << "Failed to accumulate sub-steps! Inconsistent number of ADC samples" << endmsg; + ATH_MSG_ERROR( "Failed to accumulate sub-steps! Inconsistent number of ADC samples" ); } //end loop over input container }//end loop over keys return StatusCode::SUCCESS; @@ -218,17 +218,17 @@ StatusCode LArPedestalAutoCorrBuilder::stop() { NCells++; }//end loop over all cells - msg(MSG::INFO) << "Gain " << gain << " Number of cells with 0 events to compute "<<objName<< ": " << n_zero << endmsg; - msg(MSG::INFO) << "Gain " << gain << " Minimum number of events*samples to compute " <<objName<<": "<< n_min << endmsg; - msg(MSG::INFO) << "Gain " << gain << " Maximum number of events*samples to compute " <<objName<<": " <<n_max << endmsg; + ATH_MSG_INFO( "Gain " << gain << " Number of cells with 0 events to compute "<<objName<< ": " << n_zero ); + ATH_MSG_INFO( "Gain " << gain << " Minimum number of events*samples to compute " <<objName<<": "<< n_min ); + ATH_MSG_INFO( "Gain " << gain << " Maximum number of events*samples to compute " <<objName<<": " <<n_max ); }// End loop over all containers - msg(MSG::INFO) << " Summary : Number of cells with " <<objName<<" value computed : " << NCells << endmsg; - msg(MSG::INFO) << " Summary : Number of Barrel PS cells side A or C (connected+unconnected): 3904+ 192 = 4096 " << endmsg; - msg(MSG::INFO) << " Summary : Number of Barrel cells side A or C (connected+unconnected): 50944+2304 = 53248 " << endmsg; - msg(MSG::INFO) << " Summary : Number of EMEC cells side A or C (connected+unconnected): 31872+3456 = 35328 " << endmsg; - msg(MSG::INFO) << " Summary : Number of HEC cells side A or C (connected+unconnected): 2816+ 256 = 3072 " << endmsg; - msg(MSG::INFO) << " Summary : Number of FCAL cells side A or C (connected+unconnected): 1762+ 30 = 1792 " << endmsg; + ATH_MSG_INFO( " Summary : Number of cells with " <<objName<<" value computed : " << NCells ); + ATH_MSG_INFO( " Summary : Number of Barrel PS cells side A or C (connected+unconnected): 3904+ 192 = 4096 " ); + ATH_MSG_INFO( " Summary : Number of Barrel cells side A or C (connected+unconnected): 50944+2304 = 53248 " ); + ATH_MSG_INFO( " Summary : Number of EMEC cells side A or C (connected+unconnected): 31872+3456 = 35328 " ); + ATH_MSG_INFO( " Summary : Number of HEC cells side A or C (connected+unconnected): 2816+ 256 = 3072 " ); + ATH_MSG_INFO( " Summary : Number of FCAL cells side A or C (connected+unconnected): 1762+ 30 = 1792 " ); if (larPedestalComplete) { ATH_CHECK( detStore()->record(std::move(larPedestalComplete),m_pedContName) ); diff --git a/LArCalorimeter/LArCalibUtils/src/LArPedestalBuilder.cxx b/LArCalorimeter/LArCalibUtils/src/LArPedestalBuilder.cxx index 3055b20d385..17bbed52c3c 100644 --- a/LArCalorimeter/LArCalibUtils/src/LArPedestalBuilder.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArPedestalBuilder.cxx @@ -45,14 +45,14 @@ LArPedestalBuilder::~LArPedestalBuilder() StatusCode LArPedestalBuilder::initialize() { StatusCode sc; - msg(MSG::INFO) << ">>> Initialize" << endmsg; + ATH_MSG_INFO( ">>> Initialize" ); //m_mean.resize(1); //m_rms.resize(1); sc = detStore()->retrieve(m_onlineHelper, "LArOnlineID"); if (sc.isFailure()) { - msg(MSG::ERROR) << "Could not get LArOnlineID helper !" << endmsg; + ATH_MSG_ERROR( "Could not get LArOnlineID helper !" ); return StatusCode::FAILURE; } @@ -71,7 +71,7 @@ StatusCode LArPedestalBuilder::initialize() m_accu.setGroupingType(LArConditionsContainerBase::SingleGroup); m_accu.initialize(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed initialize LArConditionsContainer 'm_accu'" << endmsg; + ATH_MSG_ERROR( "Failed initialize LArConditionsContainer 'm_accu'" ); return sc; } return StatusCode::SUCCESS; @@ -84,7 +84,7 @@ StatusCode LArPedestalBuilder::execute() { ++m_event_counter; if (m_keylist.size()==0) { - msg(MSG::ERROR) << "Key list is empty! No containers processed!" << endmsg; + ATH_MSG_ERROR( "Key list is empty! No containers processed!" ); return StatusCode::FAILURE; } @@ -95,7 +95,7 @@ StatusCode LArPedestalBuilder::execute() } else if (m_event_counter==1) - msg(MSG::WARNING) << "No FebErrorSummaryObject found! Feb errors not checked!" << endmsg; + ATH_MSG_WARNING( "No FebErrorSummaryObject found! Feb errors not checked!" ); @@ -134,8 +134,8 @@ StatusCode LArPedestalBuilder::execute() if (febErrs & m_fatalFebErrorPattern) { if (febid!=lastFailedFEB) { lastFailedFEB=febid; - msg(MSG::ERROR) << "Event " << m_event_counter << " Feb " << m_onlineHelper->channel_name(febid) - << " reports error(s):" << febErrSum->error_to_string(febErrs) << ". Data ignored." << endmsg; + ATH_MSG_ERROR( "Event " << m_event_counter << " Feb " << m_onlineHelper->channel_name(febid) + << " reports error(s):" << febErrSum->error_to_string(febErrs) << ". Data ignored." ); } continue; } //end if fatal feb error @@ -145,7 +145,7 @@ StatusCode LArPedestalBuilder::execute() LArAccumulatedDigit& accDg=m_accu.get(chid,gain); if (!accDg.setAddSubStep(*dg)) - msg(MSG::ERROR) << "Failed to accumulate sub-steps! Inconsistent number of ADC samples" << endmsg; + ATH_MSG_ERROR( "Failed to accumulate sub-steps! Inconsistent number of ADC samples" ); } //end loop over input container }//end loop over keys return StatusCode::SUCCESS; @@ -187,18 +187,18 @@ StatusCode LArPedestalBuilder::execute() NPedestal++; }//end loop over all cells - msg(MSG::DEBUG) << "Gain " << gain << " Number of cells with 0 events to compute pedestal: " << n_zero << endmsg; - msg(MSG::DEBUG) << "Gain " << gain << " Minimum number of events*samples to compute pedestal: " << n_min << endmsg; - msg(MSG::DEBUG) << "Gain " << gain << " Maximum number of events*samples to compute pedestal: " << n_max << endmsg; + ATH_MSG_DEBUG( "Gain " << gain << " Number of cells with 0 events to compute pedestal: " << n_zero ); + ATH_MSG_DEBUG( "Gain " << gain << " Minimum number of events*samples to compute pedestal: " << n_min ); + ATH_MSG_DEBUG( "Gain " << gain << " Maximum number of events*samples to compute pedestal: " << n_max ); }// End loop over all containers - //msg(MSG::INFO) << " Summary : Number of cells with a pedestal value computed : " << larPedestalComplete->totalNumberOfConditions() << endmsg; - msg(MSG::INFO) << " Summary : Number of cells with a pedestal value computed : " << NPedestal << endmsg; - msg(MSG::INFO) << " Summary : Number of Barrel PS cells side A or C (connected+unconnected): 3904+ 192 = 4096 " << endmsg; - msg(MSG::INFO) << " Summary : Number of Barrel cells side A or C (connected+unconnected): 50944+2304 = 53248 " << endmsg; - msg(MSG::INFO) << " Summary : Number of EMEC cells side A or C (connected+unconnected): 31872+3456 = 35328 " << endmsg; - msg(MSG::INFO) << " Summary : Number of HEC cells side A or C (connected+unconnected): 2816+ 256 = 3072 " << endmsg; - msg(MSG::INFO) << " Summary : Number of FCAL cells side A or C (connected+unconnected): 1762+ 30 = 1792 " << endmsg; + //ATH_MSG_INFO( " Summary : Number of cells with a pedestal value computed : " << larPedestalComplete->totalNumberOfConditions() ); + ATH_MSG_INFO( " Summary : Number of cells with a pedestal value computed : " << NPedestal ); + ATH_MSG_INFO( " Summary : Number of Barrel PS cells side A or C (connected+unconnected): 3904+ 192 = 4096 " ); + ATH_MSG_INFO( " Summary : Number of Barrel cells side A or C (connected+unconnected): 50944+2304 = 53248 " ); + ATH_MSG_INFO( " Summary : Number of EMEC cells side A or C (connected+unconnected): 31872+3456 = 35328 " ); + ATH_MSG_INFO( " Summary : Number of HEC cells side A or C (connected+unconnected): 2816+ 256 = 3072 " ); + ATH_MSG_INFO( " Summary : Number of FCAL cells side A or C (connected+unconnected): 1762+ 30 = 1792 " ); // Record LArPedestalComplete ATH_CHECK( detStore()->record(std::move(larPedestalComplete),m_pedContName) ); diff --git a/LArCalorimeter/LArCalibUtils/src/LArPhysWavePredictor.cxx b/LArCalorimeter/LArCalibUtils/src/LArPhysWavePredictor.cxx index dc038fc5b44..fda34396839 100755 --- a/LArCalorimeter/LArCalibUtils/src/LArPhysWavePredictor.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArPhysWavePredictor.cxx @@ -6,7 +6,6 @@ #include "GaudiKernel/ToolHandle.h" #include "LArRecConditions/ILArBadChannelMasker.h" -#include "LArRecConditions/ILArBadChanTool.h" #include "CaloIdentifier/CaloIdManager.h" #include "LArRawConditions/LArCaliWave.h" @@ -47,7 +46,6 @@ typedef LArPhysWaveContainer::ConstConditionsMapIterator PhysWaveIt; LArPhysWavePredictor::LArPhysWavePredictor (const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator), - m_badChanTool("LArBadChanTool"), m_onlineHelper(0), m_groupingType("FeedThrough") // SubDetector, Single, FeedThrough { @@ -119,28 +117,24 @@ LArPhysWavePredictor::~LArPhysWavePredictor() StatusCode LArPhysWavePredictor::initialize() { if ( ! m_doubleTriangle ) { - msg(MSG::INFO) << "Using standard triangular ionization pulse" << endmsg ; + ATH_MSG_INFO( "Using standard triangular ionization pulse" ) ; } else { - msg(MSG::INFO) << "Using refined ionization pulse (double triangle)" << endmsg ; + ATH_MSG_INFO( "Using refined ionization pulse (double triangle)" ) ; } StatusCode sc = detStore()->retrieve(m_onlineHelper, "LArOnlineID"); if (sc.isFailure()) { - msg(MSG::ERROR) << "Could not get LArOnlineID" << endmsg; + ATH_MSG_ERROR( "Could not get LArOnlineID" ); return sc; } - sc=m_badChanTool.retrieve(); - if (sc.isFailure()) { - msg(MSG::FATAL) << "Could not retrieve BadChannelTool " << m_badChanTool << endmsg; - return StatusCode::FAILURE; - } + ATH_CHECK( m_BCKey.initialize() ); sc=m_maskingTool.retrieve(); if (sc.isFailure()) { - msg(MSG::FATAL) << "Could not retrieve BadChannelMask " - << m_maskingTool << endmsg; + ATH_MSG_FATAL( "Could not retrieve BadChannelMask " + << m_maskingTool ); return StatusCode::FAILURE; } @@ -165,7 +159,7 @@ struct FileCloser StatusCode LArPhysWavePredictor::stop() { - msg(MSG::INFO) << "... in stop()" << endmsg ; + ATH_MSG_INFO( "... in stop()" ) ; LArWaveHelper larWaveHelper; @@ -173,7 +167,7 @@ StatusCode LArPhysWavePredictor::stop() //StoreGateSvc* detStore; //StatusCode sc = service("DetectorStore",detStore); //if (sc!=StatusCode::SUCCESS) { - // msg(MSG::ERROR) << "Cannot get DetectorStore!" << endmsg; + // ATH_MSG_ERROR( "Cannot get DetectorStore!" ); // return sc; //} @@ -181,7 +175,7 @@ StatusCode LArPhysWavePredictor::stop() ToolHandle<LArPhysWaveTool> larPhysWaveTool("LArPhysWaveTool"); StatusCode sc=larPhysWaveTool.retrieve(); if (sc!=StatusCode::SUCCESS) { - msg(MSG::ERROR) << " Can't get LArPhysWaveTool " << endmsg; + ATH_MSG_ERROR( " Can't get LArPhysWaveTool " ); return sc; } @@ -190,14 +184,14 @@ StatusCode LArPhysWavePredictor::stop() if(m_isHEC){ sc=larPhysWaveHECTool.retrieve(); if (sc!=StatusCode::SUCCESS) { - msg(MSG::ERROR) << " Can't get LArPhysWaveHECTool " << endmsg; + ATH_MSG_ERROR( " Can't get LArPhysWaveHECTool " ); return sc; }} const CaloIdManager *caloIdMgr = CaloIdManager::instance() ; const LArEM_ID* emId = caloIdMgr->getEM_ID(); if (!emId) { - msg(MSG::ERROR) << "Could not access lar EM ID helper" << endmsg; + ATH_MSG_ERROR( "Could not access lar EM ID helper" ); return StatusCode::FAILURE; } @@ -205,12 +199,12 @@ StatusCode LArPhysWavePredictor::stop() ToolHandle<LArCablingService> larCablingSvc("LArCablingService"); sc = larCablingSvc.retrieve(); if (sc!=StatusCode::SUCCESS) { - msg(MSG::ERROR) << " Can't get LArCablingSvc " << endmsg; + ATH_MSG_ERROR( " Can't get LArCablingSvc " ); return sc; } if(sc.isFailure()){ - msg(MSG::ERROR) << "Could not retrieve LArCablingService Tool" << endmsg; + ATH_MSG_ERROR( "Could not retrieve LArCablingService Tool" ); return StatusCode::FAILURE; } @@ -223,10 +217,10 @@ StatusCode LArPhysWavePredictor::stop() if ( !m_useJOCaliPulseParams ) { sc = detStore()->retrieve(larCaliPulseParams); if ( sc == StatusCode::FAILURE ) { - msg(MSG::WARNING) << "Cannot retrieve LArCaliPulseParams" << endmsg ; + ATH_MSG_WARNING( "Cannot retrieve LArCaliPulseParams" ) ; return sc; } else { - msg(MSG::INFO) << "LArCaliPulseParams successfully retrieved" << endmsg ; + ATH_MSG_INFO( "LArCaliPulseParams successfully retrieved" ) ; } } @@ -234,10 +228,10 @@ StatusCode LArPhysWavePredictor::stop() if (!m_isHEC) { sc = detStore()->retrieve(larDetCellParams); if ( sc == StatusCode::FAILURE ) { - msg(MSG::WARNING) << "Cannot retrieve LArDetCellParams" << endmsg; + ATH_MSG_WARNING( "Cannot retrieve LArDetCellParams" ); return sc; }else { - msg(MSG::INFO) << "LArDetCellParams successfully retrieved" << endmsg; + ATH_MSG_INFO( "LArDetCellParams successfully retrieved" ); } }else{ m_useJODetCellParams = true ; @@ -247,42 +241,42 @@ StatusCode LArPhysWavePredictor::stop() if ( !m_useJOTdrift ) { sc = detStore()->retrieve(larTdrift); if ( sc == StatusCode::FAILURE ) { - msg(MSG::WARNING) << "Cannot retrieve LArTdriftComplete" << endmsg; + ATH_MSG_WARNING( "Cannot retrieve LArTdriftComplete" ); return sc; }else { - msg(MSG::INFO) << "LArTdriftComplete successfully retrieved" << endmsg; + ATH_MSG_INFO( "LArTdriftComplete successfully retrieved" ); } } if ( !m_useJOPhysCaliTdiff ) { sc = detStore()->retrieve(larPhysCaliTdiff); if ( sc == StatusCode::FAILURE ) { - msg(MSG::WARNING) << "Cannot retrieve LArPhysCaliTdiff" << endmsg; + ATH_MSG_WARNING( "Cannot retrieve LArPhysCaliTdiff" ); return sc; }else { - msg(MSG::INFO) << "LArPhysCaliTdiff successfully retrieved" << endmsg; + ATH_MSG_INFO( "LArPhysCaliTdiff successfully retrieved" ); } } const ILArFEBTimeOffset* larFebTshift = NULL; if ( m_useJOPhysCaliTdiff ) { // no LArPhysCaliTdiffComplete found, or manual time shift selected if ( m_timeShiftByHelper ) { - msg(MSG::INFO) << "Will use helper class for start time." << endmsg; + ATH_MSG_INFO( "Will use helper class for start time." ); m_timeShiftByIndex = -1 ; m_timeShiftByLayer = false ; m_timeShiftByFEB = false ; } if ( m_timeShiftByIndex != -1 ) { - msg(MSG::INFO) << "Manually shifting pulses by time index " << m_timeShiftByIndex << endmsg; + ATH_MSG_INFO( "Manually shifting pulses by time index " << m_timeShiftByIndex ); m_timeShiftByLayer = false ; m_timeShiftByFEB = false ; } if ( m_timeShiftByLayer ) { - msg(MSG::INFO) << "Manually shifting pulses by *layer-dependent* time indexes." << endmsg; + ATH_MSG_INFO( "Manually shifting pulses by *layer-dependent* time indexes." ); m_timeShiftByFEB = false ; } if ( m_timeShiftByFEB ) { - msg(MSG::INFO) << "Manually shifting pulses by *FEB* time indexes." << endmsg; + ATH_MSG_INFO( "Manually shifting pulses by *FEB* time indexes." ); sc = detStore()->retrieve(larFebTshift); if (sc.isFailure()) larFebTshift = NULL; @@ -296,13 +290,13 @@ StatusCode LArPhysWavePredictor::stop() sc=larPhysWaveContainer->setGroupingType(m_groupingType,msg()); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to set groupingType for LArPhysWaveContainer object" << endmsg; + ATH_MSG_ERROR( "Failed to set groupingType for LArPhysWaveContainer object" ); return sc; } sc=larPhysWaveContainer->initialize(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed initialize LArPhysWaveContainer object" << endmsg; + ATH_MSG_ERROR( "Failed initialize LArPhysWaveContainer object" ); return sc; } @@ -310,13 +304,13 @@ StatusCode LArPhysWavePredictor::stop() LArMphysOverMcalComplete* MphysOverMcalComplete = new LArMphysOverMcalComplete(); sc=MphysOverMcalComplete->setGroupingType(m_groupingType,msg()); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to set groupingType for LArMphysOverMcalComplete object" << endmsg; + ATH_MSG_ERROR( "Failed to set groupingType for LArMphysOverMcalComplete object" ); return sc; } sc=MphysOverMcalComplete->initialize(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed initialize LArMphysOverMcalComplete object" << endmsg; + ATH_MSG_ERROR( "Failed initialize LArMphysOverMcalComplete object" ); return sc; } @@ -350,7 +344,7 @@ StatusCode LArPhysWavePredictor::stop() const LArPhysWaveContainer* larIdealPhysWaveContainer=0; if(m_isHEC){ ATH_CHECK(detStore()->retrieve(larIdealPhysWaveContainer,m_keyIdealPhys)); - msg(MSG::INFO) <<"LArPhysWaveContainer with (key = " << m_keyIdealPhys << ") reading from StoreGate" << endmsg; + ATH_MSG_INFO("LArPhysWaveContainer with (key = " << m_keyIdealPhys << ") reading from StoreGate" ); } /////////////IDEAL PHYSWAVE///////////////////////////// @@ -367,19 +361,19 @@ StatusCode LArPhysWavePredictor::stop() const LArCaliWaveContainer* caliWaveContainer; sc = detStore()->retrieve(caliWaveContainer,*key_it); if (sc.isFailure()) { - //log << MSG::INF0 << "LArCaliWaveContainer (key = " << *key_it << ") not found in StoreGate" << endmsg; + //log << MSG::INF0 << "LArCaliWaveContainer (key = " << *key_it << ") not found in StoreGate" ); continue; } if ( caliWaveContainer == NULL ) { - msg(MSG::INFO) << "LArCaliWaveContainer (key = " << *key_it << ") is empty" << endmsg; + ATH_MSG_INFO( "LArCaliWaveContainer (key = " << *key_it << ") is empty" ); continue; } - msg(MSG::INFO) << "Processing LArCaliWaveContainer from StoreGate, key = " << *key_it << endmsg; + ATH_MSG_INFO( "Processing LArCaliWaveContainer from StoreGate, key = " << *key_it ); for ( unsigned gain = CaloGain::LARHIGHGAIN ; gain < CaloGain::LARNGAIN ; ++ gain ) { // loop over gain in the current LArCaliWAveContainer - msg(MSG::INFO) << "Now processing gain = " << gain << " in LArCaliWaveContainer with key = " << *key_it << endmsg; + ATH_MSG_INFO( "Now processing gain = " << gain << " in LArCaliWaveContainer with key = " << *key_it ); // loop over current cali wave container typedef LArCaliWaveContainer::ConstConditionsMapIterator const_iterator; @@ -392,7 +386,7 @@ StatusCode LArPhysWavePredictor::stop() LArCaliWaveContainer::LArCaliWaves::const_iterator cont_it_e = (*itVec).end(); if ( itVec == itVec_e ) { - msg(MSG::INFO) << "LArCaliWaveContainer (key = " << *key_it << ") has no wave with gain = " << gain << endmsg; + ATH_MSG_INFO( "LArCaliWaveContainer (key = " << *key_it << ") has no wave with gain = " << gain ); continue ; } @@ -406,7 +400,7 @@ StatusCode LArPhysWavePredictor::stop() } nchannel++ ; if ( nchannel < 100 || ( nchannel < 1000 && nchannel%100==0 ) || nchannel%1000==0 ) - msg(MSG::INFO) << "Processing calibration waveform number " << nchannel << endmsg; + ATH_MSG_INFO( "Processing calibration waveform number " << nchannel ); const LArCaliWave& larCaliWave = (*cont_it); @@ -427,8 +421,8 @@ StatusCode LArPhysWavePredictor::stop() try { id = larCablingSvc->cnvToIdentifier(chid); } catch (LArID_Exception & execpt) { - msg(MSG::ERROR) << "LArCabling exception caught for channel 0x" << MSG::hex << chid << MSG::dec - << ". Skipping channel." << endmsg ; + ATH_MSG_ERROR( "LArCabling exception caught for channel 0x" << MSG::hex << chid << MSG::dec + << ". Skipping channel." ) ; continue ; } @@ -493,8 +487,8 @@ StatusCode LArPhysWavePredictor::stop() Tdrift = larTdrift->Tdrift(chid) ; if ( Tdrift <= 1.0+LArTdriftComplete::ERRORCODE ) { notFoundMsg(chid,gain,"Tdrift"); - //msg(MSG::ERROR) << "Cannot access Tdrift for channel 0x" << MSG::hex << chid << MSG::dec - // << ". Will use jobOption setting." << endmsg ; + //ATH_MSG_ERROR( "Cannot access Tdrift for channel 0x" << MSG::hex << chid << MSG::dec + // << ". Will use jobOption setting." ) ; if ( layer>=0 && layer<4 ) Tdrift = m_Tdrift[layer]; // Set drift time according to layer else @@ -515,8 +509,6 @@ StatusCode LArPhysWavePredictor::stop() Tdiff = (int)larPhysCaliTdiff->Tdiff(chid,gain) ; if ( Tdiff <= 1.0+LArPhysCaliTdiffComplete::ERRORCODE ) { notFoundMsg(chid,gain,"Tdiff"); - //msg(MSG::WARNING) << "Cannot access Tdiff for channel 0x" << MSG::hex << chid << MSG::dec - // << ", gain = " << gain << ". Will use jobOption setting." << endmsg ; Tdiff = 0 ; m_useJOPhysCaliTdiff = true ; noTdiff[gain]++; @@ -554,7 +546,7 @@ StatusCode LArPhysWavePredictor::stop() double peak = theLArCaliWave.getSample(larWaveHelper.getMax(theLArCaliWave)); ATH_MSG_VERBOSE("Channel 0x" << MSG::hex << chid << MSG::dec << " -> Applying normalisation (CaliWave peak = " << peak << ")"); if ( peak <=0 ) { - msg(MSG::WARNING) << "Peak value <=0 , cannot normalize!" << endmsg ; + ATH_MSG_WARNING( "Peak value <=0 , cannot normalize!" ) ; } else { theLArCaliWave = LArCaliWave( (theLArCaliWave*(1./peak)).getWave(), theLArCaliWave.getErrors(), @@ -582,7 +574,7 @@ StatusCode LArPhysWavePredictor::stop() else sc = larPhysWaveTool->makeLArPhysWave(wfParams,theLArCaliWave,region,layer,larPhysWave,MphysMcali); if (sc.isFailure()) { - msg(MSG::FATAL) << "Cannot predict LArPhysWave for channel 0x" << MSG::hex << chid << MSG::dec << endmsg; + ATH_MSG_FATAL( "Cannot predict LArPhysWave for channel 0x" << MSG::hex << chid << MSG::dec ); continue; } larPhysWave.setFlag( LArWave::predCali ) ; @@ -596,7 +588,7 @@ StatusCode LArPhysWavePredictor::stop() float MphysMcali2 ; sc = larPhysWaveTool->makeLArPhysWave(wfParams2,theLArCaliWave,region,layer,larPhysWave2,MphysMcali2); if (sc.isFailure()) { - msg(MSG::FATAL) << "Cannot predict LArPhysWave for channel 0x" << MSG::hex << chid << MSG::dec << "with double triangle." << endmsg; + ATH_MSG_FATAL( "Cannot predict LArPhysWave for channel 0x" << MSG::hex << chid << MSG::dec << "with double triangle." ); continue; } larPhysWave = LArPhysWave ( ( larPhysWave*(1.-m_wTriangle2[layer])+larPhysWave2*m_wTriangle2[layer] ).getWave() , @@ -605,7 +597,7 @@ StatusCode LArPhysWavePredictor::stop() // Double-triagle predicion was used, Mphys/Mcali should be recomputed... MphysMcali = larPhysWave.getSample(larWaveHelper.getMax(larPhysWave))/theLArCaliWave.getSample(larWaveHelper.getMax(theLArCaliWave)); } else { - msg(MSG::WARNING) << "Double triangle implemented only for EMB, skip channel!" << endmsg ; + ATH_MSG_WARNING( "Double triangle implemented only for EMB, skip channel!" ) ; } } // end if 2nd triangle @@ -637,19 +629,19 @@ StatusCode LArPhysWavePredictor::stop() if ( m_testmode && nchannel>=10 ) { - msg(MSG::INFO) << "Test mode selected, process only one channel!" << endmsg ; + ATH_MSG_INFO( "Test mode selected, process only one channel!" ) ; // Record LArPhysWaveContainer to DetectorStore sc = detStore()->record(larPhysWaveContainer,m_keyPhys); if (sc.isFailure()) { - msg(MSG::FATAL) << "Cannot record LArPhysWaveContainer to StoreGate! key=" << m_keyPhys << endmsg; + ATH_MSG_FATAL( "Cannot record LArPhysWaveContainer to StoreGate! key=" << m_keyPhys ); return StatusCode::FAILURE; } // Record LArMphysOverMcalComplete to DetectorStore sc = detStore()->record(MphysOverMcalComplete,m_keyMphysMcali); if (sc.isFailure()) { - msg(MSG::FATAL) << "Cannot record LArMphysOverMcalComplete to StoreGate! key=" << m_keyMphysMcali << endmsg; + ATH_MSG_FATAL( "Cannot record LArMphysOverMcalComplete to StoreGate! key=" << m_keyMphysMcali ); return StatusCode::FAILURE; } @@ -658,10 +650,10 @@ StatusCode LArPhysWavePredictor::stop() ILArMphysOverMcal *larMphysOverMcal = NULL; sc = detStore()->symLink(MphysOverMcalComplete,larMphysOverMcal); if (sc.isFailure()) { - msg(MSG::FATAL) << "Could not symlink ILArMphysOverMcal with LArMphysOverMcalComplete." << endmsg; + ATH_MSG_FATAL( "Could not symlink ILArMphysOverMcal with LArMphysOverMcalComplete." ); return StatusCode::FAILURE; } - msg(MSG::INFO) << "ILArMphysOverMcal symlink with LArMphysOverMcalComplete successfully" << endmsg ; + ATH_MSG_INFO( "ILArMphysOverMcal symlink with LArMphysOverMcalComplete successfully" ) ; return StatusCode::SUCCESS; @@ -675,50 +667,50 @@ StatusCode LArPhysWavePredictor::stop() } // End loop over all CaliWave containers - //msg(MSG::INFO) << " Summary : Number of cells with a PhysWave values computed : " << larPhysWaveContainer->totalNumberOfConditions() << endmsg; - //msg(MSG::INFO) << " Summary : Number of cells with a MphysOverMcal values computed : " << MphysOverMcalComplete->totalNumberOfConditions() << endmsg; - msg(MSG::INFO) << " Summary : Number of cells with a PhysWave values computed : " << NPhysWave << endmsg; - msg(MSG::INFO) << " Summary : Number of cells with a MphysOverMcal values computed : " << NMPMC << endmsg; - msg(MSG::INFO) << " Summary : Number of Barrel PS cells side A or C (connected+unconnected): 3904+ 192 " << endmsg; - msg(MSG::INFO) << " Summary : Number of Barrel cells side A or C (connected+unconnected): 50944+2304 " << endmsg; - msg(MSG::INFO) << " Summary : Number of EMEC cells side A or C (connected+unconnected): 31872+3456 " << endmsg; - msg(MSG::INFO) << " Summary : Number of HEC cells side A or C (connected+unconnected): 2816+ 256 " << endmsg; - msg(MSG::INFO) << " Summary : Number of FCAL cells side A or C (connected+unconnected): 1762+ 30 " << endmsg; + //ATH_MSG_INFO( " Summary : Number of cells with a PhysWave values computed : " << larPhysWaveContainer->totalNumberOfConditions() ); + //ATH_MSG_INFO( " Summary : Number of cells with a MphysOverMcal values computed : " << MphysOverMcalComplete->totalNumberOfConditions() ); + ATH_MSG_INFO( " Summary : Number of cells with a PhysWave values computed : " << NPhysWave ); + ATH_MSG_INFO( " Summary : Number of cells with a MphysOverMcal values computed : " << NMPMC ); + ATH_MSG_INFO( " Summary : Number of Barrel PS cells side A or C (connected+unconnected): 3904+ 192 " ); + ATH_MSG_INFO( " Summary : Number of Barrel cells side A or C (connected+unconnected): 50944+2304 " ); + ATH_MSG_INFO( " Summary : Number of EMEC cells side A or C (connected+unconnected): 31872+3456 " ); + ATH_MSG_INFO( " Summary : Number of HEC cells side A or C (connected+unconnected): 2816+ 256 " ); + ATH_MSG_INFO( " Summary : Number of FCAL cells side A or C (connected+unconnected): 1762+ 30 " ); ATH_MSG_DEBUG("LArPhysWaveContainer->totalNumberOfConditions() = " << larPhysWaveContainer->totalNumberOfConditions()); ATH_MSG_DEBUG("LArMphysOverMcalComplete->totalNumberOfConditions() = " << MphysOverMcalComplete->totalNumberOfConditions()); // final report - msg(MSG::INFO) << "\n Final report \n" << endmsg; + ATH_MSG_INFO( "\n Final report \n" ); for ( unsigned theGain = CaloGain::LARHIGHGAIN ; theGain < CaloGain::LARNGAIN ; ++theGain ) { - msg(MSG::INFO) << " *** Gain = " << theGain << " ***" << endmsg; + ATH_MSG_INFO( " *** Gain = " << theGain << " ***" ); if ( !m_useJOCaliPulseParams ) { - msg(MSG::INFO) << "\t" << noTcali[theGain] << " / " << nTotal[theGain] << " channel(s) missing Tcali" << endmsg; - msg(MSG::INFO) << "\t" << noFstep[theGain] << " / " << nTotal[theGain] << " channel(s) missing Fstep" << endmsg; + ATH_MSG_INFO( "\t" << noTcali[theGain] << " / " << nTotal[theGain] << " channel(s) missing Tcali" ); + ATH_MSG_INFO( "\t" << noFstep[theGain] << " / " << nTotal[theGain] << " channel(s) missing Fstep" ); } if ( !m_useJODetCellParams ) { - msg(MSG::INFO) << "\t" << noOmega0[theGain] << " / " << nTotal[theGain] << " channel(s) missing Omega0" << endmsg; - msg(MSG::INFO) << "\t" << noTaur[theGain] << " / " << nTotal[theGain] << " channel(s) missing Taur" << endmsg; + ATH_MSG_INFO( "\t" << noOmega0[theGain] << " / " << nTotal[theGain] << " channel(s) missing Omega0" ); + ATH_MSG_INFO( "\t" << noTaur[theGain] << " / " << nTotal[theGain] << " channel(s) missing Taur" ); } if ( !m_useJOTdrift ) - msg(MSG::INFO) << "\t" << noTdrift[theGain] << " / " << nTotal[theGain] << " channel(s) missing Tdrift" << endmsg; + ATH_MSG_INFO( "\t" << noTdrift[theGain] << " / " << nTotal[theGain] << " channel(s) missing Tdrift" ); if ( !m_useJOPhysCaliTdiff ) - msg(MSG::INFO) << "\t" << noTdiff[theGain] << " / " << nTotal[theGain] << " channel(s) missing Tdiff" << endmsg; + ATH_MSG_INFO( "\t" << noTdiff[theGain] << " / " << nTotal[theGain] << " channel(s) missing Tdiff" ); } - msg(MSG::INFO) << "\n" << endmsg; + ATH_MSG_INFO( "\n" ); // Record LArPhysWaveContainer to DetectorStore sc = detStore()->record(larPhysWaveContainer,m_keyPhys); if (sc.isFailure()) { - msg(MSG::FATAL) << "Cannot record LArPhysWaveContainer to StoreGate! key=" << m_keyPhys << endmsg; + ATH_MSG_FATAL( "Cannot record LArPhysWaveContainer to StoreGate! key=" << m_keyPhys ); return StatusCode::FAILURE; } // Record LArMphysOverMcalComplete to DetectorStore sc = detStore()->record(MphysOverMcalComplete,m_keyMphysMcali); if (sc.isFailure()) { - msg(MSG::FATAL) << "Cannot record LArMphysOverMcalComplete to StoreGate! key=" << m_keyMphysMcali << endmsg; + ATH_MSG_FATAL( "Cannot record LArMphysOverMcalComplete to StoreGate! key=" << m_keyMphysMcali ); return StatusCode::FAILURE; } @@ -727,27 +719,31 @@ StatusCode LArPhysWavePredictor::stop() ILArMphysOverMcal *larMphysOverMcal = NULL; sc = detStore()->symLink(MphysOverMcalComplete,larMphysOverMcal); if (sc.isFailure()) { - msg(MSG::FATAL) << "Could not symlink ILArMphysOverMcal with LArMphysOverMcalComplete." << endmsg; + ATH_MSG_FATAL( "Could not symlink ILArMphysOverMcal with LArMphysOverMcalComplete." ); return StatusCode::FAILURE; } - msg(MSG::INFO) << "ILArMphysOverMcal symlink with LArMphysOverMcalComplete successfully" << endmsg ; + ATH_MSG_INFO( "ILArMphysOverMcal symlink with LArMphysOverMcalComplete successfully" ) ; - msg(MSG::INFO) << "LArPhysWavePredictor finalized!" << endmsg; + ATH_MSG_INFO( "LArPhysWavePredictor finalized!" ); return StatusCode::SUCCESS; } void LArPhysWavePredictor::notFoundMsg(const HWIdentifier chid, const int gain, const char* value) { if (m_maskingTool->cellShouldBeMasked(chid,gain)) - msg(MSG::WARNING) << "Cannot access " << value << " for known bad channel channel " << m_onlineHelper->channel_name(chid) - << ", gain = " << gain << ". Will use jobO setting." << endmsg ; + ATH_MSG_WARNING( "Cannot access " << value << " for known bad channel channel " << m_onlineHelper->channel_name(chid) + << ", gain = " << gain << ". Will use jobO setting." ) ; else { LArBadChanBitPacking packer; - const LArBadChannel bc=m_badChanTool->status(chid); - const std::string badChanStatus=packer.stringStatus(bc); - - msg(MSG::ERROR) << "Cannot access " << value << " for channel " << m_onlineHelper->channel_name(chid) - << ", gain = " << gain << " BC status=[" << badChanStatus << "]. Will use jobO setting." << endmsg ; + SG::ReadCondHandle<LArBadChannelCont> bcHdl{m_BCKey}; + const LArBadChannelCont* bcCont{*bcHdl}; + if(bcCont) { + const LArBadChannel bc = bcCont->status(chid); + const std::string badChanStatus=packer.stringStatus(bc); + + ATH_MSG_ERROR( "Cannot access " << value << " for channel " << m_onlineHelper->channel_name(chid) + << ", gain = " << gain << " BC status=[" << badChanStatus << "]. Will use jobO setting." ); + } } return; } diff --git a/LArCalorimeter/LArCalibUtils/src/LArPhysWaveShifter.cxx b/LArCalorimeter/LArCalibUtils/src/LArPhysWaveShifter.cxx index 965218d37ee..a66ae4eb4e9 100755 --- a/LArCalorimeter/LArCalibUtils/src/LArPhysWaveShifter.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArPhysWaveShifter.cxx @@ -69,14 +69,14 @@ LArPhysWaveShifter::~LArPhysWaveShifter() {} StatusCode LArPhysWaveShifter::stop() { - msg(MSG::INFO) << "... in stop()" << endmsg ; + ATH_MSG_INFO( "... in stop()" ) ; LArWaveHelper larWaveHelper; // get LArOnlineID helper StatusCode sc = detStore()->retrieve(m_onlineHelper, "LArOnlineID"); if (sc.isFailure()) { - msg(MSG::ERROR) << "Could not get LArOnlineID" << endmsg; + ATH_MSG_ERROR( "Could not get LArOnlineID" ); return sc; } @@ -84,7 +84,7 @@ StatusCode LArPhysWaveShifter::stop() { ToolHandle<LArPhysWaveTool> larPhysWaveTool("LArPhysWaveTool"); sc=larPhysWaveTool.retrieve(); if (sc!=StatusCode::SUCCESS) { - msg(MSG::ERROR) << " Can't get LArPhysWaveTool " << endmsg; + ATH_MSG_ERROR( " Can't get LArPhysWaveTool " ); return sc; } @@ -93,11 +93,11 @@ StatusCode LArPhysWaveShifter::stop() { if (m_usePhysCaliTdiff) { sc = detStore()->retrieve(larPhysCaliTdiff,m_cellByCellShiftsKey); if (sc!=StatusCode::SUCCESS) { - msg(MSG::WARNING) << "Cannot retrieve LArPhysCaliTdiff with key " << m_cellByCellShiftsKey - << ". Disabling use of PhysCaliTdiff values in wave shift." << endmsg; + ATH_MSG_WARNING( "Cannot retrieve LArPhysCaliTdiff with key " << m_cellByCellShiftsKey + << ". Disabling use of PhysCaliTdiff values in wave shift." ); m_usePhysCaliTdiff = false; }else { - msg(MSG::INFO) << "LArPhysCaliTdiff successfully retrieved" << endmsg; + ATH_MSG_INFO( "LArPhysCaliTdiff successfully retrieved" ); } } @@ -106,27 +106,27 @@ StatusCode LArPhysWaveShifter::stop() { if ( ( m_modeTimeShiftByFEB==2 || m_modeTimeShiftByFEB==3 ) && m_nIndexFromPeak==0 ) m_nIndexFromPeak=m_nSamplings*m_nDelays; sc = ComputeTimeShiftByFEB(m_modeTimeShiftByFEB); if(!sc.isSuccess()) { - msg(MSG::ERROR) << "Can't compute time shifts by FEB." << endmsg; + ATH_MSG_ERROR( "Can't compute time shifts by FEB." ); return sc; } } // apply time shifts if ( m_timeShiftByHelper ) { - msg(MSG::INFO) << "Will use helper class for start time." << endmsg; + ATH_MSG_INFO( "Will use helper class for start time." ); m_timeShiftByIndex = 0 ; m_timeShiftFromPeak = false ; m_timeShiftByFEB = false ; } if ( m_timeShiftByIndex != 0 ) { - msg(MSG::INFO) << "Manually shifting pulses by time index " << m_timeShiftByIndex << endmsg; + ATH_MSG_INFO( "Manually shifting pulses by time index " << m_timeShiftByIndex ); m_timeShiftFromPeak = false ; m_timeShiftByFEB = false ; } if ( m_timeShiftFromPeak ) { - msg(MSG::INFO) << "Manually shifting pulses by a constant index from peak." << endmsg; + ATH_MSG_INFO( "Manually shifting pulses by a constant index from peak." ); if ( m_nIndexFromPeak==0 ) m_nIndexFromPeak=m_nSamplings*m_nDelays; m_timeShiftByFEB = false ; } @@ -143,10 +143,10 @@ StatusCode LArPhysWaveShifter::stop() { */ const ILArFEBTimeOffset* larFebTshift = NULL; if ( m_timeShiftByFEB ) { - msg(MSG::INFO) << "Manually shifting pulses by *FEB* time indexes." << endmsg; + ATH_MSG_INFO( "Manually shifting pulses by *FEB* time indexes." ); sc = detStore()->retrieve(larFebTshift); if (sc.isFailure()) { - msg(MSG::ERROR) << "Cannot find any FEB time offsets. Please check." << endmsg; + ATH_MSG_ERROR( "Cannot find any FEB time offsets. Please check." ); return sc; } } @@ -155,12 +155,12 @@ StatusCode LArPhysWaveShifter::stop() { //LArPhysCaliTdiffComplete* totalShifts=new LArPhysCaliTdiffComplete(); auto totalShifts = std::make_unique<LArOFCBinComplete>(); if (totalShifts->setGroupingType(m_groupingType,msg()).isFailure()) { - msg(MSG::ERROR) << "Failed to set grouping type for LArPhysCaliTdiffComplete object" << endmsg; + ATH_MSG_ERROR( "Failed to set grouping type for LArPhysCaliTdiffComplete object" ); return StatusCode::FAILURE; } if(totalShifts->initialize().isFailure()) { - msg(MSG::ERROR) << "Failed to initialize LArPhysCaliTdiffComplete object" << endmsg; + ATH_MSG_ERROR( "Failed to initialize LArPhysCaliTdiffComplete object" ); return StatusCode::FAILURE; } @@ -176,10 +176,10 @@ StatusCode LArPhysWaveShifter::stop() { sc= detStore()->retrieve(larPhysWaveContainerOld,*key_it); if (sc.isFailure()) { - msg(MSG::INFO) << "LArPhysWaveContainer (key=" << *key_it << ") not found in StoreGate" << endmsg; + ATH_MSG_INFO( "LArPhysWaveContainer (key=" << *key_it << ") not found in StoreGate" ); continue ; } - msg(MSG::INFO) << "Processing LArPhysWaveContainer from StoreGate, key = " << *key_it << endmsg; + ATH_MSG_INFO( "Processing LArPhysWaveContainer from StoreGate, key = " << *key_it ); // loop over physwave in 'old' container for ( unsigned gain = CaloGain::LARHIGHGAIN ; gain < CaloGain::LARNGAIN; gain++ ) { // Loop over all gains @@ -189,14 +189,14 @@ StatusCode LArPhysWaveShifter::stop() { PhysWaveIt wave_it_e = larPhysWaveContainerOld->end(gain); if ( wave_it == wave_it_e ) { - msg(MSG::INFO) << "LArPhysWaveContainer (key = " << *key_it << ") has no wave with gain = " << gain << endmsg; + ATH_MSG_INFO( "LArPhysWaveContainer (key = " << *key_it << ") has no wave with gain = " << gain ); continue; // skip to next gain } for ( ; wave_it!=wave_it_e; wave_it++) { if ( nchannel < 100 || ( nchannel < 1000 && nchannel%100==0 ) || nchannel%1000==0 ) - msg(MSG::INFO) << "Processing physics waveform number " << nchannel << endmsg; + ATH_MSG_INFO( "Processing physics waveform number " << nchannel ); nchannel++ ; const LArPhysWave* larPhysWave = &(*wave_it); @@ -283,11 +283,11 @@ StatusCode LArPhysWaveShifter::stop() { if (m_totalShiftsKey.size()) { sc=detStore()->record(std::move(totalShifts),m_totalShiftsKey); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to recrod LArPhysCaliTdiffComplete with key " << m_totalShiftsKey << endmsg; + ATH_MSG_ERROR( "Failed to recrod LArPhysCaliTdiffComplete with key " << m_totalShiftsKey ); } } - msg(MSG::INFO) << "LArPhysWaveShifter stopped!" << endmsg; + ATH_MSG_INFO( "LArPhysWaveShifter stopped!" ); return StatusCode::SUCCESS; } @@ -322,15 +322,15 @@ StatusCode LArPhysWaveShifter::ComputeTimeShiftByFEB(unsigned mode=2) sc=detStore()->retrieve(larPhysWaveContainerOld,*key_it); if (sc.isFailure()) { - msg(MSG::INFO) << "LArPhysWaveContainer (key=" << *key_it << ") not found in StoreGate" << endmsg; + ATH_MSG_INFO( "LArPhysWaveContainer (key=" << *key_it << ") not found in StoreGate" ); continue ; } if ( larPhysWaveContainerOld == NULL ) { - msg(MSG::INFO) << "LArPhysWaveContainer (key=" << *key_it << ") is empty" << endmsg; + ATH_MSG_INFO( "LArPhysWaveContainer (key=" << *key_it << ") is empty" ); continue ; } - msg(MSG::INFO) << "ComputeTimeShiftByFEB(): processing LArPhysWaveContainer from StoreGate, key = " << *key_it << endmsg; + ATH_MSG_INFO( "ComputeTimeShiftByFEB(): processing LArPhysWaveContainer from StoreGate, key = " << *key_it ); for ( unsigned gain = CaloGain::LARHIGHGAIN ; gain < CaloGain::LARNGAIN; gain++ ) { // Loop over all gains @@ -338,7 +338,7 @@ StatusCode LArPhysWaveShifter::ComputeTimeShiftByFEB(unsigned mode=2) PhysWaveIt wave_it_e = larPhysWaveContainerOld->end(gain); if ( wave_it == wave_it_e ) { - msg(MSG::INFO) << "ComputeTimeShiftByFEB(): LArPhysWaveContainer (key = " << *key_it << ") has no wave with gain = " << gain << endmsg; + ATH_MSG_INFO( "ComputeTimeShiftByFEB(): LArPhysWaveContainer (key = " << *key_it << ") has no wave with gain = " << gain ); continue; // skip to next gain } @@ -398,8 +398,8 @@ StatusCode LArPhysWaveShifter::ComputeTimeShiftByFEB(unsigned mode=2) float timeoff = m_larFEBTstart->TimeOffset(*it)/nChanInFEB.TimeOffset(*it); m_larFEBTstart->setTimeOffset(*it,timeoff); } - msg(MSG::INFO) << nFeb << ". FEB ID 0x" << std::hex << (*it).get_compact() << std::dec - << " - Tstart = " << (int)m_larFEBTstart->TimeOffset(*it) << endmsg ; + ATH_MSG_INFO( nFeb << ". FEB ID 0x" << std::hex << (*it).get_compact() << std::dec + << " - Tstart = " << (int)m_larFEBTstart->TimeOffset(*it) ) ; } else { m_larFEBTstart->setTimeOffset(*it,0); @@ -429,7 +429,7 @@ StatusCode LArPhysWaveShifter::ComputeTimeShiftByFEB(unsigned mode=2) } outfile << " ]" << std::endl ; outfile.close() ; - msg(MSG::INFO) << "Minimum Tstart per FEB (all gain) saved in " << m_fileTimeShiftByFEB << endmsg ; + ATH_MSG_INFO( "Minimum Tstart per FEB (all gain) saved in " << m_fileTimeShiftByFEB ) ; } } else { @@ -438,14 +438,14 @@ StatusCode LArPhysWaveShifter::ComputeTimeShiftByFEB(unsigned mode=2) sc=detStore()->record(m_larFEBTstart,"FebTimeOffset"); if(sc.isFailure()) { - msg(MSG::ERROR) << "Can't record LArFEBTimeOffset to DetectorStore" << endmsg; + ATH_MSG_ERROR( "Can't record LArFEBTimeOffset to DetectorStore" ); return StatusCode::FAILURE; } const ILArFEBTimeOffset* ilarFEBTimeOffset=NULL; sc=detStore()->symLink(m_larFEBTstart,ilarFEBTimeOffset); if(sc.isFailure()) { - msg(MSG::ERROR) << "Can't symlink LArFEBTimeOffset to abstract interface in DetectorStore" << endmsg; + ATH_MSG_ERROR( "Can't symlink LArFEBTimeOffset to abstract interface in DetectorStore" ); return StatusCode::FAILURE; } diff --git a/LArCalorimeter/LArCalibUtils/src/LArRTMParamExtractor.cxx b/LArCalorimeter/LArCalibUtils/src/LArRTMParamExtractor.cxx index 3d99ac2bcb3..98cec037b33 100755 --- a/LArCalorimeter/LArCalibUtils/src/LArRTMParamExtractor.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArRTMParamExtractor.cxx @@ -141,7 +141,7 @@ StatusCode LArRTMParamExtractor::initialize() { msg(MSG::INFO) << "FT selection enabled, will only process data from FT = [ "; for(unsigned i=0; i<m_FT.size()-1; ++i) msg() << m_FT[i] << ", "; - msg(MSG::INFO) << m_FT[m_FT.size()-1] << " ] at PosNeg = " << m_PosNeg << endmsg; + ATH_MSG_INFO( m_FT[m_FT.size()-1] << " ] at PosNeg = " << m_PosNeg ); } if ( m_Slotselection && !m_Slot.size() ) @@ -167,7 +167,7 @@ StatusCode LArRTMParamExtractor::stop() const LArOnlineID* onlineHelper; StatusCode sc = detStore()->retrieve(onlineHelper, "LArOnlineID"); if (sc.isFailure()) { - msg(MSG::ERROR) << "Could not get LArOnlineID" << endmsg; + ATH_MSG_ERROR( "Could not get LArOnlineID" ); return sc; } @@ -175,7 +175,7 @@ StatusCode LArRTMParamExtractor::stop() ToolHandle<LArWFParamTool> larWFParamTool("LArWFParamTool"); sc=larWFParamTool.retrieve(); if (sc!=StatusCode::SUCCESS) { - msg(MSG::ERROR) << " Can't get LArWFParamTool" << endmsg; + ATH_MSG_ERROR( " Can't get LArWFParamTool" ); return sc; } @@ -194,15 +194,15 @@ StatusCode LArRTMParamExtractor::stop() //sc = detStore()->retrieve(prevCaliPulseParams,m_keyRetrievedCaliPulse); sc = detStore()->retrieve(prevCaliPulseParams); if ( sc.isFailure() ) { - //msg(MSG::ERROR) << "Can't get CaliPulseParams from DetStore, key=" << m_keyRetrievedCaliPulse << endmsg; - msg(MSG::ERROR) << "Can't get CaliPulseParams from DetStore" << endmsg ; - msg(MSG::ERROR) << "(was requested for" ; + //ATH_MSG_ERROR( "Can't get CaliPulseParams from DetStore, key=" << m_keyRetrievedCaliPulse ); + ATH_MSG_ERROR( "Can't get CaliPulseParams from DetStore" ) ; + ATH_MSG_ERROR( "(was requested for" ; if ( ! m_extractTcal ) msg() << " Tcal" ; if ( ! m_extractFstep ) msg() << " Fstep" ; - msg() << ")" << endmsg ; + msg() << ")" ) ; return sc ; } - //ATH_MSG_INFO( "CaliPulseParams retrieved from DetStore, key=" << m_keyRetrievedCaliPulse << endmsg ; + //ATH_MSG_INFO( "CaliPulseParams retrieved from DetStore, key=" << m_keyRetrievedCaliPulse ) ; ATH_MSG_INFO( "CaliPulseParams retrieved from DetStore"); } @@ -210,15 +210,15 @@ StatusCode LArRTMParamExtractor::stop() //sc = detStore()->retrieve(prevDetCellParams,m_keyRetrievedDetCell); sc = detStore()->retrieve(prevDetCellParams); if ( sc.isFailure() ) { - //msg(MSG::ERROR) << "Can't get DetCellParams from DetStore, key=" << m_keyRetrievedDetCell << endmsg ; - msg(MSG::ERROR) << "Can't get DetCellParams from DetStore" << endmsg ; - msg(MSG::ERROR) << "(was requested for" ; + //ATH_MSG_ERROR( "Can't get DetCellParams from DetStore, key=" << m_keyRetrievedDetCell ) ; + ATH_MSG_ERROR( "Can't get DetCellParams from DetStore" ) ; + ATH_MSG_ERROR( "(was requested for" ; if ( ! m_extractOmega0 ) msg() << " Omega0" ; if ( ! m_extractTaur ) msg() << " Taur" ; - msg() << ")" << endmsg ; + msg() << ")" ) ; return sc ; } - //ATH_MSG_INFO( "DetCellParams retrieved from DetStore, key=" << m_keyRetrievedDetCell << endmsg ; + //ATH_MSG_INFO( "DetCellParams retrieved from DetStore, key=" << m_keyRetrievedDetCell ) ; ATH_MSG_INFO( "DetCellParams retrieved from DetStore"); } @@ -229,24 +229,24 @@ StatusCode LArRTMParamExtractor::stop() sc=newCaliPulseParams->setGroupingType(m_groupingType,msg()); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to set groupingType for LArCaliPulseParams object" << endmsg; + ATH_MSG_ERROR( "Failed to set groupingType for LArCaliPulseParams object" ); return sc; } sc=newCaliPulseParams->initialize(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to initialize for LArCaliPulseParams object" << endmsg; + ATH_MSG_ERROR( "Failed to initialize for LArCaliPulseParams object" ); return sc; } LArDetCellParamsComplete* newDetCellParams = new LArDetCellParamsComplete(); sc=newDetCellParams->setGroupingType(m_groupingType,msg()); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to set groupingType for LArDetCellParamsComplete object" << endmsg; + ATH_MSG_ERROR( "Failed to set groupingType for LArDetCellParamsComplete object" ); return sc; } sc=newDetCellParams->initialize(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to initialize LArDetCellParamsComplete object" << endmsg; + ATH_MSG_ERROR( "Failed to initialize LArDetCellParamsComplete object" ); return sc; } @@ -257,12 +257,12 @@ StatusCode LArRTMParamExtractor::stop() omegaScanContainer = new LArCaliWaveContainer(); sc=omegaScanContainer->setGroupingType(m_groupingType,msg()); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to set groupingType for LArCaliWaveContainer object" << endmsg; + ATH_MSG_ERROR( "Failed to set groupingType for LArCaliWaveContainer object" ); return sc; } sc=omegaScanContainer->initialize(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to initialize LArCaliWaveContainer object" << endmsg; + ATH_MSG_ERROR( "Failed to initialize LArCaliWaveContainer object" ); return sc; } }// end if m_dumpOmegaScan @@ -274,20 +274,20 @@ StatusCode LArRTMParamExtractor::stop() resOscillContainerBefore = new LArCaliWaveContainer(); resOscillContainerAfter = new LArCaliWaveContainer(); if(resOscillContainerBefore->setGroupingType(m_groupingType,msg()).isFailure()) { - msg(MSG::ERROR) << "Failed to set groupingType for LArCaliWaveContainer object" << endmsg; + ATH_MSG_ERROR( "Failed to set groupingType for LArCaliWaveContainer object" ); return StatusCode::FAILURE; } if(resOscillContainerBefore->initialize().isFailure()) { - msg(MSG::ERROR) << "Failed to initialize LArCaliWaveContainer object" << endmsg; + ATH_MSG_ERROR( "Failed to initialize LArCaliWaveContainer object" ); return StatusCode::FAILURE; } if(resOscillContainerAfter->setGroupingType(m_groupingType,msg()).isFailure()) { - msg(MSG::ERROR) << "Failed to set groupingType for LArCaliWaveContainer object" << endmsg; + ATH_MSG_ERROR( "Failed to set groupingType for LArCaliWaveContainer object" ); return StatusCode::FAILURE; } if(resOscillContainerAfter->initialize().isFailure()) { - msg(MSG::ERROR) << "Failed to initialize LArCaliWaveContainer object" << endmsg; + ATH_MSG_ERROR( "Failed to initialize LArCaliWaveContainer object" ); return StatusCode::FAILURE; } } @@ -437,14 +437,14 @@ StatusCode LArRTMParamExtractor::stop() } else { wfParams.setTcal( retrievedParam = prevCaliPulseParams->Tcal(chid,gain) ) ; if ( retrievedParam == emptyCaliPulse.m_Tcal ) { - msg(MSG::WARNING) << "Parameters Tcal requested from DB but not found for channel " + ATH_MSG_WARNING( "Parameters Tcal requested from DB but not found for channel " << MSG::hex << chid << MSG::dec - << " gain=" << gain << " DAC=" << larCaliWave.getDAC(); + << " gain=" << gain << " DAC=" << larCaliWave.getDAC()); if (m_recoverEmptyDB) { wfParams.setTcal( LArWFParamTool::DoExtract ) ; - msg() << " -> Recovering with RTM extraction." << endmsg; + ATH_MSG_WARNING( " -> Recovering with RTM extraction." ); } else { - msg() << " -> Skipping cell!" << endmsg; + ATH_MSG_WARNING( " -> Skipping cell!" ); continue ; } } @@ -457,14 +457,14 @@ StatusCode LArRTMParamExtractor::stop() } else { wfParams.setFstep( retrievedParam = prevCaliPulseParams->Fstep(chid,gain) ) ; if ( retrievedParam == emptyCaliPulse.m_Fstep ) { - msg(MSG::WARNING) << "Parameters Fstep requested from DB but not found for channel " + ATH_MSG_WARNING( "Parameters Fstep requested from DB but not found for channel " << MSG::hex << chid << MSG::dec - << " gain=" << gain << " DAC=" << larCaliWave.getDAC(); + << " gain=" << gain << " DAC=" << larCaliWave.getDAC()); if (m_recoverEmptyDB) { - msg() << " -> Recovering with RTM extraction." << endmsg; + ATH_MSG_WARNING( " -> Recovering with RTM extraction." ); wfParams.setFstep( LArWFParamTool::DoExtract ) ; } else { - msg() << " -> Skipping cell!" << endmsg; + ATH_MSG_WARNING( " -> Skipping cell!" ); continue ; } } @@ -477,14 +477,14 @@ StatusCode LArRTMParamExtractor::stop() } else { wfParams.setOmega0( retrievedParam = prevDetCellParams->Omega0(chid,gain) ) ; if ( retrievedParam == emptyDetCell.m_Omega0 ) { - msg(MSG::WARNING) << "Parameters Omega0 requested from DB but not found for channel " + ATH_MSG_WARNING( "Parameters Omega0 requested from DB but not found for channel " << MSG::hex << chid << MSG::dec - << " gain=" << gain << " DAC=" << larCaliWave.getDAC() ; + << " gain=" << gain << " DAC=" << larCaliWave.getDAC() ); if (m_recoverEmptyDB) { - msg() << " -> Recovering with RTM extraction." << endmsg; + ATH_MSG_WARNING( " -> Recovering with RTM extraction." ); wfParams.setOmega0( LArWFParamTool::DoExtract ) ; } else { - msg() << " -> Skipping cell!" << endmsg; + ATH_MSG_WARNING( " -> Skipping cell!" ); continue ; } } @@ -497,14 +497,14 @@ StatusCode LArRTMParamExtractor::stop() } else { wfParams.setTaur( retrievedParam = prevDetCellParams->Taur(chid,gain) ) ; if ( retrievedParam == emptyDetCell.m_Taur ) { - msg(MSG::WARNING) << "Parameters Taur requested from DB but not found for channel " + ATH_MSG_WARNING( "Parameters Taur requested from DB but not found for channel " << MSG::hex << chid << MSG::dec - << " gain=" << gain << " DAC=" << larCaliWave.getDAC(); + << " gain=" << gain << " DAC=" << larCaliWave.getDAC()); if (m_recoverEmptyDB) { - msg() << " -> Recovering with RTM extraction." << endmsg; + ATH_MSG_WARNING( " -> Recovering with RTM extraction." ); wfParams.setTaur( LArWFParamTool::DoExtract ) ; } else { - msg() << " -> Skipping cell!" << endmsg; + ATH_MSG_WARNING( " -> Skipping cell!" ); continue ; } } @@ -538,8 +538,8 @@ StatusCode LArRTMParamExtractor::stop() resOscill1 ); //ATH_MSG_INFO( "Time for larWFParamTool->getLArWaveParams chid=" << std::hex << chid.get_compact() << std::dec << ":" << (clock() - t1)/(double)CLOCKS_PER_SEC << " sec" << std::endl; if (sc.isFailure()) { // bad parameters - msg(MSG::WARNING) << "Bad parameters for channel " << MSG::hex << chid << MSG::dec - << " gain=" << gain << " DAC=" << larCaliWave.getDAC() << endmsg ; + ATH_MSG_WARNING( "Bad parameters for channel " << MSG::hex << chid << MSG::dec + << " gain=" << gain << " DAC=" << larCaliWave.getDAC() ) ; continue ; } @@ -548,8 +548,8 @@ StatusCode LArRTMParamExtractor::stop() // fill params structures to be registered in detStore if ( newCaliPulseParams->Tcal(chid,gain) != emptyCaliPulse.m_Tcal ) { - msg(MSG::WARNING) << "Already present in LArCaliPulseParams, don't add: channel " - << MSG::hex << chid << MSG::dec << " gain=" << gain << endmsg ; + ATH_MSG_WARNING( "Already present in LArCaliPulseParams, don't add: channel " + << MSG::hex << chid << MSG::dec << " gain=" << gain ) ; } else { ATH_MSG_VERBOSE( "add to LArCaliPulseParams..." ) ; NCalibParams++; @@ -561,8 +561,8 @@ StatusCode LArRTMParamExtractor::stop() } if ( newDetCellParams->Omega0(chid,gain) != emptyDetCell.m_Omega0 ) { - msg(MSG::WARNING) << "Already present in LArDetCellParams, don't add: channel " - << MSG::hex << chid << MSG::dec << " gain=" << gain << endmsg ; + ATH_MSG_WARNING( "Already present in LArDetCellParams, don't add: channel " + << MSG::hex << chid << MSG::dec << " gain=" << gain ) ; } else { ATH_MSG_VERBOSE( "add to LArDetCellParams..." ) ; newDetCellParams->set(chid,(int)(gain),wfParams.omega0(),wfParams.taur() ) ; @@ -600,9 +600,9 @@ StatusCode LArRTMParamExtractor::stop() } // end loop over dac for a given channel if (nDACproc==0) { - msg(MSG::WARNING) << "No pulse corresponding to selected DAC = " << m_DAC + ATH_MSG_WARNING( "No pulse corresponding to selected DAC = " << m_DAC << " was found for channel 0x" << MSG::hex << itVec.channelId() << MSG::dec - << " in Gain = " << gain << endmsg; + << " in Gain = " << gain ); } if ( m_testmode ) { @@ -617,7 +617,7 @@ StatusCode LArRTMParamExtractor::stop() }// End loop over all CaliWave containers if (nWaveConts==0) { - msg(MSG::ERROR) << "Did not process any caliwave container!" << endmsg; + ATH_MSG_ERROR( "Did not process any caliwave container!" ); return StatusCode::FAILURE; } @@ -634,7 +634,7 @@ StatusCode LArRTMParamExtractor::stop() // record extracted LArCaliPulseParamsComplete to detStore ATH_MSG_INFO( "...recording LArCaliPulseParams into det.store, key=" << m_keyExtractedCaliPulse ) ; if ( StatusCode::FAILURE == ( detStore()->record(newCaliPulseParams, m_keyExtractedCaliPulse ) ) ) { - msg(MSG::ERROR) << "Could not record LArCaliPulseParams into det.store!" << endmsg ; + ATH_MSG_ERROR( "Could not record LArCaliPulseParams into det.store!" ) ; return StatusCode::FAILURE ; } @@ -643,7 +643,7 @@ StatusCode LArRTMParamExtractor::stop() ILArCaliPulseParams *larCaliPulseParams = NULL; sc = detStore()->symLink(newCaliPulseParams,larCaliPulseParams); if (sc.isFailure()) { - msg(MSG::FATAL) << "Could not symlink ILArCaliPulseParams with LArCaliPulseParamsComplete." << endmsg; + ATH_MSG_FATAL( "Could not symlink ILArCaliPulseParams with LArCaliPulseParamsComplete." ); return StatusCode::FAILURE; } ATH_MSG_INFO( "ILArCaliPulseParams symlink with LArCaliPulseParamsComplete successfully"); @@ -651,7 +651,7 @@ StatusCode LArRTMParamExtractor::stop() // record extracted LArDetCellParamsComplete to detStore ATH_MSG_INFO( "...recording LArDetCellParams into det.store, key=" << m_keyExtractedDetCell) ; if ( StatusCode::FAILURE == ( detStore()->record(newDetCellParams, m_keyExtractedDetCell ) ) ) { - msg(MSG::ERROR) << "Could not record LArDetCellParams into det.store!" << endmsg ; + ATH_MSG_ERROR( "Could not record LArDetCellParams into det.store!" ) ; return StatusCode::FAILURE ; } @@ -660,7 +660,7 @@ StatusCode LArRTMParamExtractor::stop() ILArDetCellParams *lArDetCellParams = NULL; sc = detStore()->symLink(newDetCellParams,lArDetCellParams); if (sc.isFailure()) { - msg(MSG::FATAL) << "Could not symlink ILArDetCellParams with LArDetCellParamsComplete." << endmsg; + ATH_MSG_FATAL( "Could not symlink ILArDetCellParams with LArDetCellParamsComplete." ); return StatusCode::FAILURE; } ATH_MSG_INFO( "ILArDetCellParams symlink with LArDetCellParamsComplete successfully" ) ; @@ -668,7 +668,7 @@ StatusCode LArRTMParamExtractor::stop() if ( omegaScanContainer ) { ATH_MSG_INFO( "Recording omega scan container into det.store, key=" << m_omegaScanKey ) ; if ( StatusCode::FAILURE == ( detStore()->record(omegaScanContainer, m_omegaScanKey ) ) ) { - msg(MSG::WARNING) << "Could not record omega scan container into DetStore!" << endmsg ; + ATH_MSG_WARNING( "Could not record omega scan container into DetStore!" ) ; // return StatusCode::FAILURE ; } } @@ -676,7 +676,7 @@ StatusCode LArRTMParamExtractor::stop() if ( resOscillContainerBefore ) { ATH_MSG_INFO( "Recording residual oscillation (before Taur extraction) container into DetStore, key = " << m_resOscillKeyBefore ) ; if ( StatusCode::FAILURE == ( detStore()->record(resOscillContainerBefore, m_resOscillKeyBefore ) ) ) { - msg(MSG::WARNING) << "Could not record residual oscillation (before Taur extraction) container into DetStore!" << endmsg ; + ATH_MSG_WARNING( "Could not record residual oscillation (before Taur extraction) container into DetStore!" ) ; // return StatusCode::FAILURE ; } } @@ -684,7 +684,7 @@ StatusCode LArRTMParamExtractor::stop() if ( resOscillContainerAfter ) { ATH_MSG_INFO( "Recording residual oscillation (after Taur extraction) container into DetStore, key = " << m_resOscillKeyAfter ) ; if ( StatusCode::FAILURE == ( detStore()->record(resOscillContainerAfter, m_resOscillKeyAfter ) ) ) { - msg(MSG::WARNING) << "Could not record residual oscillation (after Taur extraction) container into DetStore!" << endmsg ; + ATH_MSG_WARNING( "Could not record residual oscillation (after Taur extraction) container into DetStore!" ) ; // return StatusCode::FAILURE ; } } diff --git a/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx b/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx index 52d1258a98e..3b74781ceb7 100755 --- a/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArRampBuilder.cxx @@ -27,7 +27,6 @@ LArRampBuilder::LArRampBuilder(const std::string& name, ISvcLocator* pSvcLocator m_event_counter(0), m_recoType(OF), m_larCablingSvc("LArCablingService"), - //m_badChanneMasker("LArBadChanTool"), m_onlineHelper(), m_emId(0), m_groupingType("ExtendedFeedThrough"), @@ -80,20 +79,20 @@ StatusCode LArRampBuilder::initialize() { StatusCode sc = detStore()->retrieve(m_onlineHelper, "LArOnlineID"); if (sc.isFailure()) { - msg(MSG::FATAL) << "Could not get LArOnlineID helper !" << endmsg; + ATH_MSG_FATAL( "Could not get LArOnlineID helper !" ); return StatusCode::FAILURE; } sc = m_larCablingSvc.retrieve(); if(sc.isFailure()){ - msg(MSG::FATAL) << "Could not retrieve LArCablingService Tool" << endmsg; + ATH_MSG_FATAL( "Could not retrieve LArCablingService Tool" ); return sc; } if(m_doBadChannelMask) { sc=m_badChannelMask.retrieve(); if (sc.isFailure()) { - msg(MSG::FATAL) << "Could not retrieve BadChannelMask " - << m_badChannelMask << endmsg; + ATH_MSG_FATAL( "Could not retrieve BadChannelMask " + << m_badChannelMask ); return StatusCode::FAILURE; } } @@ -102,12 +101,12 @@ StatusCode LArRampBuilder::initialize() //FIXME: Thats probably nonsenes, these raw ramps aren't written to COOL sc=m_ramps->setGroupingType(m_groupingType,msg()); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to set groupingType for intermediate LArRamps object" << endmsg; + ATH_MSG_ERROR( "Failed to set groupingType for intermediate LArRamps object" ); return sc; } sc=m_ramps->initialize(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed initialize intermediate LArRamps object" << endmsg; + ATH_MSG_ERROR( "Failed initialize intermediate LArRamps object" ); return sc; } @@ -120,10 +119,10 @@ StatusCode LArRampBuilder::initialize() if(m_ishec) { sc = detStore()->regHandle(m_dd_rinj,m_hec_key); if (sc!=StatusCode::SUCCESS) { - msg(MSG::ERROR) << "Cannot get register callback for HEC map" << endmsg; - msg(MSG::ERROR) << "Will use default "<< endmsg; + ATH_MSG_ERROR( "Cannot get register callback for HEC map" ); + ATH_MSG_ERROR( "Will use default "); } else { - msg(MSG::INFO) << " register callback for HEC map " << endmsg; + ATH_MSG_INFO( " register callback for HEC map " ); } } @@ -138,7 +137,7 @@ void LArRampBuilder::chooseRecoMode() { m_recoType=PARABOLA; StatusCode sc=m_peakParabolaTool.retrieve(); if (sc!=StatusCode::SUCCESS) { - msg(MSG::ERROR) << "Can't get LArParabolaPeakRecoTool" << endmsg; + ATH_MSG_ERROR( "Can't get LArParabolaPeakRecoTool" ); return; } ATH_MSG_DEBUG("LArParabolaPeakRecoTool retrieved with success!"); @@ -148,7 +147,7 @@ void LArRampBuilder::chooseRecoMode() { const CaloIdManager *caloIdMgr=CaloIdManager::instance() ; m_emId=caloIdMgr->getEM_ID(); if (!m_emId) { - msg(MSG::ERROR) << "Could not access lar EM ID helper" << endmsg; + ATH_MSG_ERROR( "Could not access lar EM ID helper" ); return ; } @@ -373,7 +372,7 @@ StatusCode LArRampBuilder::execute() //larPedestal=NULL; //ATH_MSG_WARNING("No pedestals found in database. Use default value for all channels."); //m_thePedestal[chid_hash] = 1000; - msg(MSG::FATAL) << "No pedestals found in database. Aborting executiong." << endmsg; + ATH_MSG_FATAL( "No pedestals found in database. Aborting executiong." ); return sc; } @@ -505,7 +504,7 @@ StatusCode LArRampBuilder::stop() if(m_dac0sub && dac_it->first== m_DAC0){ // check that DAC0 is the first DAC of list if(dac_it!=cell_it->begin()) - msg(MSG::ERROR) << "DAC0 is not the first DAC ? This might be a problem... " << endmsg; + ATH_MSG_ERROR( "DAC0 is not the first DAC ? This might be a problem... " ); adc0v = dac_it->second.mean(); ramppoint.Samples = adc0v; ramppoint.RMS = dac_it->second.RMS(); @@ -549,9 +548,9 @@ StatusCode LArRampBuilder::stop() bool isgood=true; if(m_doBadChannelMask && m_badChannelMask->cellShouldBeMasked(chid)) isgood=false; if (m_larCablingSvc->isOnlineConnected(chid) && isgood) { - msg(MSG::WARNING) << "Not enough samples around the maximum! Use kMax=2 (" + ATH_MSG_WARNING( "Not enough samples around the maximum! Use kMax=2 (" << m_onlineHelper->channel_name(chid) <<", DAC=" << dac_it->first - << ", Amp[2]=" << ramppoint.Samples[2] << " )" << endmsg; + << ", Amp[2]=" << ramppoint.Samples[2] << " )" ); if (msgLvl(MSG::VERBOSE)) { msg(MSG::VERBOSE) << " Samples: "; for (unsigned k=0;k<ramppoint.Samples.size();k++) @@ -721,8 +720,8 @@ StatusCode LArRampBuilder::stop() } else{ if(rampCoeffs[1]<0) - msg (MSG::ERROR) << "Negative 1rst order coef for ramp = " << rampCoeffs[1] << " for channel " - << m_onlineHelper->channel_name(chid) << endmsg; + ATH_MSG_ERROR( "Negative 1rst order coef for ramp = " << rampCoeffs[1] << " for channel " + << m_onlineHelper->channel_name(chid) ); if (vSat[0] != -1) { rawramp->setsat(vSat[0]); } // if a saturation point was found in rampfit, record it else { @@ -809,7 +808,7 @@ StatusCode LArRampBuilder::rampfit(unsigned deg, const std::vector<LArRawRamp::R bool isgood=true; if(m_doBadChannelMask && m_badChannelMask->cellShouldBeMasked(chid)) isgood=false; if (m_larCablingSvc->isOnlineConnected(chid) && isgood ) { - msg(MSG::ERROR) << "Not enough datapoints (" << linRange << ") to fit a polynom!" << endmsg; + ATH_MSG_ERROR( "Not enough datapoints (" << linRange << ") to fit a polynom!" ); return StatusCode::FAILURE; } else { @@ -862,7 +861,7 @@ StatusCode LArRampBuilder::rampfit(unsigned deg, const std::vector<LArRawRamp::R if(m_doBadChannelMask && m_badChannelMask->cellShouldBeMasked(chid)) isgood=false; if (deg>linRange) { if (m_larCablingSvc->isOnlineConnected(chid) && isgood ) - msg(MSG::ERROR) << "Not enough datapoints before saturation (" << linRange << ") to fit a polynom of degree " << deg << endmsg; + ATH_MSG_ERROR( "Not enough datapoints before saturation (" << linRange << ") to fit a polynom of degree " << deg ); else ATH_MSG_DEBUG("Not enough datapoints before saturation (" << linRange << ") to fit a polynom of degree " << deg << " (channel disconnected or known to be bad)"); @@ -871,8 +870,8 @@ StatusCode LArRampBuilder::rampfit(unsigned deg, const std::vector<LArRawRamp::R } if (data[linRange-1].DAC>0 && data[linRange-1].ADC<m_DeadChannelCut && data[linRange-1].ADC!=-999.) { - msg(MSG::ERROR) << "DAC= " << data[linRange-1].DAC << " yields ADC= " << data[linRange-1].ADC - << ". Dead channel?" << endmsg; + ATH_MSG_ERROR( "DAC= " << data[linRange-1].DAC << " yields ADC= " << data[linRange-1].ADC + << ". Dead channel?" ); return StatusCode::FAILURE; } diff --git a/LArCalorimeter/LArCalibUtils/src/LArShapeCorrector.cxx b/LArCalorimeter/LArCalibUtils/src/LArShapeCorrector.cxx index c4e2458a0cc..1ac2e931c82 100644 --- a/LArCalorimeter/LArCalibUtils/src/LArShapeCorrector.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArShapeCorrector.cxx @@ -35,8 +35,8 @@ StatusCode LArShapeCorrector::initialize() } else if ( m_groupingName == "ExtendedSubDetector" ) { m_groupingType = LArConditionsContainerBase::ExtendedSubDetGrouping ; } else { - msg(MSG::ERROR)<< "Grouping type " << m_groupingName << " is not foreseen!" << endmsg ; - msg(MSG::ERROR)<< "Only \"Unknown\", \"SingleGroup\", \"SubDetector\", \"FeedThrough\", \"ExtendedFeedThrough\" and \"ExtendedSubDetector\" are allowed" << endmsg ; + ATH_MSG_ERROR( "Grouping type " << m_groupingName << " is not foreseen!" ) ; + ATH_MSG_ERROR( "Only \"Unknown\", \"SingleGroup\", \"SubDetector\", \"FeedThrough\", \"ExtendedFeedThrough\" and \"ExtendedSubDetector\" are allowed" ) ; return StatusCode::FAILURE ; } @@ -57,7 +57,7 @@ StatusCode LArShapeCorrector::stop() { const LArShapeComplete* inputShape=NULL; StatusCode sc=detStore()->retrieve(inputShape,m_keyShape); if (sc.isFailure()) { - msg(MSG::ERROR)<< "Failed to get input Shapes with key " << m_keyShape << endmsg; + ATH_MSG_ERROR( "Failed to get input Shapes with key " << m_keyShape ); return sc; } @@ -65,7 +65,7 @@ StatusCode LArShapeCorrector::stop() { const LArShapeComplete* inputShapeResidual=NULL; sc=detStore()->retrieve(inputShapeResidual,m_keyShapeResidual); if (sc.isFailure()) { - msg(MSG::ERROR)<< "Failed to get input Shape residuals with key " << m_keyShapeResidual << endmsg; + ATH_MSG_ERROR( "Failed to get input Shape residuals with key " << m_keyShapeResidual ); return sc; } @@ -73,7 +73,7 @@ StatusCode LArShapeCorrector::stop() { larShapeCompleteCorr->setGroupingType( static_cast<LArConditionsContainerBase::GroupingType>(m_groupingType)); sc = larShapeCompleteCorr->initialize(); if ( sc.isFailure() ) { - msg(MSG::ERROR)<< "Could not initialize LArShapeComplete data object - exit!" << endmsg ; + ATH_MSG_ERROR( "Could not initialize LArShapeComplete data object - exit!" ) ; return sc; } @@ -99,12 +99,12 @@ StatusCode LArShapeCorrector::stop() { //some sanity check on the Shapes bool doShapeCorr=true; if ( vShape.size() == 0 || vShapeDer.size() == 0 ) { - msg(MSG::WARNING) << "Shape not found for gain "<< gain << " channel 0x" << std::hex << id.get_compact() << std::dec << endmsg; + ATH_MSG_WARNING( "Shape not found for gain "<< gain << " channel 0x" << std::hex << id.get_compact() << std::dec ); continue; } if ( vShape.size() != vShapeDer.size() ) { - msg(MSG::WARNING) << "Shape (" << vShape.size() << ") derivative (" << vShapeDer.size() << ") don't have the same size for channel 0x" - << std::hex << id.get_compact() << std::dec << endmsg; + ATH_MSG_WARNING( "Shape (" << vShape.size() << ") derivative (" << vShapeDer.size() << ") don't have the same size for channel 0x" + << std::hex << id.get_compact() << std::dec ); continue; } @@ -114,24 +114,24 @@ StatusCode LArShapeCorrector::stop() { ILArShape::ShapeRef_t vShapeResidual=inputShapeResidual->Shape(id,gain,8); // only one phase, stored in phase #8 ILArShape::ShapeRef_t vShapeResidualDer=inputShapeResidual->ShapeDer(id,gain,8); if ( vShapeResidual.size() == 0 || vShapeResidualDer.size() == 0 ) { - msg(MSG::WARNING) << "Shape residual not found for gain " << gain + ATH_MSG_WARNING( "Shape residual not found for gain " << gain << " channel 0x" << std::hex << id.get_compact() << std::dec - << ". Will not be applied!" << endmsg; + << ". Will not be applied!" ); doShapeCorr=false; } if ( vShapeResidual.size() != vShapeResidualDer.size() ) { - msg(MSG::ERROR) << "Shape residual (" << vShapeResidual.size() << ") and its derivative (" << vShapeResidualDer.size() + ATH_MSG_ERROR( "Shape residual (" << vShapeResidual.size() << ") and its derivative (" << vShapeResidualDer.size() << ") don't have the same size for channel 0x" << std::hex << id.get_compact() << std::dec - << ". Will be not applied!" << endmsg; + << ". Will be not applied!" ); doShapeCorr=false; } // check if shape and residuals sizes match if ( vShape.size() > vShapeResidual.size() ) { //FIXME, allow to apply 5 sample residual on 4 sample shape - msg(MSG::WARNING) << "Shape residual size does not match the shape size for channel 0x" + ATH_MSG_WARNING( "Shape residual size does not match the shape size for channel 0x" << std::hex << id.get_compact() << std::dec - << ". Will be not corrected!" << endmsg; + << ". Will be not corrected!" ); doShapeCorr=false; } @@ -163,18 +163,18 @@ StatusCode LArShapeCorrector::stop() { sc = detStore()->record(larShapeCompleteCorr, m_keyShape_newcorr); if (sc.isFailure()) { - msg(MSG::ERROR)<< "Failed to record LArShapeComplete object with key " << m_keyShape_newcorr << endmsg; + ATH_MSG_ERROR( "Failed to record LArShapeComplete object with key " << m_keyShape_newcorr ); return sc; } - msg(MSG::INFO) << "Successfully registered LArShapeComplete object with key " << m_keyShape_newcorr << endmsg; + ATH_MSG_INFO( "Successfully registered LArShapeComplete object with key " << m_keyShape_newcorr ); sc = detStore()->symLink(larShapeCompleteCorr, (ILArShape*)larShapeCompleteCorr); if (sc.isFailure()) { - msg(MSG::ERROR)<< "Failed to sym-link LArShapeComplete object" << endmsg; + ATH_MSG_ERROR( "Failed to sym-link LArShapeComplete object" ); return sc; } - //msg(MSG::INFO) << detStore()->dump() << endmsg; + //ATH_MSG_INFO( detStore()->dump() ); return StatusCode::SUCCESS; diff --git a/LArCalorimeter/LArCalibUtils/src/LArStripsCrossTalkCorrector.cxx b/LArCalorimeter/LArCalibUtils/src/LArStripsCrossTalkCorrector.cxx index 1efa54e7b7e..2865353090a 100755 --- a/LArCalorimeter/LArCalibUtils/src/LArStripsCrossTalkCorrector.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArStripsCrossTalkCorrector.cxx @@ -8,15 +8,13 @@ #include "LArRawEvent/LArFebErrorSummary.h" #include "CaloIdentifier/CaloGain.h" #include "LArRecConditions/ILArBadChannelMasker.h" -#include "LArBadChannelTool/LArBadChanTool.h" #include "LArRecConditions/LArBadChannel.h" +#include "LArBadChannelTool/LArBadChannelDBTools.h" #include <math.h> LArStripsCrossTalkCorrector::LArStripsCrossTalkCorrector(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator), - m_larCablingSvc("LArCablingService"), - m_badChannelTool("LArBadChanTool"), m_dontUseForCorr("LArBadChannelMasker/DontUseForXtalkCorr",this), m_dontCorrect("LArBadChannelMasker/NoXtalkCorr",this), m_onlineHelper(nullptr), @@ -50,44 +48,41 @@ StatusCode LArStripsCrossTalkCorrector::initialize() { StatusCode sc = detStore()->retrieve(m_onlineHelper, "LArOnlineID"); if (sc.isFailure()) { - msg (MSG::ERROR) << "Could not get LArOnlineID helper !" << endmsg; + ATH_MSG_ERROR( "Could not get LArOnlineID helper !" ); return StatusCode::FAILURE; } sc = detStore()->retrieve(m_emId, "LArEM_ID"); if (sc.isFailure()) { - msg (MSG::ERROR) << "Could not get LArEM_ID helper !" << endmsg; + ATH_MSG_ERROR( "Could not get LArEM_ID helper !" ); return StatusCode::FAILURE; } - // Retrieve LArCablingService - sc = m_larCablingSvc.retrieve(); - if (sc!=StatusCode::SUCCESS) { - msg (MSG::ERROR) << " Can't get LArCablingSvc " << endmsg; - return sc; - } sc=m_dontCorrect.retrieve(); if (sc!=StatusCode::SUCCESS) { - msg (MSG::ERROR) << " Can't get LArBadChannelMaskingTool " << m_dontCorrect.typeAndName() << endmsg; + ATH_MSG_ERROR( " Can't get LArBadChannelMaskingTool " << m_dontCorrect.typeAndName() ); return sc; } else - msg (MSG::DEBUG) << "Successfully retrieved " << m_dontCorrect.typeAndName() << endmsg; + ATH_MSG_DEBUG( "Successfully retrieved " << m_dontCorrect.typeAndName() ); sc=m_dontUseForCorr.retrieve(); if (sc!=StatusCode::SUCCESS) { - msg (MSG::ERROR) << " Can't get LArBadChannelMaskingTool " << m_dontUseForCorr.typeAndName() << endmsg; + ATH_MSG_ERROR( " Can't get LArBadChannelMaskingTool " << m_dontUseForCorr.typeAndName() ); return sc; } else - msg (MSG::DEBUG) << "Successfully retrieved " << m_dontUseForCorr.typeAndName() << endmsg; + ATH_MSG_DEBUG( "Successfully retrieved " << m_dontUseForCorr.typeAndName() ); + ATH_CHECK(m_BCKey.initialize()); + ATH_CHECK(m_BFKey.initialize()); + ATH_CHECK(m_cablingKey.initialize()); sc = detStore()->regHandle(m_larPedestal,m_pedKey); if (sc!=StatusCode::SUCCESS) { - msg (MSG::ERROR) << "Could not register DataHandle for pedestal with key " << m_pedKey << endmsg; + ATH_MSG_ERROR( "Could not register DataHandle for pedestal with key " << m_pedKey ); return sc; } @@ -102,11 +97,11 @@ StatusCode LArStripsCrossTalkCorrector::initialize() { StatusCode LArStripsCrossTalkCorrector::execute() { if ( m_event_counter < 100 || ( m_event_counter < 1000 && m_event_counter%100==0 ) || m_event_counter%1000==0 ) - msg(MSG::INFO) << "Processing event " << m_event_counter << endmsg; + ATH_MSG_INFO( "Processing event " << m_event_counter ); ++m_event_counter; if (m_keylist.size()==0) { - msg(MSG::ERROR) << "Key list is empty! No containers to process!" << endmsg; + ATH_MSG_ERROR( "Key list is empty! No containers to process!" ); return StatusCode::FAILURE; } @@ -127,13 +122,20 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits() if (evtStore()->contains<LArFebErrorSummary>("LArFebErrorSummary")) { sc=evtStore()->retrieve(febErrSum); if (sc.isFailure()) { - msg(MSG::ERROR) << "Failed to retrieve FebErrorSummary object!" << endmsg; + ATH_MSG_ERROR( "Failed to retrieve FebErrorSummary object!" ); return sc; } } else if (m_event_counter==1) - msg(MSG::WARNING) << "No FebErrorSummaryObject found! Feb errors not checked!" << endmsg; + ATH_MSG_WARNING( "No FebErrorSummaryObject found! Feb errors not checked!" ); + + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling{*cablingHdl}; + if(!cabling) { + ATH_MSG_ERROR( "Do not have cabling object LArOnOffIdMapping"); + return StatusCode::FAILURE; + } std::vector<std::string>::const_iterator key_it=m_keylist.begin(); std::vector<std::string>::const_iterator key_it_e=m_keylist.end(); @@ -146,7 +148,7 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits() sc = evtStore()->retrieve(larAccumulatedCalibDigitContainer,*key_it); if (sc.isFailure()){ - msg(MSG::WARNING) << "Cannot read LArAccumulatedCalibDigitContainer from StoreGate! key=" << *key_it << endmsg; + ATH_MSG_WARNING( "Cannot read LArAccumulatedCalibDigitContainer from StoreGate! key=" << *key_it ); continue; // Try next container } @@ -161,12 +163,12 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits() HWIdentifier lastFailedFEB(0); if(it == it_end) { - msg(MSG::DEBUG) << "LArAccumulatedCalibDigitContainer with key = " << *key_it << " is empty " << endmsg; + ATH_MSG_DEBUG( "LArAccumulatedCalibDigitContainer with key = " << *key_it << " is empty " ); //return StatusCode::SUCCESS; continue; // Try next container } else { - msg( MSG::DEBUG) << "Processing LArAccumulatedCalibDigitContainer with key = " << *key_it - << ". Size: " << larAccumulatedCalibDigitContainer->size() << endmsg; + ATH_MSG_DEBUG( "Processing LArAccumulatedCalibDigitContainer with key = " << *key_it + << ". Size: " << larAccumulatedCalibDigitContainer->size() ); } //Get barrel/ec for online Identifier of the first cell in the container @@ -202,17 +204,17 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits() } } - msg(MSG::DEBUG) << "Filling Strips lookup table..." << endmsg ; + ATH_MSG_DEBUG( "Filling Strips lookup table..." ) ; int nStrips=0; for (;it!=it_end;it++) { //Loop over all cells to fill Strips lookup table const LArAccumulatedCalibDigit* dig=*it; chid=dig->hardwareID(); if (!(m_onlineHelper->isEMBchannel(chid) || m_onlineHelper->isEMECchannel(chid))) continue; //Deal only with EM calos case - if (!m_larCablingSvc->isOnlineConnected(chid)) continue; //ignore disconnected channels + if (!cabling->isOnlineConnected(chid)) continue; //ignore disconnected channels - const Identifier id=m_larCablingSvc->cnvToIdentifier(chid); + const Identifier id=cabling->cnvToIdentifier(chid); if (m_emId->sampling(id)!=1) continue; //Deal only with strips const HWIdentifier febid=m_onlineHelper->feb_Id(chid); @@ -221,8 +223,8 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits() if (febErrs & m_fatalFebErrorPattern) { if (febid!=lastFailedFEB) { lastFailedFEB=febid; - msg(MSG::ERROR) << "Event " << m_event_counter << " Feb " << m_onlineHelper->channel_name(febid) - << " reports error(s):" << febErrSum->error_to_string(febErrs) << ". Data ignored." << endmsg; + ATH_MSG_ERROR( "Event " << m_event_counter << " Feb " << m_onlineHelper->channel_name(febid) + << " reports error(s):" << febErrSum->error_to_string(febErrs) << ". Data ignored." ); } dig=&febErrorDummy; } //end if fatal feb error @@ -230,7 +232,7 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits() if (m_onlineHelper->barrel_ec(chid) != have_barrel_ec) { - msg(MSG::FATAL) << "Found barrel and endcap cells in same event. This is not supported by the LArStripsCrossTalkCorrector!" << endmsg; + ATH_MSG_FATAL( "Found barrel and endcap cells in same event. This is not supported by the LArStripsCrossTalkCorrector!" ); return StatusCode::FAILURE; } @@ -238,8 +240,8 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits() if (ieta==m_noIdx) continue; //Not a cell we care about const size_t iphi=getPhiIndex(id); if (iphi>=2*m_MAXphi || ieta>=m_MAXeta) { - msg( MSG::FATAL) << "Array index out of range: iphi=" << iphi << " (max " << m_MAXphi << "), ieta=" - << ieta << "(max " << m_MAXphi << ")" << endmsg; + ATH_MSG_FATAL( "Array index out of range: iphi=" << iphi << " (max " << m_MAXphi << "), ieta=" + << ieta << "(max " << m_MAXphi << ")" ); return StatusCode::FAILURE; } ++nStrips; @@ -277,8 +279,8 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits() m_nStrips=nStrips; if (m_nStrips != nStrips) { - msg(MSG::WARNING) << "Number of strips changed! Have " << nStrips << ", had " << m_nStrips - << " before. Size of map: " << 2*m_MAXphi*(m_MAXeta-m_MINeta) << endmsg; + ATH_MSG_WARNING( "Number of strips changed! Have " << nStrips << ", had " << m_nStrips + << " before. Size of map: " << 2*m_MAXphi*(m_MAXeta-m_MINeta) ); m_nStrips=nStrips; } else @@ -344,9 +346,9 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits() << " (Eta = " << ieta << ", Phi = " << iphi << ")"); } else { - msg(MSG::WARNING) << "Cannot find neighbour " << neighbours[i].dist << " to be added to Strip 0x" + ATH_MSG_WARNING( "Cannot find neighbour " << neighbours[i].dist << " to be added to Strip 0x" << MSG::hex << chid.get_compact() << MSG::dec - << " (Eta = " << ieta << ", Phi = " << iphi << ")" << endmsg; + << " (Eta = " << ieta << ", Phi = " << iphi << ")" ); } }//end if msgLvl(INFO) continue; @@ -359,9 +361,9 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits() //Check if neighbour is pulsed if (neighDig->isPulsed()) { - msg(MSG::WARNING) << "Neighbour " << neighbours[i].dist << " of strip 0x" << MSG::hex << chid.get_compact() << MSG::dec + ATH_MSG_WARNING( "Neighbour " << neighbours[i].dist << " of strip 0x" << MSG::hex << chid.get_compact() << MSG::dec << " (Eta = " << ieta << ", Phi = " << iphi <<", " << printMaxSample(neighDig) - << ") is pulsed. Not used for correction." << endmsg; + << ") is pulsed. Not used for correction." ); continue; } //Check if neighbour is on the bad-channel list @@ -374,9 +376,9 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits() //Get Pedestal const float pedestal = m_larPedestal->pedestal(neighDig->hardwareID(),t_gain); if (pedestal <= (1.0+LArElecCalib::ERRORCODE)) { - msg(MSG::ERROR) << "No pedestal are available for neighbour " << neighbours[i].dist << " of Strip 0x" + ATH_MSG_ERROR( "No pedestal are available for neighbour " << neighbours[i].dist << " of Strip 0x" << MSG::hex << chid.get_compact() << MSG::dec - << " (Eta = " << ieta << ", Phi = " << iphi << "). Not used for correction!" << endmsg; + << " (Eta = " << ieta << ", Phi = " << iphi << "). Not used for correction!" ); continue; } //All went ok, fill struct @@ -424,16 +426,16 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits() } //end if have pointer to neighbor cell else { //Neighbor not usable for some reason, try mirrored neighbor const int j = 3-i; //get mirrored neighbor - msg(MSG::INFO) << "Neighbour " << neighbours[i].dist << " of channel 0x" << MSG::hex << chid.get_compact() << MSG::dec - << " cannot be used. Taking mirrored neighbour " << neighbours[j].dist << " instead." << endmsg; + ATH_MSG_INFO( "Neighbour " << neighbours[i].dist << " of channel 0x" << MSG::hex << chid.get_compact() << MSG::dec + << " cannot be used. Taking mirrored neighbour " << neighbours[j].dist << " instead." ); if (neighbours[j].dig!=0 && neighbours[j].dig!=&inexistingDummy){ correctSamples(SampleSums,neighbours[j]); ATH_MSG_VERBOSE("Mirrored neighbour " << neighbours[j].dist << " of strip 0x" << MSG::hex << chid.get_compact() << MSG::dec << " (Eta = " << ieta << ", Phi = " << iphi << ") is used for correction"); }//end if neighbours[j].dig else { - msg(MSG::WARNING) << "Mirrored Neighbour " << neighbours[j].dist << " of channel 0x" << MSG::hex << chid.get_compact() << MSG::dec - << " cannot be used too. No correction applied" << endmsg; + ATH_MSG_WARNING( "Mirrored Neighbour " << neighbours[j].dist << " of channel 0x" << MSG::hex << chid.get_compact() << MSG::dec + << " cannot be used too. No correction applied" ); } }//end if no neighboring cell }//end loop over the four neighbors @@ -447,9 +449,9 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits() const uint32_t& oldVal=currDig->sampleSum()[SampleIndex]; if (thisSampleSum<0) { unresonable=true; - msg(MSG::WARNING) << "Channel 0x" << MSG::hex << chid.get_compact() << MSG::dec + ATH_MSG_WARNING( "Channel 0x" << MSG::hex << chid.get_compact() << MSG::dec << " (Eta = " << ieta << ", Phi = " << iphi << ") Resulting ADC sample " << SampleIndex <<" negative! " - << thisSampleSum << " instead of " << oldVal << " Not corrected." << endmsg; + << thisSampleSum << " instead of " << oldVal << " Not corrected." ); break; } @@ -489,26 +491,30 @@ StatusCode LArStripsCrossTalkCorrector::executeWithAccumulatedDigits() } //End loop over all containers if (nSaturation) - msg(MSG::INFO) << "Found " << nSaturation << " saturating digits in this event." << endmsg; + ATH_MSG_INFO( "Found " << nSaturation << " saturating digits in this event." ); return StatusCode::SUCCESS; } StatusCode LArStripsCrossTalkCorrector::executeWithStandardDigits() { - msg(MSG::FATAL) << "Xtalk correction wiht non-accumulated digits not supported any more." << endmsg; + ATH_MSG_FATAL( "Xtalk correction wiht non-accumulated digits not supported any more." ); return StatusCode::FAILURE; } StatusCode LArStripsCrossTalkCorrector::finalize() { if (msgLvl(MSG::WARNING) && m_uncorrectedIds.size()>0 ) { const LArBadChanBitPacking packing; - msg(MSG::WARNING) << "The following "<< m_uncorrectedIds.size() << " channels are (partly) uncorrected because of unresonable high correction:" << endmsg; - std::set<HWIdentifier>::const_iterator it=m_uncorrectedIds.begin(); - std::set<HWIdentifier>::const_iterator it_e=m_uncorrectedIds.end(); - for (;it!=it_e;++it) { - LArBadChannel bc=m_badChannelTool->status(*it); - msg(MSG::WARNING) << "Not corrected: " << m_onlineHelper->channel_name(*it) << " " << packing.stringStatus(bc) << endmsg; + ATH_MSG_WARNING( "The following "<< m_uncorrectedIds.size() << " channels are (partly) uncorrected because of unresonable high correction:" ); + SG::ReadCondHandle<LArBadChannelCont> bcHdl{m_BCKey}; + const LArBadChannelCont* bcCont{*bcHdl}; + if(bcCont) { + std::set<HWIdentifier>::const_iterator it=m_uncorrectedIds.begin(); + std::set<HWIdentifier>::const_iterator it_e=m_uncorrectedIds.end(); + for (;it!=it_e;++it) { + LArBadChannel bc=bcCont->status(*it); + ATH_MSG_WARNING( "Not corrected: " << m_onlineHelper->channel_name(*it) << " " << packing.stringStatus(bc) ); + } } } @@ -534,28 +540,44 @@ StatusCode LArStripsCrossTalkCorrector::initKnownMissingFebs(const int bec) { m_knownMissingFebs.resize(m_MAXeta); //const std::vector<HWIdentifier> mf=m_badChannelTool->missingFEBs(); - const LArBadChanTool::BadFebVec& mf=m_badChannelTool->fullBadFebsState(); - - //msg(MSG::DEBUG) << "Got " << mf.size() << " missing FEBs" << endmsg; - LArBadChanTool::BadFebVec::const_iterator it=mf.begin(); - LArBadChanTool::BadFebVec::const_iterator it_e=mf.end(); + SG::ReadCondHandle<LArBadFebCont> bfHdl{m_BFKey}; + const LArBadFebCont* bfCont{*bfHdl}; + if(!bfCont) { + ATH_MSG_ERROR( "Do not have missing FEBs " << m_BFKey.key() ); + return StatusCode::FAILURE; + } + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling{*cablingHdl}; + if(!cabling) { + ATH_MSG_ERROR( "Do not have cabling object LArOnOffIdMapping"); + return StatusCode::FAILURE; + } + + LArBadChannelDBTools::BadFebVec mf; + for (const auto& entry : bfCont->fullCont()) { + const HWIdentifier hid=HWIdentifier(entry.first); + mf.emplace_back(LArBadChannelDBTools::BadFebEntry(hid,entry.second)); + } + //ATH_MSG_DEBUG( "Got " << mf.size() << " missing FEBs" ); + LArBadChannelDBTools::BadFebVec::const_iterator it=mf.begin(); + LArBadChannelDBTools::BadFebVec::const_iterator it_e=mf.end(); for (;it!=it_e;++it) { const HWIdentifier& fid=it->first; const LArBadFeb& bf=it->second; if (bf.deadAll() || bf.deadReadout() || bf.deactivatedInOKS()) { if ((bec==0 && m_onlineHelper->isEMBchannel(fid)) || (bec==1 && m_onlineHelper->isEMECchannel(fid))) { - msg(MSG::DEBUG) << "Feb " << MSG::hex << fid.get_compact() << MSG::dec << " reported as missing" << endmsg; + ATH_MSG_DEBUG( "Feb " << MSG::hex << fid.get_compact() << MSG::dec << " reported as missing" ); const int nChan=m_onlineHelper->channelInSlotMax(fid); for (int c=0;c<nChan;++c) { const HWIdentifier chid=m_onlineHelper->channel_Id(fid,c); - const Identifier id=m_larCablingSvc->cnvToIdentifier(chid); + const Identifier id=cabling->cnvToIdentifier(chid); const size_t ieta=getEtaIndex(id); if (ieta==m_noIdx) continue; //Not a cell we care about const size_t iphi=getPhiIndex(id); if (iphi>=2*m_MAXphi || ieta>=m_MAXeta) { - msg(MSG::FATAL) << "Array index out of range: iphi=" << iphi << " (max " << m_MAXphi << "), ieta=" - << ieta << "(max " << m_MAXphi << ")" << endmsg; + ATH_MSG_FATAL( "Array index out of range: iphi=" << iphi << " (max " << m_MAXphi << "), ieta=" + << ieta << "(max " << m_MAXphi << ")" ); return StatusCode::FAILURE; } m_knownMissingFebs[ieta].set(iphi); @@ -564,7 +586,7 @@ StatusCode LArStripsCrossTalkCorrector::initKnownMissingFebs(const int bec) { }//end if is barrel/endcap & EM }//end if is dead }//end loop over problematic febs - msg(MSG::INFO) << "Number of known missing Strip cells: "<< nMissing << endmsg; + ATH_MSG_INFO( "Number of known missing Strip cells: "<< nMissing ); return StatusCode::SUCCESS; } diff --git a/LArCalorimeter/LArCalibUtils/src/LArWFParamTool.cxx b/LArCalorimeter/LArCalibUtils/src/LArWFParamTool.cxx index 29f2d32baa5..234cd15fba2 100755 --- a/LArCalorimeter/LArCalibUtils/src/LArWFParamTool.cxx +++ b/LArCalorimeter/LArCalibUtils/src/LArWFParamTool.cxx @@ -111,60 +111,60 @@ StatusCode LArWFParamTool::initialize() { std::string layerName[4] = { "PS" , "Strips" , "Middle" , "Back" } ; - msg(MSG::INFO) << "TShaper set to " << m_Tshaper << " ns" << endmsg ; + ATH_MSG_INFO( "TShaper set to " << m_Tshaper << " ns" ) ; - msg(MSG::INFO) << "Step response (Fstep) -> Ttail = Tmin + " << m_DeltaTtail[0] << " steps" << endmsg ; + ATH_MSG_INFO( "Step response (Fstep) -> Ttail = Tmin + " << m_DeltaTtail[0] << " steps" ) ; if (!m_UseOmegaScanHelper) - msg(MSG::INFO) << "Cosine response (Omega0) -> Ttail = Tmin + " << m_DeltaTtail[1] << " steps" << endmsg ; + ATH_MSG_INFO( "Cosine response (Omega0) -> Ttail = Tmin + " << m_DeltaTtail[1] << " steps" ) ; else - msg(MSG::INFO) << "Cosine response (Omega0) -> Will use OmegaScanHelper() to dynamically select settings" << endmsg; + ATH_MSG_INFO( "Cosine response (Omega0) -> Will use OmegaScanHelper() to dynamically select settings" ); - msg(MSG::INFO) << "Residual oscillations (Taur) -> Ttail = Tmin + " << m_DeltaTtail[2] << " steps" << endmsg ; + ATH_MSG_INFO( "Residual oscillations (Taur) -> Ttail = Tmin + " << m_DeltaTtail[2] << " steps" ) ; for ( unsigned layer=0 ; layer<4 ; ++layer ) { - msg(MSG::INFO) << "options for Layer " << layer << " (" << layerName[layer] << ")" << endmsg ; + ATH_MSG_INFO( "options for Layer " << layer << " (" << layerName[layer] << ")" ) ; - msg(MSG::INFO) << " perform cos resp scan: " ; + ATH_MSG_INFO( " perform cos resp scan: " ); if ( m_cosRespScan[layer] && !m_UseOmegaScanHelper ) - msg(MSG::INFO) << "YES (" << m_npoints[layer] << " points)" << endmsg ; + ATH_MSG_INFO( "YES (" << m_npoints[layer] << " points)" ) ; if ( !m_cosRespScan[layer] && !m_UseOmegaScanHelper ) - msg(MSG::INFO) << "NO" << endmsg ; + ATH_MSG_INFO( "NO" ) ; if ( m_UseOmegaScanHelper ) - msg(MSG::INFO) << "Will use OmegaScanHelper() to dynamically select settings" << endmsg ; + ATH_MSG_INFO( "Will use OmegaScanHelper() to dynamically select settings" ) ; if (!m_UseOmegaScanHelper) { - msg(MSG::INFO) << " search interval: [ " << m_omegamin[layer] << " ; " << m_omegamax[layer] << " ]" << endmsg ; + ATH_MSG_INFO( " search interval: [ " << m_omegamin[layer] << " ; " << m_omegamax[layer] << " ]" ) ; if ( m_omegamin[layer] >= m_omegamax[layer] ) { - msg(MSG::ERROR) << "Omega0Min >= Omega0Max in layer " << layer << " -- exit!" << endmsg ; + ATH_MSG_ERROR( "Omega0Min >= Omega0Max in layer " << layer << " -- exit!" ) ; return StatusCode::FAILURE ; } } - msg(MSG::INFO) << " store residual oscillation wave:" ; + ATH_MSG_INFO( " store residual oscillation wave:" ); if ( m_storeResOscill[layer] ) { - msg(MSG::INFO) << "YES" << endmsg ; + ATH_MSG_INFO( "YES" ) ; } else { - msg(MSG::INFO) << "NO" << endmsg ; + ATH_MSG_INFO( "NO" ) ; } } StatusCode sc = detStore()->retrieve(m_onlineHelper, "LArOnlineID"); if (sc.isFailure()) { - msg(MSG::ERROR) << "Could not get LArOnlineID helper" << endmsg; + ATH_MSG_ERROR( "Could not get LArOnlineID helper" ); return sc; } sc = detStore()->retrieve(m_emId, "LArEM_ID"); if (sc.isFailure()) { - msg(MSG::ERROR) << "Could not get LArOnlineID helper" << endmsg; + ATH_MSG_ERROR( "Could not get LArOnlineID helper" ); return sc; } sc= m_larCablingSvc.retrieve(); if (sc.isFailure()) { - msg(MSG::ERROR) << "Could not get LArCablingService" << endmsg; + ATH_MSG_ERROR( "Could not get LArCablingService" ); return sc; } @@ -193,8 +193,8 @@ StatusCode LArWFParamTool::getLArWaveParams(const LArCaliWave& larCaliWave, if ( wfParams.tcal() == DoExtract ) { const double Tcal = expTail(gCali,waveTiming) ; if ( Tcal < 0 ) { - msg(MSG::WARNING) << "Could not extract Tcal for ChID=" << chid.get_compact() - << " gain=" << (int)gain << endmsg ; + ATH_MSG_WARNING( "Could not extract Tcal for ChID=" << chid.get_compact() + << " gain=" << (int)gain ) ; wfParams.setTcal(FailExtract); return StatusCode::FAILURE; } @@ -208,8 +208,8 @@ StatusCode LArWFParamTool::getLArWaveParams(const LArCaliWave& larCaliWave, if ( wfParams.fstep() == DoExtract ) { StatusCode sc = GetFstep(gCali,wfParams,waveTiming); if ( sc.isFailure() ) { - msg(MSG::WARNING) << "Could not extract Fstep for ChID=" << chid.get_compact() - << " gain=" << (int)gain << endmsg; + ATH_MSG_WARNING( "Could not extract Fstep for ChID=" << chid.get_compact() + << " gain=" << (int)gain ); wfParams.setFstep(FailExtract); return sc ; } @@ -221,8 +221,8 @@ StatusCode LArWFParamTool::getLArWaveParams(const LArCaliWave& larCaliWave, if ( wfParams.omega0() == DoExtract ) { StatusCode sc = RTM_Omega0(gCali,chid,wfParams,waveTiming,omegaScanWave); if ( sc.isFailure() ) { - msg(MSG::WARNING) << "Could not extract Omega0 for ChID=" << chid.get_compact() - << " gain=" << (int)gain << endmsg; + ATH_MSG_WARNING( "Could not extract Omega0 for ChID=" << chid.get_compact() + << " gain=" << (int)gain ); wfParams.setOmega0(FailExtract) ; return sc ; } @@ -242,8 +242,8 @@ StatusCode LArWFParamTool::getLArWaveParams(const LArCaliWave& larCaliWave, if ( wfParams.taur() == DoExtract ) { StatusCode sc = RTM_Taur(gCali, wfParams,waveTiming ) ; if ( sc.isFailure() ) { - msg(MSG::WARNING) << "Could not extract Taur for ChID=" << chid.get_compact() - << " gain=" << (int)gain << endmsg ; + ATH_MSG_WARNING( "Could not extract Taur for ChID=" << chid.get_compact() + << " gain=" << (int)gain ) ; wfParams.setTaur(FailExtract); return sc ; } @@ -316,7 +316,7 @@ double LArWFParamTool::expTail(const LArWave& gCali, const WaveTiming_t& wt) con const double Tcal = -1./A ; if ( Tcal < 0 ) { - msg(MSG::WARNING) << "Exponential fit yielded negative Tcal " << Tcal << endmsg; + ATH_MSG_WARNING( "Exponential fit yielded negative Tcal " << Tcal ); } ATH_MSG_VERBOSE( "*** Exponential fit\t--> m_Tcal = " << Tcal ) ; @@ -551,7 +551,7 @@ LArWFParamTool::omegaScanParams_t LArWFParamTool::OmegaScanHelper(const Identifi ret.DeltaOmega = 0.001 ; - //(*m_log) << MSG::WARNING << " m_Tstart= " << m_Tstart << " m_Tcross=" << m_Tcross << endmsg ; + //(*m_log) << MSG::WARNING << " m_Tstart= " << m_Tstart << " m_Tcross=" << m_Tcross ) ; const bool IsEMECInnerWheel = m_emId->is_em_endcap_inner(id);//m_onlineHelper->isEMECinHECchannel(m_chID); const int eta=m_emId->eta(id); @@ -967,7 +967,7 @@ unsigned LArWFParamTool::checkStatus(const LArCaliWave &larCaliWave) const unsigned length ; if ( (length=larCaliWave.getSize()) < 750 ) { - msg(MSG::WARNING) << "Calibration wave is too short!" << endmsg ; + ATH_MSG_WARNING( "Calibration wave is too short!" ) ; return TooShort ; } @@ -977,11 +977,11 @@ unsigned LArWFParamTool::checkStatus(const LArCaliWave &larCaliWave) const double maxSample = -9.E+10 ; for ( unsigned i=0 ; i<length ; i++ ) { if ( larCaliWave.getError(i) < 0 || larCaliWave.getTrigger(i) < 0 ) { - msg(MSG::WARNING) << "Calibration wave probably not completely filled" << endmsg ; + ATH_MSG_WARNING( "Calibration wave probably not completely filled" ) ; return NotFilled ; } if ( larCaliWave.getTrigger(i) < 50 ) { - msg(MSG::WARNING) << "Calibration wave with low statistics" << endmsg ; + ATH_MSG_WARNING( "Calibration wave with low statistics" ) ; return LowStat ; } double thisSample = larCaliWave.getTrigger(i) ; @@ -999,11 +999,11 @@ unsigned LArWFParamTool::checkStatus(const LArCaliWave &larCaliWave) const } } if ( sqrt(tremble/length)/maxSample > 0.1 ) { - msg(MSG::WARNING) << "Calibration wave is noisy " << sqrt(tremble/length)/maxSample << endmsg ; + ATH_MSG_WARNING( "Calibration wave is noisy " << sqrt(tremble/length)/maxSample ) ; return Noisy ; } if ( nMax > 1 ) { - msg(MSG::WARNING) << "Calibration wave oscillates" << endmsg ; + ATH_MSG_WARNING( "Calibration wave oscillates" ) ; return Oscillating ; } diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_BadChanTool.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_BadChanTool.py deleted file mode 100644 index b560c3381a2..00000000000 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_BadChanTool.py +++ /dev/null @@ -1,19 +0,0 @@ -BadChannelsFolder="/LAR/BadChannelsOfl/BadChannels" -MissingFEBsFolder="/LAR/BadChannelsOfl/MissingFEBs" - -from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool - -theLArBadChanTool= LArBadChanTool(CoolFolder=BadChannelsFolder, - CoolMissingFEBsFolder=MissingFEBsFolder, - ) - -ToolSvc+=theLArBadChanTool - - -from AthenaCommon.AlgSequence import AthSequencer -from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelCondAlg,LArBadFebCondAlg -condSeq = AthSequencer("AthCondSeq") -condSeq+=LArBadFebCondAlg(ReadKey=MissingFEBsFolder) -condSeq+=LArBadChannelCondAlg(ReadKey=BadChannelsFolder) - - diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_Cali_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_Cali_jobOptions.py index 61ce2a19710..9d4207496b7 100644 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_Cali_jobOptions.py +++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_Cali_jobOptions.py @@ -696,10 +696,6 @@ if CorrectBadChannels: theLArCaliWavePatcher.PatchMethod="PhiAverage" ##do an aveage in phi after removing bad and empty event theLArCaliWavePatcher.OutputLevel=INFO - from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool - theLArBadChannelTool=LArBadChanTool() - ToolSvc+=theLArBadChannelTool - from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelMasker theLArRCBMasker=LArBadChannelMasker("LArRCBMasker") theLArRCBMasker.DoMasking=True diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_splitter_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_splitter_jobOptions.py index 7d2e07e37df..cf14e0cab36 100644 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_splitter_jobOptions.py +++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_OFC_splitter_jobOptions.py @@ -713,11 +713,6 @@ if CorrectBadChannels: theLArCaliWavePatcher.PatchMethod="PhiAverage" ##do an aveage in phi after removing bad and empty event theLArCaliWavePatcher.OutputLevel=INFO - from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool - theLArBadChannelTool=LArBadChanTool() - theLArBadChannelTool.OutputLevel=DEBUG - ToolSvc+=theLArBadChannelTool - from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelMasker theLArRCBMasker=LArBadChannelMasker("LArRCBMasker") theLArRCBMasker.DoMasking=True diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_jobOptions.py index 7578e37fb0e..12a3f04cacd 100644 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_jobOptions.py +++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_jobOptions.py @@ -492,10 +492,6 @@ if CorrectBadChannels: theLArCaliWavePatcher.PatchMethod="PhiAverage" ##do an aveage in phi after removing bad and empty event theLArCaliWavePatcher.OutputLevel=INFO - from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool - theLArBadChannelTool=LArBadChanTool() - ToolSvc+=theLArBadChannelTool - from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelMasker theLArRCBMasker=LArBadChannelMasker("LArRCBMasker") theLArRCBMasker.DoMasking=True diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_splitter_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_splitter_jobOptions.py index c84cb635556..ca4fcb13792 100644 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_splitter_jobOptions.py +++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Delay_splitter_jobOptions.py @@ -562,13 +562,6 @@ if CorrectBadChannels: theLArCaliWavePatcher.PatchMethod="PhiAverage" ##do an aveage in phi after removing bad and empty event theLArCaliWavePatcher.OutputLevel=INFO - from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool - theLArBadChannelTool=LArBadChanTool() - theLArBadChannelTool.OutputLevel=DEBUG - theLArBadChannelTool.CoolFolder=BadChannelsFolder - theLArBadChannelTool.CoolMissingFEBsFolder=MissingFEBsFolder - ToolSvc+=theLArBadChannelTool - from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelMasker theLArRCBMasker=LArBadChannelMasker("LArRCBMasker") theLArRCBMasker.DoMasking=True diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_WavePatcher.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_WavePatcher.py index 5dbb4477585..84cca2bef9e 100644 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_WavePatcher.py +++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Example_WavePatcher.py @@ -66,11 +66,6 @@ theLArCaliWavePatcher.PatchMethod="PhiNeighbor" theLArCaliWavePatcher.OutputLevel=DEBUG topSequence+=theLArCaliWavePatcher -from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool -theLArBadChannelTool=LArBadChanTool() -theLArBadChannelTool.OutputLevel=DEBUG -ToolSvc+=theLArBadChannelTool - from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelMasker theLArRCBMasker=LArBadChannelMasker("LArRCBMasker") theLArRCBMasker.DoMasking=True diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Patching_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Patching_jobOptions.py index 634f4cf735f..c8c14ee3bf1 100644 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Patching_jobOptions.py +++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Patching_jobOptions.py @@ -158,11 +158,6 @@ while (os.access(outputRootFileName,os.F_OK)): outputRootFileName="AdditionalCorrections_%i_%i.root" % (IOVstart,i) -from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool -theLArBadChannelTool=LArBadChanTool() -#theLArBadChannelTool.OutputLevel=DEBUG -ToolSvc+=theLArBadChannelTool - from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelMasker theLArRCBMasker=LArBadChannelMasker("LArRCBMasker") theLArRCBMasker.DoMasking=True diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_jobOptions.py index 56746d2b53d..3c8c1676bb9 100644 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_jobOptions.py +++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_jobOptions.py @@ -640,9 +640,6 @@ if CorrectBadChannels: theLArRampPatcher.ContainerKey=KeyOutput theLArRampPatcher.PatchMethod="PhiAverage" - from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool - theLArBadChannelTool=LArBadChanTool() - ToolSvc+=theLArBadChannelTool theLArRampPatcher.MaskingTool=theLArRCBMasker theLArRampPatcher.UseCorrChannels=False topSequence+=theLArRampPatcher diff --git a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_splitter_jobOptions.py b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_splitter_jobOptions.py index 979c733e343..dad32cc668f 100644 --- a/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_splitter_jobOptions.py +++ b/LArCalorimeter/LArExample/LArCalibProcessing/share/LArCalib_Ramp_splitter_jobOptions.py @@ -544,10 +544,6 @@ if ( StripsXtalkCorr ) : theLArStripsCrossTalkCorrector.AcceptableDifference=25.0 #in per-cent topSequence +=theLArStripsCrossTalkCorrector -from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool -theLArBadChannelTool=LArBadChanTool() -ToolSvc+=theLArBadChannelTool - from LArBadChannelTool.LArBadChannelToolConf import LArBadChannelMasker theLArRCBMasker=LArBadChannelMasker("LArRCBMasker") theLArRCBMasker.DoMasking=True diff --git a/LArCalorimeter/LArMonTools/share/LArCoverage_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArCoverage_jobOptions.py index 55923105623..26539badd68 100755 --- a/LArCalorimeter/LArMonTools/share/LArCoverage_jobOptions.py +++ b/LArCalorimeter/LArMonTools/share/LArCoverage_jobOptions.py @@ -13,13 +13,6 @@ theLArCoverage = LArCoverage(name="LArCoverage", #ToolSvc += theLArCoverage LArMon.AthenaMonTools+=[ theLArCoverage ] -# BadChannelTool configuration -from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool -theLArBadChannelTool=LArBadChanTool() -theLArBadChannelTool.ReadFromASCII=False -ToolSvc+=theLArBadChannelTool -LArCoverage.LArBadChannelTool=theLArBadChannelTool - # CaloNoiseTool configuration from CaloTools.CaloNoiseToolDefault import CaloNoiseToolDefault theLArCoverageCaloNoiseTool=CaloNoiseToolDefault() diff --git a/LArCalorimeter/LArMonTools/share/LArFEBMon_jobOptions.py b/LArCalorimeter/LArMonTools/share/LArFEBMon_jobOptions.py index 7fd60162092..8e35d8087ce 100755 --- a/LArCalorimeter/LArMonTools/share/LArFEBMon_jobOptions.py +++ b/LArCalorimeter/LArMonTools/share/LArFEBMon_jobOptions.py @@ -26,13 +26,6 @@ theLArFEBMon = LArFEBMon(name="LArFEBMon", #ToolSvc += theLArFEBMon LArMon.AthenaMonTools+=[ theLArFEBMon ] -# BadChannelTool configuration -from LArBadChannelTool.LArBadChannelToolConf import LArBadChanTool -theLArBadChannelTool=LArBadChanTool() -theLArBadChannelTool.ReadFromASCII=False -ToolSvc+=theLArBadChannelTool -LArFEBMon.LArBadChannelTool=theLArBadChannelTool - #to change an option later, do e.g #ToolSvc.LArFEBMon.maxOfTimingHisto =100 #ToolSvc.LArFEBMon.OutputLevel =DEBUG diff --git a/LArCalorimeter/LArMonTools/src/LArCosmicsMonTool.h b/LArCalorimeter/LArMonTools/src/LArCosmicsMonTool.h index 8403bfa4137..3eb1634e869 100755 --- a/LArCalorimeter/LArMonTools/src/LArCosmicsMonTool.h +++ b/LArCalorimeter/LArMonTools/src/LArCosmicsMonTool.h @@ -94,8 +94,6 @@ class LArCosmicsMonTool: public ManagedMonitorToolBase ITHistSvc* m_rootStore; /** Handle to LArCablingService */ ToolHandle<LArCablingService> m_larCablingService; - /** Handle to bad-channel tool */ - //ToolHandle<ILArBadChanTool> m_badChannelTool; /** Handle to bad-channel mask */ ToolHandle<ILArBadChannelMasker> m_badChannelMask; diff --git a/LArCalorimeter/LArMonTools/src/LArCoverage.cxx b/LArCalorimeter/LArMonTools/src/LArCoverage.cxx index 2d623571c3d..80d9109f36c 100755 --- a/LArCalorimeter/LArMonTools/src/LArCoverage.cxx +++ b/LArCalorimeter/LArMonTools/src/LArCoverage.cxx @@ -67,7 +67,6 @@ LArCoverage::LArCoverage(const std::string& type, declareProperty("LArDigitContainerKey",m_LArDigitContainerKey = "FREE"); declareProperty("LArRawChannelKey",m_channelKey="LArRawChannels"); declareProperty("LArBadChannelMask",m_badChannelMask); - declareProperty("LArBadChannelTool",m_badChannelTool); declareProperty("LArCaloNoiseTool",m_caloNoiseTool); declareProperty("Nevents",m_nevents = 50); declareProperty("Nsigma",m_nsigma = 3); @@ -124,14 +123,8 @@ LArCoverage::initialize() return sc; } - // Get BadChannelTool - sc=m_badChannelTool.retrieve(); - if (sc.isFailure()) { - ATH_MSG_ERROR( "Could not retrieve LArBadChannelTool " << m_badChannelTool ); - return StatusCode::FAILURE; - } else { - ATH_MSG_DEBUG( "LArBadChannelTool" << m_badChannelTool << " retrieved" ); - } + ATH_CHECK( m_BCKey.initialize() ); + ATH_CHECK( m_BFKey.initialize() ); // Get bad-channel mask sc=m_badChannelMask.retrieve(); @@ -826,9 +819,16 @@ StatusCode LArCoverage::procHistograms() /*---------------------------------------------------------*/ int LArCoverage::DBflag(HWIdentifier onID){ - int flag = 0; - LArBadChannel bc = m_badChannelTool->status(onID); + SG::ReadCondHandle<LArBadChannelCont> bch{m_BCKey}; + const LArBadChannelCont* bcCont{*bch}; + if(!bcCont) { + ATH_MSG_WARNING( "Do not have Bad chan container " << m_BCKey.key() ); + return -1; + } + + LArBadChannel bc = bcCont->status(onID); + int flag = 0; if(bc.deadCalib()) flag = 1; if(bc.lowNoiseHG()||bc.lowNoiseMG()||bc.lowNoiseLG()) flag = 2; if(bc.distorted()) flag = 3; @@ -862,6 +862,12 @@ void LArCoverage::SetBadChannelZaxisLabels(TH2I_LW* h){ /*---------------------------------------------------------*/ void LArCoverage::FillKnownMissingFEBs(const CaloDetDescrManager* caloDetDescrMgr){ + SG::ReadCondHandle<LArBadFebCont> bf{m_BFKey}; + const LArBadFebCont* mfCont{*bf}; + if(!mfCont) { + ATH_MSG_WARNING( "Do not have Missing FEBs container !!" ); + return ; + } // Loop over all FEBs for (std::vector<HWIdentifier>::const_iterator allFeb = m_LArOnlineIDHelper->feb_begin(); allFeb != m_LArOnlineIDHelper->feb_end(); ++allFeb) { @@ -871,9 +877,9 @@ void LArCoverage::FillKnownMissingFEBs(const CaloDetDescrManager* caloDetDescrMg // Known missing FEB but cells actually readout: set content to 4 // Known FEB with error: set content to 0 (CaloCells not produced) - const LArBadFeb febStatus = m_badChannelTool->febStatus(febid); + const LArBadFeb febStatus = mfCont->status(febid); - if(m_badChannelTool->febMissing(febid) || febStatus.inError()){ + if(febStatus.deadAll() || febStatus.deadReadout() || febStatus.inError()){ int barrel_ec = m_LArOnlineIDHelper->barrel_ec(febid); int pos_neg = m_LArOnlineIDHelper->pos_neg(febid); @@ -883,7 +889,7 @@ void LArCoverage::FillKnownMissingFEBs(const CaloDetDescrManager* caloDetDescrMg // EMBA if (barrel_ec==0 and pos_neg==1){ int content; int replace = 0; - if (m_badChannelTool->febMissing(febid)){ + if (febStatus.deadAll() || febStatus.deadReadout()){ content = int(m_hCoverageHWEMBA->GetBinContent(ft*14+slot,1)); if(content==0 || content==1) replace = 1; else replace = 4; @@ -915,7 +921,7 @@ void LArCoverage::FillKnownMissingFEBs(const CaloDetDescrManager* caloDetDescrMg // EMBC if (barrel_ec==0 and pos_neg==0){ int content; int replace = 0; - if (m_badChannelTool->febMissing(febid)){ + if (febStatus.deadAll() || febStatus.deadReadout()){ content = int(m_hCoverageHWEMBC->GetBinContent(ft*14+slot,1)); if(content==0 || content==1) replace = 1; else replace = 4; @@ -952,7 +958,7 @@ void LArCoverage::FillKnownMissingFEBs(const CaloDetDescrManager* caloDetDescrMg // EMECA if( m_LArOnlineIDHelper->isEMECchannel(test_chid)){ int content; int replace = 0; - if (m_badChannelTool->febMissing(febid)){ + if (febStatus.deadAll() || febStatus.deadReadout()){ content = int(m_hCoverageHWEMECA->GetBinContent(ft*15+slot,1)); if(content==0 || content==1) replace = 1; else replace = 4; @@ -984,7 +990,7 @@ void LArCoverage::FillKnownMissingFEBs(const CaloDetDescrManager* caloDetDescrMg // HECA if( m_LArOnlineIDHelper->isHECchannel(test_chid)){ int content; int replace = 0; - if (m_badChannelTool->febMissing(febid)){ + if (febStatus.deadAll() || febStatus.deadReadout()){ content = int(m_hCoverageHWHECA->GetBinContent(ft*15+slot,1)); if(content==0 || content==1) replace = 1; else replace = 4; @@ -1016,7 +1022,7 @@ void LArCoverage::FillKnownMissingFEBs(const CaloDetDescrManager* caloDetDescrMg // FCALA if( m_LArOnlineIDHelper->isFCALchannel(test_chid)){ int content; int replace = 0; - if (m_badChannelTool->febMissing(febid)){ + if (febStatus.deadAll() || febStatus.deadReadout()){ content = int(m_hCoverageHWFCALA->GetBinContent(ft*15+slot,1)); if(content==0 || content==1) replace = 1; else replace = 4; @@ -1050,7 +1056,7 @@ void LArCoverage::FillKnownMissingFEBs(const CaloDetDescrManager* caloDetDescrMg // EMECC if( m_LArOnlineIDHelper->isEMECchannel(test_chid)){ int content; int replace = 0; - if (m_badChannelTool->febMissing(febid)){ + if (febStatus.deadAll() || febStatus.deadReadout()){ content = int(m_hCoverageHWEMECC->GetBinContent(ft*15+slot,1)); if(content==0 || content==1) replace = 1; else replace = 4; @@ -1082,7 +1088,7 @@ void LArCoverage::FillKnownMissingFEBs(const CaloDetDescrManager* caloDetDescrMg // HECC if( m_LArOnlineIDHelper->isHECchannel(test_chid)){ int content; int replace = 0; - if (m_badChannelTool->febMissing(febid)){ + if (febStatus.deadAll() || febStatus.deadReadout()){ content = int(m_hCoverageHWHECC->GetBinContent(ft*15+slot,1)); if(content==0 || content==1) replace = 1; else replace = 4; @@ -1114,7 +1120,7 @@ void LArCoverage::FillKnownMissingFEBs(const CaloDetDescrManager* caloDetDescrMg // FCALC if( m_LArOnlineIDHelper->isFCALchannel(test_chid)){ int content; int replace = 0; - if (m_badChannelTool->febMissing(febid)){ + if (febStatus.deadAll() || febStatus.deadReadout()){ content = int(m_hCoverageHWFCALC->GetBinContent(ft*15+slot,1)); if(content==0 || content==1) replace = 1; else replace = 4; diff --git a/LArCalorimeter/LArMonTools/src/LArCoverage.h b/LArCalorimeter/LArMonTools/src/LArCoverage.h index 42e364cf4ac..2052300259c 100644 --- a/LArCalorimeter/LArMonTools/src/LArCoverage.h +++ b/LArCalorimeter/LArMonTools/src/LArCoverage.h @@ -32,7 +32,9 @@ #include "EventContainers/SelectAllObject.h" #include "LArCabling/LArCablingService.h" #include "LArRecConditions/ILArBadChannelMasker.h" -#include "LArRecConditions/ILArBadChanTool.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArBadChannelCont.h" + #include <string> #include <map> @@ -88,10 +90,13 @@ class LArCoverage: public ManagedMonitorToolBase ToolHandle<LArCablingService> m_larCablingService; /** Handle to bad-channel tools */ ToolHandle<ILArBadChannelMasker> m_badChannelMask; - ToolHandle<ILArBadChanTool> m_badChannelTool; /** Handle to caloNoiseTool */ ToolHandle < ICaloNoiseTool > m_caloNoiseTool ; + SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey{this, "BadChanKey", "LArBadChannel", "SG bad channels key"}; + SG::ReadCondHandleKey<LArBadFebCont> m_BFKey{this, "MFKey", "LArBadFeb", "SG missing FEBs key"}; + + private: // To retrieve bad channel DB keywords diff --git a/LArCalorimeter/LArMonTools/src/LArFEBMon.cxx b/LArCalorimeter/LArMonTools/src/LArFEBMon.cxx index 9c50a695e97..e36456d6cc2 100755 --- a/LArCalorimeter/LArMonTools/src/LArFEBMon.cxx +++ b/LArCalorimeter/LArMonTools/src/LArFEBMon.cxx @@ -67,7 +67,6 @@ LArFEBMon::LArFEBMon(const std::string& type, declareProperty("IgnoreMissingHeaderEMB",m_ignoreMissingHeaderEMB = false); declareProperty("IgnoreMissingHeaderPS",m_ignoreMissingHeaderPS = false); declareProperty("keyDSPThresholds",m_keyDSPThresholds="LArDSPThresholds"); - declareProperty("LArBadChannelTool",m_badChannelTool); /** Give the name of the streams you want to monitor, if empty, only simple profile per partition (offline case):*/ declareProperty("Streams",m_streams); declareProperty("ExcludeCosmicCalo",m_excoscalo); @@ -137,13 +136,12 @@ StatusCode LArFEBMon::initialize() { m_strHelper = new LArOnlineIDStrHelper(m_onlineHelper); m_strHelper->setDefaultNameType(LArOnlineIDStrHelper::LARONLINEID); - // Get BadChannelTool - sc=m_badChannelTool.retrieve(); + sc=m_BFKey.initialize(); if (sc.isFailure()) { - ATH_MSG_ERROR( "Could not retrieve LArBadChannelTool " << m_badChannelTool ); + ATH_MSG_ERROR( "Could not initialize Missing FEBs key " << m_BFKey.key() ); return StatusCode::FAILURE; } else { - ATH_MSG_DEBUG( "LArBadChannelTool" << m_badChannelTool << " retrieved" ); + ATH_MSG_DEBUG( "Missing FEBs key" << m_BFKey.key() << " initialized" ); } ManagedMonitorToolBase::initialize().ignore(); @@ -1130,11 +1128,17 @@ LArFEBMon::procHistograms() void LArFEBMon::plotMaskedFEB(){ + SG::ReadCondHandle<LArBadFebCont> badFebHdl{m_BFKey}; + const LArBadFebCont* badFebCont=(*badFebHdl); + if(!badFebCont) { + ATH_MSG_WARNING( "Do not have Misisng FEB container, no plots !!!" ); + return; + } // Loop over all FEBs for (std::vector<HWIdentifier>::const_iterator allFeb = m_onlineHelper->feb_begin(); allFeb != m_onlineHelper->feb_end(); ++allFeb) { HWIdentifier febid = HWIdentifier(*allFeb); - const LArBadFeb febStatus = m_badChannelTool->febStatus(febid); + const LArBadFeb febStatus = badFebCont->status(febid); int binContent = 0; if (febStatus.inError() || febStatus.deadReadout() || febStatus.deadAll() || febStatus.deactivatedInOKS()) binContent = 2; if (febStatus.ignoreErrors() > 0) binContent = 1; diff --git a/LArCalorimeter/LArMonTools/src/LArFEBMon.h b/LArCalorimeter/LArMonTools/src/LArFEBMon.h index 75010207c4a..db368e66e64 100755 --- a/LArCalorimeter/LArMonTools/src/LArFEBMon.h +++ b/LArCalorimeter/LArMonTools/src/LArFEBMon.h @@ -10,8 +10,9 @@ #include "AthenaMonitoring/ManagedMonitorToolBase.h" #include "LArIdentifier/LArOnlineID.h" -#include "LArRecConditions/ILArBadChanTool.h" #include "Identifier/HWIdentifier.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArBadChannelCont.h" #include "TrigDecisionTool/TrigDecisionTool.h" @@ -76,7 +77,7 @@ private: // StoreGateSvc* m_storeGate; const LArOnlineID* m_onlineHelper; LArOnlineIDStrHelper* m_strHelper; - ToolHandle<ILArBadChanTool> m_badChannelTool; + SG::ReadCondHandleKey<LArBadFebCont> m_BFKey{this, "MissingFEBKey", "LArBadFeb", "SG key for missing FEBs"}; // trig. decision tool ToolHandle<Trig::TrigDecisionTool> m_trigDec; bool m_trigok; diff --git a/LArCalorimeter/LArTest/LArCalibTest/LArCalibTest/LArCablingChecker.h b/LArCalorimeter/LArTest/LArCalibTest/LArCalibTest/LArCablingChecker.h index f5af1ff6c04..f903353e756 100755 --- a/LArCalorimeter/LArTest/LArCalibTest/LArCalibTest/LArCablingChecker.h +++ b/LArCalorimeter/LArTest/LArCalibTest/LArCalibTest/LArCablingChecker.h @@ -6,11 +6,14 @@ #define LARCABLINGCHECKER #include "AthenaBaseComps/AthAlgorithm.h" #include "LArRawEvent/LArDigitContainer.h" -#include "LArCabling/LArCablingService.h" //#include "CaloIdentifier/LArEM_ID.h" -#include "LArRecConditions/ILArBadChanTool.h" #include "LArIdentifier/LArOnlineID.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArBadChannelCont.h" +#include "LArCabling/LArOnOffIdMapping.h" +#include "LArRecConditions/LArCalibLineMapping.h" + #include <fstream> #include <vector> @@ -28,8 +31,10 @@ class LArCablingChecker : public AthAlgorithm private: int m_count; - LArCablingService *m_larCablingSvc; - ILArBadChanTool *m_caloBadChannelTool; + + SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}; + SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey{this, "BadChanKey", "LArBadChannel", "SG bad channels key"}; + SG::ReadCondHandleKey<LArCalibLineMapping> m_CLKey{this, "CalibLineKey", "LArCalibLineMap", "SG calib line key"}; const LArOnlineID* m_onlineHelper; const LArEM_ID* m_emId; diff --git a/LArCalorimeter/LArTest/LArCalibTest/src/LArCablingChecker.cxx b/LArCalorimeter/LArTest/LArCalibTest/src/LArCablingChecker.cxx index 443bbef409f..3a279f3691b 100755 --- a/LArCalorimeter/LArTest/LArCalibTest/src/LArCablingChecker.cxx +++ b/LArCalorimeter/LArTest/LArCalibTest/src/LArCablingChecker.cxx @@ -7,7 +7,6 @@ #include "CaloIdentifier/CaloIdManager.h" #include "LArRawConditions/LArCalibParams.h" #include "xAODEventInfo/EventInfo.h" -#include "LArRecConditions/ILArBadChanTool.h" #include <algorithm> #include <sstream> #include <iomanip> @@ -15,8 +14,6 @@ LArCablingChecker::LArCablingChecker(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator), //m_chan(0), - m_larCablingSvc(0), - m_caloBadChannelTool(0), m_onlineHelper(0), m_emId(0), m_errorcellsThisEvent(0), @@ -46,16 +43,11 @@ LArCablingChecker::~LArCablingChecker() { StatusCode LArCablingChecker::initialize() { ATH_CHECK( detStore()->retrieve(m_onlineHelper, "LArOnlineID") ); - ATH_CHECK( toolSvc()->retrieveTool("LArCablingService", m_larCablingSvc) ); + ATH_CHECK( m_cablingKey.initialize() ); + ATH_CHECK( m_CLKey.initialize() ); if (m_useBadChannelTool) { - IAlgTool *tool = nullptr; - ATH_CHECK ( toolSvc()->retrieveTool("LArBadChanTool", tool) ); - m_caloBadChannelTool = dynamic_cast<ILArBadChanTool*>(tool); - if (!m_caloBadChannelTool) { - ATH_MSG_ERROR ( "Failed dynamic_cast to ILArBadChanTool*" ); - return StatusCode::FAILURE; - } + ATH_CHECK( m_BCKey.initialize() ); } m_outfile.open(m_outFileName.c_str(), std::ios::out); @@ -97,6 +89,28 @@ StatusCode LArCablingChecker::execute() { const DataHandle<LArCalibParams> calibParams; ATH_CHECK( detStore()->retrieve(calibParams,"LArCalibParams") ); + SG::ReadCondHandle<LArBadChannelCont> readHandle{m_BCKey}; + const LArBadChannelCont *bcCont {*readHandle}; + if(!bcCont) { + ATH_MSG_ERROR( "Do not have Bad chan container " << m_BCKey.key() ); + return StatusCode::FAILURE; + } + + SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{m_cablingKey}; + const LArOnOffIdMapping* cabling=*cablingHdl; + if(!cabling) { + ATH_MSG_ERROR( "Do not have cabling object LArOnOffIdMapping" ); + return StatusCode::FAILURE; + } + + SG::ReadCondHandle<LArCalibLineMapping> clHdl{m_CLKey}; + const LArCalibLineMapping *clCont {*clHdl}; + if(!clCont) { + ATH_MSG_ERROR( "Do not have calib line mapping !!!" ); + return StatusCode::FAILURE; + } + + // Using vectors like this works because the hashes seem to be guaranteed to be collision-free. delete m_errorcellsPreviousEvent; // OK to delete 0, Stroustrup 6.2.6 m_errorcellsPreviousEvent = m_errorcellsThisEvent; @@ -135,7 +149,7 @@ StatusCode LArCablingChecker::execute() { int chNb = m_onlineHelper->channel(online_id); // Check if channel is connected. - if (!m_larCablingSvc->isOnlineConnected(online_id)) { + if (!cabling->isOnlineConnected(online_id)) { disconnected = true; disconnectedCounter++; } else @@ -146,7 +160,7 @@ StatusCode LArCablingChecker::execute() { // Get offline id. bool noOffline_id = false; try { - offline_id = m_larCablingSvc->cnvToIdentifier(online_id); + offline_id = cabling->cnvToIdentifier(online_id); } catch (const LArID_Exception&) { noOffline_id = true; @@ -165,7 +179,7 @@ StatusCode LArCablingChecker::execute() { pulsed = false; int DACvalue = -1; std::ostringstream PulserList; - const std::vector<HWIdentifier>& calibChannelIDs=m_larCablingSvc->calibSlotLine(online_id); + const std::vector<HWIdentifier>& calibChannelIDs=clCont->calibSlotLine(online_id); std::vector<HWIdentifier>::const_iterator csl_it=calibChannelIDs.begin(); std::vector<HWIdentifier>::const_iterator csl_it_e=calibChannelIDs.end(); @@ -203,7 +217,7 @@ StatusCode LArCablingChecker::execute() { // Find out if we have a bad cell. if (m_useBadChannelTool && !noOffline_id) { - if (m_caloBadChannelTool->offlineStatus(offline_id).good()) { + if (bcCont->offlineStatus(offline_id).good()) { badChannel = false; } else { badChannel = true; diff --git a/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetBadChanCorrTool.h b/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetBadChanCorrTool.h index 8b26819b0f1..c4fc7e3434c 100644 --- a/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetBadChanCorrTool.h +++ b/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetBadChanCorrTool.h @@ -45,7 +45,6 @@ class Identifier; class CaloDetDescrManager; class ITileBadChanTool; -class ILArBadChanTool; class ITHistSvc; class JetBadChanCorrTool: public JetModifierBase diff --git a/Reconstruction/Jet/JetRecCalo/CMakeLists.txt b/Reconstruction/Jet/JetRecCalo/CMakeLists.txt index e9c99e144fd..dfd9ec1ce6f 100644 --- a/Reconstruction/Jet/JetRecCalo/CMakeLists.txt +++ b/Reconstruction/Jet/JetRecCalo/CMakeLists.txt @@ -16,11 +16,11 @@ atlas_depends_on_subdirs( Reconstruction/Jet/JetInterface Reconstruction/Jet/JetUtils TileCalorimeter/TileConditions + LArCalorimeter/LArRecConditions PRIVATE Calorimeter/CaloDetDescr Calorimeter/CaloEvent - Control/AthenaKernel - LArCalorimeter/LArRecConditions ) + Control/AthenaKernel ) # Component(s) in the package: atlas_add_library( JetRecCaloLib diff --git a/Reconstruction/Jet/JetRecCalo/JetRecCalo/MissingCellListTool.h b/Reconstruction/Jet/JetRecCalo/JetRecCalo/MissingCellListTool.h index 91725314839..d0a8aa56dc7 100644 --- a/Reconstruction/Jet/JetRecCalo/JetRecCalo/MissingCellListTool.h +++ b/Reconstruction/Jet/JetRecCalo/JetRecCalo/MissingCellListTool.h @@ -35,6 +35,8 @@ //include "CaloEvent/CaloCell.h" #include "CaloIdentifier/CaloCell_ID.h" #include "TileConditions/TileCablingSvc.h" +#include "StoreGate/ReadCondHandleKey.h" +#include "LArRecConditions/LArBadChannelCont.h" #include "JetUtils/TiledEtaPhiMap.h" @@ -47,7 +49,6 @@ class CaloCell; class CaloDetDescrManager; class ITileBadChanTool ; -class ILArBadChanTool; namespace std { template<> @@ -179,7 +180,7 @@ class MissingCellListTool ServiceHandle<TileCablingSvc> m_tileCabling; ToolHandle<ITileBadChanTool> m_tileTool; - ToolHandle<ILArBadChanTool> m_larTool; + SG::ReadCondHandleKey<LArBadChannelCont> m_BCKey{this, "BadChanKey", "LArBadChannel", "SG bad channels key"}; std::string m_missingCellMapName; }; diff --git a/Reconstruction/Jet/JetRecCalo/src/MissingCellListTool.cxx b/Reconstruction/Jet/JetRecCalo/src/MissingCellListTool.cxx index b2006c8753d..56fc61c76ff 100644 --- a/Reconstruction/Jet/JetRecCalo/src/MissingCellListTool.cxx +++ b/Reconstruction/Jet/JetRecCalo/src/MissingCellListTool.cxx @@ -24,7 +24,6 @@ #include "TileConditions/ITileBadChanTool.h" #include "TileConditions/TileBadChanTool.h" -#include "LArRecConditions/ILArBadChanTool.h" @@ -37,8 +36,7 @@ MissingCellListTool::MissingCellListTool(const std::string& name) : asg::AsgTool ( name ), m_tileCabling("TileCablingSvc",name), - m_tileTool("TileBadChanTool"), - m_larTool("LArBadChanTool") + m_tileTool("TileBadChanTool") { //declareInterface<IMissingCellListTool>( this ); @@ -88,7 +86,7 @@ StatusCode MissingCellListTool::initialize() if ( m_addCellFromTool) { CHECK( m_tileTool.retrieve() ); - CHECK( m_larTool.retrieve() ); + ATH_CHECK( m_BCKey.initialize() ); } return StatusCode::SUCCESS; @@ -171,6 +169,12 @@ int MissingCellListTool::execute() const { if(m_addCellFromTool){ const CaloCell_ID* calo_id = m_caloDDM->getCaloCell_ID(); const TileBadChanTool* tileTool = dynamic_cast<const TileBadChanTool*>(m_tileTool.operator->()); + SG::ReadCondHandle<LArBadChannelCont> readHandle{m_BCKey}; + const LArBadChannelCont *bcCont {*readHandle}; + if(!bcCont) { + ATH_MSG_ERROR( "Do not have Bad chan container !!!" ); + return 1; + } std::vector<Identifier>::const_iterator idItr = calo_id->cell_begin(); std::vector<Identifier>::const_iterator idItrE = calo_id->cell_end(); for(; idItr!=idItrE; idItr++){ @@ -181,7 +185,7 @@ int MissingCellListTool::execute() const { CaloBadChannel bc = tileTool->caloStatus(*idItr); insert = (bc.packedData() & m_tileMaskBit) != 0 ; } else { - LArBadChannel bc = m_larTool->offlineStatus(*idItr); + LArBadChannel bc = bcCont->offlineStatus(*idItr); insert = (bc.packedData() & m_larMaskBit) != 0 ; } diff --git a/Reconstruction/egamma/egammaTools/src/egammaOQFlagsBuilder.h b/Reconstruction/egamma/egammaTools/src/egammaOQFlagsBuilder.h index ebd675b9bee..08717f5267d 100644 --- a/Reconstruction/egamma/egammaTools/src/egammaOQFlagsBuilder.h +++ b/Reconstruction/egamma/egammaTools/src/egammaOQFlagsBuilder.h @@ -18,7 +18,6 @@ Most of the informations are given separately for each layer of the EM calorimet #include "egammaBaseTool.h" #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/EventContext.h" -#include "LArRecConditions/ILArBadChanTool.h" #include "LArCabling/LArCablingService.h" #include "CaloIdentifier/LArEM_ID.h" #include "Identifier/HWIdentifier.h" diff --git a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/LArCellCont.cxx b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/LArCellCont.cxx index 1752f2135fa..01450e56d6e 100755 --- a/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/LArCellCont.cxx +++ b/Trigger/TrigAlgorithms/TrigT2CaloCommon/src/LArCellCont.cxx @@ -124,7 +124,7 @@ if(!sc.isSuccess()) //not a critical error. LArCellCont can proceed as usual, wi std::cout << "LArCellCont\t\t INFO \t Failed to retrieve LArBadChannelMasker - no masking will be done." << std::endl; -sc = toolSvc->retrieveTool("LArBadChanTool/MyBadChanTool", m_badChanTool); +sc = toolSvc->retrieveTool("LArBadChanLegacyTool/MyBadChanTool", m_badChanTool); bool toolAvailable = sc.isSuccess(); if(!sc.isSuccess()) //not a critical error. LArCellCont can proceed as usual, without masking. -- GitLab