diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/LorentzAngleSvcSetup.py b/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/LorentzAngleSvcSetup.py deleted file mode 100644 index bbfcc364f389cfffd22b8ab5606f36e27c539e84..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/python/LorentzAngleSvcSetup.py +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration - -# Usage: -# -# from SiLorentzAngleSvc.LorentzAngleSvcSetup import lorentzAngleSvc -# -# By default will determine whether to use DB or not from GeoModel. -# To force usage of DB (that is, use SiliconConditionsServices which should -# normally read from DB): -# -# lorentzAngleSvc.forceUseDB() -# -# for both pixel and SCT or to set pixel and SCT separately do: -# -# lorentzAngleSvc.sctForceUseDB() -# -# -# For more configuration one can get access to the service configurable via -# members pixel and sct: Eg: -# lorentzAngleSvc.pixel.OutputLevel = VERBOSE -# lorentzAngleSvc.sct.OutputLevel = VERBOSE -# print lorentzAngleSvc.pixel -# print lorentzAngleSvc.sct -# -# You can also access the pixel and sct SiliconConditionsSvc: -# -# lorentzAngleSvc.PixelSiliconConditionsSvc.CheckGeoModel = False # same as forceUseDB -# lorentzAngleSvc.SCT_SiliconConditionsSvc.CheckGeoModel = False # same as forceUseDB -# print lorentzAngleSvc.PixelSiliconConditionsSvc -# print lorentzAngleSvc.SCT_SiliconConditionsSvc -# -# -# Alternatively, you can also access the services by: -# from SiLorentzAngleSvc.LorentzAngleSvcSetup import PixelLorentzAngleSvc,SCTLorentzAngleSvc -# -# PixelLorentzAngleSvc.OutputLevel = VERBOSE -# SCTLorentzAngleSvc.OutputLevel = VERBOSE -# - -class LorentzAngleSvcSetup: - "Class to simplify setup of LorentzAngleSvc" - def __init__(self): - - from AthenaCommon.AppMgr import ServiceMgr as svcMgr - - from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SiLorentzAngleSvc - - from AthenaCommon.DetFlags import DetFlags - ## - ## Pixel - ## - if ( DetFlags.detdescr.pixel_on() ): - from PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup - pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() - self.pixel = pixelLorentzAngleToolSetup.PixelLorentzAngleTool - self.pixelDCSConditionsTool = pixelLorentzAngleToolSetup.PixelDCSConditionsTool - self.PixelDCSConditionsTool = pixelLorentzAngleToolSetup.PixelDCSConditionsTool - self.pixelSiPropertiesTool = pixelLorentzAngleToolSetup.PixelSiPropertiesTool - self.PixelSiPropertiesTool = pixelLorentzAngleToolSetup.PixelSiPropertiesTool - ## - ## SCT - ## - if ( DetFlags.detdescr.SCT_on() ): - # Init SCTLorentzAngleTool - - from SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup - sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup() - self.sct = sctLorentzAngleToolSetup.SCTLorentzAngleTool - self.sctSiliconConditionsTool = sctLorentzAngleToolSetup.SCT_SiliconConditionsTool - self.SCT_SiliconConditionsTool = sctLorentzAngleToolSetup.SCT_SiliconConditionsTool - - # Force the Lorentz angle sercive to use SiliconConditions service (which are assumed to use the DB) - # Default is to decide based on GeoModel. - def forceUseDB(self) : - "Force usage of conditions DB" - from AthenaCommon.DetFlags import DetFlags - if ( DetFlags.detdescr.SCT_on() ): - self.sctForceUseDB() - - def sctForceUseDB(self) : - "Force usage of conditions DB for SCT" - self.SCT_SiliconConditionsTool.CheckGeoModel = False - - - # Force to use the defaults from GeoModel. In case it is not possible to use DCS - def forceUseGeoModel(self) : - "Force usage of GeoModel defaults" - from AthenaCommon.DetFlags import DetFlags - if ( DetFlags.detdescr.SCT_on() ): - self.sctForceUseGeoModel() - - def sctForceUseGeoModel(self) : - "Force usage of GeoModel defaults for SCT" - self.SCT_SiliconConditionsTool.ForceUseGeoModel = True - - -# configuration instance -lorentzAngleSvc = LorentzAngleSvcSetup() - -from AthenaCommon.DetFlags import DetFlags -if ( DetFlags.detdescr.pixel_on() ): - from PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup - pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() - PixelLorentzAngleTool = pixelLorentzAngleToolSetup.PixelLorentzAngleTool -if ( DetFlags.detdescr.SCT_on() ): - from SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup - sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup() - SCTLorentzAngleTool = sctLorentzAngleToolSetup.SCTLorentzAngleTool - diff --git a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SCTSiLorentzAngleCondAlg.h b/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SCTSiLorentzAngleCondAlg.h index 490819f057e518425cd7b070440292ab9af5ffdb..78783cd4c06ba3c4d4d1279a0d97fa8670517e02 100644 --- a/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SCTSiLorentzAngleCondAlg.h +++ b/InnerDetector/InDetConditions/SiLorentzAngleSvc/src/SCTSiLorentzAngleCondAlg.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /** @@ -33,7 +33,7 @@ namespace MagField { /** * @class SCTSiLorentzAngleCondAlg - * This class prepares SiLorentAngleCondData using SiPropertiesCHSvc + * This class prepares SiLorentAngleCondData using SiPropertiesTool **/ class SCTSiLorentzAngleCondAlg: public AthAlgorithm diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/SiPropertiesSvc/ISiPropertiesSvc.h b/InnerDetector/InDetConditions/SiPropertiesSvc/SiPropertiesSvc/ISiPropertiesSvc.h deleted file mode 100644 index e97305480f9dbd6e8c941c8a8616a6736306923f..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/SiPropertiesSvc/SiPropertiesSvc/ISiPropertiesSvc.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @file ISiPropertiesSvc.h - * @author Grant.Gorfine@cern.ch -**/ -#ifndef ISiPropertiesSvc_h -#define ISiPropertiesSvc_h -//Gaudi Includes -#include "GaudiKernel/IInterface.h" -#include "AthenaKernel/IOVSvcDefs.h" -#include "SiPropertiesSvc/SiliconProperties.h" - -//forward declarations -class IdentifierHash; - -namespace Trk -{ - class LocalPosition; -} - - - -/** - * @class ISiPropertiesSvc - * Interface class for service providing silicon properties (mobility, etc). - * for each detector element. These depend on conditions such as temperature. -**/ -class ISiPropertiesSvc: virtual public IInterface -{ -public: - virtual ~ISiPropertiesSvc(){} - - static const InterfaceID & interfaceID(); //!< reimplemented from IInterface - - /// Get Silicon properties for a given detector element. - virtual const InDet::SiliconProperties & getSiProperties(const IdentifierHash & elementHash) = 0; - - /// IOV CallBack - virtual StatusCode callBack(IOVSVC_CALLBACK_ARGS) = 0; - -}; - -inline const InterfaceID & ISiPropertiesSvc::interfaceID(){ - static const InterfaceID IID_ISiPropertiesSvc("ISiPropertiesSvc",1,0); - return IID_ISiPropertiesSvc; -} -#endif diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/SiPropertiesSvc/SiliconPropertiesVector.h b/InnerDetector/InDetConditions/SiPropertiesSvc/SiPropertiesSvc/SiliconPropertiesVector.h index 6d0e40725229121eee61d8b4f0005e6f78612bac..ad3019d3be402d09d28793b671a2bae4b914a7b5 100644 --- a/InnerDetector/InDetConditions/SiPropertiesSvc/SiPropertiesSvc/SiliconPropertiesVector.h +++ b/InnerDetector/InDetConditions/SiPropertiesSvc/SiPropertiesSvc/SiliconPropertiesVector.h @@ -1,12 +1,12 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef SIPROPERTIESSVC_SILICONPROPERTIESVECTOR_H #define SIPROPERTIESSVC_SILICONPROPERTIESVECTOR_H /////////////////////////////////////////////////////////////////// -// Header file for class SiliconPropertiesVector for SiPropertiesCHSvc +// Header file for class SiliconPropertiesVector for SiPropertiesTool /////////////////////////////////////////////////////////////////// #include <vector> diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiPropertiesCHSvc.cxx b/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiPropertiesCHSvc.cxx deleted file mode 100644 index c26f985cf77a2da5fa57791a42cbc721c431905b..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiPropertiesCHSvc.cxx +++ /dev/null @@ -1,94 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -#include "SiPropertiesCHSvc.h" - -#include "Identifier/IdentifierHash.h" - -SiPropertiesCHSvc::SiPropertiesCHSvc( const std::string& name, ISvcLocator* pSvcLocator ) : - AthService(name, pSvcLocator), - m_propertiesVector{"SCTSiliconPropertiesVector"}, - m_defaultProperties{} -{ - declareProperty("DetectorName", m_detectorName="SCT", "Dectector name: Pixel or SCT"); - declareProperty("ReadKey", m_propertiesVector, "Key of SiliconPropertiesVector"); -} - -SiPropertiesCHSvc::~SiPropertiesCHSvc() -{} - -StatusCode -SiPropertiesCHSvc::initialize() -{ - ATH_MSG_INFO("SiPropertiesCHSvc Initialized"); - - StatusCode sc{AthService::initialize()}; - if (sc.isFailure()) { - ATH_MSG_FATAL("Unable to initialize the service!"); - return sc; - } - - if ((m_detectorName != "Pixel") and (m_detectorName != "SCT")) { - ATH_MSG_FATAL("Invalid detector name: " << m_detectorName << ". Must be Pixel or SCT."); - return StatusCode::FAILURE; - } - - bool isPixel{m_detectorName == "Pixel"}; - if (isPixel) { - ATH_MSG_FATAL("PIXEL case is not implemented yet!!!"); - return StatusCode::FAILURE; - } - - ATH_CHECK(m_propertiesVector.initialize()); - - return StatusCode::SUCCESS; -} - -StatusCode -SiPropertiesCHSvc::finalize() -{ - return StatusCode::SUCCESS; -} - -// Query the interfaces. -// Input: riid, Requested interface ID -// ppvInterface, Pointer to requested interface -// Return: StatusCode indicating SUCCESS or FAILURE. -// N.B. Don't forget to release the interface after use!!! -StatusCode -SiPropertiesCHSvc::queryInterface(const InterfaceID& riid, void** ppvInterface) -{ - if ( ISiPropertiesSvc::interfaceID().versionMatch(riid) ) { - *ppvInterface = dynamic_cast<ISiPropertiesSvc *>(this); - } else { - // Interface is not directly available: try out a base class - return Service::queryInterface(riid, ppvInterface); - } - addRef(); - return StatusCode::SUCCESS; -} - - -StatusCode -SiPropertiesCHSvc::callBack(IOVSVC_CALLBACK_ARGS) -{ - ATH_MSG_FATAL("SiPropertiesCHSvc::callBack is not implemented!!!"); - return StatusCode::FAILURE; -} - -const InDet::SiliconProperties& -SiPropertiesCHSvc::getSiProperties(const IdentifierHash& elementHash) { - SG::ReadCondHandle<InDet::SiliconPropertiesVector> handle{m_propertiesVector}; - if (handle.isValid()) { - const InDet::SiliconPropertiesVector* vector{*handle}; - if (vector) { - return vector->getSiProperties(elementHash); - } - } - - ATH_MSG_WARNING("SG::ReadCondHandle<InDet::SiliconPropertiesVector> is not valid. " << - "Return default InDet::SiliconProperties for IdentifierHash for " << - elementHash); - return m_defaultProperties; -} diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiPropertiesCHSvc.h b/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiPropertiesCHSvc.h deleted file mode 100644 index e32b4a7948c1836f8db30e218480475d095dbec4..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiPropertiesCHSvc.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @file ISiPropertiesSvc.h - * @author Grant.Gorfine@cern.ch -**/ -#ifndef SiPropertiesCHSvc_h -#define SiPropertiesCHSvc_h - -#include "SiPropertiesSvc/ISiPropertiesSvc.h" - -//Gaudi Includes -#include "GaudiKernel/IInterface.h" -#include "GaudiKernel/ServiceHandle.h" - -#include "AthenaKernel/IOVSvcDefs.h" -#include "AthenaBaseComps/AthService.h" -#include "SiPropertiesSvc/SiliconPropertiesVector.h" -#include "StoreGate/ReadCondHandleKey.h" - -//forward declarations -class IdentifierHash; -class ISiliconConditionsSvc; -class StoreGateSvc; - -namespace Trk -{ - class LocalPosition; -} - -/** - * @class SiPropertiesCHSvc - * Concrete class for service providing silicon properties (mobility, etc). - * for each detector element. These depend on conditions such as temperature. -**/ -class SiPropertiesCHSvc: public AthService, virtual public ISiPropertiesSvc -{ -public: - SiPropertiesCHSvc(const std::string& name, ISvcLocator* sl); - virtual ~SiPropertiesCHSvc(); - - virtual StatusCode initialize(); //!< Service init - virtual StatusCode finalize(); //!< Service finalize - virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface); - - static const InterfaceID& interfaceID(); - - /// Get properties for the detector element. - virtual const InDet::SiliconProperties& getSiProperties(const IdentifierHash& elementHash); - - /// IOV CallBack - virtual StatusCode callBack(IOVSVC_CALLBACK_ARGS); - -private: - // Properties - std::string m_detectorName; - SG::ReadCondHandleKey<InDet::SiliconPropertiesVector> m_propertiesVector; - - InDet::SiliconProperties m_defaultProperties; -}; - -inline const InterfaceID& SiPropertiesCHSvc::interfaceID(){ - return ISiPropertiesSvc::interfaceID(); -} - -#endif // SiPropertiesCHSvc_h diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiPropertiesSvc.cxx b/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiPropertiesSvc.cxx deleted file mode 100644 index 625c40714a01494880a327b4a0fc07f1a748d1e2..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiPropertiesSvc.cxx +++ /dev/null @@ -1,201 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "SiPropertiesSvc.h" - - -#include "InDetIdentifier/PixelID.h" -#include "InDetIdentifier/SCT_ID.h" -#include "Identifier/Identifier.h" -#include "Identifier/IdentifierHash.h" - -#include "InDetReadoutGeometry/SiDetectorElement.h" -#include "InDetReadoutGeometry/SiDetectorManager.h" - -#include "StoreGate/StoreGate.h" - -#include "InDetConditionsSummaryService/ISiliconConditionsSvc.h" - -const double DEFAULTTEMPERATURE = -7; // Degree C -const double DEFAULTDEPLVOLTAGE = 70; // Volt -const double DEFAULTBIASVOLTAGE = 150; // Volt - -SiPropertiesSvc::SiPropertiesSvc( const std::string& name, ISvcLocator* pSvcLocator ) : - AthService(name, pSvcLocator), - m_electronSaturationVelocity(1.53e9), - m_holeSaturationVelocity(1.62e8), - m_siConditionsSvc("PixelSiliconConditionsSvc", name), - m_detStore("StoreGateSvc/DetectorStore", name), - m_conditionsSvcValid(false), - m_detManager(0) -{ - declareProperty("TemperatureMin",m_temperatureMin = -80., "Minimum temperature allowed in Celcius."); - declareProperty("TemperatureMax",m_temperatureMax = 100., "Maximum temperature allowed in Celcius."); - declareProperty("ElectronSaturationVelocity", m_electronSaturationVelocity = 1.53e9, "Electron Saturation Velocity [cm/s]"); - declareProperty("HoleSaturationVelocity", m_holeSaturationVelocity = 1.62e8, "Hole Saturation Velocity [cm/s]"); - declareProperty("SiConditionsServices", m_siConditionsSvc); - declareProperty("DetectorName", m_detectorName="Pixel"); - declareProperty("UseConditionsDB", m_conditionsSvcValid=true); -} - -SiPropertiesSvc::~SiPropertiesSvc() {} - -StatusCode SiPropertiesSvc::initialize() { - ATH_MSG_INFO("SiPropertiesSvc Initialized"); - - CHECK(AthService::initialize()); - - if (m_detectorName!="Pixel" && m_detectorName!="SCT") { - ATH_MSG_FATAL("Invalid detector name: " << m_detectorName << ". Must be Pixel or SCT."); - return StatusCode::FAILURE; - } - - if (m_detectorName == "SCT") { - ATH_MSG_FATAL("Please use SiPropertiesCHSvc instead of SiPropertiesSvc for SCT!"); - return StatusCode::FAILURE; - } - - // Get conditions summary service. - if (m_conditionsSvcValid) { - CHECK(m_siConditionsSvc.retrieve()); - } - - // Detector store - CHECK(m_detStore.retrieve()); - - // Get the detector manager - CHECK(m_detStore->retrieve(m_detManager,m_detectorName)); - - //Register callback. To be triggered after SiConditionsSvc's callback, - if (m_conditionsSvcValid) { - if (m_siConditionsSvc->hasCallBack()) { - ATH_MSG_INFO("Registering callback."); - CHECK(m_detStore->regFcn(&ISiliconConditionsSvc::callBack,&*m_siConditionsSvc,&ISiPropertiesSvc::callBack,dynamic_cast<ISiPropertiesSvc *>(this),true)); - } - } - - bool isPixel = (m_detectorName == "Pixel"); - - // Get maximum hash for vector sizes. We need the idhelper for this. - unsigned int maxHash = 0; - if (isPixel) { - // Pixel - const PixelID * idHelper; - CHECK(m_detStore->retrieve(idHelper,"PixelID")); - maxHash = idHelper->wafer_hash_max(); - } - else { - // SCT - const SCT_ID * idHelper; - CHECK(m_detStore->retrieve(idHelper,"SCT_ID")); - maxHash = idHelper->wafer_hash_max(); - } - - // Initialize the caches - m_propertiesCache.resize(maxHash); - m_cacheValid.resize(maxHash); // initialized to false - //m_outOfRangeWarning.resize(maxHash); // initialized to false - - return StatusCode::SUCCESS; -} - -StatusCode SiPropertiesSvc::finalize() { - return StatusCode::SUCCESS; -} - -StatusCode SiPropertiesSvc::queryInterface(const InterfaceID& riid, void** ppvInterface) { - if ( ISiPropertiesSvc::interfaceID().versionMatch(riid) ) { - *ppvInterface = dynamic_cast<ISiPropertiesSvc *>(this); - } else { - // Interface is not directly available: try out a base class - return Service::queryInterface(riid, ppvInterface); - } - addRef(); - return StatusCode::SUCCESS; -} - - -StatusCode SiPropertiesSvc::callBack(IOVSVC_CALLBACK_ARGS) { - if (msgLvl(MSG::DEBUG)) { - ATH_MSG_DEBUG("Callback called."); - } - invalidateCache(); - return StatusCode::SUCCESS; -} - -const InDet::SiliconProperties & SiPropertiesSvc::getSiProperties(const IdentifierHash & elementHash) { - if (!valid(elementHash)) updateCache(elementHash); - return m_propertiesCache[elementHash]; -} - -void SiPropertiesSvc::updateCache(const IdentifierHash & elementHash) { - const InDetDD::SiDetectorElement * element = m_detManager->getDetectorElement(elementHash); - double temperature; - double deplVoltage; - double biasVoltage; - if (!m_conditionsSvcValid) { - temperature = DEFAULTTEMPERATURE + 273.15; - deplVoltage = DEFAULTDEPLVOLTAGE * CLHEP::volt; - biasVoltage = DEFAULTBIASVOLTAGE * CLHEP::volt; - } else { - temperature = m_siConditionsSvc->temperature(elementHash) + 273.15; - deplVoltage = m_siConditionsSvc->depletionVoltage(elementHash) * CLHEP::volt; - biasVoltage = m_siConditionsSvc->biasVoltage(elementHash) * CLHEP::volt; - } - - // Protect against invalid temperature - double temperatureC = temperature - 273.15; - if (!(temperatureC > m_temperatureMin && temperatureC < m_temperatureMax)) { - //if (msgLvl(MSG::WARNING)) msg(MSG::WARNING) << "Invalid temperature: " << temperatureC << " C. " - // << "Setting to " << DEFAULTTEMPERATURE << " C." - // << endreq; - // temperature = m_temperature + 273.15; - if (msgLvl(MSG::DEBUG)) { - ATH_MSG_DEBUG("Invalid temperature: " << temperatureC << " C. " << "Setting to " << DEFAULTTEMPERATURE << " C. " << "Detector element hash: " << elementHash); - } - temperature = DEFAULTTEMPERATURE + 273.15; - } - - - // Calculate depletion depth. If biasVoltage is less than depletionVoltage - // the detector is not fully depleted and we need to take this into account. - // We take absolute values just in case voltages are signed . - double depletionDepth = element->thickness(); - if (std::abs(biasVoltage) < std::abs(deplVoltage)) { - depletionDepth *= sqrt(std::abs(biasVoltage / deplVoltage)); - } - - double meanElectricField = 0; - if (depletionDepth) meanElectricField = biasVoltage / depletionDepth; - - // Change saturation velocity - m_propertiesCache[elementHash].setElectronSaturationVelocity(m_electronSaturationVelocity*CLHEP::cm/CLHEP::s); - m_propertiesCache[elementHash].setHoleSaturationVelocity(m_holeSaturationVelocity*CLHEP::cm/CLHEP::s); - - m_propertiesCache[elementHash].setConditions(temperature, meanElectricField); - m_cacheValid[elementHash] = true; - - if (msgLvl(MSG::VERBOSE)) { - ATH_MSG_VERBOSE("Temperature (C), bias voltage, depletion voltage: " << temperature - 273.15 << ", " << biasVoltage/CLHEP::volt << ", " << deplVoltage/CLHEP::volt); - double hallMobility = m_propertiesCache[elementHash].signedHallMobility(element->carrierType()); - double driftMobility = m_propertiesCache[elementHash].driftMobility(element->carrierType()); - double ehPairsPerEnergy = m_propertiesCache[elementHash].electronHolePairsPerEnergy(); - double diffConst = m_propertiesCache[elementHash].diffusionConstant(element->carrierType()); - ATH_MSG_VERBOSE("Signed Mobility (cm2/V/s): " << hallMobility/(CLHEP::cm2/CLHEP::volt/CLHEP::s)); - ATH_MSG_VERBOSE("Drift Mobility (cm2/V/s): " << driftMobility/(CLHEP::cm2/CLHEP::volt/CLHEP::s)); - ATH_MSG_VERBOSE("eh pairs per eV: " << ehPairsPerEnergy/(1./CLHEP::eV)); - ATH_MSG_VERBOSE("Diffusion constant (cm2/s): " << diffConst/(CLHEP::cm2/CLHEP::s)); - } -} - -void SiPropertiesSvc::invalidateCache() { - // Invalidate all caches. - std::fill(m_cacheValid.begin(), m_cacheValid.end(), false); -} - - -bool SiPropertiesSvc::valid(const IdentifierHash & elementHash) { - //if (msgLvl(MSG::VERBOSE) msg(MSG::VERBOSE) << "Cache valid = " << m_cacheValid[elementHash] << endreg; - return m_cacheValid[elementHash]; -} diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiPropertiesSvc.h b/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiPropertiesSvc.h deleted file mode 100644 index 54beecc7483b12797e2c3cdb56d3f3df0f0283dd..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiPropertiesSvc.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @file ISiPropertiesSvc.h - * @author Grant.Gorfine@cern.ch -**/ -#ifndef SiPropertiesSvc_h -#define SiPropertiesSvc_h - -#include "SiPropertiesSvc/ISiPropertiesSvc.h" - -//Gaudi Includes -#include "GaudiKernel/IInterface.h" -#include "GaudiKernel/ServiceHandle.h" -#include "AthenaKernel/IOVSvcDefs.h" -#include "AthenaBaseComps/AthService.h" - -//forward declarations -class IdentifierHash; -class ISiliconConditionsSvc; -class StoreGateSvc; - -namespace Trk -{ - class LocalPosition; -} - -namespace InDetDD { - class SiDetectorManager; -} - -/** - * @class SiPropertiesSvc - * Concrete class for service providing silicon properties (mobility, etc). - * for each detector element. These depend on conditions such as temperature. -**/ -class SiPropertiesSvc: public AthService, virtual public ISiPropertiesSvc { - public: - SiPropertiesSvc(const std::string& name, ISvcLocator* sl); - virtual ~SiPropertiesSvc(); - - virtual StatusCode initialize(); //!< Service init - virtual StatusCode finalize(); //!< Service finalize - virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvInterface); - - static const InterfaceID & interfaceID(); - - - /// Get properties for the detector element. - virtual const InDet::SiliconProperties & getSiProperties(const IdentifierHash & elementHash); - - /// IOV CallBack - virtual StatusCode callBack(IOVSVC_CALLBACK_ARGS); - - private: - - void updateCache(const IdentifierHash & elementHash); - void invalidateCache(); - bool valid(const IdentifierHash & elementHash); - - private: - - // Properties - double m_temperatureMin; - double m_temperatureMax; - double m_electronSaturationVelocity; - double m_holeSaturationVelocity; - std::string m_detectorName; - ServiceHandle<ISiliconConditionsSvc> m_siConditionsSvc; - ServiceHandle<StoreGateSvc> m_detStore; - - bool m_conditionsSvcValid; - - std::vector<InDet::SiliconProperties> m_propertiesCache; - std::vector<bool> m_cacheValid; - const InDetDD::SiDetectorManager * m_detManager; - - std::vector<bool> m_outOfRangeWarning; - -}; - -inline const InterfaceID & SiPropertiesSvc::interfaceID(){ - return ISiPropertiesSvc::interfaceID(); -} - -#endif diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiliconPropertiesVector.cxx b/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiliconPropertiesVector.cxx index 2ca90dfca8b4e9adb2c0addeca8abf8e39adeb54..ee6bac0fcc702fb36c0fb11d958fd1d1cd0ab8b1 100644 --- a/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiliconPropertiesVector.cxx +++ b/InnerDetector/InDetConditions/SiPropertiesSvc/src/SiliconPropertiesVector.cxx @@ -1,9 +1,9 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// -// Source file for class SiliconPropertiesVector for SiPropertiesCHSvc +// Source file for class SiliconPropertiesVector for SiPropertiesTool /////////////////////////////////////////////////////////////////// #include "SiPropertiesSvc/SiliconPropertiesVector.h" diff --git a/InnerDetector/InDetConditions/SiPropertiesSvc/src/components/SiPropertiesSvc_entries.cxx b/InnerDetector/InDetConditions/SiPropertiesSvc/src/components/SiPropertiesSvc_entries.cxx index 8ef1b35e31883a892b53b7ecf6857ac9e2f166d3..1d5e0f4f27ad50320332efa3cc3f51b0bda81e7a 100644 --- a/InnerDetector/InDetConditions/SiPropertiesSvc/src/components/SiPropertiesSvc_entries.cxx +++ b/InnerDetector/InDetConditions/SiPropertiesSvc/src/components/SiPropertiesSvc_entries.cxx @@ -1,11 +1,7 @@ -#include "../SiPropertiesSvc.h" -#include "../SiPropertiesCHSvc.h" #include "../SiPropertiesTool.h" #include "../SCTSiPropertiesCondAlg.h" #include "../PixelSiPropertiesCondAlg.h" -DECLARE_COMPONENT( SiPropertiesSvc ) -DECLARE_COMPONENT( SiPropertiesCHSvc ) DECLARE_COMPONENT( SiPropertiesTool ) DECLARE_COMPONENT( SCTSiPropertiesCondAlg ) DECLARE_COMPONENT( PixelSiPropertiesCondAlg ) diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/CMakeLists.txt b/InnerDetector/InDetDigitization/FastSiDigitization/CMakeLists.txt index 5b01e59558e1aea913e098c7ea52387c1b771a27..ec3de863305e19e93ae44a9c2f7153e6d1ca5d81 100644 --- a/InnerDetector/InDetDigitization/FastSiDigitization/CMakeLists.txt +++ b/InnerDetector/InDetDigitization/FastSiDigitization/CMakeLists.txt @@ -17,7 +17,6 @@ atlas_depends_on_subdirs( PUBLIC InnerDetector/InDetConditions/InDetCondServices InnerDetector/InDetConditions/PixelConditionsServices InnerDetector/InDetConditions/PixelConditionsTools - InnerDetector/InDetConditions/SiPropertiesSvc InnerDetector/InDetDetDescr/InDetReadoutGeometry InnerDetector/InDetRawEvent/InDetSimData InnerDetector/InDetRecEvent/InDetPrepRawData diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/SiSmearedDigitizationTool.h b/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/SiSmearedDigitizationTool.h index 9a0b5e8aea881aaa699f3e0d0098ba452dbfb2fa..1c0e8df06ad043e3041a4535472c81388cf9089b 100644 --- a/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/SiSmearedDigitizationTool.h +++ b/InnerDetector/InDetDigitization/FastSiDigitization/FastSiDigitization/SiSmearedDigitizationTool.h @@ -20,7 +20,6 @@ #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/AlgTool.h" #include "InDetConditionsSummaryService/IInDetConditionsSvc.h" -#include "SiPropertiesSvc/ISiPropertiesSvc.h" #include "AthenaKernel/IAtRndmGenSvc.h" #include "xAODEventInfo/EventInfo.h" #include "xAODEventInfo/EventAuxInfo.h" diff --git a/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py b/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py index 32a4caa4f365246a192008e58f8f8d85e7c66337..d2e52954cc94bc8f2417b775fbe6e5385a2a2130 100644 --- a/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py +++ b/InnerDetector/InDetDigitization/FastSiDigitization/python/FastSiDigitizationConfig.py @@ -59,11 +59,6 @@ def FastClusterMakerTool(name="FastClusterMakerTool", **kwargs): from PixelConditionsServices.PixelConditionsServicesConf import PixelCalibSvc InDetPixelCalibSvc = PixelCalibSvc() ServiceMgr += InDetPixelCalibSvc - if not hasattr(ServiceMgr, "PixelSiPropertiesSvc"): - from SiLorentzAngleSvc.LorentzAngleSvcSetup import lorentzAngleSvc - from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesSvc; - PixelSiPropertiesSvc = SiPropertiesSvc(name = "PixelSiPropertiesSvc",DetectorName="Pixel",SiConditionsServices = lorentzAngleSvc.pixelSiliconConditionsSvc) - ServiceMgr += PixelSiPropertiesSvc from AthenaCommon import CfgMgr return CfgMgr.InDet__ClusterMakerTool(name,**kwargs) diff --git a/InnerDetector/InDetDigitization/PixelRadDamDigitization/python/PixelRadDamDigitizationConfig.py b/InnerDetector/InDetDigitization/PixelRadDamDigitization/python/PixelRadDamDigitizationConfig.py index ab980531b4d3d390612e1533e11d92775eedfd8a..e0a3ea13c57cf7e3090771b52fed72fbade22875 100644 --- a/InnerDetector/InDetDigitization/PixelRadDamDigitization/python/PixelRadDamDigitizationConfig.py +++ b/InnerDetector/InDetDigitization/PixelRadDamDigitization/python/PixelRadDamDigitizationConfig.py @@ -43,16 +43,31 @@ def EnergyDepositionTool(name="EnergyDepositionTool", **kwargs): return CfgMgr.RadDam__EnergyDepositionTool(name, **kwargs) def SensorSimPlanarTool(name="SensorSimPlanarTool", **kwargs): + if not hasattr(ToolSvc, "PixelSiPropertiesTool"): + from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup + pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup() + pixelSiPropertiesToolSetup.setup() + kwargs.setdefault("SiPropertiesTool", ToolSvc.PixelSiPropertiesTool) kwargs.setdefault("RndmSvc", digitizationFlags.rndmSvc()) kwargs.setdefault("RndmEngine", "PixelDigitization") return CfgMgr.RadDam__SensorSimPlanarTool(name, **kwargs) def SensorSim3DTool(name="SensorSim3DTool", **kwargs): + if not hasattr(ToolSvc, "PixelSiPropertiesTool"): + from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup + pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup() + pixelSiPropertiesToolSetup.setup() + kwargs.setdefault("SiPropertiesTool", ToolSvc.PixelSiPropertiesTool) kwargs.setdefault("RndmSvc", digitizationFlags.rndmSvc()) kwargs.setdefault("RndmEngine", "PixelDigitization") return CfgMgr.RadDam__SensorSim3DTool(name, **kwargs) def SensorSimTool(name="SensorSimTool", **kwargs): + if not hasattr(ToolSvc, "PixelSiPropertiesTool"): + from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup + pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup() + pixelSiPropertiesToolSetup.setup() + kwargs.setdefault("SiPropertiesTool", ToolSvc.PixelSiPropertiesTool) kwargs.setdefault("RndmSvc", digitizationFlags.rndmSvc()) kwargs.setdefault("RndmEngine", "PixelDigitization") return CfgMgr.RadDam__SensorSimTool(name, **kwargs) @@ -160,11 +175,6 @@ def BasicPixelDigitizationTool(name="PixelDigitizationTool", **kwargs): PixelCablingSvc = getService("PixelCablingSvc") ServiceMgr += PixelCablingSvc print PixelCablingSvc - if not hasattr(ServiceMgr, "PixelSiPropertiesSvc"): - from SiLorentzAngleSvc.LorentzAngleSvcSetup import lorentzAngleSvc - from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesSvc - pixelSiPropertiesSvc = SiPropertiesSvc(name = "PixelSiPropertiesSvc",DetectorName="Pixel",SiConditionsServices = lorentzAngleSvc.pixelSiliconConditionsSvc) - ServiceMgr += pixelSiPropertiesSvc kwargs.setdefault("InputObjectName", "PixelHits") procTools = [] chargeTools = [] #Tools in array for flexibility diff --git a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSim3DTool.cxx b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSim3DTool.cxx index 6b21e1775d2a432306931dce59b8efdf4e3b0cc5..425f0c882b376a136f7592f5bc8bd16d85f8dc30 100644 --- a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSim3DTool.cxx +++ b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSim3DTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -290,7 +290,7 @@ StatusCode SensorSim3DTool::induceCharge(const TimedHitPtr < SiHit > & phit, SiC ATH_MSG_VERBOSE("Applying 3D sensor simulation."); double sensorThickness = Module.design().thickness(); - const InDet::SiliconProperties & siProperties = m_siPropertiesSvc->getSiProperties(Module.identifyHash()); + const InDet::SiliconProperties & siProperties = m_siPropertiesTool->getSiProperties(Module.identifyHash()); double eleholePairEnergy = siProperties.electronHolePairsPerEnergy(); // = 1 / 3.6 eV -> expressed in MeV^-1 = 276243 MeV^-1 // Charge Collection Probability Map bin size diff --git a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSimPlanarTool.cxx b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSimPlanarTool.cxx index a0b2a2df3343051454acde1bdaf8216a5024b1ea..3ac22271ca4356c96d1b054d1df1c836006d9b4a 100644 --- a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSimPlanarTool.cxx +++ b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSimPlanarTool.cxx @@ -317,7 +317,7 @@ StatusCode SensorSimPlanarTool::induceCharge(const TimedHitPtr<SiHit> &phit, SiC //Set up physical detector properties, switch on detector material ATH_MSG_DEBUG("Applying planar sensor simulation"); double sensorThickness = Module.design().thickness(); - const InDet::SiliconProperties & siProperties = m_siPropertiesSvc->getSiProperties(Module.identifyHash()); + const InDet::SiliconProperties & siProperties = m_siPropertiesTool->getSiProperties(Module.identifyHash()); int etaCells = p_design.columns(); int phiCells = p_design.rows(); diff --git a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSimTool.h b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSimTool.h index 5a859c3d9d0d9fbf0f5c95552f3e7d3f2431c05a..76b81c1051ac155af7ce9f2cf4ed73a1ee33f03a 100644 --- a/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSimTool.h +++ b/InnerDetector/InDetDigitization/PixelRadDamDigitization/src/SensorSimTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -20,11 +20,10 @@ #include "HitManagement/TimedHitPtr.h" #include "SiDigitization/SiChargedDiodeCollection.h" -#include "SiPropertiesSvc/ISiPropertiesSvc.h" +#include "SiPropertiesSvc/ISiPropertiesTool.h" #include "InDetReadoutGeometry/SiDetectorElement.h" #include "SiDigitization/SiChargedDiodeCollection.h" #include "InDetReadoutGeometry/PixelModuleDesign.h" -#include "SiPropertiesSvc/ISiPropertiesSvc.h" static const InterfaceID IID_ISensorSimTool("SensorSimTool", 1, 0); @@ -33,13 +32,11 @@ class SensorSimTool:public AthAlgTool,virtual public IAlgTool { public: SensorSimTool( const std::string& type, const std::string& name,const IInterface* parent) : AthAlgTool(type,name,parent), - m_siPropertiesSvc("PixelSiPropertiesSvc",name), m_rndmSvc("AtDSFMTGenSvc",name), m_rndmEngineName("PixelDigitization"), m_rndmEngine(nullptr) { declareInterface<SensorSimTool>(this); - declareProperty("SiPropertiesSvc", m_siPropertiesSvc, "SiPropertiesSvc"); declareProperty("RndmSvc", m_rndmSvc, "Random Number Service used in SCT & Pixel digitization"); declareProperty("RndmEngine", m_rndmEngineName, "Random engine name"); } @@ -49,7 +46,7 @@ class SensorSimTool:public AthAlgTool,virtual public IAlgTool { virtual StatusCode initialize() { CHECK(AthAlgTool::initialize()); - CHECK(m_siPropertiesSvc.retrieve()); + CHECK(m_siPropertiesTool.retrieve()); CHECK(m_rndmSvc.retrieve()); @@ -73,7 +70,7 @@ class SensorSimTool:public AthAlgTool,virtual public IAlgTool { SensorSimTool(); protected: - ServiceHandle<ISiPropertiesSvc> m_siPropertiesSvc; + ToolHandle<ISiPropertiesTool> m_siPropertiesTool{this, "SiPropertiesTool", "SiPropertiesTool", "Tool to retrieve SiProperties"}; ServiceHandle<IAtRndmGenSvc> m_rndmSvc; std::string m_rndmEngineName; CLHEP::HepRandomEngine *m_rndmEngine; diff --git a/InnerDetector/InDetExample/InDetDetDescrExample/InDetDetDescrExample/ReadSiDetectorElements.h b/InnerDetector/InDetExample/InDetDetDescrExample/InDetDetDescrExample/ReadSiDetectorElements.h index e6d42e052ec0c0e9a3e2f2644dbd94f4c42ec63a..b939863d0d598a79ce3441faeabe795c0d545240 100755 --- a/InnerDetector/InDetExample/InDetDetDescrExample/InDetDetDescrExample/ReadSiDetectorElements.h +++ b/InnerDetector/InDetExample/InDetDetDescrExample/InDetDetDescrExample/ReadSiDetectorElements.h @@ -17,7 +17,6 @@ #include "InDetConditionsSummaryService/ISiliconConditionsTool.h" #include "InDetCondServices/ISiLorentzAngleTool.h" #include "InDetConditionsSummaryService/ISiliconConditionsSvc.h" -#include "SiPropertiesSvc/ISiPropertiesSvc.h" #include <vector> diff --git a/InnerDetector/InDetExample/InDetDetDescrExample/share/ReadSiDetectorElements_jobOptions.py b/InnerDetector/InDetExample/InDetDetDescrExample/share/ReadSiDetectorElements_jobOptions.py index 3e80049d564e693311269c8f2aa229dfc1081b0f..01861c2a3d13e0375fefebb4800704f21372bb54 100755 --- a/InnerDetector/InDetExample/InDetDetDescrExample/share/ReadSiDetectorElements_jobOptions.py +++ b/InnerDetector/InDetExample/InDetDetDescrExample/share/ReadSiDetectorElements_jobOptions.py @@ -56,43 +56,35 @@ job += ReadSCTElements; # from AthenaCommon.AppMgr import ServiceMgr -# -# Both pixel and SCT -# -from SiLorentzAngleSvc.LorentzAngleSvcSetup import lorentzAngleSvc -from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesSvc - # # Pixel # # Load DCS service from PixelConditionsTools.PixelDCSConditionsToolSetup import PixelDCSConditionsToolSetup pixelDCSConditionsToolSetup = PixelDCSConditionsToolSetup() -pixelDCSConditionsToolSetup.setIsDATA(isData) pixelDCSConditionsToolSetup.setup() +pixelDCSConditionsTool = pixelDCSConditionsToolSetup.getTool() from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup() -pixelSiPropertiesToolSetup.setSiliconTool(pixelDCSConditionsToolSetup.getTool()) pixelSiPropertiesToolSetup.setup() pixelSiPropertiesTool = pixelSiPropertiesToolSetup.getTool() +from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup +pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() +pixelLorentzAngleTool = pixelLorentzAngleToolSetup.PixelLorentzAngleTool ReadPixelElements.UseConditionsTools = True -ReadPixelElements.SiLorentzAngleTool = lorentzAngleSvc.pixel +ReadPixelElements.SiLorentzAngleTool = pixelLorentzAngleTool ReadPixelElements.SiPropertiesTool = pixelSiPropertiesTool -ReadPixelElements.SiConditionsTool = None +ReadPixelElements.SiConditionsTool = pixelDCSConditionsTool -ServiceMgr.GeoModelSvc.DetectorTools['PixelDetectorTool'].LorentzAngleTool=lorentzAngleSvc.pixel # # SCT # -# Load DCS Tool -from SCT_ConditionsTools.SCT_DCSConditionsToolSetup import SCT_DCSConditionsToolSetup -sct_DCSConditionsToolSetup = SCT_DCSConditionsToolSetup() -sct_DCSConditionsToolSetup.setup() -InDetSCT_DCSConditionsTool = sct_DCSConditionsToolSetup.getTool() - -## Silicon conditions tool (set up by LorentzAngleSvcSetup) -sctSiliconConditionsTool = lorentzAngleSvc.SCT_SiliconConditionsTool +# Silicon Lorentz angle tool +from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup +sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup() +sctLorentzAngleTool = sctLorentzAngleToolSetup.SCTLorentzAngleTool +sctSiliconConditionsTool = sctLorentzAngleToolSetup.sctSiliconConditionsTool # Silicon properties tool from SiPropertiesSvc.SCT_SiPropertiesToolSetup import SCT_SiPropertiesToolSetup @@ -102,18 +94,18 @@ sct_SiPropertiesToolSetup.setup() sctSiPropertiesTool = sct_SiPropertiesToolSetup.getTool() ReadSCTElements.UseConditionsTools = True -ReadSCTElements.SiLorentzAngleTool = lorentzAngleSvc.sct +ReadSCTElements.SiLorentzAngleTool = sctLorentzAngleTool ReadSCTElements.SiPropertiesTool = sctSiPropertiesTool ReadSCTElements.SiConditionsTool = sctSiliconConditionsTool ReadSCTElements.DetEleCollKey = "SCT_DetectorElementCollection" print ReadPixelElements -print lorentzAngleSvc.pixel -print pixelSiliconConditionsSvc -print pixelSiPropertiesSvc +print pixelLorentzAngleTool +print pixelDCSConditionsTool +print pixelSiPropertiesTool print ReadSCTElements -print lorentzAngleSvc.sct +print sctLorentzAngleTool print sctSiliconConditionsTool print sctSiPropertiesTool diff --git a/InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadSiDetectorElements_jobOptions.py b/InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadSiDetectorElements_jobOptions.py index 4cc37dacaa7efb9e0ef65b705968b3b302f27252..7673748b476ad34fe54e0dc73a04c034ad5dd246 100755 --- a/InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadSiDetectorElements_jobOptions.py +++ b/InnerDetector/InDetValidation/InDetGeometryValidation/share/ReadSiDetectorElements_jobOptions.py @@ -56,51 +56,35 @@ job += ReadSCTElements; # from AthenaCommon.AppMgr import ServiceMgr -# -# Both pixel and SCT -# -from SiLorentzAngleSvc.LorentzAngleSvcSetup import lorentzAngleSvc -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.SiLorentzAngleTool = lorentzAngleSvc.pixel -ReadPixelElements.SiPropertiesSvc = pixelSiPropertiesSvc -ReadPixelElements.SiConditionsSvc = pixelSiliconConditionsSvc -# ReadPixelElements.DetEleCollKey = "PixelDetectorElementCollection" - -ServiceMgr.GeoModelSvc.DetectorTools['PixelDetectorTool'].LorentzAngleSvc=lorentzAngleSvc.pixel +from PixelConditionsTools.PixelDCSConditionsToolSetup import PixelDCSConditionsToolSetup +pixelDCSConditionsToolSetup = PixelDCSConditionsToolSetup() +pixelDCSConditionsToolSetup.setup() +pixelDCSConditionsTool = pixelDCSConditionsToolSetup.getTool() +from SiPropertiesSvc.PixelSiPropertiesToolSetup import PixelSiPropertiesToolSetup +pixelSiPropertiesToolSetup = PixelSiPropertiesToolSetup() +pixelSiPropertiesToolSetup.setup() +pixelSiPropertiesTool = pixelSiPropertiesToolSetup.getTool() +from SiLorentzAngleSvc.PixelLorentzAngleToolSetup import PixelLorentzAngleToolSetup +pixelLorentzAngleToolSetup = PixelLorentzAngleToolSetup() +pixelLorentzAngleTool = pixelLorentzAngleToolSetup.PixelLorentzAngleTool + +ReadPixelElements.UseConditionsTools = True +ReadPixelElements.SiLorentzAngleTool = pixelLorentzAngleTool +ReadPixelElements.SiPropertiesTool = pixelSiPropertiesTool +ReadPixelElements.SiConditionsTool = pixelDCSConditionsTool # # SCT # -# Load DCS Tool -from SCT_ConditionsTools.SCT_DCSConditionsToolSetup import SCT_DCSConditionsToolSetup -sct_DCSConditionsToolSetup = SCT_DCSConditionsToolSetup() -sct_DCSConditionsToolSetup.setup() -InDetSCT_DCSConditionsTool = sct_DCSConditionsToolSetup.getTool() - -## Silicon conditions tool (set up by LorentzAngleSvcSetup) -sctSiliconConditionsTool = lorentzAngleSvc.SCT_SiliconConditionsTool +# Silicon Lorentz angle tool +from SiLorentzAngleSvc.SCTLorentzAngleToolSetup import SCTLorentzAngleToolSetup +sctLorentzAngleToolSetup = SCTLorentzAngleToolSetup() +sctLorentzAngleTool = sctLorentzAngleToolSetup.SCTLorentzAngleTool +sctSiliconConditionsTool = sctLorentzAngleToolSetup.sctSiliconConditionsTool # Silicon properties tool from SiPropertiesSvc.SCT_SiPropertiesToolSetup import SCT_SiPropertiesToolSetup @@ -110,18 +94,18 @@ sct_SiPropertiesToolSetup.setup() sctSiPropertiesTool = sct_SiPropertiesToolSetup.getTool() ReadSCTElements.UseConditionsTools = True -ReadSCTElements.SiLorentzAngleTool = lorentzAngleSvc.sct +ReadSCTElements.SiLorentzAngleTool = sctLorentzAngleTool ReadSCTElements.SiPropertiesTool = sctSiPropertiesTool ReadSCTElements.SiConditionsTool = sctSiliconConditionsTool ReadSCTElements.DetEleCollKey = "SCT_DetectorElementCollection" print ReadPixelElements -print lorentzAngleSvc.pixel -print pixelSiliconConditionsSvc -print pixelSiPropertiesSvc +print pixelLorentzAngleTool +print pixelDCSConditionsTool +print pixelSiPropertiesTool print ReadSCTElements -print lorentzAngleSvc.sct +print sctLorentzAngleTool print sctSiliconConditionsTool print sctSiPropertiesTool diff --git a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/ISF_ntuple_core.py b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/ISF_ntuple_core.py index 4d8a10fa16eddbe3db8c3a9fb0d8c2e925458d7b..fbc335ad67bc18918ffe7759a68951070247171e 100644 --- a/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/ISF_ntuple_core.py +++ b/Simulation/ISF/ISF_FastCaloSim/ISF_FastCaloSimParametrization/share/ISF_ntuple_core.py @@ -36,43 +36,6 @@ ISF_HitAnalysis = ISF_HitAnalysis() ISF_HitAnalysis.NtupleFileName = 'ISF_HitAnalysis' ISF_HitAnalysis.GeoFileName = 'ISF_Geometry' -############################## - -# The following lines added according to instructions on ATLASSIM-3697 - -include("PixelConditionsServices/PixelDCSSvc_jobOptions.py") - -from SiLorentzAngleSvc.LorentzAngleSvcSetup import lorentzAngleSvc - -from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesSvc - -pixelSiPropertiesSvc = SiPropertiesSvc(name = "PixelSiPropertiesSvc",DetectorName="Pixel",SiConditionsServices=lorentzAngleSvc.pixelSiliconConditionsSvc) - -ServiceMgr += pixelSiPropertiesSvc - - - -from IOVDbSvc.CondDB import conddb - -conddb.addFolder("DCS_OFL","/SCT/DCS/CHANSTAT") - -conddb.addFolder("DCS_OFL","/SCT/DCS/MODTEMP") - -conddb.addFolder("DCS_OFL","/SCT/DCS/HV") - - - -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_DCSConditionsSvc - -InDetSCT_DCSConditionsSvc = SCT_DCSConditionsSvc(name="InDetSCT_DCSConditionsSvc") - -ServiceMgr += InDetSCT_DCSConditionsSvc - -sctSiPropertiesSvc = SiPropertiesSvc(name = "SCT_SiPropertiesSvc", DetectorName="SCT", SiConditionsServices=lorentzAngleSvc.sctSiliconConditionsSvc) - -ServiceMgr += sctSiPropertiesSvc - - ########################################################## ISF_HitAnalysis.CaloBoundaryR = 1148.0 diff --git a/Simulation/Tools/RDOAnalysis/share/RDOAnalysis_commonOptions.py b/Simulation/Tools/RDOAnalysis/share/RDOAnalysis_commonOptions.py index 9aeea52feca4afa5a0ad64374f643fc6335c57ae..473319edfeb5ed9207ac4fc02ee876a181b97d4f 100644 --- a/Simulation/Tools/RDOAnalysis/share/RDOAnalysis_commonOptions.py +++ b/Simulation/Tools/RDOAnalysis/share/RDOAnalysis_commonOptions.py @@ -83,24 +83,3 @@ include("RecExCond/AllDet_detDescr.py") import MuonCnvExample.MuonCablingConfig -# Update Pixel conditions services -include("PixelConditionsServices/PixelDCSSvc_jobOptions.py") -from SiLorentzAngleSvc.LorentzAngleSvcSetup import lorentzAngleSvc -from SiPropertiesSvc.SiPropertiesSvcConf import SiPropertiesSvc -pixelSiPropertiesSvc = SiPropertiesSvc(name = "PixelSiPropertiesSvc",DetectorName="Pixel",SiConditionsServices=lorentzAngleSvc.pixelSiliconConditionsSvc) -ServiceMgr += pixelSiPropertiesSvc - -# Add conditions database folders -from IOVDbSvc.CondDB import conddb -conddb.addFolder("DCS_OFL","/SCT/DCS/CHANSTAT") -conddb.addFolder("DCS_OFL","/SCT/DCS/MODTEMP") -conddb.addFolder("DCS_OFL","/SCT/DCS/HV") - -# Set the SCT conditions services for `lorentzAngleSvc` -from SCT_ConditionsServices.SCT_ConditionsServicesConf import SCT_DCSConditionsSvc -InDetSCT_DCSConditionsSvc = SCT_DCSConditionsSvc(name="InDetSCT_DCSConditionsSvc") -ServiceMgr += InDetSCT_DCSConditionsSvc -sctSiPropertiesSvc = SiPropertiesSvc(name = "SCT_SiPropertiesSvc", DetectorName="SCT", SiConditionsServices=lorentzAngleSvc.sctSiliconConditionsSvc) -ServiceMgr += sctSiPropertiesSvc - -