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());
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");
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);
148 StatusCode status=
m_detStore->record(sPhysVol,
"LARCRYO_B");
149 if(!status.isSuccess())
throw std::runtime_error(
"Cannot store LARCRYO_B PhysVol");
152 status=
m_detStore->record(sAlignX,
"LARCRYO_B");
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);
168 StatusCode status=
m_detStore->record(sPhysVol,
"LARCRYO_EC_POS");
169 if(!status.isSuccess())
throw std::runtime_error(
"Cannot store LARCRYO_EC_POS PhysVol");
172 status=
m_detStore->record(sAlignX,
"LARCRYO_EC_POS");
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);
184 StatusCode status=
m_detStore->record(sPhysVol,
"LARCRYO_EC_NEG");
185 if(!status.isSuccess())
throw std::runtime_error(
"Cannot store LARCRYO_EC_NEG PhysVol");
188 status=
m_detStore->record(sAlignX,
"LARCRYO_EC_NEG");
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);
197 a_container->add(
new GeoTransform(GeoTrf::RotateY3D(180.0*Gaudi::Units::deg)));
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);
209 StatusCode status=
m_detStore->record(sPhysVol,
"LARCRYO_B");
210 if(!status.isSuccess())
throw std::runtime_error(
"Cannot store LARCRYO_B PhysVol");
213 status=
m_detStore->record(sAlignX,
"LARCRYO_B");
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);
231 StatusCode status=
m_detStore->record(sPhysVol,
"LARCRYO_EC_POS");
232 if(!status.isSuccess())
throw std::runtime_error(
"Cannot store LARCRYO_EC_POS PhysVol");
235 status=
m_detStore->record(sAlignX,
"LARCRYO_EC_POS");
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);
247 StatusCode status=
m_detStore->record(sPhysVol,
"LARCRYO_EC_NEG");
248 if(!status.isSuccess())
throw std::runtime_error(
"Cannot store LARCRYO_EC_NEG PhysVol");
251 status=
m_detStore->record(sAlignX,
"LARCRYO_EC_NEG");
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);
260 a_container->add(
new GeoTransform(GeoTrf::RotateY3D(180.0*Gaudi::Units::deg)));
261 a_container->add(endcapEnvelopeNeg);
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);