82 return StatusCode::SUCCESS;
87 GeoFullPhysVol* Phys =
dynamic_cast<GeoFullPhysVol *
>(pv);
89 ATH_MSG_ERROR(
"Parent volume is not a GeoFullPhysVol as expected.");
90 return StatusCode::FAILURE;
94 ATH_CHECK(detStore()->retrieve(materialManager, std::string(
"MATERIALS")));
97 std::unique_ptr<BCM_GeometryManager> manager = std::make_unique<BCM_GeometryManager>();
106 if (versionKey.
tag() ==
"AUTO") {
107 ATH_MSG_ERROR(
"AUTO Atlas version. Please select a version.");
108 return StatusCode::FAILURE;
111 ATH_MSG_INFO(
"Building BCM with Version Tag: " << versionKey.
tag() <<
" at Node: " << versionKey.
node());
112 SmartIF<IRDBAccessSvc> accessSvc{Gaudi::svcLocator()->service(
"RDBAccessSvc")};
116 std::string BCMVersionTag;
117 BCMVersionTag = accessSvc->getChildTag(
"BCM", versionKey.
tag(), versionKey.
node());
121 if (BCMVersionTag.empty()) {
123 return StatusCode::SUCCESS;
132 for(ind = 0; ind < DBmodul->
size(); ind++) {
134 moduleNo = rec->
getLong(
"MODULE_ID");
137 unsigned int mask = (1 << moduleNo);
143 std::vector<double> module_property;
144 module_property.push_back(rec->
getFloat(
"TRANS_X"));
145 module_property.push_back(rec->
getFloat(
"TRANS_Y"));
146 module_property.push_back(rec->
getFloat(
"TRANS_Z"));
147 module_property.push_back(rec->
getFloat(
"ROT_X"));
148 module_property.push_back(rec->
getFloat(
"ROT_Y"));
149 module_property.push_back(rec->
getFloat(
"ROT_Z"));
150 module_property.push_back(rec->
getFloat(
"DIMESION_Z"));
151 module_property.push_back(rec->
getFloat(
"DIAM_TRANS_Y"));
152 module_property.push_back(rec->
getFloat(
"DIAM_TRANS_Z"));
153 module_property.push_back(rec->
getFloat(
"DIAM_DIAM_X"));
154 module_property.push_back(rec->
getFloat(
"DIAM_DAIM_Y"));
155 module_property.push_back(rec->
getFloat(
"DIAM_DIAM_Z"));
156 module_property.push_back(rec->
getFloat(
"OFF_H"));
157 module_property.push_back(rec->
getFloat(
"OFF_I"));
158 module_property.push_back(rec->
getFloat(
"OFF_J"));
161 manager->ModuleOn(moduleNo);
162 manager->Module(moduleNo)->Set(moduleNo, &module_property);
170 const std::vector<double>* module_property =
nullptr;
171 for(moduleNo = 0; moduleNo < 8; moduleNo++)
173 unsigned int mask = (1 << moduleNo);
179 if(moduleNo == 0) module_property = &
m_module0;
180 else if(moduleNo == 1) module_property = &
m_moduleI;
181 else if(moduleNo == 2) module_property = &
m_moduleII;
182 else if(moduleNo == 3) module_property = &
m_moduleIII;
183 else if(moduleNo == 4) module_property = &
m_moduleIV;
184 else if(moduleNo == 5) module_property = &
m_moduleV;
185 else if(moduleNo == 6) module_property = &
m_moduleVI;
186 else if(moduleNo == 7) module_property = &
m_moduleVII;
189 manager->ModuleOn(moduleNo);
190 if (module_property){
191 manager->Module(moduleNo)->Set(moduleNo, module_property);
193 ATH_MSG_ERROR(
"module_property pointer is null in BCM_Builder.cxx");
201 for(
int i=0; i<8; i++)
204 if(!(manager->IsModuleOn(i)))
211 GeoTrf::Translation3D pos(parameters->Position_X(), parameters->Position_Y(), parameters->Position_Z());
212 GeoTrf::Transform3D rm = GeoTrf::RotateZ3D(parameters->Rotation_Z()*Gaudi::Units::deg)
213 * GeoTrf::RotateY3D(parameters->Rotation_Y()*Gaudi::Units::deg)
214 * GeoTrf::RotateX3D(parameters->Rotation_X()*Gaudi::Units::deg)
215 * GeoTrf::RotateZ3D(-90.*Gaudi::Units::deg)
216 * GeoTrf::RotateY3D(-90.*Gaudi::Units::deg);
217 GeoIntrusivePtr<GeoTransform> xform{
new GeoTransform(GeoTrf::Transform3D(pos*rm))};
223 GeoIntrusivePtr<GeoNameTag> tag{
new GeoNameTag(
"BCM Module")};
224 if (materialManager){
225 GeoVPhysVol* bcmModPhys = bcm.
Build(materialManager, parameters, (msgLvl(MSG::INFO) ? &
msg(MSG::INFO) :
nullptr));
227 Phys->add(
new GeoIdentifierTag(k));
229 Phys->add(bcmModPhys);
234 ATH_CHECK(detStore()->record(std::move(manager),
"BCMParameters"));
236 return StatusCode::SUCCESS;