#include "SolidMaterials.hh" #include "SM1Shielding.hh" #include "G4Material.hh" #include "G4MaterialTable.hh" #include "G4ThreeVector.hh" #include "G4VisAttributes.hh" #include "G4Transform3D.hh" #include "G4UnionSolid.hh" #include #include #include "G4Box.hh" #include "G4SubtractionSolid.hh" #include "G4Tubs.hh" #include "G4PVPlacement.hh" #include "G4UnitsTable.hh" #include #include "G4SystemOfUnits.hh" #include "G4PhysicalConstants.hh" #include "G4SDManager.hh" SM1Shielding::SM1Shielding(G4int verboseLevel){ fverboseLevel = verboseLevel; ShieldingThickness = 3.*cm; Plane01Length = 133.*cm; Plane01Width = 79.*cm; Plane02Length = 126.*cm; Plane02Width = 73.*cm; Plane03Length = 120.*cm; Plane03Width = 67.*cm; } SM1Shielding::~SM1Shielding() { } G4LogicalVolume *SM1Shielding::ShieldingConstruction(G4double NORCANHeigth, G4bool Shielding, G4bool FrontShielding) { G4Material * mate; // make colours ********************************************************* G4Colour white (1.0, 1.0, 1.0) ; G4Colour white_t (1.0, 1.0, 1.0, .95) ; G4Colour grey (0.5, 0.5, 0.5) ; G4Colour lgrey (.75, .75, .75) ; G4Colour red (1.0, 0.0, 0.0, 0.5) ; G4Colour blue (0.0, 0.0, 1.0) ; G4Colour blue_t (0.0, 0.0, 1.0, .75) ; G4Colour cyan (0.0, 1.0, 1.0, 0.5) ; G4Colour magenta (1.0, 0.0, 1.0) ; G4Colour yellow (1.0, 1.0, 0.0, 0.5) ; G4Colour lblue (0.0, 0.0, .75) ; G4Colour black (0.0, 0.0, 0.0) ; G4Colour green (0.0, 1.0, 0.0) ; G4Colour lgreen (0.0, .75, 0.0) ; G4Colour lgreen_t (0.0, .75, 0.0, 0.5) ; G4double ShieldingHeigth = NORCANHeigth + 6.*ShieldingThickness; G4double ShieldingInnerHeigth = ShieldingHeigth - 6.*ShieldingThickness; G4double ShieldingLength = Plane01Length + 2.*ShieldingThickness; G4double ShieldingInnerLength = ShieldingLength - 6.*ShieldingThickness; G4double ShieldingWidth = Plane01Width + 2.*ShieldingThickness; G4double ShieldingInnerWidth = ShieldingWidth - 6.*ShieldingThickness; G4double RemoveFrontShielding, RemoveZ; if( Shielding ){ if( FrontShielding ){// construct full shielding RemoveFrontShielding = 0.; RemoveZ = 0.; }else{// remove only front shielding planes RemoveFrontShielding = ShieldingThickness; RemoveZ = -ShieldingThickness; G4cout << "Front PPL Shielding not present !!!" << G4endl; } }else{ if( !FrontShielding ) G4cout << "PPL Shielding is not present at all !!!" << G4endl; } // construct Shielding box G4Box* ShieldingOuter = new G4Box("ShieldingOuter",0.5*ShieldingLength,0.5*ShieldingHeigth,0.5*ShieldingWidth); G4Box* ShieldingInner = new G4Box("ShieldingInner",0.5*ShieldingInnerLength, 0.5*ShieldingInnerHeigth, 0.5*ShieldingInnerWidth); G4SubtractionSolid* Shieldingbox = new G4SubtractionSolid("Shieldingbox",ShieldingOuter, ShieldingInner,0, G4ThreeVector(0,0,0)); mate = G4Material::GetMaterial("Air"); logShielding = new G4LogicalVolume(Shieldingbox, mate,"logShielding",0,0,0); // logShielding->SetVisAttributes(G4VisAttributes::Invisible); mate = G4Material::GetMaterial("PPL"); //Set Color G4VisAttributes* vatShielding= new G4VisAttributes(lgreen); vatShielding->SetVisibility(true); vatShielding->SetForceSolid(true); // Plane number 01 (outter longest horizontal) G4Box* Plane01 = new G4Box("Plane01",0.5*Plane01Length,0.5*ShieldingThickness,0.5*Plane01Width); logPlaneOutter = new G4LogicalVolume(Plane01, mate,"logPlaneOutter",0,0,0); logPlaneOutter->SetVisAttributes(vatShielding); if(Shielding && FrontShielding){ physPlaneOutter = new G4PVPlacement(0, //plane on top G4ThreeVector(0,0.5*NORCANHeigth + 2.5*ShieldingThickness,0), logPlaneOutter, "physPlaneOutter", logShielding, false, 0); } physPlaneOutter = new G4PVPlacement(0, //plane on bottom G4ThreeVector(0,-0.5*NORCANHeigth - 2.5*ShieldingThickness,0), logPlaneOutter, "physPlaneOutter", logShielding, false, 5); // G4cout << "Ytop: " << 0.5*NORCANHeigth + 3.*ShieldingThickness << "Ybottom: " << -0.5*NORCANHeigth - 3.*ShieldingThickness << G4endl; // Plane number 02 (in the middle horizontal) G4Box* Plane02 = new G4Box("Plane02",0.5*Plane02Length,0.5*ShieldingThickness,0.5*Plane02Width); logPlaneMiddle = new G4LogicalVolume(Plane02, mate,"logPlaneMiddle",0,0,0); logPlaneMiddle->SetVisAttributes(vatShielding); if(Shielding && FrontShielding){ physPlaneMiddle = new G4PVPlacement(0, //plane on top G4ThreeVector(0,0.5*NORCANHeigth + 1.5*ShieldingThickness,0), logPlaneMiddle, "physPlaneMiddle", logShielding, false, 1); } physPlaneMiddle = new G4PVPlacement(0, //plane on bottom G4ThreeVector(0,-0.5*NORCANHeigth - 1.5*ShieldingThickness,0), logPlaneMiddle, "physPlaneMiddle", logShielding, false, 4); // Plane number 03 (inner shortest horizontal) G4Box* Plane03 = new G4Box("Plane03",0.5*Plane03Length,0.5*ShieldingThickness,0.5*Plane03Width); logPlaneInner = new G4LogicalVolume(Plane03, mate,"logPlaneInner",0,0,0); logPlaneInner->SetVisAttributes(vatShielding); if(Shielding && FrontShielding){ physPlaneInner = new G4PVPlacement(0, //plane on top G4ThreeVector(0,0.5*NORCANHeigth + 0.5*ShieldingThickness,0), logPlaneInner, "physPlaneInner", logShielding, false, 2); } physPlaneInner = new G4PVPlacement(0, //plane on bottom G4ThreeVector(0,-0.5*NORCANHeigth - 0.5*ShieldingThickness,0), logPlaneInner, "physPlaneInner", logShielding, false, 3); // Three layer Shielding for the side of SM1 // G4cout << "X+: " << 0.5*ShieldingLength << "X-: " << -0.5*ShieldingLength << G4endl; // G4cout << "Z+: " << 0.5*ShieldingWidth << "Z-: " << -0.5*ShieldingWidth << G4endl; if( Shielding ){ G4Box* SideOuter2 = new G4Box("SideOuter2", 0.5*ShieldingLength, 0.5*ShieldingHeigth, 0.5*ShieldingWidth); G4Box* SideInner2 = new G4Box("SideInner2", 0.5*ShieldingLength+(Shielding ? -ShieldingThickness : 1.*mm)+1.1*RemoveFrontShielding, 0.5*ShieldingHeigth+1.*mm, 0.5*ShieldingWidth-ShieldingThickness+RemoveFrontShielding); G4Box* SideOuter1 = new G4Box("SideOuter1", 0.5*ShieldingLength-ShieldingThickness, 0.5*ShieldingHeigth-ShieldingThickness, 0.5*ShieldingWidth-ShieldingThickness); G4Box* SideInner1 = new G4Box("SideInner1", 0.5*ShieldingLength+(Shielding ? -2.*ShieldingThickness : 1.*mm)+2.1*RemoveFrontShielding, 0.5*ShieldingHeigth+1.*mm, 0.5*ShieldingWidth-2.*ShieldingThickness+RemoveFrontShielding); G4Box* SideOuter0 = new G4Box("SideOuter0", 0.5*ShieldingLength-2.*ShieldingThickness, 0.5*ShieldingHeigth-2.*ShieldingThickness, 0.5*ShieldingWidth-2.*ShieldingThickness); G4Box* SideInner0 = new G4Box("SideInner0", 0.5*ShieldingLength+(Shielding ? -3.*ShieldingThickness : 1.*mm)+3.1*RemoveFrontShielding, 0.5*ShieldingHeigth+1.*mm, 0.5*ShieldingWidth-3.*ShieldingThickness+RemoveFrontShielding); //first layer (internal) G4SubtractionSolid * SideBox0 = new G4SubtractionSolid("SideBox0", SideOuter0, SideInner0, 0, G4ThreeVector(0,0,RemoveZ)); //second layer (central) G4SubtractionSolid * SideBox1 = new G4SubtractionSolid("SideBox1", SideOuter1, SideInner1, 0, G4ThreeVector(0,0,RemoveZ)); //third layer (external) G4SubtractionSolid * SideBox2 = new G4SubtractionSolid("SideBox2", SideOuter2, SideInner2, 0, G4ThreeVector(0,0,RemoveZ)); vatShielding= new G4VisAttributes(lgreen_t); vatShielding->SetVisibility(true); vatShielding->SetForceSolid(true); logPlaneSideInner = new G4LogicalVolume(SideBox0, mate,"logPlaneSideInner",0,0,0); logPlaneSideInner->SetVisAttributes(vatShielding); physPlaneSideInner = new G4PVPlacement(0, G4ThreeVector(0,0,0), logPlaneSideInner, "physPlaneSideInner", logShielding, false, 0); logPlaneSideMiddle = new G4LogicalVolume(SideBox1, mate,"logPlaneSideMiddle",0,0,0); logPlaneSideMiddle->SetVisAttributes(vatShielding); physPlaneSideMiddle = new G4PVPlacement(0, G4ThreeVector(0,0,0), logPlaneSideMiddle, "physPlaneSideMiddle", logShielding, false, 1); logPlaneSideOutter = new G4LogicalVolume(SideBox2, mate,"logPlaneSideOutter",0,0,0); logPlaneSideOutter->SetVisAttributes(vatShielding); physPlaneSideOutter = new G4PVPlacement(0, G4ThreeVector(0,0,0), logPlaneSideOutter, "physPlaneSideOutter", logShielding, false, 2); if(fverboseLevel>0){ G4cout << "**************VOLUME MASS****************" << G4endl; G4cout << "PPL shielding inner: mass=" << logPlaneSideInner->GetMass()/g + 2.*logPlaneInner->GetMass()/g << ", volume=" << SideBox0->GetCubicVolume()/cm3 + 2.*Plane03->GetCubicVolume()/cm3 << G4endl; G4cout << "PPL shielding middle: mass=" << logPlaneSideMiddle->GetMass()/g + 2.*logPlaneMiddle->GetMass()/g << ", volume=" << SideBox1->GetCubicVolume()/cm3 + 2.*Plane02->GetCubicVolume()/cm3 << G4endl; G4cout << "PPL shielding outter: mass=" << logPlaneSideOutter->GetMass()/g + 2.*logPlaneOutter->GetMass()/g << ", volume=" << SideBox2->GetCubicVolume()/cm3 + 2.*Plane01->GetCubicVolume()/cm3 << G4endl; G4cout << "**********END VOLUME MASS****************" << G4endl; } } /* // Full Shielding for SM1 in one solid G4Box* Outer = new G4Box("Outer", 0.5*ShieldingLength, 0.5*ShieldingHeigth, 0.5*ShieldingWidth); G4Box* Inner = new G4Box("Inner", 0.5*ShieldingLength-3.*ShieldingThickness, 0.5*ShieldingHeigth-3.*ShieldingThickness, 0.5*ShieldingWidth-3.*ShieldingThickness); //Remove inner G4SubtractionSolid * ShieldingBox = new G4SubtractionSolid("ShieldingBox", Outer, Inner, 0, G4ThreeVector(0,0,0)); logShieldingBox = new G4LogicalVolume(ShieldingBox, mate,"logShieldingBox",0,0,0); logShieldingBox->SetVisAttributes(vatShielding); physShieldingBox = new G4PVPlacement(0, G4ThreeVector(0,0,0), logShieldingBox, "physShieldingBox", logShielding, false, 0); */ return logShielding; }