File indexing completed on 2025-02-23 09:20:12
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 #include "G4MIRDSkull.hh"
0033
0034 #include "globals.hh"
0035 #include "G4SystemOfUnits.hh"
0036 #include "G4SDManager.hh"
0037 #include "G4VisAttributes.hh"
0038 #include "G4HumanPhantomMaterial.hh"
0039 #include "G4EllipticalTube.hh"
0040 #include "G4RotationMatrix.hh"
0041 #include "G4ThreeVector.hh"
0042 #include "G4VPhysicalVolume.hh"
0043 #include "G4PVPlacement.hh"
0044 #include "G4Ellipsoid.hh"
0045 #include "G4SubtractionSolid.hh"
0046 #include "G4Box.hh"
0047 #include "G4UnionSolid.hh"
0048 #include "G4VSolid.hh"
0049 #include "G4HumanPhantomColour.hh"
0050
0051 G4VPhysicalVolume* G4MIRDSkull::Construct(const G4String& volumeName,G4VPhysicalVolume* mother,
0052 const G4String& colourName,
0053 G4bool wireFrame,G4bool)
0054 {
0055
0056 auto* material = new G4HumanPhantomMaterial();
0057
0058 G4cout<<"Construct "<<volumeName<<" with mother volume "<<mother->GetName()<<G4endl;
0059
0060
0061 auto* skeleton = material -> GetMaterial("skeleton");
0062
0063 delete material;
0064
0065
0066 G4double ax = 6.8 * cm;
0067 G4double by = 9.8 * cm;
0068 G4double cz = 8.3 * cm;
0069
0070 auto* craniumOut = new G4Ellipsoid("CraniumOut", ax, by, cz);
0071
0072 ax = 6. * cm;
0073 by = 9. * cm;
0074 cz= 6.5 * cm;
0075
0076 auto* craniumIn = new G4Ellipsoid("CraniumIn", ax, by, cz);
0077
0078
0079 auto* cranium = new G4SubtractionSolid("Cranium",
0080 craniumOut,
0081 craniumIn, nullptr,
0082 G4ThreeVector(0.0, 0.0,1. * cm));
0083
0084 auto* logicSkull = new G4LogicalVolume(cranium, skeleton,
0085 "logical" + volumeName,
0086 nullptr, nullptr, nullptr);
0087
0088
0089 G4VPhysicalVolume* physSkull = new G4PVPlacement(nullptr,
0090 G4ThreeVector(0., 0.,7.75 * cm),
0091 "physicalSkull",
0092 logicSkull,
0093 mother,
0094 false,
0095 0, true);
0096
0097
0098
0099 auto* colourPointer = new G4HumanPhantomColour();
0100 G4Colour colour = colourPointer -> GetColour(colourName);
0101 auto* SkullVisAtt = new G4VisAttributes(colour);
0102 SkullVisAtt->SetForceSolid(wireFrame);
0103 SkullVisAtt->SetLineWidth(4.* mm);
0104 logicSkull->SetVisAttributes(SkullVisAtt);
0105
0106 G4cout << "Skull created !!!!!!" << G4endl;
0107
0108
0109
0110 G4double SkullVol = logicSkull->GetSolid()->GetCubicVolume();
0111 G4cout << "Volume of Skull = " << SkullVol/cm3 << " cm^3" << G4endl;
0112
0113
0114 G4String SkullMat = logicSkull->GetMaterial()->GetName();
0115 G4cout << "Material of Skull = " << SkullMat << G4endl;
0116
0117
0118 G4double SkullDensity = logicSkull->GetMaterial()->GetDensity();
0119 G4cout << "Density of Material = " << SkullDensity*cm3/g << " g/cm^3" << G4endl;
0120
0121
0122 G4double SkullMass = (SkullVol)*SkullDensity;
0123 G4cout << "Mass of Skull = " << SkullMass/gram << " g" << G4endl;
0124
0125
0126 return physSkull;
0127 }