File indexing completed on 2025-02-23 09:20:11
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 "G4MIRDLiver.hh"
0031 #include "globals.hh"
0032 #include "G4SystemOfUnits.hh"
0033 #include "G4SDManager.hh"
0034 #include "G4VisAttributes.hh"
0035 #include "G4HumanPhantomMaterial.hh"
0036 #include "G4SDManager.hh"
0037 #include "G4PVPlacement.hh"
0038 #include "G4SubtractionSolid.hh"
0039 #include "G4Ellipsoid.hh"
0040 #include "G4ThreeVector.hh"
0041 #include "G4VPhysicalVolume.hh"
0042 #include "G4RotationMatrix.hh"
0043 #include "G4Material.hh"
0044 #include "G4EllipticalTube.hh"
0045 #include "G4Box.hh"
0046 #include "G4HumanPhantomColour.hh"
0047 #include <cmath>
0048
0049 G4VPhysicalVolume* G4MIRDLiver::Construct(const G4String& volumeName,G4VPhysicalVolume* mother,
0050 const G4String& colourName, G4bool wireFrame, G4bool)
0051 {
0052
0053 G4cout << "Construct " << volumeName <<" with mother "<<mother->GetName()<<G4endl;
0054 auto* material = new G4HumanPhantomMaterial();
0055 auto* soft = material -> GetMaterial("soft_tissue");
0056 delete material;
0057
0058 G4double dx= 14.19 *cm;
0059 G4double dy= 7.84 *cm;
0060 G4double dz= 7.21* cm;
0061
0062 auto* firstLiver = new G4EllipticalTube("FirstLiver",dx, dy, dz);
0063
0064 G4double xx = 20.00 * cm;
0065 G4double yy = 50.00 * cm;
0066 G4double zz = 50.00 *cm;
0067
0068 auto* subtrLiver = new G4Box("SubtrLiver", xx/2., yy/2., zz/2.);
0069
0070 auto* rm_relative = new G4RotationMatrix();
0071 rm_relative -> rotateY(32.* degree);
0072 rm_relative -> rotateZ(40.9* degree);
0073
0074
0075
0076
0077
0078
0079
0080
0081
0082
0083
0084 auto* liver = new G4SubtractionSolid("Liver",
0085 firstLiver,subtrLiver,
0086 rm_relative,
0087 G4ThreeVector(10.0*cm,0.0*cm,0.0 *cm));
0088
0089 auto* logicLiver = new G4LogicalVolume(liver,
0090 soft,
0091 "LiverVolume",
0092 nullptr, nullptr, nullptr);
0093
0094
0095 auto* rm = new G4RotationMatrix();
0096 rm->rotateX(180.*degree);
0097 G4VPhysicalVolume* physLiver = new G4PVPlacement(rm,G4ThreeVector(0. *cm,0. *cm,0.*cm),
0098 "physicalLiver",
0099 logicLiver,
0100 mother,
0101 false,
0102 0,true);
0103
0104
0105 auto* colourPointer = new G4HumanPhantomColour();
0106 G4Colour colour = colourPointer -> GetColour(colourName);
0107 auto* LiverVisAtt = new G4VisAttributes(colour);
0108 LiverVisAtt->SetForceSolid(wireFrame);
0109 logicLiver->SetVisAttributes(LiverVisAtt);
0110
0111 G4cout << "Liver created !!!!!!" << G4endl;
0112
0113
0114 G4double LiverVol = logicLiver->GetSolid()->GetCubicVolume();
0115 G4cout << "Volume of Liver = " << LiverVol/cm3 << " cm^3" << G4endl;
0116
0117
0118 G4String LiverMat = logicLiver->GetMaterial()->GetName();
0119 G4cout << "Material of Liver = " << LiverMat << G4endl;
0120
0121
0122 G4double LiverDensity = logicLiver->GetMaterial()->GetDensity();
0123 G4cout << "Density of Material = " << LiverDensity*cm3/g << " g/cm^3" << G4endl;
0124
0125
0126 G4double LiverMass = (LiverVol)*LiverDensity;
0127 G4cout << "Mass of Liver = " << LiverMass/gram << " g" << G4endl;
0128
0129 return physLiver;
0130 }