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 #include "G4MIRDRightLeg.hh"
0032
0033 #include "globals.hh"
0034 #include "G4SystemOfUnits.hh"
0035 #include "G4SDManager.hh"
0036 #include "G4Cons.hh"
0037 #include "G4VisAttributes.hh"
0038 #include "G4HumanPhantomMaterial.hh"
0039 #include "G4EllipticalTube.hh"
0040 #include "G4ThreeVector.hh"
0041 #include "G4VPhysicalVolume.hh"
0042 #include "G4RotationMatrix.hh"
0043 #include "G4LogicalVolume.hh"
0044 #include "G4PVPlacement.hh"
0045 #include "G4UnionSolid.hh"
0046 #include "G4HumanPhantomColour.hh"
0047
0048 G4VPhysicalVolume* G4MIRDRightLeg::Construct(const G4String& volumeName,G4VPhysicalVolume* mother,
0049 const G4String& colourName, G4bool wireFrame, G4bool )
0050 {
0051 G4cout<<"Construct "<<volumeName<<" with mother volume "<<mother->GetName()<<G4endl;
0052
0053 auto* material = new G4HumanPhantomMaterial();
0054 auto* soft = material -> GetMaterial("soft_tissue");
0055
0056 G4double rmin1 = 0.* cm;
0057 G4double rmin2 = 0.* cm;
0058 G4double dz= 80.0 * cm;
0059 G4double rmax1= 2.0 * cm;
0060 G4double rmax2= 10. * cm;
0061 G4double startphi= 0.* degree;
0062 G4double deltaphi= 360. * degree;
0063
0064 auto* leg1 = new G4Cons("Leg1",
0065 rmin1, rmax1,
0066 rmin2, rmax2, dz/2.,
0067 startphi, deltaphi);
0068
0069 auto* logicRightLeg = new G4LogicalVolume(leg1,
0070 soft,
0071 "logical" + volumeName,
0072 nullptr, nullptr, nullptr);
0073 auto* rm = new G4RotationMatrix();
0074 rm->rotateX(180.*degree);
0075 rm->rotateY(180.*degree);
0076 G4VPhysicalVolume* physRightLeg = new G4PVPlacement(rm,
0077
0078 G4ThreeVector(-10. * cm, 0. * cm, -40. *cm),
0079 "physicalRightLeg",
0080 logicRightLeg,
0081 mother,
0082 false,
0083 0, true);
0084
0085
0086
0087
0088 auto* colourPointer = new G4HumanPhantomColour();
0089 G4Colour colour = colourPointer -> GetColour(colourName);
0090 auto* RightLegVisAtt = new G4VisAttributes(colour);
0091 RightLegVisAtt->SetForceSolid(wireFrame);
0092 logicRightLeg->SetVisAttributes(RightLegVisAtt);
0093
0094 G4cout << "RightLeg created !!!!!!" << G4endl;
0095
0096
0097 G4double RightLegVol = logicRightLeg->GetSolid()->GetCubicVolume();
0098 G4cout << "Volume of RightLeg = " << RightLegVol/cm3 << " cm^3" << G4endl;
0099
0100
0101 G4String RightLegMat = logicRightLeg->GetMaterial()->GetName();
0102 G4cout << "Material of RightLeg = " << RightLegMat << G4endl;
0103
0104
0105 G4double RightLegDensity = logicRightLeg->GetMaterial()->GetDensity();
0106 G4cout << "Density of Material = " << RightLegDensity*cm3/g << " g/cm^3" << G4endl;
0107
0108
0109 G4double RightLegMass = (RightLegVol)*RightLegDensity;
0110 G4cout << "Mass of RightLeg = " << RightLegMass/gram << " g" << G4endl;
0111
0112 return physRightLeg;
0113 }