92 return StatusCode::SUCCESS;
97 GeoFullPhysVol* Phys =
dynamic_cast<GeoFullPhysVol *
>(pv);
99 ATH_MSG_ERROR(
"Parent volume is not a GeoFullPhysVol as expected.");
100 return StatusCode::FAILURE;
104 ATH_CHECK(detStore()->retrieve(materialManager, std::string(
"MATERIALS")));
107 std::unique_ptr<BLM_GeometryManager> manager = std::make_unique<BLM_GeometryManager>();
115 if (versionKey.
tag() ==
"AUTO") {
116 ATH_MSG_ERROR(
"AUTO Atlas version. Please select a version.");
117 return StatusCode::FAILURE;
120 ATH_MSG_INFO(
"Building BLM with Version Tag: "<< versionKey.
tag() <<
" at Node: " << versionKey.
node());
121 SmartIF<IRDBAccessSvc> accessSvc{Gaudi::svcLocator()->service(
"RDBAccessSvc")};
125 std::string BLMVersionTag;
126 BLMVersionTag = accessSvc->getChildTag(
"BLM", versionKey.
tag(), versionKey.
node());
130 if (BLMVersionTag.empty()) {
132 return StatusCode::SUCCESS;
142 for(ind = 0; ind < DBmodul->
size(); ind++)
145 moduleNo = rec->
getLong(
"MODULE_ID");
148 unsigned int mask = (1 << moduleNo);
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"));
166 manager->ModuleOn(moduleNo);
167 manager->Module(moduleNo)->Set(moduleNo, &module_property);
173 ATH_MSG_DEBUG(
" --> BLM parameters via jobOptions or default");
176 const std::vector<double>* module_property =
nullptr;
177 for(moduleNo = 0; moduleNo < 12; moduleNo++)
179 unsigned int mask = (1 << moduleNo);
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;
199 manager->ModuleOn(moduleNo);
200 if (module_property){
201 manager->Module(moduleNo)->Set(moduleNo, module_property);
211 for(
int i=0; i<12; i++)
214 if(!(manager->IsModuleOn(i)))
221 GeoTrf::Translation3D pos(parameters->R()*cos(parameters->Phi()*Gaudi::Units::deg), parameters->R()*sin(parameters->Phi()*Gaudi::Units::deg), parameters->Z());
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))};
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));
233 Phys->add(
new GeoIdentifierTag(k));
235 Phys->add(blmModPhys);
242 ATH_CHECK(detStore()->record(std::move(manager),
"BLMParameters"));
244 return StatusCode::SUCCESS;