67 ISvcLocator *svcLocator = Gaudi::svcLocator();
69 sc=svcLocator->service(
"MessageSvc",
msgSvc,
true );
70 if (
sc==StatusCode::FAILURE) {
71 throw std::runtime_error(
"Error in FrontBeamConstructionH62004, cannot access MessageSvc");
74 MsgStream
log(
msgSvc,
"LArGeo::FrontBeamConstructionH62004");
75 log << MSG::INFO <<
"+ HELLO from LArGeo::FrontBeamConstructionH62004 +" <<
endmsg;
79 sc=svcLocator->service(
"DetectorStore",
detStore,
false );
80 if (
sc==StatusCode::FAILURE) {
81 throw std::runtime_error(
"Error in FrontBeamConstructionH62004, cannot access DetectorStore");
90 sc=
detStore->retrieve(materialManager, std::string(
"MATERIALS"));
91 if (StatusCode::SUCCESS !=
sc)
return nullptr;
93 const GeoMaterial *Air = materialManager->
getMaterial(
"std::Air");
94 if (!Air)
throw std::runtime_error(
"Error in FrontBeamConstructionH62004, std::Air is not found.");
103 const GeoMaterial *Scint = materialManager->
getMaterial(
"std::Polystyrene");
104 if (!Scint)
throw std::runtime_error(
"Error in FrontBeamConstructionH62004, std::Polystyrene is not found.");
117 std::string baseName =
"LAr::TBH62004";
118 std::string H62004FrontBeamName = baseName +
"::FrontBeam";
135 GeoBox* H62004FrontBeamShape =
new GeoBox( bard_x, bard_y, bard_z );
136 const GeoLogVol* H62004FrontBeamLogical =
new GeoLogVol( H62004FrontBeamName, H62004FrontBeamShape, Air );
151 log << MSG::INFO <<
"Create Front Scintillators ..." <<
endmsg;
158 std::vector<double> v_ScintXY;
159 std::vector<double> v_ScintZ;
160 v_ScintXY.push_back(Wxy);
161 v_ScintXY.push_back(Wxy);
162 v_ScintXY.push_back(Bxy);
169 GeoBox* ScintShapeW =
new GeoBox(Wxy, Wxy, Wz);
170 GeoBox* ScintShapeB =
new GeoBox(Bxy, Bxy, Bz);
171 std::string ScintName = H62004FrontBeamName +
"::Scintillator";
172 GeoLogVol* WScintLogical =
new GeoLogVol( ScintName, ScintShapeW, Scint );
173 GeoLogVol* BScintLogical =
new GeoLogVol( ScintName, ScintShapeB, Scint );
174 GeoIntrusivePtr<GeoPhysVol> WScintPhysical =
new GeoPhysVol( WScintLogical );
175 GeoIntrusivePtr<GeoPhysVol> BScintPhysical =
new GeoPhysVol( BScintLogical );
178 for (
unsigned int i = 0;
i < v_ScintZ.size();
i++ ) {
185 default: {
throw std::runtime_error(
"H62004FrontBeam wants too many Scintillators!!");
break; }
194 log << MSG::INFO <<
" Create MWPC5 " <<
endmsg;
197 PVLink MwpcPhysical = MWPC5.GetEnvelope();
208 log << MSG::INFO <<
" Create BPC 1&2 " <<
endmsg;
210 BPCConstruction BPC (
false);
211 PVLink BPCPhysical = BPC.GetEnvelope();
212 for(
int i=1;
i<3; ++
i) {