Import Geant4 10.7.0 source tree

This commit is contained in:
Gabriele Cosmo
2020-12-04 12:30:43 +01:00
parent 67ba86d073
commit dab42d2018
3770 changed files with 226369 additions and 286486 deletions
@@ -28,35 +28,29 @@
#include "BrachyActionInitialization.hh"
#include "BrachyPrimaryGeneratorAction.hh"
#include "BrachySteppingAction.hh"
#include "BrachyRunAction.hh"
#include "G4RunManager.hh"
BrachyActionInitialization::BrachyActionInitialization():
G4VUserActionInitialization()
{
}
{}
BrachyActionInitialization::~BrachyActionInitialization()
{
}
{}
void BrachyActionInitialization::BuildForMaster() const
{
// In MT mode, to be clearer, the RunAction class for the master thread might be
// different than the one used for the workers.
// This RunAction will be called before and after starting the
// workers.
SetUserAction(new BrachyRunAction());
}
void BrachyActionInitialization::Build() const
{
// Initialize the primary particles
BrachyPrimaryGeneratorAction* primary = new BrachyPrimaryGeneratorAction();
SetUserAction(primary);
SetUserAction(new BrachyRunAction());
BrachySteppingAction* stepping = new BrachySteppingAction();
SetUserAction(stepping);
SetUserAction(stepping);
}
@@ -1,97 +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. *
// ********************************************************************
/*
Author: Susanna Guatelli
*/
// The class BrachyAnalysisManager creates and manages histograms and ntuples
// The analysis was included in this application following the extended Geant4
// example analysis/AnaEx01
#include "BrachyAnalysisManager.hh"
BrachyAnalysisManager* BrachyAnalysisManager::instance = 0;
BrachyAnalysisManager::BrachyAnalysisManager()
{
#ifdef ANALYSIS_USE
theTFile = 0;
histo2 =0;
histo = 0;
#endif
}
BrachyAnalysisManager::~BrachyAnalysisManager()
{
#ifdef G4ANALYSIS_USE
delete theTFile; theTFile = 0;
delete histo2; histo2 = 0;
delete histo; histo = 0;
#endif
}
BrachyAnalysisManager* BrachyAnalysisManager::GetInstance()
{
if (instance == 0) instance = new BrachyAnalysisManager;
return instance;
}
void BrachyAnalysisManager::book()
{
#ifdef ANALYSIS_USE
delete theTFile;
theTFile = new TFile("brachytherapy.root", "RECREATE");
histo = new TH1F("h10","energy spectrum", 800, 0., 800);
histo2 = new TH2F("h20","edep2Dxy", 801, -100.125, 100.125, // binning, xmin, xmax, along x direction in mm
801, -100.125, 100.125);// binning, ymin, ymax, along y direction in mm
#endif
}
#ifdef ANALYSIS_USE
void BrachyAnalysisManager::FillH2WithEnergyDeposition(G4double xx,
G4double yy,
G4double energyDep)
{
histo2 -> Fill(xx, yy,energyDep);
}
void BrachyAnalysisManager::FillPrimaryParticleHistogram(G4double primaryParticleEnergy)
{
// 1DHistogram: energy spectrum of primary particles
histo-> Fill(primaryParticleEnergy);
}
#endif
void BrachyAnalysisManager::save()
{
#ifdef ANALYSIS_USE
if (theTFile)
{
theTFile -> Write();
theTFile -> Close();
}
#endif
}
@@ -62,110 +62,109 @@
#include "BrachyDetectorConstruction.hh"
BrachyDetectorConstruction::BrachyDetectorConstruction():
detectorChoice(0), factory(0),
World(0), WorldLog(0), WorldPhys(0),
Phantom(0), PhantomLog(0), PhantomPhys(0),
phantomAbsorberMaterial(0)
fDetectorChoice(0), fFactory(nullptr),
fWorld(nullptr), fWorldLog(nullptr), fWorldPhys(nullptr),
fPhantom(nullptr), fPhantomLog(nullptr), fPhantomPhys(nullptr),
fPhantomAbsorberMaterial(nullptr)
{
// Define half size of the phantom along the x, y, z axis
phantomSizeX = 15.*cm;
phantomSizeY = 15.*cm;
phantomSizeZ = 15.*cm;
fPhantomSizeX = 15.*cm;
fPhantomSizeY = 15.*cm;
fPhantomSizeZ = 15.*cm;
// Define the sizes of the World volume containing the phantom
worldSizeX = 4.0*m;
worldSizeY = 4.0*m;
worldSizeZ = 4.0*m;
fWorldSizeX = 4.0*m;
fWorldSizeY = 4.0*m;
fWorldSizeZ = 4.0*m;
// Define the messenger of the Detector component
// It is possible to modify geometrical parameters through UI
detectorMessenger = new BrachyDetectorMessenger(this);
fDetectorMessenger = new BrachyDetectorMessenger(this);
// Define the Flexi source as default source modelled in the geometry
factory = new BrachyFactoryFlexi();
fFactory = new BrachyFactoryFlexi();
// BrachyMaterial defined the all the materials necessary
// for the experimental set-up
pMaterial = new BrachyMaterial();
fMaterial = new BrachyMaterial();
}
BrachyDetectorConstruction::~BrachyDetectorConstruction()
{
delete pMaterial;
delete factory;
delete detectorMessenger;
delete fMaterial;
delete fFactory;
delete fDetectorMessenger;
}
G4VPhysicalVolume* BrachyDetectorConstruction::Construct()
{
pMaterial -> DefineMaterials();
fMaterial -> DefineMaterials();
// Model the phantom (water box)
ConstructPhantom();
// Model the source in the phantom
factory -> CreateSource(PhantomPhys);
fFactory -> CreateSource(fPhantomPhys);
return WorldPhys;
return fWorldPhys;
}
void BrachyDetectorConstruction::SwitchBrachytherapicSeed()
{
// Change the source in the water phantom
factory -> CleanSource();
fFactory -> CleanSource();
G4cout << "Old Source is deleted ..." << G4endl;
delete factory;
delete fFactory;
switch(detectorChoice)
switch(fDetectorChoice)
{
case 1:
factory = new BrachyFactoryI();
fFactory = new BrachyFactoryI();
break;
case 2:
factory = new BrachyFactoryLeipzig();
fFactory = new BrachyFactoryLeipzig();
break;
case 3:
factory = new BrachyFactoryTG186();
fFactory = new BrachyFactoryTG186();
break;
case 4:
factory = new BrachyFactoryFlexi();
fFactory = new BrachyFactoryFlexi();
break;
case 5:
factory = new BrachyFactoryOncura6711();
fFactory = new BrachyFactoryOncura6711();
break;
default:
factory = new BrachyFactoryFlexi();
fFactory = new BrachyFactoryFlexi();
break;
}
factory -> CreateSource(PhantomPhys);
fFactory -> CreateSource(fPhantomPhys);
G4cout << "... New source is created ..." << G4endl;
// Notify run manager that the new geometry has been built
G4RunManager::GetRunManager() -> GeometryHasBeenModified();
G4cout << "... Geometry is notified .... THAT'S IT!!!!!" << G4endl;
}
void BrachyDetectorConstruction::SelectBrachytherapicSeed(G4String val)
{
if (val == "Iodine")
detectorChoice = 1;
fDetectorChoice = 1;
else
{
if(val=="Leipzig")
detectorChoice = 2;
fDetectorChoice = 2;
else
{
if(val=="TG186")
detectorChoice = 3;
fDetectorChoice = 3;
else
{
if(val=="Flexi")
detectorChoice = 4;
fDetectorChoice = 4;
else
{
if(val=="Oncura")
detectorChoice = 5;
fDetectorChoice = 5;
else
G4cout << val << "is not available!!!!" << G4endl;
}
@@ -182,47 +181,48 @@ void BrachyDetectorConstruction::ConstructPhantom()
// Define the light blue color
G4Colour lblue (0.0, 0.0, .75);
G4Material* air = pMaterial -> GetMat("Air") ;
G4Material* water = pMaterial -> GetMat("Water");
G4Material* air = fMaterial -> GetMat("Air") ;
G4Material* water = fMaterial -> GetMat("Water");
// World volume
World = new G4Box("World",worldSizeX,worldSizeY,worldSizeZ);
WorldLog = new G4LogicalVolume(World,air,"WorldLog",0,0,0);
WorldPhys = new G4PVPlacement(0,G4ThreeVector(),"WorldPhys",WorldLog,0,false,0);
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);
// Water Box
Phantom = new G4Box("Phantom",phantomSizeX,phantomSizeY,phantomSizeZ);
fPhantom = new G4Box("Phantom", fPhantomSizeX, fPhantomSizeY, fPhantomSizeZ);
// Logical volume
PhantomLog = new G4LogicalVolume(Phantom,water,"PhantomLog",0,0,0);
fPhantomLog = new G4LogicalVolume(fPhantom,water,"PhantomLog",0,0,0);
// Physical volume
PhantomPhys = new G4PVPlacement(0,G4ThreeVector(), // Position: rotation and translation
fPhantomPhys = new G4PVPlacement(0,G4ThreeVector(), // Position: rotation and translation
"PhantomPhys", // Name
PhantomLog, // Associated logical volume
WorldPhys, // Mother volume
fPhantomLog, // Associated logical volume
fWorldPhys, // Mother volume
false,0);
WorldLog -> SetVisAttributes (G4VisAttributes::GetInvisible());
fWorldLog -> SetVisAttributes (G4VisAttributes::GetInvisible());
// Visualization attributes of the phantom
G4VisAttributes* simpleBoxVisAtt = new G4VisAttributes(lblue);
simpleBoxVisAtt -> SetVisibility(true);
simpleBoxVisAtt -> SetForceWireframe(true);
PhantomLog -> SetVisAttributes(simpleBoxVisAtt);
fPhantomLog -> SetVisAttributes(simpleBoxVisAtt);
}
void BrachyDetectorConstruction::PrintDetectorParameters()
{
G4cout << "----------------" << G4endl
<< "the phantom is a water box whose size is: " << G4endl
<< phantomSizeX *2./cm
<< fPhantomSizeX *2./cm
<< " cm * "
<< phantomSizeY *2./cm
<< fPhantomSizeY *2./cm
<< " cm * "
<< phantomSizeZ *2./cm
<< fPhantomSizeZ *2./cm
<< " cm" << G4endl
<< "The phantom is made of "
<< phantomAbsorberMaterial -> GetName() <<G4endl
<< fPhantomAbsorberMaterial -> GetName() <<G4endl
<< "the source is at the center of the phantom" << G4endl
<< "----------------"
<< G4endl;
@@ -238,8 +238,8 @@ void BrachyDetectorConstruction::SetPhantomMaterial(G4String materialChoice)
if (pttoMaterial)
{
phantomAbsorberMaterial = pttoMaterial;
PhantomLog -> SetMaterial(pttoMaterial);
fPhantomAbsorberMaterial = pttoMaterial;
fPhantomLog -> SetMaterial(pttoMaterial);
PrintDetectorParameters();
} else
{ G4cout << "WARNING: material '" << materialChoice << "' not available!" << G4endl;}
@@ -56,174 +56,174 @@
#include "G4Colour.hh"
BrachyDetectorConstructionFlexi::BrachyDetectorConstructionFlexi()
: steel_shell(0),logical_steel_shell(0),air_gap(0), logical_air_gap(0), physical_air_gap(0),
End1_steel_shell(0),logical_End1_steel_shell(0), physical_End1_steel_shell(0),
End2_steel_shell(0),logical_End2_steel_shell(0), physical_End2_steel_shell(0),
cable(0),logical_cable(0),physical_cable(0),
iridium_core(0),logical_iridium_core(0),physical_iridium_core(0),
steelAttributes(0), endAttributes(0), simpleIridiumVisAtt(0)
: fSteelShell(nullptr), fLogicalSteelShell(nullptr), fAirGap(nullptr), fLogicalAirGap(nullptr), fPhysicalAirGap(nullptr),
fEnd1SteelShell(nullptr), fLogicalEnd1SteelShell(nullptr), fPhysicalEnd1SteelShell(nullptr),
fEnd2SteelShell(nullptr), fLogicalEnd2SteelShell(nullptr), fPhysicalEnd2SteelShell(nullptr),
fCable(nullptr), fLogicalCable(nullptr), fPhysicalCable(nullptr),
fIridiumCore(nullptr), fLogicalIridiumCore(nullptr), fPhysicalIridiumCore(nullptr),
fSteelAttributes(nullptr), fEndAttributes(nullptr), fSimpleIridiumVisAtt(nullptr)
{
pMat = new BrachyMaterial();
fMat = new BrachyMaterial();
}
BrachyDetectorConstructionFlexi::~BrachyDetectorConstructionFlexi()
{
delete pMat;
delete fMat;
}
void BrachyDetectorConstructionFlexi::ConstructFlexi(G4VPhysicalVolume* mother)
{
G4Material* steelMat = pMat -> GetMat("Stainless steel 304");
G4Material* iridiumMat = pMat -> GetMat("Iridium");
G4Material* airMat = pMat -> GetMat("Air");
G4Material* steelMat = fMat -> GetMat("Stainless steel 304");
G4Material* iridiumMat = fMat -> GetMat("Iridium");
G4Material* airMat = fMat -> GetMat("Air");
//Define dimensions of the outer Steel shell around the solid source - not including the ends
G4double shellr_min = 0.00 * mm;
G4double shellr_max = 0.85 * mm;
G4double shell_length = 3.6 * mm;
steel_shell = new G4Tubs("steel_shell",shellr_min, shellr_max/2, shell_length/2.,0.*deg,360.*deg);
logical_steel_shell = new G4LogicalVolume(steel_shell, steelMat, "steel_shell_log", 0, 0, 0);
physical_steel_shell = new G4PVPlacement(0,G4ThreeVector(0,0,0),"phys_steel_shell", logical_steel_shell, mother, false, 0, true);
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);
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
G4double airr_min = 0.00 * mm;
G4double airr_max = 0.67 * mm;
G4double air_length = 3.6 * mm;
air_gap = new G4Tubs("air_gap", airr_min, airr_max/2, air_length/2, 0.*deg, 360.*deg);
logical_air_gap = new G4LogicalVolume(air_gap, airMat, "air_gap_log", 0, 0, 0);
physical_air_gap = new G4PVPlacement(0, G4ThreeVector(0,0,0), "phys_air_gap",logical_air_gap, physical_steel_shell, false, 0, true);
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);
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
G4double End1r_min = 0.0 * mm;
G4double End1r_max = 0.85 * mm;
G4double End1length = 0.65 * mm;
End1_steel_shell = new G4Tubs("End_1_steel_shell",End1r_min, End1r_max/2, End1length/2.,0.*deg,360.*deg);
logical_End1_steel_shell = new G4LogicalVolume(End1_steel_shell, steelMat, "End1_steel_shell_log", 0, 0, 0);
G4double end1r_min = 0.0 * mm;
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);
G4double end1offset_x = 0.0 * mm;
G4double end1offset_y = 0.0 * mm;
G4double end1offset_z = 2.125 * mm;
physical_End1_steel_shell = new G4PVPlacement(0,G4ThreeVector(end1offset_x,end1offset_y,end1offset_z),"phys_End1_steel_shell", logical_End1_steel_shell,mother, false, 0, true);
fPhysicalEnd1SteelShell = new G4PVPlacement(nullptr,G4ThreeVector(end1offset_x,end1offset_y,end1offset_z),"phys_End1_steel_shell", fLogicalEnd1SteelShell,mother, false, 0, true);
//Define the cable weld end of the Steel shell
G4double End2r_min1 = 0.0 * mm;
G4double End2r_max1 = 0.85 * mm;
G4double End2r_min2 = 0.0 * mm;
G4double End2r_max2 = 0.5 * mm;
G4double End2length = 0.4 * mm;
End2_steel_shell = new G4Cons("End_2_steel_shell",End2r_min2, End2r_max2/2, End2r_min1, End2r_max1/2, End2length/2.0, 0.0, 360.0*deg);
logical_End2_steel_shell = new G4LogicalVolume(End2_steel_shell, steelMat, "End2_steel_shell_log", 0, 0, 0);
G4double end2r_min1 = 0.0 * mm;
G4double end2r_max1 = 0.85 * mm;
G4double end2r_min2 = 0.0 * mm;
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);
G4double end2offset_x = 0.0 * mm;
G4double end2offset_y = 0.0 * mm;
G4double end2offset_z = -2.0 * mm;
physical_End2_steel_shell = new G4PVPlacement(0,G4ThreeVector(end2offset_x,end2offset_y,end2offset_z), "phys_End2_steel_shell", logical_End2_steel_shell,mother, false, 0, true);
fPhysicalEnd2SteelShell = new G4PVPlacement(nullptr,G4ThreeVector(end2offset_x,end2offset_y,end2offset_z), "phys_End2_steel_shell", fLogicalEnd2SteelShell, mother, false, 0, true);
//Define the cable
G4double cable_min = 0.0 * mm;
G4double cable_max = 0.5 * mm;
G4double cablelength = 5.0 * mm;
cable = new G4Tubs("cable",cable_min, cable_max/2, cablelength/2.,0.*deg,360.*deg);
logical_cable = new G4LogicalVolume(cable, steelMat, "cable_log", 0, 0, 0);
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);
G4double cableoffset_x = 0.0 * mm;
G4double cableoffset_y = 0.0 * mm;
G4double cableoffset_z = -4.7 * mm;
physical_cable = new G4PVPlacement(0,G4ThreeVector(cableoffset_x,cableoffset_y,cableoffset_z),"phys_cable", logical_cable, mother, false, 0, true);
fPhysicalCable = new G4PVPlacement(nullptr,G4ThreeVector(cableoffset_x,cableoffset_y,cableoffset_z),"phys_cable", fLogicalCable, mother, false, 0, true);
// Define the Iridium core
G4double corer_min = 0.0 * mm;
G4double corer_max = 0.6 * mm;
G4double core_length = 3.5 * mm;
iridium_core = new G4Tubs("iridium_core",corer_min, corer_max/2,core_length/2.,0.*deg,360.*deg);
logical_iridium_core = new G4LogicalVolume(iridium_core, iridiumMat, "iridium_core_log", 0, 0, 0);
physical_iridium_core = new G4PVPlacement(0,G4ThreeVector(0,0,0), "phys_iridium_core", logical_iridium_core, physical_air_gap, false, 0, true);
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);
fPhysicalIridiumCore = new G4PVPlacement(nullptr,G4ThreeVector(0,0,0), "phys_iridium_core", fLogicalIridiumCore, fPhysicalAirGap, false, 0, true);
// Visualisations
//Shell/cable attributes
steelAttributes = new G4VisAttributes(G4Colour(1.0, 0.0, 0.0)); // red
steelAttributes -> SetVisibility(true);
steelAttributes -> SetForceAuxEdgeVisible(true);
fSteelAttributes = new G4VisAttributes(G4Colour(1.0, 0.0, 0.0)); // red
fSteelAttributes -> SetVisibility(true);
fSteelAttributes -> SetForceAuxEdgeVisible(true);
endAttributes = new G4VisAttributes(G4Colour(1.0, 0.0, 0.0)); // red
endAttributes -> SetVisibility(true);
endAttributes -> SetForceAuxEdgeVisible(true);
logical_steel_shell -> SetVisAttributes(steelAttributes);
logical_End1_steel_shell -> SetVisAttributes(endAttributes);
logical_End2_steel_shell -> SetVisAttributes(endAttributes);
logical_cable -> SetVisAttributes(steelAttributes);
fEndAttributes = new G4VisAttributes(G4Colour(1.0, 0.0, 0.0)); // red
fEndAttributes -> SetVisibility(true);
fEndAttributes -> SetForceAuxEdgeVisible(true);
fLogicalSteelShell -> SetVisAttributes(fSteelAttributes);
fLogicalEnd1SteelShell -> SetVisAttributes(fEndAttributes);
fLogicalEnd2SteelShell -> SetVisAttributes(fEndAttributes);
fLogicalCable -> SetVisAttributes(fSteelAttributes);
G4Colour magenta (1.0, 0.0, 1.0) ;
simpleIridiumVisAtt = new G4VisAttributes(magenta);
simpleIridiumVisAtt -> SetVisibility(true);
simpleIridiumVisAtt -> SetForceWireframe(true);
logical_iridium_core -> SetVisAttributes(simpleIridiumVisAtt);
fSimpleIridiumVisAtt = new G4VisAttributes(magenta);
fSimpleIridiumVisAtt -> SetVisibility(true);
fSimpleIridiumVisAtt -> SetForceWireframe(true);
fLogicalIridiumCore -> SetVisAttributes(fSimpleIridiumVisAtt);
}
void BrachyDetectorConstructionFlexi::CleanFlexi()
{
delete simpleIridiumVisAtt;
simpleIridiumVisAtt = 0;
delete fSimpleIridiumVisAtt;
fSimpleIridiumVisAtt = nullptr;
delete endAttributes;
endAttributes = 0;
delete fEndAttributes;
fEndAttributes = nullptr;
delete steelAttributes;
steelAttributes = 0;
delete fSteelAttributes;
fSteelAttributes = nullptr;
delete physical_iridium_core;
physical_iridium_core = 0 ;
delete fPhysicalIridiumCore;
fPhysicalIridiumCore = nullptr ;
delete logical_iridium_core;
logical_iridium_core = 0;
delete fLogicalIridiumCore;
fLogicalIridiumCore = nullptr;
delete iridium_core;
iridium_core = 0;
delete fIridiumCore;
fIridiumCore = nullptr;
delete physical_cable;
physical_cable = 0;
delete fPhysicalCable;
fPhysicalCable = nullptr;
delete logical_cable;
logical_cable = 0;
delete fLogicalCable;
fLogicalCable = nullptr;
delete cable;
cable = 0;
delete fCable;
fCable = nullptr;
delete physical_End2_steel_shell;
physical_End2_steel_shell = 0;
delete fPhysicalEnd2SteelShell;
fPhysicalEnd2SteelShell = nullptr;
delete logical_End2_steel_shell;
logical_End2_steel_shell = 0;
delete fLogicalEnd2SteelShell;
fLogicalEnd2SteelShell = nullptr;
delete End2_steel_shell;
End2_steel_shell = 0;
delete fEnd2SteelShell;
fEnd2SteelShell = nullptr;
delete physical_End1_steel_shell;
physical_End1_steel_shell = 0;
delete fPhysicalEnd1SteelShell;
fPhysicalEnd1SteelShell = nullptr;
delete logical_End1_steel_shell;
logical_End1_steel_shell = 0;
delete fLogicalEnd1SteelShell;
fLogicalEnd1SteelShell = nullptr;
delete End1_steel_shell;
End1_steel_shell = 0;
delete fEnd1SteelShell;
fEnd1SteelShell = nullptr;
delete physical_air_gap;
physical_air_gap = 0;
delete fPhysicalAirGap;
fPhysicalAirGap = nullptr;
delete logical_air_gap;
logical_air_gap = 0;
delete fLogicalAirGap;
fLogicalAirGap = nullptr;
delete air_gap;
air_gap = 0;
delete fAirGap;
fAirGap = nullptr;
delete physical_steel_shell;
physical_steel_shell = 0;
delete fPhysicalSteelShell;
fPhysicalSteelShell = nullptr;
delete logical_steel_shell;
logical_steel_shell = 0;
delete fLogicalSteelShell;
fLogicalSteelShell = nullptr;
delete steel_shell;
steel_shell = 0;
delete fSteelShell;
fSteelShell = nullptr;
G4RunManager::GetRunManager() -> GeometryHasBeenModified();
G4RunManager::GetRunManager() -> GeometryHasBeenModified();
}
@@ -57,127 +57,128 @@
#include "G4Colour.hh"
BrachyDetectorConstructionI::BrachyDetectorConstructionI():
defaultTub(0), capsule(0), capsuleTip(0),iodiumCore(0), defaultTubLog(0),
capsuleLog(0), capsuleTipLog(0), iodiumCoreLog(0),defaultTubPhys(0),
capsulePhys(0),capsuleTipPhys1(0),capsuleTipPhys2(0), iodiumCorePhys(0),
simpleiodiumVisAtt(0), simpleCapsuleVisAtt(0), simpleCapsuleTipVisAtt(0)
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)
{
pMaterial = new BrachyMaterial();
fMaterial = new BrachyMaterial();
}
BrachyDetectorConstructionI::~BrachyDetectorConstructionI()
{
delete pMaterial;
delete fMaterial;
}
void BrachyDetectorConstructionI::ConstructIodium(G4VPhysicalVolume* mother)
void BrachyDetectorConstructionI::ConstructIodine(G4VPhysicalVolume* mother)
{
// source Bebig Isoseed I-125 ...
//Get materials for source construction ...
G4Material* titanium = pMaterial -> GetMat("titanium");
G4Material* air = pMaterial -> GetMat("Air");
G4Material* iodium = pMaterial -> GetMat("Iodine");
G4Material* titanium = fMaterial -> GetMat("titanium");
G4Material* air = fMaterial -> GetMat("Air");
G4Material* Iodine = fMaterial -> GetMat("Iodine");
G4Colour red (1.0, 0.0, 0.0) ;
G4Colour magenta (1.0, 0.0, 1.0) ;
G4Colour lblue (0.0, 0.0, .75);
// Air tub
defaultTub = new G4Tubs("DefaultTub",0.*mm, 0.40*mm, 1.84*mm, 0.*deg, 360.*deg);
defaultTubLog = new G4LogicalVolume(defaultTub,air,"DefaultTub_Log");
defaultTubPhys = new G4PVPlacement(0,
fDefaultTub = new G4Tubs("DefaultTub",0.*mm, 0.40*mm, 1.84*mm, 0.*deg, 360.*deg);
fDefaultTubLog = new G4LogicalVolume(fDefaultTub,air,"DefaultTub_Log");
fDefaultTubPhys = new G4PVPlacement(nullptr,
G4ThreeVector(),
"defaultTub_Phys",
defaultTubLog,
fDefaultTubLog,
mother,
false,
0, true);
// Capsule main body ...
// Capsule main body ...
G4double capsuleR = 0.35*mm;
capsule = new G4Tubs("Capsule", capsuleR,0.40*mm,1.84*mm,0.*deg,360.*deg);
capsuleLog = new G4LogicalVolume(capsule,titanium,"CapsuleLog");
capsulePhys = new G4PVPlacement(0,
fCapsule = new G4Tubs("fCapsule", capsuleR,0.40*mm,1.84*mm,0.*deg,360.*deg);
fCapsuleLog = new G4LogicalVolume(fCapsule,titanium,"fCapsuleLog");
fCapsulePhys = new G4PVPlacement(nullptr,
G4ThreeVector(),
"CapsulePhys",
capsuleLog,
defaultTubPhys,
"fCapsulePhys",
fCapsuleLog,
fDefaultTubPhys,
false,
0, true);
// Capsule tips
capsuleTip = new G4Sphere("CapsuleTip",
// fCapsule tips
fCapsuleTip = new G4Sphere("fCapsuleTip",
0.*mm,
0.40*mm,
0.*deg,
360.*deg,
0.*deg,
90.*deg);
capsuleTipLog = new G4LogicalVolume(capsuleTip,titanium,"CapsuleTipLog");
capsuleTipPhys1 = new G4PVPlacement(0,
fCapsuleTipLog = new G4LogicalVolume(fCapsuleTip,titanium,"fCapsuleTipLog");
fCapsuleTipPhys1 = new G4PVPlacement(nullptr,
G4ThreeVector(0.,0.,1.84*mm),
"IodineCapsuleTipPhys1",
capsuleTipLog,
"IodinefCapsuleTipPhys1",
fCapsuleTipLog,
mother,
false,
0, true);
G4RotationMatrix* rotateMatrix = new G4RotationMatrix();
rotateMatrix -> rotateX(180.0*deg);
capsuleTipPhys2 = new G4PVPlacement(rotateMatrix,
fCapsuleTipPhys2 = new G4PVPlacement(rotateMatrix,
G4ThreeVector(0,0,-1.84*mm),
"IodineCapsuleTipPhys2",
capsuleTipLog,
"IodinefCapsuleTipPhys2",
fCapsuleTipLog,
mother,
false,
0, true);
// Radiactive core ...
iodiumCore = new G4Tubs("ICore",0.085*mm,0.35*mm,1.75*mm,0.*deg,360.*deg);
iodiumCoreLog = new G4LogicalVolume(iodiumCore,iodium,"iodiumCoreLog");
iodiumCorePhys = new G4PVPlacement(0,
fIodineCore = new G4Tubs("ICore",0.085*mm,0.35*mm,1.75*mm,0.*deg,360.*deg);
fIodineCoreLog = new G4LogicalVolume(fIodineCore,Iodine,"IodineCoreLog");
fIodineCorePhys = new G4PVPlacement(nullptr,
G4ThreeVector(0.,0.,0.),
"iodiumCorePhys",
iodiumCoreLog,
defaultTubPhys,
"IodineCorePhys",
fIodineCoreLog,
fDefaultTubPhys,
false,
0, true);
// Visual attributes ...
simpleiodiumVisAtt= new G4VisAttributes(magenta);
simpleiodiumVisAtt -> SetVisibility(true);
simpleiodiumVisAtt -> SetForceSolid(true);
iodiumCoreLog -> SetVisAttributes(simpleiodiumVisAtt);
fSimpleIodineVisAtt = new G4VisAttributes(magenta);
fSimpleIodineVisAtt -> SetVisibility(true);
fSimpleIodineVisAtt -> SetForceSolid(true);
fIodineCoreLog -> SetVisAttributes(fSimpleIodineVisAtt);
simpleCapsuleVisAtt= new G4VisAttributes(red);
simpleCapsuleVisAtt -> SetVisibility(true);
simpleCapsuleVisAtt -> SetForceWireframe(true);
capsuleLog -> SetVisAttributes( simpleCapsuleVisAtt);
fSimpleCapsuleVisAtt = new G4VisAttributes(red);
fSimpleCapsuleVisAtt -> SetVisibility(true);
fSimpleCapsuleVisAtt -> SetForceWireframe(true);
fCapsuleLog -> SetVisAttributes( fSimpleCapsuleVisAtt);
simpleCapsuleTipVisAtt= new G4VisAttributes(red);
simpleCapsuleTipVisAtt -> SetVisibility(true);
simpleCapsuleTipVisAtt -> SetForceSolid(true);
capsuleTipLog -> SetVisAttributes( simpleCapsuleTipVisAtt);
fSimpleCapsuleTipVisAtt = new G4VisAttributes(red);
fSimpleCapsuleTipVisAtt -> SetVisibility(true);
fSimpleCapsuleTipVisAtt -> SetForceSolid(true);
fCapsuleTipLog -> SetVisAttributes(fSimpleCapsuleTipVisAtt);
}
void BrachyDetectorConstructionI::CleanIodium()
void BrachyDetectorConstructionI::CleanIodine()
{
delete simpleiodiumVisAtt; simpleiodiumVisAtt = 0;
delete simpleCapsuleVisAtt; simpleCapsuleVisAtt = 0;
delete simpleCapsuleTipVisAtt; simpleCapsuleTipVisAtt = 0;
delete capsuleTipPhys1; capsuleTipPhys1 = 0;
delete capsuleTipPhys2; capsuleTipPhys2 = 0;
delete iodiumCorePhys; iodiumCorePhys = 0;
delete capsulePhys; capsulePhys = 0;
delete defaultTubPhys; defaultTubPhys = 0;
delete defaultTubLog; defaultTubLog = 0;
delete capsuleLog; capsuleLog = 0;
delete capsuleTipLog; capsuleTipLog = 0;
delete iodiumCoreLog; iodiumCoreLog = 0;
delete defaultTub; defaultTub = 0;
delete capsule; capsule = 0;
delete capsuleTip; capsuleTip = 0;
delete iodiumCore; iodiumCore = 0;
delete fSimpleIodineVisAtt; fSimpleIodineVisAtt = nullptr;
delete fSimpleCapsuleVisAtt; fSimpleCapsuleVisAtt = nullptr;
delete fSimpleCapsuleTipVisAtt; fSimpleCapsuleTipVisAtt = nullptr;
delete fCapsuleTipPhys1; fCapsuleTipPhys1 = nullptr;
delete fCapsuleTipPhys2; fCapsuleTipPhys2 = nullptr;
delete fIodineCorePhys; fIodineCorePhys = nullptr;
delete fCapsulePhys; fCapsulePhys = nullptr;
delete fDefaultTubPhys; fDefaultTubPhys = nullptr;
delete fDefaultTubLog; fDefaultTubLog = nullptr;
delete fCapsuleLog; fCapsuleLog = nullptr;
delete fCapsuleTipLog; fCapsuleTipLog = nullptr;
delete fIodineCoreLog; fIodineCoreLog = nullptr;
delete fDefaultTub; fDefaultTub = nullptr;
delete fCapsule; fCapsule = nullptr;
delete fCapsuleTip; fCapsuleTip = nullptr;
delete fIodineCore; fIodineCore = nullptr;
G4RunManager::GetRunManager() -> GeometryHasBeenModified();
}
@@ -62,17 +62,17 @@
// Leipzig Applicator ...
BrachyDetectorConstructionLeipzig::BrachyDetectorConstructionLeipzig():
capsule(0),capsuleTip(0), iridiumCore(0), applicator1(0), applicator2(0),
capsuleLog(0), capsuleTipLog(0), iridiumCoreLog(0), applicator1Log(0),
applicator2Log(0),capsulePhys(0), capsuleTipPhys(0),iridiumCorePhys(0),
applicator1Phys(0), applicator2Phys(0)
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)
{
pMaterial = new BrachyMaterial();
fMaterial = new BrachyMaterial();
}
BrachyDetectorConstructionLeipzig::~BrachyDetectorConstructionLeipzig()
{
delete pMaterial;
delete fMaterial;
}
void BrachyDetectorConstructionLeipzig::ConstructLeipzig(G4VPhysicalVolume* mother)
@@ -80,70 +80,70 @@ void BrachyDetectorConstructionLeipzig::ConstructLeipzig(G4VPhysicalVolume* mot
G4Colour red (1.0, 0.0, 0.0) ;
G4Colour lblue (0.0, 0.0, .75);
G4Material* capsuleMat = pMaterial -> GetMat("Stainless steel");
G4Material* iridium = pMaterial -> GetMat("Iridium");
G4Material* tungsten = pMaterial -> GetMat("Tungsten");
G4Material* capsuleMat = fMaterial -> GetMat("Stainless steel");
G4Material* iridium = fMaterial -> GetMat("Iridium");
G4Material* tungsten = fMaterial -> GetMat("Tungsten");
//Iridium source ...
capsule = new G4Tubs("Capsule",0,0.55*mm,3.725*mm,0.*deg,360.*deg);
capsuleLog = new G4LogicalVolume(capsule,capsuleMat,"CapsuleLog");
capsulePhys = new G4PVPlacement(0, G4ThreeVector(0,0,-1.975*mm),"CapsulePhys",
capsuleLog,mother, //mother volume: phantom
fCapsule = new G4Tubs("Capsule",0,0.55*mm,3.725*mm,0.*deg,360.*deg);
fCapsuleLog = new G4LogicalVolume(fCapsule,capsuleMat,"CapsuleLog");
fCapsulePhys = new G4PVPlacement(nullptr, G4ThreeVector(0,0,-1.975*mm),"CapsulePhys",
fCapsuleLog,mother, //mother volume: phantom
false,0, true);
// Capsule tip
capsuleTip = new G4Sphere("CapsuleTip",0.*mm,0.55*mm,0.*deg,360.*deg,0.*deg,90.*deg);
capsuleTipLog = new G4LogicalVolume(capsuleTip,capsuleMat,"CapsuleTipLog");
capsuleTipPhys = new G4PVPlacement(0,G4ThreeVector(0.,0.,1.75*mm),"CapsuleTipPhys",
capsuleTipLog,mother,false,0, true);
fCapsuleTip = new G4Sphere("CapsuleTip",0.*mm,0.55*mm,0.*deg,360.*deg,0.*deg,90.*deg);
fCapsuleTipLog = new G4LogicalVolume(fCapsuleTip,capsuleMat,"CapsuleTipLog");
fCapsuleTipPhys = new G4PVPlacement(nullptr,G4ThreeVector(0.,0.,1.75*mm),"CapsuleTipPhys",
fCapsuleTipLog,mother,false,0, true);
// Iridium core
iridiumCore = new G4Tubs("IrCore",0,0.30*mm,1.75*mm,0.*deg,360.*deg);
iridiumCoreLog = new G4LogicalVolume(iridiumCore, iridium, "IridiumCoreLog");
iridiumCorePhys = new G4PVPlacement(0,G4ThreeVector(0.,0.,1.975*mm),"IridiumCorePhys",
iridiumCoreLog,capsulePhys,false,0, true);
fIridiumCore = new G4Tubs("IrCore",0,0.30*mm,1.75*mm,0.*deg,360.*deg);
fIridiumCoreLog = new G4LogicalVolume(fIridiumCore, iridium, "IridiumCoreLog");
fIridiumCorePhys = new G4PVPlacement(nullptr,G4ThreeVector(0.,0.,1.975*mm),"IridiumCorePhys",
fIridiumCoreLog, fCapsulePhys,false,0, true);
//Leipzig Applicator is modelled with two different volumes
applicator1 = new G4Tubs("Appl1",5*mm,10.5*mm,12*mm,0.*deg,360.*deg);
applicator1Log = new G4LogicalVolume(applicator1,tungsten,"Appl1Log");
applicator1Phys = new G4PVPlacement(0,G4ThreeVector(0,0,4.0*mm),"Appl1Phys",applicator1Log,
fApplicator1 = new G4Tubs("Appl1",5*mm,10.5*mm,12*mm,0.*deg,360.*deg);
fApplicator1Log = new G4LogicalVolume(fApplicator1,tungsten,"Appl1Log");
fApplicator1Phys = new G4PVPlacement(nullptr,G4ThreeVector(0,0,4.0*mm),"Appl1Phys",fApplicator1Log,
mother,false,0, true);
applicator2 = new G4Tubs("Appl2",0.55*mm,5.*mm,3.125*mm,0.*deg,360.*deg);
applicator2Log = new G4LogicalVolume(applicator2,tungsten,"Appl2");
applicator2Phys = new G4PVPlacement(0,G4ThreeVector(0,0,-4.875*mm),
"Appl2Phys",applicator2Log,mother,false,0, true);
fApplicator2 = new G4Tubs("Appl2",0.55*mm,5.*mm,3.125*mm,0.*deg,360.*deg);
fApplicator2Log = new G4LogicalVolume(fApplicator2,tungsten,"Appl2");
fApplicator2Phys = new G4PVPlacement(nullptr,G4ThreeVector(0,0,-4.875*mm),
"Appl2Phys", fApplicator2Log,mother,false,0, true);
simpleCapsuleVisAtt = new G4VisAttributes(red);
simpleCapsuleVisAtt -> SetVisibility(true);
simpleCapsuleVisAtt -> SetForceWireframe(true);
capsuleLog -> SetVisAttributes(simpleCapsuleVisAtt);
fSimpleCapsuleVisAtt = new G4VisAttributes(red);
fSimpleCapsuleVisAtt -> SetVisibility(true);
fSimpleCapsuleVisAtt -> SetForceWireframe(true);
fCapsuleLog -> SetVisAttributes(fSimpleCapsuleVisAtt);
simpleCapsuleTipVisAtt = new G4VisAttributes(red);
simpleCapsuleTipVisAtt -> SetVisibility(true);
simpleCapsuleTipVisAtt -> SetForceSolid(true);
capsuleTipLog -> SetVisAttributes(simpleCapsuleTipVisAtt);
iridiumCoreLog -> SetVisAttributes(simpleCapsuleTipVisAtt);
fSimpleCapsuleTipVisAtt = new G4VisAttributes(red);
fSimpleCapsuleTipVisAtt -> SetVisibility(true);
fSimpleCapsuleTipVisAtt -> SetForceSolid(true);
fCapsuleTipLog -> SetVisAttributes(fSimpleCapsuleTipVisAtt);
fIridiumCoreLog -> SetVisAttributes(fSimpleCapsuleTipVisAtt);
applicatorVisAtt = new G4VisAttributes(lblue);
applicatorVisAtt -> SetVisibility(true);
applicatorVisAtt -> SetForceWireframe(true);
applicator1Log -> SetVisAttributes(applicatorVisAtt);
applicator2Log -> SetVisAttributes(applicatorVisAtt);
fApplicatorVisAtt = new G4VisAttributes(lblue);
fApplicatorVisAtt -> SetVisibility(true);
fApplicatorVisAtt -> SetForceWireframe(true);
fApplicator1Log -> SetVisAttributes(fApplicatorVisAtt);
fApplicator2Log -> SetVisAttributes(fApplicatorVisAtt);
}
void BrachyDetectorConstructionLeipzig::CleanLeipzigApplicator()
{
delete applicatorVisAtt; applicatorVisAtt = 0;
delete simpleCapsuleTipVisAtt; simpleCapsuleTipVisAtt = 0;
delete simpleCapsuleVisAtt; simpleCapsuleVisAtt = 0;
delete applicator2Phys; applicator2Phys = 0;
delete applicator1Phys; applicator1Phys = 0;
delete iridiumCorePhys; iridiumCorePhys = 0;
delete capsuleTipPhys; capsuleTipPhys = 0;
delete capsulePhys; capsulePhys = 0;
delete applicator2Log; applicator2Log = 0;
delete applicator1Log; applicator1Log = 0;
delete iridiumCoreLog; iridiumCoreLog = 0;
delete capsuleTipLog; capsuleTipLog = 0;
delete capsuleLog; capsuleLog = 0;
delete fApplicatorVisAtt; fApplicatorVisAtt = nullptr;
delete fSimpleCapsuleTipVisAtt; fSimpleCapsuleTipVisAtt = nullptr;
delete fSimpleCapsuleVisAtt; fSimpleCapsuleVisAtt = nullptr;
delete fApplicator2Phys; fApplicator2Phys = nullptr;
delete fApplicator1Phys; fApplicator1Phys = nullptr;
delete fIridiumCorePhys; fIridiumCorePhys = nullptr;
delete fCapsuleTipPhys; fCapsuleTipPhys = nullptr;
delete fCapsulePhys; fCapsulePhys = nullptr;
delete fApplicator2Log; fApplicator2Log = nullptr;
delete fApplicator1Log; fApplicator1Log = nullptr;
delete fIridiumCoreLog; fIridiumCoreLog = nullptr;
delete fCapsuleTipLog; fCapsuleTipLog = nullptr;
delete fCapsuleLog; fCapsuleLog = nullptr;
}
@@ -58,25 +58,25 @@
BrachyDetectorConstructionOncura6711::BrachyDetectorConstructionOncura6711()
:
OncuraCapsule(0),OncuraCapsuleLog(0),
OncuraCapsulePhys(0),
OncuraCapsuleTip1(0),OncuraCapsuleTip1Log(0),
OncuraCapsuleTip1Phys(0),
OncuraCapsuleTip2(0),OncuraCapsuleTip2Log(0),
OncuraCapsuleTip2Phys(0),
OncuraAirGap(0),OncuraAirGapLog(0),
OncuraAirGapPhys(0),
OncuraSilverCore(0), OncuraSilverCoreLog(0),
OncuraSilverCorePhys(0),
OncuraCapsuleShellVisAtt(0),OncuraCapsuleTipVisAtt(0),
OncuraSilverCoreVisAtt(0)
fOncuraCapsule(nullptr), fOncuraCapsuleLog(nullptr),
fOncuraCapsulePhys(nullptr),
fOncuraCapsuleTip1(nullptr), fOncuraCapsuleTip1Log(nullptr),
fOncuraCapsuleTip1Phys(nullptr),
fOncuraCapsuleTip2(nullptr), fOncuraCapsuleTip2Log(nullptr),
fOncuraCapsuleTip2Phys(nullptr),
fOncuraAirGap(nullptr), fOncuraAirGapLog(nullptr),
fOncuraAirGapPhys(nullptr),
fOncuraSilverCore(nullptr), fOncuraSilverCoreLog(nullptr),
fOncuraSilverCorePhys(nullptr),
fOncuraCapsuleShellVisAtt(nullptr), fOncuraCapsuleTipVisAtt(nullptr),
fOncuraSilverCoreVisAtt(nullptr)
{
pMat = new BrachyMaterial();
fMat = new BrachyMaterial();
}
BrachyDetectorConstructionOncura6711::~BrachyDetectorConstructionOncura6711()
{
delete pMat;
delete fMat;
}
void BrachyDetectorConstructionOncura6711::ConstructOncura6711(G4VPhysicalVolume* mother)
@@ -84,122 +84,120 @@ void BrachyDetectorConstructionOncura6711::ConstructOncura6711(G4VPhysicalVolume
G4Colour red (1.0, 0.0, 0.0) ;
G4Colour magenta (1.0, 0.0, 1.0) ;
G4Material* titaniumMat = pMat -> GetMat("titanium");
G4Material* airMat = pMat -> GetMat("Air");
G4Material* silverMat = pMat -> GetMat("Silver");
G4Material* titaniumMat = fMat -> GetMat("titanium");
G4Material* airMat = fMat -> GetMat("Air");
G4Material* silverMat = fMat -> GetMat("Silver");
//Capsule shell
OncuraCapsule = new G4Tubs("OncuraCapsule",0,0.4*mm,1.875*mm,0.*deg,360.*deg);
OncuraCapsuleLog = new G4LogicalVolume(OncuraCapsule,titaniumMat,"OncuraCapsuleLog", 0,0,0);
OncuraCapsulePhys = new G4PVPlacement(0, G4ThreeVector(0,0,0),
"OncuraCapsulePhys", OncuraCapsuleLog,
mother, false,
0, true);
fOncuraCapsule = new G4Tubs("OncuraCapsule",0,0.4*mm,1.875*mm,0.*deg,360.*deg);
fOncuraCapsuleLog = new G4LogicalVolume(fOncuraCapsule,titaniumMat,"OncuraCapsuleLog", 0,0,0);
fOncuraCapsulePhys = new G4PVPlacement(nullptr, G4ThreeVector(0,0,0),
"OncuraCapsulePhys", fOncuraCapsuleLog,
mother, false, 0, true);
//Capsule tips
OncuraCapsuleTip1 = new G4Sphere("OncuraCapsuleTip1", 0, 0.4*mm, 0., 360*deg, 0., 90*deg);
OncuraCapsuleTip1Log = new G4LogicalVolume(OncuraCapsuleTip1, titaniumMat, "OncuraCapsuleTip1Log",0,0,0);
OncuraCapsuleTip1Phys = new G4PVPlacement(0, G4ThreeVector(0,0,1.875*mm),
"OncuraCapsuleTip1Phys", OncuraCapsuleTip1Log,
fOncuraCapsuleTip1 = new G4Sphere("OncuraCapsuleTip1", 0, 0.4*mm, 0., 360*deg, 0., 90*deg);
fOncuraCapsuleTip1Log = new G4LogicalVolume(fOncuraCapsuleTip1, titaniumMat, "OncuraCapsuleTip1Log",0,0,0);
fOncuraCapsuleTip1Phys = new G4PVPlacement(nullptr, G4ThreeVector(0,0,1.875*mm),
"OncuraCapsuleTip1Phys", fOncuraCapsuleTip1Log,
mother, false,
0, true);
OncuraCapsuleTip2 = new G4Sphere("OncuraCapsuleTip2", 0, 0.4*mm, 0., 360*deg, 90*deg, 90*deg);
OncuraCapsuleTip2Log = new G4LogicalVolume(OncuraCapsuleTip2, titaniumMat, "OncuraCapsuleTip2Log",0,0,0);
OncuraCapsuleTip2Phys = new G4PVPlacement(0, G4ThreeVector(0,0,-1.875*mm),
"OncuraCapsuleTip2Phys", OncuraCapsuleTip2Log,
fOncuraCapsuleTip2 = new G4Sphere("OncuraCapsuleTip2", 0, 0.4*mm, 0., 360*deg, 90*deg, 90*deg);
fOncuraCapsuleTip2Log = new G4LogicalVolume(fOncuraCapsuleTip2, titaniumMat, "OncuraCapsuleTip2Log",0,0,0);
fOncuraCapsuleTip2Phys = new G4PVPlacement(nullptr, G4ThreeVector(0,0,-1.875*mm),
"OncuraCapsuleTip2Phys", fOncuraCapsuleTip2Log,
mother, false,
0, true);
//Airgap
OncuraAirGap = new G4Tubs("OncuraAirGap",0,0.33*mm,1.825*mm,0.*deg,360.*deg);
OncuraAirGapLog = new G4LogicalVolume(OncuraAirGap, airMat, "OncuraAirGapLog");
OncuraAirGapPhys = new G4PVPlacement(0, G4ThreeVector(0,0,0),
"OncuraAirGapPhys", OncuraAirGapLog,
OncuraCapsulePhys, false,
//Air gap
fOncuraAirGap = new G4Tubs("OncuraAirGap",0,0.33*mm,1.825*mm,0.*deg,360.*deg);
fOncuraAirGapLog = new G4LogicalVolume(fOncuraAirGap, airMat, "OncuraAirGapLog");
fOncuraAirGapPhys = new G4PVPlacement(nullptr, G4ThreeVector(0,0,0),
"OncuraAirGapPhys", fOncuraAirGapLog,
fOncuraCapsulePhys, false,
0, true);
//Silver core
OncuraSilverCore = new G4Tubs("OncuraSilverCore",0,0.25*mm,1.4*mm,0.*deg,360.*deg);
OncuraSilverCoreLog = new G4LogicalVolume(OncuraSilverCore, silverMat, "silverCoreLog");
OncuraSilverCorePhys = new G4PVPlacement(0, G4ThreeVector(0,0,0),
"OncuraSilverCorePhys", OncuraSilverCoreLog,
OncuraAirGapPhys, false,
fOncuraSilverCore = new G4Tubs("OncuraSilverCore",0,0.25*mm,1.4*mm,0.*deg,360.*deg);
fOncuraSilverCoreLog = new G4LogicalVolume(fOncuraSilverCore, silverMat, "silverCoreLog");
fOncuraSilverCorePhys = new G4PVPlacement(nullptr, G4ThreeVector(0,0,0),
"OncuraSilverCorePhys", fOncuraSilverCoreLog,
fOncuraAirGapPhys, false,
0, true);
OncuraCapsuleShellVisAtt = new G4VisAttributes(red);
OncuraCapsuleShellVisAtt -> SetVisibility(true);
OncuraCapsuleShellVisAtt -> SetForceWireframe(true);
OncuraCapsuleLog -> SetVisAttributes(OncuraCapsuleShellVisAtt);
fOncuraCapsuleShellVisAtt = new G4VisAttributes(red);
fOncuraCapsuleShellVisAtt -> SetVisibility(true);
fOncuraCapsuleShellVisAtt -> SetForceWireframe(true);
fOncuraCapsuleLog -> SetVisAttributes(fOncuraCapsuleShellVisAtt);
OncuraCapsuleTipVisAtt = new G4VisAttributes(red);
OncuraCapsuleTipVisAtt -> SetVisibility(true);
OncuraCapsuleTipVisAtt -> SetForceSolid(true);
OncuraCapsuleTip1Log -> SetVisAttributes(OncuraCapsuleTipVisAtt);
OncuraCapsuleTip2Log -> SetVisAttributes(OncuraCapsuleTipVisAtt);
OncuraSilverCoreVisAtt = new G4VisAttributes(magenta);
OncuraSilverCoreVisAtt -> SetVisibility(true);
OncuraSilverCoreVisAtt -> SetForceSolid(true);
OncuraSilverCoreLog -> SetVisAttributes(OncuraSilverCoreVisAtt);
fOncuraCapsuleTipVisAtt = new G4VisAttributes(red);
fOncuraCapsuleTipVisAtt -> SetVisibility(true);
fOncuraCapsuleTipVisAtt -> SetForceSolid(true);
fOncuraCapsuleTip1Log -> SetVisAttributes(fOncuraCapsuleTipVisAtt);
fOncuraCapsuleTip2Log -> SetVisAttributes(fOncuraCapsuleTipVisAtt);
fOncuraSilverCoreVisAtt = new G4VisAttributes(magenta);
fOncuraSilverCoreVisAtt -> SetVisibility(true);
fOncuraSilverCoreVisAtt -> SetForceSolid(true);
fOncuraSilverCoreLog -> SetVisAttributes(fOncuraSilverCoreVisAtt);
}
void BrachyDetectorConstructionOncura6711::CleanOncura6711()
{
delete OncuraSilverCoreVisAtt;
OncuraSilverCoreVisAtt = 0;
delete fOncuraSilverCoreVisAtt;
fOncuraSilverCoreVisAtt = nullptr;
delete OncuraCapsuleTipVisAtt;
OncuraCapsuleTipVisAtt = 0;
delete fOncuraCapsuleTipVisAtt;
fOncuraCapsuleTipVisAtt = nullptr;
delete OncuraCapsuleShellVisAtt;
OncuraCapsuleShellVisAtt = 0;
delete fOncuraCapsuleShellVisAtt;
fOncuraCapsuleShellVisAtt = nullptr;
delete OncuraSilverCorePhys;
OncuraSilverCorePhys = 0;
delete fOncuraSilverCorePhys;
fOncuraSilverCorePhys = nullptr;
delete OncuraSilverCoreLog;
OncuraSilverCoreLog = 0;
delete fOncuraSilverCoreLog;
fOncuraSilverCoreLog = nullptr;
delete OncuraSilverCore;
OncuraSilverCore = 0;
delete fOncuraSilverCore;
fOncuraSilverCore = nullptr;
delete OncuraAirGapPhys;
OncuraAirGapPhys = 0;
delete fOncuraAirGapPhys;
fOncuraAirGapPhys = nullptr;
delete OncuraAirGapLog;
OncuraAirGapLog = 0;
delete fOncuraAirGapLog;
fOncuraAirGapLog = nullptr;
delete OncuraAirGap;
OncuraAirGap = 0;
delete fOncuraAirGap;
fOncuraAirGap = nullptr;
delete OncuraCapsuleTip2Phys;
OncuraCapsuleTip2Phys = 0;
delete fOncuraCapsuleTip2Phys;
fOncuraCapsuleTip2Phys = nullptr;
delete OncuraCapsuleTip2Log;
OncuraCapsuleTip2Log = 0;
delete fOncuraCapsuleTip2Log;
fOncuraCapsuleTip2Log = nullptr;
delete OncuraCapsuleTip2;
OncuraCapsuleTip2 = 0;
delete fOncuraCapsuleTip2;
fOncuraCapsuleTip2 = nullptr;
delete OncuraCapsuleTip1Phys;
OncuraCapsuleTip1Phys = 0;
delete fOncuraCapsuleTip1Phys;
fOncuraCapsuleTip1Phys = nullptr;
delete OncuraCapsuleTip1Log;
OncuraCapsuleTip1Log = 0;
delete fOncuraCapsuleTip1Log;
fOncuraCapsuleTip1Log = nullptr;
delete OncuraCapsuleTip1;
OncuraCapsuleTip1 = 0;
delete fOncuraCapsuleTip1;
fOncuraCapsuleTip1 = nullptr;
delete OncuraCapsulePhys;
OncuraCapsulePhys = 0;
delete fOncuraCapsulePhys;
fOncuraCapsulePhys = nullptr;
delete OncuraCapsuleLog;
OncuraCapsuleLog = 0;
delete fOncuraCapsuleLog;
fOncuraCapsuleLog = nullptr;
delete OncuraCapsule;
OncuraCapsule = 0;
delete fOncuraCapsule;
fOncuraCapsule = nullptr;
G4RunManager::GetRunManager() -> GeometryHasBeenModified();
}
@@ -57,23 +57,23 @@
BrachyDetectorConstructionTG186::BrachyDetectorConstructionTG186()
:
TG186capsule(0),TG186capsuleLog(0),
TG186capsulePhys(0),
TG186capsuleTip(0),TG186capsuleTipLog(0),
TG186capsuleTipPhys(0),
TG186iridiumCore(0),TG186iridiumCoreLog(0),
TG186iridiumCorePhys(0),
TG186cable(0),TG186cableLog(0),
TG186cablePhys(0),
TG186simpleCapsuleVisAtt(0),TG186simpleCapsuleTipVisAtt(0),TG186simpleIridiumVisAtt(0),
TG186simpleCableVisAtt(0)
fTG186capsule(nullptr), fTG186capsuleLog(nullptr),
fTG186capsulePhys(nullptr),
fTG186capsuleTip(nullptr), fTG186capsuleTipLog(nullptr),
fTG186capsuleTipPhys(nullptr),
fTG186iridiumCore(nullptr), fTG186iridiumCoreLog(nullptr),
fTG186iridiumCorePhys(nullptr),
fTG186cable(nullptr), fTG186cableLog(nullptr),
fTG186cablePhys(nullptr),
fTG186simpleCapsuleVisAtt(nullptr), fTG186simpleCapsuleTipVisAtt(nullptr), fTG186simpleIridiumVisAtt(nullptr),
fTG186simpleCableVisAtt(nullptr)
{
pMat = new BrachyMaterial();
fMat = new BrachyMaterial();
}
BrachyDetectorConstructionTG186::~BrachyDetectorConstructionTG186()
{
delete pMat;
delete fMat;
}
void BrachyDetectorConstructionTG186::ConstructTG186(G4VPhysicalVolume* mother)
@@ -81,22 +81,22 @@ void BrachyDetectorConstructionTG186::ConstructTG186(G4VPhysicalVolume* mother)
G4Colour red (1.0, 0.0, 0.0) ;
G4Colour magenta (1.0, 0.0, 1.0) ;
G4Material* capsuleMat = pMat -> GetMat("Stainless steel");
G4Material* iridiumMat = pMat -> GetMat("Iridium");
G4Material* capsuleMat = fMat -> GetMat("Stainless steel");
G4Material* iridiumMat = fMat -> GetMat("Iridium");
// Capsule main body
TG186capsule = new G4Tubs("TG186-Capsule",0,0.5*mm,2.25*mm,0.*deg,360.*deg);
TG186capsuleLog = new G4LogicalVolume(TG186capsule,capsuleMat,"TG186-CapsuleLog");
TG186capsulePhys = new G4PVPlacement(0,
fTG186capsule = new G4Tubs("TG186-Capsule",0,0.5*mm,2.25*mm,0.*deg,360.*deg);
fTG186capsuleLog = new G4LogicalVolume(fTG186capsule,capsuleMat,"TG186-CapsuleLog");
fTG186capsulePhys = new G4PVPlacement(nullptr,
G4ThreeVector(0,0,-0.4*mm),
"TG186-IridiumCapsulePhys",
TG186capsuleLog,
fTG186capsuleLog,
mother,
false,
0, true);
// Capsule tip
TG186capsuleTip = new G4Sphere("Tg186-CapsuleTipIridium",
fTG186capsuleTip = new G4Sphere("Tg186-CapsuleTipIridium",
0.*mm,
0.5*mm,
0.*deg,
@@ -104,119 +104,122 @@ void BrachyDetectorConstructionTG186::ConstructTG186(G4VPhysicalVolume* mother)
0.*deg,
90.*deg);
TG186capsuleTipLog = new G4LogicalVolume(TG186capsuleTip,
fTG186capsuleTipLog = new G4LogicalVolume(fTG186capsuleTip,
capsuleMat,
"CapsuleTipIridumLog");
TG186capsuleTipPhys = new G4PVPlacement(0,
fTG186capsuleTipPhys = new G4PVPlacement(nullptr,
G4ThreeVector(0.,0.,1.85*mm),
"TG186-CapsuleTipIridiumPhys",
TG186capsuleTipLog,
fTG186capsuleTipLog,
mother,
false,
0, true);
TG186cable = new G4Tubs("TG186-cable",
fTG186cable = new G4Tubs("TG186-cable",
0.*mm,
0.5*mm,
1.0*mm,
1.0*mm,
0.*deg,
360.*deg);
TG186cableLog = new G4LogicalVolume(TG186cable,
fTG186cableLog = new G4LogicalVolume(fTG186cable,
capsuleMat,
"TG186-cableLog");
TG186cablePhys = new G4PVPlacement(0,
fTG186cablePhys = new G4PVPlacement(nullptr,
G4ThreeVector(0.,0.,-3.65*mm),
"TG186-CablePhys",
TG186cableLog,
fTG186cableLog,
mother,
false,
0, true);
// Iridium core
TG186iridiumCore = new G4Tubs("TG186-IrCore",0,0.30*mm,1.75*mm,0.*deg,360.*deg);
TG186iridiumCoreLog = new G4LogicalVolume(TG186iridiumCore,
fTG186iridiumCore = new G4Tubs("TG186-IrCore",0,0.30*mm,1.75*mm,0.*deg,360.*deg);
fTG186iridiumCoreLog = new G4LogicalVolume(fTG186iridiumCore,
iridiumMat,
"TG186-IridiumCoreLog");
TG186iridiumCorePhys = new G4PVPlacement(0,
fTG186iridiumCorePhys = new G4PVPlacement(nullptr,
G4ThreeVector(0,0,0.4*mm),
"TG186-IridiumCorePhys",
TG186iridiumCoreLog,
TG186capsulePhys,
fTG186iridiumCoreLog,
fTG186capsulePhys,
false,
0, true);
TG186simpleCapsuleVisAtt = new G4VisAttributes(red);
TG186simpleCapsuleVisAtt -> SetVisibility(true);
TG186simpleCapsuleVisAtt -> SetForceWireframe(true);
TG186capsuleLog -> SetVisAttributes(TG186simpleCapsuleVisAtt);
fTG186simpleCapsuleVisAtt = new G4VisAttributes(red);
fTG186simpleCapsuleVisAtt -> SetVisibility(true);
fTG186simpleCapsuleVisAtt -> SetForceWireframe(true);
fTG186capsuleLog -> SetVisAttributes(fTG186simpleCapsuleVisAtt);
TG186simpleCapsuleTipVisAtt = new G4VisAttributes(red);
TG186simpleCapsuleTipVisAtt -> SetVisibility(true);
TG186simpleCapsuleTipVisAtt -> SetForceSolid(true);
TG186capsuleTipLog -> SetVisAttributes(TG186simpleCapsuleTipVisAtt);
fTG186simpleCapsuleTipVisAtt = new G4VisAttributes(red);
fTG186simpleCapsuleTipVisAtt -> SetVisibility(true);
fTG186simpleCapsuleTipVisAtt -> SetForceSolid(true);
fTG186capsuleTipLog -> SetVisAttributes(fTG186simpleCapsuleTipVisAtt);
TG186simpleIridiumVisAtt = new G4VisAttributes(magenta);
TG186simpleIridiumVisAtt -> SetVisibility(true);
TG186simpleIridiumVisAtt -> SetForceWireframe(true);
TG186iridiumCoreLog -> SetVisAttributes(TG186simpleIridiumVisAtt);
fTG186simpleIridiumVisAtt = new G4VisAttributes(magenta);
fTG186simpleIridiumVisAtt -> SetVisibility(true);
fTG186simpleIridiumVisAtt -> SetForceWireframe(true);
fTG186iridiumCoreLog -> SetVisAttributes(fTG186simpleIridiumVisAtt);
TG186simpleCableVisAtt = new G4VisAttributes(red);
TG186simpleCableVisAtt -> SetVisibility(true);
TG186simpleCableVisAtt -> SetForceSolid(true);
TG186cableLog -> SetVisAttributes(TG186simpleCableVisAtt);
fTG186simpleCableVisAtt = new G4VisAttributes(red);
fTG186simpleCableVisAtt -> SetVisibility(true);
fTG186simpleCableVisAtt -> SetForceSolid(true);
fTG186cableLog -> SetVisAttributes(fTG186simpleCableVisAtt);
}
void BrachyDetectorConstructionTG186::CleanTG186()
{
delete TG186simpleIridiumVisAtt;
TG186simpleIridiumVisAtt = 0;
delete fTG186simpleIridiumVisAtt;
fTG186simpleIridiumVisAtt = nullptr;
delete TG186iridiumCorePhys;
TG186iridiumCorePhys = 0;
delete fTG186iridiumCorePhys;
fTG186iridiumCorePhys = nullptr;
delete TG186iridiumCore;
TG186iridiumCore = 0;
delete fTG186iridiumCore;
fTG186iridiumCore = nullptr;
delete TG186iridiumCoreLog;
TG186iridiumCoreLog = 0 ;
delete fTG186iridiumCoreLog;
fTG186iridiumCoreLog = nullptr ;
delete TG186simpleCapsuleTipVisAtt;
TG186simpleCapsuleTipVisAtt = 0;
delete fTG186simpleCapsuleTipVisAtt;
fTG186simpleCapsuleTipVisAtt = nullptr;
delete TG186capsuleTipPhys;
TG186capsuleTipPhys = 0;
delete fTG186capsuleTipPhys;
fTG186capsuleTipPhys = nullptr;
delete TG186capsuleTip;
TG186capsuleTip = 0;
delete fTG186capsuleTip;
fTG186capsuleTip = nullptr;
delete TG186capsuleTipLog;
TG186capsuleTipLog = 0;
delete fTG186capsuleTipLog;
fTG186capsuleTipLog = nullptr;
delete TG186simpleCapsuleVisAtt;
TG186simpleCapsuleVisAtt = 0;
delete fTG186simpleCapsuleVisAtt;
fTG186simpleCapsuleVisAtt = nullptr;
delete TG186capsulePhys;
TG186capsulePhys = 0;
delete fTG186capsulePhys;
fTG186capsulePhys = nullptr;
delete TG186capsule;
TG186capsule = 0;
delete fTG186capsule;
fTG186capsule = nullptr;
delete TG186capsuleLog;
TG186capsuleLog = 0;
delete fTG186capsuleLog;
fTG186capsuleLog = nullptr;
delete TG186cable;
TG186cable = 0;
delete fTG186cable;
fTG186cable = nullptr;
delete TG186cableLog;
TG186cableLog = 0;
delete fTG186cableLog;
fTG186cableLog = nullptr;
delete TG186cablePhys;
TG186cablePhys = 0;
delete fTG186cablePhys;
fTG186cablePhys = nullptr;
delete TG186simpleCableVisAtt;
TG186simpleCableVisAtt = 0;
delete fTG186simpleCableVisAtt;
fTG186simpleCableVisAtt = nullptr;
G4RunManager::GetRunManager() -> GeometryHasBeenModified();
}
@@ -34,53 +34,49 @@
// *********************************
//
//
//
//
#include "BrachyDetectorMessenger.hh"
#include "BrachyDetectorConstruction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAString.hh"
BrachyDetectorMessenger::BrachyDetectorMessenger( BrachyDetectorConstruction* Det): detector(Det)
BrachyDetectorMessenger::BrachyDetectorMessenger(BrachyDetectorConstruction* detector): fDetector(detector)
{
detectorDir = new G4UIdirectory("/phantom/");
detectorDir -> SetGuidance(" phantom control.");
fDetectorDir = new G4UIdirectory("/phantom/");
fDetectorDir -> SetGuidance(" phantom control.");
phantomMaterialCmd = new G4UIcmdWithAString("/phantom/selectMaterial",this);
phantomMaterialCmd -> SetGuidance("Select Material of the phantom.");
phantomMaterialCmd -> SetParameterName("choice",false);
phantomMaterialCmd -> AvailableForStates(G4State_Idle);
fPhantomMaterialCmd = new G4UIcmdWithAString("/phantom/selectMaterial",this);
fPhantomMaterialCmd -> SetGuidance("Select Material of the phantom.");
fPhantomMaterialCmd -> SetParameterName("choice",false);
fPhantomMaterialCmd -> AvailableForStates(G4State_Idle);
sourceCmd = new G4UIcmdWithAString("/source/switch",this);
sourceCmd -> SetGuidance("Assign the selected geometry to G4RunManager.");
sourceCmd -> SetParameterName("choice",true);
sourceCmd -> SetDefaultValue(" ");
sourceCmd -> SetCandidates("TG186 Flexi Iodine Leipzig Oncura");
sourceCmd -> AvailableForStates(G4State_PreInit,G4State_Idle);
fSourceCmd = new G4UIcmdWithAString("/source/switch",this);
fSourceCmd -> SetGuidance("Assign the selected geometry to G4RunManager.");
fSourceCmd -> SetParameterName("choice",true);
fSourceCmd -> SetDefaultValue(" ");
fSourceCmd -> SetCandidates("TG186 Flexi Iodine Leipzig Oncura");
fSourceCmd -> AvailableForStates(G4State_PreInit,G4State_Idle);
}
BrachyDetectorMessenger::~BrachyDetectorMessenger()
{
delete sourceCmd;
delete phantomMaterialCmd;
delete detectorDir;
delete fSourceCmd;
delete fPhantomMaterialCmd;
delete fDetectorDir;
}
void BrachyDetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
{
// Change the material of the phantom
if( command == phantomMaterialCmd )
{ detector -> SetPhantomMaterial(newValue);}
if( command == fPhantomMaterialCmd )
{ fDetector -> SetPhantomMaterial(newValue);}
// Switch the source in the phantom
if( command == sourceCmd )
if( command == fSourceCmd )
{
if(newValue=="Iodine" || newValue=="TG186"|| newValue=="Leipzig" || newValue== "Flexi" || newValue== "Oncura")
{
detector -> SelectBrachytherapicSeed(newValue);
detector -> SwitchBrachytherapicSeed();
fDetector -> SelectBrachytherapicSeed(newValue);
fDetector -> SwitchBrachytherapicSeed();
}
}
}
@@ -48,21 +48,21 @@
BrachyFactoryFlexi:: BrachyFactoryFlexi()
{
flexiSource = new BrachyDetectorConstructionFlexi();
fFlexiSource = new BrachyDetectorConstructionFlexi();
}
BrachyFactoryFlexi:: ~BrachyFactoryFlexi()
{
delete flexiSource;
delete fFlexiSource;
}
void BrachyFactoryFlexi::CreateSource(G4VPhysicalVolume* mother)
{
flexiSource -> ConstructFlexi(mother);
fFlexiSource -> ConstructFlexi(mother);
}
void BrachyFactoryFlexi::CleanSource()
{
flexiSource -> CleanFlexi();
flexiSource = 0;
fFlexiSource -> CleanFlexi();
fFlexiSource = nullptr;
}
@@ -46,21 +46,21 @@
BrachyFactoryI:: BrachyFactoryI()
{
iodiumSource = new BrachyDetectorConstructionI();
fIodineSource = new BrachyDetectorConstructionI();
}
BrachyFactoryI::~BrachyFactoryI()
{
delete iodiumSource;
delete fIodineSource;
}
void BrachyFactoryI::CreateSource(G4VPhysicalVolume* mother)
{
iodiumSource -> ConstructIodium(mother);
fIodineSource -> ConstructIodine(mother);
}
void BrachyFactoryI::CleanSource()
{
iodiumSource -> CleanIodium();
iodiumSource = 0;
fIodineSource -> CleanIodine();
fIodineSource = nullptr;
}
@@ -48,21 +48,21 @@
BrachyFactoryLeipzig:: BrachyFactoryLeipzig()
{
leipzigSource = new BrachyDetectorConstructionLeipzig();
fLeipzigSource = new BrachyDetectorConstructionLeipzig();
}
BrachyFactoryLeipzig:: ~BrachyFactoryLeipzig()
{
delete leipzigSource;
delete fLeipzigSource;
}
void BrachyFactoryLeipzig::CreateSource(G4VPhysicalVolume* mother)
{
leipzigSource -> ConstructLeipzig(mother);
fLeipzigSource -> ConstructLeipzig(mother);
}
void BrachyFactoryLeipzig::CleanSource()
{
leipzigSource -> CleanLeipzigApplicator();
leipzigSource = 0;
fLeipzigSource -> CleanLeipzigApplicator();
fLeipzigSource = nullptr;
}
@@ -48,21 +48,21 @@
BrachyFactoryOncura6711:: BrachyFactoryOncura6711()
{
Oncura6711IodineSource = new BrachyDetectorConstructionOncura6711();
fOncura6711IodineSource = new BrachyDetectorConstructionOncura6711();
}
BrachyFactoryOncura6711:: ~BrachyFactoryOncura6711()
{
delete Oncura6711IodineSource;
delete fOncura6711IodineSource;
}
void BrachyFactoryOncura6711::CreateSource(G4VPhysicalVolume* mother)
{
Oncura6711IodineSource -> ConstructOncura6711(mother);
fOncura6711IodineSource -> ConstructOncura6711(mother);
}
void BrachyFactoryOncura6711::CleanSource()
{
Oncura6711IodineSource -> CleanOncura6711();
Oncura6711IodineSource = 0;
fOncura6711IodineSource -> CleanOncura6711();
fOncura6711IodineSource = nullptr;
}
@@ -47,21 +47,21 @@
BrachyFactoryTG186:: BrachyFactoryTG186()
{
TG186iridiumSource = new BrachyDetectorConstructionTG186();
fTG186iridiumSource = new BrachyDetectorConstructionTG186();
}
BrachyFactoryTG186:: ~BrachyFactoryTG186()
{
delete TG186iridiumSource;
delete fTG186iridiumSource;
}
void BrachyFactoryTG186::CreateSource(G4VPhysicalVolume* mother)
{
TG186iridiumSource -> ConstructTG186(mother);
fTG186iridiumSource -> ConstructTG186(mother);
}
void BrachyFactoryTG186::CleanSource()
{
TG186iridiumSource -> CleanTG186();
TG186iridiumSource = 0;
fTG186iridiumSource -> CleanTG186();
fTG186iridiumSource = nullptr;
}
@@ -45,7 +45,12 @@
#include "G4ElementTable.hh"
#include "BrachyMaterial.hh"
BrachyMaterial::BrachyMaterial()
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()
@@ -117,132 +122,132 @@ void BrachyMaterial::DefineMaterials()
A = 183.84* g/mole;
d = 19.3*g/cm3;
matW = new G4Material("Tungsten",Z = 74.,A,d);
fW = new G4Material("Tungsten",Z = 74.,A,d);
// Perspex, plexiglass, lucite
d = 1.19*g/cm3;
matplexiglass = new G4Material("Plexiglass",d,3);
matplexiglass->AddElement(elH,0.08);
matplexiglass->AddElement(elC,0.60);
matplexiglass->AddElement(elO,0.32);
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;
matPb = new G4Material("Lead",Z,A,d);
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;
matir192 = new G4Material("Iridium",Z,A,d);
fIr192 = new G4Material("Iridium",Z,A,d);
//titanium
A = 47.88*g/mole;
d = 4.50*g/cm3;
Titanium = new G4Material("titanium" ,Z = 22.,A,d);
fTi = new G4Material("titanium" ,Z = 22.,A,d);
//silver
A = 107.87*g/mole;
d = 10.49*g/cm3;
Z = 22.0;
matAg = new G4Material("Silver", Z, A, d);
fAg = new G4Material("Silver", Z, A, d);
// Air material
d = 1.290*mg/cm3;
matAir = new G4Material("Air",d,2);
matAir->AddElement(elN,0.7);
matAir->AddElement(elO,0.3);
fAir = new G4Material("Air",d,2);
fAir -> AddElement(elN,0.7);
fAir -> AddElement(elO,0.3);
// Water
d = 1.000*g/cm3;
matH2O = new G4Material("Water",d,2);
matH2O->AddElement(elH,2);
matH2O->AddElement(elO,1);
matH2O->GetIonisation()->SetMeanExcitationEnergy(75.0*eV);
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;
soft = new G4Material("tissue",d,13);
soft->AddElement(elH,0.104472);
soft->AddElement(elC,0.23219);
soft->AddElement(elN,0.02488);
soft->AddElement(elO,0.630238);
soft->AddElement(elNa,0.00113);
soft->AddElement(elMg,0.00013);
soft->AddElement(elP,0.00133);
soft->AddElement(elS,0.00199);
soft->AddElement(elCl,0.00134);
soft->AddElement(elK,0.00199);
soft->AddElement(elCa,0.00023);
soft->AddElement(elFe,0.00005);
soft->AddElement(elZn,0.00003);
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 ;
matsteel = new G4Material("Stainless steel",d,5);
matsteel->AddElement(elMn, 0.02);
matsteel->AddElement(elSi, 0.01);
matsteel->AddElement(elCr, 0.19);
matsteel->AddElement(elNi, 0.10);
matsteel->AddElement(elFe, 0.68);
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 ;
mat304steel = new G4Material("Stainless steel 304",d,6);
mat304steel->AddElement(elMn, 0.02);
mat304steel->AddElement(elSi, 0.01);
mat304steel->AddElement(elCr, 0.19);
mat304steel->AddElement(elNi, 0.10);
mat304steel->AddElement(elFe, 0.6792);
mat304steel->AddElement(elC, 0.0008);
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;
gold = new G4Material("gold",Z = 79.,A,d);
fAu = new G4Material("gold",Z = 79.,A,d);
//Iodine Core
A = 124.9*g/mole;
d = 4.862*g/cm3;
matI = new G4Material("Iodine",Z = 53.,A,d);
fI = new G4Material("Iodine",Z = 53.,A,d);
//ceramic(Medical Physics, May 2000)
d = 2.88*g/cm3;
ceramic = new G4Material("allumina",d,2);
ceramic->AddElement(elAl,2);
ceramic->AddElement(elO,3);
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;
Vacuum = new G4Material("Galactic", Z = 1., A,density,kStateGas,temperature,pressure);
fVacuum = new G4Material("Galactic", Z = 1., A,density,kStateGas,temperature,pressure);
//compact bone (http://www.NIST.gov)
d = 1.85*g/cm3;
bone = new G4Material("bone",d,8);
bone->AddElement(elH,0.063984);
bone->AddElement(elC,0.278);
bone->AddElement(elN,0.027);
bone->AddElement(elO,0.410016);
bone->AddElement(elMg,0.002);
bone->AddElement(elP,0.07);
bone->AddElement(elS,0.002);
bone->AddElement(elCa,0.147);
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)
muscle = new G4Material("muscle",d,9);
muscle->AddElement(elH,0.101997);
muscle->AddElement(elC,0.123);
muscle->AddElement(elN,0.035);
muscle->AddElement(elNa,0.0008);
muscle->AddElement(elO,0.729);
muscle->AddElement(elMg,0.0002);
muscle->AddElement(elP,0.002);
muscle->AddElement(elS,0.005);
muscle->AddElement(elK,0.003);
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)
@@ -55,6 +55,8 @@ Author: Susanna Guatelli
#include "globals.hh"
#include "G4SystemOfUnits.hh"
#include "BrachyPhysicsListMessenger.hh"
#include "G4UAtomicDeexcitation.hh"
#include "G4LossTableManager.hh"
BrachyPhysicsList::BrachyPhysicsList(): G4VModularPhysicsList()
{
@@ -91,8 +93,19 @@ fEmPhysicsList -> ConstructProcess();
// decay physics list
fDecPhysicsList -> ConstructProcess();
fRadDecayPhysicsList -> ConstructProcess();
}
// Deexcitation
// Both Fluorescence and Auger e- emission activated
G4VAtomDeexcitation* de = new G4UAtomicDeexcitation();
G4LossTableManager::Instance()->SetAtomDeexcitation(de);
de -> SetFluo(true);
de -> SetAuger(true);
// To model full Auger cascade include in the macro file
// the following UI commands:
// process/em/augerCascade true
// process/em/deexcitationIgnoreCut true
}
void BrachyPhysicsList::AddPhysicsList(const G4String& name)
{
@@ -46,38 +46,35 @@
#include "G4Event.hh"
#include "G4GeneralParticleSource.hh"
#include "G4RunManager.hh"
#include <CLHEP/Units/SystemOfUnits.h>
#ifdef ANALYSIS_USE
#include "G4SystemOfUnits.hh"
#include "BrachyAnalysisManager.hh"
#endif
BrachyPrimaryGeneratorAction::BrachyPrimaryGeneratorAction()
{
// Use the GPS to generate primary particles,
// Particle type, energy position, direction are specified in the
// the macro file primary.mac
gun = new G4GeneralParticleSource();
// Particle type, energy position, direction are specified in
//macro files
fGun = new G4GeneralParticleSource();
}
BrachyPrimaryGeneratorAction::~BrachyPrimaryGeneratorAction()
{
delete gun;
delete fGun;
}
void BrachyPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
gun -> GeneratePrimaryVertex(anEvent);
fGun -> GeneratePrimaryVertex(anEvent);
#ifdef ANALYSIS_USE
if (gun -> GetParticleDefinition()-> GetParticleName()== "gamma")
if (fGun -> GetParticleDefinition()-> GetParticleName()== "gamma")
{
BrachyAnalysisManager* analysis = BrachyAnalysisManager::GetInstance();
G4double energy = gun -> GetParticleEnergy();
analysis -> FillPrimaryParticleHistogram(energy/CLHEP::keV);
}
#endif
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);
}
}
@@ -45,7 +45,9 @@
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4ios.hh"
#include "BrachyAnalysisManager.hh"
#include "G4SystemOfUnits.hh"
#include "globals.hh"
BrachyRunAction::BrachyRunAction()
{}
@@ -55,13 +57,33 @@ BrachyRunAction::~BrachyRunAction()
void BrachyRunAction::BeginOfRunAction(const G4Run* aRun)
{
G4cout << "### Run " << aRun -> GetRunID() << " start." << G4endl;
G4cout << "### Run " << aRun -> GetRunID() << " start." << G4endl;
auto analysisManager = G4AnalysisManager::Instance();
G4bool fileOpen = analysisManager -> OpenFile("primary.root");
if (! fileOpen) {
G4cerr << "\n---> The ROOT output file has not been opened "
<< analysisManager->GetFileName() << G4endl;
}
G4cout << "Using " << analysisManager->GetType() << G4endl;
analysisManager -> SetVerboseLevel(1);
// Create histogram with the energy spectrum of the photons emitted by the
// radionucldie
analysisManager-> CreateH1("h10","energy spectrum", 800, 0., 800.);
}
void BrachyRunAction::EndOfRunAction(const G4Run* aRun)
{
G4cout << "number of events = " << aRun->GetNumberOfEvent() << G4endl;
G4cout << "number of events = " << aRun->GetNumberOfEvent() << G4endl;
// save histograms in primary.root
auto analysisManager = G4AnalysisManager::Instance();
analysisManager -> Write();
analysisManager -> CloseFile();
}
@@ -39,27 +39,20 @@
#include "G4TrackStatus.hh"
#include "G4ParticleDefinition.hh"
#include "G4Gamma.hh"
#ifdef ANALYSIS_USE
#include "BrachyAnalysisManager.hh"
#endif
#include "BrachySteppingAction.hh"
#include "G4SystemOfUnits.hh"
BrachySteppingAction::BrachySteppingAction()
{
}
{}
BrachySteppingAction::~BrachySteppingAction()
{
}
{}
void BrachySteppingAction::UserSteppingAction(const G4Step* aStep)
{
// Retrieve the spectrum of gamma emitted in the Radioactive Decay
// Retrieve the spectrum of photons emitted in the Radioactive Decay
// and store it in a 1D histogram
G4SteppingManager* steppingManager = fpSteppingManager;
@@ -68,7 +61,6 @@ void BrachySteppingAction::UserSteppingAction(const G4Step* aStep)
// check if it is alive
if(theTrack-> GetTrackStatus() == fAlive) {return;}
// G4cout << "Start secondariessss" << G4endl;
// Retrieve the secondary particles
G4TrackVector* fSecondary = steppingManager -> GetfSecondary();
@@ -83,14 +75,13 @@ void BrachySteppingAction::UserSteppingAction(const G4Step* aStep)
// Retrieve the process originating it
// G4cout << "creator process " << process << G4endl;
if (process == "RadioactiveDecay")
if (process == "RadioactiveDecayBase")
{
#ifdef ANALYSIS_USE
BrachyAnalysisManager* analysis = BrachyAnalysisManager::GetInstance();
G4double energy = (*fSecondary)[lp1] -> GetKineticEnergy();
// Store the initial energy of particles in a 1D histogram
analysis -> FillPrimaryParticleHistogram(energy/keV);
#endif
G4double energy = (*fSecondary)[lp1] -> GetKineticEnergy();
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
// Fill histogram with energy spectrum of the photons emitted in the
// radioactive decay
analysisManager->FillH1(0, energy/keV);
}
}
}
@@ -33,13 +33,8 @@ Original code from geant4/examples/extended/runAndEvent/RE03, by M. Asai
#include <map>
#include <fstream>
#include "BrachyUserScoreWriter.hh"
#include <CLHEP/Units/SystemOfUnits.h>
#ifdef ANALYSIS_USE
#include "G4SystemOfUnits.hh"
#include "BrachyAnalysisManager.hh"
#endif
#include "G4MultiFunctionalDetector.hh"
#include "G4SDParticleFilter.hh"
#include "G4VPrimitiveScorer.hh"
@@ -107,6 +102,26 @@ ofile << "# primitive scorer name: " << msMapItr -> first << G4endl;
// Write quantity in the ASCII output file and in brachytherapy.root
//
ofile << std::setprecision(16); // for double value with 8 bytes
auto analysisManager = G4AnalysisManager::Instance();
G4bool fileOpen = analysisManager -> OpenFile("brachytherapy.root");
if (! fileOpen) {
G4cerr << "\n---> The ROOT output file has not been opened "
<< analysisManager->GetFileName() << G4endl;
}
G4cout << "Using " << analysisManager -> GetType() << G4endl;
analysisManager -> SetVerboseLevel(1);
analysisManager -> SetActivation(true);
// Create histograms
G4int histo2= analysisManager-> CreateH2("h20","edep2Dxy", 801, -100.125, 100.125, 801, -100.125, 100.125);
// Histo 0 with the energy spectrum will not be saved
// in brachytherapy.root
analysisManager->SetH1Activation(0, false);
analysisManager->SetH2Activation(histo2, true);
for(int x = 0; x < fNMeshSegments[0]; x++) {
for(int y = 0; y < fNMeshSegments[1]; y++) {
@@ -129,20 +144,20 @@ for(int x = 0; x < fNMeshSegments[0]; x++) {
// Print in the ASCII output file the information
ofile << xx << " " << yy << " " << zz <<" "
<<(value->second->sum_wx())/CLHEP::keV << G4endl;
#ifdef ANALYSIS_USE
// Save the same information in the output analysis file
BrachyAnalysisManager* analysis = BrachyAnalysisManager::GetInstance();
<<(value->second->sum_wx())/keV << G4endl;
// Save the same information in the ROOT output file
if(zz> -0.125 *CLHEP::mm && zz < 0.125*CLHEP::mm)
analysis -> FillH2WithEnergyDeposition(xx,yy,
(value->second->sum_wx())/CLHEP::keV);
#endif
if(zz> -0.125 *CLHEP::mm && zz < 0.125/mm)
analysisManager->FillH2(histo2, xx, yy, (value->second->sum_wx())/keV);
}}}}
ofile << std::setprecision(6);
// Close the output ASCII file
ofile.close();
// Close the output ROOT file
analysisManager -> Write();
analysisManager -> CloseFile();
}