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/GeoSerialIdentifier.h"
22 #include "GeoModelKernel/GeoSerialTransformer.h"
23 #include "GeoModelKernel/GeoAlignableTransform.h"
24 #include "GeoModelKernel/GeoIdentifierTag.h"
25 #include "GeoModelKernel/GeoSerialDenominator.h"
26 #include "GeoModelKernel/GeoDefinitions.h"
29 #include "GeoModelKernel/GeoShapeSubtraction.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_H62004MovableTablePhysical(nullptr),
49 m_detectorManager(nullptr)
62 if (m_H62004MovableTablePhysical)
return m_H62004MovableTablePhysical;
66 ISvcLocator *svcLocator = Gaudi::svcLocator();
69 sc = svcLocator->service(
"MessageSvc",
msgSvc,
true );
70 if (
sc==StatusCode::FAILURE) {
71 throw std::runtime_error(
"Error in MovableTableConstructionH62004, cannot access MessageSvc");
74 MsgStream
log(
msgSvc,
"LArGeo::MovableTableConstructionH62004");
75 log << MSG::INFO <<
"+ HELLO from LArGeo::MovableTableConstructionH62004 +" <<
endmsg;
79 sc=svcLocator->service(
"DetectorStore",
detStore,
false );
80 if (
sc==StatusCode::FAILURE) {
81 throw std::runtime_error(
"Error in MovableTableConstructionH62004, 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 MovableTableConstructionH62004, std::Air is not found.");
103 const GeoMaterial *Scint = materialManager->
getMaterial(
"std::Polystyrene");
104 if (!Scint)
throw std::runtime_error(
"Error in MovableTableConstructionH62004, std::Polystyrene is not found.");
116 std::string baseName =
"LAr::TBH62004";
117 std::string H62004MovableName = baseName +
"::MovableTable";
142 GeoBox* H62004MovableShape =
new GeoBox( bttb_x, bttb_y, bttb_z );
143 const GeoLogVol* H62004FrontBeamLogical =
new GeoLogVol( H62004MovableName, H62004MovableShape, Air );
145 m_H62004MovableTablePhysical =
new GeoPhysVol(H62004FrontBeamLogical);
158 log << MSG::INFO <<
"Create Movable Scintillators ..." <<
endmsg;
163 GeoBox* ScintShapeS23 =
new GeoBox(btas_x/2., btas_y/2., btas_z/2.);
164 std::string ScintName = H62004MovableName +
"::Scintillator";
165 GeoLogVol* S1ScintLogical =
new GeoLogVol( ScintName, ScintShapeS1, Scint );
166 GeoLogVol* S23ScintLogical =
new GeoLogVol( ScintName, ScintShapeS23, Scint );
167 GeoIntrusivePtr<GeoPhysVol> S1ScintPhysical =
new GeoPhysVol( S1ScintLogical );
168 GeoIntrusivePtr<GeoPhysVol> S2ScintPhysical =
new GeoPhysVol( S23ScintLogical );
170 m_H62004MovableTablePhysical->add(
new GeoIdentifierTag(4) );
172 m_H62004MovableTablePhysical->add(S1ScintPhysical);
173 for (
unsigned int i = 1;
i <3; ++
i ) {
174 m_H62004MovableTablePhysical->add(
new GeoIdentifierTag(
i+5) );
176 m_H62004MovableTablePhysical->add( S2ScintPhysical );
179 GeoBox* boxH =
new GeoBox(bh_x/2., bh_x/2., btas_z/2.);
180 GeoTubs* tubH =
new GeoTubs(0., bh_d/2., btas_z/2., 0., 2*
M_PI);
181 const GeoShapeSubtraction &shapeHSc = (*boxH).subtract(*tubH);
182 GeoLogVol* logHSc =
new GeoLogVol( ScintName, &shapeHSc, Scint);
183 GeoIntrusivePtr<GeoPhysVol> physHSc =
new GeoPhysVol(logHSc);
184 m_H62004MovableTablePhysical->add(
new GeoIdentifierTag(5) );
186 m_H62004MovableTablePhysical->add(physHSc);
188 GeoBox* boxB =
new GeoBox(bb2_x/2., bb2_x/2., (btas_z+2.5*
Gaudi::Units::cm)/2.);
189 GeoLogVol* logBSc =
new GeoLogVol( ScintName, boxB, Scint);
190 GeoIntrusivePtr<GeoPhysVol> physBSc =
new GeoPhysVol(logBSc);
191 m_H62004MovableTablePhysical->add(
new GeoIdentifierTag(8) );
193 m_H62004MovableTablePhysical->add(physBSc);
198 log << MSG::INFO <<
" Create MWPC's " <<
endmsg;
203 for(
int i = 1;
i < 4; ++
i){
204 m_H62004MovableTablePhysical->add(
new GeoIdentifierTag(
i+1) );
206 m_H62004MovableTablePhysical->add( MwpcPhysical );
211 log << MSG::INFO <<
" Create BPC 5&6 " <<
endmsg;
215 for(
int i=1;
i<3; ++
i) {
216 m_H62004MovableTablePhysical->add(
new GeoIdentifierTag(7-
i) );
218 m_H62004MovableTablePhysical->add(BPCPhysical);
224 return m_H62004MovableTablePhysical;