Import Geant4 11.1.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2022-07-01 10:44:02 +02:00
parent b3bf75a2a1
commit c07cea1fe0
2172 changed files with 183300 additions and 123938 deletions
@@ -45,12 +45,10 @@ void BrachyActionInitialization::BuildForMaster() const
void BrachyActionInitialization::Build() const
{
BrachyPrimaryGeneratorAction* primary = new BrachyPrimaryGeneratorAction();
SetUserAction(primary);
SetUserAction(new BrachyPrimaryGeneratorAction());
SetUserAction(new BrachyRunAction());
BrachySteppingAction* stepping = new BrachySteppingAction();
SetUserAction(stepping);
SetUserAction(new BrachySteppingAction());
}
@@ -179,17 +179,17 @@ void BrachyDetectorConstruction::ConstructPhantom()
// World volume
fWorld = new G4Box("World", fWorldSizeX, fWorldSizeY, fWorldSizeZ);
fWorldLog = new G4LogicalVolume(fWorld,air,"WorldLog",0,0,0);
fWorldPhys = new G4PVPlacement(0,G4ThreeVector(),"WorldPhys",fWorldLog,0,false,0);
fWorldLog = new G4LogicalVolume(fWorld,air,"WorldLog",nullptr,nullptr,nullptr);
fWorldPhys = new G4PVPlacement(nullptr,G4ThreeVector(),"WorldPhys",fWorldLog,nullptr,false,0);
// Water Box
fPhantom = new G4Box("Phantom", fPhantomSizeX, fPhantomSizeY, fPhantomSizeZ);
// Logical volume
fPhantomLog = new G4LogicalVolume(fPhantom,water,"PhantomLog",0,0,0);
fPhantomLog = new G4LogicalVolume(fPhantom,water,"PhantomLog",nullptr,nullptr,nullptr);
// Physical volume
fPhantomPhys = new G4PVPlacement(0,G4ThreeVector(), // Position: rotation and translation
fPhantomPhys = new G4PVPlacement(nullptr,G4ThreeVector(), // Position: rotation and translation
"PhantomPhys", // Name
fPhantomLog, // Associated logical volume
fWorldPhys, // Mother volume
@@ -198,7 +198,7 @@ void BrachyDetectorConstruction::ConstructPhantom()
fWorldLog -> SetVisAttributes (G4VisAttributes::GetInvisible());
// Visualization attributes of the phantom
G4VisAttributes* simpleBoxVisAtt = new G4VisAttributes(lblue);
auto simpleBoxVisAtt = new G4VisAttributes(lblue);
simpleBoxVisAtt -> SetVisibility(true);
simpleBoxVisAtt -> SetForceWireframe(true);
fPhantomLog -> SetVisAttributes(simpleBoxVisAtt);
@@ -64,9 +64,6 @@ BrachyDetectorConstructionFlexi::BrachyDetectorConstructionFlexi()
fSteelAttributes(nullptr), fEndAttributes(nullptr), fSimpleIridiumVisAtt(nullptr)
{}
BrachyDetectorConstructionFlexi::~BrachyDetectorConstructionFlexi()
{}
void BrachyDetectorConstructionFlexi::ConstructFlexi(G4VPhysicalVolume* mother)
{
G4NistManager* nist = G4NistManager::Instance();
@@ -84,7 +81,7 @@ void BrachyDetectorConstructionFlexi::ConstructFlexi(G4VPhysicalVolume* mother)
G4Element* elNi = nist -> FindOrBuildElement(Z=28);
constexpr G4double d = 7.999*g/cm3;
G4Material* steelMat = new G4Material("Stainless steel 304",d,6);
auto steelMat = new G4Material("Stainless steel 304",d,6);
steelMat -> AddElement(elMn, 0.02);
steelMat -> AddElement(elSi, 0.01);
steelMat -> AddElement(elCr, 0.19);
@@ -98,7 +95,7 @@ void BrachyDetectorConstructionFlexi::ConstructFlexi(G4VPhysicalVolume* mother)
G4double shellr_max = 0.85 * mm;
G4double shell_length = 3.6 * mm;
fSteelShell = new G4Tubs("steel_shell",shellr_min, shellr_max/2, shell_length/2.,0.*deg,360.*deg);
fLogicalSteelShell = new G4LogicalVolume(fSteelShell, steelMat, "steel_shell_log", 0, 0, 0);
fLogicalSteelShell = new G4LogicalVolume(fSteelShell, steelMat, "steel_shell_log", nullptr, nullptr, nullptr);
fPhysicalSteelShell = new G4PVPlacement(nullptr,G4ThreeVector(0,0,0),"phys_steel_shell", fLogicalSteelShell, mother, false, 0, true);
//Define dimensions of the air gap between Steel shell and Iridium core
@@ -106,7 +103,7 @@ void BrachyDetectorConstructionFlexi::ConstructFlexi(G4VPhysicalVolume* mother)
G4double airr_max = 0.67 * mm;
G4double air_length = 3.6 * mm;
fAirGap = new G4Tubs("air_gap", airr_min, airr_max/2, air_length/2, 0.*deg, 360.*deg);
fLogicalAirGap = new G4LogicalVolume(fAirGap, airMat, "air_gap_log", 0, 0, 0);
fLogicalAirGap = new G4LogicalVolume(fAirGap, airMat, "air_gap_log", nullptr, nullptr, nullptr);
fPhysicalAirGap = new G4PVPlacement(nullptr, G4ThreeVector(0,0,0), "phys_air_gap", fLogicalAirGap, fPhysicalSteelShell, false, 0, true);
//Define the non-cable weld end of the Steel shell
@@ -114,7 +111,7 @@ void BrachyDetectorConstructionFlexi::ConstructFlexi(G4VPhysicalVolume* mother)
G4double end1r_max = 0.85 * mm;
G4double end1length = 0.65 * mm;
fEnd1SteelShell = new G4Tubs("End_1_steel_shell", end1r_min, end1r_max/2, end1length/2.,0.*deg,360.*deg);
fLogicalEnd1SteelShell = new G4LogicalVolume(fEnd1SteelShell, steelMat, "End1_steel_shell_log", 0, 0, 0);
fLogicalEnd1SteelShell = new G4LogicalVolume(fEnd1SteelShell, steelMat, "End1_steel_shell_log", nullptr, nullptr, nullptr);
G4double end1offset_x = 0.0 * mm;
G4double end1offset_y = 0.0 * mm;
G4double end1offset_z = 2.125 * mm;
@@ -127,7 +124,7 @@ void BrachyDetectorConstructionFlexi::ConstructFlexi(G4VPhysicalVolume* mother)
G4double end2r_max2 = 0.5 * mm;
G4double end2length = 0.4 * mm;
fEnd2SteelShell = new G4Cons("End_2_steel_shell", end2r_min2, end2r_max2/2, end2r_min1, end2r_max1/2, end2length/2.0, 0.0, 360.0*deg);
fLogicalEnd2SteelShell = new G4LogicalVolume(fEnd2SteelShell, steelMat, "End2_steel_shell_log", 0, 0, 0);
fLogicalEnd2SteelShell = new G4LogicalVolume(fEnd2SteelShell, steelMat, "End2_steel_shell_log", nullptr, nullptr, nullptr);
G4double end2offset_x = 0.0 * mm;
G4double end2offset_y = 0.0 * mm;
G4double end2offset_z = -2.0 * mm;
@@ -138,7 +135,7 @@ void BrachyDetectorConstructionFlexi::ConstructFlexi(G4VPhysicalVolume* mother)
G4double cable_max = 0.5 * mm;
G4double cablelength = 5.0 * mm;
fCable = new G4Tubs("cable",cable_min, cable_max/2, cablelength/2.,0.*deg,360.*deg);
fLogicalCable = new G4LogicalVolume(fCable, steelMat, "cable_log", 0, 0, 0);
fLogicalCable = new G4LogicalVolume(fCable, steelMat, "cable_log", nullptr, nullptr, nullptr);
G4double cableoffset_x = 0.0 * mm;
G4double cableoffset_y = 0.0 * mm;
G4double cableoffset_z = -4.7 * mm;
@@ -149,7 +146,7 @@ void BrachyDetectorConstructionFlexi::ConstructFlexi(G4VPhysicalVolume* mother)
G4double corer_max = 0.6 * mm;
G4double core_length = 3.5 * mm;
fIridiumCore = new G4Tubs("iridium_core",corer_min, corer_max/2,core_length/2.,0.*deg,360.*deg);
fLogicalIridiumCore = new G4LogicalVolume(fIridiumCore, iridiumMat, "iridium_core_log", 0, 0, 0);
fLogicalIridiumCore = new G4LogicalVolume(fIridiumCore, iridiumMat, "iridium_core_log", nullptr, nullptr, nullptr);
fPhysicalIridiumCore = new G4PVPlacement(nullptr,G4ThreeVector(0,0,0), "phys_iridium_core", fLogicalIridiumCore, fPhysicalAirGap, false, 0, true);
// Visualisations
@@ -63,9 +63,6 @@ fCapsulePhys(nullptr),fCapsuleTipPhys1(nullptr),fCapsuleTipPhys2(nullptr), fIodi
fSimpleIodineVisAtt(nullptr), fSimpleCapsuleVisAtt(nullptr), fSimpleCapsuleTipVisAtt(nullptr)
{}
BrachyDetectorConstructionI::~BrachyDetectorConstructionI()
{}
void BrachyDetectorConstructionI::ConstructIodine(G4VPhysicalVolume* mother)
{
// Model of the Bebig Isoseed I-125 brachy source
@@ -116,7 +113,7 @@ void BrachyDetectorConstructionI::ConstructIodine(G4VPhysicalVolume* mother)
false,
0, true);
G4RotationMatrix* rotateMatrix = new G4RotationMatrix();
auto rotateMatrix = new G4RotationMatrix();
rotateMatrix -> rotateX(180.0*deg);
fCapsuleTipPhys2 = new G4PVPlacement(rotateMatrix,
G4ThreeVector(0,0,-1.84*mm),
@@ -62,9 +62,6 @@ fApplicator2Log(nullptr), fCapsulePhys(nullptr), fCapsuleTipPhys(nullptr), fIrid
fApplicator1Phys(nullptr), fApplicator2Phys(nullptr)
{}
BrachyDetectorConstructionLeipzig::~BrachyDetectorConstructionLeipzig()
{}
void BrachyDetectorConstructionLeipzig::ConstructLeipzig(G4VPhysicalVolume* mother)
{
G4Colour red (1.0, 0.0, 0.0) ;
@@ -82,7 +79,7 @@ void BrachyDetectorConstructionLeipzig::ConstructLeipzig(G4VPhysicalVolume* mot
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);
auto steel = new G4Material("Stainless steel",d,5);
steel -> AddElement(elMn, 0.02);
steel -> AddElement(elSi, 0.01);
steel -> AddElement(elCr, 0.19);
@@ -72,9 +72,6 @@ BrachyDetectorConstructionOncura6711::BrachyDetectorConstructionOncura6711()
fOncuraSilverCoreVisAtt(nullptr)
{}
BrachyDetectorConstructionOncura6711::~BrachyDetectorConstructionOncura6711()
{}
void BrachyDetectorConstructionOncura6711::ConstructOncura6711(G4VPhysicalVolume* mother)
{
G4Colour red (1.0, 0.0, 0.0) ;
@@ -87,21 +84,21 @@ 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,titanium,"OncuraCapsuleLog", 0,0,0);
fOncuraCapsuleLog = new G4LogicalVolume(fOncuraCapsule,titanium,"OncuraCapsuleLog", nullptr,nullptr,nullptr);
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, titanium, "OncuraCapsuleTip1Log",0,0,0);
fOncuraCapsuleTip1Log = new G4LogicalVolume(fOncuraCapsuleTip1, titanium, "OncuraCapsuleTip1Log",nullptr,nullptr,nullptr);
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, titanium, "OncuraCapsuleTip2Log",0,0,0);
fOncuraCapsuleTip2Log = new G4LogicalVolume(fOncuraCapsuleTip2, titanium, "OncuraCapsuleTip2Log", nullptr,nullptr,nullptr);
fOncuraCapsuleTip2Phys = new G4PVPlacement(nullptr, G4ThreeVector(0,0,-1.875*mm),
"OncuraCapsuleTip2Phys", fOncuraCapsuleTip2Log,
mother, false,
@@ -68,16 +68,13 @@ BrachyDetectorConstructionTG186::BrachyDetectorConstructionTG186():
fTG186simpleCableVisAtt(nullptr)
{}
BrachyDetectorConstructionTG186::~BrachyDetectorConstructionTG186()
{}
void BrachyDetectorConstructionTG186::ConstructTG186(G4VPhysicalVolume* mother)
{
G4Colour red (1.0, 0.0, 0.0) ;
G4Colour magenta (1.0, 0.0, 1.0) ;
G4NistManager* nist = G4NistManager::Instance();
G4Material* iridium = nist -> FindOrBuildMaterial("G4_Ir");
auto iridium = nist -> FindOrBuildMaterial("G4_Ir");
// Stainless steel (Medical Physics, Vol 25, No 10, Oct 1998)
constexpr G4double d = 8.02*g/cm3;
@@ -87,7 +84,7 @@ void BrachyDetectorConstructionTG186::ConstructTG186(G4VPhysicalVolume* mother)
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);
auto capsuleMat = new G4Material("Stainless steel",d,5);
capsuleMat -> AddElement(elMn, 0.02);
capsuleMat -> AddElement(elSi, 0.01);
capsuleMat -> AddElement(elCr, 0.19);
@@ -49,12 +49,6 @@
#include "G4SystemOfUnits.hh"
#include "globals.hh"
BrachyRunAction::BrachyRunAction()
{}
BrachyRunAction::~BrachyRunAction()
{}
void BrachyRunAction::BeginOfRunAction(const G4Run* aRun)
{
G4cout << "### Run " << aRun -> GetRunID() << " start." << G4endl;
@@ -39,11 +39,6 @@
#include "G4Gamma.hh"
#include "G4SystemOfUnits.hh"
BrachySteppingAction::BrachySteppingAction()
{}
BrachySteppingAction::~BrachySteppingAction()
{}
void BrachySteppingAction::UserSteppingAction(const G4Step* aStep)
{
@@ -86,8 +86,8 @@ if(!ofile)
// retrieve the map
MeshScoreMap fSMap = fScoringMesh -> GetScoreMap();
MeshScoreMap::const_iterator msMapItr = fSMap.find(psName);
auto msMapItr = fSMap.find(psName);
if(msMapItr == fSMap.end())
{
@@ -96,7 +96,7 @@ if(msMapItr == fSMap.end())
return;
}
std::map<G4int, G4StatDouble*> * score = msMapItr -> second-> GetMap();
auto score = msMapItr-> second-> GetMap();
ofile << "# primitive scorer name: " << msMapItr -> first << G4endl;
//
@@ -139,7 +139,7 @@ for(int x = 0; x < fNMeshSegments[0]; x++) {
G4double zz = ( - numberOfVoxel_z + 1+ 2*z )* voxelWidth/2;
G4int idx = GetIndex(x, y, z);
std::map<G4int, G4StatDouble*>::iterator value = score -> find(idx);
if (value != score -> end())
{
// Print in the ASCII output file the information