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
0033 #include "G4MIRDTrunk.hh"
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 "G4HumanPhantomColour.hh"
0045
0046
0047 G4VPhysicalVolume* G4MIRDTrunk::Construct(const G4String& volumeName, G4VPhysicalVolume* mother,
0048 const G4String& colourName, G4bool wireFrame,G4bool )
0049 {
0050 auto* material = new G4HumanPhantomMaterial();
0051
0052 G4cout<<"Construct "<<volumeName<<" with mother volume "<<mother->GetName()<<G4endl;
0053
0054 auto* soft = material -> GetMaterial("soft_tissue");
0055
0056 delete material;
0057
0058
0059
0060 G4double dx = 20. * cm;
0061 G4double dy = 10. * cm;
0062 G4double dz = 35. * cm;
0063
0064 auto* trunk = new G4EllipticalTube("Trunk",dx, dy, dz);
0065
0066 auto* logicTrunk = new G4LogicalVolume(trunk, soft,
0067 "logical" + volumeName,
0068 nullptr, nullptr, nullptr);
0069
0070 auto* rm = new G4RotationMatrix();
0071 rm->rotateX(180.*degree);
0072 rm->rotateY(180.*degree);
0073 G4VPhysicalVolume* physTrunk = new G4PVPlacement(rm,
0074
0075 G4ThreeVector(0.* cm, 0. *cm, 35.*cm),
0076 "physicalTrunk",
0077 logicTrunk,
0078 mother,
0079 false,
0080 0, true);
0081
0082 auto* colourPointer = new G4HumanPhantomColour();
0083 G4Colour colour = colourPointer -> GetColour(colourName);
0084 auto* TrunkVisAtt = new G4VisAttributes(colour);
0085 TrunkVisAtt->SetForceSolid(wireFrame);
0086 logicTrunk->SetVisAttributes(TrunkVisAtt);
0087
0088 G4cout << "Trunk created !!!!!!" << G4endl;
0089
0090
0091 G4double TrunkVol = logicTrunk->GetSolid()->GetCubicVolume();
0092 G4cout << "Volume of Trunk = " << TrunkVol/cm3 << " cm^3" << G4endl;
0093
0094
0095 G4String TrunkMat = logicTrunk->GetMaterial()->GetName();
0096 G4cout << "Material of Trunk = " << TrunkMat << G4endl;
0097
0098
0099 G4double TrunkDensity = logicTrunk->GetMaterial()->GetDensity();
0100 G4cout << "Density of Material = " << TrunkDensity*cm3/g << " g/cm^3" << G4endl;
0101
0102
0103 G4double TrunkMass = (TrunkVol)*TrunkDensity;
0104 G4cout << "Mass of Trunk = " << TrunkMass/gram << " g" << G4endl;
0105
0106 return physTrunk;
0107 }