From 29f3527d14384e92bc778c74967cb45c92d096d6 Mon Sep 17 00:00:00 2001 From: Guillaume Unal <Guillaume.Unal@cern.ch> Date: Thu, 26 Jan 2017 20:25:11 +0100 Subject: [PATCH] change Warning message to Info in LArCellHVCorr (LArCellRec-02-13-15) * src/LArCellHVCorr.cxx change Warning message to Info in case difference of HV correction <0.9 to avoid many warnings after fix for EMECPS HV mapping * tag LArCellRec-02-13-15 23-01-2017 Pavol Strizenec Mpavol @ mail.cern.ch> * merged with branch LArCellRec-02-12-94-branch used during 2016 datataking * tag LArCellRec-02-13-14 * following changes were there: ------------------------------------------------------------ 2016-10-11 Emma Kuwertz <emma.sian.kuwertz@cern.ch> * Tagging LArCellRec-02-12-94-16 2016-10-07 Emma Kuwertz <emma.sian.kuwertz@cern.ch> * Adding MNB FEB list to be configurable in job options 5-08-2016 Pavol Strizenec <pavol @ mail.cern.ch> * fixing typo for IW front wheel FEB exclusion * tag LArCellRec-02-12-94-15 3-08-2016 Pavol Strizenec <pavol @ mail.cern.ch> ... (Long ChangeLog diff - truncated) Former-commit-id: 4177ba0111894ed858b01b9ae6ddd51ac70e3576 --- LArCalorimeter/LArCellRec/CMakeLists.txt | 5 +- .../LArCellRec/LArBadFebMaskingTool.h | 11 +- .../LArCellBuilderFromLArRawChannelTool.h | 4 +- .../LArCellRec/LArCellDeadOTXCorr.h | 8 +- .../LArCellRec/LArCellRec/LArNoisyROTool.h | 14 ++- LArCalorimeter/LArCellRec/cmt/requirements | 3 +- .../LArCellRec/python/LArNoisyROFlags.py | 16 +++ .../python/LArNoisyROSummaryGetter.py | 3 +- .../LArCellRec/src/LArBadFebMaskingTool.cxx | 19 ++- .../src/LArCellBuilderFromLArHitTool.cxx | 26 ++-- .../LArCellBuilderFromLArRawChannelTool.cxx | 114 ++++++------------ .../LArCellRec/src/LArCellDeadOTXCorr.cxx | 21 ++-- .../LArCellRec/src/LArCellEmMiscalib.cxx | 58 +++------ .../LArCellRec/src/LArCellHVCorr.cxx | 24 ++-- .../LArCellRec/src/LArCellMaskingTool.cxx | 10 +- .../LArCellRec/src/LArCellMerger.cxx | 53 ++------ .../LArCellRec/src/LArCellRecalibration.cxx | 17 +-- .../LArCellRec/src/LArCellRescaler.cxx | 14 +-- LArCalorimeter/LArCellRec/src/LArG3Escale.cxx | 16 +-- .../LArCellRec/src/LArG3Escale_TDR.cxx | 16 +-- .../LArCellRec/src/LArNoisyROAlg.cxx | 10 +- .../LArCellRec/src/LArNoisyROTool.cxx | 35 +++--- .../LArCellRec/src/LArNonLinearity.cxx | 70 +++-------- .../LArCellRec/src/LArTimeVetoAlg.cxx | 32 ++--- 24 files changed, 221 insertions(+), 378 deletions(-) diff --git a/LArCalorimeter/LArCellRec/CMakeLists.txt b/LArCalorimeter/LArCellRec/CMakeLists.txt index d52e8eac72fb..fab986413dc2 100644 --- a/LArCalorimeter/LArCellRec/CMakeLists.txt +++ b/LArCalorimeter/LArCellRec/CMakeLists.txt @@ -17,7 +17,6 @@ atlas_depends_on_subdirs( PUBLIC Control/AthAllocators Control/AthenaBaseComps Control/AthenaKernel - Control/CxxUtils Control/StoreGate DetectorDescription/AtlasDetDescr DetectorDescription/Identifier @@ -27,12 +26,12 @@ atlas_depends_on_subdirs( PUBLIC LArCalorimeter/LArRawEvent LArCalorimeter/LArRecConditions LArCalorimeter/LArSimEvent + Event/xAOD/xAODTrigL1Calo PRIVATE Calorimeter/CaloTriggerTool Database/AthenaPOOL/AthenaPoolUtilities DetectorDescription/GeoModel/GeoModelInterfaces Event/xAOD/xAODEventInfo - Event/xAOD/xAODTrigL1Calo Generators/GeneratorObjects LArCalorimeter/LArRecEvent LArCalorimeter/LArCabling @@ -49,7 +48,7 @@ atlas_add_component( LArCellRec src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} CaloConditions CaloDetDescrLib CaloEvent CaloIdentifier CaloRecLib CaloUtilsLib AthAllocators AthenaBaseComps AthenaKernel CxxUtils StoreGateLib SGtests AtlasDetDescr Identifier GaudiKernel LArIdentifier LArRawEvent LArRecConditions LArSimEvent CaloTriggerToolLib AthenaPoolUtilities xAODEventInfo xAODTrigL1Calo GeneratorObjects LArRecEvent LArCablingLib TrigT1CaloCalibConditions ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} CaloConditions CaloDetDescrLib CaloEvent CaloIdentifier CaloRecLib CaloUtilsLib AthAllocators AthenaBaseComps AthenaKernel StoreGateLib SGtests AtlasDetDescr Identifier GaudiKernel LArIdentifier LArRawEvent LArRecConditions LArSimEvent CaloTriggerToolLib AthenaPoolUtilities xAODEventInfo xAODTrigL1Calo GeneratorObjects LArRecEvent LArCablingLib TrigT1CaloCalibConditions ) # Install files from the package: atlas_install_headers( LArCellRec ) diff --git a/LArCalorimeter/LArCellRec/LArCellRec/LArBadFebMaskingTool.h b/LArCalorimeter/LArCellRec/LArCellRec/LArBadFebMaskingTool.h index cab3f7150038..1fa2e45cc537 100755 --- a/LArCalorimeter/LArCellRec/LArCellRec/LArBadFebMaskingTool.h +++ b/LArCalorimeter/LArCellRec/LArCellRec/LArBadFebMaskingTool.h @@ -22,12 +22,14 @@ #include "GaudiKernel/ToolHandle.h" #include "CaloInterface/ICaloCellMakerTool.h" #include "AthenaKernel/IOVSvcDefs.h" +#include "StoreGate/ReadHandleKey.h" class LArCablingService; class StoreGateSvc; class CaloCell_ID; class LArOnlineID; class ILArBadChanTool; +class LArFebErrorSummary; class LArBadFebMaskingTool: public AthAlgTool, virtual public ICaloCellMakerTool @@ -82,10 +84,15 @@ public: bool m_maskCheckSum; bool m_maskMissingHeader; bool m_maskBadGain; - + + /** Minimum number of FEBs in error to trigger EventInfo::LArError + Defined as 1 by default/bulk, 4 in online/express in CaloCellGetter (CaloRec package) + */ + int m_minFebsInError; /** key of larFebErrorSummary in storegate */ - std::string m_larFebErrorSummaryKey; + //std::string m_larFebErrorSummaryKey; + SG::ReadHandleKey<LArFebErrorSummary> m_larFebErrorSummaryKey; /** compute bit mask of errors to mask */ diff --git a/LArCalorimeter/LArCellRec/LArCellRec/LArCellBuilderFromLArRawChannelTool.h b/LArCalorimeter/LArCellRec/LArCellRec/LArCellBuilderFromLArRawChannelTool.h index 21f29748e11b..3c641474f768 100755 --- a/LArCalorimeter/LArCellRec/LArCellRec/LArCellBuilderFromLArRawChannelTool.h +++ b/LArCalorimeter/LArCellRec/LArCellRec/LArCellBuilderFromLArRawChannelTool.h @@ -23,6 +23,7 @@ #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ToolHandle.h" #include "AthenaKernel/IOVSvcDefs.h" +#include "StoreGate/ReadHandleKey.h" #include "CaloInterface/ICaloCellMakerTool.h" #include "Identifier/HWIdentifier.h" @@ -159,7 +160,8 @@ private: // Variables set by jobOptions - std::string m_rawChannelsName; //!< rdo container name (jO) + //std::string m_rawChannelsName; //!< rdo container name (jO) + SG::ReadHandleKey<LArRawChannelContainer> m_rawChannelsKey; //!< rdo container name (jO) bool m_addDeadOTX; //!< activate addition of missing cells from dead OTX int m_initialDataPoolSize; //!< Initial size of DataPool<LArCell> diff --git a/LArCalorimeter/LArCellRec/LArCellRec/LArCellDeadOTXCorr.h b/LArCalorimeter/LArCellRec/LArCellRec/LArCellDeadOTXCorr.h index 5b4669fe372d..c8e4d3d2dcef 100644 --- a/LArCalorimeter/LArCellRec/LArCellRec/LArCellDeadOTXCorr.h +++ b/LArCalorimeter/LArCellRec/LArCellRec/LArCellDeadOTXCorr.h @@ -34,12 +34,13 @@ #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/Property.h" #include "StoreGate/StoreGateSvc.h" +#include "StoreGate/ReadHandleKey.h" #include "CaloInterface/ICaloCellMakerTool.h" #include "AthenaKernel/IOVSvcDefs.h" #include "Identifier/Identifier.h" #include "CaloConditions/Array.h" #include "CaloRec/ToolWithConstantsMixin.h" - +#include "xAODTrigL1Calo/TriggerTowerContainer.h" #include <string> #include <vector> @@ -57,8 +58,6 @@ class CaloIdManager; class L1CaloCondSvc; - - /** * @class LArCellDeadOTXCorr * @brief Tool used to correct energy in missing FEBs @@ -103,7 +102,8 @@ class LArCellDeadOTXCorr : public AthAlgTool, ToolHandle<ILArBadChanTool> m_badChannelTool; ToolHandle<LArCablingService> m_cablingService; - std::string m_TTLocation; + //std::string m_TTLocation; + SG::ReadHandleKey<xAOD::TriggerTowerContainer> m_TTLocation; std::vector<double> m_triggerNoiseCut; bool m_useL1CaloDB; diff --git a/LArCalorimeter/LArCellRec/LArCellRec/LArNoisyROTool.h b/LArCalorimeter/LArCellRec/LArCellRec/LArNoisyROTool.h index 76e957de3a42..c2195f734a1b 100644 --- a/LArCalorimeter/LArCellRec/LArCellRec/LArNoisyROTool.h +++ b/LArCalorimeter/LArCellRec/LArCellRec/LArNoisyROTool.h @@ -15,13 +15,12 @@ #include <string> #include <set> #include <array> +#include <unordered_map> // FrameWork includes #include "AthenaBaseComps/AthAlgTool.h" #include "GaudiKernel/ToolHandle.h" -#include "CxxUtils/unordered_map.h" - #include "CaloInterface/ILArNoisyROTool.h" #include "Identifier/HWIdentifier.h" @@ -107,9 +106,9 @@ class LArNoisyROTool: size_t partitionNumber(const HWIdentifier); - typedef SG::unordered_map<unsigned int, FEBEvtStat> FEBEvtStatMap; - typedef SG::unordered_map<unsigned int, FEBEvtStat>::iterator FEBEvtStatMapIt; - typedef SG::unordered_map<unsigned int, FEBEvtStat>::const_iterator FEBEvtStatMapCstIt; + typedef std::unordered_map<unsigned int, FEBEvtStat> FEBEvtStatMap; + typedef std::unordered_map<unsigned int, FEBEvtStat>::iterator FEBEvtStatMapIt; + typedef std::unordered_map<unsigned int, FEBEvtStat>::const_iterator FEBEvtStatMapCstIt; private: std::string m_CaloCellContainerName; @@ -126,6 +125,9 @@ class LArNoisyROTool: //** ignore masked cells ? */ bool m_ignore_masked_cells; + //** ignore front inner wheel cells ? */ + bool m_ignore_front_innerwheel_cells; + //** number of bad channels to declare a preamp noisy */ unsigned int m_BadChanPerPA; @@ -152,7 +154,7 @@ class LArNoisyROTool: std::set<HWIdentifier> m_knownMNBFEBs; //** count bad FEB for job */ - SG::unordered_map<unsigned int, unsigned int> m_badFEB_counters; + std::unordered_map<unsigned int, unsigned int> m_badFEB_counters; //** count bad PA for job */ std::map<uint64_t, unsigned int> m_badPA_counters; diff --git a/LArCalorimeter/LArCellRec/cmt/requirements b/LArCalorimeter/LArCellRec/cmt/requirements index 399c219734c4..d81ca27b8587 100755 --- a/LArCalorimeter/LArCellRec/cmt/requirements +++ b/LArCalorimeter/LArCellRec/cmt/requirements @@ -8,7 +8,6 @@ use AtlasPolicy AtlasPolicy-* use AthenaKernel AthenaKernel-* Control use StoreGate StoreGate-* Control use AthenaBaseComps AthenaBaseComps-* Control -use CxxUtils CxxUtils-* Control use AthAllocators AthAllocators-* Control use AtlasDetDescr AtlasDetDescr-* DetectorDescription @@ -33,6 +32,7 @@ use LArElecCalib LArElecCalib-* LArCalorimeter use LArRecConditions LArRecConditions-* LArCalorimeter # +use xAODTrigL1Calo xAODTrigL1Calo-* Event/xAOD private use AtlasHepMC AtlasHepMC-* External @@ -49,7 +49,6 @@ use LArCabling LArCabling-* LArCalorimeter # for deadOTX correction using L1 energies (These packages are in AtlasConditions and AtlasEvent) use TrigT1CaloCalibConditions TrigT1CaloCalibConditions-* Trigger/TrigT1 # use TrigT1CaloEvent TrigT1CaloEvent-* Trigger/TrigT1 -use xAODTrigL1Calo xAODTrigL1Calo-* Event/xAOD use TrigT1CaloCondSvc TrigT1CaloCondSvc-* Trigger/TrigT1 end_private diff --git a/LArCalorimeter/LArCellRec/python/LArNoisyROFlags.py b/LArCalorimeter/LArCellRec/python/LArNoisyROFlags.py index b2eb9a1b0126..cf8d30e64620 100644 --- a/LArCalorimeter/LArCellRec/python/LArNoisyROFlags.py +++ b/LArCalorimeter/LArCellRec/python/LArNoisyROFlags.py @@ -25,6 +25,21 @@ class BadFEBCut(JobProperty): StoredValue=5 pass +class KnownMNBFEBs(JobProperty): + #Number of bad febs per partition + statusOn=True + allowedTypes=['list'] + StoredValue=[951255040, # EMBC FT 22 Slot 7 + 953810944, # EMBC FT 27 Slot 5 + 954105856, # EMBC FT 27 Slot 14 + 961052672, # EMBA FT 9 Slot 2 + 961839104, # EMBA FT 10 Slot 10 + 961970176, # EMBA FT 10 Slot 14 + 972980224, # EMBA FT 31 Slot 14 + 961445888 # EMBA FT 9 Slot 14 + ] + pass + class LArNoisyROFlags(JobPropertyContainer): pass @@ -35,5 +50,6 @@ jobproperties.add_Container(LArNoisyROFlags) jobproperties.LArNoisyROFlags.add_JobProperty(CellQualityCut) jobproperties.LArNoisyROFlags.add_JobProperty(BadChanPerFEB) jobproperties.LArNoisyROFlags.add_JobProperty(BadFEBCut) +jobproperties.LArNoisyROFlags.add_JobProperty(KnownMNBFEBs) larNoisyROFlags = jobproperties.LArNoisyROFlags diff --git a/LArCalorimeter/LArCellRec/python/LArNoisyROSummaryGetter.py b/LArCalorimeter/LArCellRec/python/LArNoisyROSummaryGetter.py index f12b0748b176..5d64e3bb0ac7 100755 --- a/LArCalorimeter/LArCellRec/python/LArNoisyROSummaryGetter.py +++ b/LArCalorimeter/LArCellRec/python/LArNoisyROSummaryGetter.py @@ -41,7 +41,8 @@ class LArNoisyROSummaryGetter ( Configured ) : theLArNoisyROTool=LArNoisyROTool(PrintSummary=True, CellQualityCut=larNoisyROFlags.CellQualityCut(), BadChanPerFEB=larNoisyROFlags.BadChanPerFEB(), - BadFEBCut=larNoisyROFlags.BadFEBCut() + BadFEBCut=larNoisyROFlags.BadFEBCut(), + KnownMNBFEBs=larNoisyROFlags.KnownMNBFEBs() ) diff --git a/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.cxx b/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.cxx index c85a5887f876..417fc04c6924 100755 --- a/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.cxx +++ b/LArCalorimeter/LArCellRec/src/LArBadFebMaskingTool.cxx @@ -50,7 +50,7 @@ LArBadFebMaskingTool::LArBadFebMaskingTool( m_badChannelTool(""),m_maskParity(true),m_maskSampleHeader(true),m_maskEVTID(true),m_maskScacStatus(true), m_maskScaOutOfRange(true),m_maskGainMismatch(true),m_maskTypeMismatch(true),m_maskNumOfSamples(true), m_maskEmptyDataBlock(true),m_maskDspBlockSize(true),m_maskCheckSum(true),m_maskMissingHeader(true), - m_maskBadGain(true), + m_maskBadGain(true),m_minFebsInError(1), m_larFebErrorSummaryKey("LArFebErrorSummary"), m_errorToMask(0), m_calo_id(nullptr), @@ -74,6 +74,7 @@ LArBadFebMaskingTool::LArBadFebMaskingTool( declareProperty("maskCheckSum",m_maskCheckSum); declareProperty("maskMissingHeader",m_maskMissingHeader); declareProperty("maskBadGain",m_maskBadGain); + declareProperty("minFebInError",m_minFebsInError); // Minimum number of FEBs in error to trigger EventInfo::LArError (1 by default/bulk, 4 in online/express). declareProperty("larFebErrorSummaryKey",m_larFebErrorSummaryKey); } @@ -114,6 +115,9 @@ StatusCode LArBadFebMaskingTool::initialize() return sc; } + // initialize read handle key + ATH_CHECK(m_larFebErrorSummaryKey.initialize()); + // dummy parameters for the callback: int dummyInt=0; std::list<std::string> dummyList; @@ -172,9 +176,10 @@ StatusCode LArBadFebMaskingTool::process(CaloCellContainer * theCont ) ATH_MSG_DEBUG (" in LArBadFebMaskingTool::process "); - const LArFebErrorSummary* larFebErrorSummary; - StatusCode sc = evtStore()->retrieve(larFebErrorSummary,m_larFebErrorSummaryKey); - if (sc.isFailure()) { + //const LArFebErrorSummary* larFebErrorSummary; + //StatusCode sc = evtStore()->retrieve(larFebErrorSummary,m_larFebErrorSummaryKey); + SG::ReadHandle<LArFebErrorSummary>larFebErrorSummary(m_larFebErrorSummaryKey); + if (!larFebErrorSummary.isValid()) { ATH_MSG_WARNING (" cannot retrieve Feb error summary. Skip LArBadFebMaskingTool::process "); return StatusCode::SUCCESS; } @@ -186,7 +191,7 @@ StatusCode LArBadFebMaskingTool::process(CaloCellContainer * theCont ) // retrieve EventInfo const EventInfo* eventInfo_c=0; - sc = evtStore()->retrieve(eventInfo_c); + StatusCode sc = evtStore()->retrieve(eventInfo_c); if (sc.isFailure()) { ATH_MSG_WARNING (" cannot retrieve EventInfo, will not set LAr bit information "); } @@ -196,6 +201,7 @@ StatusCode LArBadFebMaskingTool::process(CaloCellContainer * theCont ) } bool flagBadEvent = false; // flag bad event = Feb error not known in database + int nbOfFebsInError = 0; // catch cases of empty LAR container => severe problem in decoding => flag event as in ERROR unsigned int nLar = theCont->nCellsCalo(CaloCell_ID::LAREM)+theCont->nCellsCalo(CaloCell_ID::LARHEC)+theCont->nCellsCalo(CaloCell_ID::LARFCAL); @@ -235,7 +241,7 @@ StatusCode LArBadFebMaskingTool::process(CaloCellContainer * theCont ) ATH_MSG_DEBUG (" inError, isDead " << inError << " " << isDead); } - if (toMask1 && !inError && !isDead) flagBadEvent=true; + if (toMask1 && !inError && !isDead) nbOfFebsInError = nbOfFebsInError + 1; if (toMask1 || inError) { m_mask++; @@ -268,6 +274,7 @@ StatusCode LArBadFebMaskingTool::process(CaloCellContainer * theCont ) } // loop over Febs in error + if (nbOfFebsInError >= m_minFebsInError) flagBadEvent=true; if (eventInfo && flagBadEvent) { ATH_MSG_DEBUG (" set error bit for LAr for this event "); diff --git a/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArHitTool.cxx b/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArHitTool.cxx index cfe34872e55a..c7e958ba32d4 100755 --- a/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArHitTool.cxx +++ b/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArHitTool.cxx @@ -29,15 +29,9 @@ #include "AthenaKernel/IAtRndmGenSvc.h" -#include "GaudiKernel/ISvcLocator.h" -#include "GaudiKernel/StatusCode.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/INTupleSvc.h" -#include "GaudiKernel/IToolSvc.h" -#include "GaudiKernel/ListItem.h" - #include "StoreGate/StoreGateSvc.h" #include "CLHEP/Units/SystemOfUnits.h" +#include "GaudiKernel/ListItem.h" using CLHEP::HepRandomEngine; @@ -452,7 +446,7 @@ StatusCode LArCellBuilderFromLArHitTool::process( CaloCellContainer * theCellCon //FIXME //log << MSG::DEBUG << " Hit : " << m_atlas_id->show_to_string(id) - // << " energy " << e << endreq ; + // << " energy " << e << endmsg ; // WITH MAP if( m_WithMap ) @@ -485,7 +479,7 @@ StatusCode LArCellBuilderFromLArHitTool::process( CaloCellContainer * theCellCon e/= m_dd_fSampl->FSAMPL(id); //FIXME - // log << MSG::DEBUG << " .. new e " << e << endreq ; + // log << MSG::DEBUG << " .. new e " << e << endmsg ; const double t = hit->time(); const double q = 1. ; @@ -533,7 +527,7 @@ StatusCode LArCellBuilderFromLArHitTool::process( CaloCellContainer * theCellCon ++index; if (*it==0) { //log << MSG::WARNING << " hole in permanent collection " - // << index << endreq ; + // << index << endmsg ; continue; } @@ -719,7 +713,7 @@ StatusCode LArCellBuilderFromLArHitTool::initializeCellPermamentCollection() //check if no hole if (caloDDE==0) { // log << MSG::WARNING << "hole detected calo num " - // << m_caloType << " index " << index << endreq ; + // << m_caloType << " index " << index << endmsg ; ++nHole; continue; } @@ -775,7 +769,7 @@ StatusCode LArCellBuilderFromLArHitTool::initializeCellPermamentCollection() for (unsigned int i=0;i<m_cellPermanentCollection.size();++i){ if (m_cellPermanentCollection[i]==0) { //log << MSG::WARNING - //<< " one element missing in m_cellPermanentCollection " << i << endreq; + //<< " one element missing in m_cellPermanentCollection " << i << endmsg; ++nFailed; } } @@ -871,10 +865,10 @@ StatusCode LArCellBuilderFromLArHitTool::defineWindow() if (msgSvc()->outputLevel() <= MSG::DEBUG) { for(unsigned int iPart=0;iPart<m_etaPart.size();++iPart) { - log << MSG::DEBUG << " Selected window" - << m_etaPart[iPart] << " phi=" << m_phiPart[iPart] - << " deta=" << m_WindowsEtaSize << " dphi="<< m_WindowsPhiSize - << endreq ; + ATH_MSG_DEBUG( " Selected window" + << m_etaPart[iPart] << " phi=" << m_phiPart[iPart] + << " deta=" << m_WindowsEtaSize << " dphi="<< m_WindowsPhiSize + ); } } diff --git a/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArRawChannelTool.cxx b/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArRawChannelTool.cxx index f1ce3a9841c6..18883886508e 100755 --- a/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArRawChannelTool.cxx +++ b/LArCalorimeter/LArCellRec/src/LArCellBuilderFromLArRawChannelTool.cxx @@ -22,6 +22,8 @@ #include "CaloDetDescr/CaloDetDescriptor.h" #include "GeoModelInterfaces/IGeoModelSvc.h" +#include "StoreGate/ReadHandle.h" + #include "LArRecConditions/ILArBadChanTool.h" #include "LArRecConditions/LArBadFeb.h" @@ -33,7 +35,7 @@ LArCellBuilderFromLArRawChannelTool::LArCellBuilderFromLArRawChannelTool( const std::string& name, const IInterface* parent) :AthAlgTool(type, name, parent), - m_rawChannelsName("LArRawChannels"), + m_rawChannelsKey("LArRawChannels"), m_addDeadOTX(true), m_initialDataPoolSize(-1), m_nTotalCells(0), @@ -46,7 +48,7 @@ LArCellBuilderFromLArRawChannelTool::LArCellBuilderFromLArRawChannelTool( { declareInterface<ICaloCellMakerTool>(this); //key of input raw channel - declareProperty("RawChannelsName",m_rawChannelsName,"Name of input container"); + declareProperty("RawChannelsName",m_rawChannelsKey,"Name of input container"); // bad channel tool declareProperty("badChannelTool",m_badChannelTool,"Bad Channel Tool to provide list of missing FEBs"); // activate creation of cells from missing Febs @@ -63,11 +65,9 @@ LArCellBuilderFromLArRawChannelTool::~LArCellBuilderFromLArRawChannelTool() { StatusCode LArCellBuilderFromLArRawChannelTool::initialize() { const IGeoModelSvc *geoModel=0; - StatusCode sc = service("GeoModelSvc", geoModel); - if(sc.isFailure()) { - msg(MSG::ERROR) << "Could not locate GeoModelSvc" << endreq; - return sc; - } + ATH_CHECK( service("GeoModelSvc", geoModel) ); + + ATH_CHECK(m_rawChannelsKey.initialize()); // dummy parameters for the callback: int dummyInt=0; @@ -77,14 +77,10 @@ StatusCode LArCellBuilderFromLArRawChannelTool::initialize() { return geoInit(dummyInt,dummyList); } else{ - sc = detStore()->regFcn(&IGeoModelSvc::geoInit, geoModel, - &LArCellBuilderFromLArRawChannelTool::geoInit,this); - if(sc.isFailure()) { - msg(MSG::ERROR) << "Could not register geoInit callback" << endreq; - return sc; - } + ATH_CHECK( detStore()->regFcn(&IGeoModelSvc::geoInit, geoModel, + &LArCellBuilderFromLArRawChannelTool::geoInit,this) ); } - return sc; + return StatusCode::SUCCESS; } StatusCode @@ -95,50 +91,27 @@ LArCellBuilderFromLArRawChannelTool::geoInit(IOVSVC_CALLBACK_ARGS) { ATH_MSG_DEBUG("Accesssing CaloCellID"); m_caloCID = m_caloDDM->getCaloCell_ID(); - // get LArCablingService - StatusCode sc=m_cablingSvc.retrieve(); - if (sc.isFailure()) { - msg(MSG::ERROR) << "Unable to retrieve LArCablingService" << endreq; - return StatusCode::FAILURE; - } - - // retrieve OnlineID helper from detStore - sc = detStore()->retrieve(m_onlineID, "LArOnlineID"); - if (sc.isFailure()) { - msg(MSG::ERROR) << "ould not get LArOnlineID helper !" << endreq ; - return StatusCode::FAILURE; - } + ATH_CHECK( m_cablingSvc.retrieve() ); + ATH_CHECK( detStore()->retrieve(m_onlineID, "LArOnlineID") ); if (!m_badChannelTool.empty()) { - sc = m_badChannelTool.retrieve(); - if (sc.isFailure()) { - msg(MSG::ERROR) << "Could not retrieve bad channel tool " << endreq; - return sc; - } + ATH_CHECK( m_badChannelTool.retrieve() ); } else { if (m_addDeadOTX) { - msg(MSG::ERROR) << "Configuration problem: 'addDeadOTX' set, but no bad-channel tool given." << endreq; + ATH_MSG_ERROR( "Configuration problem: 'addDeadOTX' set, but no bad-channel tool given." ); return StatusCode::FAILURE; } } - sc = detStore()->regFcn(&LArCablingService::iovCallBack,&(*m_cablingSvc), - &LArCellBuilderFromLArRawChannelTool::cablingSvc_CB, - this,true) ; - if (sc.isFailure()) { - msg(MSG::ERROR) << "could not register callback on LArCablingSvc!" << endreq ; - return StatusCode::FAILURE; - } + ATH_CHECK( detStore()->regFcn(&LArCablingService::iovCallBack,&(*m_cablingSvc), + &LArCellBuilderFromLArRawChannelTool::cablingSvc_CB, + this,true) ); if (m_addDeadOTX) { - sc = detStore()->regFcn(&ILArBadChanTool::updateBadFebsFromDB,&(*m_badChannelTool), - &LArCellBuilderFromLArRawChannelTool::missingFEB_CB, - this,true); - if (sc.isFailure()) { - msg(MSG::ERROR) << "could not register callback on ILArBadChan Tool" << endreq; - return sc; - } + ATH_CHECK( detStore()->regFcn(&ILArBadChanTool::updateBadFebsFromDB,&(*m_badChannelTool), + &LArCellBuilderFromLArRawChannelTool::missingFEB_CB, + this,true) ); } //Compute total number of cells @@ -158,7 +131,7 @@ LArCellBuilderFromLArRawChannelTool::geoInit(IOVSVC_CALLBACK_ARGS) { ATH_MSG_DEBUG("Initial size of DataPool<LArCell>: " << m_initialDataPoolSize); ATH_MSG_DEBUG("Initialisating finished"); - return sc; + return StatusCode::SUCCESS; } @@ -166,34 +139,27 @@ LArCellBuilderFromLArRawChannelTool::geoInit(IOVSVC_CALLBACK_ARGS) { // ========================================================================================== // StatusCode LArCellBuilderFromLArRawChannelTool::process(CaloCellContainer * theCellContainer) { -#ifndef ATHENAHIVE if (theCellContainer->ownPolicy() == SG::OWN_ELEMENTS) { - msg(MSG::ERROR) << "Called with a CaloCellContainer with wrong ownership policy! Need a VIEW container!" << endreq; -#else - if (theCellContainer->ownPolicy() != SG::OWN_ELEMENTS) { - msg(MSG::ERROR) << "Called with a CaloCellContainer with wrong ownership policy! Need a OWN container!" << endreq; -#endif + ATH_MSG_ERROR( "Called with a CaloCellContainer with wrong ownership policy! Need a VIEW container!" ); return StatusCode::FAILURE; } - // Get the raw Channel Container - const LArRawChannelContainer* rawColl; - StatusCode sc = evtStore()->retrieve(rawColl, m_rawChannelsName ) ; - if(sc.isFailure() || !rawColl) { - msg(MSG::ERROR) << " Can not retrieve LArRawChannelContainer: " - << m_rawChannelsName<<endreq; + SG::ReadHandle<LArRawChannelContainer> rawColl(m_rawChannelsKey); + if(!rawColl.isValid()) { + ATH_MSG_ERROR( " Can not retrieve LArRawChannelContainer: " + << m_rawChannelsKey.key() ); return StatusCode::FAILURE; } const size_t nRawChannels=rawColl->size(); if (nRawChannels==0) { - msg(MSG::WARNING) << "Got empty LArRawChannel container. Do nothing" << endreq; + ATH_MSG_WARNING( "Got empty LArRawChannel container. Do nothing" ); return StatusCode::SUCCESS; } else ATH_MSG_DEBUG("Got " << nRawChannels << " LArRawChannels"); - return fillCompleteCellCont(rawColl,theCellContainer); + return fillCompleteCellCont(rawColl.ptr(),theCellContainer); } // ========================================================================================== // @@ -203,7 +169,7 @@ StatusCode LArCellBuilderFromLArRawChannelTool::fillCompleteCellCont(const LArRa std::bitset<CaloCell_ID::NSUBCALO> includedSubcalos; // resize calo cell container to correct size if (theCellContainer->size()) { - msg(MSG::ERROR) << "filleCellCont: container should be empty! Clear now." << endreq; + ATH_MSG_ERROR( "filleCellCont: container should be empty! Clear now." ); theCellContainer->clear(); } @@ -217,9 +183,9 @@ StatusCode LArCellBuilderFromLArRawChannelTool::fillCompleteCellCont(const LArRa LArCell* larcell=getCell(*itrRawChannel,hashid,pool); if (larcell) { if ((*theCellContainer)[hashid]) { - msg(MSG::WARNING) << "Channel added twice! Data corruption? hash=" << hashid - << " online ID=0x" << std::hex << itrRawChannel->channelID().get_compact() - << " " << m_onlineID->channel_name(itrRawChannel->channelID()) << endreq; + ATH_MSG_WARNING( "Channel added twice! Data corruption? hash=" << hashid + << " online ID=0x" << std::hex << itrRawChannel->channelID().get_compact() + << " " << m_onlineID->channel_name(itrRawChannel->channelID()) ); } else { (*theCellContainer)[hashid]=larcell; @@ -257,8 +223,8 @@ StatusCode LArCellBuilderFromLArRawChannelTool::fillCompleteCellCont(const LArRa } if (nMissingButPresent) - msg(MSG::WARNING) << "A total of " << nMissingButPresent - << " supposedly missing channels where present in the LArRawChannelContainer" << endreq; + ATH_MSG_WARNING( "A total of " << nMissingButPresent + << " supposedly missing channels where present in the LArRawChannelContainer" ); if (nCellsAdded!=m_nTotalCells) { ATH_MSG_DEBUG("Filled only " << nCellsAdded << " out of " << m_nTotalCells << " cells. Now search for holes.."); @@ -303,11 +269,7 @@ LArCellBuilderFromLArRawChannelTool::getCell(const LArRawChannel& theRawChannel, const uint16_t provenance = (theRawChannel.provenance() & 0x3FFF); // to be sure not to set by error "dead" bit const CaloGain::CaloGain gain = theRawChannel.gain(); -#ifndef ATHENAHIVE LArCell *pCell = pool.nextElementPtr(); -#else - LArCell *pCell = new LArCell(); -#endif *pCell = LArCell (theDDE, theDDE->identify(), energy, @@ -336,7 +298,7 @@ StatusCode LArCellBuilderFromLArRawChannelTool::caloDDEsInitialize() const CaloDetDescriptor * caloDDD = caloDDE->descriptor(); if (caloDDD==0) { - msg(MSG::ERROR) << " caloDDE does not have a descriptor " << endreq; + ATH_MSG_ERROR( " caloDDE does not have a descriptor " ); continue ; } @@ -351,14 +313,14 @@ StatusCode LArCellBuilderFromLArRawChannelTool::caloDDEsInitialize() StatusCode LArCellBuilderFromLArRawChannelTool::cablingSvc_CB(IOVSVC_CALLBACK_ARGS) { - msg(MSG::INFO) << "Callback on LArCablingSvc. Now initialize CaloDDE" << endreq; + ATH_MSG_INFO( "Callback on LArCablingSvc. Now initialize CaloDDE" ); return caloDDEsInitialize() ; } StatusCode LArCellBuilderFromLArRawChannelTool::missingFEB_CB(IOVSVC_CALLBACK_ARGS) { - msg(MSG::INFO) << "Callback from ILArBadChanTool. " << endreq; + ATH_MSG_INFO( "Callback from ILArBadChanTool. " ); m_deadFEBChannels.clear(); const uint16_t provenance = 0x0A00; // 0x0800 (dead) + 0x0200 (to indicate missing readout) @@ -384,7 +346,7 @@ StatusCode LArCellBuilderFromLArRawChannelTool::missingFEB_CB(IOVSVC_CALLBACK_AR }//end loop over feb-channels }//end if febStatus }//end loop over bad febs - msg(MSG::INFO) << "Set up " << m_deadFEBChannels.size() << " dummy LArRawChannels for " << m_nDeadFEBs << " dead FEBs" << endreq; + ATH_MSG_INFO( "Set up " << m_deadFEBChannels.size() << " dummy LArRawChannels for " << m_nDeadFEBs << " dead FEBs" ); return StatusCode::SUCCESS; } diff --git a/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.cxx b/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.cxx index 6c31c7d3c4c7..d81241a5ad9d 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.cxx +++ b/LArCalorimeter/LArCellRec/src/LArCellDeadOTXCorr.cxx @@ -33,15 +33,11 @@ #include "LArCellRec/LArCellDeadOTXCorr.h" //Needs to be changed to correct package -#include "GaudiKernel/ISvcLocator.h" -#include "GaudiKernel/ListItem.h" -#include "GaudiKernel/StatusCode.h" - #include "CLHEP/Units/SystemOfUnits.h" #include "StoreGate/StoreGateSvc.h" #include "StoreGate/DataHandle.h" - +#include "StoreGate/ReadHandle.h" #include "Identifier/IdentifierHash.h" @@ -197,6 +193,8 @@ StatusCode LArCellDeadOTXCorr::initialize() const IGeoModelSvc *geoModel=0; ATH_CHECK( service("GeoModelSvc", geoModel) ); + ATH_CHECK(m_TTLocation.initialize()); + if(m_useL1CaloDB) { ATH_MSG_INFO ("L1Calo database will be used to get the pedestal values."); @@ -254,9 +252,9 @@ StatusCode LArCellDeadOTXCorr::geoInit(IOVSVC_CALLBACK_ARGS) IAlgTool *algtool; sc = toolSvc->retrieveTool("L1CaloTTIdTools", algtool); - mLog<<MSG::DEBUG<<"L1CaloTTIdTools retrieved"<<endreq; + ATH_MSG_DEBUG("L1CaloTTIdTools retrieved" ); if (sc!=StatusCode::SUCCESS) { - mLog << MSG::WARNING << " Cannot get L1CaloTTIdTools !" << endreq; + ATH_MSG_WARNING( " Cannot get L1CaloTTIdTools !" ); // m_bTTMapInitialized = false; } m_l1CaloTTIdTools = dynamic_cast<L1CaloTTIdTools*> (algtool); @@ -282,8 +280,13 @@ StatusCode LArCellDeadOTXCorr::process(CaloCellContainer * cellCont ){ //Retrieve Trigger Towers from SG //const TriggerTowerCollection* storedTTs = 0; - const xAOD::TriggerTowerContainer* storedTTs = 0; - ATH_CHECK( evtStore()->retrieve(storedTTs, m_TTLocation) ); + //const xAOD::TriggerTowerContainer* storedTTs = 0; + SG::ReadHandle<xAOD::TriggerTowerContainer> storedTTs(m_TTLocation); + if(!storedTTs.isValid()) { + ATH_MSG_ERROR("Could not read container " << m_TTLocation.key()); + return StatusCode::FAILURE; + } + bool getDBPedestal = m_useL1CaloDB; L1CaloPprLutContainer* l1CaloPprLutContainer = 0; diff --git a/LArCalorimeter/LArCellRec/src/LArCellEmMiscalib.cxx b/LArCalorimeter/LArCellRec/src/LArCellEmMiscalib.cxx index 3da0c78d1021..6c0523603f9c 100755 --- a/LArCalorimeter/LArCellRec/src/LArCellEmMiscalib.cxx +++ b/LArCalorimeter/LArCellRec/src/LArCellEmMiscalib.cxx @@ -15,13 +15,6 @@ PURPOSE: applies miscalibration in EM calorimeter ********************************************************************/ #include "LArCellRec/LArCellEmMiscalib.h" - -#include "GaudiKernel/Service.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/Property.h" -#include "GaudiKernel/ListItem.h" - - #include "CaloEvent/CaloCellContainer.h" #include "CaloIdentifier/CaloIdManager.h" #include "CaloIdentifier/CaloCell_ID.h" @@ -69,12 +62,7 @@ LArCellEmMiscalib::LArCellEmMiscalib( StatusCode LArCellEmMiscalib::initialize() { const IGeoModelSvc *geoModel=0; - StatusCode sc = service("GeoModelSvc", geoModel); - if(sc.isFailure()) - { - msg(MSG::ERROR) << "Could not locate GeoModelSvc" << endreq; - return sc; - } + ATH_CHECK( service("GeoModelSvc", geoModel) ); // dummy parameters for the callback: int dummyInt=0; @@ -86,41 +74,23 @@ StatusCode LArCellEmMiscalib::initialize() } else { - sc = detStore()->regFcn(&IGeoModelSvc::geoInit, - geoModel, - &LArCellEmMiscalib::geoInit,this); - if(sc.isFailure()) - { - msg(MSG::ERROR) << "Could not register geoInit callback" << endreq; - return sc; - } + ATH_CHECK( detStore()->regFcn(&IGeoModelSvc::geoInit, + geoModel, + &LArCellEmMiscalib::geoInit,this) ); } - return sc; + return StatusCode::SUCCESS; } StatusCode LArCellEmMiscalib::geoInit(IOVSVC_CALLBACK_ARGS) { - msg(MSG::INFO) << " in LArCellEmMiscalib::geoInit()" << endreq; + ATH_MSG_INFO( " in LArCellEmMiscalib::geoInit()" ); - StatusCode sc = detStore()->retrieve( m_caloIdMgr ); - if (sc.isFailure()) { - msg(MSG::ERROR) << "Unable to retrieve CaloIdMgr " << endreq; - return sc; - } - - sc = detStore()->retrieve(m_calodetdescrmgr); - if (sc.isFailure()) { - msg(MSG::ERROR) << "Unable to retrieve CaloDetDescrMgr " << endreq; - return sc; - } + ATH_CHECK( detStore()->retrieve( m_caloIdMgr ) ); + ATH_CHECK( detStore()->retrieve(m_calodetdescrmgr) ); static const bool CREATEIFNOTTHERE(true); - sc = service("AtRndmGenSvc", m_AtRndmGenSvc, CREATEIFNOTTHERE); - if (!sc.isSuccess() || 0 == m_AtRndmGenSvc) { - msg(MSG::ERROR) << "Unable to initialize AtRndmGenSvc" << endreq; - return sc; - } + ATH_CHECK( service("AtRndmGenSvc", m_AtRndmGenSvc, CREATEIFNOTTHERE) ); m_engine = m_AtRndmGenSvc->setOnDefinedSeeds(m_seed,this->name()); @@ -160,7 +130,7 @@ LArCellEmMiscalib::geoInit(IOVSVC_CALLBACK_ARGS) ATH_MSG_VERBOSE(" m_calib " << m_calib[idHash]); } else { - msg(MSG::WARNING) << " Cannot find region for cell " << eta << " " << phi << endreq; + ATH_MSG_WARNING( " Cannot find region for cell " << eta << " " << phi ); m_calib[idHash]=1.; } } @@ -208,8 +178,8 @@ void LArCellEmMiscalib::smearingPerRegion() } iphi=ii%16; ieta=ii/16; - msg(MSG::DEBUG) << "iregion,barrelec,ieta,iphi,spread " << iregion << " " - << barrelec << " " << ieta << " " << iphi << " " << m_spread1[i] << endreq; + ATH_MSG_DEBUG( "iregion,barrelec,ieta,iphi,spread " << iregion << " " + << barrelec << " " << ieta << " " << iphi << " " << m_spread1[i] ); } }//end if msg_lvl(DEBUG) @@ -281,8 +251,8 @@ void LArCellEmMiscalib::MakeCorrection(CaloCell * theCell ) } else { - msg(MSG::WARNING) << "Inconsistent hash value found " << idHash - << " >= " << m_ncellem << endreq ; + ATH_MSG_WARNING( "Inconsistent hash value found " << idHash + << " >= " << m_ncellem ); } // if (m_larem_id->phi(id)==0) // std::cout << "Barrel_ec,sampl.region,eta,wt " << m_larem_id->barrel_ec(id) << diff --git a/LArCalorimeter/LArCellRec/src/LArCellHVCorr.cxx b/LArCalorimeter/LArCellRec/src/LArCellHVCorr.cxx index 370c6c4bcf9c..aeebf97cface 100755 --- a/LArCalorimeter/LArCellRec/src/LArCellHVCorr.cxx +++ b/LArCalorimeter/LArCellRec/src/LArCellHVCorr.cxx @@ -3,10 +3,7 @@ */ #include "LArCellRec/LArCellHVCorr.h" -//#include "GaudiKernel/MsgStream.h" -//#include "StoreGate/StoreGateSvc.h" #include "CaloEvent/CaloCell.h" -//#include "LArRecUtils/LArHVCorrTool.h" LArCellHVCorr::LArCellHVCorr (const std::string& type, @@ -52,27 +49,23 @@ StatusCode LArCellHVCorr::queryInterface( const InterfaceID& riid, void** ppvIf StatusCode LArCellHVCorr::initialize() { - StatusCode sc = m_hvCorrTool.retrieve(); - if (sc.isFailure()) { - msg(MSG::ERROR) << "Unable to find tool for LArHVCorrTool" << endreq; - return StatusCode::FAILURE; - } + ATH_CHECK( m_hvCorrTool.retrieve() ); // if (m_undoHVonline) { // sc = detStore()->regHandle(m_dd_HVScaleCorr,m_keyHVScaleCorr); // if (sc.isFailure()) { - // msg(MSG::ERROR) << "Unable to register handle to HVScaleCorr " << endreq; + // msg(MSG::ERROR) << "Unable to register handle to HVScaleCorr " << endmsg; // return StatusCode::FAILURE; // } // } ATH_CHECK(detStore()->regFcn(&ILArHVCorrTool::LoadCalibration,&(*m_hvCorrTool),&ILArCellHVCorrTool::LoadCalibration,(ILArCellHVCorrTool*)this)); - msg(MSG::INFO) << "Registered callback on ILArHVCorrTool" << endreq; + ATH_MSG_INFO( "Registered callback on ILArHVCorrTool" ); ATH_CHECK(detStore()->regFcn(&LArCellHVCorr::LoadCalibration,this,m_dd_HVScaleCorr,m_keyHVScaleCorr)); - msg(MSG::INFO) << "Registered callback on DataHandle<ILArHVScaleCorr>" << endreq; + ATH_MSG_INFO( "Registered callback on DataHandle<ILArHVScaleCorr>" ); return StatusCode::SUCCESS; } @@ -80,10 +73,10 @@ StatusCode LArCellHVCorr::initialize() { StatusCode LArCellHVCorr::LoadCalibration(IOVSVC_CALLBACK_ARGS) { //Dummy callback method to forward callback on HV update to CaloNoiseTool - msg(MSG::DEBUG) << "LArCellHVCorr::LoadCalibration callback invoked" << endreq; + ATH_MSG_DEBUG( "LArCellHVCorr::LoadCalibration callback invoked" ); m_updateOnLastCallback=m_hvCorrTool->updateOnLastCallback(); if (!m_updateOnLastCallback) - msg(MSG::DEBUG) << "No real HV change, chaches remain valid" << endreq; + ATH_MSG_DEBUG( "No real HV change, chaches remain valid" ); return StatusCode::SUCCESS; } @@ -96,8 +89,9 @@ float LArCellHVCorr::getCorrection(const Identifier id) { if (hvonline>0. && hvonline<100.) hvcorr = hvcorr/hvonline; } - if (hvcorr<0.9) { - msg(MSG::WARNING) << "HV corr for cell with id " << id.get_identifier32().get_compact() << " = " << hvcorr << endreq; + if (hvcorr<0.9 ) { + if (hvcorr<0.4) ATH_MSG_WARNING( "HV corr for cell with id " << id.get_identifier32().get_compact() << " = " << hvcorr ); + else ATH_MSG_INFO( "HV corr for cell with id " << id.get_identifier32().get_compact() << " = " << hvcorr ); } diff --git a/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.cxx b/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.cxx index 98c83b8982ae..ca4b2c9dc48c 100644 --- a/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.cxx +++ b/LArCalorimeter/LArCellRec/src/LArCellMaskingTool.cxx @@ -10,14 +10,8 @@ PACKAGE: offline/Calorimeter/CaloRec ********************************************************************/ #include "LArCellRec/LArCellMaskingTool.h" - -#include "GaudiKernel/Service.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/Property.h" #include "StoreGate/StoreGateSvc.h" - #include "CaloEvent/CaloCellContainer.h" - #include "LArCabling/LArCablingService.h" @@ -64,7 +58,7 @@ StatusCode LArCellMaskingTool::initialize() ATH_MSG_DEBUG ("CaloCell Hash Max: " << m_offlinehashMax); // m_onlinehashMax=m_onlineID->hash_max(); -// (*m_log) << MSG::DEBUG << "CaloCell Hash Max: " << m_offlinehashMax << endreq; +// (*m_log) << MSG::DEBUG << "CaloCell Hash Max: " << m_offlinehashMax << endmsg; //Fill the bit map m_includedCellsMap.set(); // By default include all cells @@ -120,7 +114,7 @@ StatusCode LArCellMaskingTool::fillIncludedCellsMap() { if (haveFT) msg() << " FT=" << FT; if (haveSlot) msg() << " slot=" << slot; if (haveChannel) msg() << " channel=" << channel; - msg() << endreq; + msg() << endmsg; unsigned nOnlExceptions=0; unsigned nOfflExceptions=0; diff --git a/LArCalorimeter/LArCellRec/src/LArCellMerger.cxx b/LArCalorimeter/LArCellRec/src/LArCellMerger.cxx index 087c375a3a19..c76e75b9c139 100755 --- a/LArCalorimeter/LArCellRec/src/LArCellMerger.cxx +++ b/LArCalorimeter/LArCellRec/src/LArCellMerger.cxx @@ -58,12 +58,7 @@ StatusCode LArCellMerger::initialize() // callback to GeoModel to retrieve identifier helpers, etc.. const IGeoModelSvc *geoModel=0; - StatusCode sc = service("GeoModelSvc", geoModel); - if(sc.isFailure()) - { - msg(MSG::ERROR) << "Could not locate GeoModelSvc" << endreq; - return sc; - } + ATH_CHECK( service("GeoModelSvc", geoModel) ); // dummy parameters for the callback: int dummyInt=0; @@ -75,14 +70,9 @@ StatusCode LArCellMerger::initialize() } else { - sc = detStore()->regFcn(&IGeoModelSvc::geoInit, - geoModel, - &LArCellMerger::geoInit,this); - if(sc.isFailure()) - { - msg(MSG::ERROR) << "Could not register geoInit callback" << endreq; - return sc; - } + ATH_CHECK( detStore()->regFcn(&IGeoModelSvc::geoInit, + geoModel, + &LArCellMerger::geoInit,this) ); } return StatusCode::SUCCESS; } @@ -91,33 +81,20 @@ StatusCode LArCellMerger::geoInit(IOVSVC_CALLBACK_ARGS) { const CaloIdManager* caloIdMgr; - StatusCode sc = detStore()->retrieve( caloIdMgr ); - if (sc.isFailure()) { - msg(MSG::ERROR) << "Unable to retrieve CaloIdMgr " << endreq; - return sc; - } + ATH_CHECK( detStore()->retrieve( caloIdMgr ) ); m_calo_id = caloIdMgr->getCaloCell_ID(); - - - // translate offline ID into online ID - sc = m_cablingService.retrieve(); - if(sc.isFailure()){ - msg(MSG::ERROR) << "Could not retrieve LArCablingService Tool" << endreq; - return sc; - } - + ATH_CHECK( m_cablingService.retrieve() ); return StatusCode::SUCCESS; - } StatusCode LArCellMerger::finalize() { - msg(MSG::INFO) << " ---- Summary from LArCellMerger " << endreq; - msg(MSG::INFO) << " Number of events processed " << m_evt << endreq; - msg(MSG::INFO) << " Number of cells from merged raw channel container " << m_ncell << endreq; + ATH_MSG_INFO( " ---- Summary from LArCellMerger " ); + ATH_MSG_INFO( " Number of events processed " << m_evt ); + ATH_MSG_INFO( " Number of cells from merged raw channel container " << m_ncell ); float ratio=0.; if (m_evt>0) ratio=((float)(m_ncell))/((float)(m_evt)); - msg(MSG::INFO) << " Average number of cells per event " << ratio << endreq; + ATH_MSG_INFO( " Average number of cells per event " << ratio ); return StatusCode::SUCCESS; } @@ -132,11 +109,7 @@ StatusCode LArCellMerger::process(CaloCellContainer * theCont ) ATH_MSG_DEBUG("in LArCellMerger::process"); const LArRawChannelContainer* rawColl; - StatusCode sc = evtStore()->retrieve(rawColl,m_rawChannelContainerName); - if (sc.isFailure()) { - msg(MSG::WARNING) << " cannot retrieve raw channel container to merge " << m_rawChannelContainerName << " Skip LArCellMerger::process " << endreq; - return StatusCode::SUCCESS; - } + ATH_CHECK( evtStore()->retrieve(rawColl,m_rawChannelContainerName) ); // loop over raw channel container // as this new container is supposed to contain only few cells, we do a simple loop and the basics onlineId to offlineId conversion @@ -155,9 +128,9 @@ StatusCode LArCellMerger::process(CaloCellContainer * theCont ) int index = theCont->findIndex(theCellHashID); if (index<0) { if (nwarnings<100) { - msg(MSG::WARNING) << " cell " << hwid.get_compact() << " " << id.get_compact() << " is not in the container " << endreq; + ATH_MSG_WARNING( " cell " << hwid.get_compact() << " " << id.get_compact() << " is not in the container " ); nwarnings++; - if (nwarnings==100) msg(MSG::WARNING) << " will not print anymore warnings for this event... " << endreq; + if (nwarnings==100) ATH_MSG_WARNING( " will not print anymore warnings for this event... " ); } continue; } diff --git a/LArCalorimeter/LArCellRec/src/LArCellRecalibration.cxx b/LArCalorimeter/LArCellRec/src/LArCellRecalibration.cxx index 57c126609554..fccfe8427073 100755 --- a/LArCalorimeter/LArCellRec/src/LArCellRecalibration.cxx +++ b/LArCalorimeter/LArCellRec/src/LArCellRecalibration.cxx @@ -30,20 +30,9 @@ LArCellRecalibration::~LArCellRecalibration() {} StatusCode LArCellRecalibration::initialize() { - MsgStream log(msgSvc(), name()); - log << MSG::INFO << " initialization " << endreq; - - StatusCode sc = m_adc2mevTool.retrieve(); - if (sc.isFailure()) { - log << MSG::ERROR << "Unable to find tool for LArADC2MeVTool" << endreq; - return StatusCode::FAILURE; - } - sc = m_adc2mevToolOnline.retrieve(); - if (sc.isFailure()) { - log << MSG::ERROR << "Unable to find tool for LArADC2MeVTool" << endreq; - return StatusCode::FAILURE; - } - + ATH_MSG_INFO( " initialization " ); + ATH_CHECK( m_adc2mevTool.retrieve() ); + ATH_CHECK( m_adc2mevToolOnline.retrieve() ); return StatusCode::SUCCESS; } diff --git a/LArCalorimeter/LArCellRec/src/LArCellRescaler.cxx b/LArCalorimeter/LArCellRec/src/LArCellRescaler.cxx index 8e4e7ccfd498..e338bfaa2969 100755 --- a/LArCalorimeter/LArCellRec/src/LArCellRescaler.cxx +++ b/LArCalorimeter/LArCellRec/src/LArCellRescaler.cxx @@ -23,13 +23,12 @@ LArCellRescaler::~LArCellRescaler() {} StatusCode LArCellRescaler::initialize() { - MsgStream log(msgSvc(), name()); - log << MSG::INFO << " initialization " << endreq; + ATH_MSG_INFO( " initialization " ); // sc=m_detStore->regHandle(m_factors,m_key); // if (sc.isFailure()) { // log << MSG::ERROR << "Cound not register DataHandle<CaloRec::CaloCellFactor> with key " -// << m_key << endreq; +// << m_key << endmsg; // return sc; // } @@ -43,18 +42,17 @@ StatusCode LArCellRescaler::initialize() { StatusCode LArCellRescaler::checkConstants(IOVSVC_CALLBACK_ARGS) { - MsgStream log(msgSvc(), name()); const CaloCell_ID* cellID; ATH_CHECK( detStore()->retrieve(cellID) ); IdentifierHash emMin, emMax; cellID->calo_cell_hash_range(CaloCell_ID::LAREM,emMin,emMax); if (m_factors->size() != emMax) { - log << MSG::ERROR << "CaloCellFactor object with key " << m_key - << " has wrong size " << m_factors->size() - << " HashMax is " << emMax << endreq; + ATH_MSG_ERROR( "CaloCellFactor object with key " << m_key + << " has wrong size " << m_factors->size() + << " HashMax is " << emMax ); return StatusCode::FAILURE; } - log << MSG::DEBUG << "CaloCellFactor object with key " << m_key << " has proper size." << endreq; + ATH_MSG_DEBUG( "CaloCellFactor object with key " << m_key << " has proper size." ); return StatusCode::SUCCESS; } diff --git a/LArCalorimeter/LArCellRec/src/LArG3Escale.cxx b/LArCalorimeter/LArCellRec/src/LArG3Escale.cxx index 08715e409eea..1dccb8cf1c61 100755 --- a/LArCalorimeter/LArCellRec/src/LArG3Escale.cxx +++ b/LArCalorimeter/LArCellRec/src/LArG3Escale.cxx @@ -32,13 +32,7 @@ Updated : Jul 2003 (DR) #include "CaloEvent/CaloCell.h" #include "CaloDetDescr/CaloDetDescrElement.h" -#include "GaudiKernel/MsgStream.h" - -//#ifdef HAVE_NEW_IOSTREAMS #include <iostream> -//#else -//#include <iostream.h> -//#endif #include <math.h> @@ -196,12 +190,10 @@ LArG3Escale::LArG3Escale(const std::string& type, const std::string& name, StatusCode LArG3Escale::initialize() { - MsgStream log(msgSvc(), name()); - - log<<MSG::INFO<< name() << endreq; - if(m_Weights) log<<MSG::INFO<< " Properties: Weights= true"<<endreq; - else log<<MSG::INFO<< " Properties: Weights= false"<<endreq; - log<<MSG::INFO<< " Properties: OverallScale= "<<m_OverallScale<<endreq; + ATH_MSG_INFO( name() ); + if(m_Weights) ATH_MSG_INFO( " Properties: Weights= true" ); + else ATH_MSG_INFO( " Properties: Weights= false" ); + ATH_MSG_INFO( " Properties: OverallScale= "<<m_OverallScale ); // pointer to DD manager and helpers: const CaloIdManager* mgr = (CaloDetDescrManager::instance())->getCalo_Mgr(); diff --git a/LArCalorimeter/LArCellRec/src/LArG3Escale_TDR.cxx b/LArCalorimeter/LArCellRec/src/LArG3Escale_TDR.cxx index c6aeaeff72d3..674c3d1784a6 100755 --- a/LArCalorimeter/LArCellRec/src/LArG3Escale_TDR.cxx +++ b/LArCalorimeter/LArCellRec/src/LArG3Escale_TDR.cxx @@ -24,16 +24,8 @@ Updated: Jan. 7, 2001 (SR) #include "LArCellRec/LArG3Escale_TDR.h" #include "CaloIdentifier/CaloIdManager.h" #include "CaloDetDescr/CaloDetDescrManager.h" - - #include "CaloEvent/CaloCell.h" -#include "GaudiKernel/MsgStream.h" - -//#ifdef HAVE_NEW_IOSTREAMS #include <iostream> -//#else -//#include <iostream.h> -//#endif #include <math.h> @@ -66,11 +58,9 @@ LArG3Escale_TDR::LArG3Escale_TDR(const std::string& type, StatusCode LArG3Escale_TDR::initialize() { - MsgStream log(msgSvc(), name()); - - log<<MSG::INFO<< name() << endreq; - log<<MSG::INFO<< " Properties: OverallScale= "<<m_OverallScale - << " FromHit ="<<m_FromHit<<endreq; + ATH_MSG_INFO( name() ); + ATH_MSG_INFO( " Properties: OverallScale= "<<m_OverallScale + << " FromHit ="<<m_FromHit ); const CaloIdManager* mgr = (CaloDetDescrManager::instance())->getCalo_Mgr(); m_emID = mgr->getEM_ID(); diff --git a/LArCalorimeter/LArCellRec/src/LArNoisyROAlg.cxx b/LArCalorimeter/LArCellRec/src/LArNoisyROAlg.cxx index 0e816ef460d1..2b2a99eca057 100644 --- a/LArCalorimeter/LArCellRec/src/LArNoisyROAlg.cxx +++ b/LArCalorimeter/LArCellRec/src/LArNoisyROAlg.cxx @@ -43,7 +43,7 @@ StatusCode LArNoisyROAlg::execute() const CaloCellContainer* cellContainer(0); StatusCode sc = evtStore()->retrieve(cellContainer, m_CaloCellContainerName); if (sc.isFailure() || !cellContainer ) { - msg(MSG::WARNING) << " Could not retreive the CaloCellContainer with name " << m_CaloCellContainerName << endreq; + ATH_MSG_WARNING( " Could not retreive the CaloCellContainer with name " << m_CaloCellContainerName ); return StatusCode::RECOVERABLE; } @@ -56,8 +56,6 @@ StatusCode LArNoisyROAlg::execute() bool MNBLooseCut=noisyRO->MNBLooseFlaggedPartitions(); bool MNBTightCut=noisyRO->MNBTightFlaggedPartitions(); - - if ( badFEBFlag || badFEBFlag_W || badSaturatedTightCut || MNBLooseCut || MNBTightCut) { // retrieve EventInfo @@ -65,7 +63,7 @@ StatusCode LArNoisyROAlg::execute() sc = evtStore()->retrieve(eventInfo_c); if (sc.isFailure()) { - msg(MSG::WARNING) << " cannot retrieve EventInfo, will not set LAr bit information " << endreq; + ATH_MSG_WARNING( " cannot retrieve EventInfo, will not set LAr bit information " ); } xAOD::EventInfo* eventInfo=0; if (eventInfo_c) @@ -105,8 +103,8 @@ StatusCode LArNoisyROAlg::execute() failSetWARNREASON |=(!eventInfo->setEventFlagBit(EventInfo::LAr,LArEventBitInfo::MININOISEBURSTLOOSE)); } - if (failSetWARN) msg(MSG::WARNING) << "Failure during EventInfo::setEventErrorState(EventInfo::LAR,EventInfo::WARNING)" << endreq; - if (failSetWARNREASON) msg(MSG::WARNING) << "Failure during setEventFlagBit(EventInfo::LAr,...)" << endreq; + if (failSetWARN) ATH_MSG_WARNING( "Failure during EventInfo::setEventErrorState(EventInfo::LAR,EventInfo::WARNING)" ); + if (failSetWARNREASON) ATH_MSG_WARNING( "Failure during setEventFlagBit(EventInfo::LAr,...)" ); } diff --git a/LArCalorimeter/LArCellRec/src/LArNoisyROTool.cxx b/LArCalorimeter/LArCellRec/src/LArNoisyROTool.cxx index 93eff9db6aa9..62465ab46f13 100644 --- a/LArCalorimeter/LArCellRec/src/LArNoisyROTool.cxx +++ b/LArCalorimeter/LArCellRec/src/LArNoisyROTool.cxx @@ -33,7 +33,8 @@ LArNoisyROTool::LArNoisyROTool( const std::string& type, declareProperty( "BadChanPerPA", m_BadChanPerPA=2 ); declareProperty( "CellQualityCut", m_CellQualityCut=4000 ); declareProperty( "IgnoreMaskedCells", m_ignore_masked_cells=false ); - declareProperty( "BadFEBCut", m_MinBadFEB=5 ); + declareProperty( "IgnoreFrontInnerWheelCells", m_ignore_front_innerwheel_cells=true ); + declareProperty( "BadFEBCut", m_MinBadFEB=3 ); declareProperty( "KnownBADFEBs", m_knownBadFEBsVec={0x3a188000, 0x3a480000, 0x3a490000, 0x3a498000, 0x3a790000, 0x3aa90000, 0x3aa98000, 0x3b108000, 0x3b110000, 0x3b118000, 0x3ba80000, 0x3ba88000, 0x3ba90000, 0x3ba98000, 0x3bb08000, 0x3bc00000}); // list agreed on LAr weekly meeting : https://indico.cern.ch/event/321653/ // 3a188000 EndcapCFT06LEMInner2 ECC06LEMI2 EndcapCFT03Slot02 [4.4.1.0.3.2] @@ -84,12 +85,12 @@ LArNoisyROTool::~LArNoisyROTool() StatusCode LArNoisyROTool::initialize() { if ( m_CellQualityCut > m_SaturatedCellQualityCut ) { - msg(MSG::FATAL) << "Configuration problem: LArNoisyROTool assumes that the QFactor cut to declare a channel noisy is softer than the QFactor cut to declare the quality saturated !" << endreq; + ATH_MSG_FATAL( "Configuration problem: LArNoisyROTool assumes that the QFactor cut to declare a channel noisy is softer than the QFactor cut to declare the quality saturated !" ); return StatusCode::FAILURE; } if ( m_MNBLooseCut > m_MNBTightCut) { - msg(MSG::FATAL) << "Configuration problem: LArNoisyROTool assumes that MNBLooseCut is smaller than MNBTightCut" << endreq; + ATH_MSG_FATAL( "Configuration problem: LArNoisyROTool assumes that MNBLooseCut is smaller than MNBTightCut" ); return StatusCode::FAILURE; } @@ -139,8 +140,8 @@ std::unique_ptr<LArNoisyROSummary> LArNoisyROTool::process(const CaloCellContain // they should not matter for physics so don't consider them if ( m_ignore_masked_cells && std::abs(cell->e()) < 0.1 ) continue; //Fixme: use provenance - Identifier id = cell->ID(); + if (m_ignore_front_innerwheel_cells && m_calo_id->is_em_endcap_inner(id) && m_calo_id->sampling(id) == 1) continue; // Front inner wheel cells are ignored // saturated Qfactor ? Tight cuts. if ( cell->quality()>=m_SaturatedCellQualityCut && @@ -183,19 +184,20 @@ std::unique_ptr<LArNoisyROSummary> LArNoisyROTool::process(const CaloCellContain } // exclude FCAL for now + // And also HEC (since 08/2015 - B.Trocme) uint8_t SatTightPartitions = 0; if ( NsaturatedTightCutBarrelA >= m_SaturatedCellTightCut ) SatTightPartitions |= LArNoisyROSummary::EMBAMask; if ( NsaturatedTightCutBarrelC >= m_SaturatedCellTightCut ) SatTightPartitions |= LArNoisyROSummary::EMBCMask; if ( NsaturatedTightCutEMECA >= m_SaturatedCellTightCut ) SatTightPartitions |= LArNoisyROSummary::EMECAMask; if ( NsaturatedTightCutEMECC >= m_SaturatedCellTightCut ) SatTightPartitions |= LArNoisyROSummary::EMECCMask; - if ( NsaturatedTightCutHECA >= m_SaturatedCellTightCut ) SatTightPartitions |= LArNoisyROSummary::HECAMask; - if ( NsaturatedTightCutHECC >= m_SaturatedCellTightCut ) SatTightPartitions |= LArNoisyROSummary::HECCMask; +// if ( NsaturatedTightCutHECA >= m_SaturatedCellTightCut ) SatTightPartitions |= LArNoisyROSummary::HECAMask; +// if ( NsaturatedTightCutHECC >= m_SaturatedCellTightCut ) SatTightPartitions |= LArNoisyROSummary::HECCMask; bool badSaturatedTightCut = (SatTightPartitions != 0); if ( badSaturatedTightCut ) noisyRO-> SetSatTightFlaggedPartitions(SatTightPartitions); // Too many saturated cells ? if ( badSaturatedTightCut ) { - //msg(MSG::INFO) << "Too many saturated cells " << endreq; + //ATH_MSG_INFO( "Too many saturated cells " ); m_SaturatedCellTightCutEvents++; } @@ -317,10 +319,8 @@ std::unique_ptr<LArNoisyROSummary> LArNoisyROTool::process(const CaloCellContain for (unsigned iP=0;iP<4;++iP) { - if (msgLvl(MSG::DEBUG)) { - msg(MSG::DEBUG) << "Partition " << iP << ": Found " << nLooseMNBFEBSperPartition[iP] << " MNB FEBs with more than " << m_MNBLooseCut << " bad-Q channels" << endreq; - msg(MSG::DEBUG) << "Partition " << iP << ": Found " << nTightMNBFEBSperPartition[iP] << " MNB FEBs with more than " << m_MNBTightCut << " bad-Q channels" << endreq; - } + ATH_MSG_DEBUG( "Partition " << iP << ": Found " << nLooseMNBFEBSperPartition[iP] << " MNB FEBs with more than " << m_MNBLooseCut << " bad-Q channels" ); + ATH_MSG_DEBUG( "Partition " << iP << ": Found " << nTightMNBFEBSperPartition[iP] << " MNB FEBs with more than " << m_MNBTightCut << " bad-Q channels" ); if (nLooseMNBFEBSperPartition[iP]>0) MNBLoosePartition |= m_partitionMask[iP]; if (nTightMNBFEBSperPartition[iP]>0) MNBTightPartition |= m_partitionMask[iP]; }// end loop over partitions @@ -336,21 +336,22 @@ StatusCode LArNoisyROTool::finalize() { if (m_printSummary) { - msg(MSG::INFO) << "List of bad FEBs found in all events " << endreq; - for ( SG::unordered_map<unsigned int, unsigned int>::const_iterator it = m_badFEB_counters.begin(); it != m_badFEB_counters.end(); it++ ) { - msg(MSG::INFO) << "FEB " << it->first << " declared noisy in " << it->second << " events " << endreq; + ATH_MSG_INFO( "List of bad FEBs found in all events " ); + for ( std::unordered_map<unsigned int, unsigned int>::const_iterator it = m_badFEB_counters.begin(); it != m_badFEB_counters.end(); it++ ) { + ATH_MSG_INFO( "FEB " << it->first << " declared noisy in " << it->second << " events " ); } - msg(MSG::INFO) << "List of bad preamps found in at least max(2,0.1%) events" << endreq; + ATH_MSG_INFO( "List of bad preamps found in at least max(2,0.1%) events" ); unsigned int cut = static_cast<unsigned int>(0.001*static_cast<float>(m_invocation_counter)); if ( cut < 2 ) cut = 2; uint64_t PAfactor = 1000000000L; for ( std::map<uint64_t, unsigned int>::const_iterator it = m_badPA_counters.begin(); it != m_badPA_counters.end(); it++ ) { - if ( it->second > cut ) msg(MSG::INFO) << "Preamplifier " << (it->first)/PAfactor << " of FEB " << (it->first)%PAfactor << " declared noisy in " << it->second << " events " << endreq; + if ( it->second > cut ) + ATH_MSG_INFO( "Preamplifier " << (it->first)/PAfactor << " of FEB " << (it->first)%PAfactor << " declared noisy in " << it->second << " events " ); } - msg(MSG::INFO) << "Number of events with too many saturated QFactor cells (Tight cuts): " << m_SaturatedCellTightCutEvents << endreq; + ATH_MSG_INFO( "Number of events with too many saturated QFactor cells (Tight cuts): " << m_SaturatedCellTightCutEvents ); } return StatusCode::SUCCESS; diff --git a/LArCalorimeter/LArCellRec/src/LArNonLinearity.cxx b/LArCalorimeter/LArCellRec/src/LArNonLinearity.cxx index 09ba4676a110..76d3d23004c0 100755 --- a/LArCalorimeter/LArCellRec/src/LArNonLinearity.cxx +++ b/LArCalorimeter/LArCellRec/src/LArNonLinearity.cxx @@ -22,7 +22,6 @@ PURPOSE: non linearity if only linear calibration fit is used #include "GeoModelInterfaces/IGeoModelSvc.h" #include "CaloEvent/CaloCell.h" -#include "GaudiKernel/MsgStream.h" #include "StoreGate/StoreGateSvc.h" // Units #include "CLHEP/Units/SystemOfUnits.h" @@ -86,21 +85,8 @@ LArNonLinearity::LArNonLinearity(const std::string& type, const std::string& nam StatusCode LArNonLinearity::initialize() { - MsgStream log(msgSvc(), name()); - - StoreGateSvc* detStore; - if (service("DetectorStore", detStore).isFailure()) { - log << MSG::ERROR << "Unable to access DetectoreStore" << endreq ; - return StatusCode::FAILURE; - } - const IGeoModelSvc *geoModel=0; - StatusCode sc = service("GeoModelSvc", geoModel); - if(sc.isFailure()) - { - log << MSG::ERROR << "Could not locate GeoModelSvc" << endreq; - return sc; - } + ATH_CHECK( service("GeoModelSvc", geoModel) ); // dummy parameters for the callback: int dummyInt=0; @@ -112,45 +98,22 @@ StatusCode LArNonLinearity::initialize() } else { - sc = detStore->regFcn(&IGeoModelSvc::geoInit, - geoModel, - &LArNonLinearity::geoInit,this); - if(sc.isFailure()) - { - log << MSG::ERROR << "Could not register geoInit callback" << endreq; - return sc; - } + ATH_CHECK( detStore()->regFcn(&IGeoModelSvc::geoInit, + geoModel, + &LArNonLinearity::geoInit,this) ); } - return sc; + return StatusCode::SUCCESS; } StatusCode LArNonLinearity::geoInit(IOVSVC_CALLBACK_ARGS) { - MsgStream log(msgSvc(), name()); - - log<<MSG::INFO<< name() << endreq; - log<<MSG::INFO<< " Initialize LArNonLinearity " << endreq; - - StoreGateSvc* detStore; - StatusCode sc = service ( "DetectorStore" , detStore ) ; - if (sc.isFailure()) - { - log << MSG::ERROR - << "Unable to access pointer to DetectorStore" - << endreq; - return StatusCode::FAILURE; - } + ATH_MSG_INFO( name() ); + ATH_MSG_INFO( " Initialize LArNonLinearity " ); - // pointer to DD manager and helpers: + // pointer to DD manager and helpers: const DataHandle<CaloIdManager> caloIdMgr; - sc = detStore->retrieve(caloIdMgr); - if (sc.isFailure()) { - log << MSG::ERROR - << "Unable to retrieve CaloIdManager from DetectoreStore" - << endreq; - return StatusCode::FAILURE; - } + ATH_CHECK( detStore()->retrieve(caloIdMgr) ); m_emID = caloIdMgr->getEM_ID(); m_hecID = caloIdMgr->getHEC_ID(); @@ -168,8 +131,6 @@ LArNonLinearity::~LArNonLinearity() void LArNonLinearity::MakeCorrection(CaloCell* theCell) { - MsgStream log(msgSvc(), name()); - float eta = theCell->eta(); Identifier id = theCell->ID(); @@ -191,10 +152,11 @@ void LArNonLinearity::MakeCorrection(CaloCell* theCell) else {ielec=1;} int index =ielec + 2*(sampling-1); // from 0 to 5 (see above) - if (energy>2.*GeV) log << MSG::DEBUG << " energy " << energy + if (energy>2.*GeV) + ATH_MSG_DEBUG( " energy " << energy << " sampling " << sampling << " eta " << eta - << " index " << index << endreq; + << " index " << index ); // check E less than E maximum validity @@ -222,10 +184,10 @@ void LArNonLinearity::MakeCorrection(CaloCell* theCell) if (energy>2.*GeV) { - log << MSG::DEBUG << " pol coeff " << m_p0[index][irange] << " " - << m_p1[index][irange] << " " << m_p2[index][irange] << " " - << m_p3[index][irange] << endreq; - log << MSG::DEBUG << "energy,index,corr = " << energy << " " << index << " " << corr << endreq; + ATH_MSG_DEBUG( " pol coeff " << m_p0[index][irange] << " " + << m_p1[index][irange] << " " << m_p2[index][irange] << " " + << m_p3[index][irange] ); + ATH_MSG_DEBUG( "energy,index,corr = " << energy << " " << index << " " << corr ); } } diff --git a/LArCalorimeter/LArCellRec/src/LArTimeVetoAlg.cxx b/LArCalorimeter/LArCellRec/src/LArTimeVetoAlg.cxx index 8f82a7dbe44f..d794dea90858 100644 --- a/LArCalorimeter/LArCellRec/src/LArTimeVetoAlg.cxx +++ b/LArCalorimeter/LArCellRec/src/LArTimeVetoAlg.cxx @@ -6,7 +6,6 @@ #include "AthenaPoolUtilities/AthenaAttributeList.h" #include "LArRecEvent/LArEventBitInfo.h" #include "GaudiKernel/Property.h" -#include "GaudiKernel/MsgStream.h" #include "xAODEventInfo/EventInfo.h" using xAOD::EventInfo; @@ -31,16 +30,11 @@ LArTimeVetoAlg:: LArTimeVetoAlg(const std::string& name, ISvcLocator* pSvcLocato //__________________________________________________________________________ StatusCode LArTimeVetoAlg::initialize() { - msg(MSG::INFO) <<"LArTimeVetoAlg initialize()" << endreq; + ATH_MSG_INFO("LArTimeVetoAlg initialize()" ); m_nevt=0; m_nevtMasked=0; - StatusCode sc = detStore()->regHandle(m_dd_atrList,m_folderName); - if (sc.isFailure()) { - msg(MSG::ERROR) << " cannot register handle to attribute list " << m_folderName << endreq; - return StatusCode::FAILURE; - } - + ATH_CHECK( detStore()->regHandle(m_dd_atrList,m_folderName) ); return StatusCode::SUCCESS; } @@ -48,8 +42,8 @@ StatusCode LArTimeVetoAlg::initialize() //__________________________________________________________________________ StatusCode LArTimeVetoAlg::finalize() { - msg(MSG::DEBUG) << "LArTimeVetoAlg finalize()" << endreq; - msg(MSG::INFO) << " Number of events processed " << m_nevt << " Number of events in LAr bad time interval " << m_nevtMasked << endreq; + ATH_MSG_DEBUG( "LArTimeVetoAlg finalize()" ); + ATH_MSG_INFO( " Number of events processed " << m_nevt << " Number of events in LAr bad time interval " << m_nevtMasked ); return StatusCode::SUCCESS; } @@ -70,29 +64,25 @@ StatusCode LArTimeVetoAlg::execute() // retrieve EventInfo const EventInfo* eventInfo_c=0; - StatusCode sc = evtStore()->retrieve(eventInfo_c); - if (sc.isFailure()) { - msg(MSG::WARNING) << " cannot retrieve EventInfo, will not set LAr bit information " << endreq; - return StatusCode::SUCCESS; - } + ATH_CHECK( evtStore()->retrieve(eventInfo_c) ); EventInfo* eventInfo=0; if (eventInfo_c) { eventInfo = const_cast<EventInfo*>(eventInfo_c); } if (eventInfo) { if (!eventInfo->setErrorState(EventInfo::LAr,EventInfo::Error)) { - msg(MSG::WARNING) << " cannot set error state for LAr " << endreq; + ATH_MSG_WARNING( " cannot set error state for LAr " ); } - if (vetoWord & 0xFFFF) { + if (vetoWord & 0x1FFFF) { ATH_MSG_DEBUG("Event flagged as Noise Burst!"); if (!eventInfo->setEventFlagBit(EventInfo::LAr,LArEventBitInfo::NOISEBURSTVETO)) { - msg(MSG::WARNING) << " cannot set flag bit for LAr " << endreq; + ATH_MSG_WARNING( " cannot set flag bit for LAr " ); } if (vetoWord & 0x10000) { ATH_MSG_DEBUG("Event flagged as Mini-Noise Burst!"); if (!eventInfo->setEventFlagBit(EventInfo::LAr,LArEventBitInfo::MININOISEBURSTTIGHT)) { - msg(MSG::WARNING) << " cannot set flag bit for LAr " << endreq; + ATH_MSG_WARNING( " cannot set flag bit for LAr " ); } } @@ -101,7 +91,7 @@ StatusCode LArTimeVetoAlg::execute() for (int i=0;i<8;i++) { if (vetoWord & (1<<i)) { if (!eventInfo->setEventFlagBit(EventInfo::LAr,20+i)) { - msg(MSG::WARNING) << " cannot set flag bit for LAr documenting noise burst location " << endreq; + ATH_MSG_WARNING( " cannot set flag bit for LAr documenting noise burst location " ); } } } @@ -109,7 +99,7 @@ StatusCode LArTimeVetoAlg::execute() if (vetoWord & 0xFFF80000) { ATH_MSG_DEBUG("Event flagged as DataCorruption!"); if (!eventInfo->setEventFlagBit(EventInfo::LAr,LArEventBitInfo::DATACORRUPTEDVETO)) { - msg(MSG::WARNING) << " cannot set flag bit for LAr " << endreq; + ATH_MSG_WARNING( " cannot set flag bit for LAr " ); } }//end if one of the second 16 bits set } //if eventInfo -- GitLab