Import Geant4 10.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-12-09 12:35:28 +01:00
parent 4ec577e5c4
commit a3452e42ac
3514 changed files with 210500 additions and 89628 deletions
@@ -31,9 +31,9 @@ Author: Susanna Guatelli
// example analysis/AnaEx01
#include <stdlib.h>
#include "G4SystemOfUnits.hh"
#include "BrachyAnalysisManager.hh"
#include "G4UnitsTable.hh"
#include "G4SystemOfUnits.hh"
BrachyAnalysisManager* BrachyAnalysisManager::instance = 0;
@@ -41,8 +41,8 @@ BrachyAnalysisManager::BrachyAnalysisManager()
{
#ifdef ANALYSIS_USE
theTFile = 0;
histo2 =0;
histo = 0;
ntuple = 0;
#endif
}
@@ -50,16 +50,15 @@ BrachyAnalysisManager::~BrachyAnalysisManager()
{
#ifdef G4ANALYSIS_USE
delete theTFile; theTFile = 0;
delete histo2; histo2 = 0;
delete histo; histo = 0;
delete ntuple; ntuple = 0;
#endif
}
BrachyAnalysisManager* BrachyAnalysisManager::GetInstance()
{
if (instance == 0) instance = new BrachyAnalysisManager;
return instance;
if (instance == 0) instance = new BrachyAnalysisManager;
return instance;
}
void BrachyAnalysisManager::book()
@@ -69,17 +68,17 @@ void BrachyAnalysisManager::book()
theTFile = new TFile("brachytherapy.root", "RECREATE");
histo = new TH1F("h10","energy spectrum", 800, 0., 800);
ntuple = new TNtuple("ntuple","edep3D","xx:yy:zz:edep");
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::FillNtupleWithEnergyDeposition(G4double xx,
void BrachyAnalysisManager::FillH2WithEnergyDeposition(G4double xx,
G4double yy,
G4double zz,
G4double energyDep)
{
ntuple -> Fill(xx, yy, zz, energyDep);
histo2 -> Fill(xx, yy,energyDep);
}
void BrachyAnalysisManager::FillPrimaryParticleHistogram(G4double primaryParticleEnergy)
@@ -27,8 +27,8 @@
// GEANT 4 - Brachytherapy example
// --------------------------------------------------------------
//
// Code developed by:
// S. Agostinelli, F. Foppiano, S. Garelli , M. Tropeano, S.Guatelli
// Code developed by:S. Guatelli, D. Cutajar
// Past developers: S. Agostinelli, F. Foppiano, S. Garelli , M. Tropeano
//
//
// ****************************************
@@ -54,8 +54,9 @@
#include "G4VisAttributes.hh"
#include "BrachyMaterial.hh"
#include "BrachyFactoryLeipzig.hh"
#include "BrachyFactoryIr.hh"
#include "BrachyFactoryTG186.hh"
#include "BrachyFactoryI.hh"
#include "BrachyFactoryFlexi.hh"
#include "BrachyDetectorMessenger.hh"
#include "BrachyDetectorConstruction.hh"
@@ -79,8 +80,8 @@ BrachyDetectorConstruction::BrachyDetectorConstruction():
// It is possible to modify geometrical parameters through UI
detectorMessenger = new BrachyDetectorMessenger(this);
// Define the Iridium source as default source modelled in the geometry
factory = new BrachyFactoryIr();
// Define the Flexi source as default source modelled in the geometry
factory = new BrachyFactoryFlexi();
// BrachyMaterial defined the all the materials necessary
// for the experimental set-up
@@ -123,10 +124,13 @@ void BrachyDetectorConstruction::SwitchBrachytherapicSeed()
factory = new BrachyFactoryLeipzig();
break;
case 3:
factory = new BrachyFactoryIr();
factory = new BrachyFactoryTG186();
break;
case 4:
factory = new BrachyFactoryFlexi();
break;
default:
factory = new BrachyFactoryIr();
factory = new BrachyFactoryFlexi();
break;
}
@@ -140,14 +144,17 @@ void BrachyDetectorConstruction::SwitchBrachytherapicSeed()
void BrachyDetectorConstruction::SelectBrachytherapicSeed(G4String val)
{
if (val == "Iodium") detectorChoice = 1;
if (val == "Iodine") detectorChoice = 1;
else{
if(val=="Leipzig") detectorChoice = 2;
else{
if(val=="Iridium") detectorChoice = 3;
else G4cout << val << "is not available!!!!" <<G4endl;
if(val=="TG186") detectorChoice = 3;
else{
if(val=="Flexi") detectorChoice = 4;
else G4cout << val << "is not available!!!!" <<G4endl;
}
}
}
G4cout << "Now the source is " << val << G4endl;
}
@@ -178,7 +185,7 @@ void BrachyDetectorConstruction::ConstructPhantom()
PhantomLog, // Associated logical volume
WorldPhys, // Mother volume
false,0);
WorldLog -> SetVisAttributes (G4VisAttributes::Invisible);
WorldLog -> SetVisAttributes (G4VisAttributes::GetInvisible());
// Visualization attributes of the phantom
G4VisAttributes* simpleBoxVisAtt = new G4VisAttributes(lblue);
@@ -0,0 +1,229 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// --------------------------------------------------------------
// GEANT 4 - Brachytherapy example
// --------------------------------------------------------------
//
// Code developed by:
// S. Guatelli, D. Cutajar, J. Poder
// Centre For Medical Radiation Physics, University of Wollongong
//
// ****************************************
// * *
// * BrachyDetectorConstructionFlexi.cc*
// * *
// ****************************************
//
//
#include "globals.hh"
#include "G4SystemOfUnits.hh"
#include "BrachyDetectorConstructionFlexi.hh"
#include "G4RunManager.hh"
#include "G4Tubs.hh"
#include "G4Cons.hh"
#include "G4LogicalVolume.hh"
#include "G4ThreeVector.hh"
#include "G4PVPlacement.hh"
#include "G4Transform3D.hh"
#include "G4RotationMatrix.hh"
#include "G4TransportationManager.hh"
#include "BrachyMaterial.hh"
#include "G4VisAttributes.hh"
#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)
{
pMat = new BrachyMaterial();
}
BrachyDetectorConstructionFlexi::~BrachyDetectorConstructionFlexi()
{
delete pMat;
}
void BrachyDetectorConstructionFlexi::ConstructFlexi(G4VPhysicalVolume* mother)
{
G4Material* steelMat = pMat -> GetMat("Stainless steel 304");
G4Material* iridiumMat = pMat -> GetMat("Iridium");
G4Material* airMat = pMat -> 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);
//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);
//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 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);
//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 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);
//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);
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);
// 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);
// Visualisations
//Shell/cable attributes
steelAttributes = new G4VisAttributes(G4Colour(1.0, 0.0, 0.0)); // red
steelAttributes -> SetVisibility(true);
steelAttributes -> 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);
G4Colour magenta (1.0, 0.0, 1.0) ;
simpleIridiumVisAtt = new G4VisAttributes(magenta);
simpleIridiumVisAtt -> SetVisibility(true);
simpleIridiumVisAtt -> SetForceWireframe(true);
logical_iridium_core -> SetVisAttributes(simpleIridiumVisAtt);
}
void BrachyDetectorConstructionFlexi::CleanFlexi()
{
delete simpleIridiumVisAtt;
simpleIridiumVisAtt = 0;
delete endAttributes;
endAttributes = 0;
delete steelAttributes;
steelAttributes = 0;
delete physical_iridium_core;
physical_iridium_core = 0 ;
delete logical_iridium_core;
logical_iridium_core = 0;
delete iridium_core;
iridium_core = 0;
delete physical_cable;
physical_cable = 0;
delete logical_cable;
logical_cable = 0;
delete cable;
cable = 0;
delete physical_End2_steel_shell;
physical_End2_steel_shell = 0;
delete logical_End2_steel_shell;
logical_End2_steel_shell = 0;
delete End2_steel_shell;
End2_steel_shell = 0;
delete physical_End1_steel_shell;
physical_End1_steel_shell = 0;
delete logical_End1_steel_shell;
logical_End1_steel_shell = 0;
delete End1_steel_shell;
End1_steel_shell = 0;
delete physical_air_gap;
physical_air_gap = 0;
delete logical_air_gap;
logical_air_gap = 0;
delete air_gap;
air_gap = 0;
delete physical_steel_shell;
physical_steel_shell = 0;
delete logical_steel_shell;
logical_steel_shell = 0;
delete steel_shell;
steel_shell = 0;
G4RunManager::GetRunManager() -> GeometryHasBeenModified();
}
@@ -36,7 +36,7 @@
// * *
// ****************************************
//
// $Id: BrachyDetectorConstructionI.cc 69765 2013-05-14 10:11:22Z gcosmo $
// $Id: BrachyDetectorConstructionI.cc 100821 2016-11-02 15:21:34Z gcosmo $
//
#include "globals.hh"
#include "G4SystemOfUnits.hh"
@@ -78,7 +78,7 @@ void BrachyDetectorConstructionI::ConstructIodium(G4VPhysicalVolume* mother)
//Get materials for source construction ...
G4Material* titanium = pMaterial -> GetMat("titanium");
G4Material* air = pMaterial -> GetMat("Air");
G4Material* iodium = pMaterial -> GetMat("Iodium");
G4Material* iodium = pMaterial -> GetMat("Iodine");
G4Colour red (1.0, 0.0, 0.0) ;
G4Colour magenta (1.0, 0.0, 1.0) ;
@@ -0,0 +1,223 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// --------------------------------------------------------------
// GEANT 4 - Brachytherapy example
// --------------------------------------------------------------
//
// Code developed by:
// D. Cutajar
//
// ****************************************
// * *
// * BrachyDetectorConstructionTG186.cc *
// * *
// ****************************************
//
// $Id: BrachyDetectorConstructionTG186.cc 69765 2013-05-14 10:11:22Z gcosmo $
//
#include "globals.hh"
#include "G4SystemOfUnits.hh"
#include "BrachyDetectorConstructionTG186.hh"
#include "G4Sphere.hh"
#include "G4RunManager.hh"
#include "G4Box.hh"
#include "G4Tubs.hh"
#include "G4LogicalVolume.hh"
#include "G4ThreeVector.hh"
#include "G4PVPlacement.hh"
#include "G4Transform3D.hh"
#include "G4RotationMatrix.hh"
#include "G4TransportationManager.hh"
#include "BrachyMaterial.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
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)
{
pMat = new BrachyMaterial();
}
BrachyDetectorConstructionTG186::~BrachyDetectorConstructionTG186()
{
delete pMat;
}
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");
// 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,
G4ThreeVector(0,0,-0.4*mm),
"TG186-IridiumCapsulePhys",
TG186capsuleLog,
mother,
false,
0, true);
// Capsule tip
TG186capsuleTip = new G4Sphere("Tg186-CapsuleTipIridium",
0.*mm,
0.5*mm,
0.*deg,
360.*deg,
0.*deg,
90.*deg);
TG186capsuleTipLog = new G4LogicalVolume(TG186capsuleTip,
capsuleMat,
"CapsuleTipIridumLog");
TG186capsuleTipPhys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,1.85*mm),
"TG186-CapsuleTipIridiumPhys",
TG186capsuleTipLog,
mother,
false,
0, true);
TG186cable = new G4Tubs("TG186-cable",
0.*mm,
0.5*mm,
1.0*mm,
0.*deg,
360.*deg);
TG186cableLog = new G4LogicalVolume(TG186cable,
capsuleMat,
"TG186-cableLog");
TG186cablePhys = new G4PVPlacement(0,
G4ThreeVector(0.,0.,-3.65*mm),
"TG186-CablePhys",
TG186cableLog,
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,
iridiumMat,
"TG186-IridiumCoreLog");
TG186iridiumCorePhys = new G4PVPlacement(0,
G4ThreeVector(0,0,0.4*mm),
"TG186-IridiumCorePhys",
TG186iridiumCoreLog,
TG186capsulePhys,
false,
0, true);
TG186simpleCapsuleVisAtt = new G4VisAttributes(red);
TG186simpleCapsuleVisAtt -> SetVisibility(true);
TG186simpleCapsuleVisAtt -> SetForceWireframe(true);
TG186capsuleLog -> SetVisAttributes(TG186simpleCapsuleVisAtt);
TG186simpleCapsuleTipVisAtt = new G4VisAttributes(red);
TG186simpleCapsuleTipVisAtt -> SetVisibility(true);
TG186simpleCapsuleTipVisAtt -> SetForceSolid(true);
TG186capsuleTipLog -> SetVisAttributes(TG186simpleCapsuleTipVisAtt);
TG186simpleIridiumVisAtt = new G4VisAttributes(magenta);
TG186simpleIridiumVisAtt -> SetVisibility(true);
TG186simpleIridiumVisAtt -> SetForceWireframe(true);
TG186iridiumCoreLog -> SetVisAttributes(TG186simpleIridiumVisAtt);
TG186simpleCableVisAtt = new G4VisAttributes(red);
TG186simpleCableVisAtt -> SetVisibility(true);
TG186simpleCableVisAtt -> SetForceSolid(true);
TG186cableLog -> SetVisAttributes(TG186simpleCableVisAtt);
}
void BrachyDetectorConstructionTG186::CleanTG186()
{
delete TG186simpleIridiumVisAtt;
TG186simpleIridiumVisAtt = 0;
delete TG186iridiumCorePhys;
TG186iridiumCorePhys = 0;
delete TG186iridiumCore;
TG186iridiumCore = 0;
delete TG186iridiumCoreLog;
TG186iridiumCoreLog = 0 ;
delete TG186simpleCapsuleTipVisAtt;
TG186simpleCapsuleTipVisAtt = 0;
delete TG186capsuleTipPhys;
TG186capsuleTipPhys = 0;
delete TG186capsuleTip;
TG186capsuleTip = 0;
delete TG186capsuleTipLog;
TG186capsuleTipLog = 0;
delete TG186simpleCapsuleVisAtt;
TG186simpleCapsuleVisAtt = 0;
delete TG186capsulePhys;
TG186capsulePhys = 0;
delete TG186capsule;
TG186capsule = 0;
delete TG186capsuleLog;
TG186capsuleLog = 0;
delete TG186cable;
TG186cable = 0;
delete TG186cableLog;
TG186cableLog = 0;
delete TG186cablePhys;
TG186cablePhys = 0;
delete TG186simpleCableVisAtt;
TG186simpleCableVisAtt = 0;
G4RunManager::GetRunManager() -> GeometryHasBeenModified();
}
@@ -34,7 +34,7 @@
// *********************************
//
//
// $Id: BrachyDetectorMessenger.cc 69765 2013-05-14 10:11:22Z gcosmo $
// $Id: BrachyDetectorMessenger.cc 100821 2016-11-02 15:21:34Z gcosmo $
//
//
@@ -58,7 +58,7 @@ BrachyDetectorMessenger::BrachyDetectorMessenger( BrachyDetectorConstruction* De
sourceCmd -> SetGuidance("Assign the selected geometry to G4RunManager.");
sourceCmd -> SetParameterName("choice",true);
sourceCmd -> SetDefaultValue(" ");
sourceCmd -> SetCandidates("Iridium Iodium Leipzig ");
sourceCmd -> SetCandidates("TG186 Flexi Iodine Leipzig");
sourceCmd -> AvailableForStates(G4State_PreInit,G4State_Idle);
}
@@ -78,7 +78,7 @@ void BrachyDetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue
// Switch the source in the phantom
if( command == sourceCmd )
{
if(newValue=="Iodium" || newValue=="Iridium"|| newValue=="Leipzig")
if(newValue=="Iodine" || newValue=="TG186"|| newValue=="Leipzig" || newValue== "Flexi")
{
detector -> SelectBrachytherapicSeed(newValue);
detector -> SwitchBrachytherapicSeed();
@@ -0,0 +1,68 @@
//
// ********************************************************************
// * 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, D. Cutajar, J. Poder,
//Centre For Medical Radiation Physics, University of Wollongong
//
// *******************************
// * *
// * BrachyFactoryFlexi *
// * *
// *******************************
//
//
#include "globals.hh"
#include "BrachyFactoryFlexi.hh"
#include "G4ParticleTable.hh"
#include "Randomize.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4IonTable.hh"
#include "G4UImanager.hh"
#include "G4RunManager.hh"
#include "BrachyDetectorMessenger.hh"
#include "BrachyDetectorConstructionFlexi.hh"
BrachyFactoryFlexi:: BrachyFactoryFlexi()
{
flexiSource = new BrachyDetectorConstructionFlexi();
}
BrachyFactoryFlexi:: ~BrachyFactoryFlexi()
{
delete flexiSource;
}
void BrachyFactoryFlexi::CreateSource(G4VPhysicalVolume* mother)
{
flexiSource -> ConstructFlexi(mother);
}
void BrachyFactoryFlexi::CleanSource()
{
flexiSource -> CleanFlexi();
flexiSource = 0;
}
@@ -0,0 +1,68 @@
//
// ********************************************************************
// * 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 & D. Cutajar
//
// *******************************
// * *
// * BrachyFactoryIr *
// * *
// *******************************
//
// $Id: BrachyFactoryIr.cc 69765 2013-05-14 10:11:22Z gcosmo $
//
#include "globals.hh"
#include "BrachyFactoryTG186.hh"
#include "G4ParticleTable.hh"
#include "Randomize.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4IonTable.hh"
#include "G4UImanager.hh"
#include "G4RunManager.hh"
#include "BrachyDetectorMessenger.hh"
#include "BrachyDetectorConstructionTG186.hh"
BrachyFactoryTG186:: BrachyFactoryTG186()
{
TG186iridiumSource = new BrachyDetectorConstructionTG186();
}
BrachyFactoryTG186:: ~BrachyFactoryTG186()
{
delete TG186iridiumSource;
}
void BrachyFactoryTG186::CreateSource(G4VPhysicalVolume* mother)
{
TG186iridiumSource -> ConstructTG186(mother);
}
void BrachyFactoryTG186::CleanSource()
{
TG186iridiumSource -> CleanTG186();
TG186iridiumSource = 0;
}
@@ -32,7 +32,7 @@
// * *
// *******************************
//
// $Id: BrachyMaterial.cc 69765 2013-05-14 10:11:22Z gcosmo $
// $Id: BrachyMaterial.cc 100821 2016-11-02 15:21:34Z gcosmo $
//
#include "globals.hh"
#include "Randomize.hh"
@@ -183,16 +183,26 @@ void BrachyMaterial::DefineMaterials()
matsteel->AddElement(elCr, 0.19);
matsteel->AddElement(elNi, 0.10);
matsteel->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);
//gold(chimica degli elementi N.N Greenwood,A.Earnshaw)
//gold
A = 196.97*g/mole;
d = 19.32*g/cm3;
gold = new G4Material("gold",Z = 79.,A,d);
//IodiumCore(chimica degli elementi N.N Greenwood,A.Earnshaw)
//Iodine Core
A = 124.9*g/mole;
d = 4.862*g/cm3;
matI = new G4Material("Iodium",Z = 53.,A,d);
matI = new G4Material("Iodine",Z = 53.,A,d);
//ceramic(Medical Physics, May 2000)
d = 2.88*g/cm3;
@@ -55,16 +55,13 @@ BrachyPhysicsList::BrachyPhysicsList(): G4VModularPhysicsList()
SetVerboseLevel(1);
// EM physics: 3 alternatives
emPhysicsList = new G4EmLivermorePhysics();
emPhysicsList = new G4EmStandardPhysics_option4(1);
// or
//emPhysicsList = new G4EmStandardPhysics_option4(1);
// Alternatively you can substitute this physics list
// with the LowEnergy Livermore or LowEnergy Penelope:
// emPhysicsList = new G4EmLivermorePhysics();
// Low Energy based on Livermore Evaluated Data Libraries
//
// Penelope physics
//emPhysicsList = new G4EmPenelopePhysics();
// or
// emPhysicsList = new G4EmPenelopePhysics();
// Add Decay
decPhysicsList = new G4DecayPhysics();
@@ -99,7 +96,7 @@ void BrachyPhysicsList::SetCuts()
// Definition of threshold of production
// of secondary particles
// This is defined in range.
defaultCutValue = 0.1 * mm;
defaultCutValue = 0.05 * mm;
SetCutValue(defaultCutValue, "gamma");
SetCutValue(defaultCutValue, "e-");
SetCutValue(defaultCutValue, "e+");
@@ -29,7 +29,7 @@
// --------------------------------------------------------------
//
// Code developed by:
// S.Guatelli
// S.Guatelli and D. Cutajar
//
//
// *******************************
@@ -38,7 +38,7 @@
// * *
// *******************************
//
// $Id: BrachyRunAction.cc 69765 2013-05-14 10:11:22Z gcosmo $
// $Id: BrachyRunAction.cc 100821 2016-11-02 15:21:34Z gcosmo $
//
#include "BrachyRunAction.hh"
@@ -97,7 +97,7 @@ if(msMapItr == fSMap.end())
return;
}
std::map<G4int, G4double*> * score = msMapItr -> second-> GetMap();
std::map<G4int, G4StatDouble*> * score = msMapItr -> second-> GetMap();
ofile << "# primitive scorer name: " << msMapItr -> first << G4endl;
//
@@ -108,27 +108,31 @@ ofile << std::setprecision(16); // for double value with 8 bytes
for(int x = 0; x < fNMeshSegments[0]; x++) {
for(int y = 0; y < fNMeshSegments[1]; y++) {
for(int z = 0; z < fNMeshSegments[2]; z++){
G4int numberOfVoxel = fNMeshSegments[0];
G4int numberOfVoxel_x = fNMeshSegments[0];
G4int numberOfVoxel_y = fNMeshSegments[1];
G4int numberOfVoxel_z =fNMeshSegments[2];
// If the voxel width is changed in the macro file,
// the voxel width variable must be updated
G4double voxelWidth = 1. *mm;
G4double voxelWidth = 0.25 *mm;
//
G4double xx = ( - numberOfVoxel + 1+ 2*x )* voxelWidth/2;
G4double yy = ( - numberOfVoxel + 1+ 2*y )* voxelWidth/2;
G4double zz = ( - numberOfVoxel + 1+ 2*z )* voxelWidth/2;
G4double xx = ( - numberOfVoxel_x + 1+ 2*x )* voxelWidth/2;
G4double yy = ( - numberOfVoxel_y + 1+ 2*y )* voxelWidth/2;
G4double zz = ( - numberOfVoxel_z + 1+ 2*z )* voxelWidth/2;
G4int idx = GetIndex(x, y, z);
std::map<G4int, G4double*>::iterator value = score -> find(idx);
std::map<G4int, G4StatDouble*>::iterator value = score -> find(idx);
if (value != score -> end())
{
// Print in the ASCII output file the information
ofile << xx << " " << yy << " " << zz <<" "
<<*(value->second)/keV << G4endl;
<<(value->second->sum_wx())/keV << G4endl;
#ifdef ANALYSIS_USE
// Save the same information in the output analysis file
BrachyAnalysisManager* analysis = BrachyAnalysisManager::GetInstance();
analysis -> FillNtupleWithEnergyDeposition(xx, yy, zz, *(value->second)/keV);
if(zz> -0.125 *mm && zz < 0.125*mm) analysis -> FillH2WithEnergyDeposition(xx,yy, (value->second->sum_wx())/keV);
#endif
}}}}