20 #include <Geant4/G4Cons.hh>
21 #include <Geant4/G4DisplacedSolid.hh>
22 #include <Geant4/G4IntersectionSolid.hh>
23 #include <Geant4/G4LogicalSkinSurface.hh>
24 #include <Geant4/G4LogicalVolume.hh>
25 #include <Geant4/G4Material.hh>
26 #include <Geant4/G4MaterialPropertiesTable.hh>
27 #include <Geant4/G4OpticalSurface.hh>
28 #include <Geant4/G4Orb.hh>
29 #include <Geant4/G4PVPlacement.hh>
30 #include <Geant4/G4PhysicalConstants.hh>
31 #include <Geant4/G4Sphere.hh>
32 #include <Geant4/G4String.hh>
33 #include <Geant4/G4SubtractionSolid.hh>
34 #include <Geant4/G4SurfaceProperty.hh>
35 #include <Geant4/G4SystemOfUnits.hh>
36 #include <Geant4/G4ThreeVector.hh>
37 #include <Geant4/G4Transform3D.hh>
38 #include <Geant4/G4Tubs.hh>
39 #include <Geant4/G4Types.hh>
40 #include <Geant4/G4VPhysicalVolume.hh>
41 #include <Geant4/G4NistManager.hh>
48 #include <boost/stacktrace.hpp>
53 using namespace ePHENIXRICH;
57 , overlapcheck_rich(
false)
64 , overlapcheck_rich(
false)
72 std::cout <<
"ePHENIXRICHConstruction::RegisterVolume - Error - invalid volume!"
78 std::cout <<
"ePHENIXRICHConstruction::RegisterVolume - Warning - replacing "
79 << v->GetName() << std::endl;
91 std::cout <<
"ePHENIXRICHConstruction::RegisterPhysicalVolume - Error - invalid volume!"
100 std::cout <<
"ePHENIXRICHConstruction::RegisterPhysicalVolume - Warning - replacing "
101 << v->GetName() <<
"[" << v->GetCopyNo() <<
"]" << std::endl;
112 G4VSolid *RICHOutSphereBoundary =
new G4Orb(
"RICHOutSphereBoundary",
114 G4VSolid *RICHOutSphereBoundary_place =
new G4DisplacedSolid(
"RICHOutSphereBoundary_place", RICHOutSphereBoundary, 0,
117 G4VSolid *RICHInnerSphereBoundary =
new G4Orb(
"RICHInnerSphereBoundary",
119 G4VSolid *RICHInnerSphereBoundary_place =
new G4DisplacedSolid(
"RICHInnerSphereBoundary_place",
120 RICHInnerSphereBoundary,
126 G4VSolid *RICHConeBoundary =
new G4Cons(
"RICHConeBoundary",
134 G4VSolid *RICHConeBoundary_place =
new G4DisplacedSolid(
"RICHConeBoundary_place",
142 G4VSolid *RICHSecBoundary =
new G4Tubs(
"RICHSecBoundary",
150 G4VSolid *RICHSphereBoundary =
new G4SubtractionSolid(
"RICHSphereBoundary",
151 RICHOutSphereBoundary_place, RICHInnerSphereBoundary_place);
155 G4VSolid *RICHSecBox_ConeSec =
new G4IntersectionSolid(
"RICHSecBox_ConeSec",
156 RICHSecBoundary, RICHConeBoundary_place);
159 G4VSolid *RICHSecBox =
new G4IntersectionSolid(
"RICHSecBox",
160 RICHSecBox_ConeSec, RICHSphereBoundary);
162 G4LogicalVolume *RICHSecLog =
new G4LogicalVolume(RICHSecBox,
184 G4VSolid *RICHMirrorSphereBoundary =
new G4Sphere(
"RICHMirrorSphereBoundary",
190 G4VSolid *RICHMirrorSphereBoundary_place =
new G4DisplacedSolid(
"RICHMirrorSphereBoundary_place", RICHMirrorSphereBoundary, 0,
192 G4VSolid *RICHMirror =
new G4IntersectionSolid(
"RICHMirror",
193 RICHSecBox_ConeSec, RICHMirrorSphereBoundary_place);
194 G4LogicalVolume *RICHMirrorLog =
new G4LogicalVolume(RICHMirror,
203 G4LogicalSkinSurface *RICHMirrorSurface =
new G4LogicalSkinSurface(
"RICHMirrorSurface",
206 RICHMirrorSurface->GetName();
211 G4VSolid *RICHBackWindowSphereBoundary =
new G4Sphere(
"RICHBackWindowSphereBoundary",
217 G4VSolid *RICHBackWindowSphereBoundary_place =
new G4DisplacedSolid(
"RICHBackWindowSphereBoundary_place", RICHBackWindowSphereBoundary,
219 G4VSolid *RICHBackWindow =
new G4IntersectionSolid(
"RICHBackWindow",
220 RICHSecBox_ConeSec, RICHBackWindowSphereBoundary_place);
221 G4LogicalVolume *RICHBackWindowLog =
new G4LogicalVolume(RICHBackWindow,
223 "RICHBackWindowLog");
231 G4VSolid *RICHFrontWindowSphereBoundary =
new G4Sphere(
"RICHFrontWindowSphereBoundary",
237 G4VSolid *RICHFrontWindowSphereBoundary_place =
new G4DisplacedSolid(
"RICHFrontWindowSphereBoundary_place",
238 RICHFrontWindowSphereBoundary,
243 G4VSolid *RICHFrontWindow =
new G4IntersectionSolid(
"RICHFrontWindow",
244 RICHSecBox_ConeSec, RICHFrontWindowSphereBoundary_place);
245 G4LogicalVolume *RICHFrontWindowLog =
new G4LogicalVolume(RICHFrontWindow,
247 "RICHFrontWindowLog");
283 G4VSolid *RICHHBDBox =
new G4Cons(
"RICHHBDBox",
290 G4LogicalVolume *RICHHBDLog =
new G4LogicalVolume(RICHHBDBox,
305 double current_z = -HBD_thickness / 2;
311 current_z += 0.003 *
cm;
315 G4LogicalSkinSurface *RICHPhotocathodeSurface;
321 current_z += 0.15 *
cm;
323 for (
int gem = 1; gem <= n_GEM_layers; gem++)
330 G4String(
"GEMFrontCu") + G4String(sid.str()),
"G4_Cu",
331 current_z, 0.0005 *
cm * 64
e-2);
332 current_z += 0.0005 *
cm;
338 RICHPhotocathodeSurface->GetName();
343 G4String(
"GEMKapton") + G4String(sid.str()),
"G4_KAPTON",
344 current_z, 0.005 *
cm * 64
e-2);
345 current_z += 0.005 *
cm;
349 G4String(
"GEMBackCu") + G4String(sid.str()),
"G4_Cu", current_z,
350 0.0005 *
cm * 64
e-2);
351 current_z += 0.0005 *
cm;
355 G4String(
"Frame") + G4String(sid.str()),
"G10", current_z,
357 current_z += 0.15 *
cm;
362 current_z, 0.005 *
cm * 100
e-2);
363 current_z += 0.005 *
cm;
367 0.0005 *
cm * 80
e-2);
368 current_z += 0.0005 *
cm;
372 0.025 * 2 *
cm * 100
e-2);
373 current_z += 0.025 * 2 *
cm;
382 current_z += 0.05 *
cm;
384 0.001 *
cm * 100
e-2);
385 current_z += 0.001 *
cm;
390 0.0005 *
cm * 100
e-2);
391 current_z += 0.0005 *
cm;
393 assert(current_z < HBD_thickness / 2);
401 const G4String
name,
const G4String
material,
const double start_z,
404 G4VSolid *
box =
new G4Cons(G4String(
"RICHHBD") + name + G4String(
"Box"),
411 G4LogicalVolume *Log =
new G4LogicalVolume(box,
413 G4String(
"RICHHBD") + name + G4String(
"Log"));
417 G4String(
"RICHHBD") + name + G4String(
"Physical"), RICHHBDLog,
456 G4double pp[NUM] = {2.038 *
eV, 4.144 *
eV};
457 G4double rindex[NUM] = {1.4, 1.4};
458 G4double reflectivity[NUM] = {1.0, 1.0};
459 G4double efficiency[NUM] = {0.0, 0.0};
461 G4MaterialPropertiesTable *RICH_Mirror_OpticalSurface_SMPT =
new G4MaterialPropertiesTable();
463 RICH_Mirror_OpticalSurface_SMPT->AddProperty(
"RINDEX", pp, rindex, NUM);
464 RICH_Mirror_OpticalSurface_SMPT->AddProperty(
"REFLECTIVITY", pp, reflectivity, NUM);
465 RICH_Mirror_OpticalSurface_SMPT->AddProperty(
"EFFICIENCY", pp, efficiency, NUM);
475 G4double photocath_EPHOTON[2] = {1., 1000.};
476 G4double photocath_EFF[2] = {1., 1.};
477 G4double photocath_REFL[2] = {0., 0.};
479 G4MaterialPropertiesTable *RICH_Photocathode_OpticalSurface_MPT =
new G4MaterialPropertiesTable();
480 RICH_Photocathode_OpticalSurface_MPT->AddProperty(
"EFFICIENCY", photocath_EPHOTON, photocath_EFF, 2);
481 RICH_Photocathode_OpticalSurface_MPT->AddProperty(
"REFLECTIVITY", photocath_EPHOTON, photocath_REFL, 2);
532 return volume->GetCopyNo();
540 G4Material *thismaterial = G4Material::GetMaterial(name,
false);
545 thismaterial = G4NistManager::Instance()->FindOrBuildMaterial(name);
552 std::cout <<
"PHG4Detector::GetDetectorMaterial: Could not locate " << name <<
" in NIST DB or create it" << std::endl;
553 std::cout << boost::stacktrace::stacktrace();
554 std::cout << std::endl;
555 std::cout <<
"read the above stack trace who is calling this material" << std::endl;