File indexing completed on 2025-02-23 09:22:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #include "RE03DetectorConstruction.hh"
0032
0033 #include "G4Box.hh"
0034 #include "G4Colour.hh"
0035 #include "G4LogicalVolume.hh"
0036 #include "G4Material.hh"
0037 #include "G4MultiFunctionalDetector.hh"
0038 #include "G4NistManager.hh"
0039 #include "G4PSEnergyDeposit.hh"
0040 #include "G4PSNofStep.hh"
0041 #include "G4PSTrackLength.hh"
0042 #include "G4PVPlacement.hh"
0043 #include "G4SDManager.hh"
0044 #include "G4SDParticleFilter.hh"
0045 #include "G4SystemOfUnits.hh"
0046 #include "G4VPrimitiveScorer.hh"
0047 #include "G4VisAttributes.hh"
0048 #include "G4ios.hh"
0049
0050
0051 RE03DetectorConstruction::RE03DetectorConstruction()
0052 : G4VUserDetectorConstruction(),
0053 fAir(0),
0054 fWater(0),
0055 fWorldPhys(0),
0056 fPhantomPhys(0),
0057 fConstructed(false)
0058 {
0059 ;
0060 }
0061
0062
0063 RE03DetectorConstruction::~RE03DetectorConstruction()
0064 {
0065 ;
0066 }
0067
0068
0069 G4VPhysicalVolume* RE03DetectorConstruction::Construct()
0070 {
0071 if (!fConstructed) {
0072 fConstructed = true;
0073 DefineMaterials();
0074 SetupGeometry();
0075 }
0076 return fWorldPhys;
0077 }
0078
0079
0080 void RE03DetectorConstruction::DefineMaterials()
0081 {
0082
0083
0084 G4NistManager* NISTman = G4NistManager::Instance();
0085 fWater = NISTman->FindOrBuildMaterial("G4_WATER");
0086 fAir = NISTman->FindOrBuildMaterial("G4_AIR");
0087 }
0088
0089
0090 void RE03DetectorConstruction::SetupGeometry()
0091 {
0092
0093
0094
0095 G4VSolid* worldSolid = new G4Box("World", 2. * m, 2. * m, 2. * m);
0096 G4LogicalVolume* worldLogical = new G4LogicalVolume(worldSolid, fAir, "World");
0097 fWorldPhys = new G4PVPlacement(0, G4ThreeVector(), worldLogical, "World", 0, false, 0);
0098
0099
0100
0101
0102 G4VSolid* phantomSolid = new G4Box("Calor", 1. * m, 1. * m, 1. * m);
0103 G4LogicalVolume* phantomLogical = new G4LogicalVolume(phantomSolid, fWater, "Phantom");
0104 fPhantomPhys =
0105 new G4PVPlacement(0, G4ThreeVector(), phantomLogical, "Phantom", worldLogical, false, 0);
0106
0107
0108
0109
0110 G4VisAttributes* simpleBoxVisAtt = new G4VisAttributes(G4Colour(1.0, 1.0, 1.0));
0111 simpleBoxVisAtt->SetVisibility(true);
0112 phantomLogical->SetVisAttributes(simpleBoxVisAtt);
0113 }
0114
0115 void RE03DetectorConstruction::ConstructSDandField()
0116 {
0117 ;
0118 }