Import Geant4 8.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:55:03 +02:00
parent 216a75eeb1
commit fe73f43734
6714 changed files with 118229 additions and 68144 deletions
@@ -24,27 +24,21 @@
// ********************************************************************
//
//
// $Id: RE02DetectorConstruction.cc,v 1.2 2006/06/29 17:45:10 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: RE02DetectorConstruction.cc,v 1.3 2006/11/18 01:37:23 asaim Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
#include "RE02DetectorConstruction.hh"
#include "G4MultiFunctionalDetector.hh"
#include "G4PSEnergyDeposit.hh"
//#include "G4PSDoseDeposit.hh"
#include "G4PSNofStep.hh"
//#include "G4PSNofSecondary.hh"
//#include "G4PSMinKinEAtGeneration.hh"
#include "G4PSCellFlux.hh"
//#include "G4PSTrackLength.hh"
//#include "G4PSPassageTrackLength.hh"
//#include "G4PSPassageCurrent.hh"
#include "G4PSPassageCellFlux.hh"
#include "G4PSFlatSurfaceFlux.hh"
#include "G4PSFlatSurfaceCurrent.hh"
//#include "G4PSSphereSurfaceCurrent.hh"
#include "RE02PSEnergyDeposit.hh"
#include "RE02PSNofStep.hh"
#include "RE02PSCellFlux.hh"
#include "RE02PSPassageCellFlux.hh"
#include "RE02PSFlatSurfaceFlux.hh"
#include "RE02PSFlatSurfaceCurrent.hh"
#include "G4SDParticleWithEnergyFilter.hh"
#include "G4SDParticleFilter.hh"
#include "G4SDChargedFilter.hh"
@@ -57,7 +51,7 @@
#include "G4SDManager.hh"
#include "G4PVParameterised.hh"
#include "RE02PhantomParameterisation.hh"
#include "RE02NestedPhantomParameterisation.hh"
#include "G4VisAttributes.hh"
#include "G4Colour.hh"
@@ -74,12 +68,16 @@
// [Geometry]
// The world volume is defined as 200 cm x 200 cm x 200 cm box with Air.
// Water phantom is defined as 200 mm x 200 mm x 400 mm box with Water.
// The water phantom is divided into 100 segments in x,y plane, and 200 segments
// perpendicular to z axis using parameterised volume.
// These values are defined at constructor,
// e.g. the size of water phantom (fphantomSize), and number of segmentation
// The water phantom is divided into 100 segments in x,y plane using replication,
// and then divided into 200 segments perpendicular to z axis using nested
// parameterised volume.
// These values are defined at constructor,
// e.g. the size of water phantom (fphantomSize), and number of segmentation
// of water phantom (fNx, fNy, fNz).
// NIST database is used for materials.
//
// By default, lead plates are inserted into the position of even order segments.
// NIST database is used for materials.
//
//
// [Scorer]
// Assignment of G4MultiFunctionalDetector and G4PrimitiveScorer
@@ -104,16 +102,11 @@
//
RE02DetectorConstruction::RE02DetectorConstruction()
{
// Default size of water phantom,and segmentation.
fphantomSize.setX(200.*mm);
fphantomSize.setY(200.*mm);
fphantomSize.setZ(400.*mm);
//fNx = fNy = fNz = 100;
fNx = 100; fNy = 100; fNz = 200;
//fNx = 1; fNy = 1; fNz = 200;
G4cout << "<-- RE02DetectorConstruction -----------------" <<G4endl;
G4cout << " Water Phantom Size " << fphantomSize/mm << G4endl;
G4cout << " Segmentation ("<< fNx<<","<<fNy<<","<<fNz<<")"<<G4endl;
G4cout << "<---------------------------------------------"<<G4endl;
fNx = fNy = fNz = 100;
}
//
@@ -131,8 +124,9 @@ RE02DetectorConstruction::~RE02DetectorConstruction()
// Material Information imported from NIST database.
//
G4NistManager* NISTman = G4NistManager::Instance();
G4Material* Air = NISTman->FindOrBuildMaterial("G4_AIR");
G4Material* H2O = NISTman->FindOrBuildMaterial("G4_WATER");
G4Material* Air = NISTman->FindOrBuildMaterial("G4_AIR");
G4Material* H2O = NISTman->FindOrBuildMaterial("G4_WATER");
G4Material* LEAD = NISTman->FindOrBuildMaterial("G4_Pb");
//
// Print all the materials defined.
@@ -199,13 +193,17 @@ RE02DetectorConstruction::~RE02DetectorConstruction()
// Phantom segmentation using Parameterisation
//..............................................
//
G4cout << "<-- RE02DetectorConstruction::Construct-------" <<G4endl;
G4cout << " Water Phantom Size " << fphantomSize/mm << G4endl;
G4cout << " Segmentation ("<< fNx<<","<<fNy<<","<<fNz<<")"<<G4endl;
G4cout << " Lead plate at even copy # (0-False,1-True): " << IsLeadSegment() <<G4endl;
G4cout << "<---------------------------------------------"<<G4endl;
// Number of segmentation.
// - Default number of segmentation is defined at constructor.
G4int nxCells = fNx;
G4int nyCells = fNy;
G4int nzCells = fNz;
G4int nCells = nxCells*nyCells*nzCells;
G4ThreeVector sensSize;
sensSize.setX(phantomSize.x()/(G4double)nxCells);
sensSize.setY(phantomSize.y()/(G4double)nyCells);
@@ -213,28 +211,51 @@ RE02DetectorConstruction::~RE02DetectorConstruction()
// i.e Voxel size will be 2.0 x 2.0 x 2.0 mm3 cube by default.
//
// Replication of Water Phantom Volume.
// Y Slice
G4String yRepName("RepY");
G4VSolid* solYRep =
new G4Box(yRepName,phantomSize.x()/2.,sensSize.y()/2.,phantomSize.z()/2.);
G4LogicalVolume* logYRep =
new G4LogicalVolume(solYRep,H2O,yRepName);
//G4PVReplica* yReplica =
new G4PVReplica(yRepName,logYRep,logicPhantom,kYAxis,fNy,sensSize.y());
// X Slice
G4String xRepName("RepX");
G4VSolid* solXRep =
new G4Box(xRepName,sensSize.x()/2.,sensSize.y()/2.,phantomSize.z()/2.);
G4LogicalVolume* logXRep =
new G4LogicalVolume(solXRep,H2O,xRepName);
//G4PVReplica* xReplica =
new G4PVReplica(xRepName,logXRep,logYRep,kXAxis,fNx,sensSize.x());
//
//
//
//..................................
// Voxel solid and logical volumes
//..................................
// Z Slice
G4String zVoxName("phantomSens");
G4VSolid* solVoxel =
new G4Box(zVoxName,sensSize.x()/2.,sensSize.y()/2.,sensSize.z()/2.);
G4LogicalVolume* logicPhantomSens = new G4LogicalVolume(solVoxel,H2O,zVoxName);
//
G4Box * solidPhantomSens
= new G4Box("phantomSens",
sensSize.x()/2., sensSize.y()/2., sensSize.z()/2.);
G4LogicalVolume * logicPhantomSens
= new G4LogicalVolume(solidPhantomSens, H2O,"PhantomSens",0,0,0);
//
std::vector<G4Material*> phantomMat(2,H2O);
if ( IsLeadSegment() ) phantomMat[1]=LEAD;
//
// Parameterisation for transformation of voxels.
// (voxel size is fixed in this example. i.e parameterisation handles
// only transfomation of voxels.)
RE02PhantomParameterisation* paramPhantom
= new RE02PhantomParameterisation(phantomSize/2.,nxCells,nyCells,nzCells);
// (voxel size is fixed in this example.
// e.g. nested parameterisation handles material and transfomation of voxels.)
RE02NestedPhantomParameterisation* paramPhantom
= new RE02NestedPhantomParameterisation(sensSize/2.,nzCells,phantomMat);
//G4VPhysicalVolume * physiPhantomSens =
new G4PVParameterised("PhantomSens", // their name
logicPhantomSens, // their logical volume
logicPhantom, // Mother logical volume
kUndefined, // Are placed along this axis
nCells, // Number of cells
paramPhantom); // Parameterisation.
new G4PVParameterised("PhantomSens", // their name
logicPhantomSens, // their logical volume
logXRep, // Mother logical volume
kUndefined, // Are placed along this axis
nzCells, // Number of cells
paramPhantom); // Parameterisation.
// Optimization flag is avaiable for,
// kUndefined, kXAxis, kYAxis, kZAxis.
//
@@ -291,20 +312,23 @@ RE02DetectorConstruction::~RE02DetectorConstruction()
//-- Primitive Scorer for Energy Deposit.
// Total, by protons, by electrons.
G4String psName;
G4PSEnergyDeposit* scorer0 = new G4PSEnergyDeposit(psName="totalEDep");
G4PSEnergyDeposit* scorer1 = new G4PSEnergyDeposit(psName="protonEDep");
G4PSEnergyDeposit* scorer0 = new RE02PSEnergyDeposit(psName="totalEDep",fNx,fNy,fNz);
G4PSEnergyDeposit* scorer1 = new RE02PSEnergyDeposit(psName="protonEDep",fNx,fNy,fNz);
scorer1->SetFilter(protonFilter);
//
//-- Number of Steps for protons
G4PSNofStep* scorer2 = new G4PSNofStep(psName="protonNStep");
G4PSNofStep* scorer2 = new RE02PSNofStep(psName="protonNStep",fNx,fNy,fNz);
scorer2->SetFilter(protonFilter);
//
//-- CellFlux for charged particles
G4PSPassageCellFlux* scorer3 = new G4PSPassageCellFlux(psName="chargedPassCellFlux");
G4PSCellFlux* scorer4 = new G4PSCellFlux(psName="chargedCellFlux");
G4PSFlatSurfaceFlux* scorer5 = new G4PSFlatSurfaceFlux(psName="chargedSurfFlux",fFlux_InOut);
G4PSPassageCellFlux* scorer3 = new RE02PSPassageCellFlux(psName="chargedPassCellFlux",
fNx,fNy,fNz);
G4PSCellFlux* scorer4 = new RE02PSCellFlux(psName="chargedCellFlux",
fNx,fNy,fNz);
G4PSFlatSurfaceFlux* scorer5 = new RE02PSFlatSurfaceFlux(psName="chargedSurfFlux",
fFlux_InOut,fNx,fNy,fNz);
scorer3->SetFilter(chargedFilter);
scorer4->SetFilter(chargedFilter);
scorer5->SetFilter(chargedFilter);
@@ -346,7 +370,7 @@ RE02DetectorConstruction::~RE02DetectorConstruction()
pkinEFilter->show(); // Show accepting condition to stdout.
//-- Surface Current Scorer which scores number of tracks in unit area.
G4PSFlatSurfaceCurrent* scorer =
new G4PSFlatSurfaceCurrent(psgName,fCurrent_InOut);
new RE02PSFlatSurfaceCurrent(psgName,fCurrent_InOut,fNx,fNy,fNz);
scorer->SetFilter(pkinEFilter); // Assign filter.
MFDet->RegisterPrimitive(scorer); // Register it to MultiFunctionalDetector.
}
@@ -359,15 +383,20 @@ RE02DetectorConstruction::~RE02DetectorConstruction()
G4VisAttributes* BoxVisAtt= new G4VisAttributes(G4Colour(1.0,1.0,1.0));
logicWorld ->SetVisAttributes(BoxVisAtt);
//logicWorld->SetVisAttributes(G4VisAttributes::Invisible);
// Mother volume of WaterPhantom
G4VisAttributes* PhantomVisAtt = new G4VisAttributes(G4Colour(1.0,1.0,0.0));
logicPhantom->SetVisAttributes(PhantomVisAtt);
// Replica
G4VisAttributes* YRepVisAtt = new G4VisAttributes(G4Colour(0.0,1.0,0.0));
logYRep->SetVisAttributes(YRepVisAtt);
G4VisAttributes* XRepVisAtt = new G4VisAttributes(G4Colour(0.0,1.0,0.0));
logXRep->SetVisAttributes(YRepVisAtt);
// Skip the visualization for those voxels.
logicPhantomSens->SetVisAttributes(G4VisAttributes::Invisible);
// If number of segmentation of water phantom is too large,
// skip the visualization for those voxels.
if ( nCells > 1000 ) {
logicPhantomSens->SetVisAttributes(G4VisAttributes::Invisible);
}
return physiWorld;
}
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: RE02EventAction.cc,v 1.2 2006/06/29 17:45:14 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: RE02EventAction.cc,v 1.3 2006/11/18 01:37:24 asaim Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
#include "RE02EventAction.hh"
@@ -0,0 +1,129 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
///////////////////////////////////////////////////////////////////////////////
#include "RE02NestedPhantomParameterisation.hh"
#include "G4VPhysicalVolume.hh"
#include "G4VTouchable.hh"
#include "G4ThreeVector.hh"
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4Material.hh"
//=======================================================================
// (RE02NestedPhantomParameterisation)
//
// (Description)
// Class for nested parameterisation.
// This parameterisation handles material and transfomation of voxles.
//
// T.Aso Created. Nov.2007.
//
////////////////////////////////////////////////////////////////////
RE02NestedPhantomParameterisation::RE02NestedPhantomParameterisation(
const G4ThreeVector& voxelSize,
G4int nz,
std::vector<G4Material*>& mat):
G4VNestedParameterisation(),fdX(voxelSize.x()),fdY(voxelSize.y()),fdZ(voxelSize.z()),
fNz(nz),fmat(mat)
{
// Position of voxels.
// x and y positions are already defined in DetectorConstruction
// by using replicated volume. Here only we need to define is z positions of voxles.
fpZ.clear();
G4double zp;
for ( G4int iz = 0; iz < fNz; iz++){
zp = (-fNz+1+2*iz)*fdZ;
fpZ.push_back(zp);
}
}
RE02NestedPhantomParameterisation::~RE02NestedPhantomParameterisation(){
fpZ.clear();
}
//
// Material assignment to geometry.
//
G4Material* RE02NestedPhantomParameterisation::ComputeMaterial(G4VPhysicalVolume* currentVol,
const G4int copyNo,
const G4VTouchable* parentTouch)
{
// Copy number of voxels.
// Copy number of X and Y are obtained from replication number.
// Copy nymber of Z is the copy number of current voxel.
G4int ix = parentTouch->GetReplicaNumber(0);
G4int iy = parentTouch->GetReplicaNumber(1);
G4int iz = copyNo;
// For demonstration purpose,a couple of materials are chosen alternately.
G4Material* mat=0;
if ( ix < 0 && iy < 0 ) return NULL;
if ( ix%2 == 0 && iy%2 == 0 && iz%2 == 0 ) mat = fmat[0];
else mat = fmat[1];
// Set material to the current logical volume.
G4LogicalVolume* currentLog = currentVol->GetLogicalVolume();
currentLog->SetMaterial(mat);
return mat;
}
//
// Number of Materials
// Material scanner is required for preparing physics tables and so on before
// stating simulation, so that G4 has to know number of materials.
G4int RE02NestedPhantomParameterisation::GetNumberOfMaterials() const{
return fmat.size();
}
//
// GetMaterial
// This is needed for material scanner and realizing geometry.
//
G4Material* RE02NestedPhantomParameterisation::GetMaterial(G4int i) const{
return fmat[i];
}
//
// Transformation of voxels.
//
void RE02NestedPhantomParameterisation::ComputeTransformation(const G4int copyNo,
G4VPhysicalVolume* physVol)const{
G4ThreeVector position(0.,0.,fpZ[copyNo]);
physVol->SetTranslation(position);
}
//
// Dimensions are always same in this RE02 example.
//
void RE02NestedPhantomParameterisation::ComputeDimensions(G4Box& box,
const G4int ,
const G4VPhysicalVolume* ) const{
box.SetXHalfLength(fdX);
box.SetYHalfLength(fdY);
box.SetZHalfLength(fdZ);
}
@@ -0,0 +1,73 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: RE02PSCellFlux.cc,v 1.2 2006/12/13 15:43:05 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// RE02PSCellFlux
#include "RE02PSCellFlux.hh"
///////////////////////////////////////////////////////////////////////////////
//
// The developement and research on this code is supported by Core Research
// for Evolutional Science and Technology (CREST) Program of Japan Science
// and Technology Corporation (JST). You may acknowlege to JST and authers
// whenever you publish your results using this code, as well as the Geant4
// collaboration. Both JST and authers remain to have a right to refuse to use
// this code for any case.
// Tsukasa Aso ( aso@toyama-cmt.ac.jp )
// Akinori Kimura ( AKimura@ashitech.ac.jp )
//
///////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring cell charge.
// The Cell Charge is defined by a sum of charge inside the cell
// which calculates the deposited charge in the cell.
//
//
//
//
//
// Created: 2006-06-20 Tsukasa ASO, Akinori Kimura.
//
///////////////////////////////////////////////////////////////////////////////
RE02PSCellFlux::RE02PSCellFlux(G4String name,G4int nx, G4int ny, G4int nz)
:G4PSCellFlux(name),fNx(nx),fNy(ny),fNz(nz)
{;}
RE02PSCellFlux::~RE02PSCellFlux()
{;}
G4int RE02PSCellFlux::GetIndex(G4Step* aStep)
{
const G4VTouchable* touchable = aStep->GetPreStepPoint()->GetTouchable();
G4int ix = touchable->GetReplicaNumber(1);
G4int iy = touchable->GetReplicaNumber(2);
G4int iz = touchable->GetReplicaNumber(0);
return iy*fNx*fNy+ix*fNz+iz;
}
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: RE02PSEnergyDeposit.cc,v 1.2 2006/12/13 15:43:07 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// RE02PSEnergyDeposit
#include "RE02PSEnergyDeposit.hh"
///////////////////////////////////////////////////////////////////////////////
//
// The developement and research on this code is supported by Core Research
// for Evolutional Science and Technology (CREST) Program of Japan Science
// and Technology Corporation (JST). You may acknowlege to JST and authers
// whenever you publish your results using this code, as well as the Geant4
// collaboration. Both JST and authers remain to have a right to refuse to use
// this code for any case.
// Tsukasa Aso ( aso@toyama-cmt.ac.jp )
// Akinori Kimura ( AKimura@ashitech.ac.jp )
//
///////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring cell charge.
// The Cell Charge is defined by a sum of charge inside the cell
// which calculates the deposited charge in the cell.
//
//
//
//
//
// Created: 2006-06-20 Tsukasa ASO, Akinori Kimura.
//
///////////////////////////////////////////////////////////////////////////////
RE02PSEnergyDeposit::RE02PSEnergyDeposit(G4String name,G4int nx, G4int ny, G4int nz)
:G4PSEnergyDeposit(name),fNx(nx),fNy(ny),fNz(nz)
{;}
RE02PSEnergyDeposit::~RE02PSEnergyDeposit()
{;}
G4int RE02PSEnergyDeposit::GetIndex(G4Step* aStep)
{
const G4VTouchable* touchable = aStep->GetPreStepPoint()->GetTouchable();
G4int ix = touchable->GetReplicaNumber(1);
G4int iy = touchable->GetReplicaNumber(2);
G4int iz = touchable->GetReplicaNumber(0);
return iy*fNx*fNy+ix*fNz+iz;
}
@@ -0,0 +1,74 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: RE02PSFlatSurfaceCurrent.cc,v 1.2 2006/12/13 15:43:09 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// RE02PSFlatSurfaceCurrent
#include "RE02PSFlatSurfaceCurrent.hh"
///////////////////////////////////////////////////////////////////////////////
//
// The developement and research on this code is supported by Core Research
// for Evolutional Science and Technology (CREST) Program of Japan Science
// and Technology Corporation (JST). You may acknowlege to JST and authers
// whenever you publish your results using this code, as well as the Geant4
// collaboration. Both JST and authers remain to have a right to refuse to use
// this code for any case.
// Tsukasa Aso ( aso@toyama-cmt.ac.jp )
// Akinori Kimura ( AKimura@ashitech.ac.jp )
//
///////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring cell charge.
// The Cell Charge is defined by a sum of charge inside the cell
// which calculates the deposited charge in the cell.
//
//
//
//
//
// Created: 2006-06-20 Tsukasa ASO, Akinori Kimura.
//
///////////////////////////////////////////////////////////////////////////////
RE02PSFlatSurfaceCurrent::RE02PSFlatSurfaceCurrent(G4String name, G4int direction,
G4int nx, G4int ny, G4int nz)
:G4PSFlatSurfaceCurrent(name,direction),fNx(nx),fNy(ny),fNz(nz)
{;}
RE02PSFlatSurfaceCurrent::~RE02PSFlatSurfaceCurrent()
{;}
G4int RE02PSFlatSurfaceCurrent::GetIndex(G4Step* aStep)
{
const G4VTouchable* touchable = aStep->GetPreStepPoint()->GetTouchable();
G4int ix = touchable->GetReplicaNumber(1);
G4int iy = touchable->GetReplicaNumber(2);
G4int iz = touchable->GetReplicaNumber(0);
return iy*fNx*fNy+ix*fNz+iz;
}
@@ -0,0 +1,74 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: RE02PSFlatSurfaceFlux.cc,v 1.2 2006/12/13 15:43:11 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// RE02PSFlatSurfaceFlux
#include "RE02PSFlatSurfaceFlux.hh"
///////////////////////////////////////////////////////////////////////////////
//
// The developement and research on this code is supported by Core Research
// for Evolutional Science and Technology (CREST) Program of Japan Science
// and Technology Corporation (JST). You may acknowlege to JST and authers
// whenever you publish your results using this code, as well as the Geant4
// collaboration. Both JST and authers remain to have a right to refuse to use
// this code for any case.
// Tsukasa Aso ( aso@toyama-cmt.ac.jp )
// Akinori Kimura ( AKimura@ashitech.ac.jp )
//
///////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring cell charge.
// The Cell Charge is defined by a sum of charge inside the cell
// which calculates the deposited charge in the cell.
//
//
//
//
//
// Created: 2006-06-20 Tsukasa ASO, Akinori Kimura.
//
///////////////////////////////////////////////////////////////////////////////
RE02PSFlatSurfaceFlux::RE02PSFlatSurfaceFlux(G4String name, G4int direction,
G4int nx, G4int ny, G4int nz)
:G4PSFlatSurfaceFlux(name,direction),fNx(nx),fNy(ny),fNz(nz)
{;}
RE02PSFlatSurfaceFlux::~RE02PSFlatSurfaceFlux()
{;}
G4int RE02PSFlatSurfaceFlux::GetIndex(G4Step* aStep)
{
const G4VTouchable* touchable = aStep->GetPreStepPoint()->GetTouchable();
G4int ix = touchable->GetReplicaNumber(1);
G4int iy = touchable->GetReplicaNumber(2);
G4int iz = touchable->GetReplicaNumber(0);
return iy*fNx*fNy+ix*fNz+iz;
}
@@ -23,53 +23,51 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE02PhantomParameterisation.cc,v 1.2 2006/06/29 17:45:26 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
//
// $Id: RE02PSNofStep.cc,v 1.2 2006/12/13 15:43:14 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// RE02PSNofStep
#include "RE02PSNofStep.hh"
#include "RE02PhantomParameterisation.hh"
#include "G4Box.hh"
#include "G4VPhysicalVolume.hh"
///////////////////////////////////////////////////////////////////////////////
//
// The developement and research on this code is supported by Core Research
// for Evolutional Science and Technology (CREST) Program of Japan Science
// and Technology Corporation (JST). You may acknowlege to JST and authers
// whenever you publish your results using this code, as well as the Geant4
// collaboration. Both JST and authers remain to have a right to refuse to use
// this code for any case.
// Tsukasa Aso ( aso@toyama-cmt.ac.jp )
// Akinori Kimura ( AKimura@ashitech.ac.jp )
//
///////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring cell charge.
// The Cell Charge is defined by a sum of charge inside the cell
// which calculates the deposited charge in the cell.
//
//
//
//
//
// Created: 2006-06-20 Tsukasa ASO, Akinori Kimura.
//
///////////////////////////////////////////////////////////////////////////////
RE02PhantomParameterisation::RE02PhantomParameterisation(
const G4ThreeVector& motherSize,
const G4int nx, const G4int ny, const G4int nz)
:G4VPVParameterisation(),fDxyzMother(motherSize),
fNx(nx),fNy(ny),fNz(nz)
RE02PSNofStep::RE02PSNofStep(G4String name,G4int nx, G4int ny, G4int nz)
:G4PSNofStep(name),fNx(nx),fNy(ny),fNz(nz)
{;}
RE02PSNofStep::~RE02PSNofStep()
{;}
G4int RE02PSNofStep::GetIndex(G4Step* aStep)
{
// Voxel Size
fDxyz.setX(fDxyzMother.x()/(G4double)fNx);
fDxyz.setY(fDxyzMother.y()/(G4double)fNy);
fDxyz.setZ(fDxyzMother.z()/(G4double)fNz);
// Calculation of each segmented position, and fill it in vector.
G4double offsetX = -fDxyzMother.x()+fDxyz.x();
G4double offsetY = -fDxyzMother.y()+fDxyz.y();
G4double offsetZ = -fDxyzMother.z()+fDxyz.z();
for ( G4int ix = 0; ix < fNx; ix++){
for ( G4int iy = 0; iy < fNy; iy++){
for ( G4int iz = 0; iz < fNz; iz++){
G4double x = offsetX+((G4double)ix)*fDxyz.x()*2.;
G4double y = offsetY+((G4double)iy)*fDxyz.y()*2.;
G4double z = offsetZ+((G4double)iz)*fDxyz.z()*2.;
G4ThreeVector pos(x,y,z);
fPositions.push_back(pos);
}
}
}
const G4VTouchable* touchable = aStep->GetPreStepPoint()->GetTouchable();
G4int ix = touchable->GetReplicaNumber(1);
G4int iy = touchable->GetReplicaNumber(2);
G4int iz = touchable->GetReplicaNumber(0);
return iy*fNx*fNy+ix*fNz+iz;
}
RE02PhantomParameterisation::~RE02PhantomParameterisation() {
}
void RE02PhantomParameterisation::ComputeTransformation(const G4int copyNo,
G4VPhysicalVolume* physVol) const
{
physVol->SetTranslation(fPositions[copyNo]);
}
@@ -0,0 +1,73 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: RE02PSPassageCellFlux.cc,v 1.2 2006/12/13 15:43:17 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
// RE02PSPassageCellFlux
#include "RE02PSPassageCellFlux.hh"
///////////////////////////////////////////////////////////////////////////////
//
// The developement and research on this code is supported by Core Research
// for Evolutional Science and Technology (CREST) Program of Japan Science
// and Technology Corporation (JST). You may acknowlege to JST and authers
// whenever you publish your results using this code, as well as the Geant4
// collaboration. Both JST and authers remain to have a right to refuse to use
// this code for any case.
// Tsukasa Aso ( aso@toyama-cmt.ac.jp )
// Akinori Kimura ( AKimura@ashitech.ac.jp )
//
///////////////////////////////////////////////////////////////////////////////
// (Description)
// This is a primitive scorer class for scoring cell charge.
// The Cell Charge is defined by a sum of charge inside the cell
// which calculates the deposited charge in the cell.
//
//
//
//
//
// Created: 2006-06-20 Tsukasa ASO, Akinori Kimura.
//
///////////////////////////////////////////////////////////////////////////////
RE02PSPassageCellFlux::RE02PSPassageCellFlux(G4String name,G4int nx, G4int ny, G4int nz)
:G4PSPassageCellFlux(name),fNx(nx),fNy(ny),fNz(nz)
{;}
RE02PSPassageCellFlux::~RE02PSPassageCellFlux()
{;}
G4int RE02PSPassageCellFlux::GetIndex(G4Step* aStep)
{
const G4VTouchable* touchable = aStep->GetPreStepPoint()->GetTouchable();
G4int ix = touchable->GetReplicaNumber(1);
G4int iy = touchable->GetReplicaNumber(2);
G4int iz = touchable->GetReplicaNumber(0);
return iy*fNx*fNy+ix*fNz+iz;
}
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: RE02PrimaryGeneratorAction.cc,v 1.2 2006/06/29 17:45:32 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: RE02PrimaryGeneratorAction.cc,v 1.3 2006/11/18 01:37:24 asaim Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
#include "RE02PrimaryGeneratorAction.hh"
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: RE02Run.cc,v 1.2 2006/06/29 17:45:35 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: RE02Run.cc,v 1.3 2006/11/18 01:37:24 asaim Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
//=====================================================================
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: RE02RunAction.cc,v 1.2 2006/06/29 17:45:38 gunter Exp $
// GEANT4 tag $Name: geant4-08-01 $
// $Id: RE02RunAction.cc,v 1.3 2006/11/18 01:37:24 asaim Exp $
// GEANT4 tag $Name: geant4-08-02 $
//
#include "RE02RunAction.hh"
#include "RE02Run.hh"