diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondHVAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondHVAlg.cxx index 0540ac10c399d60a6b2a01a5d6a38303cf3f45b9..9672739f21272826bb5e77a5325dd03fa421374c 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondHVAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondHVAlg.cxx @@ -14,7 +14,7 @@ PixelDCSCondHVAlg::PixelDCSCondHVAlg(const std::string& name, ISvcLocator* pSvcL } StatusCode PixelDCSCondHVAlg::initialize() { - ATH_MSG_INFO("PixelDCSCondHVAlg::initialize()"); + ATH_MSG_DEBUG("PixelDCSCondHVAlg::initialize()"); ATH_CHECK(m_condSvc.retrieve()); @@ -28,7 +28,7 @@ StatusCode PixelDCSCondHVAlg::initialize() { } StatusCode PixelDCSCondHVAlg::execute() { - ATH_MSG_INFO("PixelDCSCondHVAlg::execute()"); + ATH_MSG_DEBUG("PixelDCSCondHVAlg::execute()"); SG::WriteCondHandle<PixelDCSConditionsData> writeHandle(m_writeKey); if (writeHandle.isValid()) { @@ -79,7 +79,7 @@ StatusCode PixelDCSCondHVAlg::execute() { } StatusCode PixelDCSCondHVAlg::finalize() { - ATH_MSG_INFO("PixelDCSCondHVAlg::finalize()"); + ATH_MSG_DEBUG("PixelDCSCondHVAlg::finalize()"); return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.cxx index 467ca9462c3880a18272a9112c6b57d966723241..20d9d36983950006747b5a53a16b3763fc17e967 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondStateAlg.cxx @@ -14,7 +14,7 @@ PixelDCSCondStateAlg::PixelDCSCondStateAlg(const std::string& name, ISvcLocator* } StatusCode PixelDCSCondStateAlg::initialize() { - ATH_MSG_INFO("PixelDCSCondStateAlg::initialize()"); + ATH_MSG_DEBUG("PixelDCSCondStateAlg::initialize()"); ATH_CHECK(m_condSvc.retrieve()); @@ -35,7 +35,7 @@ StatusCode PixelDCSCondStateAlg::initialize() { } StatusCode PixelDCSCondStateAlg::execute() { - ATH_MSG_INFO("PixelDCSCondStateAlg::execute()"); + ATH_MSG_DEBUG("PixelDCSCondStateAlg::execute()"); //=========== // FSM_STATE @@ -135,7 +135,7 @@ StatusCode PixelDCSCondStateAlg::execute() { } StatusCode PixelDCSCondStateAlg::finalize() { - ATH_MSG_INFO("PixelDCSCondStateAlg::finalize()"); + ATH_MSG_DEBUG("PixelDCSCondStateAlg::finalize()"); return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondTempAlg.cxx b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondTempAlg.cxx index 1fbae54caabddf7ff943fe93a3192523a890c35b..432e1e1fede6e2cf8c7629cc341b50e821f5be19 100644 --- a/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondTempAlg.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsAlgorithms/src/PixelDCSCondTempAlg.cxx @@ -15,7 +15,7 @@ PixelDCSCondTempAlg::PixelDCSCondTempAlg(const std::string& name, ISvcLocator* p } StatusCode PixelDCSCondTempAlg::initialize() { - ATH_MSG_INFO("PixelDCSCondTempAlg::initialize()"); + ATH_MSG_DEBUG("PixelDCSCondTempAlg::initialize()"); ATH_CHECK(m_condSvc.retrieve()); @@ -30,7 +30,7 @@ StatusCode PixelDCSCondTempAlg::initialize() { } StatusCode PixelDCSCondTempAlg::execute() { - ATH_MSG_INFO("PixelDCSCondTempAlg::execute()"); + ATH_MSG_DEBUG("PixelDCSCondTempAlg::execute()"); SG::WriteCondHandle<PixelDCSConditionsData> writeHandle(m_writeKey); // Do we have a valid Write Cond Handle for current time? @@ -83,7 +83,7 @@ StatusCode PixelDCSCondTempAlg::execute() { } StatusCode PixelDCSCondTempAlg::finalize() { - ATH_MSG_INFO("PixelDCSCondTempAlg::finalize()"); + ATH_MSG_DEBUG("PixelDCSCondTempAlg::finalize()"); return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetConditions/PixelConditionsServices/src/PixelConditionsSummarySvc.cxx b/InnerDetector/InDetConditions/PixelConditionsServices/src/PixelConditionsSummarySvc.cxx index c2e49b607027725080a1bd82ebac7ccb2eae7821..a9c120674c2cb7df84fde54dbf8a639fc20f8971 100644 --- a/InnerDetector/InDetConditions/PixelConditionsServices/src/PixelConditionsSummarySvc.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsServices/src/PixelConditionsSummarySvc.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "PixelConditionsSummarySvc.h" @@ -139,6 +139,8 @@ bool PixelConditionsSummarySvc::isActive(const Identifier & elementId, const InD bool isDCSActive = false; std::string dcsState = m_pixelDCSSvc->getFSMState(moduleHash); + std::cout << "STSTST PixelConditionsSummarySvc::isActive 1 " << dcsState << std::endl; + for (unsigned int istate=0; istate<m_isActiveStates.size(); istate++) { if (m_isActiveStates[istate]==dcsState) { isDCSActive=true; } } @@ -184,6 +186,8 @@ bool PixelConditionsSummarySvc::isActive(const IdentifierHash & elementHash) { bool isDCSActive = false; std::string dcsState = m_pixelDCSSvc->getFSMState(elementHash); + std::cout << "STSTST PixelConditionsSummarySvc::isActive 2 " << dcsState << std::endl; + for (unsigned int istate=0; istate<m_isActiveStates.size(); istate++) { if (m_isActiveStates[istate]==dcsState) { isDCSActive=true; } } @@ -208,6 +212,8 @@ bool PixelConditionsSummarySvc::isActive(const IdentifierHash & elementHash, con bool isDCSActive = false; std::string dcsState = m_pixelDCSSvc->getFSMState(elementHash); + std::cout << "STSTST PixelConditionsSummarySvc::isActive 3 " << dcsState << std::endl; + for (unsigned int istate=0; istate<m_isActiveStates.size(); istate++) { if (m_isActiveStates[istate]==dcsState) { isDCSActive=true; } } @@ -238,6 +244,8 @@ double PixelConditionsSummarySvc::activeFraction(const IdentifierHash & elementH bool isDCSActive = false; std::string dcsState = m_pixelDCSSvc->getFSMState(elementHash); + std::cout << "STSTST PixelConditionsSummarySvc::activeFraction " << dcsState << std::endl; + for (unsigned int istate=0; istate<m_isActiveStates.size(); istate++) { if (m_isActiveStates[istate]==dcsState) { isDCSActive = true; } } @@ -297,6 +305,8 @@ bool PixelConditionsSummarySvc::isGood(const Identifier & elementId, const InDet bool isDCSGood = false; std::string dcsStatus = m_pixelDCSSvc->getFSMStatus(moduleHash); + std::cout << "STSTST PixelConditionsSummarySvc::isGood 1 " << dcsState << " " << dcsStatus << std::endl; + for (unsigned int istate=0; istate<m_isActiveStates.size(); istate++) { if (m_isActiveStates[istate]==dcsState) { isDCSActive = true; } } @@ -352,6 +362,8 @@ bool PixelConditionsSummarySvc::isGood(const IdentifierHash & elementHash) { bool isDCSGood = false; std::string dcsStatus = m_pixelDCSSvc->getFSMStatus(elementHash); + std::cout << "STSTST PixelConditionsSummarySvc::isGood 2 " << dcsState << " " << dcsStatus << std::endl; + for (unsigned int istate=0; istate<m_isActiveStates.size(); istate++) { if (m_isActiveStates[istate]==dcsState) { isDCSActive=true; } } @@ -381,6 +393,8 @@ bool PixelConditionsSummarySvc::isGood(const IdentifierHash & elementHash, const bool isDCSGood = false; std::string dcsStatus = m_pixelDCSSvc->getFSMStatus(elementHash); + std::cout << "STSTST PixelConditionsSummarySvc::isGood 3 " << dcsState << " " << dcsStatus << std::endl; + for (unsigned int istate=0; istate<m_isActiveStates.size(); istate++) { if (m_isActiveStates[istate]==dcsState) { isDCSActive=true; } } @@ -416,6 +430,8 @@ double PixelConditionsSummarySvc::goodFraction(const IdentifierHash & elementHas bool isDCSGood = false; std::string dcsStatus = m_pixelDCSSvc->getFSMStatus(elementHash); + std::cout << "STSTST PixelConditionsSummarySvc::goodFraction " << dcsState << " " << dcsStatus << std::endl; + for (unsigned int istate=0; istate<m_isActiveStates.size(); istate++) { if (m_isActiveStates[istate]==dcsState) { isDCSActive=true; } } diff --git a/InnerDetector/InDetConditions/PixelConditionsServices/src/components/PixelConditionsServices_entries.cxx b/InnerDetector/InDetConditions/PixelConditionsServices/src/components/PixelConditionsServices_entries.cxx index 8a001af9a051ebdb3b1c1c078af5ef55aa9d119d..084f8968f8570dd7d7b4cb3b4bbd61fed30f3b1d 100644 --- a/InnerDetector/InDetConditions/PixelConditionsServices/src/components/PixelConditionsServices_entries.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsServices/src/components/PixelConditionsServices_entries.cxx @@ -5,7 +5,6 @@ #include "../PixelConditionsSummarySvc.h" #include "../PixelSiliconConditionsSvc.h" #include "../PixelByteStreamErrorsSvc.h" -#include "../PixelConditionsSummarySvc.h" #include "../PixelTDAQSvc.h" DECLARE_COMPONENT( PixelOfflineCalibSvc ) diff --git a/InnerDetector/InDetConditions/PixelConditionsServices/test/PixelDCSTestSvc.h b/InnerDetector/InDetConditions/PixelConditionsServices/test/PixelDCSTestSvc.h index 19532c709e2ed6399192e272dc72b671a497fff4..1da6d6eaa2d730ff8ed15dfa295834c9cdd3c3a7 100644 --- a/InnerDetector/InDetConditions/PixelConditionsServices/test/PixelDCSTestSvc.h +++ b/InnerDetector/InDetConditions/PixelConditionsServices/test/PixelDCSTestSvc.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ //**************************************************************************** @@ -48,7 +48,7 @@ class PixelDCSTestSvc: public AthAlgorithm{ ServiceHandle< IPixelDCSSvc > m_pixelDCSSvc; - ToolHandle< PixelConditionsSummaryTool > m_pixelSvc; + ToolHandle<PixelConditionsSummaryTool> m_pixelSvc; }; diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelConditionsSummaryToolSetup.py b/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelConditionsSummaryToolSetup.py index 9915b24c7e6bafd8b2bf6f2b9e990b06b0a95ffd..58596c3bce51469b9535585e06b47772bf522fd7 100644 --- a/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelConditionsSummaryToolSetup.py +++ b/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelConditionsSummaryToolSetup.py @@ -4,15 +4,29 @@ class PixelConditionsSummaryToolSetup: "Class to simplify setup of PixelConditionsSummaryTool and required conditions algorithms" def __init__(self): - self.toolName = "InDetPixelConditionsSummaryTool" + self.toolName = "PixelConditionsSummaryTool" self.tool = None + self.useDCS = False + self.useBS = False + self.useTDAQ = False - def setTool(self): - from AthenaCommon.AppMgr import ToolSvc - if not hasattr(ToolSvc, self.toolName): - from PixelConditionsTools.PixelConditionsToolsConf import PixelConditionsSummaryTool - ToolSvc += PixelConditionsSummaryTool(name = self.toolName) - self.tool = getattr(ToolSvc, self.toolName) + def setUseDCS(self, useDCS): + self.useDCS = useDCS + + def getUseDCS(self): + return self.useDCS + + def setUseBS(self, useBS): + self.useBS = useBS + + def getUseBS(self): + return self.useBS + + def setUseTDAQ(self, useTDAQ): + self.useTDAQ = useTDAQ + + def getUseTDAQ(self): + return self.useTDAQ def getTool(self): return self.tool @@ -23,5 +37,18 @@ class PixelConditionsSummaryToolSetup: def setToolName(self, toolName): self.toolName = toolName + def setTool(self): + from AthenaCommon.AppMgr import ToolSvc + if not hasattr(ToolSvc, "PixelDCSConditionsTool"): + from PixelConditionsTools.PixelDCSConditionsToolSetup import PixelDCSConditionsToolSetup + pixelDCSConditionsToolSetup = PixelDCSConditionsToolSetup() + pixelDCSConditionsToolSetup.setup() + + if not hasattr(ToolSvc, self.toolName): + from PixelConditionsTools.PixelConditionsToolsConf import PixelConditionsSummaryTool + ToolSvc += PixelConditionsSummaryTool(name=self.toolName, PixelDCSConditionsTool=ToolSvc.PixelDCSConditionsTool, UseDCS=self.useDCS, UseByteStream=self.useBS, UseTDAQ=self.useTDAQ) + self.tool = getattr(ToolSvc, self.toolName) + def setup(self): self.setTool() + diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelDCSConditionsToolSetup.py b/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelDCSConditionsToolSetup.py index cb21eef3975db340aad166208096814693491cb2..920db6ee08c2aeb816a9929d2286bc783b361912 100644 --- a/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelDCSConditionsToolSetup.py +++ b/InnerDetector/InDetConditions/PixelConditionsTools/python/PixelDCSConditionsToolSetup.py @@ -11,79 +11,20 @@ class PixelDCSConditionsToolSetup: self.dbInstance = "DCS_OFL" self.useDB = True - self.isDATA = True self.stateAlgName = "PixelDCSCondStateAlg" self.hvAlgName = "PixelDCSCondHVAlg" self.tempAlgName = "PixelDCSCondTempAlg" - self.stateAlg = None - self.hvAlg = None - self.tempAlg = None - - self.toolName = "InDetPixelDCSConditionsTool" + self.toolName = "PixelDCSConditionsTool" self.tool = None - def getStateFolder(self): - return self.stateFolder - - def getStatusFolder(self): - return self.statusFolder - - def getHVFolder(self): - return self.hvFolder - - def getTempFolder(self): - return self.tempFolder - - def setStateFolder(self, stateFolder): - self.stateFolder = stateFolder - - def setStatusFolder(self, statusFolder): - self.statusFolder = statusFolder - - def setHVFolder(self, hvFolder): - self.hvFolder = hvFolder - - def setTempFolder(self, tempFolder): - self.tempFolder = tempFolder - - def getDbInstance(self): - return self.dbInstance - - def setDbInstance(self, dbInstance): - self.dbInstance = dbInstance - def getUseDB(self): return self.useDB def setUseDB(self, useDB): self.useDB = useDB - def getIsDATA(self): - return self.isDATA - - def setIsDATA(self, isDATA): - self.isDATA = isDATA - - def getStateAlgName(self): - return self.stateAlgName - - def getHVAlgName(self): - return self.hvAlgName - - def getTempAlgName(self): - return self.tempAlgName - - def getStateAlg(self): - return self.stateAlg - - def getHVAlg(self): - return self.hvAlg - - def getTempAlg(self): - return self.tempAlg - def getToolName(self): return self.toolName @@ -94,44 +35,50 @@ class PixelDCSConditionsToolSetup: return self.tool def setFolders(self): + from AthenaCommon.GlobalFlags import globalflags from IOVDbSvc.CondDB import conddb + from AthenaCommon.AthenaCommonFlags import athenaCommonFlags + if athenaCommonFlags.isOnline(): + self.hvFolder = "/PIXEL/HLT/DCS/HV" + self.tempFolder = "/PIXEL/HLT/DCS/TEMPERATURE" + self.dbInstance = "PIXEL_ONL" + if (self.useDB): if not conddb.folderRequested(self.hvFolder): conddb.addFolder(self.dbInstance, self.hvFolder, className="CondAttrListCollection") if not conddb.folderRequested(self.tempFolder): conddb.addFolder(self.dbInstance, self.tempFolder, className="CondAttrListCollection") - if (self.isDATA): + if ((globalflags.DataSource=='data')): if not conddb.folderRequested(self.stateFolder): conddb.addFolder(self.dbInstance, self.stateFolder, className="CondAttrListCollection") if not conddb.folderRequested(self.statusFolder): conddb.addFolder(self.dbInstance, self.statusFolder, className="CondAttrListCollection") def setAlgs(self): + from AthenaCommon.GlobalFlags import globalflags from AthenaCommon.AlgSequence import AthSequencer condSeq = AthSequencer("AthCondSeq") - if (self.isDATA): + if ((globalflags.DataSource=='data')): if not hasattr(condSeq, self.stateAlgName): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondStateAlg condSeq += PixelDCSCondStateAlg(name = self.stateAlgName) - self.stateAlg = getattr(condSeq, self.stateAlgName) if not hasattr(condSeq, self.hvAlgName): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondHVAlg condSeq += PixelDCSCondHVAlg(name = self.hvAlgName, ReadKey = self.hvFolder) - self.hvAlg = getattr(condSeq, self.hvAlgName) if not hasattr(condSeq, self.tempAlgName): from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import PixelDCSCondTempAlg condSeq += PixelDCSCondTempAlg(name = self.tempAlgName, ReadKey = self.tempFolder) - self.tempAlg = getattr(condSeq, self.tempAlgName) def setTool(self): + from AthenaCommon.GlobalFlags import globalflags from AthenaCommon.AppMgr import ToolSvc if not hasattr(ToolSvc, self.toolName): from PixelConditionsTools.PixelConditionsToolsConf import PixelDCSConditionsTool - ToolSvc += PixelDCSConditionsTool(name=self.toolName, UseDB=self.useDB, IsDATA=self.isDATA) + ToolSvc += PixelDCSConditionsTool(name=self.toolName, UseDB=self.useDB, IsDATA=(globalflags.DataSource=='data')) self.tool = getattr(ToolSvc, self.toolName) def setup(self): diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx index 172f78d08da3dd888b5ec27576b976868a70efde..6be27fb13fb15a517e6b13776da06bee7f2680aa 100644 --- a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef SIMULATIONBASE @@ -9,7 +9,6 @@ #include "InDetIdentifier/PixelID.h" -#include "PixelConditionsServices/IPixelDCSSvc.h" #include "PixelConditionsServices/IPixelByteStreamErrorsSvc.h" #include "PixelConditionsServices/ISpecialPixelMapSvc.h" #include "PixelConditionsData/SpecialPixelMap.h" @@ -20,13 +19,11 @@ #include "PixelGeoModel/IBLParameterSvc.h" PixelConditionsSummaryTool::PixelConditionsSummaryTool(const std::string& type, const std::string& name, const IInterface* parent) - : - AthAlgTool(type, name, parent), + :AthAlgTool(type, name, parent), m_detStore("DetectorStore", name), m_pixelID(0), m_specialPixelMapKey("SpecialPixelMap"), m_specialPixelMapSvc("SpecialPixelMapSvc", name), - m_pixelDCSSvc("PixelDCSSvc", name), m_IBLParameterSvc("IBLParameterSvc",name), m_pixelBSErrorsSvc("PixelByteStreamErrorsSvc", name), m_pixelTDAQSvc("PixelTDAQSvc", name), @@ -53,86 +50,52 @@ PixelConditionsSummaryTool::PixelConditionsSummaryTool(const std::string& type, PixelConditionsSummaryTool::~PixelConditionsSummaryTool(){} - - - -//======== queryInterface, initialize, finalize - - StatusCode PixelConditionsSummaryTool::initialize(){ - msg(MSG::INFO) << "Initializing PixelConditionsSummaryTool" << endmsg; + ATH_MSG_DEBUG("PixelConditionsSummaryTool::initialize()"); + ATH_CHECK(m_specialPixelMapKey.initialize()); - StatusCode sc = setProperties(); - if( !sc.isSuccess() ){ - msg(MSG::FATAL) << "Unable to set properties" << endmsg; - return StatusCode::FAILURE; - } + ATH_CHECK(setProperties()); + if (m_IBLParameterSvc.retrieve().isFailure()) { msg(MSG::WARNING) << "Could not retrieve IBLParameterSvc" << endmsg; } else { m_IBLParameterSvc->setBoolParameters(m_useSpecialPixelMap,"EnableSpecialPixels"); } - sc = m_detStore.retrieve(); - if( !sc.isSuccess() ){ - msg(MSG::FATAL) << "Unable to retrieve detector store" << endmsg; - return StatusCode::FAILURE; - } - if(m_useDCS){ - if (StatusCode::SUCCESS!=m_pixelDCSSvc.retrieve()) { - msg(MSG::FATAL) << "Unable to retrieve PixelDCSSvc" << endmsg; - return StatusCode::FAILURE; - } - msg(MSG::INFO) << "PixelDCSSvc retrieved" << endmsg; - } + ATH_CHECK(m_detStore.retrieve()); - if(m_useBS){ - if (StatusCode::SUCCESS!=m_pixelBSErrorsSvc.retrieve()) { - msg(MSG::FATAL) << "Unable to retrieve PixelBSErrorSvc" << endmsg; - return StatusCode::FAILURE; - } - msg(MSG::INFO) << "PixelBSErrorsSvc retrieved" << endmsg; + if (m_useDCS) { + ATH_CHECK(m_DCSConditionsTool.retrieve()); } - sc = m_detStore->retrieve( m_pixelID, "PixelID" ); - if( !sc.isSuccess() ){ - ATH_MSG_FATAL( "Unable to retrieve pixel ID helper" ); - return StatusCode::FAILURE; + if (m_useBS) { + ATH_CHECK(m_pixelBSErrorsSvc.retrieve()); } - if(m_useSpecialPixelMap){ - sc = m_specialPixelMapSvc.retrieve(); + ATH_CHECK(m_detStore->retrieve(m_pixelID,"PixelID")); - if( !sc.isSuccess() ){ - msg(MSG::FATAL) << "Unable to retrieve SpecialPixelMapSvc" << endmsg; - return StatusCode::FAILURE; - } + if (m_useSpecialPixelMap) { + ATH_CHECK(m_specialPixelMapSvc.retrieve()); - if(m_specialPixelMapSvc->getNPixelMaps() == 0){ - msg(MSG::WARNING) << "No special pixel maps configured" << endmsg; - msg(MSG::WARNING) << "Disabling use of special pixel maps" << endmsg; + if (m_specialPixelMapSvc->getNPixelMaps()==0) { + ATH_MSG_WARNING("No special pixel maps configured"); + ATH_MSG_WARNING("Disabling use of special pixel maps"); m_useSpecialPixelMap = false; } - else{ + else { //Callback removed for athena MT } } - if(m_useTDAQ){ - sc = m_pixelTDAQSvc.retrieve(); - - if( !sc.isSuccess() ){ - ATH_MSG_FATAL("Unable to retrieve PixelTDAQSvc"); - return StatusCode::FAILURE; - } + if (m_useTDAQ) { + ATH_CHECK(m_pixelTDAQSvc.retrieve()); } return StatusCode::SUCCESS; } - StatusCode PixelConditionsSummaryTool::queryInterface(const InterfaceID& riid, void** ppvIf){ if(interfaceID() == riid){ @@ -150,22 +113,16 @@ StatusCode PixelConditionsSummaryTool::queryInterface(const InterfaceID& riid, v return StatusCode::SUCCESS; } +bool PixelConditionsSummaryTool::isActive(const Identifier & elementId, const InDetConditions::Hierarchy h) const { - -//======== isActive methods - - -bool PixelConditionsSummaryTool::isActive(const Identifier & elementId, const InDetConditions::Hierarchy h) const{ - - //Identifier moduleID = m_pixelID->wafer_id(elementId); IdentifierHash moduleHash = m_pixelID->wafer_hash(elementId); - if(m_useBS && !m_pixelBSErrorsSvc->isActive(moduleHash)) return false; + if (m_useBS && !m_pixelBSErrorsSvc->isActive(moduleHash)) { return false; } - if(m_useDCS){ + if (m_useDCS) { bool isDCSActive = false; - std::string dcsState = m_pixelDCSSvc->getFSMState(moduleHash); + std::string dcsState = m_DCSConditionsTool->PixelFSMState(moduleHash); for(unsigned int istate=0; istate<m_isActiveStates.size(); istate++){ if(m_isActiveStates[istate] == dcsState) isDCSActive = true; @@ -218,8 +175,7 @@ bool PixelConditionsSummaryTool::isActive(const IdentifierHash & elementHash) co if(m_useDCS){ bool isDCSActive = false; - std::string dcsState = m_pixelDCSSvc->getFSMState(elementHash); - + std::string dcsState = m_DCSConditionsTool->PixelFSMState(elementHash); for(unsigned int istate=0; istate<m_isActiveStates.size(); istate++){ if(m_isActiveStates[istate] == dcsState) isDCSActive = true; @@ -251,7 +207,7 @@ bool PixelConditionsSummaryTool::isActive(const IdentifierHash & elementHash, co if(m_useDCS){ bool isDCSActive = false; - std::string dcsState = m_pixelDCSSvc->getFSMState(elementHash); + std::string dcsState = m_DCSConditionsTool->PixelFSMState(elementHash); for(unsigned int istate=0; istate<m_isActiveStates.size(); istate++){ if(m_isActiveStates[istate] == dcsState) isDCSActive = true; @@ -291,7 +247,7 @@ double PixelConditionsSummaryTool::activeFraction(const IdentifierHash & element if(m_useDCS){ bool isDCSActive = false; - std::string dcsState = m_pixelDCSSvc->getFSMState(elementHash); + std::string dcsState = m_DCSConditionsTool->PixelFSMState(elementHash); for(unsigned int istate=0; istate<m_isActiveStates.size(); istate++){ if(m_isActiveStates[istate] == dcsState) isDCSActive = true; @@ -365,10 +321,9 @@ bool PixelConditionsSummaryTool::isGood(const Identifier & elementId, const InDe if(m_useDCS){ bool isDCSActive = false; - std::string dcsState = m_pixelDCSSvc->getFSMState(moduleHash); + std::string dcsState = m_DCSConditionsTool->PixelFSMState(moduleHash); bool isDCSGood = false; - std::string dcsStatus = m_pixelDCSSvc->getFSMStatus(moduleHash); - + std::string dcsStatus = m_DCSConditionsTool->PixelFSMStatus(moduleHash); for(unsigned int istate=0; istate<m_isActiveStates.size(); istate++){ if(m_isActiveStates[istate] == dcsState) isDCSActive = true; @@ -439,9 +394,9 @@ bool PixelConditionsSummaryTool::isGood(const IdentifierHash & elementHash) cons if(m_useDCS){ bool isDCSActive = false; - std::string dcsState = m_pixelDCSSvc->getFSMState(elementHash); + std::string dcsState = m_DCSConditionsTool->PixelFSMState(elementHash); bool isDCSGood = false; - std::string dcsStatus = m_pixelDCSSvc->getFSMStatus(elementHash); + std::string dcsStatus = m_DCSConditionsTool->PixelFSMStatus(elementHash); for(unsigned int istate=0; istate<m_isActiveStates.size(); istate++){ if(m_isActiveStates[istate] == dcsState) isDCSActive = true; @@ -476,9 +431,9 @@ bool PixelConditionsSummaryTool::isGood(const IdentifierHash & elementHash, cons if(m_useDCS){ bool isDCSActive = false; - std::string dcsState = m_pixelDCSSvc->getFSMState(elementHash); + std::string dcsState = m_DCSConditionsTool->PixelFSMState(elementHash); bool isDCSGood = false; - std::string dcsStatus = m_pixelDCSSvc->getFSMStatus(elementHash); + std::string dcsStatus = m_DCSConditionsTool->PixelFSMStatus(elementHash); for(unsigned int istate=0; istate<m_isActiveStates.size(); istate++){ if(m_isActiveStates[istate] == dcsState) isDCSActive = true; @@ -520,9 +475,9 @@ double PixelConditionsSummaryTool::goodFraction(const IdentifierHash & elementHa if(m_useDCS){ bool isDCSActive = false; - std::string dcsState = m_pixelDCSSvc->getFSMState(elementHash); + std::string dcsState = m_DCSConditionsTool->PixelFSMState(elementHash); bool isDCSGood = false; - std::string dcsStatus = m_pixelDCSSvc->getFSMStatus(elementHash); + std::string dcsStatus = m_DCSConditionsTool->PixelFSMStatus(elementHash); for(unsigned int istate=0; istate<m_isActiveStates.size(); istate++){ if(m_isActiveStates[istate] == dcsState) isDCSActive = true; diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.h b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.h index 79171225341f0ed316be68502e386c08ca6543b5..24939e78eb295c16916e65da364579695c4e7388 100644 --- a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.h +++ b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelConditionsSummaryTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef PIXELCONDITIONSSERVICES_PIXELCONDITIONSSUMMARYTOOL_H @@ -13,11 +13,11 @@ #include "InDetConditionsSummaryService/IInDetConditionsTool.h" #include "InDetConditionsSummaryService/InDetHierarchy.h" +#include "PixelConditionsTools/IPixelDCSConditionsTool.h" class Identifier; class IdentifierHash; class PixelID; -class IPixelDCSSvc; class IPixelByteStreamErrorsSvc; class ISpecialPixelMapSvc; class DetectorSpecialPixelMap; @@ -25,60 +25,46 @@ class StoreGateSvc; class IPixelTDAQSvc; class IBLParameterSvc; - -/** - * Returns the status of pixel modules, frontends or single pixels - * as determined by the PixelDCSSvc, PixelByteStreamErrorsSvc and SpecialPixelMapSvc. - * - * ruwiedel@physik.uni-bonn.de - * - */ - - - class PixelConditionsSummaryTool: public AthAlgTool, public IInDetConditionsTool{ + public: + static InterfaceID& interfaceID(); - public: - static InterfaceID& interfaceID(); - - PixelConditionsSummaryTool(const std::string& type, const std::string& name, const IInterface* parent); - virtual ~PixelConditionsSummaryTool(); - - virtual StatusCode initialize() override; - - virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvIf) override; + PixelConditionsSummaryTool(const std::string& type, const std::string& name, const IInterface* parent); + virtual ~PixelConditionsSummaryTool(); + virtual StatusCode initialize() override; + virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvIf) override; - virtual bool isActive(const Identifier & elementId, const InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override final; - virtual bool isActive(const IdentifierHash & elementHash) const override final; - virtual bool isActive(const IdentifierHash & elementHash, const Identifier & elementId) const override final; - virtual double activeFraction(const IdentifierHash & elementHash, const Identifier & idStart, const Identifier & idEnd) const override final; + virtual bool isActive(const Identifier & elementId, const InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override final; + virtual bool isActive(const IdentifierHash & elementHash) const override final; + virtual bool isActive(const IdentifierHash & elementHash, const Identifier & elementId) const override final; + virtual double activeFraction(const IdentifierHash & elementHash, const Identifier & idStart, const Identifier & idEnd) const override final; - virtual bool isGood(const Identifier & elementId, const InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override final; - virtual bool isGood(const IdentifierHash & elementHash) const override final; - virtual bool isGood(const IdentifierHash & elementHash, const Identifier & elementId) const override final; - virtual double goodFraction(const IdentifierHash & elementHash, const Identifier & idStart, const Identifier & idEnd) const override final; + virtual bool isGood(const Identifier & elementId, const InDetConditions::Hierarchy h=InDetConditions::DEFAULT) const override final; + virtual bool isGood(const IdentifierHash & elementHash) const override final; + virtual bool isGood(const IdentifierHash & elementHash, const Identifier & elementId) const override final; + virtual double goodFraction(const IdentifierHash & elementHash, const Identifier & idStart, const Identifier & idEnd) const override final; -private: - ServiceHandle< StoreGateSvc > m_detStore; + private: + ServiceHandle< StoreGateSvc > m_detStore; - const PixelID* m_pixelID; + const PixelID* m_pixelID; - SG::ReadCondHandleKey< DetectorSpecialPixelMap> m_specialPixelMapKey; + SG::ReadCondHandleKey< DetectorSpecialPixelMap> m_specialPixelMapKey; - ServiceHandle< ISpecialPixelMapSvc > m_specialPixelMapSvc; - ServiceHandle< IPixelDCSSvc > m_pixelDCSSvc; - ServiceHandle< IBLParameterSvc> m_IBLParameterSvc; - ServiceHandle< IPixelByteStreamErrorsSvc > m_pixelBSErrorsSvc; - ServiceHandle< IPixelTDAQSvc > m_pixelTDAQSvc; - std::vector<std::string> m_isActiveStatus; - std::vector<std::string> m_isActiveStates; + ServiceHandle< ISpecialPixelMapSvc > m_specialPixelMapSvc; + ToolHandle<IPixelDCSConditionsTool> m_DCSConditionsTool{this, "PixelDCSConditionsTool", "PixelDCSConditionsTool", "Tool to retrieve Pixel information"}; + ServiceHandle< IBLParameterSvc> m_IBLParameterSvc; + ServiceHandle< IPixelByteStreamErrorsSvc > m_pixelBSErrorsSvc; + ServiceHandle< IPixelTDAQSvc > m_pixelTDAQSvc; + std::vector<std::string> m_isActiveStatus; + std::vector<std::string> m_isActiveStates; - bool m_useSpecialPixelMap; - bool m_useDCS; - bool m_useBS; - bool m_useTDAQ; + bool m_useSpecialPixelMap; + bool m_useDCS; + bool m_useBS; + bool m_useTDAQ; - void getID(const Identifier& id, unsigned int& pixID, unsigned int& mchips) const; + void getID(const Identifier& id, unsigned int& pixID, unsigned int& mchips) const; }; diff --git a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelDCSConditionsTool.cxx b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelDCSConditionsTool.cxx index 3357c0e2ba989735d6baeac03785654f56b3c6a3..8838b5672c7a55a0cdb5b775d4c5c82918ceb95a 100644 --- a/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelDCSConditionsTool.cxx +++ b/InnerDetector/InDetConditions/PixelConditionsTools/src/PixelDCSConditionsTool.cxx @@ -10,7 +10,7 @@ PixelDCSConditionsTool::PixelDCSConditionsTool(const std::string& type, const st m_pixid(nullptr), m_useDB(true), m_isDATA(true), - m_defaultTemperature(-5.0), + m_defaultTemperature(-7.0), m_defaultBiasVoltage(150.0), m_defaultDepletionVoltage(40.0) { diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/PixelLorentzAngleToolSetup.py b/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/PixelLorentzAngleToolSetup.py index 073fb289495da5d55ceaf5e8b6f52c8be52a1c60..24409985d422c162ed6cfcdc8d31d9eb77fad6cd 100644 --- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/PixelLorentzAngleToolSetup.py +++ b/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/PixelLorentzAngleToolSetup.py @@ -3,40 +3,29 @@ class PixelLorentzAngleToolSetup: "Class to simplify setup of PixelLorentzAngleTool" def __init__(self): - from PixelConditionsTools.PixelDCSConditionsToolSetup import PixelDCSConditionsToolSetup - pixelDCSConditionsToolSetup = PixelDCSConditionsToolSetup() - - # CHECK CHECK!!! For HLT - from AthenaCommon.AthenaCommonFlags import athenaCommonFlags - - if athenaCommonFlags.isOnline(): - from AthenaCommon.GlobalFlags import globalflags - pixelDCSConditionsToolSetup.setDbInstance("PIXEL_ONL") - pixelDCSConditionsToolSetup.setHVFolder("/PIXEL/HLT/DCS/HV") - pixelDCSConditionsToolSetup.setTempFolder("/PIXEL/HLT/DCS/TEMPERATURE") - - pixelDCSConditionsToolSetup.setup() + from AthenaCommon.AppMgr import ToolSvc + if not hasattr(ToolSvc, "PixelDCSConditionsTool"): + from PixelConditionsTools.PixelDCSConditionsToolSetup import PixelDCSConditionsToolSetup + pixelDCSConditionsToolSetup = PixelDCSConditionsToolSetup() + pixelDCSConditionsToolSetup.setup() - from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup - pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup() - pixelSiPropertiesToolSetup.setSiliconTool(pixelDCSConditionsToolSetup.getTool()) - pixelSiPropertiesToolSetup.setup() + if not hasattr(ToolSvc, "PixelSiPropertiesTool"): + from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup + pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup() + pixelSiPropertiesToolSetup.setup() - # Set up PixelSiLorentzAngleCondAlg from AthenaCommon.AlgSequence import AthSequencer condSeq = AthSequencer("AthCondSeq") if not hasattr(condSeq, "PixelSiLorentzAngleCondAlg"): from SiLorentzAngleSvc.SiLorentzAngleSvcConf import PixelSiLorentzAngleCondAlg from AthenaCommon.AthenaCommonFlags import athenaCommonFlags condSeq += PixelSiLorentzAngleCondAlg(name = "PixelSiLorentzAngleCondAlg", - PixelDCSConditionsTool = pixelDCSConditionsToolSetup.getTool(), - SiPropertiesTool = pixelSiPropertiesToolSetup.getTool(), + PixelDCSConditionsTool = ToolSvc.PixelDCSConditionsTool, + SiPropertiesTool = ToolSvc.PixelSiPropertiesTool, UseMagFieldSvc = True, UseMagFieldDcs = (not athenaCommonFlags.isOnline())) pixelSiLorentzAngleCondAlg = condSeq.PixelSiLorentzAngleCondAlg - # Set up PixelLorentzAngleTool - from AthenaCommon.AppMgr import ToolSvc if not hasattr(ToolSvc, "PixelLorentzAngleTool"): from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SiLorentzAngleTool ToolSvc += SiLorentzAngleTool(name="PixelLorentzAngleTool", DetectorName="Pixel", SiLorentzAngleCondData="PixelSiLorentzAngleCondData") diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/python/PixelSiPropertiesToolSetup.py b/InnerDetector/InDetConditions/SiPropertiesSvc/python/PixelSiPropertiesToolSetup.py index 7d1f116f0e9fff109c3d5226952bffbb2bd1f1d4..19d6e2168b1ad6c37e332a15a97101d288c3fecd 100644 --- a/InnerDetector/InDetConditions/SiPropertiesSvc/python/PixelSiPropertiesToolSetup.py +++ b/InnerDetector/InDetConditions/SiPropertiesSvc/python/PixelSiPropertiesToolSetup.py @@ -8,7 +8,7 @@ class PixelSiPropertiesToolSetup: self.alg = None self.toolName = "PixelSiPropertiesTool" self.tool = None - self.siliconTool = None +# self.siliconTool = None def getAlgName(self): return self.algName @@ -28,23 +28,21 @@ class PixelSiPropertiesToolSetup: def getTool(self): return self.tool - def setSiliconTool(self, siliconTool): - self.siliconTool = siliconTool +# def setSiliconTool(self, siliconTool): +# self.siliconTool = siliconTool def setAlg(self): + from AthenaCommon.AppMgr import ToolSvc + if not hasattr(ToolSvc, "PixelDCSConditionsTool"): + from PixelConditionsTools.PixelDCSConditionsToolSetup import PixelDCSConditionsToolSetup + pixelDCSConditionsToolSetup = PixelDCSConditionsToolSetup() + pixelDCSConditionsToolSetup.setup() + from AthenaCommon.AlgSequence import AthSequencer condSeq = AthSequencer("AthCondSeq") - if not hasattr(condSeq, self.algName): from SiPropertiesSvc.SiPropertiesSvcConf import PixelSiPropertiesCondAlg - condSeq += PixelSiPropertiesCondAlg(name = self.algName) - -# if self.siliconTool is None: -# condSeq += PixelSiPropertiesCondAlg(name = self.algName) -# else: -# condSeq += PixelSiPropertiesCondAlg(name = self.algName, -# SiConditionsTool = self.siliconTool) - + condSeq += PixelSiPropertiesCondAlg(name = self.algName, PixelDCSConditionsTool=ToolSvc.PixelDCSConditionsTool) self.alg = getattr(condSeq, self.algName) def setTool(self): diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/src/PixelSiPropertiesCondAlg.cxx b/InnerDetector/InDetConditions/SiPropertiesSvc/src/PixelSiPropertiesCondAlg.cxx index 3420d27caffca7cb0330de1cfd94b350984092d2..b90eefeee932398802a7092bc1c119704b391e36 100644 --- a/InnerDetector/InDetConditions/SiPropertiesSvc/src/PixelSiPropertiesCondAlg.cxx +++ b/InnerDetector/InDetConditions/SiPropertiesSvc/src/PixelSiPropertiesCondAlg.cxx @@ -19,7 +19,7 @@ PixelSiPropertiesCondAlg::PixelSiPropertiesCondAlg(const std::string& name, ISvc } StatusCode PixelSiPropertiesCondAlg::initialize() { - ATH_MSG_INFO("PixelSiPropertiesCondAlg::initialize()"); + ATH_MSG_DEBUG("PixelSiPropertiesCondAlg::initialize()"); ATH_CHECK(detStore()->retrieve(m_detManager,"Pixel")); ATH_CHECK(detStore()->retrieve(m_pixid,"PixelID")); @@ -39,7 +39,7 @@ StatusCode PixelSiPropertiesCondAlg::initialize() { } StatusCode PixelSiPropertiesCondAlg::execute() { - ATH_MSG_INFO("PixelSiPropertiesCondAlg::execute()"); + ATH_MSG_DEBUG("PixelSiPropertiesCondAlg::execute()"); SG::WriteCondHandle<InDet::SiliconPropertiesVector> writeHandle(m_writeKey); if (writeHandle.isValid()) { @@ -116,7 +116,7 @@ StatusCode PixelSiPropertiesCondAlg::execute() { } StatusCode PixelSiPropertiesCondAlg::finalize() { - ATH_MSG_INFO("PixelSiPropertiesCondAlg::finalize()"); + ATH_MSG_DEBUG("PixelSiPropertiesCondAlg::finalize()"); return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiCommonItems.h b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiCommonItems.h index b5c4defb1369800fb7daebb82a9a5350fc7987c0..b273978107634add537508fa7f3d33ccc2c6e92d 100755 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiCommonItems.h +++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/InDetReadoutGeometry/SiCommonItems.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -19,6 +19,7 @@ class AtlasDetectorID; #include "CLHEP/Geometry/Transform3D.h" #include "GeoModelKernel/RCBase.h" #include "InDetCondServices/ISiLorentzAngleSvc.h" +#include "InDetCondServices/ISiLorentzAngleTool.h" namespace InDetDD { @@ -44,7 +45,9 @@ namespace InDetDD { const HepGeom::Transform3D & solenoidFrame() const; void setSolenoidFrame(const HepGeom::Transform3D & transform) const; void setLorentzAngleSvc(const ServiceHandle<ISiLorentzAngleSvc> & lorentzAngleSvc); + void setLorentzAngleTool(const ISiLorentzAngleTool* lorentzAngleTool); ISiLorentzAngleSvc * lorentzAngleSvc() const; + const ISiLorentzAngleTool * lorentzAngleTool() const; //Declaring the Message method for further use MsgStream& msg (MSG::Level lvl) const { return m_msg.get() << lvl; } @@ -62,6 +65,7 @@ namespace InDetDD { ServiceHandle<ISiLorentzAngleSvc> m_lorentzAngleSvcHandle; mutable ISiLorentzAngleSvc * m_lorentzAngleSvc; mutable bool m_lorentzAngleSvcInit; + const ISiLorentzAngleTool *m_lorentzAngleTool; }; diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiCommonItems.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiCommonItems.cxx index 87645052270356b23fddf608a89d2bd75228b9fc..d15097bc2b8ac7c1de68791addc7e1611ec33b43 100755 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiCommonItems.cxx +++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiCommonItems.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "InDetReadoutGeometry/SiCommonItems.h" @@ -13,6 +13,7 @@ SiCommonItems::SiCommonItems(const AtlasDetectorID* const idHelper) m_idHelper(idHelper), m_lorentzAngleSvcHandle("", "SiDetectorElement"), m_lorentzAngleSvc(0), + m_lorentzAngleTool(0), m_lorentzAngleSvcInit(false) {} @@ -27,6 +28,10 @@ SiCommonItems::setLorentzAngleSvc(const ServiceHandle<ISiLorentzAngleSvc> & lore { m_lorentzAngleSvcHandle = lorentzAngleSvc; } + +void SiCommonItems::setLorentzAngleTool(const ISiLorentzAngleTool* lorentzAngleTool) { + m_lorentzAngleTool = lorentzAngleTool; +} ISiLorentzAngleSvc * SiCommonItems::lorentzAngleSvc() const @@ -43,4 +48,9 @@ SiCommonItems::lorentzAngleSvc() const } return m_lorentzAngleSvc; } + +const ISiLorentzAngleTool* SiCommonItems::lorentzAngleTool() const { + return m_lorentzAngleTool; +} + } // End namespace InDetDD diff --git a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx index 8da438e4cd624faaa95433a9e46e0e4edc5ebef6..8b404ed8ceed6842d34685c22a712c43ffa16445 100755 --- a/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx +++ b/InnerDetector/InDetDetDescr/InDetReadoutGeometry/src/SiDetectorElement.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /** @@ -373,20 +373,9 @@ SiDetectorElement::updateConditionsCache() const { m_conditionsCacheValid = true; - // - // Lorentz Angle related stuff - // - - if (isPixel() and m_commonItems->lorentzAngleSvc()) { - m_tanLorentzAnglePhi = m_commonItems->lorentzAngleSvc()->getTanLorentzAngle(m_idHash); - m_tanLorentzAngleEta = m_commonItems->lorentzAngleSvc()->getTanLorentzAngleEta(m_idHash); - m_lorentzCorrection = m_commonItems->lorentzAngleSvc()->getLorentzShift(m_idHash); - } else { - // Set to zero - m_tanLorentzAnglePhi = 0.; - m_tanLorentzAngleEta = 0.; - m_lorentzCorrection = 0.; - } + m_tanLorentzAnglePhi = 0.; + m_tanLorentzAngleEta = 0.; + m_lorentzCorrection = 0.; } diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/PixelFastDigitizationTool.h b/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/PixelFastDigitizationTool.h index 0d1e95c0285735060c9e8a687d52000415088109..444c7d9f413cfa26001a368067585aa1653529d0 100644 --- a/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/PixelFastDigitizationTool.h +++ b/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/PixelFastDigitizationTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -24,6 +24,8 @@ #include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/ServiceHandle.h" +#include "InDetCondServices/ISiLorentzAngleTool.h" + #include <string> #include <vector> #include <list> @@ -87,6 +89,7 @@ private: const PixelID* m_pixel_ID; //!< Handle to the ID helper ToolHandle<InDet::ClusterMakerTool> m_clusterMaker; //!< ToolHandle to ClusterMaker + ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool{this, "LorentzAngleTool", "PixelLorentzAngleTool", "Tool to retreive Lorentz angle"}; bool m_pixUseClusterMaker; //!< use the pixel cluster maker or not InDet::PixelClusterContainer* m_pixelClusterContainer; //!< the PixelClusterContainer diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py b/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py index 90eccd9cbbe4a49b16a7c2227072f58f1cc1fff3..4ccced8a2cfd875cc992d8fd058976bf146df9b6 100644 --- a/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py +++ b/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration # The earliest bunch crossing time for which interactions will be sent # to the Fast Pixel Digitization code. @@ -74,6 +74,12 @@ def FastClusterMakerTool(name="FastClusterMakerTool", **kwargs): return CfgMgr.InDet__ClusterMakerTool(name,**kwargs) def commonPixelFastDigitizationConfig(name,**kwargs): + + # Setup the DCS folders and tool used in the sctSiliconConditionsTool + from PixelConditionsTools.PixelDCSConditionsToolSetup import PixelDCSConditionsToolSetup + pixelDCSConditionsToolSetup = PixelDCSConditionsToolSetup() + pixelDCSConditionsToolSetup.setup() + kwargs.setdefault("ClusterMaker", "FastClusterMakerTool") # Import Digitization job properties @@ -89,6 +95,13 @@ def commonPixelFastDigitizationConfig(name,**kwargs): kwargs.setdefault("FirstXing", FastPixel_FirstXing()) kwargs.setdefault("LastXing", FastPixel_LastXing() ) + # SiLorentzAngleTool for PixelFastDigitizationTool + from AthenaCommon.AppMgr import ToolSvc + if not hasattr(ToolSvc, "PixelLorentzAngleTool"): + from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup + pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() + kwargs.setdefault("LorentzAngleTool", ToolSvc.PixelLorentzAngleTool) + from AthenaCommon import CfgMgr return CfgMgr.PixelFastDigitizationTool(name,**kwargs) diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/src/PixelFastDigitizationTool.cxx b/InnerDetector/InDetDigitization/FastSiDigitization/src/PixelFastDigitizationTool.cxx index 38be93716dc9334de97dcc6fa769d54b3f0ee61f..03fe9ccf14a2e98f83b99b3a0c12ceae7e927a6c 100644 --- a/InnerDetector/InDetDigitization/FastSiDigitization/src/PixelFastDigitizationTool.cxx +++ b/InnerDetector/InDetDigitization/FastSiDigitization/src/PixelFastDigitizationTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ //////////////////////////////////////////////////////////////////////////// @@ -208,6 +208,7 @@ StatusCode PixelFastDigitizationTool::initialize() ATH_MSG_DEBUG ( m_gangedAmbiguitiesFinder.propertyName() << ": Retrieved tool " << m_gangedAmbiguitiesFinder.type() ); } + ATH_CHECK(m_lorentzAngleTool.retrieve()); return StatusCode::SUCCESS; } @@ -589,10 +590,11 @@ StatusCode PixelFastDigitizationTool::digitize() // the delta ranges int deltaRawPhi = 0; // apply the lorentz correction - const double tanLorAng = m_pixTanLorentzAngleScalor*hitSiDetElement->getTanLorentzAnglePhi(); + const IdentifierHash detElHash = hitSiDetElement->identifyHash(); + const double tanLorAng = m_pixTanLorentzAngleScalor*m_lorentzAngleTool->getTanLorentzAngle(detElHash); const int lorentzDirection = tanLorAng > 0. ? 1 : -1; // shift parameters - const double shift = hitSiDetElement->getLorentzCorrection(); + const double shift = m_lorentzAngleTool->getLorentzShift(detElHash); // validation filling // lorenz angle effects : offset goes against the lorentzAngle diff --git a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py index 8d37a1e8a3fcfb8a027ddfaa838a381b9d05a102..0f2ecacc76672c500d57dcb5b6ba2924ba50a52c 100644 --- a/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py +++ b/InnerDetector/InDetDigitization/PixelDigitization/python/PixelDigitizationConfig.py @@ -43,35 +43,30 @@ def EnergyDepositionTool(name="EnergyDepositionTool", **kwargs): return CfgMgr.EnergyDepositionTool(name, **kwargs) def SensorSimPlanarTool(name="SensorSimPlanarTool", **kwargs): - from PixelConditionsTools.PixelDCSConditionsToolSetup import PixelDCSConditionsToolSetup - pixelDCSConditionsToolSetup = PixelDCSConditionsToolSetup() - pixelDCSConditionsToolSetup.setIsDATA(False) - pixelDCSConditionsToolSetup.setup() - from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup - pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup() - pixelSiPropertiesToolSetup.setSiliconTool(pixelDCSConditionsToolSetup.getTool()) - pixelSiPropertiesToolSetup.setup() from AthenaCommon.AppMgr import ToolSvc + if not hasattr(ToolSvc, "PixelSiPropertiesTool"): + from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup + pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup() + pixelSiPropertiesToolSetup.setup() if not hasattr(ToolSvc, "PixelLorentzAngleTool"): from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() - - kwargs.setdefault("SiPropertiesTool", pixelSiPropertiesToolSetup.getTool()) + kwargs.setdefault("SiPropertiesTool", ToolSvc.PixelSiPropertiesTool) kwargs.setdefault("LorentzAngleTool", ToolSvc.PixelLorentzAngleTool) kwargs.setdefault("RndmSvc", digitizationFlags.rndmSvc()) kwargs.setdefault("RndmEngine", "PixelDigitization") return CfgMgr.SensorSimPlanarTool(name, **kwargs) def SensorSim3DTool(name="SensorSim3DTool", **kwargs): - from PixelConditionsTools.PixelDCSConditionsToolSetup import PixelDCSConditionsToolSetup - pixelDCSConditionsToolSetup = PixelDCSConditionsToolSetup() - pixelDCSConditionsToolSetup.setIsDATA(False) - pixelDCSConditionsToolSetup.setup() - from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup - pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup() - pixelSiPropertiesToolSetup.setSiliconTool(pixelDCSConditionsToolSetup.getTool()) - pixelSiPropertiesToolSetup.setup() - kwargs.setdefault("SiPropertiesTool", pixelSiPropertiesToolSetup.getTool()) + from AthenaCommon.AppMgr import ToolSvc + if not hasattr(ToolSvc, "PixelSiPropertiesTool"): + from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup + pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup() + pixelSiPropertiesToolSetup.setup() + if not hasattr(ToolSvc, "PixelLorentzAngleTool"): + from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup + pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() + kwargs.setdefault("SiPropertiesTool", ToolSvc.PixelSiPropertiesTool) kwargs.setdefault("RndmSvc", digitizationFlags.rndmSvc()) kwargs.setdefault("RndmEngine", "PixelDigitization") return CfgMgr.SensorSim3DTool(name, **kwargs) @@ -82,8 +77,14 @@ def SensorSimTool(name="SensorSimTool", **kwargs): return CfgMgr.SensorSimTool(name, **kwargs) def FrontEndSimTool(name="FrontEndSimTool", **kwargs): + from AthenaCommon.AppMgr import ToolSvc + if not hasattr(ToolSvc, "PixelConditionsSummaryTool"): + from PixelConditionsTools.PixelConditionsSummaryToolSetup import PixelConditionsSummaryToolSetup + pixelConditionsSummaryToolSetup = PixelConditionsSummaryToolSetup() + pixelConditionsSummaryToolSetup.setup() kwargs.setdefault("RndmSvc", digitizationFlags.rndmSvc()) kwargs.setdefault("RndmEngine", "PixelDigitization") + kwargs.setdefault("PixelConditionsSummaryTool", ToolSvc.PixelConditionsSummaryTool) from AthenaCommon.BeamFlags import jobproperties if jobproperties.Beam.beamType == "cosmics" : kwargs.setdefault("UseComTime", True) diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/FEI3SimTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/FEI3SimTool.cxx index 0561a69fce87aac97856ac7fbf08f5e0b09512d9..a98c5ba48c533a547b6efbd73dffbc6a9abb06c1 100644 --- a/InnerDetector/InDetDigitization/PixelDigitization/src/FEI3SimTool.cxx +++ b/InnerDetector/InDetDigitization/PixelDigitization/src/FEI3SimTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "FEI3SimTool.h" @@ -131,7 +131,7 @@ void FEI3SimTool::process(SiChargedDiodeCollection &chargedDiodes,PixelRDO_Colle if (SiHelper::isMaskOut((*i_chargedDiode).second)) { continue; } if (SiHelper::isDisabled((*i_chargedDiode).second)) { continue; } - if (!m_pixelConditionsSvc->isActive(moduleHash,diodeID)) { + if (!m_pixelConditionsTool->isActive(moduleHash,diodeID)) { SiHelper::disabled((*i_chargedDiode).second,true,true); continue; } diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/FEI4SimTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/FEI4SimTool.cxx index f0963fdc3745e79c0c34227845a07314dc8fbe75..9f2eeabab0975c76d98ab9668441a9097aec3627 100644 --- a/InnerDetector/InDetDigitization/PixelDigitization/src/FEI4SimTool.cxx +++ b/InnerDetector/InDetDigitization/PixelDigitization/src/FEI4SimTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "FEI4SimTool.h" @@ -117,7 +117,7 @@ void FEI4SimTool::process(SiChargedDiodeCollection &chargedDiodes,PixelRDO_Colle if (SiHelper::isMaskOut((*i_chargedDiode).second)) { continue; } if (SiHelper::isDisabled((*i_chargedDiode).second)) { continue; } - if (!m_pixelConditionsSvc->isActive(moduleHash,diodeID)) { + if (!m_pixelConditionsTool->isActive(moduleHash,diodeID)) { SiHelper::disabled((*i_chargedDiode).second,true,true); continue; } diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/FrontEndSimTool.h b/InnerDetector/InDetDigitization/PixelDigitization/src/FrontEndSimTool.h index 29eb633bcdd2f0b7ab998aa1b6c43989976a7388..b0bdff0d5103af41f55f07053b7aba9544356e36 100644 --- a/InnerDetector/InDetDigitization/PixelDigitization/src/FrontEndSimTool.h +++ b/InnerDetector/InDetDigitization/PixelDigitization/src/FrontEndSimTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef PIXELDIGITIZATION_FrontEndSimTool_H @@ -17,7 +17,7 @@ #include "SiDigitization/SiChargedDiodeCollection.h" #include "InDetRawData/InDetRawDataCLASS_DEF.h" -#include "InDetConditionsSummaryService/IInDetConditionsSvc.h" +#include "InDetConditionsSummaryService/IInDetConditionsTool.h" #include "PixelConditionsServices/IPixelCalibSvc.h" #include "InDetSimEvent/SiTotalCharge.h" @@ -40,7 +40,6 @@ class FrontEndSimTool:public AthAlgTool,virtual public IAlgTool { m_rndmSvc("AtRndmGenSvc",name), m_rndmEngineName("PixelDigitization"), m_rndmEngine(nullptr), - m_pixelConditionsSvc("PixelConditionsSummarySvc",name), m_pixelCalibSvc("PixelCalibSvc",name), m_timeBCN(1), m_timeZero(5.0), @@ -63,7 +62,6 @@ class FrontEndSimTool:public AthAlgTool,virtual public IAlgTool { declareInterface<FrontEndSimTool>(this); declareProperty("RndmSvc", m_rndmSvc, "Random number service used in FE simulation"); declareProperty("RndmEngine", m_rndmEngineName, "Random engine name"); - declareProperty("PixelConditionsSummarySvc", m_pixelConditionsSvc); declareProperty("PixelCalibSvc", m_pixelCalibSvc); declareProperty("TimeBCN", m_timeBCN, "Number of BCID"); declareProperty("TimeZero", m_timeZero, "Time zero...?"); @@ -84,13 +82,13 @@ class FrontEndSimTool:public AthAlgTool,virtual public IAlgTool { static const InterfaceID& interfaceID() { return IID_IFrontEndSimTool; } virtual StatusCode initialize() { - CHECK(AthAlgTool::initialize()); + ATH_CHECK(AthAlgTool::initialize()); - CHECK(m_rndmSvc.retrieve()); + ATH_CHECK(m_rndmSvc.retrieve()); - CHECK(m_pixelConditionsSvc.retrieve()); + ATH_CHECK(m_pixelConditionsTool.retrieve()); - CHECK(m_pixelCalibSvc.retrieve()); + ATH_CHECK(m_pixelCalibSvc.retrieve()); m_rndmEngine = m_rndmSvc->GetEngine(m_rndmEngineName); if (!m_rndmEngine) { @@ -205,7 +203,7 @@ class FrontEndSimTool:public AthAlgTool,virtual public IAlgTool { std::string m_rndmEngineName; CLHEP::HepRandomEngine *m_rndmEngine; - ServiceHandle<IInDetConditionsSvc> m_pixelConditionsSvc; + ToolHandle<IInDetConditionsTool> m_pixelConditionsTool{this, "PixelConditionsSummaryTool", "PixelConditionsSummaryTool", "Tool to retrieve Pixel Conditions summary"}; ServiceHandle<IPixelCalibSvc> m_pixelCalibSvc; double m_timeBCN; diff --git a/InnerDetector/InDetDigitization/PixelDigitization/src/RD53SimTool.cxx b/InnerDetector/InDetDigitization/PixelDigitization/src/RD53SimTool.cxx index c6969ff8722801d9e2ba105009512ac4a89c68fa..44fd06288309f71a437cdab128b32b7f599f5610 100644 --- a/InnerDetector/InDetDigitization/PixelDigitization/src/RD53SimTool.cxx +++ b/InnerDetector/InDetDigitization/PixelDigitization/src/RD53SimTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "RD53SimTool.h" @@ -110,7 +110,7 @@ void RD53SimTool::process(SiChargedDiodeCollection &chargedDiodes,PixelRDO_Colle if (SiHelper::isMaskOut((*i_chargedDiode).second)) { continue; } if (SiHelper::isDisabled((*i_chargedDiode).second)) { continue; } - if (!m_pixelConditionsSvc->isActive(moduleHash,diodeID)) { + if (!m_pixelConditionsTool->isActive(moduleHash,diodeID)) { SiHelper::disabled((*i_chargedDiode).second,true,true); continue; } diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/CMakeLists.txt b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/CMakeLists.txt index 7ef19fe4e40e3bd63a9a5c202161a662bb194b55..34e9f8ce7c64ef059b8f0b534e88c489f308b77d 100644 --- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/CMakeLists.txt +++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/CMakeLists.txt @@ -14,6 +14,7 @@ atlas_depends_on_subdirs( PUBLIC DetectorDescription/Identifier Event/xAOD/xAODTracking InnerDetector/InDetConditions/PixelConditionsServices + InnerDetector/InDetConditions/PixelConditionsTools InnerDetector/InDetConditions/InDetCondServices InnerDetector/InDetConditions/TRT_ConditionsServices InnerDetector/InDetDetDescr/InDetIdentifier diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py index 2b65c65247df20f7f76b1059f6a88fc534044b51..47abc9fb1f749f53cf5d8495e6e67504082d17d4 100644 --- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py +++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/share/InDetDxAOD.py @@ -405,9 +405,23 @@ if dumpSctInfo: print xAOD_SCT_PrepDataToxAOD.properties() if dumpPixInfo: + from PixelConditionsTools.PixelDCSConditionsToolSetup import PixelDCSConditionsToolSetup + pixelDCSConditionsToolSetup = PixelDCSConditionsToolSetup() + pixelDCSConditionsToolSetup.setIsDATA(False) + pixelDCSConditionsToolSetup.setup() + from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup + pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup() + pixelSiPropertiesToolSetup.setSiliconTool(pixelDCSConditionsToolSetup.getTool()) + pixelSiPropertiesToolSetup.setup() + from AthenaCommon.AppMgr import ToolSvc + if not hasattr(ToolSvc, "PixelLorentzAngleTool"): + from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup + pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() + from InDetPrepRawDataToxAOD.InDetPrepRawDataToxAODConf import PixelPrepDataToxAOD xAOD_PixelPrepDataToxAOD = PixelPrepDataToxAOD( name = "xAOD_PixelPrepDataToxAOD") - ## Content steering Properties (default value shown as comment) + xAOD_PixelPrepDataToxAOD.PixelDCSConditionsTool = pixelDCSConditionsToolSetup.getTool() + xAOD_PixelPrepDataToxAOD.LorentzAngleTool = ToolSvc.PixelLorentzAngleTool xAOD_PixelPrepDataToxAOD.OutputLevel = INFO xAOD_PixelPrepDataToxAOD.UseTruthInfo = dumpTruthInfo xAOD_PixelPrepDataToxAOD.WriteRDOinformation = InDetDxAODFlags.DumpPixelRdoInfo() diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx index 35325443a478df847be3afc568cd1d0f9d05dc75..6f3e2488b77024922b2e0048e32beefab62f7e5d 100644 --- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx +++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -31,9 +31,7 @@ #include "CLHEP/Geometry/Point3D.h" #include "PixelConditionsServices/IPixelCalibSvc.h" -#include "PixelConditionsServices/IPixelDCSSvc.h" #include "PixelConditionsServices/IPixelByteStreamErrorsSvc.h" -#include "InDetCondServices/ISiLorentzAngleSvc.h" #define AUXDATA(OBJ, TYP, NAME) \ static const SG::AuxElement::Accessor<TYP> acc_##NAME (#NAME); acc_##NAME(*(OBJ)) @@ -48,9 +46,7 @@ PixelPrepDataToxAOD::PixelPrepDataToxAOD(const std::string &name, ISvcLocator *p m_PixelHelper(0), m_useSiHitsGeometryMatching(true), m_calibSvc("PixelCalibSvc", name), - m_pixelDCSSvc("PixelDCSSvc", name), m_pixelBSErrorsSvc("PixelByteStreamErrorsSvc", name), - m_lorentzAngleSvc("PixelLorentzAngleSvc", name), m_firstEventWarnings(true) { // --- Steering and configuration flags @@ -91,11 +87,11 @@ StatusCode PixelPrepDataToxAOD::initialize() CHECK(m_calibSvc.retrieve()); - CHECK(m_pixelDCSSvc.retrieve()); + ATH_CHECK(m_DCSConditionsTool.retrieve()); CHECK(m_pixelBSErrorsSvc.retrieve()); - CHECK(m_lorentzAngleSvc.retrieve()); + ATH_CHECK(m_lorentzAngleTool.retrieve()); ATH_CHECK(m_clustercontainer_key.initialize()); m_need_sihits = (m_writeNNinformation || m_writeSiHits) && m_useTruthInfo; @@ -227,12 +223,11 @@ StatusCode PixelPrepDataToxAOD::execute() if(m_writeRDOinformation) { IdentifierHash moduleHash = clusterCollection->identifyHash(); AUXDATA(xprd,int,isBSError) = (int)m_pixelBSErrorsSvc->isActive(moduleHash); - AUXDATA(xprd,std::string,DCSState) = (std::string)m_pixelDCSSvc->getFSMState(moduleHash); - - AUXDATA(xprd,float,BiasVoltage) = (float)m_lorentzAngleSvc->getBiasVoltage(moduleHash); - AUXDATA(xprd,float,Temperature) = (float)m_lorentzAngleSvc->getTemperature(moduleHash); - AUXDATA(xprd,float,DepletionVoltage) = (float)m_lorentzAngleSvc->getDepletionVoltage(moduleHash); - AUXDATA(xprd,float,LorentzShift) = (float)m_lorentzAngleSvc->getLorentzShift(moduleHash); + AUXDATA(xprd,std::string,DCSState) = (std::string)m_DCSConditionsTool->PixelFSMState(moduleHash); + AUXDATA(xprd,float,BiasVoltage) = (float)m_DCSConditionsTool->biasVoltage(moduleHash); + AUXDATA(xprd,float,Temperature) = (float)m_DCSConditionsTool->temperature(moduleHash); + AUXDATA(xprd,float,DepletionVoltage) = (float)m_DCSConditionsTool->depletionVoltage(moduleHash); + AUXDATA(xprd,float,LorentzShift) = (float)m_lorentzAngleTool->getLorentzShift(moduleHash); addRdoInformation(xprd, prd); } @@ -835,7 +830,7 @@ void PixelPrepDataToxAOD::addNNInformation(xAOD::TrackMeasurementValidation* xpr float trknormcomp = trackDir.dot(module_normal); double bowphi = atan2(trkphicomp,trknormcomp); double boweta = atan2(trketacomp,trknormcomp); - double tanl = de->getTanLorentzAnglePhi(); + double tanl = m_lorentzAngleTool->getTanLorentzAngle(de->identifyHash()); if(bowphi > TMath::Pi()/2) bowphi -= TMath::Pi(); if(bowphi < -TMath::Pi()/2) bowphi += TMath::Pi(); int readoutside = design->readoutSide(); @@ -933,8 +928,7 @@ void PixelPrepDataToxAOD::addNNTruthInfo( xAOD::TrackMeasurementValidation* xp return; } // lorentz shift correction - double shift = de->getLorentzCorrection(); - + double shift = m_lorentzAngleTool->getLorentzShift(de->identifyHash()); unsigned hitNumber(0); for( auto& siHit : matchingHits ){ @@ -1011,7 +1005,8 @@ void PixelPrepDataToxAOD::addNNTruthInfo( xAOD::TrackMeasurementValidation* xp //Truth Track incident angle theta theta[hitNumber] = atan2(diffPositions.z() ,diffPositions.x()); //Truth track incident angle phi -- correct for lorentz angle - float tanlorentz = de->getTanLorentzAnglePhi(); + float tanlorentz = m_lorentzAngleTool->getTanLorentzAngle(de->identifyHash()); + int readoutside = design->readoutSide(); phi[hitNumber] = atan(tan(bowphi)-readoutside*tanlorentz); diff --git a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.h b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.h index 88139ea54074f74e609390ec311e53776b756648..2cbef167207585f59c678f8c6d1cd7cbe614b4cd 100644 --- a/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.h +++ b/InnerDetector/InDetEventCnv/InDetPrepRawDataToxAOD/src/PixelPrepDataToxAOD.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -20,6 +20,8 @@ #include "xAODTracking/TrackMeasurementValidation.h" #include "xAODTracking/TrackMeasurementValidationContainer.h" +#include "PixelConditionsTools/IPixelDCSConditionsTool.h" +#include "InDetCondServices/ISiLorentzAngleTool.h" #include <string> @@ -29,9 +31,7 @@ class InDetSimDataCollection; class IdentifierHash; class IPixelCalibSvc; -class IPixelDCSSvc; class IPixelByteStreamErrorsSvc; -class ISiLorentzAngleSvc; namespace InDet { @@ -103,9 +103,9 @@ private: bool m_useSiHitsGeometryMatching; ServiceHandle<IPixelCalibSvc> m_calibSvc; - ServiceHandle<IPixelDCSSvc> m_pixelDCSSvc; + ToolHandle<IPixelDCSConditionsTool> m_DCSConditionsTool{this, "PixelDCSConditionsTool", "PixelDCSConditionsTool", "Tool to retrieve Pixel information"}; ServiceHandle<IPixelByteStreamErrorsSvc> m_pixelBSErrorsSvc; - ServiceHandle<ISiLorentzAngleSvc> m_lorentzAngleSvc; + ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool{this, "LorentzAngleTool", "SiLorentzAngleTool", "Tool to retreive Lorentz angle"}; // -- Private members bool m_firstEventWarnings; diff --git a/InnerDetector/InDetExample/InDetDetDescrExample/InDetDetDescrExample/ReadSiDetectorElements.h b/InnerDetector/InDetExample/InDetDetDescrExample/InDetDetDescrExample/ReadSiDetectorElements.h index 6e9b34d503c801f9c99a9bf23d1da7d50905d674..cb450a91733356a92aef0360eedfdb674825eab4 100755 --- a/InnerDetector/InDetExample/InDetDetDescrExample/InDetDetDescrExample/ReadSiDetectorElements.h +++ b/InnerDetector/InDetExample/InDetDetDescrExample/InDetDetDescrExample/ReadSiDetectorElements.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef InDetDetDescrExample_ReadSiDetectorElements_h @@ -24,9 +24,6 @@ namespace InDetDD{ class SiDetectorElement; } -class ISiliconConditionsSvc; -class ISiPropertiesSvc; -class ISiLorentzAngleSvc; class AtlasDetectorID; class PixelID; class SCT_ID; @@ -53,9 +50,6 @@ public: bool m_doLoop; bool m_doInit; bool m_doExec; - ServiceHandle<ISiLorentzAngleSvc> m_siLorentzAngleSvc; - ServiceHandle<ISiliconConditionsSvc> m_siConditionsSvc; - ServiceHandle<ISiPropertiesSvc> m_siPropertiesSvc; bool m_useConditionsTools; ToolHandle<ISiliconConditionsTool> m_siConditionsTool{this, "SiConditionsTool", "SCT_SiliconConditionsTool", "Silicon conditions tool"}; ToolHandle<ISiPropertiesTool> m_siPropertiesTool{this, "SiPropertiesTool", "SiPropertiesTool", "Silicon properties tool"}; diff --git a/InnerDetector/InDetExample/InDetDetDescrExample/share/ReadSiDetectorElements_jobOptions.py b/InnerDetector/InDetExample/InDetDetDescrExample/share/ReadSiDetectorElements_jobOptions.py index 0470162fe20948d53641d808b5055e8da7dd621e..bb04af5b61d1c8b405de7823451993baf21e0ca3 100755 --- a/InnerDetector/InDetExample/InDetDetDescrExample/share/ReadSiDetectorElements_jobOptions.py +++ b/InnerDetector/InDetExample/InDetDetDescrExample/share/ReadSiDetectorElements_jobOptions.py @@ -18,6 +18,8 @@ DetFlags.detdescr.SCT_setOn() globalflags.DataSource='geant4' #globalflags.DataSource='data' +isData = (globalflags.DataSource == 'data') + # Select the geometry version. globalflags.DetDescrVersion='ATLAS-R1-2012-03-01-00' @@ -64,28 +66,22 @@ from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesSvc # Pixel # # Load DCS service -include( "PixelConditionsServices/PixelDCSSvc_jobOptions.py" ) - -## Silicon conditions service (set up by LorentzAngleSvcSetup) -pixelSiliconConditionsSvc = lorentzAngleSvc.PixelSiliconConditionsSvc -## Or directly from ServiceMgr (its the same instance) -#pixelSiliconConditionsSvc=ServiceMgr.PixelSiliconConditionsSvc -## Or if you want a different instance than used by LorentzAngleSvcSetup -#from PixelConditionsServices.PixelConditionsServicesConf import PixelSiliconConditionsSvc -#pixelSiliconConditionsSvc = PixelSiliconConditionsSvc("OtherPixel_SiliconConditionsSvc") -#ServiceMgr += pixelSiliconConditionsSvc - -# Silicon properties service -pixelSiPropertiesSvc = SiPropertiesSvc(name = "PixelSiPropertiesSvc", - DetectorName="Pixel", - SiConditionsServices = pixelSiliconConditionsSvc) -ServiceMgr += pixelSiPropertiesSvc - -ReadPixelElements.SiLorentzAngleSvc = lorentzAngleSvc.pixel -ReadPixelElements.SiPropertiesSvc = pixelSiPropertiesSvc -ReadPixelElements.SiConditionsSvc = pixelSiliconConditionsSvc - -ServiceMgr.GeoModelSvc.DetectorTools['PixelDetectorTool'].LorentzAngleSvc=lorentzAngleSvc.pixel +from PixelConditionsTools.PixelDCSConditionsToolSetup import PixelDCSConditionsToolSetup +pixelDCSConditionsToolSetup = PixelDCSConditionsToolSetup() +pixelDCSConditionsToolSetup.setIsDATA(isData) +pixelDCSConditionsToolSetup.setup() +from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup +pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup() +pixelSiPropertiesToolSetup.setSiliconTool(pixelDCSConditionsToolSetup.getTool()) +pixelSiPropertiesToolSetup.setup() +pixelSiPropertiesTool = pixelSiPropertiesToolSetup.getTool() + +ReadPixelElements.UseConditionsTools = True +ReadPixelElements.SiLorentzAngleTool = lorentzAngleSvc.pixel +ReadPixelElements.SiPropertiesTool = pixelSiPropertiesTool +ReadPixelElements.SiConditionsTool = None + +ServiceMgr.GeoModelSvc.DetectorTools['PixelDetectorTool'].LorentzAngleTool=lorentzAngleSvc.pixel # # SCT diff --git a/InnerDetector/InDetExample/InDetDetDescrExample/src/ReadSiDetectorElements.cxx b/InnerDetector/InDetExample/InDetDetDescrExample/src/ReadSiDetectorElements.cxx index 97ee433cd0df9bb962548d9ff8d6f175b7b40a4e..c01befb4a2f4b611da13a183babc39858406b0fa 100755 --- a/InnerDetector/InDetExample/InDetDetDescrExample/src/ReadSiDetectorElements.cxx +++ b/InnerDetector/InDetExample/InDetDetDescrExample/src/ReadSiDetectorElements.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "InDetDetDescrExample/ReadSiDetectorElements.h" @@ -17,8 +17,6 @@ #include "InDetIdentifier/PixelID.h" #include "InDetIdentifier/SCT_ID.h" #include "Identifier/Identifier.h" -#include "InDetCondServices/ISiLorentzAngleSvc.h" -#include "SiPropertiesSvc/ISiPropertiesSvc.h" #include "InDetConditionsSummaryService/ISiliconConditionsSvc.h" #include "InDetReadoutGeometry/SiLocalPosition.h" @@ -46,9 +44,6 @@ ReadSiDetectorElements::ReadSiDetectorElements(const std::string& name, ISvcLoca AthAlgorithm(name, pSvcLocator), m_managerName("Pixel"), // or SCT m_doLoop(true), - m_siLorentzAngleSvc("PixelLorentzAngleSvc",name), - m_siConditionsSvc("PixelSiliconConditionsSvc",name), - m_siPropertiesSvc("PixelSiPropertiesSvc",name), m_manager(0), m_idHelper(0), m_pixelIdHelper(0), @@ -61,9 +56,6 @@ ReadSiDetectorElements::ReadSiDetectorElements(const std::string& name, ISvcLoca declareProperty("DoInitialize", m_doInit = false); declareProperty("DoExecute", m_doExec = true); declareProperty("UseConditionsTools", m_useConditionsTools = false); - declareProperty("SiLorentzAngleSvc", m_siLorentzAngleSvc); - declareProperty("SiConditionsSvc", m_siConditionsSvc); - declareProperty("SiPropertiesSvc", m_siPropertiesSvc); } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * @@ -104,18 +96,6 @@ StatusCode ReadSiDetectorElements::initialize(){ ATH_CHECK(m_siConditionsTool.retrieve()); ATH_CHECK(m_siPropertiesTool.retrieve()); } else { - StatusCode sc = m_siLorentzAngleSvc.retrieve(); - if (sc.isFailure()) { - ATH_MSG_ERROR( "Could not retrieve Lorentz Angle Svc: " << m_siLorentzAngleSvc.name() ); - } - sc = m_siPropertiesSvc.retrieve(); - if (sc.isFailure()) { - ATH_MSG_ERROR( "Could not retrieve silicon properties svc: " << m_siPropertiesSvc.name() ); - } - sc = m_siConditionsSvc.retrieve(); - if (sc.isFailure()) { - ATH_MSG_ERROR( "Could not retrieve silicon conditions service: " << m_siConditionsSvc.name() ); - } m_siLorentzAngleTool.disable(); m_siConditionsTool.disable(); m_siPropertiesTool.disable(); @@ -172,29 +152,15 @@ void ReadSiDetectorElements::printAllElements() { << m_siConditionsTool->temperature(hashId) << " " << m_siConditionsTool->biasVoltage(hashId) << " " << m_siConditionsTool->depletionVoltage(hashId)); - } else { - ATH_MSG_ALWAYS(" Temperature (C), bias voltage, depletion voltage: " - << m_siConditionsSvc->temperature(hashId) << " " - << m_siConditionsSvc->biasVoltage(hashId) << " " - << m_siConditionsSvc->depletionVoltage(hashId)); } - if (m_manager->getName() == "Pixel") { - //msg(MSG::ALWAYS) << "Via SiDetectorElement:" - ATH_MSG_ALWAYS(" Lorentz correction (mm), tanLorentzPhi = " - << element->getLorentzCorrection()/CLHEP::mm << " " - << element->getTanLorentzAnglePhi()); - } else { - //msg(MSG::ALWAYS) << "Direct from SiLorentzAngleSvc:" - ATH_MSG_ALWAYS(" Lorentz correction (mm), tanLorentzPhi = " - << m_siLorentzAngleTool->getLorentzShift(hashId)/CLHEP::mm << " " - << m_siLorentzAngleTool->getTanLorentzAngle(hashId)); - } + //msg(MSG::ALWAYS) << "Direct from SiLorentzAngleSvc:" + ATH_MSG_ALWAYS(" Lorentz correction (mm), tanLorentzPhi = " + << m_siLorentzAngleTool->getLorentzShift(hashId)/CLHEP::mm << " " + << m_siLorentzAngleTool->getTanLorentzAngle(hashId)); // These are no longer accessed through the detector element. - const InDet::SiliconProperties & siProperties = m_useConditionsTools - ? m_siPropertiesTool->getSiProperties(hashId) - : m_siPropertiesSvc->getSiProperties(hashId); + const InDet::SiliconProperties & siProperties = m_siPropertiesTool->getSiProperties(hashId); ATH_MSG_ALWAYS(" Hall Mobility (cm2/volt/s), Drift mobility (cm2/volt/s), diffusion constant (cm2/s) = " << siProperties.hallMobility(element->carrierType()) /(CLHEP::cm2/CLHEP::volt/CLHEP::s) << " " << siProperties.driftMobility(element->carrierType()) /(CLHEP::cm2/CLHEP::volt/CLHEP::s) << " " @@ -529,32 +495,16 @@ ReadSiDetectorElements::testElement(const Identifier & id, ); ATH_MSG_ALWAYS(" center: r (mm) = " << element->center().perp()/CLHEP::mm << ", phi (deg) = " << element->center().phi()/CLHEP::deg); - const InDet::SiliconProperties & siProperties = m_useConditionsTools - ? m_siPropertiesTool->getSiProperties(hashId) - : m_siPropertiesSvc->getSiProperties(hashId); - if (m_manager->getName() == "Pixel") { - ATH_MSG_ALWAYS(" Lorentz correction (mm), mobility (cm2/V/s), tanLorentzPhi = " - << element->getLorentzCorrection()/CLHEP::mm << " " - << element->getLorentzCorrection()/CLHEP::mm << " " - << siProperties.hallMobility(element->carrierType()) /(CLHEP::cm2/CLHEP::volt/CLHEP::s) << " " - << element->getTanLorentzAnglePhi()); - } else { - ATH_MSG_ALWAYS(" Lorentz correction (mm), mobility (cm2/V/s), tanLorentzPhi = " - << m_siLorentzAngleTool->getLorentzShift(hashId)/CLHEP::mm << " " - << element->getLorentzCorrection()/CLHEP::mm << " " - << siProperties.hallMobility(element->carrierType()) /(CLHEP::cm2/CLHEP::volt/CLHEP::s) << " " - << m_siLorentzAngleTool->getTanLorentzAngle(hashId)); - } + const InDet::SiliconProperties & siProperties = m_siPropertiesTool->getSiProperties(hashId); + ATH_MSG_ALWAYS(" Lorentz correction (mm), mobility (cm2/V/s), tanLorentzPhi = " + << m_siLorentzAngleTool->getLorentzShift(hashId)/CLHEP::mm << " " + << siProperties.hallMobility(element->carrierType()) /(CLHEP::cm2/CLHEP::volt/CLHEP::s) << " " + << m_siLorentzAngleTool->getTanLorentzAngle(hashId)); if (m_useConditionsTools) { ATH_MSG_ALWAYS(" Temperature (C), bias voltage, depletion voltage: " << m_siConditionsTool->temperature(hashId) << " " << m_siConditionsTool->biasVoltage(hashId) << " " << m_siConditionsTool->depletionVoltage(hashId)); - } else { - ATH_MSG_ALWAYS(" Temperature (C), bias voltage, depletion voltage: " - << m_siConditionsSvc->temperature(hashId) << " " - << m_siConditionsSvc->biasVoltage(hashId) << " " - << m_siConditionsSvc->depletionVoltage(hashId)); } ATH_MSG_ALWAYS(" sin(tilt), tilt (deg), sin(stereo), stereo (deg) = " << element->sinTilt() << ", " diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py index b359ade6acd8b63b43b8171befd53521f0035ad4..3b92b7f75c9d318a26e704b014fce1a6579cbfde 100644 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecConditionsAccess.py @@ -28,13 +28,29 @@ condSeq = AthSequencer("AthCondSeq") # if DetFlags.haveRIO.pixel_on(): # Load pixel conditions summary service - from PixelConditionsServices.PixelConditionsServicesConf import PixelConditionsSummarySvc - InDetPixelConditionsSummarySvc = PixelConditionsSummarySvc() - - #Tool version for athenaMT - from PixelConditionsTools.PixelConditionsToolsConf import PixelConditionsSummaryTool - InDetPixelConditionsSummaryTool = PixelConditionsSummaryTool() + from AthenaCommon.AppMgr import ToolSvc + if not hasattr(ToolSvc, "PixelConditionsSummaryTool"): + from PixelConditionsTools.PixelConditionsSummaryToolSetup import PixelConditionsSummaryToolSetup + pixelConditionsSummaryToolSetup = PixelConditionsSummaryToolSetup() + pixelConditionsSummaryToolSetup.setUseDCS(isData) + pixelConditionsSummaryToolSetup.setUseBS(isData) + pixelConditionsSummaryToolSetup.setup() + InDetPixelConditionsSummaryTool = ToolSvc.PixelConditionsSummaryTool + + if athenaCommonFlags.isOnline() : + InDetPixelConditionsSummaryTool.UseSpecialPixelMap = False + else: + InDetPixelConditionsSummaryTool.UseSpecialPixelMap = True + + if InDetFlags.usePixelDCS(): + InDetPixelConditionsSummaryTool.IsActiveStates = [ 'READY', 'ON', 'UNKNOWN', 'TRANSITION', 'UNDEFINED' ] + InDetPixelConditionsSummaryTool.IsActiveStatus = [ 'OK', 'WARNING', 'ERROR', 'FATAL' ] + + if (InDetFlags.doPrintConfigurables()): + print InDetPixelConditionsSummaryTool + + # Load pixel calibration service if not athenaCommonFlags.isOnline(): if not conddb.folderRequested('/PIXEL/PixCalib'): @@ -46,12 +62,7 @@ if DetFlags.haveRIO.pixel_on(): print InDetPixelCalibSvc # Load pixel special pixel map services - if athenaCommonFlags.isOnline() : - InDetPixelConditionsSummarySvc.UseSpecialPixelMap = False - InDetPixelConditionsSummaryTool.UseSpecialPixelMap = False - else: - InDetPixelConditionsSummarySvc.UseSpecialPixelMap = True - InDetPixelConditionsSummaryTool.UseSpecialPixelMap = True + if not athenaCommonFlags.isOnline(): if not conddb.folderRequested('/PIXEL/PixMapShort'): conddb.addFolder("PIXEL_OFL","/PIXEL/PixMapShort", className='CondAttrListCollection') if not conddb.folderRequested('/PIXEL/PixMapLong'): @@ -71,7 +82,6 @@ if DetFlags.haveRIO.pixel_on(): if InDetFlags.doPrintConfigurables(): print InDetSpecialPixelMapSvc - InDetPixelConditionsSummarySvc.DisableCallback = False #Alg is suppose to replace service, sync withh service for now from PixelConditionsAlgorithms.PixelConditionsAlgorithmsConf import SpecialPixelMapCondAlg InDetSpecialPixelMapCondAlg = SpecialPixelMapCondAlg(name="InDetSpecialPixelMapCondAlg", @@ -84,119 +94,16 @@ if DetFlags.haveRIO.pixel_on(): print InDetSpecialPixelMapSvc - if InDetFlags.usePixelDCS(): - - print "STSTST InDetExample 1 ",isData,athenaCommonFlags.isOnline() - - from PixelConditionsTools.PixelDCSConditionsToolSetup import PixelDCSConditionsToolSetup - pixelDCSConditionsToolSetup = PixelDCSConditionsToolSetup() - pixelDCSConditionsToolSetup.setIsDATA(isData) - if athenaCommonFlags.isOnline(): - print "STSTST InDetExample XXX" - pixelDCSConditionsToolSetup.setHVFolder("/PIXEL/HLT/DCS/HV") - pixelDCSConditionsToolSetup.setTempFolder("/PIXEL/HLT/DCS/TEMPERATURE") - pixelDCSConditionsToolSetup.setDbInstance("PIXEL_ONL") - else: - pixelDCSConditionsToolSetup.setHVFolder("/PIXEL/DCS/HV") - pixelDCSConditionsToolSetup.setTempFolder("/PIXEL/DCS/TEMPERATURE") - pixelDCSConditionsToolSetup.setDbInstance("DCS_OFL") - pixelDCSConditionsToolSetup.setup() - if (InDetFlags.doPrintConfigurables()): - print pixelDCSConditionsToolSetup.getTool() - - - # temporarily workaround incomplete conditions data for MC - # by only enabling the usage of dcs in the pixel conditions summary service for data - InDetPixelConditionsSummarySvc.UseDCS = isData - InDetPixelConditionsSummarySvc.IsActiveStates = [ 'READY', 'ON', 'UNKNOWN', 'TRANSITION', 'UNDEFINED' ] - InDetPixelConditionsSummarySvc.IsActiveStatus = [ 'OK', 'WARNING', 'ERROR', 'FATAL' ] - - InDetPixelConditionsSummaryTool.UseDCS = isData - InDetPixelConditionsSummaryTool.IsActiveStates = [ 'READY', 'ON', 'UNKNOWN', 'TRANSITION', 'UNDEFINED' ] - InDetPixelConditionsSummaryTool.IsActiveStatus = [ 'OK', 'WARNING', 'ERROR', 'FATAL' ] - - -#STSTST # Load pixel DCS information -#STSTST from SiLorentzAngleSvc.PixelLorentzAngleSvcSetup import pixelLorentzAngleSvcSetup -#STSTST if InDetFlags.usePixelDCS(): -#STSTST from PixelConditionsServices.PixelConditionsServicesConf import PixelDCSSvc -#STSTST if athenaCommonFlags.isOnline(): -#STSTST if not conddb.folderRequested('/PIXEL/HLT/DCS/TEMPERATURE'): -#STSTST conddb.addFolder("PIXEL_ONL","/PIXEL/HLT/DCS/TEMPERATURE") -#STSTST if not conddb.folderRequested('/PIXEL/HLT/DCS/HV'): -#STSTST conddb.addFolder("PIXEL_ONL","/PIXEL/HLT/DCS/HV") -#STSTST -#STSTST InDetPixelDCSSvc = PixelDCSSvc(RegisterCallback = TRUE, -#STSTST TemperatureFolder = "/PIXEL/HLT/DCS/TEMPERATURE", -#STSTST HVFolder = "/PIXEL/HLT/DCS/HV", -#STSTST TemperatureFieldName = "temperature", -#STSTST HVFieldName = "HV") -#STSTST else: -#STSTST if not conddb.folderRequested('/PIXEL/DCS/TEMPERATURE'): -#STSTST conddb.addFolder("DCS_OFL","/PIXEL/DCS/TEMPERATURE") -#STSTST if not conddb.folderRequested('/PIXEL/DCS/HV'): -#STSTST conddb.addFolder("DCS_OFL","/PIXEL/DCS/HV") -#STSTST if not conddb.folderRequested('/PIXEL/DCS/FSMSTATUS'): -#STSTST conddb.addFolder("DCS_OFL","/PIXEL/DCS/FSMSTATUS") -#STSTST if not conddb.folderRequested('/PIXEL/DCS/FSMSTATE'): -#STSTST conddb.addFolder("DCS_OFL","/PIXEL/DCS/FSMSTATE") -#STSTST from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as geoFlags -#STSTST # from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as idGeoFlags -#STSTST if (rec.doMonitoring() and globalflags.DataSource() == 'data' and ( geoFlags.Run() in ["RUN2", "RUN3"] ) and conddb.dbdata == "CONDBR2"): -#STSTST # idGeoFlags.isIBL() == True may work too instead of ( geoFlags.Run() in ["RUN2", "RUN3"] ) -#STSTST if not conddb.folderRequested('/PIXEL/DCS/PIPES'): -#STSTST conddb.addFolder("DCS_OFL","/PIXEL/DCS/PIPES") -#STSTST if not conddb.folderRequested('/PIXEL/DCS/LV'): -#STSTST conddb.addFolder("DCS_OFL","/PIXEL/DCS/LV") -#STSTST if not conddb.folderRequested('/PIXEL/DCS/HVCURRENT'): -#STSTST conddb.addFolder("DCS_OFL","/PIXEL/DCS/HVCURRENT") -#STSTST # not used anymore -#STSTST # if not conddb.folderRequested('/PIXEL/DCS/PLANTS'): -#STSTST # conddb.addFolder("DCS_OFL","/PIXEL/DCS/PLANTS") -#STSTST -#STSTST InDetPixelDCSSvc = PixelDCSSvc(RegisterCallback = TRUE, -#STSTST TemperatureFolder = "/PIXEL/DCS/TEMPERATURE", -#STSTST HVFolder = "/PIXEL/DCS/HV", -#STSTST FSMStatusFolder = "/PIXEL/DCS/FSMSTATUS", -#STSTST FSMStateFolder = "/PIXEL/DCS/FSMSTATE", -#STSTST TemperatureFieldName = "temperature", -#STSTST HVFieldName = "HV", -#STSTST FSMStatusFieldName = "FSM_status", -#STSTST FSMStateFieldName = "FSM_state" ) -#STSTST ServiceMgr += InDetPixelDCSSvc -#STSTST if InDetFlags.doPrintConfigurables(): -#STSTST print InDetPixelDCSSvc -#STSTST -#STSTST # temporarily workaround incomplete conditions data for MC -#STSTST # by only enabling the usage of dcs in the pixel conditions summary service for data -#STSTST InDetPixelConditionsSummarySvc.UseDCS = isData -#STSTST InDetPixelConditionsSummarySvc.IsActiveStates = [ 'READY', 'ON', 'UNKNOWN', 'TRANSITION', 'UNDEFINED' ] -#STSTST InDetPixelConditionsSummarySvc.IsActiveStatus = [ 'OK', 'WARNING', 'ERROR', 'FATAL' ] -#STSTST -#STSTST InDetPixelConditionsSummaryTool.UseDCS = isData -#STSTST InDetPixelConditionsSummaryTool.IsActiveStates = [ 'READY', 'ON', 'UNKNOWN', 'TRANSITION', 'UNDEFINED' ] -#STSTST InDetPixelConditionsSummaryTool.IsActiveStatus = [ 'OK', 'WARNING', 'ERROR', 'FATAL' ] - - else: - pixelLorentzAngleSvcSetup.usePixelDefaults = True + if not InDetFlags.usePixelDCS(): from PixelConditionsServices.PixelConditionsServicesConf import PixelSiliconConditionsSvc PixelSiliconConditionsSvc.UseDB = False # Load Pixel BS errors service - if ( globalflags.DataSource == 'geant4' ) : - # Due to a "feature" in the BS encoder for simulation, - # the information of the BS error service - # is not reliable on MC. - InDetPixelConditionsSummarySvc.UseByteStream = False - InDetPixelConditionsSummaryTool.UseByteStream = False - else : + if not (globalflags.DataSource=='geant4'): from PixelConditionsServices.PixelConditionsServicesConf import PixelByteStreamErrorsSvc InDetPixelByteStreamErrorsSvc = PixelByteStreamErrorsSvc() if ( globalflags.InputFormat != 'bytestream' ): InDetPixelByteStreamErrorsSvc.ReadingESD = True - InDetPixelConditionsSummarySvc.UseByteStream = True - InDetPixelConditionsSummaryTool.UseByteStream = True - ServiceMgr += InDetPixelByteStreamErrorsSvc if (InDetFlags.doPrintConfigurables()): print InDetPixelByteStreamErrorsSvc @@ -227,19 +134,10 @@ if DetFlags.haveRIO.pixel_on(): if (InDetFlags.doPrintConfigurables()): print InDetPixelOfflineCalibSvc - # Register and printout configuration of PixelConditionsSummarySvc - ServiceMgr += InDetPixelConditionsSummarySvc - if (InDetFlags.doPrintConfigurables()): - print InDetPixelConditionsSummarySvc - ToolSvc += InDetPixelConditionsSummaryTool - if (InDetFlags.doPrintConfigurables()): - print InDetPixelConditionsSummaryTool + if not hasattr(ToolSvc, "PixelLorentzAngleTool"): + from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup + pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() - print "STSTST InDetExample 2" - # Setup Lorentz angle tool. - from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup - pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() - PixelLorentzAngleTool = pixelLorentzAngleToolSetup.PixelLorentzAngleTool # # --- Load SCT Conditions Services diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py index 8b53bb586eff5a6721fa5711ebce51ab7405eb7b..0f5a51d43e273ac5d324b7b8b51a3e95babaa3ff 100755 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py @@ -16,8 +16,6 @@ if use_broad_cluster_sct == None : # detector specific settings will override the global setting: use_broad_cluster_any = use_broad_cluster_pix or use_broad_cluster_sct -print "STSTST InDetRecLoadTool 1" - #load common NN tools for clustering and ROT creation if InDetFlags.doPixelClusterSplitting() and not InDetFlags.doSLHC(): @@ -54,18 +52,12 @@ if InDetFlags.doPixelClusterSplitting() and not InDetFlags.doSLHC(): from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() - if not hasattr(ToolSvc, "PixelLorentzAngleTool"): - print "STSTST",ToolSvc - print "STSTST",pixelLorentzAngleToolSetup - - print "STSTST InDetRecLoadTools" - from SiClusterizationTool.SiClusterizationToolConf import InDet__NnClusterizationFactory from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as geoFlags if ( not geoFlags.Run() in ["RUN2", "RUN3"] ) : NnClusterizationFactory = InDet__NnClusterizationFactory( name = "NnClusterizationFactory", -# PixelLorentzAngleTool= ToolSvc.PixelLorentzAngleTool, + PixelLorentzAngleTool= ToolSvc.PixelLorentzAngleTool, NetworkToHistoTool = NeuralNetworkToHistoTool, doRunI = True, useToT = False, @@ -78,7 +70,7 @@ if InDetFlags.doPixelClusterSplitting() and not InDetFlags.doSLHC(): else: NnClusterizationFactory = InDet__NnClusterizationFactory( name = "NnClusterizationFactory", -# PixelLorentzAngleTool= ToolSvc.PixelLorentzAngleTool, + PixelLorentzAngleTool= ToolSvc.PixelLorentzAngleTool, NetworkToHistoTool = NeuralNetworkToHistoTool, LoadNoTrackNetwork = True, useToT = InDetFlags.doNNToTCalibration(), @@ -105,22 +97,14 @@ elif InDetFlags.doPixelClusterSplitting(): from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() - if not hasattr(ToolSvc, "PixelLorentzAngleTool"): - print "STSTST",ToolSvc - print "STSTST",pixelLorentzAngleToolSetup - - print "STSTST InDetRecLoadTools X" - from SiClusterizationTool.SiClusterizationToolConf import InDet__TruthClusterizationFactory - NnClusterizationFactory = InDet__TruthClusterizationFactory( name = "TruthClusterizationFactory") -# PixelLorentzAngleTool= ToolSvc.PixelLorentzAngleTool) + NnClusterizationFactory = InDet__TruthClusterizationFactory( name = "TruthClusterizationFactory", + PixelLorentzAngleTool= ToolSvc.PixelLorentzAngleTool) ToolSvc += NnClusterizationFactory if (InDetFlags.doPrintConfigurables()): print NnClusterizationFactory -print "STSTST InDetRecLoadTool 2" - # --- load cabling (if needed) include("InDetRecExample/InDetRecCabling.py") @@ -138,10 +122,7 @@ from TrkEventCnvTools import TrkEventCnvToolsConfig # ----------- control loading of ROT_creator # -print "STSTST InDetRecLoadTool 3 ",InDetFlags.loadRotCreator() - if InDetFlags.loadRotCreator(): - # # --- configure default ROT creator # @@ -882,17 +863,27 @@ if InDetFlags.loadAssoTool(): # # ----------- control loading of SummaryTool # + if InDetFlags.loadSummaryTool(): from TrkTrackSummaryTool.AtlasTrackSummaryTool import AtlasTrackSummaryTool AtlasTrackSummaryTool = AtlasTrackSummaryTool() ToolSvc += AtlasTrackSummaryTool + if not hasattr(ToolSvc, "PixelConditionsSummaryTool"): + from PixelConditionsTools.PixelConditionsSummaryToolSetup import PixelConditionsSummaryToolSetup + pixelConditionsSummaryToolSetup = PixelConditionsSummaryToolSetup() + pixelConditionsSummaryToolSetup.setUseDCS((globalflags.DataSource=='data')) + pixelConditionsSummaryToolSetup.setUseBS((globalflags.DataSource=='data')) + pixelConditionsSummaryToolSetup.setup() + + # # Loading Pixel test tool # from InDetTestPixelLayer.InDetTestPixelLayerConf import InDet__InDetTestPixelLayerTool InDetTestPixelLayerTool = InDet__InDetTestPixelLayerTool(name = "InDetTestPixelLayerTool", + PixelSummaryTool = ToolSvc.PixelConditionsSummaryTool, CheckActiveAreas=InDetFlags.checkDeadElementsOnTrack(), CheckDeadRegions=InDetFlags.checkDeadElementsOnTrack(), CheckDisabledFEs=InDetFlags.checkDeadElementsOnTrack()) @@ -906,6 +897,7 @@ if InDetFlags.loadSummaryTool(): from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool InDetHoleSearchTool = InDet__InDetTrackHoleSearchTool(name = "InDetHoleSearchTool", Extrapolator = InDetExtrapolator, + PixelSummaryTool = ToolSvc.PixelConditionsSummaryTool, usePixel = DetFlags.haveRIO.pixel_on(), useSCT = DetFlags.haveRIO.SCT_on(), CountDeadModulesAfterLastHit = True, @@ -930,7 +922,7 @@ if InDetFlags.loadSummaryTool(): if DetFlags.haveRIO.pixel_on() : from InDetTestBLayer.InDetTestBLayerConf import InDet__InDetTestBLayerTool InDetRecTestBLayerTool = InDet__InDetTestBLayerTool(name = "InDetRecTestBLayerTool", - PixelSummaryTool = InDetPixelConditionsSummaryTool, + PixelSummaryTool = ToolSvc.PixelConditionsSummaryTool, Extrapolator = InDetExtrapolator) ToolSvc += InDetRecTestBLayerTool if (InDetFlags.doPrintConfigurables()): diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPreProcessingSilicon.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPreProcessingSilicon.py index 9ab8477c36d4f219eb382305d6577b07a5643526..2eb1bd12af680fec45c1330a8a06283108504337 100644 --- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPreProcessingSilicon.py +++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPreProcessingSilicon.py @@ -74,7 +74,6 @@ if InDetFlags.doPRDFormation(): # --- Neutral Network version ? # if InDetFlags.pixelClusterSplittingType() == 'NeuralNet': - useBeamConstraint = InDetFlags.useBeamConstraint() # --- new NN prob tool @@ -119,7 +118,6 @@ if InDetFlags.doPRDFormation(): # --- Neutral Network version ? # elif InDetFlags.pixelClusterSplittingType() == 'AnalogClus': - # new splitter tool from SiClusterizationTool.SiClusterizationToolConf import InDet__TotPixelClusterSplitter TotPixelClusterSplitter=InDet__TotPixelClusterSplitter (name="TotPixelClusterSplitter") diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConditionsAccess.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConditionsAccess.py index 1a917669d9e6a0c6cfd966c44d894a2be1300dd8..85dc1a3141411a0c911fade550cf055083ff624a 100644 --- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConditionsAccess.py +++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConditionsAccess.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration ## ## @file InDetTrigConfConditionsAccess.py @@ -8,24 +8,18 @@ from InDetTrigRecExample.InDetTrigFlags import InDetTrigFlags -print "STSTST InDetTrigConditionsAccess 1" - if InDetTrigFlags.useConditionsClasses(): _useDCS = False _onlineMode = True _prefix = 'InDetTrig' #_prefix = '' - print "STSTST InDetTrigConditionsAccess 2" - from InDetTrigRecExample.InDetTrigConfigConditions import PixelConditionsSetup PixelConditionsSetup.config(useDCS=_useDCS,onlineMode=_onlineMode,prefix=_prefix) PixelConditionsSetup.lock() PixelConditionsSetup.createSvc() PixelConditionsSetup.createTool() - print "STSTST InDetTrigConditionsAccess 3" - from InDetTrigRecExample.InDetTrigConfigConditions import SCT_ConditionsSetup SCT_ConditionsSetup.config(useDCS=_useDCS, onlineMode=_onlineMode, prefix=_prefix) SCT_ConditionsSetup.lock() diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py index c254188e1835a7264af8acb8a98631a8fb88edc0..bd3b52aa974721e17dab8b40532e550ea42f69fe 100644 --- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py +++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigConditions.py @@ -16,7 +16,6 @@ class PixelConditionsServicesSetup: self._lock = False self.config(useDCS=True, onlineMode=False, prefix='') #default offline settings - ########### STSTST NEW ############## from AthenaCommon.AppMgr import ServiceMgr self.svcMgr = ServiceMgr from AthenaCommon.AppMgr import ToolSvc @@ -26,8 +25,6 @@ class PixelConditionsServicesSetup: from AthenaCommon.GlobalFlags import globalflags if globalflags.DataSource() == 'data': self.isData = True - ########### STSTST NEW ############## - def config(self, useDCS=True, onlineMode=False, prefix=''): if not self._lock: @@ -52,60 +49,26 @@ class PixelConditionsServicesSetup: def createSvc(self): - from AthenaCommon.AppMgr import ToolSvc,ServiceMgr,theApp - from IOVDbSvc.CondDB import conddb - from AthenaCommon.AlgSequence import AthSequencer - condSeq = AthSequencer("AthCondSeq") + from AthenaCommon.AppMgr import ToolSvc + if not hasattr(ToolSvc, "PixelConditionsSummaryTool"): + from PixelConditionsTools.PixelConditionsSummaryToolSetup import PixelConditionsSummaryToolSetup + pixelConditionsSummaryToolSetup = PixelConditionsSummaryToolSetup() + pixelConditionsSummaryToolSetup.setUseDCS(self.useDCS) + pixelConditionsSummaryToolSetup.setUseBS(self.useBS) + pixelConditionsSummaryToolSetup.setUseTDAQ(self.useTDAQ) + pixelConditionsSummaryToolSetup.setup() + + PixelConditionsSummaryTool = ToolSvc.PixelConditionsSummaryTool - #Retire service later - from PixelConditionsServices.PixelConditionsServicesConf import PixelConditionsSummarySvc as pixSummarySvc - PixelConditionsSummarySvc = \ - pixSummarySvc(name=self.instanceName('PixelConditionsSummarySvc'), - UseDCS = self.useDCS, - UseByteStream=self.useBS, - #UseSpecialPixelMap= not self.onlineMode, - UseSpecialPixelMap=True, - UseTDAQ=self.useTDAQ - ) - #active states used by dcs (if on) - if self.useDCS and not self.onlineMode: - PixelConditionsSummarySvc.IsActiveStates = [ 'READY', 'ON' ] - PixelConditionsSummarySvc.IsActiveStatus = [ 'OK', 'WARNING' ] - - ServiceMgr += PixelConditionsSummarySvc - - if self._print: print PixelConditionsSummarySvc - - from PixelConditionsTools.PixelConditionsToolsConf import PixelConditionsSummaryTool as pixSummaryTool - PixelConditionsSummaryTool = \ - pixSummaryTool(name=self.instanceName('PixelConditionsSummaryTool'), - UseDCS = self.useDCS, - UseByteStream=self.useBS, - #UseSpecialPixelMap= not self.onlineMode, - UseSpecialPixelMap=True, - UseTDAQ=self.useTDAQ - ) - #active states used by dcs (if on) if self.useDCS and not self.onlineMode: PixelConditionsSummaryTool.IsActiveStates = [ 'READY', 'ON' ] PixelConditionsSummaryTool.IsActiveStatus = [ 'OK', 'WARNING' ] - ToolSvc += PixelConditionsSummaryTool - if self._print: print PixelConditionsSummaryTool - - - - # #create another instance of the PixelConditionsSummarySvc w/o BS - # # service to be used with RegionSelector - # InDetTrigRSPixelConditionsSummarySvc = pixSummarySvc(name='InDetTrigRSPixelConditionsSummarySvc', - # UseDCS = self.useDCS, - # UseByteStream=self.useBS - # UseSpecialPixelMap= True, - # ) - # ServiceMgr += InDetTrigRSPixelConditionsSummarySvc - # if self._print: print InDetTrigRSPixelConditionsSummarySvc + + from AthenaCommon.AppMgr import ServiceMgr,theApp + from IOVDbSvc.CondDB import conddb if not self.onlineMode: from PixelConditionsServices.PixelConditionsServicesConf import PixelCalibSvc PixelCalibSvc = PixelCalibSvc(name=self.instanceName('PixelCalibSvc')) @@ -185,135 +148,14 @@ class PixelConditionsServicesSetup: # if self._print: print SpecialPixelMapSvc -#STSTST from AthenaCommon.AthenaCommonFlags import athenaCommonFlags -#STSTST from AthenaCommon.GlobalFlags import globalflags -#STSTST if self.useDCS or self.onlineMode: -#STSTST #sim -#STSTST if globalflags.DataSource() == 'geant4' or (not athenaCommonFlags.isOnline()): -#STSTST if not conddb.folderRequested('/PIXEL/DCS/TEMPERATURE'): -#STSTST conddb.addFolder("DCS_OFL","/PIXEL/DCS/TEMPERATURE") -#STSTST if not conddb.folderRequested('/PIXEL/DCS/HV'): -#STSTST conddb.addFolder("DCS_OFL","/PIXEL/DCS/HV") -#STSTST if not conddb.folderRequested('/PIXEL/DCS/FSMSTATUS'): -#STSTST conddb.addFolder("DCS_OFL","/PIXEL/DCS/FSMSTATUS") -#STSTST if not conddb.folderRequested('/PIXEL/DCS/FSMSTATE'): -#STSTST conddb.addFolder("DCS_OFL","/PIXEL/DCS/FSMSTATE") -#STSTST else: -#STSTST if not conddb.folderRequested('/PIXEL/HLT/DCS/TEMPERATURE'): -#STSTST conddb.addFolder("PIXEL_ONL","/PIXEL/HLT/DCS/TEMPERATURE") -#STSTST #conddb.addFolder("PIXEL","/PIXEL/HLT/DCS/TEMPERATURE <tag>PixDCSTemp-UPD1-00</tag>") -#STSTST if not conddb.folderRequested('/PIXEL/HLT/DCS/HV'): -#STSTST conddb.addFolder("PIXEL_ONL","/PIXEL/HLT/DCS/HV") -#STSTST #conddb.addFolder("PIXEL","/PIXEL/HLT/DCS/HV <tag>PixDCSHV-UPD1-00</tag>") -#STSTST -#STSTST -#STSTST from PixelConditionsServices.PixelConditionsServicesConf import PixelDCSSvc -#STSTST InDetPixelDCSSvc = PixelDCSSvc(name = 'TrigPixelDCSSvc', -#STSTST RegisterCallback = True, -#STSTST TemperatureFolder = "/PIXEL/DCS/TEMPERATURE", -#STSTST HVFolder = "/PIXEL/DCS/HV", -#STSTST FSMStatusFolder = "/PIXEL/DCS/FSMSTATUS", -#STSTST FSMStateFolder = "/PIXEL/DCS/FSMSTATE", -#STSTST TemperatureFieldName = "temperature", -#STSTST HVFieldName = "HV", -#STSTST FSMStatusFieldName = "FSM_status", -#STSTST FSMStateFieldName = "FSM_state", -#STSTST UseFSMStatus = False, -#STSTST UseFSMState = False -#STSTST ) -#STSTST -#STSTST if globalflags.DataSource() == 'data': -#STSTST if (not athenaCommonFlags.isOnline()): -#STSTST InDetPixelDCSSvc.TemperatureFolder = "/PIXEL/DCS/TEMPERATURE" -#STSTST InDetPixelDCSSvc.HVFolder = "/PIXEL/DCS/HV" -#STSTST else: -#STSTST InDetPixelDCSSvc.TemperatureFolder = "/PIXEL/HLT/DCS/TEMPERATURE" -#STSTST InDetPixelDCSSvc.HVFolder = "/PIXEL/HLT/DCS/HV" -#STSTST -#STSTST ServiceMgr += InDetPixelDCSSvc -#STSTST -#STSTST -#STSTST if self.useDCS or self.onlineMode: -#STSTST if self._print: print InDetPixelDCSSvc -#STSTST -#STSTST -#STSTST #this needs also updates how LorentzAngleSvc is accessed () -#STSTST from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SiLorentzAngleSvc -#STSTST PixelLorentzAngleSvc = SiLorentzAngleSvc(name='PixelLorentzAngleSvc') -#STSTST from PixelConditionsServices.PixelConditionsServicesConf import PixelSiliconConditionsSvc -#STSTST pixelSiliconConditionsSvc=PixelSiliconConditionsSvc(name=self.instanceName('PixelSiliconConditionsSvc'), -#STSTST PixelDCSSvc = 'TrigPixelDCSSvc') -#STSTST ServiceMgr += pixelSiliconConditionsSvc -#STSTST -#STSTST PixelLorentzAngleSvc.SiConditionsServices = pixelSiliconConditionsSvc -#STSTST PixelLorentzAngleSvc.UseMagFieldSvc = True #may need also MagFieldSvc instance -#STSTST -#STSTST #if self.useDCS or self.onlineMode: -#STSTST #if (globalflags.DataSource() == 'data'): -#STSTST #else: -#STSTST #pixelSiliconConditionsSvc.ForceUseGeoModel = True -#STSTST #PixelLorentzAngleSvc.pixelForceUseGeoModel() -#STSTST if self._print: -#STSTST print pixelSiliconConditionsSvc -#STSTST print PixelLorentzAngleSvc - - - ########### STSTST NEW ############## def createTool(self): - self.dcsTool = self.initDcsTool('InDetPixelDCSConditionsTool') - self.lorentzTool = self.initLorentzAngleTool('PixelLorentzAngleTool') + from AthenaCommon.AppMgr import ToolSvc + if not hasattr(ToolSvc, "PixelLorentzAngleTool"): + from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup + pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() pass - def initDcsTool(self, instanceName): - "Init DCS conditions tool" - - from PixelConditionsTools.PixelDCSConditionsToolSetup import PixelDCSConditionsToolSetup - pixelDCSConditionsToolSetup = PixelDCSConditionsToolSetup() - pixelDCSConditionsToolSetup.setToolName(instanceName) - pixelDCSConditionsToolSetup.setIsDATA(self.isData) - from AthenaCommon.AthenaCommonFlags import athenaCommonFlags - if athenaCommonFlags.isOnline(): - pixelDCSConditionsToolSetup.setHVFolder("/PIXEL/HLT/DCS/HV") - pixelDCSConditionsToolSetup.setTempFolder("/PIXEL/HLT/DCS/TEMPERATURE") - pixelDCSConditionsToolSetup.setDbInstance("PIXEL_ONL") - else: - pixelDCSConditionsToolSetup.setHVFolder("/PIXEL/DCS/HV") - pixelDCSConditionsToolSetup.setTempFolder("/PIXEL/DCS/TEMPERATURE") - pixelDCSConditionsToolSetup.setDbInstance("DCS_OFL") - - pixelDCSConditionsToolSetup.setup() - dcsTool = pixelDCSConditionsToolSetup.getTool() - return dcsTool - - def initLorentzAngleTool(self, instanceName): - "Inititalize Lorentz angle Tool" - - from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup - pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup() - pixelSiPropertiesToolSetup.setSiliconTool(self.dcsTool) - pixelSiPropertiesToolSetup.setup() - - from AthenaCommon.AlgSequence import AthSequencer - condSeq = AthSequencer("AthCondSeq") - if not hasattr(condSeq, "PixelSiLorentzAngleCondAlg"): - from SiLorentzAngleSvc.SiLorentzAngleSvcConf import PixelSiLorentzAngleCondAlg - from AthenaCommon.AthenaCommonFlags import athenaCommonFlags - condSeq += PixelSiLorentzAngleCondAlg(name = "PixelSiLorentzAngleCondAlg", - PixelDCSConditionsTool = self.dcsTool, - SiPropertiesTool = pixelSiPropertiesToolSetup.getTool(), - UseMagFieldSvc = True, - UseMagFieldDcs = (not athenaCommonFlags.isOnline())) - pixelSiLorentzAngleCondAlg = condSeq.PixelSiLorentzAngleCondAlg - - if not hasattr(self.toolSvc, instanceName): - from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SiLorentzAngleTool - self.toolSvc += SiLorentzAngleTool(name=instanceName, DetectorName="Pixel", SiLorentzAngleCondData="PixelSiLorentzAngleCondData") - pixelLorentzAngleTool = getattr(self.toolSvc, instanceName) - pixelLorentzAngleTool.UseMagFieldSvc = True - - print "STSTST initLorentzAngleTool end ",instanceName - def instanceName(self, toolname): return self.prefix+toolname diff --git a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py index c5e5af36d3a67f8cc81c78303017ad9e87094212..aa395256dfb5fcbf005ac5118153d29d6ee7d8fd 100755 --- a/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py +++ b/InnerDetector/InDetExample/InDetTrigRecExample/python/InDetTrigConfigRecLoadTools.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration # ------------------------------------------------------------ @@ -92,18 +92,54 @@ if InDetTrigFlags.loadRotCreator(): from SiClusterOnTrackTool.SiClusterOnTrackToolConf import InDet__PixelClusterOnTrackTool from InDetTrigRecExample.InDetTrigConditionsAccess import PixelConditionsSetup + from TrkNeuralNetworkUtils.TrkNeuralNetworkUtilsConf import Trk__NeuralNetworkToHistoTool + NeuralNetworkToHistoTool=Trk__NeuralNetworkToHistoTool(name = "NeuralNetworkToHistoTool") + + ToolSvc += NeuralNetworkToHistoTool + if (InDetTrigFlags.doPrintConfigurables()): + print NeuralNetworkToHistoTool + + from SiClusterizationTool.SiClusterizationToolConf import InDet__NnClusterizationFactory + from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as geoFlags + if ( not geoFlags.Run() in ["RUN2", "RUN3"] ) : + NnClusterizationFactory = InDet__NnClusterizationFactory( name = "NnClusterizationFactory", + PixelLorentzAngleTool= ToolSvc.PixelLorentzAngleTool, + NetworkToHistoTool = NeuralNetworkToHistoTool, + doRunI = True, + useToT = False, + useRecenteringNNWithoutTracks = True, + useRecenteringNNWithTracks = False, + correctLorShiftBarrelWithoutTracks = 0, + correctLorShiftBarrelWithTracks = 0.030, + LoadNoTrackNetwork = True, + LoadWithTrackNetwork = True) + else: + NnClusterizationFactory = InDet__NnClusterizationFactory( name = "NnClusterizationFactory", + PixelLorentzAngleTool= ToolSvc.PixelLorentzAngleTool, + NetworkToHistoTool = NeuralNetworkToHistoTool, + LoadNoTrackNetwork = True, + useToT = InDetTrigFlags.doNNToTCalibration(), + LoadWithTrackNetwork = True) + + ToolSvc += NnClusterizationFactory + + from IOVDbSvc.CondDB import conddb + if not conddb.folderRequested('/PIXEL/PixelClustering/PixelClusNNCalib'): + conddb.addFolder("PIXEL_OFL","/PIXEL/PixelClustering/PixelClusNNCalib") + if InDetTrigFlags.doTIDE_RescalePixelCovariances() : + if not conddb.folderRequested('/PIXEL/PixelClustering/PixelCovCorr'): + conddb.addFolder("PIXEL_OFL","/PIXEL/PixelClustering/PixelCovCorr") + + if (InDetTrigFlags.doPrintConfigurables()): + print NnClusterizationFactory + InDetTrigPixelClusterOnTrackTool = InDet__PixelClusterOnTrackTool("InDetTrigPixelClusterOnTrackTool", PixelOfflineCalibSvc=PixelConditionsSetup.instanceName('PixelOfflineCalibSvc'), ErrorStrategy = 2, -# LorentzAngleTool = PixelConditionsSetup.instanceName('PixelLorentzAngleTool')) LorentzAngleTool = ToolSvc.PixelLorentzAngleTool) - print "STSTST InDetTrigConfigRecLoadTools 1" - ToolSvc += InDetTrigPixelClusterOnTrackTool - print "STSTST InDetTrigConfigRecLoadTools 2" - if (InDetTrigFlags.doPrintConfigurables()): print InDetTrigPixelClusterOnTrackTool @@ -596,9 +632,7 @@ if InDetTrigFlags.loadFitter(): if DetFlags.haveRIO.pixel_on(): - from PixelConditionsTools.PixelConditionsToolsConf import PixelConditionsSummaryTool - from InDetTrigRecExample.InDetTrigConditionsAccess import PixelConditionsSetup - InDetTrigPixelConditionsSummaryTool = PixelConditionsSummaryTool(PixelConditionsSetup.instanceName('PixelConditionsSummaryTool')) + InDetTrigPixelConditionsSummaryTool = ToolSvc.PixelConditionsSummaryTool else: InDetTrigPixelConditionsSummaryTool = None diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalErrorMonTool.cxx b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalErrorMonTool.cxx index a097804a3c45aeceae6c3d3a047569333cdcb942..d4eb106c6a1ca23f40662dd0f86b3bbdfbda8925 100755 --- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalErrorMonTool.cxx +++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalErrorMonTool.cxx @@ -1,12 +1,11 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ //Local #include "InDetGlobalErrorMonTool.h" #include "InDetIdentifier/PixelID.h" -#include "InDetConditionsSummaryService/IInDetConditionsSvc.h" #include "PixelConditionsServices/IPixelByteStreamErrorsSvc.h" @@ -23,7 +22,6 @@ InDetGlobalErrorMonTool::InDetGlobalErrorMonTool( const std::string & type, m_pixID( 0 ), m_pixManager( 0 ), m_sctManager( 0 ), - m_pixCond("PixelConditionsSummarySvc", name), m_ErrorSvc("PixelByteStreamErrorsSvc",name), m_errorGeoPixel(), m_disabledGeoPixel(), @@ -58,10 +56,7 @@ StatusCode InDetGlobalErrorMonTool::initialize() { return StatusCode::FAILURE; } - if (m_pixCond.retrieve().isFailure()){ - msg(MSG::ERROR) << "Could not retrieve Pixel conditions service!" << endmsg; - return StatusCode::FAILURE; - } + ATH_CHECK(m_pixelCondSummaryTool.retrieve()); ATH_CHECK(m_ConfigurationTool.retrieve()); ATH_CHECK(m_byteStreamErrTool.retrieve()); @@ -302,7 +297,7 @@ bool InDetGlobalErrorMonTool::SyncPixel() IdentifierHash waferHash = m_pixID->wafer_hash((*fit)); // Inactive module, flagging time! - if ( m_pixCond->isActive( waferHash ) == false ) + if ( m_pixelCondSummaryTool->isActive( waferHash ) == false ) { moduleGeo_t moduleGeo; @@ -316,7 +311,7 @@ bool InDetGlobalErrorMonTool::SyncPixel() } // Bad module, flagging time! - if ( m_pixCond->isActive( waferHash ) == true && m_pixCond->isGood( waferHash ) == false ) + if ( m_pixelCondSummaryTool->isActive( waferHash ) == true && m_pixelCondSummaryTool->isGood( waferHash ) == false ) { moduleGeo_t moduleGeo; diff --git a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalErrorMonTool.h b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalErrorMonTool.h index 3d89f16f018e783f45d7ddbe0ce228b9db3f3075..3548c276849330f9632f5bf18283df2b57a5ed81 100755 --- a/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalErrorMonTool.h +++ b/InnerDetector/InDetMonitoring/InDetGlobalMonitoring/src/InDetGlobalErrorMonTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef InDetGlobalErrorMonTool_H @@ -12,10 +12,10 @@ #include "AthenaMonitoring/ManagedMonitorToolBase.h" #include "Identifier/Identifier.h" #include "Identifier/IdentifierHash.h" +#include "InDetConditionsSummaryService/IInDetConditionsTool.h" #include "SCT_ConditionsTools/ISCT_ConfigurationConditionsTool.h" #include "SCT_ConditionsTools/ISCT_ByteStreamErrorsTool.h" -class IInDetConditionsSvc; class IPixelByteStreamErrorsSvc; namespace InDetDD @@ -59,7 +59,7 @@ private: const InDetDD::PixelDetectorManager * m_pixManager; const InDetDD::SCT_DetectorManager * m_sctManager; - ServiceHandle<IInDetConditionsSvc> m_pixCond; + ToolHandle<IInDetConditionsTool> m_pixelCondSummaryTool{this, "PixelConditionsSummaryTool", "PixelConditionsSummaryTool", "Tool to retrieve Pixel Conditions summary"}; ToolHandle<ISCT_ConfigurationConditionsTool> m_ConfigurationTool{this, "conditionsTool", "SCT_ConfigurationConditionsTool/InDetSCT_ConfigurationConditionsTool", "Tool to retrieve SCT Configuration Tool"}; ToolHandle<ISCT_ByteStreamErrorsTool> m_byteStreamErrTool{this, "SCT_ByteStreamErrorsTool", "SCT_ByteStreamErrorsTool", "Tool to retrieve SCT ByteStream Errors"}; diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h index 6b24df4850dc75b99874e185e09a1cad1800468b..59a6c97d317d6f035cb5e66b68338f61bccf6211 100755 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/PixelMonitoring/PixelMainMon.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef PIXMAINMON_H_ @@ -24,6 +24,7 @@ #include "EventInfo/EventInfo.h" #include "xAODEventInfo/EventInfo.h" #include "StoreGate/ReadHandleKey.h" +#include "InDetConditionsSummaryService/IInDetConditionsTool.h" class PixelMonModules1D; class PixelMonModulesProf; @@ -60,7 +61,6 @@ class ITrackHoleSearchTool; class IPixelCablingSvc; class SpacePointContainer; class IPixelByteStreamErrorsSvc; -class IInDetConditionsSvc; class PixelRDORawData; typedef InDet::PixelCluster PixelCluster; @@ -171,7 +171,7 @@ class PixelMainMon : public ManagedMonitorToolBase { StatusCode procPixelDCSMon(void); private: - ServiceHandle<IInDetConditionsSvc> m_pixelCondSummarySvc; + ToolHandle<IInDetConditionsTool> m_pixelCondSummaryTool{this, "PixelConditionsSummaryTool", "PixelConditionsSummaryTool", "Tool to retrieve Pixel Conditions summary"}; ServiceHandle<IPixelByteStreamErrorsSvc> m_ErrorSvc; ServiceHandle<IPixelCablingSvc> m_pixelCableSvc; ServiceHandle<IBLParameterSvc> m_IBLParameterSvc; diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx index b36fde6265481cc125540e347a3461cf3cf7343f..d6a5f663a255e4375ae8eecb792536491d509932 100755 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/PixelMainMon.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////////////////// @@ -12,7 +12,6 @@ #include "PixelMonitoring/PixelMainMon.h" -#include "InDetConditionsSummaryService/IInDetConditionsSvc.h" #include "InDetRIO_OnTrack/SiClusterOnTrack.h" #include "InDetReadoutGeometry/SiDetectorElement.h" #include "LWHists/TH1F_LW.h" @@ -49,7 +48,6 @@ PixelMainMon::PixelMainMon(const std::string& type, const std::string& name, const IInterface* parent) : ManagedMonitorToolBase(type, name, parent), - m_pixelCondSummarySvc("PixelConditionsSummarySvc", name), m_ErrorSvc("PixelByteStreamErrorsSvc", name), m_pixelCableSvc("PixelCablingSvc", name), m_IBLParameterSvc("IBLParameterSvc", name), @@ -67,7 +65,6 @@ PixelMainMon::PixelMainMon(const std::string& type, const std::string& name, con m_FSM_status(new dcsDataHolder()), m_moduleDCSDataHolder(new moduleDcsDataHolder()) { // all job options flags go here - declareProperty("PixelConditionsSummarySvc", m_pixelCondSummarySvc); declareProperty("PixelByteStreamErrorsSvc", m_ErrorSvc); declareProperty("PixelCablingSvc", m_pixelCableSvc); declareProperty("HoleSearchTool", m_holeSearchTool); @@ -399,12 +396,7 @@ StatusCode PixelMainMon::initialize() { ATH_CHECK(detStore()->retrieve(m_idHelper, "AtlasID")); - if (m_pixelCondSummarySvc.retrieve().isFailure()) { - if (msgLvl(MSG::FATAL)) msg(MSG::FATAL) << "Failed to retrieve tool " << m_pixelCondSummarySvc << endmsg; - return StatusCode::FAILURE; - } else { - if (msgLvl(MSG::INFO)) msg(MSG::INFO) << "Retrieved tool " << m_pixelCondSummarySvc << endmsg; - } + ATH_CHECK(m_pixelCondSummaryTool.retrieve()); if (m_pixelCableSvc.retrieve().isFailure()) { if (msgLvl(MSG::FATAL)) msg(MSG::FATAL) << "Failed to retrieve tool " << m_pixelCableSvc << endmsg; @@ -755,10 +747,10 @@ StatusCode PixelMainMon::fillHistograms() { pixlayeribl2d3ddbm = getPixLayerIDIBL2D3DDBM(m_pixelid->barrel_ec(WaferID), m_pixelid->layer_disk(WaferID), m_pixelid->eta_module(WaferID), m_doIBL); } if (pixlayeribl2d3ddbm == 99) continue; - if (m_pixelCondSummarySvc->isActive(id_hash) == true) { + if (m_pixelCondSummaryTool->isActive(id_hash) == true) { m_nActive_mod[pixlayeribl2d3ddbm]++; } - if (m_pixelCondSummarySvc->isActive(id_hash) == true && m_pixelCondSummarySvc->isGood(id_hash) == true) { + if (m_pixelCondSummaryTool->isActive(id_hash) == true && m_pixelCondSummaryTool->isGood(id_hash) == true) { m_nGood_mod[pixlayeribl2d3ddbm]++; } } diff --git a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Status.cxx b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Status.cxx index bac360fc10436b2e521d701aee046cb8bc848473..2b040c22eb46bcc7adf65bcdf315fd70bccb3bb8 100644 --- a/InnerDetector/InDetMonitoring/PixelMonitoring/src/Status.cxx +++ b/InnerDetector/InDetMonitoring/PixelMonitoring/src/Status.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////////////////// @@ -130,9 +130,9 @@ StatusCode PixelMainMon::fillStatusMon(void) { if (pixlayer == 99) continue; // check in order of occurrence to reduce number of calls to conditions service - if (m_pixelCondSummarySvc->isActive(id_hash) == true && m_pixelCondSummarySvc->isGood(id_hash) == true) { + if (m_pixelCondSummaryTool->isActive(id_hash) == true && m_pixelCondSummaryTool->isGood(id_hash) == true) { Index = 0; - } else if (m_pixelCondSummarySvc->isActive(id_hash) == false) { + } else if (m_pixelCondSummaryTool->isActive(id_hash) == false) { Index = 2; } else { Index = 1; diff --git a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/PixelClusterization.cxx b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/PixelClusterization.cxx index 25492537d3d5d3646b77c4c96e4f5fccb738fadf..197b1afe8c8a594c6db31641ec898be45ef73957 100644 --- a/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/PixelClusterization.cxx +++ b/InnerDetector/InDetRecAlgs/InDetPrepRawDataFormation/src/PixelClusterization.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /** @@ -145,13 +145,12 @@ namespace InDet{ if (!RDO_Collection || RDO_Collection->empty()) continue; if( clusterContainer->tryFetch( rdoCollections.hashId() )) continue; - // Use one of the specific clustering AlgTools to make clusters std::unique_ptr<PixelClusterCollection> clusterCollection (m_clusteringTool->clusterize(*RDO_Collection, *m_manager, *m_idHelper)); + if (clusterCollection && !clusterCollection->empty()){ m_gangedAmbiguitiesFinder->execute(clusterCollection.get(),*m_manager,*ambiguitiesMap); - IdentifierHash hash = clusterCollection->identifyHash(); ATH_CHECK(clusterContainer->addOrDelete( std::move(clusterCollection), hash )); }else{ diff --git a/InnerDetector/InDetRecTools/InDetTestBLayer/InDetTestBLayer/InDetTestBLayerTool.h b/InnerDetector/InDetRecTools/InDetTestBLayer/InDetTestBLayer/InDetTestBLayerTool.h index 91f1330779966060468fb60cf8bee61292a992f8..b0bfce60e3e9bf69fe0272419c5c074d23c19160 100644 --- a/InnerDetector/InDetRecTools/InDetTestBLayer/InDetTestBLayer/InDetTestBLayerTool.h +++ b/InnerDetector/InDetRecTools/InDetTestBLayer/InDetTestBLayer/InDetTestBLayerTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef InDetTestBLayerTool_H @@ -114,7 +114,7 @@ namespace InDet { ToolHandle< Trk::IExtrapolator > m_extrapolator; /** Handles to IConditionsSummaryServices for Pixels */ - ToolHandle <IInDetConditionsTool> m_pixelCondSummaryTool; + ToolHandle <IInDetConditionsTool> m_pixelCondSummaryTool{this, "PixelSummaryTool", "PixelConditionsSummaryTool/InDetPixelConditionsSummaryTool", "Tool to retrieve Pixel Conditions summary"}; /** pointer to the residual pull calculator **/ ToolHandle < Trk::IResidualPullCalculator > m_residualPullCalculator; diff --git a/InnerDetector/InDetRecTools/InDetTestBLayer/src/InDetTestBLayerTool.cxx b/InnerDetector/InDetRecTools/InDetTestBLayer/src/InDetTestBLayerTool.cxx index 790fa9f9269d95e5d89439d44e8c8b660df39d5c..7f00e3606db21c6d73eb5ad06a371b2e8d4cbc8c 100644 --- a/InnerDetector/InDetRecTools/InDetTestBLayer/src/InDetTestBLayerTool.cxx +++ b/InnerDetector/InDetRecTools/InDetTestBLayer/src/InDetTestBLayerTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "AthenaBaseComps/AthAlgTool.h" @@ -48,7 +48,6 @@ namespace InDet { const std::string& n, const IInterface* p): AthAlgTool(name, n,p), m_extrapolator(""), - m_pixelCondSummaryTool("",this), m_residualPullCalculator("Trk::ResidualPullCalculator/ResidualPullCalculator"), m_idHelper(nullptr), m_pixelId(nullptr), @@ -56,7 +55,6 @@ namespace InDet { { declareInterface<IInDetTestBLayerTool>(this); declareProperty("Extrapolator" , m_extrapolator); - declareProperty("PixelSummaryTool", m_pixelCondSummaryTool); declareProperty("ResidualPullCalculator",m_residualPullCalculator); declareProperty("CheckActiveAreas", m_checkActiveAreas = false); declareProperty("CheckDeadRegions", m_checkDeadRegions = false); @@ -102,7 +100,7 @@ namespace InDet { } } - // Get PixelConditionsSummarySvc + // Get PixelConditionsSummaryTool if( m_pixelCondSummaryTool.empty() ){ ATH_MSG_INFO( "PixelConditionsSummary not configured " ); m_configured=false; diff --git a/InnerDetector/InDetRecTools/InDetTestPixelLayer/InDetTestPixelLayer/InDetTestPixelLayerTool.h b/InnerDetector/InDetRecTools/InDetTestPixelLayer/InDetTestPixelLayer/InDetTestPixelLayerTool.h index 5bc1d4fb9feb0d21eba3f484966975c4aad46a3b..48e764d8c7f05f1a45acdce5f763affb97e793eb 100644 --- a/InnerDetector/InDetRecTools/InDetTestPixelLayer/InDetTestPixelLayer/InDetTestPixelLayerTool.h +++ b/InnerDetector/InDetRecTools/InDetTestPixelLayer/InDetTestPixelLayer/InDetTestPixelLayerTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef InDetTestPixelLayerTool_H @@ -84,7 +84,7 @@ namespace InDet { ToolHandle< Trk::IExtrapolator > m_extrapolator; /** Handles to IConditionsSummaryServices for Pixels */ - ToolHandle <IInDetConditionsTool> m_pixelCondSummaryTool; + ToolHandle <IInDetConditionsTool> m_pixelCondSummaryTool{this, "PixelSummaryTool", "PixelConditionsSummaryTool/InDetPixelConditionsSummaryTool", "Tool to retrieve Pixel Conditions summary"}; /** pointer to the residual pull calculator **/ ToolHandle < Trk::IResidualPullCalculator > m_residualPullCalculator; diff --git a/InnerDetector/InDetRecTools/InDetTestPixelLayer/src/InDetTestPixelLayerTool.cxx b/InnerDetector/InDetRecTools/InDetTestPixelLayer/src/InDetTestPixelLayerTool.cxx index c08e02a903377537beae9047a82a22409a8c2339..70868b49f6a87fb14c307a7a916c32ae77b7a447 100644 --- a/InnerDetector/InDetRecTools/InDetTestPixelLayer/src/InDetTestPixelLayerTool.cxx +++ b/InnerDetector/InDetRecTools/InDetTestPixelLayer/src/InDetTestPixelLayerTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "AthenaBaseComps/AthAlgTool.h" @@ -37,7 +37,6 @@ namespace InDet { const std::string& n, const IInterface* p): AthAlgTool(name, n,p), m_extrapolator("Trk::Extrapolator/InDetExtrapolator"), - m_pixelCondSummaryTool("PixelConditionsSummaryTool",this), m_residualPullCalculator("Trk::ResidualPullCalculator/ResidualPullCalculator"), m_idHelper(nullptr), m_pixelId(nullptr), @@ -48,7 +47,6 @@ namespace InDet { { declareInterface<IInDetTestPixelLayerTool>(this); declareProperty("Extrapolator" , m_extrapolator); - declareProperty("PixelSummaryTool", m_pixelCondSummaryTool); declareProperty("ResidualPullCalculator",m_residualPullCalculator); declareProperty("CheckActiveAreas", m_checkActiveAreas = false); declareProperty("CheckDeadRegions", m_checkDeadRegions = false); @@ -93,19 +91,7 @@ namespace InDet { } } - // Get PixelConditionsSummarySvc - if( m_pixelCondSummaryTool.empty() ){ - msg(MSG::INFO) << "PixelConditionsSummaryTool not configured " << endmsg; //n - m_configured=false; - } - else{ - if ( m_pixelCondSummaryTool.retrieve().isFailure() ) { - msg(MSG::FATAL) << "Failed to retrieve tool " << m_pixelCondSummaryTool << endmsg; //n - return StatusCode::FAILURE; - } else { - msg(MSG::INFO) << "Retrieved tool " << m_pixelCondSummaryTool << endmsg; //n - } - } + ATH_CHECK(m_pixelCondSummaryTool.retrieve()); if(!m_configured){ msg(MSG::INFO) << "you are using an unconfigured tool" << endmsg; @@ -436,7 +422,7 @@ namespace InDet { bool expect_hit = false; /// will be set to true if at least one good module is passed Identifier id = trackpar->associatedSurface().associatedDetectorElement()->identify(); - + if( m_pixelCondSummaryTool->isGood(id,InDetConditions::PIXEL_MODULE) ){ if(m_checkDeadRegions){ @@ -893,7 +879,7 @@ namespace InDet { } double frac = m_pixelCondSummaryTool->goodFraction(id_hash,startId,endId); - + return frac; } diff --git a/InnerDetector/InDetRecTools/InDetTrackHoleSearch/InDetTrackHoleSearch/InDetTrackHoleSearchTool.h b/InnerDetector/InDetRecTools/InDetTrackHoleSearch/InDetTrackHoleSearch/InDetTrackHoleSearchTool.h index 394029bd54bd9554558bee7556add98b6b11b833..0c5705d7b3a266d586a14f32e9f1e30cc41a7eda 100644 --- a/InnerDetector/InDetRecTools/InDetTrackHoleSearch/InDetTrackHoleSearch/InDetTrackHoleSearchTool.h +++ b/InnerDetector/InDetRecTools/InDetTrackHoleSearch/InDetTrackHoleSearch/InDetTrackHoleSearchTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -112,9 +112,8 @@ namespace InDet ToolHandle< Trk::IExtrapolator > m_extrapolator; /** Handles to IConditionsSummaryTools for Pixels and SCT*/ - ToolHandle <IInDetConditionsTool> m_sctCondSummaryTool{this, "SctSummaryTool", - "SCT_ConditionsSummaryTool/InDetSCT_ConditionsSummaryTool", "Tool to retrieve SCT Conditions summary"}; - ToolHandle <IInDetConditionsTool> m_pixelCondSummaryTool; + ToolHandle <IInDetConditionsTool> m_sctCondSummaryTool{this, "SctSummaryTool", "SCT_ConditionsSummaryTool/InDetSCT_ConditionsSummaryTool", "Tool to retrieve SCT Conditions summary"}; + ToolHandle <IInDetConditionsTool> m_pixelCondSummaryTool{this, "PixelSummaryTool", "PixelConditionsSummaryTool/InDetPixelConditionsSummaryTool", "Tool to retrieve Pixel Conditions summary"}; ToolHandle< IInDetTestPixelLayerTool > m_pixelLayerTool; diff --git a/InnerDetector/InDetRecTools/InDetTrackHoleSearch/src/InDetTrackHoleSearchTool.cxx b/InnerDetector/InDetRecTools/InDetTrackHoleSearch/src/InDetTrackHoleSearchTool.cxx index 6760d5dca523b24271b47c1d9d73b42769000d8f..294d9d5772d52d8901a868aca3f989f8513aecbd 100644 --- a/InnerDetector/InDetRecTools/InDetTrackHoleSearch/src/InDetTrackHoleSearchTool.cxx +++ b/InnerDetector/InDetRecTools/InDetTrackHoleSearch/src/InDetTrackHoleSearchTool.cxx @@ -36,7 +36,6 @@ InDet::InDetTrackHoleSearchTool::InDetTrackHoleSearchTool(const std::string& t, AthAlgTool(t,n,p), m_atlasId(nullptr), m_extrapolator("Trk::Extrapolator"), - m_pixelCondSummaryTool("PixelConditionsSummaryTool",this), m_pixelLayerTool("InDet::InDetTestPixelLayerTool"), m_geoModelSvc("GeoModelSvc", n), m_extendedListOfHoles(false), @@ -47,7 +46,6 @@ InDet::InDetTrackHoleSearchTool::InDetTrackHoleSearchTool(const std::string& t, m_warning(0) { declareInterface<ITrackHoleSearchTool>(this); declareProperty("Extrapolator" , m_extrapolator); - declareProperty("PixelSummaryTool" , m_pixelCondSummaryTool); declareProperty("PixelLayerTool" , m_pixelLayerTool); declareProperty("GeoModelService" , m_geoModelSvc); declareProperty("ExtendedListOfHoles" , m_extendedListOfHoles = false); diff --git a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/PixelClusterOnTrackTool.cxx b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/PixelClusterOnTrackTool.cxx index 8f0b0368aead48162d369f47b4e89e2e0de19083..cee02d8d1bb218e3c1f2db393cfb9b59c9c06d84 100755 --- a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/PixelClusterOnTrackTool.cxx +++ b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/PixelClusterOnTrackTool.cxx @@ -439,7 +439,7 @@ InDet::PixelClusterOnTrackTool::correctDefault design->positionFromColumnRow(colmax, rowmax); InDetDD::SiLocalPosition centroid = 0.25 * (pos1 + pos2 + pos3 + pos4); - double shift = element->getLorentzCorrection(); + double shift = m_lorentzAngleTool->getLorentzShift(iH); int nrows = rowmax - rowmin + 1; int ncol = colmax - colmin + 1; double ang = 999.; diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/IPixelClusteringTool.h b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/IPixelClusteringTool.h index 10b4bcd75d37ec9b4bb6986bc05816401e967a48..9724700fa31d767bb1be2c53668e69c0e4a7b3f0 100755 --- a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/IPixelClusteringTool.h +++ b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/IPixelClusteringTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -23,9 +23,6 @@ // in LazyOfflineSpacePointTool in a trigger package (T.L.) #include "InDetConditionsSummaryService/IInDetConditionsSvc.h" -//class PixelConditionsSummarySvc; -//template <class T> class ServiceHandle; - class PixelID; namespace InDetDD diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/NnClusterizationFactory.h b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/NnClusterizationFactory.h index f27114f9939748a4e7d6ecdae8f89f8818ca1e37..622cc5f50bb7d6c6b36c0c83857b65a269a47c66 100644 --- a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/NnClusterizationFactory.h +++ b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/NnClusterizationFactory.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef BTAGTOOL_NnClusterizationFactory_C @@ -35,6 +35,7 @@ #include "TrkParameters/TrackParameters.h" #include "GeoPrimitives/GeoPrimitives.h" #include "EventPrimitives/EventPrimitives.h" +#include "InDetCondServices/ISiLorentzAngleTool.h" class TTrainedNetwork; class TH1; @@ -204,6 +205,7 @@ namespace InDet { std::string m_thresholdIndicator; ToolHandle<Trk::NeuralNetworkToHistoTool> m_networkToHistoTool; + ToolHandle<ISiLorentzAngleTool> m_pixelLorentzAngleTool{this, "PixelLorentzAngleTool", "PixelLorentzAngleTool", "Tool to retreive Lorentz angle of Pixel"}; ServiceHandle<IPixelCalibSvc> m_calibSvc; diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/PixelClusteringToolBase.h b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/PixelClusteringToolBase.h index bb423ddaf01b2215b5559b92ab2655211a692e63..7a05226f70b8b372084d8d529dce1b2826e15a71 100755 --- a/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/PixelClusteringToolBase.h +++ b/InnerDetector/InDetRecTools/SiClusterizationTool/SiClusterizationTool/PixelClusteringToolBase.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -66,7 +66,7 @@ protected: int m_errorStrategy; int m_acceptDiagonalClusters; int m_splitClusters; - ToolHandle<IInDetConditionsTool> m_summaryTool; + ToolHandle<IInDetConditionsTool> m_summaryTool{this, "PixelConditionsSummaryTool", "PixelConditionsSummaryTool", "Tool to retrieve Pixel Conditions summary"}; bool m_useModuleMap; bool m_usePixelMap; // mutable MsgStream m_log; diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx index bc6d9bd1979f6cf39f91fe54d5024092ec70c9b3..2def22d5d6bcaff436c5a34db6458624ab8e1459 100755 --- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx +++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/ClusterMakerTool.cxx @@ -202,7 +202,6 @@ PixelCluster* ClusterMakerTool::pixelCluster( Amg::Vector2D locpos(localPos[Trk::locX]+shift, localPos[Trk::locY]); // find global position of element Amg::Vector3D globalPos = element->globalPosition(localPosition); - // error matrix const Amg::Vector2D& colRow = width.colRow();// made ref to avoid // unnecessary copy EJWM @@ -396,7 +395,7 @@ PixelCluster* ClusterMakerTool::pixelCluster( Amg::Vector2D locpos(localPos[Trk::locX]+shift, localPos[Trk::locY]); // find global position of element Amg::Vector3D globalPos = element->globalPosition(localPosition); - + // error matrix const Amg::Vector2D& colRow = width.colRow();// made ref to avoid // unnecessary copy EJWM @@ -473,6 +472,7 @@ PixelCluster* ClusterMakerTool::pixelCluster( split, splitProb1, splitProb2); + return newCluster; } diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx index 0742262e1c8d29e0a32da009bedf77dca97a57da..a233fe08004d0ccaf3c81975e4d59b79a536dcb4 100755 --- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx +++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/MergedPixelsTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -192,7 +192,7 @@ namespace InDet { const PixelID& pixelID) const { // Get the messaging service, print where you are - + Identifier elementID = collection.identify(); // Get hash Identifier for these RDOs @@ -213,7 +213,6 @@ namespace InDet { if (m_useModuleMap && !(m_summaryTool->isGood(idHash))) return 0; - typedef InDetRawDataCollection<PixelRDORawData> RDO_Collection; // Get detector info. @@ -667,6 +666,7 @@ namespace InDet { *lvl1group=0; lvl1group++; } + return clusterCollection; } @@ -895,6 +895,7 @@ PixelCluster* MergedPixelsTool::makeCluster splitProb2); return cluster; } + } //-------------------------------------------------------------------------- // Determines if a pixel cell (whose identifier is the first argument) is @@ -940,7 +941,6 @@ void MergedPixelsTool::checkForMerge(const Identifier& id, // Look at each of groups that haven't already been checked to see if // RDO identifier is in any of them. If so, copy vector to base group and // the vector that has been copied. - typedef RDO_Vector::const_iterator idIterator; typedef TOT_Vector::const_iterator totIterator; MergedPixelsTool::RDO_GroupVector::const_iterator nextGroup(baseGroup+1); diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/NnClusterizationFactory.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/NnClusterizationFactory.cxx index 4b45318efb2ce5d5515053c67c5b9843d7bf9787..a29066290f32fef0b84f13cd54874cf5b3c195ac 100644 --- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/NnClusterizationFactory.cxx +++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/NnClusterizationFactory.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ ///////////////////////////////////////////////////////////////////////////////////////////////////// @@ -169,6 +169,8 @@ namespace InDet { ATH_MSG_ERROR("Could not retrieve " << m_calibSvc); return StatusCode::FAILURE; } + + ATH_CHECK(m_pixelLorentzAngleTool.retrieve()); return StatusCode::SUCCESS; } @@ -871,9 +873,8 @@ if(m_doRunI){ return assembleInputRunI( input, sizeX, sizeY ); }els InDetDD::SiLocalPosition siLocalPositionAdd(pitchY*(posYid-(double)posYid_int), pitchX*(posXid-(double)posXid_int)); - + double lorentzShift=m_pixelLorentzAngleTool->getLorentzShift(element->identifyHash()); - double lorentzShift=element->getLorentzCorrection(); if (input.ClusterPixBarrelEC == 0) { if (!input.useTrackInfo) @@ -1248,7 +1249,7 @@ if(m_doRunI){ return assembleInputRunI( input, sizeX, sizeY ); }els float trknormcomp = my_track.dot(my_normal); double bowphi = atan2(trkphicomp,trknormcomp); double boweta = atan2(trketacomp,trknormcomp); - tanl = element->getTanLorentzAnglePhi(); + tanl = m_pixelLorentzAngleTool->getTanLorentzAngle(element->identifyHash()); if(bowphi > M_PI/2) bowphi -= M_PI; if(bowphi < -M_PI/2) bowphi += M_PI; int readoutside = design->readoutSide(); diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/PixelClusteringToolBase.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/PixelClusteringToolBase.cxx index f22f12d9ee9d16a373469dab13335f9fe8e89352..285d66accf40ddba3465fa977e901d6794336a2d 100755 --- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/PixelClusteringToolBase.cxx +++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/PixelClusteringToolBase.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -25,7 +25,6 @@ namespace InDet m_errorStrategy(1), m_acceptDiagonalClusters(1), m_splitClusters(0), - m_summaryTool("PixelConditionsSummaryTool", this), m_useModuleMap(true), m_usePixelMap(true) { @@ -36,7 +35,6 @@ namespace InDet declareProperty("splitClusters", m_splitClusters); declareProperty("UsePixelModuleMap",m_useModuleMap,"Use bad modules map"); declareProperty("UseSpecialPixelMap",m_usePixelMap,"Use bad pixel map"); - declareProperty("PixelConditionsSummaryTool",m_summaryTool); } StatusCode PixelClusteringToolBase::initialize() diff --git a/InnerDetector/InDetRecTools/SiClusterizationTool/src/PixelGangedAmbiguitiesFinder.cxx b/InnerDetector/InDetRecTools/SiClusterizationTool/src/PixelGangedAmbiguitiesFinder.cxx index 6a6150be4fb786fd5d3a0de1a9d36b5c127853a7..c037311a0f0e582eadddf9a39fa0188f9ad1ea28 100755 --- a/InnerDetector/InDetRecTools/SiClusterizationTool/src/PixelGangedAmbiguitiesFinder.cxx +++ b/InnerDetector/InDetRecTools/SiClusterizationTool/src/PixelGangedAmbiguitiesFinder.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ //*************************************************************************** @@ -314,6 +314,7 @@ void PixelGangedAmbiguitiesFinder::execute( rmNumber++; } if(msgLvl(MSG::DEBUG)) msg() << rmNumber << " fake clusters from ganged pixel have been removed" << endmsg; + } diff --git a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx index 56b9a6bf3881f4884460436eba49bc63ee512293..868b845457e5a1abce532b1c2f365cf00974f556 100755 --- a/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx +++ b/InnerDetector/InDetRecTools/SiCombinatorialTrackFinderTool_xk/src/SiCombinatorialTrackFinder_xk.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ ////////////////////////////////////////////////////////////////// @@ -125,8 +125,6 @@ StatusCode InDet::SiCombinatorialTrackFinder_xk::initialize() Trk::IPRD_AssociationTool* assoTool = 0; if( !m_assoTool.retrieve().isFailure()) assoTool = &(*m_assoTool); - // Get PixelConditionsSummarySvc - // IInDetConditionsTool* pixcond = 0; if(m_usePIX ) { if ( m_pixelCondSummaryTool.retrieve().isFailure() ) { diff --git a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/CombinedMuonTrackSummary.py b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/CombinedMuonTrackSummary.py index 323073d7e04186e9508e0ffc1ff3d7b2e9737ff8..eebaf7dcc6b2335357ee86c39982c90c02c0f988 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/CombinedMuonTrackSummary.py +++ b/Reconstruction/MuonIdentification/MuonCombinedRecExample/python/CombinedMuonTrackSummary.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration ########################################################################### # @@ -38,7 +38,7 @@ if muonCombinedRecFlags.useDetailedPixelHoleSearch(): ToolSvc += InDet__InDetTestPixelLayerTool( name = "CombinedMuonInDetTestPixelLayerTool", Extrapolator = atlasExtrapolator, - PixelSummarySvc = ServiceMgr.PixelConditionsSummarySvc, + PixelSummaryTool = ToolSvc.PixelConditionsSummaryTool, CheckActiveAreas = True, CheckDeadRegions = True ) diff --git a/Reconstruction/egamma/egammaAlgs/python/EMBremCollectionBuilder.py b/Reconstruction/egamma/egammaAlgs/python/EMBremCollectionBuilder.py index b52f75bb8a5ff02b8aa571e0f4584128ae010845..20c34948584bf36521ef5008ccfd754db9110192 100644 --- a/Reconstruction/egamma/egammaAlgs/python/EMBremCollectionBuilder.py +++ b/Reconstruction/egamma/egammaAlgs/python/EMBremCollectionBuilder.py @@ -58,6 +58,30 @@ class egammaBremCollectionBuilder ( egammaAlgsConf.EMBremCollectionBuilder ) : useSCT = DetFlags.haveRIO.SCT_on(), CountDeadModulesAfterLastHit = True) + if DetFlags.haveRIO.pixel_on(): + if not hasattr(ToolSvc, "PixelConditionsSummaryTool"): + from PixelConditionsTools.PixelConditionsSummaryToolSetup import PixelConditionsSummaryToolSetup + pixelConditionsSummaryToolSetup = PixelConditionsSummaryToolSetup() + pixelConditionsSummaryToolSetup.setUseDCS((globalflags.DataSource=='data')) + pixelConditionsSummaryToolSetup.setUseBS((globalflags.DataSource=='data')) + pixelConditionsSummaryToolSetup.setup() + + InDetPixelConditionsSummaryTool = ToolSvc.PixelConditionsSummaryTool + + from AthenaCommon.AthenaCommonFlags import athenaCommonFlags + if athenaCommonFlags.isOnline() : + InDetPixelConditionsSummaryTool.UseSpecialPixelMap = False + else: + InDetPixelConditionsSummaryTool.UseSpecialPixelMap = True + + if InDetFlags.usePixelDCS(): + InDetPixelConditionsSummaryTool.IsActiveStates = [ 'READY', 'ON', 'UNKNOWN', 'TRANSITION', 'UNDEFINED' ] + InDetPixelConditionsSummaryTool.IsActiveStatus = [ 'OK', 'WARNING', 'ERROR', 'FATAL' ] + + GSFBuildHoleSearchTool.PixelSummaryTool = InDetPixelConditionsSummaryTool + else: + GSFBuildHoleSearchTool.PixelSummaryTool = None + if (DetFlags.haveRIO.SCT_on()): from SCT_ConditionsTools.SCT_ConditionsSummaryToolSetup import SCT_ConditionsSummaryToolSetup sct_ConditionsSummaryToolSetup = SCT_ConditionsSummaryToolSetup() @@ -72,12 +96,11 @@ class egammaBremCollectionBuilder ( egammaAlgsConf.EMBremCollectionBuilder ) : # Load BLayer tool # GSFBuildTestBLayerTool = None - if DetFlags.haveRIO.pixel_on() : + if DetFlags.haveRIO.pixel_on(): from InDetTestBLayer.InDetTestBLayerConf import InDet__InDetTestBLayerTool - from PixelConditionsTools.PixelConditionsToolsConf import PixelConditionsSummaryTool - ToolSvc += PixelConditionsSummaryTool() + GSFBuildTestBLayerTool = InDet__InDetTestBLayerTool(name = "GSFBuildTestBLayerTool", - PixelSummaryTool = ToolSvc.PixelConditionsSummaryTool, + PixelSummaryTool = InDetPixelConditionsSummaryTool, Extrapolator = GSFBuildInDetExtrapolator) ToolSvc += GSFBuildTestBLayerTool # diff --git a/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py b/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py index d396548846052dba600963e3ffa245447f4b5f9c..19df75b297e1b37b13dd89b21f79dc4f1486cf8e 100644 --- a/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py +++ b/Reconstruction/egamma/egammaRec/python/EMCommonRefitter.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration print "EMCommonRefitter.py" from InDetRecExample.InDetJobProperties import InDetFlags @@ -14,6 +14,7 @@ egammaRecFlags = egRecFlags.jobproperties.egammaRecFlags def CreateEgammaRotCreator(): global ToolSvc #Setup e/gamma offline RotCreator if one is not present + if InDetFlags.doPixelClusterSplitting() and InDetFlags.pixelClusterSplittingType() == 'NeuralNet': # --- temp: read calib file from AthenaCommon.AppMgr import ServiceMgr as svcMgr @@ -33,11 +34,17 @@ def CreateEgammaRotCreator(): conddb.addFolder("PIXEL_OFL","/PIXEL/PixelClustering/PixelClusNNCalib") # --- Select the necessary settings when running on run 1 data/MC # --- since a correction is needed to fix biases when running on new run 2 compatible calibation + + if not hasattr(ToolSvc, "PixelLorentzAngleTool"): + from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup + pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() + from SiClusterizationTool.SiClusterizationToolConf import InDet__NnClusterizationFactory from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as geoFlags if ( not geoFlags.Run() in ["RUN2", "RUN3"] ) : egNnClusterizationFactory = InDet__NnClusterizationFactory( name = "egNnClusterizationFactory", + PixelLorentzAngleTool= ToolSvc.PixelLorentzAngleTool, NetworkToHistoTool = egNeuralNetworkToHistoTool, doRunI = True, useToT = False, @@ -50,6 +57,7 @@ def CreateEgammaRotCreator(): else: egNnClusterizationFactory = InDet__NnClusterizationFactory( name = "egNnClusterizationFactory", + PixelLorentzAngleTool= ToolSvc.PixelLorentzAngleTool, NetworkToHistoTool = egNeuralNetworkToHistoTool, LoadNoTrackNetwork = True, useToT = InDetFlags.doNNToTCalibration(), @@ -61,8 +69,13 @@ def CreateEgammaRotCreator(): if DetFlags.haveRIO.pixel_on(): # load Pixel ROT creator, we overwrite the defaults for the # tool to always make conservative pixel cluster errors + if not hasattr(ToolSvc, "PixelLorentzAngleTool"): + from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup + pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() + from SiClusterOnTrackTool.SiClusterOnTrackToolConf import InDet__PixelClusterOnTrackTool egPixelClusterOnTrackTool = InDet__PixelClusterOnTrackTool("egPixelClusterOnTrackTool", + LorentzAngleTool = ToolSvc.PixelLorentzAngleTool, DisableDistortions = InDetFlags.doFatras(), applyNNcorrection = ( InDetFlags.doPixelClusterSplitting() and InDetFlags.pixelClusterSplittingType() == 'NeuralNet')) diff --git a/Reconstruction/iPat/iPatTrackFollower/iPatTrackFollower/SiliconLayerAssociator.h b/Reconstruction/iPat/iPatTrackFollower/iPatTrackFollower/SiliconLayerAssociator.h index 863b7a60f4b58a3a5f6d6cf1cfb2ad37b9d10df1..e93ddf1c3816753281e4d55009a879d6d6f84286 100755 --- a/Reconstruction/iPat/iPatTrackFollower/iPatTrackFollower/SiliconLayerAssociator.h +++ b/Reconstruction/iPat/iPatTrackFollower/iPatTrackFollower/SiliconLayerAssociator.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -21,11 +21,10 @@ #include "iPatInterfaces/ISiliconLayerAssociator.h" #include "iPatTrackFollower/LayerAssociation.h" #include "iPatTrackFollower/SiliconClusterMap.h" +#include "InDetConditionsSummaryService/IInDetConditionsTool.h" //<<<<<< CLASS DECLARATIONS >>>>>> -class IInDetConditionsSvc; - class SiliconLayerAssociator: public AthAlgTool, virtual public ISiliconLayerAssociator { @@ -70,9 +69,8 @@ private: void makeEndcapPixelAssociations (LayerPrediction* prediction); void makeEndcapStereoAssociations (LayerPrediction* prediction); - ServiceHandle<IInDetConditionsSvc> m_pixelConditions; - ToolHandle<IInDetConditionsTool> m_sctConditions{this, "SCT_ConditionsTool", - "SCT_ConditionsSummaryTool/InDetSCT_ConditionsSummaryTool", "Tool to retrieve SCT Conditions Summary"}; + ToolHandle<IInDetConditionsTool> m_pixelConditions{this, "PixelConditionsTool", "PixelConditionsSummaryTool/InDetPixelConditionsSummaryTool", "Tool to retrieve Pixel Conditions summary"}; + ToolHandle<IInDetConditionsTool> m_sctConditions{this, "SCT_ConditionsTool", "SCT_ConditionsSummaryTool/InDetSCT_ConditionsSummaryTool", "Tool to retrieve SCT Conditions Summary"}; association_vector m_associations; const SiliconClusterMap* m_clusterMap; double m_cosPhi; diff --git a/Reconstruction/iPat/iPatTrackFollower/src/SiliconLayerAssociator.cxx b/Reconstruction/iPat/iPatTrackFollower/src/SiliconLayerAssociator.cxx index 9ed91b1fc5c345c89f50e3004e08f69ad62d2f94..1664cf5e0bc1515d377e419e5274aab11285140b 100755 --- a/Reconstruction/iPat/iPatTrackFollower/src/SiliconLayerAssociator.cxx +++ b/Reconstruction/iPat/iPatTrackFollower/src/SiliconLayerAssociator.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -13,7 +13,6 @@ #include <cmath> #include <iomanip> -#include "InDetConditionsSummaryService/IInDetConditionsSvc.h" #include "iPatGeometry/SiliconRing.h" #include "iPatGeometry/SiliconTrapezoid.h" #include "iPatTrackFollower/LayerPrediction.h" @@ -25,7 +24,6 @@ SiliconLayerAssociator::SiliconLayerAssociator(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool (type, name, parent), - m_pixelConditions ("PixelConditionsSummarySvc",name), m_clusterMap (nullptr), m_cosPhi (0.), m_cosStereo (0.), @@ -37,7 +35,6 @@ SiliconLayerAssociator::SiliconLayerAssociator(const std::string& type, m_sinStereo (0.) { declareInterface<ISiliconLayerAssociator>(this); - declareProperty("PixelConditionsSvc", m_pixelConditions); } SiliconLayerAssociator::~SiliconLayerAssociator() @@ -50,20 +47,9 @@ SiliconLayerAssociator::initialize() { ATH_MSG_INFO( "SiliconLayerAssociator::initialize() - package version " << PACKAGE_VERSION ); - if (! m_pixelConditions.empty()) - { - // Get PixelConditionsSummarySvc - if (m_pixelConditions.retrieve().isFailure()) - { - ATH_MSG_FATAL( "Failed to retrieve service " << m_pixelConditions ); - return StatusCode::FAILURE; - } - else - { - ATH_MSG_INFO( "Retrieved service " << m_pixelConditions ); - } - } - + ATH_CHECK(m_pixelConditions.retrieve()); + ATH_CHECK(m_sctConditions.retrieve()); + // sufficient for most module overlap cases (only exceeded when high pixel occupancy) m_associations.reserve(8); diff --git a/Trigger/TrigFTK/FTK_DataProviderSvc/FTK_DataProviderSvc/FTK_DataProviderSvc.h b/Trigger/TrigFTK/FTK_DataProviderSvc/FTK_DataProviderSvc/FTK_DataProviderSvc.h index b9a320e44a958595cacfc770f16570f07d8cbd17..4fc0c2c898e042c641a3510fea1dd71a150a275c 100644 --- a/Trigger/TrigFTK/FTK_DataProviderSvc/FTK_DataProviderSvc/FTK_DataProviderSvc.h +++ b/Trigger/TrigFTK/FTK_DataProviderSvc/FTK_DataProviderSvc/FTK_DataProviderSvc.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef FTK_DATAPROVIDERSVC_H @@ -176,6 +176,7 @@ class FTK_DataProviderSvc : public virtual IFTK_DataProviderSvc, virtual public ToolHandle< IFTK_VertexFinderTool > m_RawVertexFinderTool; ToolHandle< Trk::IRIO_OnTrackCreator > m_ROTcreator; ToolHandle< IFTK_DuplicateTrackRemovalTool > m_DuplicateTrackRemovalTool; + ToolHandle<ISiLorentzAngleTool> m_pixelLorentzAngleTool{this, "PixelLorentzAngleTool", "PixelLorentzAngleTool", "Tool to retrieve Lorentz angle of Pixel"}; ToolHandle<ISiLorentzAngleTool> m_sctLorentzAngleTool{this, "SCTLorentzAngleTool", "SCTLorentzAngleTool", "Tool to retrieve Lorentz angle of SCT"}; double m_trainingBeamspotX; diff --git a/Trigger/TrigFTK/FTK_DataProviderSvc/src/FTK_DataProviderSvc.cxx b/Trigger/TrigFTK/FTK_DataProviderSvc/src/FTK_DataProviderSvc.cxx index 700b3dbc224efb8229129f4a1d4ba37fa183f2a4..25b5cdfcb3e3f2cb45c10eb31f34a3e0cf72c00c 100644 --- a/Trigger/TrigFTK/FTK_DataProviderSvc/src/FTK_DataProviderSvc.cxx +++ b/Trigger/TrigFTK/FTK_DataProviderSvc/src/FTK_DataProviderSvc.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "CLHEP/Units/SystemOfUnits.h" @@ -272,6 +272,7 @@ StatusCode FTK_DataProviderSvc::initialize() { ATH_CHECK(m_RawVertexFinderTool.retrieve()); ATH_MSG_INFO( " getting ROTcreator tool with name " << m_ROTcreator.name()); ATH_CHECK(m_ROTcreator.retrieve()); + ATH_CHECK(m_pixelLorentzAngleTool.retrieve()); ATH_CHECK(m_sctLorentzAngleTool.retrieve()); // Register incident handler @@ -1996,8 +1997,8 @@ const Trk::RIO_OnTrack* FTK_DataProviderSvc::createPixelCluster(const FTK_RawPi pixel_cluster_on_track = m_ROTcreator->correct(*pixel_cluster,trkPerigee); } if (!m_correctPixelClusters || pixel_cluster_on_track==nullptr) { - double shift = pixelDetectorElement->getLorentzCorrection(); - Amg::Vector2D locPos(pixel_cluster->localPosition()[Trk::locX]+shift,pixel_cluster->localPosition()[Trk::locY]); + const double shift = m_pixelLorentzAngleTool->getLorentzShift(hash); + Amg::Vector2D locPos(pixel_cluster->localPosition()[Trk::locX]+shift,pixel_cluster->localPosition()[Trk::locY]); ATH_MSG_VERBOSE("locX "<< pixel_cluster->localPosition()[Trk::locX] << " locY " << pixel_cluster->localPosition()[Trk::locY] << " lorentz shift " << shift); pixel_cluster_on_track=new InDet::PixelClusterOnTrack (pixel_cluster, locPos, diff --git a/Trigger/TrigFTK/FTK_RecTools/FTK_RecTools/FTK_PixelClusterOnTrackTool.h b/Trigger/TrigFTK/FTK_RecTools/FTK_RecTools/FTK_PixelClusterOnTrackTool.h index 541cda05286be30eaf49b96545d8916c1e005d76..6ea419c8fc80bf490fd27cef5c9eeaa2d1eedc3b 100644 --- a/Trigger/TrigFTK/FTK_RecTools/FTK_RecTools/FTK_PixelClusterOnTrackTool.h +++ b/Trigger/TrigFTK/FTK_RecTools/FTK_RecTools/FTK_PixelClusterOnTrackTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -27,6 +27,7 @@ //#include "PixelConditionsServices/IPixelOfflineCalibSvc.h" //#include "PixelConditionsTools/IModuleDistortionsTool.h" +#include "InDetCondServices/ISiLorentzAngleTool.h" #include "AthenaPoolUtilities/CondAttrListCollection.h" class PixelID; class IPixelOfflineCalibSvc; @@ -131,6 +132,7 @@ public: ToolHandle<IModuleDistortionsTool> m_pixDistoTool ; ToolHandle<Trk::IRIO_OnTrackErrorScalingTool> m_errorScalingTool; + ToolHandle<ISiLorentzAngleTool> m_lorentzAngleTool{this, "LorentzAngleTool", "SiLorentzAngleTool", "Tool to retreive Lorentz angle"}; ServiceHandle<IPixelOfflineCalibSvc> m_calibSvc ; StoreGateSvc* m_detStore ; /* ME: Test histos have nothing to do with production code, use a flag diff --git a/Trigger/TrigFTK/FTK_RecTools/src/FTK_PixelClusterOnTrackTool.cxx b/Trigger/TrigFTK/FTK_RecTools/src/FTK_PixelClusterOnTrackTool.cxx index ca1fc87237b18586fc418cd8d3f8ee00f2728b73..c8ff37ccbf9a8350e9478bae0405bb172a1d8e54 100644 --- a/Trigger/TrigFTK/FTK_RecTools/src/FTK_PixelClusterOnTrackTool.cxx +++ b/Trigger/TrigFTK/FTK_RecTools/src/FTK_PixelClusterOnTrackTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ ///////////////////////////////////////////////////////////////// @@ -218,6 +218,7 @@ FTK_PixelClusterOnTrackTool::initialize() { #include "IBL_calibration.h" /// + ATH_CHECK(m_lorentzAngleTool.retrieve()); return sc; } @@ -382,7 +383,7 @@ FTK_PixelClusterOnTrackTool::correctDefault double boweta = atan2(trketacomp, trknormcomp); float etatrack = trackPar.eta(); - float tanl = element->getTanLorentzAnglePhi(); + float tanl = m_lorentzAngleTool->getTanLorentzAngle(iH); int readoutside = element->design().readoutSide(); // map the angles of inward-going tracks onto [-PI/2, PI/2] @@ -421,7 +422,7 @@ FTK_PixelClusterOnTrackTool::correctDefault const int col = m_pixelid->eta_index(rId); InDetDD::SiLocalPosition centroid = pix->localPosition(); - double shift = element->getLorentzCorrection(); + double shift = m_lorentzAngleTool->getLorentzShift(iH); int nrows = pix->width().colRow()[Trk::locX]; int ncol = pix->width().colRow()[Trk::locX]; double ang = 999.; diff --git a/Trigger/TrigFTK/FastTrackSimWrap/FastTrackSimWrap/DumpSp.h b/Trigger/TrigFTK/FastTrackSimWrap/FastTrackSimWrap/DumpSp.h index 4358368bb69c8c0348da192cf3c46e3bc3c927a3..96f447df6c5535677526feefad817c996a454e38 100644 --- a/Trigger/TrigFTK/FastTrackSimWrap/FastTrackSimWrap/DumpSp.h +++ b/Trigger/TrigFTK/FastTrackSimWrap/FastTrackSimWrap/DumpSp.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef FASTTRACKSIMWRAP_DUMPSP @@ -49,6 +49,8 @@ #include "TrkToolInterfaces/ITrackHoleSearchTool.h" #include "InDetPrepRawData/SiClusterContainer.h" +#include "InDetCondServices/ISiLorentzAngleTool.h" + class AtlasDetectorID; class StoreGateSvc; class ITruthParameters; @@ -141,6 +143,7 @@ private: ServiceHandle<IInDetConditionsSvc> m_pixelCondSummarySvc; // tool to retrieve pixel conditions db ToolHandle<IInDetConditionsTool> m_sctCondSummaryTool{this, "SctSummaryTool", "SCT_ConditionsSummaryTool/InDetSCT_ConditionsSummaryTool", "Tool to retrieve SCT Conditions Summary"}; // tool to retrieve SCT conditions db + ToolHandle<ISiLorentzAngleTool> m_pixelLorentzAngleTool{this, "PixelLorentzAngleTool", "PixelLorentzAngleTool", "Tool to retreive Lorentz angle of Pixel"}; //#else // ToolHandle<Trk::TruthToTrack> m_truthToTrack; //!< tool to create track parameters from a gen particle //#endif diff --git a/Trigger/TrigFTK/FastTrackSimWrap/share/FastTrackSimWrap_jobOptions.py b/Trigger/TrigFTK/FastTrackSimWrap/share/FastTrackSimWrap_jobOptions.py index ec952dc9fe028f902696587793ee8ce3d89066f8..02f78b6a76bb24ee54dea685b0b552a4e7dde482 100644 --- a/Trigger/TrigFTK/FastTrackSimWrap/share/FastTrackSimWrap_jobOptions.py +++ b/Trigger/TrigFTK/FastTrackSimWrap/share/FastTrackSimWrap_jobOptions.py @@ -29,6 +29,9 @@ if hasattr(runArgs,"outputTXT_FTKIPFile") : else : OutputTXT_FTKIPFile = 'ftksim_wrap_raw.dat.bz2' +if not hasattr(ToolSvc, "PixelLorentzAngleTool"): + from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup + pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() theJob += DumpSp(OutputLevel = INFO, maxEta = 3.3, @@ -36,6 +39,7 @@ theJob += DumpSp(OutputLevel = INFO, DoData = False, OutFileName = "ftksim_wrap.dat.bz2", OutFileNameRawHits = OutputTXT_FTKIPFile, + PixelLorentzAngleTool = ToolSvc.PixelLorentzAngleTool, tracksName = "Tracks") print theJob diff --git a/Trigger/TrigFTK/FastTrackSimWrap/src/DumpSp.cxx b/Trigger/TrigFTK/FastTrackSimWrap/src/DumpSp.cxx index d1c4e5d5cede96d8111ef4728999be71480efd0b..6a423759828bbf865e3668c0d889e2c8db0eca86 100644 --- a/Trigger/TrigFTK/FastTrackSimWrap/src/DumpSp.cxx +++ b/Trigger/TrigFTK/FastTrackSimWrap/src/DumpSp.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ @@ -330,6 +330,8 @@ DumpSp::initialize() ATH_MSG_INFO("Retrieved service " << m_beamCondSvc); } + ATH_CHECK(m_pixelLorentzAngleTool.retrieve()); + return StatusCode::SUCCESS; } @@ -1272,7 +1274,7 @@ DumpSp::dump_raw_silicon( HitIndexMap& hitIndexMap, HitIndexMap& clusterIndexMap // FlagAA: THIS CODE IS NOT BACKWARD COMPATIBLE! Commited on Sep 18th, 2013 // now stores the local position in millimiters without Lorentz Correction // before it was storing a floating point coordinate in units of pixels - localx = (*iCluster)->localPosition()[Trk::distPhi] - sielement->getLorentzCorrection(); + localx = (*iCluster)->localPosition()[Trk::distPhi] - m_pixelLorentzAngleTool->getLorentzShift(sielement->identifyHash()); localy = (*iCluster)->localPosition()[Trk::distEta]; } diff --git a/Trigger/TrigFTK/TrigFTK_RawDataAlgs/share/FTKMonitor_topOptions.py b/Trigger/TrigFTK/TrigFTK_RawDataAlgs/share/FTKMonitor_topOptions.py index 9e5cfd9e9a28d62c82d4e55fdb64fa6f572efee1..127b3a217dd1e020b96d8ccb50e97fa64db94c06 100644 --- a/Trigger/TrigFTK/TrigFTK_RawDataAlgs/share/FTKMonitor_topOptions.py +++ b/Trigger/TrigFTK/TrigFTK_RawDataAlgs/share/FTKMonitor_topOptions.py @@ -32,11 +32,14 @@ FTK_RDO_Monitor.RDO_CollectionName="FTK_RDO_Tracks" FTK_RDO_Monitor.offlineTracksName="Tracks" FTK_RDO_Monitor.FTK_DataProvider=theFTK_DataProviderSvc -# SiLorentzAngleTool for SCT from AthenaCommon.AppMgr import ToolSvc +if not hasattr(ToolSvc, "PixelLorentzAngleTool"): + from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup + pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() if not hasattr(ToolSvc, "SCTLorentzAngleTool"): from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup() +FTK_RDO_Monitor.PixelLorentzAngleTool = ToolSvc.PixelLorentzAngleTool FTK_RDO_Monitor.SCTLorentzAngleTool = ToolSvc.SCTLorentzAngleTool alg += FTK_RDO_Monitor diff --git a/Trigger/TrigFTK/TrigFTK_RawDataAlgs/src/FTK_RDO_MonitorAlgo.cxx b/Trigger/TrigFTK/TrigFTK_RawDataAlgs/src/FTK_RDO_MonitorAlgo.cxx index 5ee271ef5946df9334f61bf831c56bbc161edcf1..0b69751e52d6442c71c2df717cc2fbd74790570d 100644 --- a/Trigger/TrigFTK/TrigFTK_RawDataAlgs/src/FTK_RDO_MonitorAlgo.cxx +++ b/Trigger/TrigFTK/TrigFTK_RawDataAlgs/src/FTK_RDO_MonitorAlgo.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "FTK_RDO_MonitorAlgo.h" @@ -148,6 +148,7 @@ StatusCode FTK_RDO_MonitorAlgo::initialize(){ ATH_CHECK(detStore()->retrieve(m_SCT_Manager)); ATH_CHECK(detStore()->retrieve(m_id_helper, "AtlasID")); + ATH_CHECK(m_pixelLorentzAngleTool.retrieve()); ATH_CHECK(m_sctLorentzAngleTool.retrieve()); ATH_MSG_INFO("RDO_CollectionName " << m_ftk_raw_trackcollection_Name); @@ -1456,7 +1457,7 @@ const std::pair<double,double> FTK_RDO_MonitorAlgo::getPixLocXlocY(const Identif const InDetDD::SiLocalPosition localPositionOfCornerCell = design->localPositionOfCell(cornerCell); - double shift = pixelDetectorElement->getLorentzCorrection(); + double shift = m_pixelLorentzAngleTool->getLorentzShift(hash); const double phi0 = localPositionOfCornerCell.xPhi(); const double eta0 = localPositionOfCornerCell.xEta(); diff --git a/Trigger/TrigFTK/TrigFTK_RawDataAlgs/src/FTK_RDO_MonitorAlgo.h b/Trigger/TrigFTK/TrigFTK_RawDataAlgs/src/FTK_RDO_MonitorAlgo.h index 527e95588f315ab159403595f32df7183fa33a02..7503515b9e160b7ec9cd263960c50db215167b62 100644 --- a/Trigger/TrigFTK/TrigFTK_RawDataAlgs/src/FTK_RDO_MonitorAlgo.h +++ b/Trigger/TrigFTK/TrigFTK_RawDataAlgs/src/FTK_RDO_MonitorAlgo.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #ifndef FTK_RDO_MonitorAlgo_h @@ -103,6 +103,7 @@ public: const AtlasDetectorID* m_id_helper; + ToolHandle<ISiLorentzAngleTool> m_pixelLorentzAngleTool{this, "PixelLorentzAngleTool", "PixelLorentzAngleTool", "Tool to retreive Lorentz angle of Pixel"}; ToolHandle<ISiLorentzAngleTool> m_sctLorentzAngleTool{this, "SCTLorentzAngleTool", "SCTLorentzAngleTool", "Tool to retreive Lorentz angle of SCT"}; /// Histograms /// diff --git a/Trigger/TrigTools/TrigFTKTrackConverter/TrigFTKTrackConverter/TrigFTKClusterConverterTool.h b/Trigger/TrigTools/TrigFTKTrackConverter/TrigFTKTrackConverter/TrigFTKClusterConverterTool.h index 194917f5163b002a7ab30d917da9be2c4410c10d..2fcd9f24fa40fa65ba15c965b4501fff434934da 100644 --- a/Trigger/TrigTools/TrigFTKTrackConverter/TrigFTKTrackConverter/TrigFTKClusterConverterTool.h +++ b/Trigger/TrigTools/TrigFTKTrackConverter/TrigFTKTrackConverter/TrigFTKClusterConverterTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ //implementation @@ -75,6 +75,7 @@ private: const InDetDD::PixelDetectorManager* m_pixelManager; const InDetDD::SCT_DetectorManager* m_SCT_Manager; + ToolHandle<ISiLorentzAngleTool> m_pixelLorentzAngleTool{this, "PixelLorentzAngleTool", "PixelLorentzAngleTool", "Tool to retreive Lorentz angle of Pixel"}; ToolHandle<ISiLorentzAngleTool> m_sctLorentzAngleTool{this, "SCTLorentzAngleTool", "SCTLorentzAngleTool", "Tool to retreive Lorentz angle of SCT"}; ToolHandle<Trk::ITrackFitter> m_trackFitter; bool m_doFit; diff --git a/Trigger/TrigTools/TrigFTKTrackConverter/python/TrigFTKTrackConverter_Config.py b/Trigger/TrigTools/TrigFTKTrackConverter/python/TrigFTKTrackConverter_Config.py index f97e25e4d252c6046f1b885b0d090fbc2981b7b9..85755a8094b0faef122f28b9a34ec6daaee4e8f2 100644 --- a/Trigger/TrigTools/TrigFTKTrackConverter/python/TrigFTKTrackConverter_Config.py +++ b/Trigger/TrigTools/TrigFTKTrackConverter/python/TrigFTKTrackConverter_Config.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration from TrigFTKTrackConverter.TrigFTKTrackConverterConf import TrigFTKTrackConverter from InDetTrigRecExample.InDetTrigConditionsAccess import PixelConditionsSetup @@ -70,11 +70,14 @@ from TrigFTKTrackConverter.TrigFTKTrackConverterConf import TrigFTKClusterConve class ConfiguredTrigFTKTool(TrigFTKClusterConverterTool): def __init__(self, name = "ConfiguredTrigFTKClusterConverterTool"): TrigFTKClusterConverterTool.__init__(self, name) - # SiLorentzAngleTool for SCT from AthenaCommon.AppMgr import ToolSvc + if not hasattr(ToolSvc, "PixelLorentzAngleTool"): + from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup + sctLorentzAngleToolSetup = PixelLorentzAngleToolSetup() if not hasattr(ToolSvc, "SCTLorentzAngleTool"): from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup() + TrigFTKClusterConverterTool.PixelLorentzAngleTool = ToolSvc.PixelLorentzAngleTool TrigFTKClusterConverterTool.SCTLorentzAngleTool = ToolSvc.SCTLorentzAngleTool diff --git a/Trigger/TrigTools/TrigFTKTrackConverter/src/TrigFTKClusterConverterTool.cxx b/Trigger/TrigTools/TrigFTKTrackConverter/src/TrigFTKClusterConverterTool.cxx index 28a9b3375b0f05f153374f200de0f0d5ab0b9e1a..0319f1594c658158816427a883f56bc7cdb1d50f 100644 --- a/Trigger/TrigTools/TrigFTKTrackConverter/src/TrigFTKClusterConverterTool.cxx +++ b/Trigger/TrigTools/TrigFTKTrackConverter/src/TrigFTKClusterConverterTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ //////////////////////////////////////////////////////////////////////////////// @@ -142,6 +142,7 @@ StatusCode TrigFTKClusterConverterTool::initialize() { return sc; } + ATH_CHECK(m_pixelLorentzAngleTool.retrieve()); ATH_CHECK(m_sctLorentzAngleTool.retrieve()); ATH_MSG_INFO("TrigFTKClusterConverterTool initialized "); @@ -296,7 +297,7 @@ InDet::PixelCluster* TrigFTKClusterConverterTool::createPixelCluster(IdentifierH InDet::SiWidth siWidth(Amg::Vector2D(phiWidth,etaWidth),Amg::Vector2D(phiW,etaW)); - double shift = pDE->getLorentzCorrection(); + double shift = m_pixelLorentzAngleTool->getLorentzShift(hash); Amg::Vector2D position(phiPos+shift,etaPos); std::vector<Identifier> rdoList; diff --git a/Trigger/TrigTools/TrigOnlineSpacePointTool/src/FastPixelClusterization.cxx b/Trigger/TrigTools/TrigOnlineSpacePointTool/src/FastPixelClusterization.cxx index 94bd1462da880f04182fe9233fc91ca3cea46876..6c1b9f968e778fe8cec73ca1b787440f4a54ff02 100755 --- a/Trigger/TrigTools/TrigOnlineSpacePointTool/src/FastPixelClusterization.cxx +++ b/Trigger/TrigTools/TrigOnlineSpacePointTool/src/FastPixelClusterization.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration */ #include "TrigOnlineSpacePointTool/FastPixelClusterization.h" @@ -438,9 +438,7 @@ void FastPixelClusterization::addCluster(const Identifier& pixId, Amg::Vector2D w1(widthPhi, widthRz); Amg::Vector2D dummy(rdoWidthPhi, rdoWidthRz); -// STSTST IdentifierHash hashId = m_pixelID->wafer_hash(pixId); double shift = m_lorentzAngleTool->getLorentzShift(m_pixelID->wafer_hash(pixId)); - std::cout << "STSTST FastPixelClusterization " << shift << " " << m_pixelID->wafer_hash(pixId) << std::endl; Amg::Vector2D localpos(centrePhi+shift, centreRz); InDet::SiWidth siwidth(dummy, w1); Amg::MatrixX* locErrMat = nullptr; //No error matrix