#include "DetectorConstruction.hh" #include "G4RunManager.hh" #include "G4NistManager.hh" #include "G4Box.hh" #include "G4Cons.hh" #include "G4Orb.hh" #include "G4Sphere.hh" #include "G4Trd.hh" #include "G4LogicalVolume.hh" #include "G4PVPlacement.hh" #include "G4SystemOfUnits.hh" DetectorConstruction::DetectorConstruction(): G4VUserDetectorConstruction(), fScoringVolume(0) {} DetectorConstruction::~DetectorConstruction() {} G4VPhysicalVolume* DetectorConstruction::Construct() { //Defining some constants G4double world_x=1*cm; G4double world_y=1*cm; G4double world_z=1*cm; G4double pos_x=0.0*cm; G4double pos_y=0.0*cm; G4double pos_z=0.0*cm; G4double z, a, density; density = 0.0000001*g/cm3; z=1; a=1.0*g/mole; G4String name; //Defining the material G4Material* vacum = new G4Material(name="vacum", z, a, density); //Creating a box G4Box* worldBox= new G4Box("world", world_x,world_y,world_z); //Defining the logical volume G4LogicalVolume* worldlog = new G4LogicalVolume(worldBox, vacum, "worldlog"); //Defining the physical volume G4VPhysicalVolume* worldp = new G4PVPlacement(0, G4ThreeVector(pos_x,pos_y,pos_z), worldlog, "worldp", 0, false, 0); return worldp; }