Import Geant4 6.2.0 source tree
This commit is contained in:
@@ -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