65 ISvcLocator *svcLocator = Gaudi::svcLocator();
67 if (svcLocator->service(
"MessageSvc",
msgSvc,
true )==StatusCode::FAILURE) {
68 throw std::runtime_error(
"Error in FrontBeamConstructionH62002, cannot access MessageSvc");
71 MsgStream
log(
msgSvc,
"LArGeo::FrontBeamConstructionH62002");
73 log <<
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
74 log <<
"+ +" << std::endl;
75 log <<
"+ HELLO from LArGeo::FrontBeamConstructionH62002 +" << std::endl;
76 log <<
"+ +" << std::endl;
77 log <<
"+++++++++++++++++++++++++++++++++++++++++++++++++++++++" << std::endl;
81 if (svcLocator->service(
"DetectorStore",
detStore,
false )==StatusCode::FAILURE) {
82 throw std::runtime_error(
"Error in FrontBeamConstructionH62002, cannot access DetectorStore");
86 if (geoDbTagSvc.retrieve().isFailure()) {
87 throw std::runtime_error (
"Cannot locate GeoDbTagSvc!!");
94 if (StatusCode::SUCCESS !=
detStore->retrieve(materialManager, std::string(
"MATERIALS")))
return nullptr;
97 const GeoMaterial *Air = materialManager->
getMaterial(
"std::Air");
98 if (!Air)
throw std::runtime_error(
"Error in FrontBeamConstructionH62002, std::Air is not found.");
100 const GeoMaterial *Aluminium = materialManager->
getMaterial(
"std::Aluminium");
101 if (!Aluminium)
throw std::runtime_error(
"Error in FrontBeamConstructionH62002, std::Aluminium is not found.");
110 const GeoMaterial *Scint = materialManager->
getMaterial(
"std::Polystyrene");
111 if (!Scint)
throw std::runtime_error(
"Error in FrontBeamConstructionH62002, std::Polystyrene is not found.");
113 const GeoMaterial *Mylar = materialManager->
getMaterial(
"std::Mylar");
114 if (!Mylar)
throw std::runtime_error(
"Error in FrontBeamConstructionH62002, std::Mylar is not found.");
121 std::string LArVersion = geoDbTagSvc->LAr_VersionOverride();
123 std::string detectorKey = LArVersion.empty() ?
AtlasVersion : LArVersion;
124 std::string detectorNode = LArVersion.empty() ?
"ATLAS" :
"LAr";
136 std::string baseName =
"LAr::TBH62002";
137 std::string H62002FrontBeamName = baseName +
"::FrontBeam";
143 GeoBox* H62002FrontBeamShape =
new GeoBox( H62002FrontBeamXY, H62002FrontBeamXY, H62002FrontBeamZ );
144 const GeoLogVol* H62002FrontBeamLogical =
new GeoLogVol( H62002FrontBeamName, H62002FrontBeamShape, Air );
163 log <<
"Create Front Scintillators ..." << std::endl;
170 std::vector<double> v_ScintXY;
171 std::vector<double> v_ScintZ;
172 v_ScintXY.push_back(Wxy);
173 v_ScintXY.push_back(Wxy);
174 v_ScintXY.push_back(Bxy);
181 GeoBox* ScintShapeW =
new GeoBox(Wxy, Wxy, Wz);
182 GeoBox* ScintShapeB =
new GeoBox(Bxy, Bxy, Bz);
183 std::string ScintName = baseName +
"::Scintillator";
184 GeoLogVol* WScintLogical =
new GeoLogVol( ScintName, ScintShapeW, Scint );
185 GeoLogVol* BScintLogical =
new GeoLogVol( ScintName, ScintShapeB, Scint );
186 GeoIntrusivePtr<GeoPhysVol> WScintPhysical =
new GeoPhysVol( WScintLogical );
187 GeoIntrusivePtr<GeoPhysVol> BScintPhysical =
new GeoPhysVol( BScintLogical );
190 for (
unsigned int i = 0;
i < v_ScintZ.size();
i++ ) {
197 default: {
throw std::runtime_error(
"H62002FrontBeam wants too many Scintillators!!");
break; }
209 MWPCConstruction mwpcXConstruction (WireStep);
210 PVLink mwpcEnvelope = mwpcXConstruction.GetEnvelope();