9 #include "GeoModelKernel/GeoElement.h"
10 #include "GeoModelKernel/GeoMaterial.h"
11 #include "GeoModelKernel/GeoFullPhysVol.h"
12 #include "GeoModelKernel/GeoVFullPhysVol.h"
13 #include "GeoModelKernel/GeoPhysVol.h"
14 #include "GeoModelKernel/GeoVPhysVol.h"
15 #include "GeoModelKernel/GeoLogVol.h"
16 #include "GeoModelKernel/GeoBox.h"
17 #include "GeoModelKernel/GeoTubs.h"
18 #include "GeoModelKernel/GeoTube.h"
19 #include "GeoModelKernel/GeoNameTag.h"
20 #include "GeoModelKernel/GeoTransform.h"
21 #include "GeoModelKernel/GeoSerialDenominator.h"
22 #include "GeoModelKernel/GeoSerialIdentifier.h"
23 #include "GeoModelKernel/GeoSerialTransformer.h"
24 #include "GeoModelKernel/GeoAlignableTransform.h"
25 #include "GeoModelKernel/GeoIdentifierTag.h"
26 #include "GeoModelKernel/GeoDefinitions.h"
29 #include "GeoModelKernel/GeoShapeUnion.h"
30 #include "GeoModelKernel/GeoShapeShift.h"
32 #include "GeoGenericFunctions/Variable.h"
39 #include "GaudiKernel/MsgStream.h"
40 #include "GaudiKernel/Bootstrap.h"
41 #include "GaudiKernel/SystemOfUnits.h"
48 :m_H62004FrontBeamPhysical(nullptr),
49 m_detectorManager(nullptr)
62 if (m_H62004FrontBeamPhysical)
return m_H62004FrontBeamPhysical;
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 );
138 m_H62004FrontBeamPhysical =
new GeoPhysVol(H62004FrontBeamLogical);
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++ ) {
179 m_H62004FrontBeamPhysical->add(
new GeoIdentifierTag(
i+1) );
180 m_H62004FrontBeamPhysical->add(
new GeoTransform( GeoTrf::Translate3D( 0.*
Gaudi::Units::cm, 0.*
Gaudi::Units::cm, (v_ScintZ[
i ]-bard_z) ) ) ) ; m_H62004FrontBeamPhysical->add(
new GeoNameTag(ScintName) );
183 case 0:
case 1: { m_H62004FrontBeamPhysical->add( WScintPhysical );
break; }
184 case 2: { m_H62004FrontBeamPhysical->add( BScintPhysical );
break; }
185 default: {
throw std::runtime_error(
"H62004FrontBeam wants too many Scintillators!!");
break; }
194 log << MSG::INFO <<
" Create MWPC5 " <<
endmsg;
201 m_H62004FrontBeamPhysical->add(
new GeoIdentifierTag(5) );
203 m_H62004FrontBeamPhysical->add( MwpcPhysical );
208 log << MSG::INFO <<
" Create BPC 1&2 " <<
endmsg;
212 for(
int i=1;
i<3; ++
i) {
213 m_H62004FrontBeamPhysical->add(
new GeoIdentifierTag(
i) );
215 m_H62004FrontBeamPhysical->add(BPCPhysical);
221 return m_H62004FrontBeamPhysical;