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 #include "G4MIRDUpperSpine.hh"
0031
0032 #include "globals.hh"
0033 #include "G4SystemOfUnits.hh"
0034 #include "G4SDManager.hh"
0035 #include "G4VisAttributes.hh"
0036 #include "G4VisAttributes.hh"
0037 #include "G4HumanPhantomMaterial.hh"
0038 #include "G4EllipticalTube.hh"
0039 #include "G4RotationMatrix.hh"
0040 #include "G4ThreeVector.hh"
0041 #include "G4VPhysicalVolume.hh"
0042 #include "G4PVPlacement.hh"
0043 #include "G4Box.hh"
0044 #include "G4SubtractionSolid.hh"
0045 #include "G4HumanPhantomColour.hh"
0046
0047 G4VPhysicalVolume* G4MIRDUpperSpine::Construct(const G4String& volumeName,
0048 G4VPhysicalVolume* mother,
0049 const G4String& colourName
0050 , G4bool wireFrame,G4bool)
0051 {
0052 auto* material = new G4HumanPhantomMaterial();
0053
0054 G4cout<<"Construct "<<volumeName<<" with mother volume "<<mother->GetName()<<G4endl;
0055
0056 auto* skeleton = material -> GetMaterial("skeleton");
0057
0058 delete material;
0059
0060 G4double dx = 2. *cm;
0061 G4double dy = 2.5 *cm;
0062 G4double dz = 4.25*cm;
0063
0064 auto* upperSpine = new G4EllipticalTube("UpperSpine",dx, dy, dz);
0065
0066 G4double xx = 20. * cm;
0067 G4double yy = 10. * cm;
0068 G4double zz = 5. * cm;
0069
0070 auto* subtraction = new G4Box("box", xx/2., yy/2., zz/2.);
0071
0072 auto* matrix = new G4RotationMatrix();
0073 matrix -> rotateX(-25.* deg);
0074
0075 auto* upper_spine = new G4SubtractionSolid("upperspine",upperSpine, subtraction,
0076 matrix, G4ThreeVector(0., -2.5 * cm, 5.5* cm));
0077
0078 auto* logicUpperSpine = new G4LogicalVolume(upper_spine, skeleton,
0079 "logical" + volumeName,
0080 nullptr, nullptr, nullptr);
0081
0082 G4VPhysicalVolume* physUpperSpine = new G4PVPlacement(nullptr,
0083 G4ThreeVector(0.0, 5.5 *cm, -3.5 *cm),
0084 "physicalUpperSpine",
0085 logicUpperSpine,
0086 mother,
0087 false,
0088 0, true);
0089
0090
0091
0092 auto* colourPointer = new G4HumanPhantomColour();
0093 G4Colour colour = colourPointer -> GetColour(colourName);
0094 auto* UpperSpineVisAtt = new G4VisAttributes(colour);
0095
0096 UpperSpineVisAtt->SetForceSolid(wireFrame);
0097 logicUpperSpine->SetVisAttributes(UpperSpineVisAtt);
0098
0099 G4cout << "UpperSpine created !!!!!!" << G4endl;
0100
0101
0102 G4double UpperSpineVol = logicUpperSpine->GetSolid()->GetCubicVolume();
0103 G4cout << "Volume of UpperSpine = " << UpperSpineVol/cm3 << " cm^3" << G4endl;
0104
0105
0106 G4String UpperSpineMat = logicUpperSpine->GetMaterial()->GetName();
0107 G4cout << "Material of UpperSpine = " << UpperSpineMat << G4endl;
0108
0109
0110 G4double UpperSpineDensity = logicUpperSpine->GetMaterial()->GetDensity();
0111 G4cout << "Density of Material = " << UpperSpineDensity*cm3/g << " g/cm^3" << G4endl;
0112
0113
0114 G4double UpperSpineMass = (UpperSpineVol)*UpperSpineDensity;
0115 G4cout << "Mass of UpperSpine = " << UpperSpineMass/gram << " g" << G4endl;
0116
0117 return physUpperSpine;
0118 }