Import Geant4 6.2.0 source tree
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: Brachy.cc
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - Brachytherapy example
|
||||
@@ -100,7 +100,7 @@ int main(int argc ,char ** argv)
|
||||
#ifdef G4ANALYSIS_USE
|
||||
G4cout << G4endl << G4endl << G4endl
|
||||
<< " User Environment " << G4endl
|
||||
<< " Using AIDA 3.0 analysis " << G4endl;
|
||||
<< " Using AIDA 3.2.1 analysis " << G4endl;
|
||||
# else
|
||||
G4cout << G4endl << G4endl << G4endl
|
||||
<< " User Environment " << G4endl
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
-------------------------------------------------------------------
|
||||
$Id: History,v 1.7 2004/03/11 15:38:41 guatelli Exp $
|
||||
$Id: History,v 1.8 2004/05/13 14:47:46 guatelli Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -8,7 +8,11 @@ $Id: History,v 1.7 2004/03/11 15:38:41 guatelli Exp $
|
||||
|
||||
Category History file
|
||||
---------------------
|
||||
11.3.2003 - Susanna Guatelli
|
||||
|
||||
13.5.2004 - Susanna Guatelli
|
||||
Migration to AIDA 3.2.1 and PI 1.2.1
|
||||
|
||||
11.3.2004 - Susanna Guatelli
|
||||
Add a histogram, maintenance of the code
|
||||
|
||||
12.11.2003 - John Allison
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
/source/switch Iodium
|
||||
/run/energy Iodium
|
||||
/run/initialize
|
||||
/run/beamOn 1000
|
||||
/run/beamOn 5000
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
/run/verbose 0
|
||||
/event/verbose 0
|
||||
/run/initialize
|
||||
/run/beamOn 1000
|
||||
/run/beamOn 5000
|
||||
|
||||
@@ -3,4 +3,4 @@
|
||||
/event/verbose 0
|
||||
/source/switch Leipzig
|
||||
/run/initialize
|
||||
/run/beamOn 1000
|
||||
/run/beamOn 5000
|
||||
|
||||
@@ -23,28 +23,23 @@ voxels (1.mm dimension) |
|
||||
-------------------------------------------------------------------------
|
||||
----> 2.SET-UP
|
||||
|
|
||||
-example enviroment with the compiler 3.2
|
||||
-example enviroment with the compiler 3.2.3
|
||||
-a standard Geant4 example GNUmakefile is provided |
|
||||
|
||||
setup with: |
|
||||
compiler = gcc-3.2
|
||||
compiler = gcc-3.2.3
|
||||
G4SYSTEM = linux-g++ |
|
||||
|
||||
The following environment variables need to be set: |
|
||||
|
||||
G4LEDATA: points to low energy data base - G4EMLOW2.2 |
|
||||
G4LEDATA: points to low energy data base - G4EMLOW2.3 |
|
||||
|
||||
setup for analysis with AIDA 3.0/Anaphe 5.0.5 for user with account |
|
||||
on lxplus:
|
||||
|
|
||||
setenv G4ANALYSIS_USE 1
|
||||
|
|
||||
source /afs/cern.ch/sw/lhcxx/share/LHCXX/5.0.5/scripts/setupAnaphe.csh
|
||||
setenv PATH ${PATH}:/afs/cern.ch/sw/lhcxx/share/LHCXX/5.0.5/scripts/ |
|
||||
setup for analysis: AIDA 3.2.1, PI 1.2.1 |
|
||||
|
||||
Please take a look to the Anaphe/Lizard web page |
|
||||
http://anaphe.web.cern.ch/anaphe
|
||||
for more info |
|
||||
Users can download the analysis tools from:
|
||||
|
|
||||
http://aida.freehep.org/
|
||||
http://www.cern.ch/PI |
|
||||
|
||||
------------------------------------------------------------------------
|
||||
----> 3.How to run the example. |
|
||||
@@ -108,4 +103,4 @@ a macro is provided ad example of visualisation: VisualisationMacro.mac|
|
||||
for comments, advices, doubts and questions: guatelli@ge.infn.it
|
||||
for more info http://www.ge.infn.it/geant4/examples/index.html
|
||||
|
||||
last modified: Susanna Guatelli 11/3/2004
|
||||
last modified: Susanna Guatelli 14/5/2004
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
// * *
|
||||
// *******************************
|
||||
//
|
||||
// $Id: BrachyAnalysisManager.cc,v 1.13 2004/03/11 15:38:42 guatelli Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
// $Id: BrachyAnalysisManager.cc,v 1.14 2004/05/13 14:47:46 guatelli Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
#ifdef G4ANALYSIS_USE
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
// * *
|
||||
// ****************************************
|
||||
//
|
||||
// $Id: BrachyDetectorConstruction.cc,v 1.24 2004/03/11 16:05:02 guatelli Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
// $Id: BrachyDetectorConstruction.cc,v 1.25 2004/05/13 14:47:46 guatelli Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
#include "BrachyPhantomROGeometry.hh"
|
||||
#include "BrachyPhantomSD.hh"
|
||||
@@ -101,7 +101,7 @@ BrachyDetectorConstruction::BrachyDetectorConstruction(G4String &SDName)
|
||||
|
||||
factory = new BrachyFactoryIr();
|
||||
|
||||
pMaterial= new BrachyMaterial();
|
||||
pMaterial = new BrachyMaterial();
|
||||
}
|
||||
|
||||
|
||||
@@ -115,9 +115,9 @@ BrachyDetectorConstruction::~BrachyDetectorConstruction()
|
||||
|
||||
G4VPhysicalVolume* BrachyDetectorConstruction::Construct()
|
||||
{
|
||||
pMaterial-> DefineMaterials();
|
||||
pMaterial -> DefineMaterials();
|
||||
ConstructPhantom();
|
||||
factory->CreateSource(PhantomPhys);
|
||||
factory -> CreateSource(PhantomPhys); //Build the source inside the phantom
|
||||
ConstructSensitiveDetector();
|
||||
|
||||
return WorldPhys;
|
||||
@@ -125,7 +125,8 @@ G4VPhysicalVolume* BrachyDetectorConstruction::Construct()
|
||||
|
||||
void BrachyDetectorConstruction::SwitchBrachytherapicSeed()
|
||||
{
|
||||
factory->CleanSource();
|
||||
factory -> CleanSource();
|
||||
|
||||
delete factory;
|
||||
switch(detectorChoice)
|
||||
{
|
||||
@@ -142,11 +143,10 @@ void BrachyDetectorConstruction::SwitchBrachytherapicSeed()
|
||||
factory = new BrachyFactoryIr();
|
||||
break;
|
||||
}
|
||||
factory->CreateSource(PhantomPhys);
|
||||
factory -> CreateSource(PhantomPhys);
|
||||
|
||||
// Notify run manager that the new geometry has been built
|
||||
|
||||
G4RunManager::GetRunManager()->DefineWorldVolume( WorldPhys );
|
||||
G4RunManager::GetRunManager() -> DefineWorldVolume( WorldPhys );
|
||||
}
|
||||
|
||||
void BrachyDetectorConstruction::SelectBrachytherapicSeed(G4String val)
|
||||
@@ -176,28 +176,32 @@ void BrachyDetectorConstruction::ConstructPhantom()
|
||||
{
|
||||
G4Colour lblue (0.0, 0.0, .75);
|
||||
|
||||
G4Material* air=pMaterial->GetMat("Air") ;
|
||||
G4Material* water=pMaterial->GetMat("Water");
|
||||
G4Material* air = pMaterial -> GetMat("Air") ;
|
||||
G4Material* water = pMaterial -> GetMat("Water");
|
||||
|
||||
ComputeDimVoxel();
|
||||
|
||||
// World volume
|
||||
World = new G4Box("World",Worldx,Worldy,Worldz);
|
||||
WorldLog = new G4LogicalVolume(World,air,"WorldLog",0,0,0);
|
||||
WorldPhys = new G4PVPlacement(0,G4ThreeVector(),"WorldPhys",WorldLog,0,false,0);
|
||||
WorldPhys = new G4PVPlacement(0,G4ThreeVector(),
|
||||
"WorldPhys",WorldLog,0,false,0);
|
||||
|
||||
// Water Box
|
||||
Phantom = new G4Box("Phantom",phantomDimensionX,phantomDimensionY,phantomDimensionZ);
|
||||
Phantom = new G4Box("Phantom",phantomDimensionX,phantomDimensionY,
|
||||
phantomDimensionZ);
|
||||
PhantomLog = new G4LogicalVolume(Phantom,water,"PhantomLog",0,0,0);
|
||||
PhantomPhys = new G4PVPlacement(0,G4ThreeVector(),"PhantomPhys",PhantomLog,WorldPhys,false,0);
|
||||
PhantomPhys = new G4PVPlacement(0,G4ThreeVector(),
|
||||
"PhantomPhys",PhantomLog,
|
||||
WorldPhys,false,0);
|
||||
|
||||
WorldLog->SetVisAttributes (G4VisAttributes::Invisible);
|
||||
WorldLog -> SetVisAttributes (G4VisAttributes::Invisible);
|
||||
|
||||
G4VisAttributes* simpleBoxVisAtt= new G4VisAttributes(lblue);
|
||||
simpleBoxVisAtt->SetVisibility(true);
|
||||
simpleBoxVisAtt->SetForceWireframe(true);
|
||||
G4VisAttributes* simpleBoxVisAtt = new G4VisAttributes(lblue);
|
||||
simpleBoxVisAtt -> SetVisibility(true);
|
||||
simpleBoxVisAtt -> SetForceWireframe(true);
|
||||
|
||||
PhantomLog->SetVisAttributes(simpleBoxVisAtt);
|
||||
PhantomLog -> SetVisAttributes(simpleBoxVisAtt);
|
||||
}
|
||||
|
||||
void BrachyDetectorConstruction::ConstructSensitiveDetector()
|
||||
@@ -209,11 +213,13 @@ void BrachyDetectorConstruction::ConstructSensitiveDetector()
|
||||
{
|
||||
phantomSD = new BrachyPhantomSD(sensitiveDetectorName);
|
||||
G4String ROGeometryName = "PhantomROGeometry";
|
||||
phantomROGeometry = new BrachyPhantomROGeometry(ROGeometryName,phantomDimensionX,phantomDimensionZ,numberOfVoxelsAlongX,numberOfVoxelsAlongZ);
|
||||
phantomROGeometry->BuildROGeometry();
|
||||
phantomSD->SetROgeometry(phantomROGeometry);
|
||||
pSDManager->AddNewDetector(phantomSD);
|
||||
PhantomLog->SetSensitiveDetector(phantomSD);
|
||||
phantomROGeometry = new BrachyPhantomROGeometry(ROGeometryName,
|
||||
phantomDimensionX,phantomDimensionZ,
|
||||
numberOfVoxelsAlongX,numberOfVoxelsAlongZ);
|
||||
phantomROGeometry -> BuildROGeometry();
|
||||
phantomSD -> SetROgeometry(phantomROGeometry);
|
||||
pSDManager -> AddNewDetector(phantomSD);
|
||||
PhantomLog -> SetSensitiveDetector(phantomSD);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,7 +254,7 @@ void BrachyDetectorConstruction::SetPhantomMaterial(G4String materialChoice)
|
||||
if (pttoMaterial)
|
||||
{
|
||||
phantomAbsorberMaterial = pttoMaterial;
|
||||
PhantomLog->SetMaterial(pttoMaterial);
|
||||
PhantomLog -> SetMaterial(pttoMaterial);
|
||||
PrintDetectorParameters();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
// * *
|
||||
// ************************************
|
||||
//
|
||||
// $Id: BrachyPhantomROGeometry.cc,v 1.8 2004/03/11 15:38:43 guatelli Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
// $Id: BrachyPhantomROGeometry.cc,v 1.9 2004/05/13 14:47:46 guatelli Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
#include "BrachyPhantomROGeometry.hh"
|
||||
#include "BrachyDummySD.hh"
|
||||
@@ -177,7 +177,7 @@ G4VPhysicalVolume* BrachyPhantomROGeometry::Build()
|
||||
numberOfVoxelsAlongZ,
|
||||
voxelXThickness);
|
||||
BrachyDummySD *dummySD = new BrachyDummySD;
|
||||
ROPhantomYDivisionLog->SetSensitiveDetector(dummySD);
|
||||
ROPhantomYDivisionLog -> SetSensitiveDetector(dummySD);
|
||||
|
||||
return ROWorldPhys;
|
||||
}
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
// * *
|
||||
// ********************************
|
||||
//
|
||||
// $Id: BrachyPhantomSD.cc,v 1.7 2004/03/11 16:05:03 guatelli Exp $
|
||||
// GEANT4 tag $Name: geant4-06-01 $
|
||||
// $Id: BrachyPhantomSD.cc,v 1.8 2004/05/13 14:47:46 guatelli Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
#include "BrachyPhantomSD.hh"
|
||||
#include "BrachyPhantomHit.hh"
|
||||
@@ -72,34 +72,32 @@ G4bool BrachyPhantomSD::ProcessHits(G4Step* aStep, G4TouchableHistory* ROhist)
|
||||
G4double energyDeposit = aStep->GetTotalEnergyDeposit();
|
||||
if(energyDeposit == 0.)
|
||||
return false;
|
||||
|
||||
// Read Voxel indexes: i is the x index, k is the z index
|
||||
G4int k = ROhist->GetReplicaNumber(1);
|
||||
G4int i = ROhist->GetReplicaNumber(2);
|
||||
G4int j = ROhist->GetReplicaNumber();
|
||||
|
||||
G4int numberOfVoxelZ = 300;
|
||||
G4double voxelWidthZ = 1. *mm;
|
||||
|
||||
G4double x = (-numberOfVoxelZ+1+2*i)*voxelWidthZ/2;
|
||||
G4double y = (- numberOfVoxelZ+1+2*j)*voxelWidthZ/2;
|
||||
G4double z = (- numberOfVoxelZ+1+2*k)*voxelWidthZ/2;
|
||||
|
||||
|
||||
if(energyDeposit != 0)
|
||||
if(energyDeposit != 0)
|
||||
{
|
||||
|
||||
#ifdef G4ANALYSIS_USE
|
||||
BrachyAnalysisManager* analysis =
|
||||
BrachyAnalysisManager::getInstance();
|
||||
analysis -> FillNtupleWithEnergy(x,y,z,energyDeposit);
|
||||
if (y<0.8*mm && y> -0.8*mm)
|
||||
{
|
||||
analysis -> FillHistogramWithEnergy(x,z,energyDeposit/MeV);
|
||||
// Read Voxel indexes: i is the x index, k is the z index
|
||||
G4int k = ROhist->GetReplicaNumber(1);
|
||||
G4int i = ROhist->GetReplicaNumber(2);
|
||||
G4int j = ROhist->GetReplicaNumber();
|
||||
|
||||
G4int numberOfVoxelZ = 300;
|
||||
G4double voxelWidthZ = 1. *mm;
|
||||
G4double x = (-numberOfVoxelZ+1+2*i)*voxelWidthZ/2;
|
||||
G4double y = (- numberOfVoxelZ+1+2*j)*voxelWidthZ/2;
|
||||
G4double z = (- numberOfVoxelZ+1+2*k)*voxelWidthZ/2;
|
||||
|
||||
BrachyAnalysisManager* analysis =
|
||||
BrachyAnalysisManager::getInstance();
|
||||
analysis -> FillNtupleWithEnergy(x,y,z,energyDeposit);
|
||||
if (y<0.8*mm && y> -0.8*mm)
|
||||
{
|
||||
analysis -> FillHistogramWithEnergy(x,z,energyDeposit/MeV);
|
||||
|
||||
if (z<0.8*mm && z> -0.8*mm)
|
||||
analysis -> DoseDistribution(x,energyDeposit/MeV);
|
||||
}
|
||||
if (z<0.8*mm && z> -0.8*mm)
|
||||
analysis -> DoseDistribution(x,energyDeposit/MeV);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user