Import Geant4 11.0.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2021-06-25 16:12:29 +02:00
parent c968e26a39
commit 6399a014b6
4200 changed files with 207479 additions and 237366 deletions
@@ -37,6 +37,13 @@
// * *
// ****************************************
//
#include "BrachyFactoryLeipzig.hh"
#include "BrachyFactoryTG186.hh"
#include "BrachyFactoryI.hh"
#include "BrachyFactoryFlexi.hh"
#include "BrachyFactoryOncura6711.hh"
#include "BrachyDetectorMessenger.hh"
#include "BrachyDetectorConstruction.hh"
#include "G4SystemOfUnits.hh"
#include "G4CSGSolid.hh"
#include "G4MaterialPropertyVector.hh"
@@ -52,21 +59,16 @@
#include "G4Colour.hh"
#include "G4UserLimits.hh"
#include "G4VisAttributes.hh"
#include "BrachyMaterial.hh"
#include "BrachyFactoryLeipzig.hh"
#include "BrachyFactoryTG186.hh"
#include "BrachyFactoryI.hh"
#include "BrachyFactoryFlexi.hh"
#include "BrachyFactoryOncura6711.hh"
#include "BrachyDetectorMessenger.hh"
#include "BrachyDetectorConstruction.hh"
#include "G4NistManager.hh"
BrachyDetectorConstruction::BrachyDetectorConstruction():
fDetectorChoice(0), fFactory(nullptr),
fWorld(nullptr), fWorldLog(nullptr), fWorldPhys(nullptr),
fFactory(nullptr), fWorld(nullptr), fWorldLog(nullptr), fWorldPhys(nullptr),
fPhantom(nullptr), fPhantomLog(nullptr), fPhantomPhys(nullptr),
fPhantomAbsorberMaterial(nullptr)
fDetectorChoice(0)
{
// Define the messenger of the Detector component
fDetectorMessenger = new BrachyDetectorMessenger(this);
// Define half size of the phantom along the x, y, z axis
fPhantomSizeX = 15.*cm;
fPhantomSizeY = 15.*cm;
@@ -77,29 +79,18 @@ BrachyDetectorConstruction::BrachyDetectorConstruction():
fWorldSizeY = 4.0*m;
fWorldSizeZ = 4.0*m;
// Define the messenger of the Detector component
// It is possible to modify geometrical parameters through UI
fDetectorMessenger = new BrachyDetectorMessenger(this);
// Define the Flexi source as default source modelled in the geometry
fFactory = new BrachyFactoryFlexi();
// BrachyMaterial defined the all the materials necessary
// for the experimental set-up
fMaterial = new BrachyMaterial();
}
BrachyDetectorConstruction::~BrachyDetectorConstruction()
{
delete fMaterial;
delete fDetectorMessenger;
delete fFactory;
delete fDetectorMessenger;
}
G4VPhysicalVolume* BrachyDetectorConstruction::Construct()
{
fMaterial -> DefineMaterials();
// Model the phantom (water box)
ConstructPhantom();
@@ -113,7 +104,7 @@ void BrachyDetectorConstruction::SwitchBrachytherapicSeed()
{
// Change the source in the water phantom
fFactory -> CleanSource();
G4cout << "Old Source is deleted ..." << G4endl;
G4cout << "Old brachy source is deleted ..." << G4endl;
delete fFactory;
switch(fDetectorChoice)
@@ -139,7 +130,7 @@ void BrachyDetectorConstruction::SwitchBrachytherapicSeed()
}
fFactory -> CreateSource(fPhantomPhys);
G4cout << "... New source is created ..." << G4endl;
G4cout << "New brachy source is created ..." << G4endl;
// Notify run manager that the new geometry has been built
G4RunManager::GetRunManager() -> GeometryHasBeenModified();
@@ -171,7 +162,7 @@ void BrachyDetectorConstruction::SelectBrachytherapicSeed(G4String val)
}
}
}
G4cout << "Now the source is " << val << G4endl;
G4cout << "Now the brachy source is " << val << G4endl;
}
void BrachyDetectorConstruction::ConstructPhantom()
@@ -181,8 +172,10 @@ void BrachyDetectorConstruction::ConstructPhantom()
// Define the light blue color
G4Colour lblue (0.0, 0.0, .75);
G4Material* air = fMaterial -> GetMat("Air") ;
G4Material* water = fMaterial -> GetMat("Water");
//Get nist material manager
G4NistManager* nist = G4NistManager::Instance();
G4Material* air = nist -> FindOrBuildMaterial("G4_AIR");
G4Material* water = nist -> FindOrBuildMaterial("G4_WATER");
// World volume
fWorld = new G4Box("World", fWorldSizeX, fWorldSizeY, fWorldSizeZ);
@@ -222,7 +215,7 @@ void BrachyDetectorConstruction::PrintDetectorParameters()
<< fPhantomSizeZ *2./cm
<< " cm" << G4endl
<< "The phantom is made of "
<< fPhantomAbsorberMaterial -> GetName() <<G4endl
<< fPhantomLog -> GetMaterial() -> GetName() <<G4endl
<< "the source is at the center of the phantom" << G4endl
<< "----------------"
<< G4endl;
@@ -230,17 +223,16 @@ void BrachyDetectorConstruction::PrintDetectorParameters()
void BrachyDetectorConstruction::SetPhantomMaterial(G4String materialChoice)
{
// It is possible to change the material of the phantom
// interactively
// Method to change the material of the phantom
G4NistManager* nist = G4NistManager::Instance();
// Search the material by its name
G4Material* pttoMaterial = G4Material::GetMaterial(materialChoice);
G4Material* pttoMaterial = nist -> FindOrBuildMaterial(materialChoice);
if (pttoMaterial)
{
fPhantomAbsorberMaterial = pttoMaterial;
fPhantomLog -> SetMaterial(pttoMaterial);
PrintDetectorParameters();
} else
{ G4cout << "WARNING: material '" << materialChoice << "' not available!" << G4endl;}
} else G4cout << "WARNING: material '" << materialChoice << "' not available!" << G4endl;
}
@@ -51,9 +51,9 @@
#include "G4Transform3D.hh"
#include "G4RotationMatrix.hh"
#include "G4TransportationManager.hh"
#include "BrachyMaterial.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
#include "G4NistManager.hh"
BrachyDetectorConstructionFlexi::BrachyDetectorConstructionFlexi()
: fSteelShell(nullptr), fLogicalSteelShell(nullptr), fAirGap(nullptr), fLogicalAirGap(nullptr), fPhysicalAirGap(nullptr),
@@ -62,21 +62,36 @@ BrachyDetectorConstructionFlexi::BrachyDetectorConstructionFlexi()
fCable(nullptr), fLogicalCable(nullptr), fPhysicalCable(nullptr),
fIridiumCore(nullptr), fLogicalIridiumCore(nullptr), fPhysicalIridiumCore(nullptr),
fSteelAttributes(nullptr), fEndAttributes(nullptr), fSimpleIridiumVisAtt(nullptr)
{
fMat = new BrachyMaterial();
}
{}
BrachyDetectorConstructionFlexi::~BrachyDetectorConstructionFlexi()
{
delete fMat;
}
{}
void BrachyDetectorConstructionFlexi::ConstructFlexi(G4VPhysicalVolume* mother)
{
G4Material* steelMat = fMat -> GetMat("Stainless steel 304");
G4Material* iridiumMat = fMat -> GetMat("Iridium");
G4Material* airMat = fMat -> GetMat("Air");
G4NistManager* nist = G4NistManager::Instance();
G4Material* iridiumMat = nist -> FindOrBuildMaterial("G4_Ir");
G4Material* airMat = nist -> FindOrBuildMaterial("G4_AIR");
//Define Stainless-steel-304 - Flexi source
G4int Z; //atomic number of the element
G4Element* elC = nist -> FindOrBuildElement(Z=6);
G4Element* elMn = nist -> FindOrBuildElement(Z=12);
G4Element* elSi = nist -> FindOrBuildElement(Z=14);
G4Element* elCr = nist -> FindOrBuildElement(Z=24);
G4Element* elFe = nist -> FindOrBuildElement(Z=26);
G4Element* elNi = nist -> FindOrBuildElement(Z=28);
constexpr G4double d = 7.999*g/cm3;
G4Material* steelMat = new G4Material("Stainless steel 304",d,6);
steelMat -> AddElement(elMn, 0.02);
steelMat -> AddElement(elSi, 0.01);
steelMat -> AddElement(elCr, 0.19);
steelMat -> AddElement(elNi, 0.10);
steelMat -> AddElement(elFe, 0.6792);
steelMat -> AddElement(elC, 0.0008);
//Define dimensions of the outer Steel shell around the solid source - not including the ends
G4double shellr_min = 0.00 * mm;
@@ -37,9 +37,9 @@
// ****************************************
//
//
#include "BrachyDetectorConstructionI.hh"
#include "globals.hh"
#include "G4SystemOfUnits.hh"
#include "BrachyDetectorConstructionI.hh"
#include "G4CSGSolid.hh"
#include "G4Sphere.hh"
#include "G4MaterialPropertyVector.hh"
@@ -52,33 +52,28 @@
#include "G4Transform3D.hh"
#include "G4RotationMatrix.hh"
#include "G4TransportationManager.hh"
#include "BrachyMaterial.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
#include "G4NistManager.hh"
BrachyDetectorConstructionI::BrachyDetectorConstructionI():
fDefaultTub(nullptr), fCapsule(nullptr), fCapsuleTip(nullptr), fIodineCore(nullptr), fDefaultTubLog(nullptr),
fCapsuleLog(nullptr), fCapsuleTipLog(nullptr), fIodineCoreLog(nullptr), fDefaultTubPhys(nullptr),
fCapsulePhys(nullptr),fCapsuleTipPhys1(nullptr),fCapsuleTipPhys2(nullptr), fIodineCorePhys(nullptr),
fSimpleIodineVisAtt(nullptr), fSimpleCapsuleVisAtt(nullptr), fSimpleCapsuleTipVisAtt(nullptr)
{
fMaterial = new BrachyMaterial();
}
{}
BrachyDetectorConstructionI::~BrachyDetectorConstructionI()
{
delete fMaterial;
}
{}
void BrachyDetectorConstructionI::ConstructIodine(G4VPhysicalVolume* mother)
{
// source Bebig Isoseed I-125 ...
//Get materials for source construction ...
G4Material* titanium = fMaterial -> GetMat("titanium");
G4Material* air = fMaterial -> GetMat("Air");
G4Material* Iodine = fMaterial -> GetMat("Iodine");
// Model of the Bebig Isoseed I-125 brachy source
G4NistManager* nist = G4NistManager::Instance();
G4Material* titanium = nist -> FindOrBuildMaterial("G4_Ti");
G4Material* iodine = nist -> FindOrBuildMaterial("G4_I");
G4Material* air = nist -> FindOrBuildMaterial("G4_AIR");
G4Colour red (1.0, 0.0, 0.0) ;
G4Colour magenta (1.0, 0.0, 1.0) ;
G4Colour lblue (0.0, 0.0, .75);
@@ -94,8 +89,7 @@ void BrachyDetectorConstructionI::ConstructIodine(G4VPhysicalVolume* mother)
false,
0, true);
// Capsule main body ...
G4double capsuleR = 0.35*mm;
fCapsule = new G4Tubs("fCapsule", capsuleR,0.40*mm,1.84*mm,0.*deg,360.*deg);
fCapsule = new G4Tubs("fCapsule", 0.35*mm,0.40*mm,1.84*mm,0.*deg,360.*deg);
fCapsuleLog = new G4LogicalVolume(fCapsule,titanium,"fCapsuleLog");
fCapsulePhys = new G4PVPlacement(nullptr,
G4ThreeVector(),
@@ -134,7 +128,7 @@ void BrachyDetectorConstructionI::ConstructIodine(G4VPhysicalVolume* mother)
// Radiactive core ...
fIodineCore = new G4Tubs("ICore",0.085*mm,0.35*mm,1.75*mm,0.*deg,360.*deg);
fIodineCoreLog = new G4LogicalVolume(fIodineCore,Iodine,"IodineCoreLog");
fIodineCoreLog = new G4LogicalVolume(fIodineCore,iodine,"IodineCoreLog");
fIodineCorePhys = new G4PVPlacement(nullptr,
G4ThreeVector(0.,0.,0.),
"IodineCorePhys",
@@ -37,13 +37,9 @@
// * *
// *******************************************
//
//
//
// Code by S. Guatelli
//
#include "BrachyDetectorConstructionLeipzig.hh"
#include "globals.hh"
#include "G4SystemOfUnits.hh"
#include "BrachyDetectorConstructionLeipzig.hh"
#include "G4CSGSolid.hh"
#include "G4Sphere.hh"
#include "G4RunManager.hh"
@@ -55,46 +51,55 @@
#include "G4Transform3D.hh"
#include "G4RotationMatrix.hh"
#include "G4TransportationManager.hh"
#include "BrachyMaterial.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
// Leipzig Applicator ...
#include "G4NistManager.hh"
BrachyDetectorConstructionLeipzig::BrachyDetectorConstructionLeipzig():
fCapsule(nullptr), fCapsuleTip(nullptr), fIridiumCore(nullptr), fApplicator1(nullptr), fApplicator2(nullptr),
fCapsuleLog(nullptr), fCapsuleTipLog(nullptr), fIridiumCoreLog(nullptr), fApplicator1Log(nullptr),
fApplicator2Log(nullptr), fCapsulePhys(nullptr), fCapsuleTipPhys(nullptr), fIridiumCorePhys(nullptr),
fApplicator1Phys(nullptr), fApplicator2Phys(nullptr)
{
fMaterial = new BrachyMaterial();
}
{}
BrachyDetectorConstructionLeipzig::~BrachyDetectorConstructionLeipzig()
{
delete fMaterial;
}
{}
void BrachyDetectorConstructionLeipzig::ConstructLeipzig(G4VPhysicalVolume* mother)
{
G4Colour red (1.0, 0.0, 0.0) ;
G4Colour lblue (0.0, 0.0, .75);
G4Material* capsuleMat = fMaterial -> GetMat("Stainless steel");
G4Material* iridium = fMaterial -> GetMat("Iridium");
G4Material* tungsten = fMaterial -> GetMat("Tungsten");
G4NistManager* nist = G4NistManager::Instance();
G4Material* iridium = nist -> FindOrBuildMaterial("G4_Ir");
G4Material* tungsten = nist -> FindOrBuildMaterial("G4_W");
// Stainless steel (Medical Physics, Vol 25, No 10, Oct 1998)
constexpr G4double d = 8.02*g/cm3;
G4int Z; //atomic number of the element
G4Element* elMn = nist -> FindOrBuildElement(Z=12);
G4Element* elSi = nist -> FindOrBuildElement(Z=14);
G4Element* elCr = nist -> FindOrBuildElement(Z=24);
G4Element* elFe = nist -> FindOrBuildElement(Z=26);
G4Element* elNi = nist -> FindOrBuildElement(Z=28);
G4Material* steel = new G4Material("Stainless steel",d,5);
steel -> AddElement(elMn, 0.02);
steel -> AddElement(elSi, 0.01);
steel -> AddElement(elCr, 0.19);
steel -> AddElement(elNi, 0.10);
steel -> AddElement(elFe, 0.68);
//Iridium source ...
fCapsule = new G4Tubs("Capsule",0,0.55*mm,3.725*mm,0.*deg,360.*deg);
fCapsuleLog = new G4LogicalVolume(fCapsule,capsuleMat,"CapsuleLog");
fCapsuleLog = new G4LogicalVolume(fCapsule,steel,"CapsuleLog");
fCapsulePhys = new G4PVPlacement(nullptr, G4ThreeVector(0,0,-1.975*mm),"CapsulePhys",
fCapsuleLog,mother, //mother volume: phantom
false,0, true);
// Capsule tip
fCapsuleTip = new G4Sphere("CapsuleTip",0.*mm,0.55*mm,0.*deg,360.*deg,0.*deg,90.*deg);
fCapsuleTipLog = new G4LogicalVolume(fCapsuleTip,capsuleMat,"CapsuleTipLog");
fCapsuleTipLog = new G4LogicalVolume(fCapsuleTip,steel,"CapsuleTipLog");
fCapsuleTipPhys = new G4PVPlacement(nullptr,G4ThreeVector(0.,0.,1.75*mm),"CapsuleTipPhys",
fCapsuleTipLog,mother,false,0, true);
// Iridium core
@@ -39,9 +39,9 @@
//
//
//
#include "BrachyDetectorConstructionOncura6711.hh"
#include "globals.hh"
#include "G4SystemOfUnits.hh"
#include "BrachyDetectorConstructionOncura6711.hh"
#include "G4Sphere.hh"
#include "G4RunManager.hh"
#include "G4Box.hh"
@@ -52,7 +52,7 @@
#include "G4Transform3D.hh"
#include "G4RotationMatrix.hh"
#include "G4TransportationManager.hh"
#include "BrachyMaterial.hh"
#include "G4NistManager.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
@@ -70,41 +70,38 @@ BrachyDetectorConstructionOncura6711::BrachyDetectorConstructionOncura6711()
fOncuraSilverCorePhys(nullptr),
fOncuraCapsuleShellVisAtt(nullptr), fOncuraCapsuleTipVisAtt(nullptr),
fOncuraSilverCoreVisAtt(nullptr)
{
fMat = new BrachyMaterial();
}
{}
BrachyDetectorConstructionOncura6711::~BrachyDetectorConstructionOncura6711()
{
delete fMat;
}
{}
void BrachyDetectorConstructionOncura6711::ConstructOncura6711(G4VPhysicalVolume* mother)
{
G4Colour red (1.0, 0.0, 0.0) ;
G4Colour magenta (1.0, 0.0, 1.0) ;
G4Material* titaniumMat = fMat -> GetMat("titanium");
G4Material* airMat = fMat -> GetMat("Air");
G4Material* silverMat = fMat -> GetMat("Silver");
G4NistManager* nist = G4NistManager::Instance();
G4Material* titanium = nist -> FindOrBuildMaterial("G4_Ti");
G4Material* air = nist -> FindOrBuildMaterial("G4_AIR");
G4Material* silver = nist -> FindOrBuildMaterial("G4_Ag");
//Capsule shell
fOncuraCapsule = new G4Tubs("OncuraCapsule",0,0.4*mm,1.875*mm,0.*deg,360.*deg);
fOncuraCapsuleLog = new G4LogicalVolume(fOncuraCapsule,titaniumMat,"OncuraCapsuleLog", 0,0,0);
fOncuraCapsuleLog = new G4LogicalVolume(fOncuraCapsule,titanium,"OncuraCapsuleLog", 0,0,0);
fOncuraCapsulePhys = new G4PVPlacement(nullptr, G4ThreeVector(0,0,0),
"OncuraCapsulePhys", fOncuraCapsuleLog,
mother, false, 0, true);
//Capsule tips
fOncuraCapsuleTip1 = new G4Sphere("OncuraCapsuleTip1", 0, 0.4*mm, 0., 360*deg, 0., 90*deg);
fOncuraCapsuleTip1Log = new G4LogicalVolume(fOncuraCapsuleTip1, titaniumMat, "OncuraCapsuleTip1Log",0,0,0);
fOncuraCapsuleTip1Log = new G4LogicalVolume(fOncuraCapsuleTip1, titanium, "OncuraCapsuleTip1Log",0,0,0);
fOncuraCapsuleTip1Phys = new G4PVPlacement(nullptr, G4ThreeVector(0,0,1.875*mm),
"OncuraCapsuleTip1Phys", fOncuraCapsuleTip1Log,
mother, false,
0, true);
fOncuraCapsuleTip2 = new G4Sphere("OncuraCapsuleTip2", 0, 0.4*mm, 0., 360*deg, 90*deg, 90*deg);
fOncuraCapsuleTip2Log = new G4LogicalVolume(fOncuraCapsuleTip2, titaniumMat, "OncuraCapsuleTip2Log",0,0,0);
fOncuraCapsuleTip2Log = new G4LogicalVolume(fOncuraCapsuleTip2, titanium, "OncuraCapsuleTip2Log",0,0,0);
fOncuraCapsuleTip2Phys = new G4PVPlacement(nullptr, G4ThreeVector(0,0,-1.875*mm),
"OncuraCapsuleTip2Phys", fOncuraCapsuleTip2Log,
mother, false,
@@ -112,7 +109,7 @@ fOncuraCapsuleTip2Phys = new G4PVPlacement(nullptr, G4ThreeVector(0,0,-1.875*mm)
//Air gap
fOncuraAirGap = new G4Tubs("OncuraAirGap",0,0.33*mm,1.825*mm,0.*deg,360.*deg);
fOncuraAirGapLog = new G4LogicalVolume(fOncuraAirGap, airMat, "OncuraAirGapLog");
fOncuraAirGapLog = new G4LogicalVolume(fOncuraAirGap, air, "OncuraAirGapLog");
fOncuraAirGapPhys = new G4PVPlacement(nullptr, G4ThreeVector(0,0,0),
"OncuraAirGapPhys", fOncuraAirGapLog,
fOncuraCapsulePhys, false,
@@ -120,7 +117,7 @@ fOncuraAirGapPhys = new G4PVPlacement(nullptr, G4ThreeVector(0,0,0),
//Silver core
fOncuraSilverCore = new G4Tubs("OncuraSilverCore",0,0.25*mm,1.4*mm,0.*deg,360.*deg);
fOncuraSilverCoreLog = new G4LogicalVolume(fOncuraSilverCore, silverMat, "silverCoreLog");
fOncuraSilverCoreLog = new G4LogicalVolume(fOncuraSilverCore, silver, "silverCoreLog");
fOncuraSilverCorePhys = new G4PVPlacement(nullptr, G4ThreeVector(0,0,0),
"OncuraSilverCorePhys", fOncuraSilverCoreLog,
fOncuraAirGapPhys, false,
@@ -38,9 +38,9 @@
// ****************************************
//
//
#include "BrachyDetectorConstructionTG186.hh"
#include "globals.hh"
#include "G4SystemOfUnits.hh"
#include "BrachyDetectorConstructionTG186.hh"
#include "G4Sphere.hh"
#include "G4RunManager.hh"
#include "G4Box.hh"
@@ -51,12 +51,11 @@
#include "G4Transform3D.hh"
#include "G4RotationMatrix.hh"
#include "G4TransportationManager.hh"
#include "BrachyMaterial.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
#include "G4NistManager.hh"
BrachyDetectorConstructionTG186::BrachyDetectorConstructionTG186()
:
BrachyDetectorConstructionTG186::BrachyDetectorConstructionTG186():
fTG186capsule(nullptr), fTG186capsuleLog(nullptr),
fTG186capsulePhys(nullptr),
fTG186capsuleTip(nullptr), fTG186capsuleTipLog(nullptr),
@@ -67,22 +66,34 @@ BrachyDetectorConstructionTG186::BrachyDetectorConstructionTG186()
fTG186cablePhys(nullptr),
fTG186simpleCapsuleVisAtt(nullptr), fTG186simpleCapsuleTipVisAtt(nullptr), fTG186simpleIridiumVisAtt(nullptr),
fTG186simpleCableVisAtt(nullptr)
{
fMat = new BrachyMaterial();
}
{}
BrachyDetectorConstructionTG186::~BrachyDetectorConstructionTG186()
{
delete fMat;
}
{}
void BrachyDetectorConstructionTG186::ConstructTG186(G4VPhysicalVolume* mother)
{
G4Colour red (1.0, 0.0, 0.0) ;
G4Colour magenta (1.0, 0.0, 1.0) ;
G4Material* capsuleMat = fMat -> GetMat("Stainless steel");
G4Material* iridiumMat = fMat -> GetMat("Iridium");
G4NistManager* nist = G4NistManager::Instance();
G4Material* iridium = nist -> FindOrBuildMaterial("G4_Ir");
// Stainless steel (Medical Physics, Vol 25, No 10, Oct 1998)
constexpr G4double d = 8.02*g/cm3;
G4int Z; //atomic number of the element
G4Element* elMn = nist -> FindOrBuildElement(Z=12);
G4Element* elSi = nist -> FindOrBuildElement(Z=14);
G4Element* elCr = nist -> FindOrBuildElement(Z=24);
G4Element* elFe = nist -> FindOrBuildElement(Z=26);
G4Element* elNi = nist -> FindOrBuildElement(Z=28);
G4Material* capsuleMat = new G4Material("Stainless steel",d,5);
capsuleMat -> AddElement(elMn, 0.02);
capsuleMat -> AddElement(elSi, 0.01);
capsuleMat -> AddElement(elCr, 0.19);
capsuleMat -> AddElement(elNi, 0.10);
capsuleMat -> AddElement(elFe, 0.68);
// Capsule main body
fTG186capsule = new G4Tubs("TG186-Capsule",0,0.5*mm,2.25*mm,0.*deg,360.*deg);
@@ -107,6 +118,7 @@ void BrachyDetectorConstructionTG186::ConstructTG186(G4VPhysicalVolume* mother)
fTG186capsuleTipLog = new G4LogicalVolume(fTG186capsuleTip,
capsuleMat,
"CapsuleTipIridumLog");
fTG186capsuleTipPhys = new G4PVPlacement(nullptr,
G4ThreeVector(0.,0.,1.85*mm),
"TG186-CapsuleTipIridiumPhys",
@@ -138,7 +150,7 @@ void BrachyDetectorConstructionTG186::ConstructTG186(G4VPhysicalVolume* mother)
fTG186iridiumCore = new G4Tubs("TG186-IrCore",0,0.30*mm,1.75*mm,0.*deg,360.*deg);
fTG186iridiumCoreLog = new G4LogicalVolume(fTG186iridiumCore,
iridiumMat,
iridium,
"TG186-IridiumCoreLog");
fTG186iridiumCorePhys = new G4PVPlacement(nullptr,
@@ -34,7 +34,8 @@
// *******************************
//
//
#include "globals.hh"
#include "BrachyDetectorMessenger.hh"
#include "BrachyDetectorConstructionFlexi.hh"
#include "BrachyFactoryFlexi.hh"
#include "G4ParticleTable.hh"
#include "Randomize.hh"
@@ -43,8 +44,7 @@
#include "G4IonTable.hh"
#include "G4UImanager.hh"
#include "G4RunManager.hh"
#include "BrachyDetectorMessenger.hh"
#include "BrachyDetectorConstructionFlexi.hh"
#include "globals.hh"
BrachyFactoryFlexi:: BrachyFactoryFlexi()
{
@@ -61,7 +61,7 @@ void BrachyFactoryFlexi::CreateSource(G4VPhysicalVolume* mother)
fFlexiSource -> ConstructFlexi(mother);
}
void BrachyFactoryFlexi::CleanSource()
void BrachyFactoryFlexi::CleanSource()
{
fFlexiSource -> CleanFlexi();
fFlexiSource = nullptr;
@@ -33,7 +33,8 @@
// *******************************
//
//
#include "BrachyDetectorMessenger.hh"
#include "BrachyDetectorConstructionLeipzig.hh"
#include "globals.hh"
#include "BrachyFactoryLeipzig.hh"
#include "G4ParticleTable.hh"
@@ -43,8 +44,6 @@
#include "G4IonTable.hh"
#include "G4UImanager.hh"
#include "G4RunManager.hh"
#include "BrachyDetectorMessenger.hh"
#include "BrachyDetectorConstructionLeipzig.hh"
BrachyFactoryLeipzig:: BrachyFactoryLeipzig()
{
@@ -32,8 +32,9 @@
// * *
// ********************************
//
//
//
#include "BrachyDetectorMessenger.hh"
#include "BrachyDetectorConstructionOncura6711.hh"
#include "globals.hh"
#include "BrachyFactoryOncura6711.hh"
#include "G4ParticleTable.hh"
@@ -43,8 +44,6 @@
#include "G4IonTable.hh"
#include "G4UImanager.hh"
#include "G4RunManager.hh"
#include "BrachyDetectorMessenger.hh"
#include "BrachyDetectorConstructionOncura6711.hh"
BrachyFactoryOncura6711:: BrachyFactoryOncura6711()
{
@@ -33,6 +33,8 @@
// *******************************
//
//
#include "BrachyDetectorMessenger.hh"
#include "BrachyDetectorConstructionTG186.hh"
#include "globals.hh"
#include "BrachyFactoryTG186.hh"
#include "G4ParticleTable.hh"
@@ -42,8 +44,6 @@
#include "G4IonTable.hh"
#include "G4UImanager.hh"
#include "G4RunManager.hh"
#include "BrachyDetectorMessenger.hh"
#include "BrachyDetectorConstructionTG186.hh"
BrachyFactoryTG186:: BrachyFactoryTG186()
{
@@ -1,258 +0,0 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// Code developed by:
// S.Guatelli, A. Le
//
// *******************************
// * *
// * BrachyMaterial.cc *
// * *
// *******************************
//
//
#include "globals.hh"
#include "Randomize.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4MaterialTable.hh"
#include "G4MaterialPropertiesTable.hh"
#include "G4MaterialPropertyVector.hh"
#include "G4RunManager.hh"
#include "G4Element.hh"
#include "G4ElementTable.hh"
#include "BrachyMaterial.hh"
BrachyMaterial::BrachyMaterial(): fW(nullptr),
fPlexiglass(nullptr), fPb(nullptr), fIr192(nullptr),
fTi(nullptr), fAir(nullptr), fH2O(nullptr),
fSoft(nullptr), fSteel(nullptr), fMat304steel(nullptr),
fAu(nullptr), fI(nullptr), fCeramic(nullptr),
fVacuum(nullptr), fBone(nullptr), fMuscle(nullptr), fAg(nullptr)
{;}
BrachyMaterial::~BrachyMaterial()
{;}
void BrachyMaterial::DefineMaterials()
{
// Define required materials
G4double A; // atomic mass
G4double Z; // atomic number
G4double d; // density
// General elements
A = 1.01*g/mole;
G4Element* elH = new G4Element ("Hydrogen","H",Z = 1.,A);
A = 14.01*g/mole;
G4Element* elN = new G4Element("Nitrogen","N",Z = 7.,A);
A = 16.00*g/mole;
G4Element* elO = new G4Element("Oxygen","O",Z = 8.,A);
A=26.98*g/mole;
G4Element* elAl = new G4Element("Aluminum","Al", Z = 13.,A);
A = 12.011*g/mole;
G4Element* elC = new G4Element("Carbon","C",Z = 6.,A);
A = 22.99*g/mole;
G4Element* elNa = new G4Element("Sodium","Na",Z = 11.,A);
A = 24.305*g/mole;
G4Element* elMg = new G4Element("Magnesium","Mg",Z = 12.,A);
A = 30.974*g/mole;
G4Element* elP = new G4Element("Phosphorus","P",Z = 15.,A);
A = 32.06*g/mole;
G4Element* elS = new G4Element("Sulfur","S",Z = 16.,A);
A = 35.453*g/mole;
G4Element* elCl = new G4Element("Chlorine","Cl",Z = 17.,A);
A = 39.098*g/mole;
G4Element* elK = new G4Element("Potassium","K",Z = 19.,A);
A = 40.08*g/mole;
G4Element* elCa = new G4Element("Calcium","Ca",Z = 20.,A);
A = 65.38*g/mole;
G4Element* elZn = new G4Element("Zinc","Zn",Z = 30.,A);
A = 54.94*g/mole;
G4Element* elMn = new G4Element("Manganese","Mn",Z = 25.,A);
A = 28.09*g/mole;
G4Element* elSi = new G4Element("Silicon","Si",Z = 14.,A);
A = 52.00*g/mole;
G4Element* elCr = new G4Element("Chromium","Cr",Z = 24.,A);
A = 58.70*g/mole;
G4Element* elNi = new G4Element("Nickel","Ni",Z = 28.,A);
A = 55.85*g/mole;
G4Element* elFe = new G4Element("Iron","Fe",Z = 26.,A);
A = 183.84* g/mole;
d = 19.3*g/cm3;
fW = new G4Material("Tungsten",Z = 74.,A,d);
// Perspex, plexiglass, lucite
d = 1.19*g/cm3;
fPlexiglass = new G4Material("Plexiglass",d,3);
fPlexiglass -> AddElement(elH,0.08);
fPlexiglass -> AddElement(elC,0.60);
fPlexiglass -> AddElement(elO,0.32);
// Lead material
A = 207.19*g/mole;
Z = 82;
d = 11.35*g/cm3;
fPb = new G4Material("Lead",Z,A,d);
// Iridium (Medical Physics, Vol 25, No 10, Oct 1998)
d = 22.42*g/cm3;
A = 191.96260*g/mole ;
Z = 77;
fIr192 = new G4Material("Iridium",Z,A,d);
//titanium
A = 47.88*g/mole;
d = 4.50*g/cm3;
fTi = new G4Material("titanium" ,Z = 22.,A,d);
//silver
A = 107.87*g/mole;
d = 10.49*g/cm3;
Z = 22.0;
fAg = new G4Material("Silver", Z, A, d);
// Air material
d = 1.290*mg/cm3;
fAir = new G4Material("Air",d,2);
fAir -> AddElement(elN,0.7);
fAir -> AddElement(elO,0.3);
// Water
d = 1.000*g/cm3;
fH2O = new G4Material("Water",d,2);
fH2O -> AddElement(elH,2);
fH2O -> AddElement(elO,1);
fH2O -> GetIonisation()->SetMeanExcitationEnergy(75.0*eV);
//soft tissue(http://www.nist.gov)
d = 1.0*g/cm3;
fSoft = new G4Material("tissue",d,13);
fSoft -> AddElement(elH,0.104472);
fSoft -> AddElement(elC,0.23219);
fSoft -> AddElement(elN,0.02488);
fSoft -> AddElement(elO,0.630238);
fSoft -> AddElement(elNa,0.00113);
fSoft -> AddElement(elMg,0.00013);
fSoft -> AddElement(elP,0.00133);
fSoft -> AddElement(elS,0.00199);
fSoft -> AddElement(elCl,0.00134);
fSoft -> AddElement(elK,0.00199);
fSoft -> AddElement(elCa,0.00023);
fSoft -> AddElement(elFe,0.00005);
fSoft -> AddElement(elZn,0.00003);
// Stainless steel (Medical Physics, Vol 25, No 10, Oct 1998)
d = 8.02*g/cm3 ;
fSteel = new G4Material("Stainless steel",d,5);
fSteel -> AddElement(elMn, 0.02);
fSteel -> AddElement(elSi, 0.01);
fSteel -> AddElement(elCr, 0.19);
fSteel -> AddElement(elNi, 0.10);
fSteel -> AddElement(elFe, 0.68);
//Define Stainless-steel-304 - Flexi source
d = 7.999*g/cm3;
fMat304steel = new G4Material("Stainless steel 304",d,6);
fMat304steel -> AddElement(elMn, 0.02);
fMat304steel -> AddElement(elSi, 0.01);
fMat304steel -> AddElement(elCr, 0.19);
fMat304steel -> AddElement(elNi, 0.10);
fMat304steel -> AddElement(elFe, 0.6792);
fMat304steel -> AddElement(elC, 0.0008);
//gold
A = 196.97*g/mole;
d = 19.32*g/cm3;
fAu = new G4Material("gold",Z = 79.,A,d);
//Iodine Core
A = 124.9*g/mole;
d = 4.862*g/cm3;
fI = new G4Material("Iodine",Z = 53.,A,d);
//ceramic(Medical Physics, May 2000)
d = 2.88*g/cm3;
fCeramic = new G4Material("allumina",d,2);
fCeramic -> AddElement(elAl,2);
fCeramic -> AddElement(elO,3);
G4double density = universe_mean_density;
G4double pressure = 3.e-18*pascal;
G4double temperature = 2.73*kelvin;
A=1.01*g/mole;
fVacuum = new G4Material("Galactic", Z = 1., A,density,kStateGas,temperature,pressure);
//compact bone (http://www.NIST.gov)
d = 1.85*g/cm3;
fBone = new G4Material("bone",d,8);
fBone -> AddElement(elH,0.063984);
fBone -> AddElement(elC,0.278);
fBone -> AddElement(elN,0.027);
fBone -> AddElement(elO,0.410016);
fBone -> AddElement(elMg,0.002);
fBone -> AddElement(elP,0.07);
fBone -> AddElement(elS,0.002);
fBone -> AddElement(elCa,0.147);
//muscle(http://www.NIST.gov)
fMuscle = new G4Material("muscle",d,9);
fMuscle -> AddElement(elH,0.101997);
fMuscle -> AddElement(elC,0.123);
fMuscle -> AddElement(elN,0.035);
fMuscle -> AddElement(elNa,0.0008);
fMuscle -> AddElement(elO,0.729);
fMuscle -> AddElement(elMg,0.0002);
fMuscle -> AddElement(elP,0.002);
fMuscle -> AddElement(elS,0.005);
fMuscle -> AddElement(elK,0.003);
}
G4Material* BrachyMaterial::GetMat(G4String material)
{
// Returns a material
G4Material* pttoMaterial = G4Material::GetMaterial(material);
return pttoMaterial;
}
@@ -33,6 +33,8 @@ Author: Susanna Guatelli
// * *
// **********************************
//
#include "BrachyPhysicsList.hh"
#include "BrachyPhysicsListMessenger.hh"
#include "G4EmStandardPhysics_option4.hh"
#include "G4EmLivermorePhysics.hh"
#include "G4EmStandardPhysics.hh"
@@ -43,7 +45,6 @@ Author: Susanna Guatelli
#include "G4DecayPhysics.hh"
#include "G4RadioactiveDecayPhysics.hh"
#include "G4EmPenelopePhysics.hh"
#include "BrachyPhysicsList.hh"
#include "G4VPhysicsConstructor.hh"
#include "G4ParticleDefinition.hh"
#include "G4ProductionCutsTable.hh"
@@ -54,14 +55,17 @@ Author: Susanna Guatelli
#include "G4ParticleDefinition.hh"
#include "globals.hh"
#include "G4SystemOfUnits.hh"
#include "BrachyPhysicsListMessenger.hh"
#include "G4UAtomicDeexcitation.hh"
#include "G4LossTableManager.hh"
BrachyPhysicsList::BrachyPhysicsList(): G4VModularPhysicsList()
{
SetVerboseLevel(1);
G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(250*eV, 1*GeV);
SetDefaultCutValue(0.05 *mm);
DumpCutValuesTable();
// EM physics: default
fEmPhysicsList = new G4EmLivermorePhysics();
fEmName="emlivermore";
@@ -159,30 +163,3 @@ void BrachyPhysicsList::AddPhysicsList(const G4String& name)
<< G4endl;
}
void BrachyPhysicsList::SetCuts()
{
// Definition of threshold of production
// of secondary particles
// This is defined in range.
defaultCutValue = 0.05 * mm;
SetCutValue(defaultCutValue, "gamma");
SetCutValue(defaultCutValue, "e-");
SetCutValue(defaultCutValue, "e+");
// By default the low energy limit to produce
// secondary particles is 990 eV.
// This value is correct when using the EM Standard Physics.
// When using the Low Energy Livermore this value can be
// changed to 250 eV corresponding to the limit
// of validity of the physics models.
// Comment out following three lines if the
// Standard electromagnetic Package is adopted.
G4double lowLimit = 250. * eV;
G4double highLimit = 100. * GeV;
G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(lowLimit,
highLimit);
// Print the cuts
if (verboseLevel>0) DumpCutValuesTable();
}
@@ -30,16 +30,15 @@
BrachyPhysicsListMessenger::BrachyPhysicsListMessenger(BrachyPhysicsList* pPhys)
:G4UImessenger(),
fPhysicsList(pPhys),fPhysDir(0),fListCmd(0)
fPhysicsList(pPhys),fPhysDir(nullptr),fListCmd(nullptr)
{
fPhysDir = new G4UIdirectory("/testem/phys/");
fPhysDir->SetGuidance("physics list commands");
fPhysDir -> SetGuidance("physics list commands");
fListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this);
fListCmd->SetGuidance("Add modula physics list.");
fListCmd->SetParameterName("PList",false);
fListCmd->AvailableForStates(G4State_PreInit);
fListCmd -> SetGuidance("Add modula physics list.");
fListCmd -> SetParameterName("PList",false);
fListCmd -> AvailableForStates(G4State_PreInit);
}
BrachyPhysicsListMessenger::~BrachyPhysicsListMessenger()
@@ -42,18 +42,18 @@
#include "globals.hh"
#include "BrachyPrimaryGeneratorAction.hh"
#include "BrachyAnalysisManager.hh"
#include "Randomize.hh"
#include "G4Event.hh"
#include "G4GeneralParticleSource.hh"
#include "G4RunManager.hh"
#include "G4SystemOfUnits.hh"
#include "BrachyAnalysisManager.hh"
BrachyPrimaryGeneratorAction::BrachyPrimaryGeneratorAction()
{
// Use the GPS to generate primary particles,
// Particle type, energy position, direction are specified in
//macro files
// macro files
fGun = new G4GeneralParticleSource();
}
@@ -71,9 +71,9 @@ void BrachyPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
auto analysisManager = G4AnalysisManager::Instance();
G4double energy = fGun -> GetParticleEnergy();
// Fill histogram with the energy spectrum of
// the photons emitted the radionuclide
// when modelling the photons directly (not via radioactive decay)
analysisManager->FillH1(0, energy/keV);
// the photons emitted by the radionuclide
// when modelling the photons as primary particles (not via radioactive decay)
analysisManager -> FillH1(0, energy/keV);
}
}
@@ -41,11 +41,11 @@
//
#include "BrachyRunAction.hh"
#include "BrachyAnalysisManager.hh"
#include "G4Run.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4ios.hh"
#include "BrachyAnalysisManager.hh"
#include "G4SystemOfUnits.hh"
#include "globals.hh"
@@ -73,7 +73,7 @@ analysisManager -> SetVerboseLevel(1);
// Create histogram with the energy spectrum of the photons emitted by the
// radionucldie
analysisManager-> CreateH1("h10","energy spectrum", 800, 0., 800.);
analysisManager -> CreateH1("h10","energy spectrum", 800, 0., 800.);
}
void BrachyRunAction::EndOfRunAction(const G4Run* aRun)
@@ -23,12 +23,10 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
//
// Author: Susanna Guatelli (guatelli@ge.infn.it)
//
#include "BrachyAnalysisManager.hh"
#include "BrachySteppingAction.hh"
#include "G4ios.hh"
#include "G4SteppingManager.hh"
#include "G4Step.hh"
@@ -39,8 +37,6 @@
#include "G4TrackStatus.hh"
#include "G4ParticleDefinition.hh"
#include "G4Gamma.hh"
#include "BrachyAnalysisManager.hh"
#include "BrachySteppingAction.hh"
#include "G4SystemOfUnits.hh"
BrachySteppingAction::BrachySteppingAction()
@@ -81,7 +77,7 @@ void BrachySteppingAction::UserSteppingAction(const G4Step* aStep)
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
// Fill histogram with energy spectrum of the photons emitted in the
// radioactive decay
analysisManager->FillH1(0, energy/keV);
analysisManager -> FillH1(0, energy/keV);
}
}
}
@@ -30,15 +30,16 @@
//
Original code from geant4/examples/extended/runAndEvent/RE03, by M. Asai
*/
#include <map>
#include <fstream>
#include "BrachyUserScoreWriter.hh"
#include "G4SystemOfUnits.hh"
#include "BrachyAnalysisManager.hh"
#include "G4MultiFunctionalDetector.hh"
#include "G4SDParticleFilter.hh"
#include "G4VPrimitiveScorer.hh"
#include "G4VScoringMesh.hh"
#include "G4SystemOfUnits.hh"
#include <map>
#include <fstream>
// The default output is
// voxelX, voxelY, voxelZ, edep
// The BrachyUserScoreWriter allows to change the format of the output file.