8 #include "GeoModelKernel/GeoElement.h"
9 #include "GeoModelKernel/GeoMaterial.h"
10 #include "GeoModelKernel/GeoFullPhysVol.h"
11 #include "GeoModelKernel/GeoVFullPhysVol.h"
12 #include "GeoModelKernel/GeoPhysVol.h"
13 #include "GeoModelKernel/GeoVPhysVol.h"
14 #include "GeoModelKernel/GeoLogVol.h"
15 #include "GeoModelKernel/GeoBox.h"
16 #include "GeoModelKernel/GeoTubs.h"
17 #include "GeoModelKernel/GeoTube.h"
18 #include "GeoModelKernel/GeoNameTag.h"
19 #include "GeoModelKernel/GeoTransform.h"
20 #include "GeoModelKernel/GeoSerialDenominator.h"
21 #include "GeoModelKernel/GeoSerialIdentifier.h"
22 #include "GeoModelKernel/GeoSerialTransformer.h"
23 #include "GeoModelKernel/GeoAlignableTransform.h"
24 #include "GeoModelKernel/GeoIdentifierTag.h"
25 #include "GeoModelKernel/GeoDefinitions.h"
28 #include "GeoModelKernel/GeoShapeUnion.h"
29 #include "GeoModelKernel/GeoShapeShift.h"
30 #include "GeoGenericFunctions/Variable.h"
39 #include "GaudiKernel/MsgStream.h"
40 #include "GaudiKernel/Bootstrap.h"
41 #include "GaudiKernel/SystemOfUnits.h"
48 : m_H62002FrontBeamPhysical(nullptr)
61 if (m_H62002FrontBeamPhysical)
return m_H62002FrontBeamPhysical;
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 );
146 m_H62002FrontBeamPhysical =
new GeoPhysVol(H62002FrontBeamLogical);
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++ ) {
191 m_H62002FrontBeamPhysical->add(
new GeoIdentifierTag(
i) );
192 m_H62002FrontBeamPhysical->add(
new GeoTransform( GeoTrf::Translate3D( 0.*
Gaudi::Units::cm, 0.*
Gaudi::Units::cm, (v_ScintZ[
i ]-H62002FrontBeamZ) ) ) ) ; m_H62002FrontBeamPhysical->add(
new GeoNameTag(ScintName) );
195 case 0:
case 1: { m_H62002FrontBeamPhysical->add( WScintPhysical );
break; }
196 case 2: { m_H62002FrontBeamPhysical->add( BScintPhysical );
break; }
197 default: {
throw std::runtime_error(
"H62002FrontBeam wants too many Scintillators!!");
break; }
210 PVLink mwpcEnvelope = mwpcXConstruction.
GetEnvelope();
211 m_H62002FrontBeamPhysical->add(
new GeoIdentifierTag(5));
213 m_H62002FrontBeamPhysical->add(mwpcEnvelope);
222 return m_H62002FrontBeamPhysical;