17 , m_readKey{
"SCTAlignmentStore",
"SCTAlignmentStore"}
18 , m_detManagerName(
"SCT")
20 declareProperty(
"ReadKey", m_readKey);
21 declareProperty(
"DetManagerName", m_detManagerName);
41 return StatusCode::SUCCESS;
52 if (writeHandle.isValid()) {
53 ATH_MSG_DEBUG(
"CondHandle " << writeHandle.fullKey() <<
" is already valid."
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;
80 writeHandle.addDependency(readHandle);
84 if (*muonDependency !=
nullptr) {
85 writeHandle.addDependency(muonDependency);
88 return StatusCode::FAILURE;
93 if (*trtDependency !=
nullptr) {
94 writeHandle.addDependency(trtDependency);
97 return StatusCode::FAILURE;
102 if (*pixelDependency !=
nullptr) {
103 writeHandle.addDependency(pixelDependency);
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(),
nullptr);
118 oldEl->GeoVDetectorElement::getMaterialGeom(),
119 oldEl->getCommonItems(),
121 oldToNewMap[oldEl] = *newEl;
127 InDetDD::SiDetectorElementCollection::const_iterator oldIt{oldColl->begin()};
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 newEl->surface().associateLayer(*
layer);
151 const std::size_t
size{writeCdo->size()};
152 if (writeHandle.record(std::move(writeCdo)).isFailure()) {
154 <<
" with EventRange " << writeHandle.getRange()
155 <<
" into Conditions Store");
156 return StatusCode::FAILURE;
158 ATH_MSG_INFO(
"recorded new CDO " << writeHandle.key() <<
" with range " << writeHandle.getRange() <<
" with size of " <<
size <<
" into Conditions Store");
160 return StatusCode::SUCCESS;
167 return StatusCode::SUCCESS;