197 ISvcLocator *svcLocator = Gaudi::svcLocator();
199 if (svcLocator->service(
"MessageSvc",
msgSvc,
true )==StatusCode::FAILURE) {
200 throw std::runtime_error(
"Error in LArDetectorConstructionTBEC, cannot access MessageSvc");
203 MsgStream
log(
msgSvc,
"LArGeo::LArDetectorConstructionTBEC");
208 if (svcLocator->service(
"DetectorStore",
detStore,
false )==StatusCode::FAILURE) {
209 throw std::runtime_error(
"Error in LArDetectorConstructionTBEC, cannot access DetectorStore");
215 if (StatusCode::SUCCESS !=
detStore->retrieve(materialManager, std::string(
"MATERIALS")))
return nullptr;
217 const GeoMaterial *Air = materialManager->
getMaterial(
"std::Air");
218 if (!Air)
throw std::runtime_error(
"Error in LArDetectorConstructionTBEC, std::Air is not found.");
220 const GeoMaterial *Lead = materialManager->
getMaterial(
"std::Lead");
221 if (!Lead)
throw std::runtime_error(
"Error in LArDetectorConstructionTBEC, std::Lead is not found.");
234 std::string baseName =
"LAr::TBEC";
245 std::string tbecMotherName = baseName +
"::MotherVolume";
247 const GeoLogVol* tbecMotherLogical =
new GeoLogVol( tbecMotherName, tbecMotherShape, Air );
248 GeoIntrusivePtr<GeoFullPhysVol> tbecMotherPhysical =
new GeoFullPhysVol( tbecMotherLogical );
267 std::string XAxisName = baseName +
"::XAxis";
268 const GeoLogVol* XAxisLogical =
new GeoLogVol( XAxisName, axisShape, Air );
269 GeoIntrusivePtr<GeoPhysVol> XAxisPhysVol =
new GeoPhysVol( XAxisLogical );
271 tbecMotherPhysical->add(
new GeoIdentifierTag( 1 ) );
273 tbecMotherPhysical->add( XAxisPhysVol );
276 std::string YAxisName = baseName +
"::YAxis";
277 const GeoLogVol* YAxisLogical =
new GeoLogVol( YAxisName, axisShape, Air );
278 GeoIntrusivePtr<GeoPhysVol> YAxisPhysVol =
new GeoPhysVol( YAxisLogical );
280 tbecMotherPhysical->add(
new GeoIdentifierTag( 1 ) );
282 tbecMotherPhysical->add( YAxisPhysVol );
285 std::string ZAxisName = baseName +
"::ZAxis";
286 const GeoLogVol* ZAxisLogical =
new GeoLogVol( ZAxisName, axisShape, Air );
287 GeoIntrusivePtr<GeoPhysVol> ZAxisPhysVol =
new GeoPhysVol( ZAxisLogical );
289 tbecMotherPhysical->add(
new GeoIdentifierTag( 1 ) );
290 tbecMotherPhysical->add(
new GeoTransform( GeoTrf::TranslateZ3D( axisZHalfLength ) ) );
291 tbecMotherPhysical->add( ZAxisPhysVol );
297 std::string CompensatorName = baseName +
"::LeadCompensator";
299 const GeoLogVol* CompensatorLogical =
new GeoLogVol( CompensatorName, CompensatorShape, Lead );
300 GeoIntrusivePtr<GeoPhysVol> CompensatorPhysical =
new GeoPhysVol( CompensatorLogical );
302 tbecMotherPhysical->add(
new GeoIdentifierTag( 1 ) );
306 GeoTrf::Translate3D tmpxf1(tmpvec1Rotated.x(),tmpvec1Rotated.y(),tmpvec1Rotated.z());
307 tbecMotherPhysical->add(
new GeoTransform( tmpxf1 * GeoTrf::RotateY3D(
m_eta_pos)));
308 tbecMotherPhysical->add( CompensatorPhysical );
313 CryostatConstructionTBEC cryoConstruction;
314 GeoIntrusivePtr<GeoVFullPhysVol> cryoPhys = cryoConstruction.GetEnvelope();
315 GeoIntrusivePtr<GeoPhysVol> LArPhysical = cryoConstruction.GetLArPhysical();
317 tbecMotherPhysical->add(
new GeoIdentifierTag( 1 ) );
320 GeoTrf::Translate3D tmpxf2(tmpvec2Rotated.x(),tmpvec2Rotated.y(),tmpvec2Rotated.z());
321 tbecMotherPhysical->add(
new GeoTransform( tmpxf2 * GeoTrf::RotateY3D(
m_eta_pos)));
322 tbecMotherPhysical->add( cryoPhys );
331 GeoBox* BeamCShape =
new GeoBox( beamCSize, beamCSize, beamCTh );
332 for (
int i = 0;
i < 4;
i++ ) {
333 std::string BeamCName = baseName +
"::BeamChamber";
334 BeamCName+=
char(
i ) +
'0';
335 GeoLogVol* BeamCLogical =
new GeoLogVol( BeamCName, BeamCShape, Air );
336 GeoIntrusivePtr<GeoPhysVol> BeamCPhysical =
new GeoPhysVol( BeamCLogical );
338 tbecMotherPhysical->add(
new GeoIdentifierTag( 1 ) );
340 tbecMotherPhysical->add( BeamCPhysical );
352 EMECConstruction emecModuleConstruction(
true,
true,
true );
353 GeoIntrusivePtr<GeoFullPhysVol>emecEnvelope= (GeoIntrusivePtr<GeoFullPhysVol>) emecModuleConstruction.GetEnvelope();
356 if(!
status.isSuccess())
throw std::runtime_error (
"Cannot store EMEC_POS");
363 LArPhysical->add(
new GeoIdentifierTag( 1 ) );
365 LArPhysical->add( emecEnvelope );
373 GeoIntrusivePtr<GeoFullPhysVol> PresamplerEnvelope = PresamplerConstruction.Envelope();
377 if(!
status.isSuccess())
throw std::runtime_error (
"Cannot store PRESAMPLER_EC_POS");
381 LArPhysical->add(
new GeoIdentifierTag( 1 ) );
383 LArPhysical->add( PresamplerEnvelope );
387 return tbecMotherPhysical;