// \file DetectorConstruction.cc /// \brief Implementation of the DetectorConstruction class #include "DetectorConstruction.hh" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "G4PhysicalConstants.hh" using namespace std; G4VPhysicalVolume* DetectorConstruction::Construct() { G4NistManager* nist = G4NistManager::Instance(); G4bool checkOverlaps = true; //////////////////////////////////////////////////////////////////////// //////////////////////////////WORLD Volume////////////////////////////// //////////////////////////////////////////////////////////////////////// G4double world_hx = 2 * m; G4double world_hy = 2 * m; G4double world_hz = 2 * m; G4VSolid* worldBox = new G4Box("world", world_hx, world_hy, world_hz); G4LogicalVolume* worldLog = new G4LogicalVolume(worldBox, nist->FindOrBuildMaterial("G4_AIR"), "worldLV"); G4VisAttributes* visAttr = new G4VisAttributes(); visAttr->SetVisibility(true); worldLog->SetVisAttributes(visAttr); G4VPhysicalVolume* worldPhys = new G4PVPlacement(0, {}, worldLog, "world", 0, false, 0); /////////////////////////////////////////////////////////////////////// ////////////////////////////////CONCRETE WALLS///////////////////////// /////////////////////////////////////////////////////////////////////// ////////////////////////////////WALL 1///////////////////////////////// G4double wall1_hx = 2. * cm; G4double wall1_hy = 10.00 * cm; G4double wall1_hz = 10.00 * cm; G4VSolid* wall1 = new G4Box("wallA", wall1_hx / 2, wall1_hy / 2, wall1_hz / 2); G4LogicalVolume* wall1Log = new G4LogicalVolume(wall1, nist->FindOrBuildMaterial("G4_WATER"), "wallALV"); G4VisAttributes* red = new G4VisAttributes(G4Colour::Red()); red->SetVisibility(true); red->SetForceSolid(true); wall1Log->SetVisAttributes(red); new G4PVPlacement(0, {0.25 * m, 0 * m ,0 * m}, wall1Log, "wallA", worldLog, false, 0, checkOverlaps); //////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////// DETECTORS /////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////// //// NaI Material G4double z1, z2, a1, a11, density1; G4String name1, symbol1; G4int ncomponents1; a1 = 22.98977 * g/mole; G4Element* elNa = new G4Element(name1="Sodium",symbol1= "Na",z1= 11., a1); a11 = 126.90447 * g/mole; G4Element* elI = new G4Element(name1="Iodine", symbol1="I",z2= 53., a11); density1 = 3.67 * g/cm3; G4Material* NaI_det = new G4Material("NaI_det", density1, ncomponents1= 2); NaI_det->AddElement(elNa, 1); NaI_det->AddElement(elI, 1); ////////////// NAI FAR /////////////////// G4double RadNI = 0. * m; G4double RadNX = 0.0381 * m; G4double LenNaIN = 0.075 * m; G4VSolid* NaI_FAR = new G4Tubs("BM", RadNI, RadNX, LenNaIN / 2, 0 * degree, 360 * degree); G4LogicalVolume* NaI_FARlog = new G4LogicalVolume(NaI_FAR, NaI_det, "NaI_FARLV"); G4VisAttributes* redNaI = new G4VisAttributes(G4Colour::Red()); redNaI->SetVisibility(true); redNaI->SetForceSolid(true); NaI_FARlog->SetVisAttributes(redNaI); G4RotationMatrix* rotNaI = new G4RotationMatrix; rotNaI -> rotateY(90 * degree); G4ThreeVector TranzNAI(0.3 * m ,0 * m, 0 * m); new G4PVPlacement(rotNaI, TranzNAI, NaI_FARlog, "BM", worldLog, false, 0, checkOverlaps); return worldPhys; } void DetectorConstruction::ConstructSDandField() { G4SDManager::GetSDMpointer()->SetVerboseLevel(1); // declare crystal as a MultiFunctionalDetector scorer // G4MultiFunctionalDetector* BM = new G4MultiFunctionalDetector("BM"); G4SDManager::GetSDMpointer()->AddNewDetector(BM); G4VPrimitiveScorer* primitiv1 = new G4PSEnergyDeposit("eDep"); BM->RegisterPrimitive(primitiv1); SetSensitiveDetector("NaI_FARLV",BM); }