File indexing completed on 2025-02-23 09:21:45
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
0032
0033
0034
0035 #include "DicomNestedParamDetectorConstruction.hh"
0036
0037 #include "DicomNestedPhantomParameterisation.hh"
0038
0039 #include "G4Box.hh"
0040 #include "G4LogicalVolume.hh"
0041 #include "G4PVParameterised.hh"
0042 #include "G4PVPlacement.hh"
0043 #include "G4VPhysicalVolume.hh"
0044 #include "G4VisAttributes.hh"
0045 #include "globals.hh"
0046
0047
0048 DicomNestedParamDetectorConstruction::DicomNestedParamDetectorConstruction()
0049 : DicomDetectorConstruction()
0050 {}
0051
0052
0053 DicomNestedParamDetectorConstruction::~DicomNestedParamDetectorConstruction() {}
0054
0055
0056 void DicomNestedParamDetectorConstruction::ConstructPhantom()
0057 {
0058 #ifdef G4VERBOSE
0059 G4cout << "DicomNestedParamDetectorConstruction::ConstructPhantom " << G4endl;
0060 #endif
0061
0062
0063
0064 G4String yRepName("RepY");
0065 G4VSolid* solYRep =
0066 new G4Box(yRepName, fNoVoxelsX * fVoxelHalfDimX, fVoxelHalfDimY, fNoVoxelsZ * fVoxelHalfDimZ);
0067 G4LogicalVolume* logYRep = new G4LogicalVolume(solYRep, fAir, yRepName);
0068 new G4PVReplica(yRepName, logYRep, fContainer_logic, kYAxis, fNoVoxelsY, fVoxelHalfDimY * 2.);
0069
0070 logYRep->SetVisAttributes(new G4VisAttributes(G4VisAttributes::GetInvisible()));
0071
0072
0073 G4String xRepName("RepX");
0074 G4VSolid* solXRep =
0075 new G4Box(xRepName, fVoxelHalfDimX, fVoxelHalfDimY, fNoVoxelsZ * fVoxelHalfDimZ);
0076 G4LogicalVolume* logXRep = new G4LogicalVolume(solXRep, fAir, xRepName);
0077 new G4PVReplica(xRepName, logXRep, logYRep, kXAxis, fNoVoxelsX, fVoxelHalfDimX * 2.);
0078
0079 logXRep->SetVisAttributes(new G4VisAttributes(G4VisAttributes::GetInvisible()));
0080
0081
0082
0083 G4VSolid* solVoxel = new G4Box("phantom", fVoxelHalfDimX, fVoxelHalfDimY, fVoxelHalfDimZ);
0084 G4LogicalVolume* logicVoxel = new G4LogicalVolume(solVoxel, fAir, "phantom");
0085
0086 logicVoxel->SetVisAttributes(new G4VisAttributes(G4VisAttributes::GetInvisible()));
0087
0088
0089
0090
0091
0092
0093 G4ThreeVector voxelSize(fVoxelHalfDimX, fVoxelHalfDimY, fVoxelHalfDimZ);
0094 DicomNestedPhantomParameterisation* param =
0095 new DicomNestedPhantomParameterisation(voxelSize, fMaterials);
0096
0097 new G4PVParameterised("phantom",
0098 logicVoxel,
0099 logXRep,
0100 kZAxis,
0101
0102
0103 fNoVoxelsZ,
0104 param);
0105
0106 param->SetMaterialIndices(fMateIDs);
0107 param->SetNoVoxels(fNoVoxelsX, fNoVoxelsY, fNoVoxelsZ);
0108
0109
0110
0111
0112 SetScorer(logicVoxel);
0113 }