64 ISvcLocator *svcLocator = Gaudi::svcLocator();
69 m_msg = std::make_unique<MsgStream>(
msgSvc,
"WallsConstruction");
71 throw std::runtime_error(
"WallsConstruction: cannot initialze message service");
74 (*m_msg) << MSG::INFO <<
"WallsConstruction - creating the walls in front of the cryostat " <<
endmsg;
78 if (svcLocator->service(
"DetectorStore",
detStore,
false )==StatusCode::FAILURE) {
79 throw std::runtime_error(
"Error in WallsConstruction, cannot access DetectorStore");
84 if (geoModelSvc.retrieve().isFailure()) {
85 throw std::runtime_error (
"Cannot locate GeoModelSvc!!");
94 if (StatusCode::SUCCESS !=
detStore->retrieve(materialManager, std::string(
"MATERIALS")))
return nullptr;
101 const GeoMaterial *Air = materialManager->
getMaterial(
"std::Air");
102 if (!Air)
throw std::runtime_error(
"Error in WallsConstruction, std::Air is not found.");
104 const GeoMaterial *Iron = materialManager->
getMaterial(
"std::Iron");
105 if (!Iron)
throw std::runtime_error(
"Error in WallsConstruction, std::Iron is not found.");
107 const GeoMaterial *Lead = materialManager->
getMaterial(
"std::Lead");
108 if (!Lead)
throw std::runtime_error(
"Error in WallsConstruction, std::Lead is not found.");
110 const GeoMaterial *Aluminium = materialManager->
getMaterial(
"std::Aluminium");
111 if (!Aluminium)
throw std::runtime_error(
"Error in WallsConstruction, std::Aluminium is not found.");
120 const GeoMaterial *Scint = materialManager->
getMaterial(
"std::Polystyrene");
121 if (!Scint)
throw std::runtime_error(
"Error in WallsConstruction, std::Polystyrene is not found.");
123 const GeoMaterial *Mylar = materialManager->
getMaterial(
"std::Mylar");
124 if (!Mylar)
throw std::runtime_error(
"Error in WallsConstruction, std::Mylar is not found.");
133 std::string LArVersion = geoModelSvc->LAr_VersionOverride();
135 std::string detectorKey = LArVersion.empty() ?
AtlasVersion : LArVersion;
136 std::string detectorNode = LArVersion.empty() ?
"ATLAS" :
"LAr";
152 std::string baseName =
"LAr::TBH6";
153 std::string WallsName = baseName +
"::Walls";
160 GeoBox* WallsShape =
new GeoBox( WallsX, WallsY, WallsZ );
161 const GeoLogVol* WallsLogical =
new GeoLogVol( WallsName, WallsShape, Air );
172 (*m_msg) <<
"Create Iron Wall " <<
endmsg;
183 GeoBox* IronWallShape =
new GeoBox(IronX, IronY, IronZ);
184 std::string IronWallName = baseName +
"::IronWall";
185 GeoLogVol* IronWallLogical =
new GeoLogVol( IronWallName, IronWallShape, Iron );
186 GeoIntrusivePtr<GeoPhysVol> IronWallPhysical =
new GeoPhysVol( IronWallLogical );
189 GeoBox* IronHoleShape =
new GeoBox(IronHoleX, IronHoleY, IronHoleZ);
190 std::string IronHoleName = baseName +
"::IronWall::Hole";
191 GeoLogVol* IronHoleLogical =
new GeoLogVol( IronHoleName, IronHoleShape, Air );
192 GeoIntrusivePtr<GeoPhysVol> IronHolePhysical =
new GeoPhysVol( IronHoleLogical );
193 IronWallPhysical->add(IronHolePhysical);
206 (*m_msg) <<
"Create Lead Wall " <<
endmsg;
217 GeoBox* LeadWallShape =
new GeoBox(LeadX, LeadY, LeadZ);
218 std::string LeadWallName = baseName +
"::LeadWall";
219 GeoLogVol* LeadWallLogical =
new GeoLogVol( LeadWallName, LeadWallShape, Lead );
220 GeoIntrusivePtr<GeoPhysVol> LeadWallPhysical =
new GeoPhysVol( LeadWallLogical );
223 GeoBox* LeadHoleShape =
new GeoBox(LeadHoleX, LeadHoleY, LeadHoleZ);
224 std::string LeadHoleName = baseName +
"::LeadWall::Hole";
225 GeoLogVol* LeadHoleLogical =
new GeoLogVol( LeadHoleName, LeadHoleShape, Air );
226 GeoIntrusivePtr<GeoPhysVol> LeadHolePhysical =
new GeoPhysVol( LeadHoleLogical );
227 LeadWallPhysical->add(LeadHolePhysical);
239 (*m_msg) <<
"Create Scint Wall " <<
endmsg;
250 GeoBox* ScintWallShape =
new GeoBox(ScintX, ScintY, ScintZ);
251 std::string ScintWallName = baseName +
"::ScintWall";
252 GeoLogVol* ScintWallLogical =
new GeoLogVol( ScintWallName, ScintWallShape, Scint );
253 GeoIntrusivePtr<GeoPhysVol> ScintWallPhysical =
new GeoPhysVol( ScintWallLogical );
256 GeoBox* ScintHoleShape =
new GeoBox(ScintHoleX, ScintHoleY, ScintHoleZ);
257 std::string ScintHoleName = baseName +
"::ScintWall::Hole";
258 GeoLogVol* ScintHoleLogical =
new GeoLogVol( ScintHoleName, ScintHoleShape, Air );
259 GeoIntrusivePtr<GeoPhysVol> ScintHolePhysical =
new GeoPhysVol( ScintHoleLogical );
260 ScintWallPhysical->add(ScintHolePhysical);
279 const int nPlate = 0 ;
280 const int PlatePlace = 1 ;
288 (*m_msg) << MSG::WARNING <<
" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! " <<
endmsg;
289 (*m_msg) << MSG::WARNING <<
" EXTRA MATERIAL IN THE BEAM: " << nPlate <<
" plates " <<
endmsg;
290 if (PlatePlace== 1) (*m_msg) << MSG::WARNING <<
" between cryostat and Iron Wall " <<
endmsg;
292 (*m_msg) << MSG::WARNING <<
" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! " <<
endmsg;
294 std::vector<double> v_PlateZ;
295 v_PlateZ.reserve((nPlate));
296 for (
int iz=0; iz<(nPlate); iz++) v_PlateZ.push_back(IronPlatePosZ +
double(iz)*(2*IronPlateZ+0.5));
299 GeoBox* IronPlateShape =
new GeoBox(IronPlateX, IronPlateY, IronPlateZ);
300 std::string IronPlateName = baseName +
"::IronPlate";
301 GeoLogVol* IronPlateLogical =
new GeoLogVol( IronPlateName, IronPlateShape, Iron );
302 GeoIntrusivePtr<GeoPhysVol> IronPlatePhysical =
new GeoPhysVol( IronPlateLogical );
306 for (
int iz=0; iz<(nPlate); iz++) {