15 #include "GaudiKernel/EventIDRange.h"
33 defaultThresholds(
int bec,
int layer){
35 static const Thresholds ec0{600, 24, 75, 1500};
36 static const Thresholds b0{900, 36, 110, 1000};
38 return bec==0 ? b0 : ec0;
44 defaultLegacyParameters(){
57 const EventIDBase
start{EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, 0, 0, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM};
58 const EventIDBase
stop {EventIDBase::UNDEFNUM, EventIDBase::UNDEFEVT, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM-1, EventIDBase::UNDEFNUM, EventIDBase::UNDEFNUM};
73 return StatusCode::SUCCESS;
80 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.");
81 return StatusCode::SUCCESS;
86 if (not pixelDetEleHandle.
isValid() or elements==
nullptr) {
88 return StatusCode::FAILURE;
97 IdentifierHash wafer_hash = IdentifierHash(moduleHash);
101 const std::vector<Thresholds> allDefaultThresholds(numFE, defaultThresholds(barrel_ec,
layer));
103 const std::vector<LegacyFitParameters> allDefaultFitParams(numFE, defaultLegacyParameters());
105 const std::vector<LinearFitParameters> allDefaultLinearParams(numFE,
LinearFitParameters{0.0f, 0.0f});
108 pChargeCalibData -> setThresholds(
type, moduleHash, allDefaultThresholds);
109 pChargeCalibData -> setLegacyFitParameters(
type, moduleHash, allDefaultFitParams);
110 pChargeCalibData -> setLinearFitParameters(
type, moduleHash, allDefaultLinearParams);
112 pChargeCalibData -> setTotResolutions(moduleHash, std::vector<Resolutions>(numFE, defaultResolutions()));
115 const auto & rangeW = infiniteEventRange();
116 if (writeHandle.
record(rangeW, std::move(pChargeCalibData)).isFailure()) {
117 ATH_MSG_FATAL(
"Could not record PixelChargeCalibCondData " << writeHandle.
key() <<
" with EventRange " << rangeW <<
" into Conditions Store");
118 return StatusCode::FAILURE;
120 ATH_MSG_INFO(
"recorded new CDO " << writeHandle.
key() <<
" with range " << rangeW <<
" into Conditions Store");
122 return StatusCode::SUCCESS;