diff --git a/LArCalorimeter/LArExample/LArConditionsCommon/python/LArHVDB.py b/LArCalorimeter/LArExample/LArConditionsCommon/python/LArHVDB.py index c12f428c4e942e138530d38216b004ce1d0602e7..d5cf77e488f13bb90eb9e365034983f688120273 100644 --- a/LArCalorimeter/LArExample/LArConditionsCommon/python/LArHVDB.py +++ b/LArCalorimeter/LArExample/LArConditionsCommon/python/LArHVDB.py @@ -29,7 +29,6 @@ if not conddb.isMC and not conddb.isOnline: from LArRecUtils.LArRecUtilsConf import LArHVScaleCorrCondAlg hvscale = LArHVScaleCorrCondAlg(keyHVdata="LArHVData",keyOutputCorr="LArHVScaleCorrRecomputed") hvscale.UndoOnlineHVCorr=True - hvscale.OutputLevel=DEBUG condseq += hvscale if conddb.isMC: diff --git a/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVCorr.h b/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVCorr.h index e6685020f2d77541e92510ccafdf51fbc4576a1b..e77ab6491135f0ccca43ef2977f362f69220c003 100755 --- a/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVCorr.h +++ b/LArCalorimeter/LArRecConditions/LArRecConditions/LArHVCorr.h @@ -14,15 +14,12 @@ #include <vector> class CaloCell_ID; -class MsgStream; class LArHVCorr : public ILArHVScaleCorr { - friend class LArHVCondAlg; //The conditions alg filling this object - public: - LArHVCorr(const std::vector<float>& vVec, const LArOnOffIdMapping* cabling, const CaloCell_ID* caloidhelper); - ~LArHVCorr () { if(m_log) delete m_log; } + LArHVCorr(std::vector<float>&& vVec, const LArOnOffIdMapping* cabling, const CaloCell_ID* caloidhelper); + ~LArHVCorr () {}; // retrieving HVScaleCorr using online ID @@ -35,10 +32,9 @@ class LArHVCorr : public ILArHVScaleCorr { private: const LArOnOffIdMapping* m_larCablingSvc; const CaloCell_ID* m_calo_id; - MsgStream* m_log; std::vector<float> m_hvCorr; - const float m_badCorr; + const float m_noCorr; }; #include "AthenaKernel/CondCont.h" diff --git a/LArCalorimeter/LArRecConditions/src/LArHVCorr.cxx b/LArCalorimeter/LArRecConditions/src/LArHVCorr.cxx index 37dbe97d629decce8f1813fc2a9125f73c6427db..5e128b0903fb53f1078b52862a197ed1ec7bcc35 100644 --- a/LArCalorimeter/LArRecConditions/src/LArHVCorr.cxx +++ b/LArCalorimeter/LArRecConditions/src/LArHVCorr.cxx @@ -3,24 +3,20 @@ */ #include "LArRecConditions/LArHVCorr.h" -#include "AthenaKernel/getMessageSvc.h" -LArHVCorr::LArHVCorr(const std::vector<float>& vVec, const LArOnOffIdMapping* cabling, const CaloCell_ID* caloidhelper): +LArHVCorr::LArHVCorr(std::vector<float>&& vVec, const LArOnOffIdMapping* cabling, const CaloCell_ID* caloidhelper): m_larCablingSvc(cabling), m_calo_id(caloidhelper), - m_log(nullptr), - m_badCorr(0.) { - - m_log=new MsgStream(Athena::getMessageSvc(), "LArHVCorr") - ; - m_hvCorr = vVec; -} + m_hvCorr(vVec), + m_noCorr(1.0) {} // retrieving HVScaleCorr using offline ID const float& LArHVCorr::HVScaleCorr(const Identifier& id) const { - if(m_calo_id->sub_calo(id) < CaloCell_Base_ID::TILE) - return m_hvCorr[m_calo_id->calo_cell_hash(id)]; - else return m_badCorr; + const IdentifierHash h=m_calo_id->calo_cell_hash(id); + if (h<m_hvCorr.size()) //Catches also Tile Ids + return m_hvCorr[m_calo_id->calo_cell_hash(id)]; + else + return m_noCorr; } const float& LArHVCorr::HVScaleCorr(const HWIdentifier& id) const { diff --git a/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.cxx b/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.cxx index 2ba05844981847cecb870de915b1aaab25059ba4..fbeb8cc6e6d3a2d354b51ba14545217f9553a78c 100644 --- a/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.cxx +++ b/LArCalorimeter/LArRecUtils/src/LArHVScaleCorrCondAlg.cxx @@ -229,7 +229,7 @@ StatusCode LArHVScaleCorrCondAlg::execute() { ATH_MSG_ERROR("Could not get LArOnOffIdMapping !!"); return StatusCode::FAILURE; } - std::unique_ptr<LArHVCorr> hvCorr = std::make_unique<LArHVCorr>(vScale, cabling, m_calocell_id ); + std::unique_ptr<LArHVCorr> hvCorr = std::make_unique<LArHVCorr>(std::move(vScale), cabling, m_calocell_id ); //LArHVScaleCorrFlat * hvCorr = new LArHVScaleCorrFlat(vScale); const EventIDRange crangeW(rangeW); if(writeHandle.record(crangeW,hvCorr.release()).isFailure()) {