17 ,
m_readKey{
"SCTAlignmentStore",
"SCTAlignmentStore"}
41 return StatusCode::SUCCESS;
54 <<
". In theory this should not be called, but may happen"
55 <<
" if multiple concurrent events are being processed out of order.");
56 return StatusCode::SUCCESS;
60 if (oldColl==
nullptr) {
61 ATH_MSG_FATAL(
"Null pointer is returned by getDetectorElementCollection()");
62 return StatusCode::FAILURE;
66 std::unique_ptr<InDetDD::SiDetectorElementCollection> writeCdo{std::make_unique<InDetDD::SiDetectorElementCollection>()};
71 if (readCdo==
nullptr) {
73 return StatusCode::FAILURE;
84 if (*muonDependency !=
nullptr) {
88 return StatusCode::FAILURE;
93 if (*trtDependency !=
nullptr) {
97 return StatusCode::FAILURE;
102 if (*pixelDependency !=
nullptr) {
105 ATH_MSG_ERROR(
"Pixel AlignmentStore not found but configured");
106 return StatusCode::FAILURE;
111 std::map<const InDetDD::SiDetectorElement*, const InDetDD::SiDetectorElement*> oldToNewMap;
112 oldToNewMap[
nullptr] =
nullptr;
113 writeCdo->resize(oldColl->
size());
118 oldEl->GeoVDetectorElement::getMaterialGeom(),
119 oldEl->getCommonItems(),
121 oldToNewMap[oldEl] = *newEl;
129 if (oldToNewMap[(*oldIt)]!=newEl) {
132 newEl->setNextInEta(oldToNewMap[(*oldIt)->nextInEta()]);
133 newEl->setPrevInEta(oldToNewMap[(*oldIt)->prevInEta()]);
134 newEl->setNextInPhi(oldToNewMap[(*oldIt)->nextInPhi()]);
135 newEl->setPrevInPhi(oldToNewMap[(*oldIt)->prevInPhi()]);
136 newEl->setOtherSide(oldToNewMap[(*oldIt)->otherSide()]);
140 const Trk::Layer* layer{(*oldIt)->surface().associatedLayer()};
142 newEl->surface().associateLayer(*layer);
149 newEl->updateCache();
153 const std::size_t size{writeCdo->size()};
154 if (writeHandle.
record(std::move(writeCdo)).isFailure()) {
156 <<
" with EventRange " << writeHandle.
getRange()
157 <<
" into Conditions Store");
158 return StatusCode::FAILURE;
160 ATH_MSG_INFO(
"recorded new CDO " << writeHandle.
key() <<
" with range " << writeHandle.
getRange() <<
" with size of " << size <<
" into Conditions Store");
162 return StatusCode::SUCCESS;
169 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
Base class for conditions algorithms.
DataModel_detail::const_iterator< DataVector > const_iterator
DataModel_detail::iterator< DataVector > iterator
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
Ensure that the extensions for the Vector3D are properly loaded.
static EventIDRange infiniteMixed()
Produces an mixed EventIDRange that is infinite in Time and RunLumi.
Class to hold the SiDetectorElement objects to be put in the detector store.
Class to hold geometrical description of a silicon detector element.
virtual StatusCode initialize() override final
SCT_DetectorElementCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
const InDetDD::SCT_DetectorManager * m_detManager
SG::ReadCondHandleKey< GeoAlignmentStore > m_readKey
virtual StatusCode execute(const EventContext &ctx) const override final
SG::ReadCondHandleKey< GeoAlignmentStore > m_pixelReadKey
SG::ReadCondHandleKey< InDetDD::TRT_DetElementContainer > m_trtDetElContKey
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_muonManagerKey
SG::WriteCondHandleKey< InDetDD::SiDetectorElementCollection > m_writeKey
virtual StatusCode finalize() override final
std::string m_detManagerName
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
Base Class for a Detector Layer in the Tracking realm.