File indexing completed on 2025-02-23 09:20:10
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 #include "G4MIRDHead.hh"
0031 #include "globals.hh"
0032 #include "G4SystemOfUnits.hh"
0033 #include "G4HumanPhantomMaterial.hh"
0034 #include "G4SDManager.hh"
0035 #include "G4PVPlacement.hh"
0036 #include "G4VisAttributes.hh"
0037 #include "G4UnionSolid.hh"
0038 #include "G4Ellipsoid.hh"
0039 #include "G4ThreeVector.hh"
0040 #include "G4VPhysicalVolume.hh"
0041 #include "G4RotationMatrix.hh"
0042 #include "G4Material.hh"
0043 #include "G4EllipticalTube.hh"
0044 #include "G4HumanPhantomColour.hh"
0045
0046 G4VPhysicalVolume* G4MIRDHead::Construct(const G4String& volumeName,G4VPhysicalVolume* mother,
0047 const G4String& colourName, G4bool wireFrame, G4bool)
0048 {
0049 G4cout << "Construct " << volumeName <<" with mother "<<mother->GetName()<<G4endl;
0050
0051 auto* material = new G4HumanPhantomMaterial();
0052
0053 G4Material* soft = material -> GetMaterial("soft_tissue");
0054
0055
0056
0057 G4double ax = 7.0 * cm;
0058 G4double by = 10.0 * cm;
0059 G4double cz = 8.50 * cm;
0060 G4double zcut1 = 0.0 * cm;
0061 G4double zcut2 = 8.5 * cm;
0062
0063 auto* head1 = new G4Ellipsoid("Head1", ax, by, cz, zcut1, zcut2);
0064
0065 G4double dx = 7.0 * cm;
0066 G4double dy = 10.0 * cm;
0067 G4double dz = 7.75 * cm;
0068
0069
0070 auto* head2 = new G4EllipticalTube("Head2", dx, dy, dz);
0071
0072 auto* head = new G4UnionSolid("Head",head2,head1,
0073 nullptr,
0074 G4ThreeVector(0.* cm, 0.*cm, 7.7500 * cm) );
0075
0076 auto* logicHead = new G4LogicalVolume(head, soft,"logical" + volumeName,
0077 nullptr, nullptr, nullptr);
0078
0079 auto* rm = new G4RotationMatrix();
0080 rm->rotateX(180.*degree);
0081 rm->rotateY(180.*degree);
0082
0083 G4VPhysicalVolume* physHead = new G4PVPlacement(rm,
0084
0085 G4ThreeVector(0.* cm,0.*cm, 77.75*cm),
0086 "physicalHead",
0087 logicHead,
0088 mother,
0089 false,
0090 0, true);
0091
0092
0093
0094
0095 auto* colourPointer = new G4HumanPhantomColour();
0096 G4Colour colour = colourPointer -> GetColour(colourName);
0097 auto* HeadVisAtt = new G4VisAttributes(colour);
0098
0099 HeadVisAtt->SetForceSolid(wireFrame);
0100
0101
0102 logicHead->SetVisAttributes(HeadVisAtt);
0103
0104
0105 G4double HeadVol = logicHead->GetSolid()->GetCubicVolume();
0106 G4cout << "Volume of Head = " << HeadVol/cm3 << " cm^3" << G4endl;
0107
0108
0109 G4String HeadMat = logicHead->GetMaterial()->GetName();
0110 G4cout << "Material of Head = " << HeadMat << G4endl;
0111
0112
0113 G4double HeadDensity = logicHead->GetMaterial()->GetDensity();
0114 G4cout << "Density of Material = " << HeadDensity*cm3/g << " g/cm^3" << G4endl;
0115
0116
0117 G4double HeadMass = (HeadVol)*HeadDensity;
0118 G4cout << "Mass of Head = " << HeadMass/gram << " g" << G4endl;
0119
0120 return physHead;
0121 }