#include "DetectorConstruction.hh" #include "SensitiveDetector.hh" #include "CollSD.hh" #include "G4Material.hh" #include "G4Box.hh" #include "G4LogicalVolume.hh" #include "G4PVPlacement.hh" #include "G4UniformMagField.hh" #include "G4PVReplica.hh" #include "G4GeometryManager.hh" #include "G4PhysicalVolumeStore.hh" #include "G4LogicalVolumeStore.hh" #include "G4SolidStore.hh" #include "G4Tubs.hh" #include "G4EmSaturation.hh" #include "G4NistManager.hh" #include "G4UnitsTable.hh" #include "G4LossTableManager.hh" #include "G4Region.hh" #include "G4SDManager.hh" #include "G4VisAttributes.hh" #include "G4Colour.hh" #include "G4Polyhedra.hh" #include "G4SubtractionSolid.hh" #include "G4TransportationManager.hh" #include "G4RunManager.hh" #include "G4PhysicalConstants.hh" #include "G4SystemOfUnits.hh" #include "G4UserLimits.hh" #include #include #include DetectorConstruction::DetectorConstruction() { DefineMaterials(); } DetectorConstruction::~DetectorConstruction() {} G4VPhysicalVolume* DetectorConstruction::Construct() { return ConstructVolumes(); } void DetectorConstruction::DefineMaterials() { // define Elements G4double z, a; G4Element* H = new G4Element("Hydrogen", "H", z= 1, a= 1.008*CLHEP::g/CLHEP::mole); G4Element* Li = new G4Element("Lithium","Li", z = 3., a = 6.941 *CLHEP::g/CLHEP::mole); G4Element* B = new G4Element("Boron", "B", z = 5., a = 10.81*CLHEP::g/CLHEP::mole); G4Element* C = new G4Element("Carbon", "C" , z = 6., a = 12.01*CLHEP::g/CLHEP::mole); G4Element* N = new G4Element("Nitrogen","N" , z = 7., a = 14.01*CLHEP::g/CLHEP::mole); G4Element* O = new G4Element("Oxygen" , "O", z= 8, a= 16.00*CLHEP::g/CLHEP::mole); G4Element* Na = new G4Element("Sodium" ,"Na", z = 11., a = 22.99*CLHEP::g/CLHEP::mole); G4Element* Mg = new G4Element("Magnesium","Mg", z = 12., a = 24.305*CLHEP::g/CLHEP::mole); G4Element* Al = new G4Element("Aluminium","Al", z = 13., a = 26.98*CLHEP::g/CLHEP::mole); G4Element* Si = new G4Element("Silicon","Si" , z = 14., a = 28.09*CLHEP::g/CLHEP::mole); G4Element* Ar = new G4Element("Argon", "Ar", z = 18., a = 39.948 *CLHEP::g/CLHEP::mole); G4Element* Ca = new G4Element("Calcium","Ca", z = 20., a = 40.08*CLHEP::g/CLHEP::mole); G4Element* Fe = new G4Element("Iron","Fe", z = 26., a = 55.85*CLHEP::g/CLHEP::mole); G4Element* Co = new G4Element("Cobalt","Co", z = 27., a = 58.933 *CLHEP::g/CLHEP::mole); G4Element* Cu = new G4Element("Copper","Cu", z = 29., a = 63.546 *CLHEP::g/CLHEP::mole); G4Element* Zn = new G4Element("Zinc","Zn", z = 30., a = 65.38*CLHEP::g/CLHEP::mole); G4Element* Eu = new G4Element("Europium","Eu", z = 63., a = 151.964 *CLHEP::g/CLHEP::mole); G4Element* Cs = new G4Element("Caesium","Cs", z = 55., a = 132.905 *CLHEP::g/CLHEP::mole); G4Element* W = new G4Element("Tungsten","W", z = 74., a = 183.84 *CLHEP::g/CLHEP::mole); // define Materials G4double density, temperature, pressure; G4int natoms, ncomponents; G4double fractionmass; G4Material* H2O = new G4Material("Water", density= 1.0*g/cm3, ncomponents=2); H2O->AddElement(H, natoms=2); H2O->AddElement(O, natoms=1); H2O->GetIonisation()->SetMeanExcitationEnergy(78.0*eV); density = universe_mean_density; //from PhysicalConstants.h pressure = 3.e-18*pascal; temperature = 2.73*kelvin; G4Material* vacuum = new G4Material("Galactic",z= 1,a= 1.008*g/mole,density, kStateGas,temperature,pressure); G4Material* Air = new G4Material("Air" , density= 1.290*CLHEP::mg/CLHEP::cm3, ncomponents=3); Air->AddElement(N, fractionmass=0.7810); Air->AddElement(O, fractionmass=0.2096); Air->AddElement(Ar, fractionmass=0.0094); G4Material* Brass = new G4Material("Brass", density= 8.75*CLHEP::g/CLHEP::cm3, ncomponents=2); Brass->AddElement(Cu, fractionmass= 0.7); Brass->AddElement(Zn, fractionmass= 0.3); G4Material* MarbleConcrete = new G4Material("MarbleConcrete", density=2.7*CLHEP::g/CLHEP::cm3, ncomponents=12); MarbleConcrete->AddElement(O, fractionmass = 0.375); MarbleConcrete->AddElement(C, fractionmass = 0.105); MarbleConcrete->AddElement(Mg, fractionmass = 0.003); MarbleConcrete->AddElement(Al, fractionmass = 0.007); MarbleConcrete->AddElement(Si, fractionmass = 0.024); MarbleConcrete->AddElement(Ca, fractionmass = 0.473942); MarbleConcrete->AddElement(Fe, fractionmass = 0.01); MarbleConcrete->AddElement(Na, fractionmass = 0.002); MarbleConcrete->AddElement(Li, fractionmass = 0.000037); MarbleConcrete->AddElement(Cs, fractionmass = 0.000002); MarbleConcrete->AddElement(Co, fractionmass = 0.000018); MarbleConcrete->AddElement(Eu, fractionmass = 0.000001); G4Material* Al_mat = new G4Material("Aluminium", density= 2.7*CLHEP::g/CLHEP::cm3, ncomponents=1); Al_mat->AddElement(Al, fractionmass= 1); G4Material* Iron_mat = new G4Material("Iron", density = 7.874*CLHEP::g/CLHEP::cm3, ncomponents=1); Iron_mat->AddElement(Fe, fractionmass=1); G4Material* Myl = new G4Material("Mylar", density= 1.397*CLHEP::g/CLHEP::cm3, ncomponents=3); Myl->AddElement(C, natoms=10); Myl->AddElement(H, natoms= 8); Myl->AddElement(O, natoms= 4); G4Material* Kapton = new G4Material("Kapton", density= 1.42*CLHEP::g/CLHEP::cm3, ncomponents=4); Kapton->AddElement(H, fractionmass= .027); Kapton->AddElement(C, fractionmass= .691); Kapton->AddElement(N, fractionmass= .073); Kapton->AddElement(O, fractionmass= .209); G4Material* Tungsten_mat = new G4Material("Tungsten", density= 19.25*CLHEP::g/CLHEP::cm3, ncomponents=1); Tungsten_mat->AddElement(W, fractionmass=1); G4Material* PMMA = new G4Material("PMMA", density = 1.18*CLHEP::g/CLHEP::cm3, ncomponents = 3); PMMA->AddElement(C, natoms = 5); PMMA->AddElement(O, natoms = 2); PMMA->AddElement(H, natoms = 8); //Borated plastic (5% borated polyethylene) G4Material* BoratedPlastic = new G4Material("BoratedPlastic", density = 1.04*CLHEP::g/CLHEP::cm3, ncomponents = 3); BoratedPlastic->AddElement(B, fractionmass = 0.05); BoratedPlastic->AddElement(C, fractionmass = 0.317); BoratedPlastic->AddElement(H, fractionmass = 0.633); // Materials list defaultMaterial = Air; vacMaterial = vacuum; waterMaterial = H2O; brassMaterial = Brass; marbleMaterial = MarbleConcrete; alMaterial = Al_mat; mylMaterial = Myl; kaptonMaterial = Kapton; tungstenMaterial = Tungsten_mat; ironMaterial = Iron_mat; PMMAmaterial = PMMA; borPlasticMaterial = BoratedPlastic; } G4VPhysicalVolume* DetectorConstruction::ConstructVolumes() { G4GeometryManager::GetInstance()->OpenGeometry(); G4PhysicalVolumeStore::GetInstance()->Clean(); G4LogicalVolumeStore::GetInstance()->Clean(); G4SolidStore::GetInstance()->Clean(); G4bool checkOverlaps = true; G4double startAngle = 0; G4double spanningAngle = 2*CLHEP::pi; // oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000 // World solidWorld = new G4Box("World",945*CLHEP::cm/2, 445*CLHEP::cm/2, 945*CLHEP::cm/2); logicWorld = new G4LogicalVolume(solidWorld,defaultMaterial,"World"); physiWorld = new G4PVPlacement(0, G4ThreeVector(), logicWorld, "World", 0, false, 0); // Simple concrete box, to recreate scatter from ceiling, floor and walls. solidRoomOuter = new G4Box("Walls", 815*CLHEP::cm/2, 355*CLHEP::cm/2, 855*CLHEP::cm/2); logicRoomOuter = new G4LogicalVolume(solidRoomOuter, marbleMaterial, "Walls"); physiRoomOuter = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::mm, 0.*CLHEP::mm, 0.*CLHEP::mm), //centred in world volume logicRoomOuter, "Walls", logicWorld, false, 0, checkOverlaps); // Air in the room solidRoomInner = new G4Box("Inner Room", 800*CLHEP::cm/2, 340*CLHEP::cm/2, 840*CLHEP::cm/2); logicRoomInner = new G4LogicalVolume(solidRoomInner, defaultMaterial, "Inner Room"); physiRoomInner = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::mm, 0.*CLHEP::mm, 0.*CLHEP::cm), //centred in RoomOuter volume logicRoomInner, "Inner Room", logicRoomOuter, false, 0, checkOverlaps); // oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000 //First Aluminium tube solidAlTubeOuter1 = new G4Tubs("AlTubeOuter1", 0*CLHEP::cm, 3.8*CLHEP::cm, 35.6*CLHEP::cm/2, startAngle, spanningAngle); logicAlTubeOuter1 = new G4LogicalVolume(solidAlTubeOuter1, alMaterial, "AlTubeOuter1"); physiAlTubeOuter1 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::mm, 0.*CLHEP::mm, -402.2*CLHEP::cm), //(35.6/2)-420 logicAlTubeOuter1, "AlTubeOuter1", logicRoomInner, false, 0, checkOverlaps); // Beamline is created with respect to room as the mother volume, its height isn't accurate (central) // Inner vacuum of the Al tube solidAlTubeInner1 = new G4Tubs("AlTubeInner1", 0*CLHEP::cm, 3.6*CLHEP::cm, 35.6*CLHEP::cm/2, startAngle, spanningAngle); logicAlTubeInner1 = new G4LogicalVolume(solidAlTubeInner1, vacMaterial, "AlTubeInner1"); physiAlTubeInner1 = new G4PVPlacement(0, G4ThreeVector(), // centred in AlTubeOuter1 logicAlTubeInner1, "AlTubeInner1", logicAlTubeOuter1, false, 0, checkOverlaps); // first collimator solidCollimator1 = new G4Tubs("Collimator1", 0.3*CLHEP::cm, 3.6*CLHEP::cm, 1*CLHEP::cm/2, startAngle, spanningAngle); logicCollimator1 = new G4LogicalVolume(solidCollimator1, brassMaterial, "Collimator1"); physiCollimator1 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::mm, 0.*CLHEP::mm, -12.3*CLHEP::cm), // relative to mother -35.6/2 + 5 + 1/2 logicCollimator1, "Collimator1", logicAlTubeInner1, false, 0, checkOverlaps); // first scatter foil solidScatterFoil1 = new G4Tubs("ScatterFoil1", 0*CLHEP::cm, 3.6*CLHEP::cm, 0.0025*CLHEP::cm/2, startAngle, spanningAngle); logicScatterFoil1 = new G4LogicalVolume(solidScatterFoil1, tungstenMaterial, "ScatterFoil1"); physiScatterFoil1 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::mm, 0.*CLHEP::mm, -9.79875*CLHEP::cm ), // relative to mother -35.6/2 + 8 + 0.0025/2 logicScatterFoil1, "ScatterFoil1", logicAlTubeInner1, false, 0, checkOverlaps); // beam stopper solidStopper = new G4Tubs("Stopper", 0*CLHEP::cm, 0.2855*CLHEP::cm, 0.66*CLHEP::cm/2, startAngle, spanningAngle); logicStopper= new G4LogicalVolume(solidStopper, brassMaterial, "Stopper"); physiStopper = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::mm, 0.*CLHEP::mm, 12.53*CLHEP::cm), // -35.6/2 + 30 + 0.66/2 logicStopper, "Stopper", logicAlTubeInner1, false, 0, checkOverlaps); // second scatter foil solidScatterFoil2 = new G4Tubs("ScatterFoil2", 0*CLHEP::cm, 3.6*CLHEP::cm, 0.0025*CLHEP::cm/2, startAngle, spanningAngle); logicScatterFoil2 = new G4LogicalVolume(solidScatterFoil2, tungstenMaterial, "ScatterFoil2"); physiScatterFoil2 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::mm, 0.*CLHEP::mm, 12.86125*CLHEP::cm ), // -35.6/2 + 30.66 + 0.0025/2 logicScatterFoil2, "ScatterFoil2", logicAlTubeInner1, false, 0, checkOverlaps); // Kapton Window solidKapton = new G4Tubs("Kapton", 0*CLHEP::cm, 3.6*CLHEP::cm, 0.005*CLHEP::cm/2, startAngle, spanningAngle); logicKapton= new G4LogicalVolume(solidKapton, kaptonMaterial, "Kapton"); physiKapton = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -384.3975*CLHEP::cm), // 35.6 + 0.005/2 -420 logicKapton, "Kapton", logicRoomInner, false, 0, checkOverlaps); // oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000 // First Aluminium box solidAlBoxOuter1 = new G4Box("AlBoxOuter1", 20*CLHEP::cm/2, 20*CLHEP::cm/2, 20*CLHEP::cm/2); logicAlBoxOuter1= new G4LogicalVolume(solidAlBoxOuter1, alMaterial, "AlBoxOuter1"); physiAlBoxOuter1 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -365*CLHEP::cm), // -420 + 55 (midpoint of AlBox1) logicAlBoxOuter1, "AlBoxOuter1", logicRoomInner, false, 0, checkOverlaps); // Air in box solidAlBoxInner1 = new G4Box("AlBoxInner1", 16*CLHEP::cm/2, 16*CLHEP::cm/2, 16*CLHEP::cm/2); logicAlBoxInner1= new G4LogicalVolume(solidAlBoxInner1, defaultMaterial, "AlBoxInner1"); physiAlBoxInner1 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::mm, 0.*CLHEP::cm, 0.*CLHEP::cm ), logicAlBoxInner1, "AlBoxInner1", logicAlBoxOuter1, false, 0, checkOverlaps); // holes in box for beamline solidAlBoxHole1 = new G4Tubs("AlBoxHole1", 0*CLHEP::cm, 3.6*CLHEP::cm, 1*CLHEP::cm, startAngle, spanningAngle); logicAlBoxHole1 = new G4LogicalVolume(solidAlBoxHole1, defaultMaterial, "AlBoxHole1"); physiAlBoxHole1 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::mm, 0.*CLHEP::mm, -9*CLHEP::cm), //placed between inner and outer box volumes logicAlBoxHole1, "AlBoxHole1", logicAlBoxOuter1, false, 0, checkOverlaps); solidAlBoxHole2 = new G4Tubs("AlBoxHole2", 0*CLHEP::cm, 3.6*CLHEP::cm, 1*CLHEP::cm, startAngle, spanningAngle); logicAlBoxHole2 = new G4LogicalVolume(solidAlBoxHole2, defaultMaterial, "AlBoxHole2"); physiAlBoxHole2 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::mm, 0.*CLHEP::mm, 9*CLHEP::cm), logicAlBoxHole2, "AlBoxHole2", logicAlBoxOuter1, false, 0, checkOverlaps); //Iron block after Aluminium Box 1 solidIronBlockOuter = new G4Box("IronBlockOuter", 22*CLHEP::cm/2, 21*CLHEP::cm/2, 2.5*CLHEP::cm/2); solidIronBlockInner = new G4Tubs("IronBlockInner", 0*CLHEP::cm, 3.8*CLHEP::cm/2, 2.5*CLHEP::cm/2, startAngle, spanningAngle); solidIronBlock = new G4SubtractionSolid("IronBlock", solidIronBlockOuter, solidIronBlockInner); logicIronBlock = new G4LogicalVolume(solidIronBlock, ironMaterial, "IronBlock"); physiIronBlock = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -353.75*CLHEP::cm), logicIronBlock, "IronBlock", logicRoomInner, false, 0, checkOverlaps); // oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000 // Second Aluminium tube solidAlTubeOut2 = new G4Tubs("AlTube2out", 0*CLHEP::cm, 3.8*CLHEP::cm, 45*CLHEP::cm/2, startAngle, spanningAngle); logicAlTubeOut2 = new G4LogicalVolume(solidAlTubeOut2, alMaterial, "AlTube2out"); physiAlTubeOut2 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -332.5*CLHEP::cm), logicAlTubeOut2, "AlTube2out", logicRoomInner, false, 0, checkOverlaps); solidAlTubeIn2 = new G4Tubs("AlTube2in", 0*CLHEP::cm, 3.6*CLHEP::cm, 45*CLHEP::cm/2, startAngle, spanningAngle); logicAlTubeIn2 = new G4LogicalVolume(solidAlTubeIn2, defaultMaterial, "AlTube2in"); physiAlTubeIn2 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, 0*CLHEP::cm), logicAlTubeIn2, "AlTube2in", logicAlTubeOut2, false, 0, checkOverlaps); //oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000 // Second Aluminium box solidAlBoxOuter2 = new G4Box("AlBoxOuter1", 20*CLHEP::cm/2, 20*CLHEP::cm/2, 59.2*CLHEP::cm/2); logicAlBoxOuter2= new G4LogicalVolume(solidAlBoxOuter2, alMaterial, "AlBoxOuter2"); physiAlBoxOuter2 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::mm, 0.*CLHEP::mm, 139.6*CLHEP::cm - 420*CLHEP::cm), // 110 to 169.2 cm from source logicAlBoxOuter2, "AlBoxOuter2", logicRoomInner, false, 0, checkOverlaps); // Inner air of box solidAlBoxInner2 = new G4Box("AlBoxInner2", 16*CLHEP::cm/2, 16*CLHEP::cm/2, 55.2*CLHEP::cm/2); logicAlBoxInner2= new G4LogicalVolume(solidAlBoxInner2, defaultMaterial, "AlBoxInner2"); physiAlBoxInner2 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::mm, 0.*CLHEP::mm, 0*CLHEP::cm), logicAlBoxInner2, "AlBoxInner2", logicAlBoxOuter2, false, 0, checkOverlaps); // Holes for beamline solidAlBoxHole3 = new G4Tubs("AlBoxHole3", 0*CLHEP::cm, 3.6*CLHEP::cm, 1*CLHEP::cm, startAngle, spanningAngle); logicAlBoxHole3 = new G4LogicalVolume(solidAlBoxHole3, defaultMaterial, "AlBoxHole3"); physiAlBoxHole3 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::mm, 0.*CLHEP::mm, -57.2*CLHEP::cm/2), logicAlBoxHole3, "AlBoxHole3", logicAlBoxOuter2, false, 0, checkOverlaps); solidAlBoxHole4 = new G4Tubs("AlBoxHole4", 0*CLHEP::cm, 1.7*CLHEP::cm, 1*CLHEP::cm, startAngle, spanningAngle); //changed from 3.6cm after Clatterbridge measurements, nozzle fits into box logicAlBoxHole4 = new G4LogicalVolume(solidAlBoxHole4, defaultMaterial, "AlBoxHole4"); physiAlBoxHole4 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::mm, 0.*CLHEP::mm, 57.2*CLHEP::cm/2), logicAlBoxHole4, "AlBoxHole4", logicAlBoxOuter2, false, 0, checkOverlaps); // First scatter collimator solidScatterCollimatorOuter = new G4Box("ScatterCollimatorOuter", 8*CLHEP::cm, 8*CLHEP::cm, 0.5*CLHEP::cm); solidScatterCollimatorInner = new G4Tubs("ScatterCollimatorInner", 0*CLHEP::cm, 2*CLHEP::cm, 1*CLHEP::cm/2, startAngle, spanningAngle); solidScatterCollimator1 = new G4SubtractionSolid("ScatterCollimator1", solidScatterCollimatorOuter, solidScatterCollimatorInner); logicScatterCollimator1 = new G4LogicalVolume(solidScatterCollimator1, brassMaterial, "ScatterCollimator1"); physiScatterCollimator1 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -26.1*CLHEP::cm), logicScatterCollimator1, "ScatterCollimator1", logicAlBoxInner2, false, 0, checkOverlaps); // oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000 // Dose monitors - two sheets of aluminium-backed mylar held together with perspex blocks //DOSE MONITOR 1 solidPerspexMonitorOuter1 = new G4Box("PerspexMonitorOuter1", 8*CLHEP::cm, 8*CLHEP::cm, 8*CLHEP::mm/2); solidPerspexMonitorOuterHole = new G4Tubs("PerspexMonitorOuterHole", 0*CLHEP::cm, 30*CLHEP::mm, 8*CLHEP::mm/2, startAngle, spanningAngle); solidPerspex1Monitor1 = new G4SubtractionSolid("Perspex1Monitor1", solidPerspexMonitorOuter1, solidPerspexMonitorOuterHole); logicPerspex1Monitor1 = new G4LogicalVolume(solidPerspex1Monitor1, PMMAmaterial, "Perspex1Monitor1"); physiPerspex1Monitor1 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -24.2*CLHEP::cm), logicPerspex1Monitor1, "Perspex1Monitor1", logicAlBoxInner2, false, 0, checkOverlaps); solidMylarMonitor1 = new G4Box("MylarMonitor1", 8*CLHEP::cm, 8*CLHEP::cm, 0.002*CLHEP::cm/2); logicMylarMonitor1 = new G4LogicalVolume(solidMylarMonitor1, mylMaterial, "MylarMonitor1"); physiMylarMonitor1 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -23.799*CLHEP::cm), logicMylarMonitor1, "MylarMonitor1", logicAlBoxInner2, false, 0, checkOverlaps); solidAlMonitor1 = new G4Box("AlMonitor1", 8*CLHEP::cm, 8*CLHEP::cm, 0.0004*CLHEP::cm/2); logicAlMonitor1 = new G4LogicalVolume(solidAlMonitor1, alMaterial, "AlMonitor1"); physiAlMonitor1 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -23.7988*CLHEP::cm), logicAlMonitor1, "AlMonitor1", logicAlBoxInner2, false, 0, checkOverlaps); solidGuardRing1 = new G4Tubs("GuardRing1", 3*CLHEP::cm, 8*CLHEP::cm, 1.6*CLHEP::mm/2, startAngle, spanningAngle); logicGuardRing1 = new G4LogicalVolume(solidGuardRing1, brassMaterial, "GuardRing1"); physiGuardRing1 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -23.7188*CLHEP::cm), logicGuardRing1, "GuardRing1", logicAlBoxInner2, false, 0, checkOverlaps); solidMylarMonitor2 = new G4Box("MylarMonitor2", 8*CLHEP::cm, 8*CLHEP::cm, 0.002*CLHEP::cm/2); logicMylarMonitor2 = new G4LogicalVolume(solidMylarMonitor2, mylMaterial, "MylarMonitor2"); physiMylarMonitor2 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -23.7178*CLHEP::cm), logicMylarMonitor2, "MylarMonitor2", logicAlBoxInner2, false, 0, checkOverlaps); solidAlMonitor2 = new G4Box("AlMonitor2", 8*CLHEP::cm, 8*CLHEP::cm, 0.0004*CLHEP::cm/2); logicAlMonitor2 = new G4LogicalVolume(solidAlMonitor2, alMaterial, "AlMonitor2"); physiAlMonitor2 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -23.7176*CLHEP::cm), logicAlMonitor2, "AlMonitor2", logicAlBoxInner2, false, 0, checkOverlaps); solidPerspex2Monitor1 = new G4SubtractionSolid("Perspex2Monitor1", solidPerspexMonitorOuter1, solidPerspexMonitorOuterHole); logicPerspex2Monitor1 = new G4LogicalVolume(solidPerspex2Monitor1, PMMAmaterial, "Perspex2Monitor1"); physiPerspex2Monitor1 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -23.3176*CLHEP::cm), logicPerspex2Monitor1, "Perspex2Monitor1", logicAlBoxInner2, false, 0, checkOverlaps); //DOSE MONITOR 2 solidPerspexMonitorOuter2 = new G4Box("PerspexMonitorOuter2", 8*CLHEP::cm, 8*CLHEP::cm, 8*CLHEP::mm/2); solidPerspexMonitorOuterHole2 = new G4Tubs("PerspexMonitorOuterHole2", 0*CLHEP::cm, 30*CLHEP::mm, 8*CLHEP::mm/2, startAngle, spanningAngle); solidPerspex1Monitor2 = new G4SubtractionSolid("Perspex1Monitor2", solidPerspexMonitorOuter2, solidPerspexMonitorOuterHole2); logicPerspex1Monitor2 = new G4LogicalVolume(solidPerspex1Monitor2, PMMAmaterial, "Perspex1Monitor2"); physiPerspex1Monitor2 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -24.2*CLHEP::cm), logicPerspex1Monitor2, "Perspex1Monitor2", logicAlBoxInner2, false, 0, checkOverlaps); solidMylarMonitor3 = new G4Box("MylarMonitor3", 8*CLHEP::cm, 8*CLHEP::cm, 0.002*CLHEP::cm/2); logicMylarMonitor3 = new G4LogicalVolume(solidMylarMonitor3, mylMaterial, "MylarMonitor3"); physiMylarMonitor3 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -23.799*CLHEP::cm), logicMylarMonitor3, "MylarMonitor3", logicAlBoxInner2, false, 0, checkOverlaps); solidAlMonitor3 = new G4Box("AlMonitor3", 8*CLHEP::cm, 8*CLHEP::cm, 0.0004*CLHEP::cm/2); logicAlMonitor3 = new G4LogicalVolume(solidAlMonitor3, alMaterial, "AlMonitor3"); physiAlMonitor3 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -23.7988*CLHEP::cm), logicAlMonitor3, "AlMonitor3", logicAlBoxInner2, false, 0, checkOverlaps); solidGuardRing2 = new G4Tubs("GuardRing2", 3*CLHEP::cm, 8*CLHEP::cm, 1.6*CLHEP::mm/2, startAngle, spanningAngle); logicGuardRing2 = new G4LogicalVolume(solidGuardRing2, brassMaterial, "GuardRing2"); physiGuardRing2 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -23.7188*CLHEP::cm), logicGuardRing2, "GuardRing2", logicAlBoxInner2, false, 0, checkOverlaps); solidMylarMonitor4 = new G4Box("MylarMonitor4", 8*CLHEP::cm, 8*CLHEP::cm, 0.002*CLHEP::cm/2); logicMylarMonitor4 = new G4LogicalVolume(solidMylarMonitor4, mylMaterial, "MylarMonitor4"); physiMylarMonitor4 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -23.7178*CLHEP::cm), logicMylarMonitor4, "MylarMonitor4", logicAlBoxInner2, false, 0, checkOverlaps); solidAlMonitor4 = new G4Box("AlMonitor4", 8*CLHEP::cm, 8*CLHEP::cm, 0.0004*CLHEP::cm/2); logicAlMonitor4 = new G4LogicalVolume(solidAlMonitor4, alMaterial, "AlMonitor4"); physiAlMonitor4 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -23.7176*CLHEP::cm), logicAlMonitor4, "AlMonitor4", logicAlBoxInner2, false, 0, checkOverlaps); solidPerspex2Monitor2 = new G4SubtractionSolid("Perspex2Monitor2", solidPerspexMonitorOuter2, solidPerspexMonitorOuterHole2); logicPerspex2Monitor2 = new G4LogicalVolume(solidPerspex2Monitor2, PMMAmaterial, "Perspex2Monitor2"); physiPerspex2Monitor2 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -23.3176*CLHEP::cm), logicPerspex2Monitor2, "Perspex2Monitor2", logicAlBoxInner2, false, 0, checkOverlaps); // oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000 //Borated plastics inside Aluminium Box 2 solidPlasticBlockOuter1 = new G4Box("PlasticBlockOuter1", 8*CLHEP::cm, 8*CLHEP::cm, 3.7*CLHEP::cm/2); solidPlasticBlockInner1 = new G4Tubs("PlasticBlockInner1", 0*CLHEP::cm, 3*CLHEP::cm, 3.7*CLHEP::cm/2, startAngle, spanningAngle); solidPlasticBlock1 = new G4SubtractionSolid("PlasticBlock1", solidPlasticBlockOuter1, solidPlasticBlockInner1); logicPlasticBlock1 = new G4LogicalVolume(solidPlasticBlock1, borPlasticMaterial, "PlasticBlock1"); physiPlasticBlock1 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -22.45*CLHEP::cm), logicPlasticBlock1, "PlasticBlock1", logicAlBoxInner2, false, 0, checkOverlaps); solidPlasticBlockOuter2 = new G4Box("PlasticBlockOuter2", 8*CLHEP::cm, 8*CLHEP::cm, 3.7*CLHEP::cm/2); solidPlasticBlockInner2 = new G4Tubs("PlasticBlockInner2", 0*CLHEP::cm, 3*CLHEP::cm, 3.7*CLHEP::cm/2, startAngle, spanningAngle); solidPlasticBlock2 = new G4SubtractionSolid("PlasticBlock2", solidPlasticBlockOuter2, solidPlasticBlockInner2); logicPlasticBlock2 = new G4LogicalVolume(solidPlasticBlock2, borPlasticMaterial, "PlasticBlock2"); physiPlasticBlock2 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::cm, 0.*CLHEP::cm, -15.05*CLHEP::cm), logicPlasticBlock2, "PlasticBlock2", logicAlBoxInner2, false, 0, checkOverlaps); /* // 2nd anti-scatter collimator - NOT USED solidScatterCollimatorOuter2 = new G4Box("ScatterCollimatorOuter", 8*CLHEP::cm, 8*CLHEP::cm, 1*CLHEP::cm); solidScatterCollimatorInner2 = new G4Tubs("ScatterCollimatorInner", 0*CLHEP::cm, 4*CLHEP::cm, 2*CLHEP::cm/2, startAngle, spanningAngle); solidScatterCollimator2 = new G4SubtractionSolid("ScatterCollimator2", solidScatterCollimatorOuter2, solidScatterCollimatorInner2); logicScatterCollimator2 = new G4LogicalVolume(solidScatterCollimator2, alMaterial, "ScatterCollimator2"); physiScatterCollimator2 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::mm, 0.*CLHEP::mm, 1.6*CLHEP::cm), logicScatterCollimator2, "ScatterCollimator2", logicAlBoxInner2, false, 0, checkOverlaps); */ // oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000 //Borated plastic shielding for neutrons - extends from the room wall to halfway down Aluminium Box 2 solidShielding1 = new G4Box("Shielding1", 37*CLHEP::mm/2, 23*CLHEP::cm/2, 139.6*CLHEP::cm/2); logicShielding1 = new G4LogicalVolume(solidShielding1, borPlasticMaterial, "Shielding1"); physiShielding1 = new G4PVPlacement(0, G4ThreeVector(37*CLHEP::mm/2 + 11*CLHEP::cm, 1.5*CLHEP::cm, -420*CLHEP::cm + 139.6*CLHEP::cm/2), logicShielding1, "Shielding1", logicRoomInner, false, 0, checkOverlaps); solidShielding2 = new G4Box("Shielding2", 37*CLHEP::mm/2, 23*CLHEP::cm/2, 139.6*CLHEP::cm/2); logicShielding2 = new G4LogicalVolume(solidShielding2, borPlasticMaterial, "Shielding2"); physiShielding2 = new G4PVPlacement(0, G4ThreeVector(-37*CLHEP::mm/2 - 11*CLHEP::cm, 1.5*CLHEP::cm, -420*CLHEP::cm + 139.6*CLHEP::cm/2), logicShielding2, "Shielding2", logicRoomInner, false, 0, checkOverlaps); // oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000 // Nozzle 1 (part inside the wall of Aluminium Box 2) solidNozzleInside1 = new G4Tubs("NozzleInside1", 1.7*CLHEP::cm, 2.7*CLHEP::cm, 2*CLHEP::cm/2, startAngle, spanningAngle); logicNozzleInside1 = new G4LogicalVolume(solidNozzleInside1, brassMaterial, "NozzleInside1"); physiNozzleInside1 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::mm, 0.*CLHEP::mm, 57.2*CLHEP::cm/2), //nozzle goes through Al box 2 wall logicNozzleInside1, "NozzleInside1", logicAlBoxOuter2, false, 0, checkOverlaps); //Part of nozzle 1 outside of Aluminium Box 2 solidNozzle1 = new G4Tubs("Nozzle1", 1.7*CLHEP::cm, 2.7*CLHEP::cm, 6.65*CLHEP::cm/2, startAngle, spanningAngle); logicNozzle1 = new G4LogicalVolume(solidNozzle1, brassMaterial, "Nozzle1"); physiNozzle1 = new G4PVPlacement(0, G4ThreeVector(0.*CLHEP::mm, 0.*CLHEP::mm, 172.525*CLHEP::cm - 420*CLHEP::cm), //169.2 + (6.65/2) - 420 logicNozzle1, "Nozzle1", logicRoomInner, false, 0, checkOverlaps); /* (Collimator is patient-specific) solidPatientCollimatorInner = new G4Tubs("PatientCollimatorInner", 0.3*CLHEP::cm, 1.7*CLHEP::cm, 0.4*CLHEP::cm/2, startAngle, spanningAngle); logicPatientCollimatorInner = new G4LogicalVolume(solidPatientCollimatorInner, brassMaterial, "PatientCollimatorInner"); physiPatientCollimatorInner = new G4PVPlacement(0, G4ThreeVector(0*CLHEP::mm, 0*CLHEP::mm, -244.35*CLHEP::cm), logicPatientCollimatorInner, "PatientCollimatorInner", logicRoomInner, false, checkOverlaps); solidPatientCollimatorOuter = new G4Tubs("PatientCollimatorOuter", 0.3*CLHEP::cm, 2.7*CLHEP::cm, 0.8*CLHEP::cm/2, startAngle, spanningAngle); logicPatientCollimatorOuter = new G4LogicalVolume(solidPatientCollimatorOuter, brassMaterial, "PatientCollimatorOuter"); physiPatientCollimatorOuter = new G4PVPlacement(0, G4ThreeVector(0*CLHEP::mm, 0*CLHEP::mm, -243.75*CLHEP::cm), logicPatientCollimatorOuter, "PatientCollimatorOuter", logicRoomInner, false, checkOverlaps); solidPatientCollimatorHolder = new G4Tubs("PatientCollimatorHolder", 2.7*CLHEP::cm, 2.8*CLHEP::cm, 2.4*CLHEP::cm/2, startAngle, spanningAngle); logicPatientCollimatorHolder = new G4LogicalVolume(solidPatientCollimatorHolder, brassMaterial, "PatientCollimatorHolder"); physiPatientCollimatorHolder = new G4PVPlacement(0, G4ThreeVector(0*CLHEP::mm, 0*CLHEP::mm, -244.55*CLHEP::cm), logicPatientCollimatorHolder, "PatientCollimatorHolder", logicRoomInner, false, checkOverlaps); solidPatientCollimatorHolderInner = new G4Tubs("PatientCollimatorHolderInner", 1.8*CLHEP::cm, 2.8*CLHEP::cm, 0.4*CLHEP::cm/2, startAngle, spanningAngle); logicPatientCollimatorHolderInner = new G4LogicalVolume(solidPatientCollimatorHolderInner, brassMaterial, "PatientCollimatorHolderInner"); physiPatientCollimatorHolderInner = new G4PVPlacement(0, G4ThreeVector(0*CLHEP::mm, 0*CLHEP::mm, -243.15*CLHEP::cm), logicPatientCollimatorHolderInner, "PatientCollimatorHolderInner", logicRoomInner, false, checkOverlaps); */ // oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000oo00oo00oo00oo00oo00oo00oo00oo000oo00oo00oo00oo00o000o000o000oo000oo000ooo000ooo000 // Water Box solidWater = new G4Box("WaterBox",10*CLHEP::cm,10*CLHEP::cm,10*CLHEP::cm); logicWater = new G4LogicalVolume(solidWater, waterMaterial, "WaterBox"); physiWater = new G4PVPlacement(0, G4ThreeVector(0., 0., -226*CLHEP::cm), logicWater, "WaterBox", logicRoomInner, false, 0, checkOverlaps); // Define sensitive detectors G4SDManager* SDman = G4SDManager::GetSDMpointer(); G4String name="SD"; G4String name2="antiScatterCol_1_SD"; DetectorSD = new SensitiveDetector(name); DetectorCol1 = new CollSD(name2); SDman->AddNewDetector(DetectorSD); SDman->AddNewDetector(DetectorCol1); logicWater->SetSensitiveDetector(DetectorSD); logicStopper->SetSensitiveDetector(DetectorCol1); // this is the user defined sensitive detector - replace with chosen logical volume return physiWorld; } void DetectorConstruction::UpdateGeometry() { G4RunManager::GetRunManager()->PhysicsHasBeenModified(); G4RunManager::GetRunManager()->DefineWorldVolume(ConstructVolumes()); }