Skip to content
Snippets Groups Projects
Commit 65bcf6b5 authored by scott snyder's avatar scott snyder Committed by scott snyder
Browse files

LArMonTools: Use conditions handle to read hvcorr information.

Change from using ILArHVCorrTool to using a conditions handle.
parent 96aa2f5c
No related branches found
No related tags found
No related merge requests found
...@@ -7,11 +7,8 @@ from LArMonTools.LArMonToolsConf import LArHVCorrectionMonTool ...@@ -7,11 +7,8 @@ from LArMonTools.LArMonToolsConf import LArHVCorrectionMonTool
theLArHVCorrectionMonTool = LArHVCorrectionMonTool(name="LArHVCorrectionMonTool", theLArHVCorrectionMonTool = LArHVCorrectionMonTool(name="LArHVCorrectionMonTool",
NumberOfLBs = 1000 NumberOfLBs = 1000
) )
# include LAr HV Correction tool # include LAr HV Correction cond alg
from LArRecUtils.LArHVCorrToolDefault import LArHVCorrToolDefault from LArConditionsCommon import LArHVDB
theLArHVCorrTool=LArHVCorrToolDefault()
ToolSvc+=theLArHVCorrTool
theLArHVCorrectionMonTool.HVCorrTool = theLArHVCorrTool
#ToolSvc += theLArHVCorrectionMonTool #ToolSvc += theLArHVCorrectionMonTool
LArMon.AthenaMonTools+=[ theLArHVCorrectionMonTool ] LArMon.AthenaMonTools+=[ theLArHVCorrectionMonTool ]
......
...@@ -47,13 +47,9 @@ LArHVCorrectionMonTool::LArHVCorrectionMonTool(const std::string& type, ...@@ -47,13 +47,9 @@ LArHVCorrectionMonTool::LArHVCorrectionMonTool(const std::string& type,
m_strHelper(0), m_strHelper(0),
m_rootStore(0), m_rootStore(0),
m_larCablingService("LArCablingLegacyService"), m_larCablingService("LArCablingLegacyService"),
m_hvCorrTool("LArHVCorrTool"),
m_keyHVScaleCorr("LArHVScaleCorr"),
m_eventsCounter(0) m_eventsCounter(0)
{ {
declareProperty("LArRawChannelKey",m_channelKey="LArRawChannels"); declareProperty("LArRawChannelKey",m_channelKey="LArRawChannels");
declareProperty("HVCorrTool",m_hvCorrTool);
declareProperty("keyHVScaleCorr",m_keyHVScaleCorr);
declareProperty("ErrorThreshold",m_threshold=0.02); declareProperty("ErrorThreshold",m_threshold=0.02);
declareProperty("EtaGranularity",m_delta_eta=0.01); declareProperty("EtaGranularity",m_delta_eta=0.01);
declareProperty("PhiGranularity",m_delta_phi=0.01); declareProperty("PhiGranularity",m_delta_phi=0.01);
...@@ -83,51 +79,21 @@ StatusCode LArHVCorrectionMonTool::initialize() ...@@ -83,51 +79,21 @@ StatusCode LArHVCorrectionMonTool::initialize()
{ {
ATH_MSG_INFO( "Initialize LArHVCorrectionMonTool" ); ATH_MSG_INFO( "Initialize LArHVCorrectionMonTool" );
StatusCode sc;
sc = detStore()->retrieve(m_LArOnlineIDHelper, "LArOnlineID"); ATH_CHECK( detStore()->retrieve(m_LArOnlineIDHelper, "LArOnlineID") );
if (sc.isFailure()) {
ATH_MSG_FATAL( "Could not get LArOnlineIDHelper" );
return sc;
}
// Retrieve HVCorrTool
sc = m_hvCorrTool.retrieve();
if (sc.isFailure()) {
ATH_MSG_ERROR( "Unable to find tool for LArHVCorrTool" );
return StatusCode::FAILURE;
}
// Retrieve HV Correction reference
sc = detStore()->regHandle(m_dd_HVScaleCorr,m_keyHVScaleCorr);
if (sc.isFailure()) {
ATH_MSG_ERROR( "Unable to register handle to HVScaleCorr " );
return StatusCode::FAILURE;
}
// Retrieve ID helpers // Retrieve ID helpers
sc = detStore()->retrieve( m_caloIdMgr ); const CaloCell_ID* idHelper = nullptr;
if (sc.isFailure()) { ATH_CHECK( detStore()->retrieve( idHelper, "CaloCell_ID" ) );
ATH_MSG_FATAL( "Could not get CaloIdMgr" ); m_LArEM_IDHelper = idHelper->em_idHelper();
return sc; m_LArHEC_IDHelper = idHelper->hec_idHelper();
} m_LArFCAL_IDHelper = idHelper->fcal_idHelper();
m_LArEM_IDHelper = m_caloIdMgr->getEM_ID();
m_LArHEC_IDHelper = m_caloIdMgr->getHEC_ID();
m_LArFCAL_IDHelper = m_caloIdMgr->getFCAL_ID();
// CaloDetDescrMgr gives "detector description", including real positions of cells ATH_CHECK( detStore()->retrieve(m_CaloDetDescrMgr) );
sc = detStore()->retrieve(m_CaloDetDescrMgr); ATH_CHECK( m_larCablingService.retrieve() );
if (sc.isFailure()) {
ATH_MSG_FATAL( "Could not get CaloDetDescrMgr "); ATH_CHECK( m_scaleCorrKey.initialize() );
return sc; ATH_CHECK( m_onlineScaleCorrKey.initialize() );
}
// Get LAr Cabling Service
sc=m_larCablingService.retrieve();
if (sc.isFailure()) {
ATH_MSG_ERROR( "Could not retrieve LArCablingService" );
return StatusCode::FAILURE;
}
// LArOnlineIDStrHelper // LArOnlineIDStrHelper
m_strHelper = new LArOnlineIDStrHelper(m_LArOnlineIDHelper); m_strHelper = new LArOnlineIDStrHelper(m_LArOnlineIDHelper);
...@@ -272,6 +238,7 @@ StatusCode ...@@ -272,6 +238,7 @@ StatusCode
LArHVCorrectionMonTool::fillHistograms() LArHVCorrectionMonTool::fillHistograms()
{ {
ATH_MSG_DEBUG( "in fillHists()" ); ATH_MSG_DEBUG( "in fillHists()" );
const EventContext& ctx = Gaudi::Hive::currentContext();
m_eventsCounter++; m_eventsCounter++;
...@@ -298,6 +265,9 @@ LArHVCorrectionMonTool::fillHistograms() ...@@ -298,6 +265,9 @@ LArHVCorrectionMonTool::fillHistograms()
ATH_MSG_WARNING( "Can't retrieve LArRawChannelContainer with key " << m_channelKey ); ATH_MSG_WARNING( "Can't retrieve LArRawChannelContainer with key " << m_channelKey );
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
SG::ReadCondHandle<ILArHVScaleCorr> scaleCorr (m_scaleCorrKey, ctx);
SG::ReadCondHandle<ILArHVScaleCorr> onlineScaleCorr (m_onlineScaleCorrKey, ctx);
// Loop over LArRawChannels // Loop over LArRawChannels
//SelectAllLArRawChannels AllRaw(pRawChannelsContainer); //SelectAllLArRawChannels AllRaw(pRawChannelsContainer);
...@@ -329,9 +299,9 @@ LArHVCorrectionMonTool::fillHistograms() ...@@ -329,9 +299,9 @@ LArHVCorrectionMonTool::fillHistograms()
// Retrieve HV correction info // Retrieve HV correction info
float hvdev = 0; float hvdev = 0;
float hvcorr = m_hvCorrTool->Scale(offlineID); float hvcorr = scaleCorr->HVScaleCorr(id);
//ATH_MSG_VERBOSE( "hvcorr" << hvcorr ); //ATH_MSG_VERBOSE( "hvcorr" << hvcorr );
float hvonline = m_dd_HVScaleCorr->HVScaleCorr(id); float hvonline = onlineScaleCorr->HVScaleCorr(id);
if (hvonline<=0) continue; //No valid online correction if (hvonline<=0) continue; //No valid online correction
//ATH_MSG_VERBOSE( "hvonline" << hvonline ); //ATH_MSG_VERBOSE( "hvonline" << hvonline );
if (hvcorr>hvonline) hvdev = hvonline-hvcorr; //Monitor only channels that get a higher correction from DCS (eg are at a lower voltage). if (hvcorr>hvonline) hvdev = hvonline-hvcorr; //Monitor only channels that get a higher correction from DCS (eg are at a lower voltage).
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include "CaloDetDescr/CaloDetDescriptor.h" #include "CaloDetDescr/CaloDetDescriptor.h"
#include "CaloDetDescr/CaloDetDescrElement.h" #include "CaloDetDescr/CaloDetDescrElement.h"
#include "CaloGeoHelpers/CaloPhiRange.h" #include "CaloGeoHelpers/CaloPhiRange.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "Identifier/HWIdentifier.h" #include "Identifier/HWIdentifier.h"
#include "LArIdentifier/LArOnlineID.h" #include "LArIdentifier/LArOnlineID.h"
...@@ -28,7 +29,6 @@ ...@@ -28,7 +29,6 @@
#include "LArRawEvent/LArRawChannelContainer.h" #include "LArRawEvent/LArRawChannelContainer.h"
#include "EventContainers/SelectAllObject.h" #include "EventContainers/SelectAllObject.h"
#include "LArCabling/LArCablingLegacyService.h" #include "LArCabling/LArCablingLegacyService.h"
#include "LArElecCalib/ILArHVCorrTool.h"
#include "LArElecCalib/ILArHVScaleCorr.h" #include "LArElecCalib/ILArHVScaleCorr.h"
#include <string> #include <string>
...@@ -83,9 +83,11 @@ class LArHVCorrectionMonTool: public ManagedMonitorToolBase ...@@ -83,9 +83,11 @@ class LArHVCorrectionMonTool: public ManagedMonitorToolBase
ITHistSvc* m_rootStore; ITHistSvc* m_rootStore;
/** Handle to LArCablingService */ /** Handle to LArCablingService */
ToolHandle<LArCablingLegacyService> m_larCablingService; ToolHandle<LArCablingLegacyService> m_larCablingService;
/** Handle to hv tools */
ToolHandle<ILArHVCorrTool> m_hvCorrTool; SG::ReadCondHandleKey<ILArHVScaleCorr> m_scaleCorrKey
const DataHandle<ILArHVScaleCorr> m_dd_HVScaleCorr; { this, "LArHVScaleCorr", "LArHVScaleCorrRecomputed", "" };
SG::ReadCondHandleKey<ILArHVScaleCorr> m_onlineScaleCorrKey
{ this, "OnlineLArHVScaleCorr", "LArHVScaleCorr", "" };
private: private:
...@@ -98,7 +100,6 @@ class LArHVCorrectionMonTool: public ManagedMonitorToolBase ...@@ -98,7 +100,6 @@ class LArHVCorrectionMonTool: public ManagedMonitorToolBase
// Properties // Properties
std::string m_channelKey; std::string m_channelKey;
std::string m_keyHVScaleCorr;
float m_threshold; float m_threshold;
float m_delta_eta; float m_delta_eta;
float m_delta_phi; float m_delta_phi;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment