39{
41
42 const EventContext& ctx = Gaudi::Hive::currentContext();
43
44 SG::WriteCondHandle<GeoAlignmentStore> writeHandle{
m_writeKey, ctx};
45
46
49 << ". In theory this should not be called, but may happen"
50 << " if multiple concurrent events are being processed out of order.");
51 return StatusCode::SUCCESS;
52 }
53
54
55 const InDetDD::SiDetectorElementCollection* oldColl{
m_detManager->getDetectorElementCollection()};
56 if (oldColl==nullptr) {
57 ATH_MSG_FATAL(
"Null pointer is returned by getDetectorElementCollection()");
58 return StatusCode::FAILURE;
59 }
60
61
62 std::unique_ptr<GeoAlignmentStore> writeCdo{std::make_unique<GeoAlignmentStore>()};
63
65
66 SG::ReadCondHandle<AlignableTransformContainer> readHandleStatic{
m_readKeyStatic, ctx};
68 if (readCdoStatic==nullptr) {
70 return StatusCode::FAILURE;
71 }
73
74
75
79
80
82
83
84 SG::ReadCondHandle<CondAttrListCollection> readHandleIBLDist{
m_readKeyIBLDist, ctx};
85 const CondAttrListCollection* readCdoIBLDist{*readHandleIBLDist};
86 if (readCdoIBLDist==nullptr) {
87 ATH_MSG_FATAL(
"Null pointer to the read conditions object of " << readHandleIBLDist.
key());
88 return StatusCode::FAILURE;
89 }
91
95
96 }
97 } else {
98
99 SG::ReadCondHandle<CondAttrListCollection> readHandleDynamicL1{
m_readKeyDynamicL1, ctx};
100 const CondAttrListCollection* readCdoDynamicL1{*readHandleDynamicL1};
101 if (readCdoDynamicL1==nullptr) {
103 return StatusCode::FAILURE;
104 }
106
107 SG::ReadCondHandle<CondAttrListCollection> readHandleDynamicL2{
m_readKeyDynamicL2, ctx};
108 const CondAttrListCollection* readCdoDynamicL2{*readHandleDynamicL2};
109 if (readCdoDynamicL2==nullptr) {
110 ATH_MSG_FATAL(
"Null pointer to the read conditions object of " << readHandleDynamicL2.
key());
111 return StatusCode::FAILURE;
112 }
114
115 SG::ReadCondHandle<AlignableTransformContainer> readHandleDynamicL3{
m_readKeyDynamicL3, ctx};
117 if (readCdoDynamicL3==nullptr) {
118 ATH_MSG_FATAL(
"Null pointer to the read conditions object of " << readHandleDynamicL3.
key());
119 return StatusCode::FAILURE;
120 }
122
123
124
128
132
136
137
138
140
141
142 SG::ReadCondHandle<CondAttrListCollection> readHandleIBLDist{
m_readKeyIBLDist, ctx};
143 const CondAttrListCollection* readCdoIBLDist{*readHandleIBLDist};
144 if (readCdoIBLDist==nullptr) {
145 ATH_MSG_FATAL(
"Null pointer to the read conditions object of " << readHandleIBLDist.
key());
146 return StatusCode::FAILURE;
147 }
152 }
153
154 }
155
156
157 for (const InDetDD::SiDetectorElement* oldEl: *oldColl) {
158 oldEl->getMaterialGeom()->getAbsoluteTransform(writeCdo.get());
159 oldEl->getMaterialGeom()->getDefAbsoluteTransform(writeCdo.get());
160 }
161 writeCdo->lockDelta();
162 writeCdo->lockPosCache();
163
164 if (writeHandle.
record(std::move(writeCdo)).isFailure()) {
166 <<
" with EventRange " << writeHandle.
getRange()
167 << " into Conditions Store");
168 return StatusCode::FAILURE;
169 }
170 ATH_MSG_INFO(
"recorded new CDO " << writeHandle.
key() <<
" with range " << writeHandle.
getRange() <<
" into Conditions Store");
171
172 return StatusCode::SUCCESS;
173}
#define ATH_CHECK
Evaluate an expression and check for errors.
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyIBLDist
const InDetDD::PixelDetectorManager * m_detManager
SG::ReadCondHandleKey< AlignableTransformContainer > m_readKeyDynamicL3
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyDynamicL2
SG::ReadCondHandleKey< AlignableTransformContainer > m_readKeyStatic
SG::ReadCondHandleKey< CondAttrListCollection > m_readKeyDynamicL1
BooleanProperty m_useDynamicAlignFolders
SG::WriteCondHandleKey< GeoAlignmentStore > m_writeKey
const std::string & key() const
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
std::map< std::string, const void * > RawAlignmentObjects