70 GeoIntrusivePtr<GeoFullPhysVol> barrelEnvelope{
nullptr}, endcapEnvelopePos{
nullptr}, endcapEnvelopeNeg{
nullptr};
72 double projectivityDisplacement(0.);
79 if (StatusCode::SUCCESS !=
m_detStore->
retrieve(materialManager, std::string(
"MATERIALS"))) {
80 throw std::runtime_error(
"Error in LArDetectorFactory, cannot access Material Manager");
83 SmartIF<IRDBAccessSvc> rdbAccess{Gaudi::svcLocator()->service(
"RDBAccessSvc")};
85 if(!rdbAccess.isValid())
86 throw std::runtime_error(
"Error in BarrelCryostatConstruction, cannot access RDBAccessSvc");
89 ATH_MSG_DEBUG(
"Getting primary numbers for " << larVersionKey.node() <<
", " << larVersionKey.tag());
91 IRDBRecordset_ptr larPosition = rdbAccess->getRecordsetPtr(
"LArPosition",larVersionKey.tag(),larVersionKey.node());
93 if(larPosition->size()==0) {
94 larPosition = rdbAccess->getRecordsetPtr(
"LArPosition",
"LArPosition-00");
95 if (larPosition->size()==0)
96 throw std::runtime_error(
"Error, no lar position table in database!");
99 IRDBRecordset_ptr emecGeometry = rdbAccess->getRecordsetPtr(
"EmecGeometry",larVersionKey.tag(),larVersionKey.node());
100 projectivityDisplacement = (*emecGeometry)[0]->getDouble(
"ZSHIFT");
110 lArMaterialManager.buildMaterials();
122 barrelEnvelope = barrelCryostatConstruction.GetEnvelope(
m_parameters.get());
126 endcapEnvelopePos = endcapCryostatConstruction.createEnvelope(
true);
127 endcapEnvelopeNeg = endcapCryostatConstruction.createEnvelope(
false);
131 a_container->add(
new GeoNameTag(
"LAr"));
142 if(!barrelRec)
throw std::runtime_error(
"Error, no lar position record in the database");
144 GeoAlignableTransform* barrelAlXf =
new GeoAlignableTransform(xfBarrel);
149 if(!
status.isSuccess())
throw std::runtime_error(
"Cannot store LARCRYO_B PhysVol");
153 if(!
status.isSuccess())
throw std::runtime_error(
"Cannot store LARCRYO_B Alignable XF");
156 a_container->add(
new GeoNameTag(
"LArBarrel"));
157 a_container->add(barrelAlXf);
158 a_container->add(barrelEnvelope);
162 if (!posRec)
throw std::runtime_error(
"Error, no lar position record in the database") ;
164 GeoAlignableTransform *xfEndcapPos =
new GeoAlignableTransform(xfPos);
169 if(!
status.isSuccess())
throw std::runtime_error(
"Cannot store LARCRYO_EC_POS PhysVol");
173 if(!
status.isSuccess())
throw std::runtime_error (
"Cannot store LARCRYO_EC_POS");
178 if (!negRec)
throw std::runtime_error(
"Error, no lar position record in the database") ;
180 GeoAlignableTransform *xfEndcapNeg =
new GeoAlignableTransform(xfNeg);
185 if(!
status.isSuccess())
throw std::runtime_error(
"Cannot store LARCRYO_EC_NEG PhysVol");
189 if(!
status.isSuccess())
throw std::runtime_error (
"Cannot store LARCRYO_EC_NEG");
192 a_container->add(
new GeoNameTag(
"LArEndcapPos"));
193 a_container->add(xfEndcapPos);
194 a_container->add(endcapEnvelopePos);
195 a_container->add(
new GeoNameTag(
"LArEndcapNeg"));
196 a_container->add(xfEndcapNeg);
198 a_container->add(endcapEnvelopeNeg);
203 if(!barrelRec)
throw std::runtime_error(
"Error, no lar position record in the database");
205 GeoAlignableTransform* barrelAlXf =
new GeoAlignableTransform(xfBarrel);
210 if(!
status.isSuccess())
throw std::runtime_error(
"Cannot store LARCRYO_B PhysVol");
214 if(!
status.isSuccess())
throw std::runtime_error(
"Cannot store LARCRYO_B Alignable XF");
217 a_container->add(
new GeoNameTag(
"LArBarrel"));
218 a_container->add(barrelAlXf);
219 a_container->add(barrelEnvelope);
225 if (!posRec)
throw std::runtime_error(
"Error, no lar position record in the database") ;
227 GeoAlignableTransform *xfEndcapPos =
new GeoAlignableTransform(xfPos);
232 if(!
status.isSuccess())
throw std::runtime_error(
"Cannot store LARCRYO_EC_POS PhysVol");
236 if(!
status.isSuccess())
throw std::runtime_error (
"Cannot store LARCRYO_EC_POS");
241 if (!negRec)
throw std::runtime_error(
"Error, no lar position record in the database") ;
243 GeoAlignableTransform *xfEndcapNeg =
new GeoAlignableTransform(xfNeg);
248 if(!
status.isSuccess())
throw std::runtime_error(
"Cannot store LARCRYO_EC_NEG PhysVol");
252 if(!
status.isSuccess())
throw std::runtime_error (
"Cannot store LARCRYO_EC_NEG");
255 a_container->add(
new GeoNameTag(
"LArEndcapPos"));
256 a_container->add(xfEndcapPos);
257 a_container->add(endcapEnvelopePos);
258 a_container->add(
new GeoNameTag(
"LArEndcapNeg"));
259 a_container->add(xfEndcapNeg);
261 a_container->add(endcapEnvelopeNeg);
266 TBBarrelCryostatConstruction tbbarrelCryostatConstruction;
270 barrelEnvelope = tbbarrelCryostatConstruction.GetEnvelope(
m_parameters.get());
272 a_container->add(
new GeoNameTag(
"LAr"));
273 a_container->add(barrelEnvelope);
282 , projectivityDisplacement);
289 if(!embDetectorManager
290 || !emecDetectorManager
291 || !hecDetectorManager
292 || !fcalDetectorManager) {
293 std::string errorMessage=
"Failed to build LAr Readout Geometry description";
294 throw std::runtime_error(errorMessage);