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 "G4MIRDHeart.hh"
0031 #include "globals.hh"
0032 #include "G4SDManager.hh"
0033 #include "G4VisAttributes.hh"
0034 #include "G4Ellipsoid.hh"
0035 #include "G4ThreeVector.hh"
0036 #include "G4VPhysicalVolume.hh"
0037 #include "G4RotationMatrix.hh"
0038 #include "G4Material.hh"
0039 #include "G4LogicalVolume.hh"
0040 #include "G4HumanPhantomMaterial.hh"
0041 #include "G4VPhysicalVolume.hh"
0042 #include "G4PVPlacement.hh"
0043 #include "G4Sphere.hh"
0044 #include "G4UnionSolid.hh"
0045 #include "G4HumanPhantomColour.hh"
0046 #include "G4SystemOfUnits.hh"
0047
0048 G4VPhysicalVolume* G4MIRDHeart::Construct(const G4String& volumeName,G4VPhysicalVolume* mother,
0049 const G4String& colourName, G4bool wireFrame, G4bool)
0050 {
0051
0052 G4cout << "Construct " << volumeName <<" with mother "<<mother->GetName()<<G4endl;
0053
0054 auto* material = new G4HumanPhantomMaterial();
0055
0056 auto* soft = material -> GetMaterial("soft_tissue");
0057
0058 G4double ax= 4.00* cm;
0059 G4double by= 4.00 *cm;
0060 G4double cz= 7.00 *cm;
0061 G4double zcut1= -7.00 *cm;
0062 G4double zcut2= 0.0 *cm;
0063
0064 auto* heart1 = new G4Ellipsoid("Heart1",ax, by, cz, zcut1, zcut2);
0065
0066 G4double rmin =0.*cm;
0067 G4double rmax = 3.99*cm;
0068 G4double startphi = 0. * degree;
0069 G4double deltaphi = 360. * degree;
0070 G4double starttheta = 0. * degree;
0071 G4double deltatheta = 90. * degree;
0072
0073 auto* heart2 = new G4Sphere("Heart2", rmin,rmax,
0074 startphi, deltaphi,
0075 starttheta, deltatheta);
0076
0077 auto* heart = new G4UnionSolid("Heart", heart1, heart2);
0078
0079 auto* logicHeart = new G4LogicalVolume(heart, soft,
0080 "HeartVolume",
0081 nullptr, nullptr, nullptr);
0082
0083
0084 auto* rm = new G4RotationMatrix();
0085 rm->rotateY(25.*degree);
0086 G4VPhysicalVolume* physHeart = new G4PVPlacement(rm,G4ThreeVector(0.0,-3.0*cm, 15.32 *cm),
0087 "physicalHeart",
0088 logicHeart,
0089 mother,
0090 false,
0091 0,true);
0092
0093
0094 auto* colourPointer = new G4HumanPhantomColour();
0095 G4Colour colour = colourPointer -> GetColour(colourName);
0096 auto* HeartVisAtt = new G4VisAttributes(colour);
0097 HeartVisAtt->SetForceSolid(wireFrame);
0098 logicHeart->SetVisAttributes(HeartVisAtt);
0099
0100 G4cout << "Heart created !!!!!!" << G4endl;
0101
0102
0103 G4double HeartVol = logicHeart->GetSolid()->GetCubicVolume();
0104 G4cout << "Volume of Heart = " << HeartVol/cm3 << " cm^3" << G4endl;
0105
0106
0107 G4String HeartMat = logicHeart->GetMaterial()->GetName();
0108 G4cout << "Material of Heart = " << HeartMat << G4endl;
0109
0110
0111 G4double HeartDensity = logicHeart->GetMaterial()->GetDensity();
0112 G4cout << "Density of Material = " << HeartDensity*cm3/g << " g/cm^3" << G4endl;
0113
0114
0115 G4double HeartMass = (HeartVol)*HeartDensity;
0116 G4cout << "Mass of Heart = " << HeartMass/gram << " g" << G4endl;
0117
0118 return physHeart;
0119
0120 }