Import Geant4 4.0.0 source tree
This commit is contained in:
@@ -19,10 +19,7 @@
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: Brachy.cc,v 1.4.4.1 2001/06/28 19:06:34 gunter Exp $
|
||||
// GEANT4 tag $Name: $
|
||||
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 - Brachytherapy example
|
||||
@@ -37,12 +34,13 @@
|
||||
//
|
||||
// Simplified gamma generation is used.
|
||||
// Source axis is oriented along Z axis.
|
||||
// Voxel data on the X-Z plane is output to ASCII file
|
||||
// Voxel data on the X-Z plan
|
||||
//e is output to ASCII file
|
||||
// "Brachy.out".
|
||||
//
|
||||
// For information related to this code contact the developers.
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
//
|
||||
// $Id: Brachy.cc,v 1.8 2001/12/13 13:44:53 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
|
||||
#include "BrachyEventAction.hh"
|
||||
#include "BrachyDetectorConstruction.hh"
|
||||
@@ -50,6 +48,7 @@
|
||||
#include "BrachyPrimaryGeneratorAction.hh"
|
||||
#include "BrachyWaterBoxSD.hh"
|
||||
|
||||
|
||||
#include "Randomize.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4SDManager.hh"
|
||||
@@ -58,7 +57,7 @@
|
||||
int main()
|
||||
{
|
||||
// Number of generated photons
|
||||
G4int NumberOfEvents = 10;
|
||||
G4int NumberOfEvents = 1000;
|
||||
|
||||
// Define number of voxels in X-Z plane
|
||||
G4int NumVoxelX = 101;
|
||||
@@ -103,8 +102,15 @@ int main()
|
||||
// Format = x coord [mm] <tab> z coord [mm] <tab> edep [MeV] <eol>
|
||||
ofs.open("Brachy.out");
|
||||
{
|
||||
G4double VoxelWidth_X = pDetectorConstruction->m_BoxDimX/NumVoxelX;
|
||||
G4double VoxelWidth_Z = pDetectorConstruction->m_BoxDimZ/NumVoxelZ;
|
||||
|
||||
ofs<<" x(mm)"<<'\t'<<"z(mm)"<<'\t'<<"released energy(Mev)"
|
||||
<<G4endl;
|
||||
|
||||
|
||||
|
||||
G4double VoxelWidth_X = pDetectorConstruction->GetBoxDim_X()/NumVoxelX;
|
||||
G4double VoxelWidth_Z = pDetectorConstruction->GetBoxDim_Z()/NumVoxelZ;
|
||||
|
||||
G4double x,z;
|
||||
|
||||
for(G4int k=0;k<NumVoxelZ;k++)
|
||||
@@ -118,8 +124,12 @@ int main()
|
||||
|
||||
// Do not consider near voxels
|
||||
if(fabs(x) > 3*mm || fabs(z) > 6*mm)
|
||||
ofs << x << '\t' << z << '\t' << pVoxel[j] << G4endl;
|
||||
}
|
||||
{ ofs << x << '\t' << z << '\t' << pVoxel[j] << G4endl;
|
||||
//check released energy
|
||||
// if(pVoxel[j]!=0)
|
||||
// G4cout<<x<<'\t'<<z<< '\t'<<pVoxel[j]<<G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
ofs.close();
|
||||
}
|
||||
@@ -132,3 +142,13 @@ int main()
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -42,17 +42,20 @@ class BrachyDetectorConstruction : public G4VUserDetectorConstruction
|
||||
~BrachyDetectorConstruction();
|
||||
|
||||
public:
|
||||
const G4double m_BoxDimX;
|
||||
const G4double m_BoxDimY;
|
||||
const G4double m_BoxDimZ;
|
||||
|
||||
const G4int m_NumVoxelX;
|
||||
const G4int m_NumVoxelZ;
|
||||
|
||||
G4String m_SDName;
|
||||
|
||||
G4double GetBoxDim_X() {return m_BoxDimX;};
|
||||
G4double GetBoxDim_Z() {return m_BoxDimZ;};
|
||||
|
||||
public:
|
||||
G4VPhysicalVolume* Construct();
|
||||
};
|
||||
|
||||
private:
|
||||
const G4int m_NumVoxelX;
|
||||
const G4int m_NumVoxelZ;
|
||||
G4double m_BoxDimX;
|
||||
G4double m_BoxDimY;
|
||||
G4double m_BoxDimZ;
|
||||
G4String m_SDName;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -42,13 +42,17 @@ class BrachyEventAction : public G4UserEventAction
|
||||
void BeginOfEventAction(const G4Event*);
|
||||
void EndOfEventAction(const G4Event*);
|
||||
|
||||
public:
|
||||
|
||||
|
||||
private:
|
||||
|
||||
const G4int m_NumVoxelX;
|
||||
const G4int m_NumVoxelZ;
|
||||
G4float *m_pVoxel;
|
||||
|
||||
private:
|
||||
G4int m_HitsCollectionID;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
|
||||
#ifndef BrachyWaterBoxROGeometry_h
|
||||
#define BrachyWaterBoxROGeometry_h 1
|
||||
#define BrachyWaterBoxROGeometry_h
|
||||
|
||||
#include "G4VReadOutGeometry.hh"
|
||||
|
||||
@@ -38,7 +38,7 @@ class BrachyWaterBoxROGeometry : public G4VReadOutGeometry
|
||||
BrachyWaterBoxROGeometry(G4String aString,G4double DetDimX,G4double DetDimZ,G4int NumVoxelX,G4int NumVoxelZ);
|
||||
~BrachyWaterBoxROGeometry();
|
||||
|
||||
public:
|
||||
private:
|
||||
const G4double m_DetDimX;
|
||||
const G4double m_DetDimZ;
|
||||
const G4int m_NumVoxelX;
|
||||
|
||||
@@ -89,3 +89,15 @@ void BrachyEventAction::EndOfEventAction(const G4Event* evt)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user