File indexing completed on 2025-02-23 09:20:10
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 "G4MIRDBrain.hh"
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 "G4HumanPhantomColour.hh"
0046
0047 G4VPhysicalVolume* G4MIRDBrain::Construct(const G4String& volumeName,G4VPhysicalVolume* mother,
0048 const G4String& colourName, G4bool wireFrame,G4bool)
0049 {
0050 G4cout << "Construct " << volumeName <<" with mother "<<mother->GetName()<<G4endl;
0051 auto* material = new G4HumanPhantomMaterial();
0052 auto* soft = material -> GetMaterial("soft_tissue");
0053 delete material;
0054
0055 G4double ax = 6. * cm;
0056 G4double by= 9. * cm;
0057 G4double cz = 6.5 * cm;
0058
0059 auto* brain = new G4Ellipsoid("Brain", ax, by, cz);
0060
0061
0062 auto* logicBrain = new G4LogicalVolume(brain, soft,
0063 "logical" + volumeName,
0064 nullptr, nullptr, nullptr);
0065
0066
0067 G4VPhysicalVolume* physBrain = new G4PVPlacement(nullptr,
0068 G4ThreeVector(0.*cm, 0.*cm, 8.75 * cm),
0069 "physicalBrain",
0070 logicBrain,
0071 mother,
0072 false,
0073 0, true);
0074
0075
0076
0077 auto* colourPointer = new G4HumanPhantomColour();
0078 G4Colour colour = colourPointer -> GetColour(colourName);
0079
0080 auto* brainVisAtt = new G4VisAttributes(colour);
0081 brainVisAtt->SetForceSolid(wireFrame);
0082 brainVisAtt->SetLineWidth(0.7* mm);
0083 logicBrain->SetVisAttributes(brainVisAtt);
0084
0085
0086 G4double BrainVol = logicBrain->GetSolid()->GetCubicVolume();
0087 G4cout << "Volume of Brain = " << BrainVol/cm3 << " cm^3" << G4endl;
0088
0089
0090 G4String BrainMat = logicBrain->GetMaterial()->GetName();
0091 G4cout << "Material of Brain = " << BrainMat << G4endl;
0092
0093
0094 G4double BrainDensity = logicBrain->GetMaterial()->GetDensity();
0095 G4cout << "Density of Material = " << BrainDensity*cm3/g << " g/cm^3" << G4endl;
0096
0097
0098 G4double BrainMass = (BrainVol)*BrainDensity;
0099 G4cout << "Mass of Brain = " << BrainMass/gram << " g" << G4endl;
0100
0101 return physBrain;
0102 }