39 return StatusCode::SUCCESS;
50 if (writeHandle.isValid()) {
51 ATH_MSG_DEBUG(
"CondHandle " << writeHandle.fullKey() <<
" is already valid."
52 <<
". In theory this should not be called, but may happen"
53 <<
" if multiple concurrent events are being processed out of order.");
54 return StatusCode::SUCCESS;
58 if (oldColl==
nullptr) {
59 ATH_MSG_FATAL(
"Null pointer is returned by getDetectorElementCollection()");
60 return StatusCode::FAILURE;
64 std::unique_ptr<InDetDD::SiDetectorElementCollection> writeCdo{std::make_unique<InDetDD::SiDetectorElementCollection>()};
69 if (readCdo==
nullptr) {
71 return StatusCode::FAILURE;
78 writeHandle.addDependency(readHandle);
82 if (*muonDependency !=
nullptr) {
83 writeHandle.addDependency(muonDependency);
86 return StatusCode::FAILURE;
91 if (*trtDependency !=
nullptr) {
92 writeHandle.addDependency(trtDependency);
95 return StatusCode::FAILURE;
100 if (*sctDependency !=
nullptr) {
101 writeHandle.addDependency(sctDependency);
103 ATH_MSG_ERROR(
"SCT AlignmentStore not found but configured");
104 return StatusCode::FAILURE;
109 std::map<const InDetDD::SiDetectorElement*, const InDetDD::SiDetectorElement*> oldToNewMap;
110 oldToNewMap[
nullptr] =
nullptr;
111 writeCdo->resize(oldColl->size(),
nullptr);
116 oldEl->GeoVDetectorElement::getMaterialGeom(),
117 oldEl->getCommonItems(),
119 oldToNewMap[oldEl] = *newEl;
125 InDetDD::SiDetectorElementCollection::const_iterator oldIt{oldColl->begin()};
127 if (oldToNewMap[(*oldIt)]!=newEl) {
130 newEl->setNextInEta(oldToNewMap[(*oldIt)->nextInEta()]);
131 newEl->setPrevInEta(oldToNewMap[(*oldIt)->prevInEta()]);
132 newEl->setNextInPhi(oldToNewMap[(*oldIt)->nextInPhi()]);
133 newEl->setPrevInPhi(oldToNewMap[(*oldIt)->prevInPhi()]);
138 newEl->surface().associateLayer(*
layer);
149 const std::size_t
size{writeCdo->size()};
150 if (writeHandle.record(std::move(writeCdo)).isFailure()) {
152 <<
" with EventRange " << writeHandle.getRange()
153 <<
" into Conditions Store");
154 return StatusCode::FAILURE;
156 ATH_MSG_INFO(
"recorded new CDO " << writeHandle.key() <<
" with range " << writeHandle.getRange()
157 <<
" with size of " <<
size <<
" into Conditions Store");
159 return StatusCode::SUCCESS;