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 "G4MIRDPancreas.hh"
0031
0032 #include "globals.hh"
0033 #include "G4SystemOfUnits.hh"
0034 #include "G4SDManager.hh"
0035 #include "G4VisAttributes.hh"
0036 #include "G4Ellipsoid.hh"
0037 #include "G4ThreeVector.hh"
0038 #include "G4VPhysicalVolume.hh"
0039 #include "G4RotationMatrix.hh"
0040 #include "G4Material.hh"
0041 #include "G4LogicalVolume.hh"
0042 #include "G4HumanPhantomMaterial.hh"
0043 #include "G4VPhysicalVolume.hh"
0044 #include "G4PVPlacement.hh"
0045 #include "G4Box.hh"
0046 #include "G4SubtractionSolid.hh"
0047 #include "G4HumanPhantomColour.hh"
0048
0049 G4VPhysicalVolume* G4MIRDPancreas::Construct(const G4String& volumeName,G4VPhysicalVolume* mother,
0050 const G4String& colourName
0051 ,G4bool wireFrame, G4bool)
0052 {
0053 G4cout<<"Construct "<<volumeName<<" with mother volume "<<mother->GetName()<<G4endl;
0054
0055 auto* material = new G4HumanPhantomMaterial();
0056 auto* soft = material -> GetMaterial("soft_tissue");
0057 delete material;
0058
0059 G4double ax= 3.*cm;
0060 G4double by= 1.*cm;
0061 G4double cz= 15.*cm;
0062 G4double zcut1= -15. *cm;
0063 G4double zcut2= 0.0 *cm;
0064
0065 auto* pancreasFirst = new G4Ellipsoid("PancreasFirst",ax, by, cz,
0066 zcut1, zcut2);
0067
0068 G4double xx = 6. * cm;
0069 G4double yy = 2. * cm;
0070 G4double zz = 12. * cm;
0071 auto* subtrPancreas = new G4Box("SubtrPancreas",xx/2., yy/2., zz/2.);
0072
0073 auto* pancreas = new G4SubtractionSolid("pancreas",
0074 pancreasFirst,
0075 subtrPancreas,
0076 nullptr,
0077 G4ThreeVector(-3 * cm,0.0,-9.*cm));
0078
0079 auto* logicPancreas = new G4LogicalVolume(pancreas, soft,
0080 "logical" + volumeName,
0081 nullptr, nullptr, nullptr);
0082
0083 auto* rm = new G4RotationMatrix();
0084 rm->rotateY(90.*degree);
0085 G4VPhysicalVolume* physPancreas = new G4PVPlacement(rm,
0086 G4ThreeVector(-0. *cm, 0.0, 2*cm),
0087 "physicalPancreas",
0088 logicPancreas,
0089 mother,
0090 false,
0091 0, true);
0092
0093
0094
0095
0096 auto* colourPointer = new G4HumanPhantomColour();
0097 G4Colour colour = colourPointer -> GetColour(colourName);
0098 auto* PancreasVisAtt = new G4VisAttributes(colour);
0099 PancreasVisAtt->SetForceSolid(wireFrame);
0100 logicPancreas->SetVisAttributes(PancreasVisAtt);
0101
0102 G4cout << "Pancreas created !!!!!!" << G4endl;
0103
0104
0105 G4double PancreasVol = logicPancreas->GetSolid()->GetCubicVolume();
0106 G4cout << "Volume of Pancreas = " << PancreasVol/cm3 << " cm^3" << G4endl;
0107
0108
0109 G4String PancreasMat = logicPancreas->GetMaterial()->GetName();
0110 G4cout << "Material of Pancreas = " << PancreasMat << G4endl;
0111
0112
0113 G4double PancreasDensity = logicPancreas->GetMaterial()->GetDensity();
0114 G4cout << "Density of Material = " << PancreasDensity*cm3/g << " g/cm^3" << G4endl;
0115
0116
0117 G4double PancreasMass = (PancreasVol)*PancreasDensity;
0118 G4cout << "Mass of Pancreas = " << PancreasMass/gram << " g" << G4endl;
0119
0120 return physPancreas;
0121 }