29 return StatusCode::SUCCESS;
37 ATH_MSG_DEBUG(
"CondHandle " << writeHandle.
fullKey() <<
" is already valid." <<
" In theory this should not be called, but may happen" <<
" if multiple concurrent events are being processed out of order.");
38 return StatusCode::SUCCESS;
47 if (readCdoTemp==
nullptr) {
49 return StatusCode::FAILURE;
57 if (readCdoHV==
nullptr) {
59 return StatusCode::FAILURE;
67 if (not pixelDetEleHandle.
isValid() or elements==
nullptr) {
69 return StatusCode::FAILURE;
73 std::unique_ptr<InDet::SiliconPropertiesVector> writeCdo(std::make_unique<InDet::SiliconPropertiesVector>());
75 writeCdo->resize(wafer_hash_max);
79 double temperature = readCdoTemp->
getTemperature(elementHash)+273.15;
80 double deplVoltage = 0.0*CLHEP::volt;
81 double biasVoltage = readCdoHV->
getBiasVoltage(elementHash)*CLHEP::volt;
84 double depletionDepth = element->
thickness();
85 if (std::abs(biasVoltage) < std::abs(deplVoltage)) {
86 depletionDepth *= std::sqrt(std::abs(biasVoltage/deplVoltage));
89 double meanElectricField = 0;
90 if (depletionDepth) { meanElectricField = biasVoltage/depletionDepth; }
92 writeCdo->setConditions(hash, temperature, meanElectricField);
96 if (writeHandle.
record(std::move(writeCdo)).isFailure()) {
97 ATH_MSG_FATAL(
"Could not record PixelSiliconPropertiesVector " << writeHandle.
key() <<
" with EventRange " << writeHandle.
getRange() <<
" into Conditions Store");
98 return StatusCode::FAILURE;
100 ATH_MSG_INFO(
"recorded new CDO " << writeHandle.
key() <<
" with range " << writeHandle.
getRange() <<
" into Conditions Store");
102 return StatusCode::SUCCESS;
107 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
const ServiceHandle< StoreGateSvc > & detStore() const
An algorithm that can be simultaneously executed in multiple threads.
static EventIDRange infiniteMixed()
Produces an mixed EventIDRange that is infinite in Time and RunLumi.
This is a "hash" representation of an Identifier.
Class to hold the SiDetectorElement objects to be put in the detector store.
const SiDetectorElement * getDetectorElement(const IdentifierHash &hash) const
Class to hold geometrical description of a silicon detector element.
float getBiasVoltage(const int chanNum) const
float getTemperature(int chanNum) const
Identifier::size_type size_type
SG::ReadCondHandleKey< PixelDCSHVData > m_readKeyHV
SG::WriteCondHandleKey< InDet::SiliconPropertiesVector > m_writeKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
PixelSiPropertiesCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize() override
virtual StatusCode execute(const EventContext &ctx) const override
Gaudi::Property< std::string > m_pixelIDName
virtual StatusCode finalize() override
SG::ReadCondHandleKey< PixelDCSTempData > m_readKeyTemp
const DataObjID & fullKey() const
const EventIDRange & getRange()
const std::string & key() const
void addDependency(const EventIDRange &range)
const EventIDRange & getRange() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
const DataObjID & fullKey() const