89{
92 return StatusCode::SUCCESS;
93 }
94
95
96
97 GeoFullPhysVol* Phys =
dynamic_cast<GeoFullPhysVol *
>(
pv);
98 if (!Phys) {
99 ATH_MSG_ERROR(
"Parent volume is not a GeoFullPhysVol as expected.");
100 return StatusCode::FAILURE;
101 }
102
103 StoredMaterialManager * materialManager{nullptr};
105
106
107 std::unique_ptr<BLM_GeometryManager>
manager = std::make_unique<BLM_GeometryManager>();
108
111 {
112 DecodeVersionKey versionKey("InnerDetector");
113
114
115 if (versionKey.tag() == "AUTO") {
116 ATH_MSG_ERROR(
"AUTO Atlas version. Please select a version.");
117 return StatusCode::FAILURE;
118 }
119
120 ATH_MSG_INFO(
"Building BLM with Version Tag: "<< versionKey.tag() <<
" at Node: " << versionKey.node());
121 SmartIF<IRDBAccessSvc> accessSvc{Gaudi::svcLocator()->service("RDBAccessSvc")};
123
124
125 std::string BLMVersionTag;
126 BLMVersionTag = accessSvc->getChildTag("BLM", versionKey.tag(), versionKey.node());
128
129
130 if (BLMVersionTag.empty()) {
132 return StatusCode::SUCCESS;
133 }
134
135 IRDBRecordset_ptr DBmodul = accessSvc->getRecordsetPtr(
"BLMModule", versionKey.tag(), versionKey.node());
137
138
139
140 unsigned int ind;
141 long moduleNo;
142 for(ind = 0; ind < DBmodul->
size(); ind++)
143 {
144 const IRDBRecord* rec = (*DBmodul)[ind];
145 moduleNo = rec->
getLong(
"MODULE_ID");
146
147
148 unsigned int mask = (1 << moduleNo);
150
151 continue;
152 }
153
154 std::vector<double> module_property;
155 module_property.push_back(rec->
getFloat(
"Z"));
156 module_property.push_back(rec->
getFloat(
"R"));
157 module_property.push_back(rec->
getFloat(
"PHI"));
158 module_property.push_back(rec->
getFloat(
"ROT_X"));
159 module_property.push_back(rec->
getFloat(
"ROT_Y"));
160 module_property.push_back(rec->
getFloat(
"ROT_Z"));
161 module_property.push_back(rec->
getFloat(
"DIAM_X"));
162 module_property.push_back(rec->
getFloat(
"DIAM_Y"));
163 module_property.push_back(rec->
getFloat(
"DIAM_Z"));
164
165
167 manager->Module(moduleNo)->Set(moduleNo, &module_property);
168 }
170 }
171 else
172 {
173 ATH_MSG_DEBUG(
" --> BLM parameters via jobOptions or default");
174
175 int moduleNo;
176 const std::vector<double>* module_property = nullptr;
177 for(moduleNo = 0; moduleNo < 12; moduleNo++)
178 {
179 unsigned int mask = (1 << moduleNo);
181 {
182
183 continue;
184 }
185 if(moduleNo == 0) module_property = &
m_module0;
186 else if(moduleNo == 1) module_property = &
m_moduleI;
187 else if(moduleNo == 2) module_property = &
m_moduleII;
188 else if(moduleNo == 3) module_property = &
m_moduleIII;
189 else if(moduleNo == 4) module_property = &
m_moduleIV;
190 else if(moduleNo == 5) module_property = &
m_moduleV;
191 else if(moduleNo == 6) module_property = &
m_moduleVI;
192 else if(moduleNo == 7) module_property = &
m_moduleVII;
194 else if(moduleNo == 9) module_property = &
m_moduleIX;
195 else if(moduleNo == 10) module_property = &
m_moduleX;
196 else if(moduleNo == 11) module_property = &
m_moduleXI;
197
198
200 if (module_property){
201 manager->Module(moduleNo)->Set(moduleNo, module_property);
202 } else {
204 }
205 }
206 }
207
208
209 BLM_Module blm;
210
211 for(
int i=0;
i<12;
i++)
212 {
213
215 continue;
216
217
219
220
222 GeoTrf::Transform3D rm = GeoTrf::RotateZ3D(
parameters->Rotation_Z()*Gaudi::Units::deg)
223 * GeoTrf::RotateY3D(
parameters->Rotation_Y()*Gaudi::Units::deg)
224 * GeoTrf::RotateX3D(
parameters->Rotation_X()*Gaudi::Units::deg);
225 GeoIntrusivePtr<GeoTransform> xform{new GeoTransform(GeoTrf::Transform3D(pos*rm))};
226
228
229 GeoIntrusivePtr<GeoNameTag>
tag{
new GeoNameTag(
"BLM Module")};
230 if (materialManager){
231 GeoVPhysVol* blmModPhys = blm.
Build(materialManager, parameters, (msgLvl(MSG::INFO) ? &
msg(MSG::INFO) :
nullptr));
232 Phys->add(tag);
233 Phys->add(new GeoIdentifierTag(k));
234 Phys->add(xform);
235 Phys->add(blmModPhys);
237 }
238 }
239
240
243
244 return StatusCode::SUCCESS;
245}
#define ATH_CHECK
Evaluate an expression and check for errors.
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
GeoPhysVol * Build(StoredMaterialManager *mat_mgr, const BLM_ModuleParameters *parameters, MsgStream *msg)
virtual long getLong(const std::string &fieldName) const =0
Get long field value.
virtual float getFloat(const std::string &fieldName) const =0
Get float field value.
virtual unsigned int size() const =0
::StatusCode StatusCode
StatusCode definition for legacy code.
retrieve(aClass, aKey=None)