Instructions
Instructions
Instructions
Version 2.1
bug-fixed version of Version 2.0
Version 2.0
create replications of objects
more flexibility for Sensitive Detectors
independent data storage class for the GODDeSS objects
easier construction of wrapping
Update 2013-02-13: Due to some bugs/errors, this version is not working! Use
Version 2.1 instead
Version 1.1
Version 1.0 + documentation
Version 1.0
How to install the example simulation:
install Geant4, GODDeSS is based on it (Geant4.9.6.p02 for GODDeSS versions before
4.0 or Geant4.10.00.p02 since GODDeSS version 4.0, Geant4.10.2.p02 is also tested
and approved for GODDeSS version 4.0)
if your working environment does not have it, install boost (http://www.boost.org/,
recommended version 1.59, higher versions will fail) and zlib
(http://www.zlib.net/), GODDeSS uses them
download the package and untar it in your desired directory
create a “build” directory:
_>mkdir -p path/to/BUILD/directory_
change to this directory:
_>cd path/to/BUILD/directory_
set the environment variables of your Geant4 version:
_>source path/to/Geant4/directory/bin/geant4.sh_
set the environment variable “GODDESS” (the path to the directory in which you
untared the package):
_>export GODDESS=“/absolute/path/to/GODDESS/directory”_
use “cmake” to compile the source code:
_>cmake path/to/SOURCE/directory_
_>make -j install_
How to run the example simulation with default settings:
change to the “source” directory:
_>cd path/to/SOURCE/directory_
set the environment variables “SIMDIR” (the path to the “Simulation” directory of
the example simulation) and “BUILDDIR” (the path to the “build” directory of the
example simulation):
_>export SIMDIR=“/absolute/path/to/SIMULATION/directory”_
_>export BUILDDIR=“/absolute/path/to/BUILD/directory”_
start the simulation using the “RunSimulation” script:
_>./RunSimulation.sh_
to shoot a minimum ionising muon into the scintillator tiles, do:
_>/run/beamOn_
How to run the example simulation with individual settings:
change to the “source” directory:
_>cd path/to/SOURCE/directory_
set the environment variables “SIMDIR” (the path to the “Simulation” directory of
the example simulation) and “BUILDDIR” (the path to the “build” directory of the
example simulation):
_>export SIMDIR=/absolute/path/to/SIMULATION/directory_
_>export BUILDDIR=/absolute/path/to/BUILD/directory_
edit the “RunSimulation” script between “#—- program options to be specified: —-#”
and “#—- process the program options —-#” and save the changes
(the setup and primary particles can easily be changed by editing the files
$SIMDIR/src/Preparation/DetectorConstruction.cc and
$SIMDIR/macros/GeneralParticleSource.mac, respectively :-))
start the simulation using the “RunSimulation” script:
_>./RunSimulation.sh_
to shoot a minimum ionising muon into the scintillator tiles, do:
_>/run/beamOn_
How to implement the GODDeSS object classes in to your own simulation:
install GODDeSS like described above (including the environment variables)
link GODDeSS to your simulation:
- in your CMakeLists.txt (which is creating the simulation executable) add:
#——— Boost ———#
# Find Boost package
find_package(Boost REQUIRED regex)
# Add include directories to the list of directories searched by the compiler for
include files:
include_directories(${Boost_INCLUDE_DIRS})
# Add include directories to the list of directories searched by the compiler for
include files:
set(GODDESS_INCLUDE_DIR $ENV{GODDESS}/source/G4BasicObjects/)
include_directories(${GODDESS_INCLUDE_DIR}/G4PropertyFileReadInTools/include)
include_directories(${GODDESS_INCLUDE_DIR}/G4Scintillator/include)
include_directories(${GODDESS_INCLUDE_DIR}/G4Fibre/include)
include_directories(${GODDESS_INCLUDE_DIR}/G4GeneralParticleSource/include)
include_directories(${GODDESS_INCLUDE_DIR}/G4PhotonDetector/include)
include_directories(${GODDESS_INCLUDE_DIR}/DataProcessing/include)
implement GODDeSS in your simulation’s main file (which sets up the Geant4
framework):
- in beginning, add:
#include <GODDeSS_Messenger.hh>
#include <ScintillatorTileConstructor.hh>
#include <FibreConstructor.hh>
#include <PhotonDetectorConstructor.hh>
- in your main() function, add the following lines (you can adjust the numerical
values):
// GODDeSS: energy range for the property distributions
vector energyRangeVector;
G4double energyRangeVectorSize = 10;
G4double energiesMin = 0.5*eV;
G4double energiesMax = 25*eV;
for(int i = 0; i < energyRangeVectorSize; i)
energyRangeVector.push_back( energiesMin + i * (energiesMax - energiesMin) /
(energyRangeVectorSize - 1) );
// GODDeSS Messenger:
GODDeSS_Messenger * goddessMessenger = new GODDeSS_Messenger(energyRangeVector);
- and after your physics list (G4VModularPhysicsList physicsList) has been created
(but before it is initialised by SetUserInitialization(physicsList)), add:*
// GODDeSS Constructors:
G4bool SearchOverlaps = false; // set to true to check your geometry
ScintillatorTileConstructor * scintillatorTileConstructor = new
ScintillatorTileConstructor(physicsList, goddessMessengerGetPropertyToolsManager(),
goddessMessenger>GetDataStorage(), SearchOverlaps);
goddessMessenger->SetScintillatorTileConstructor(scintillatorTileConstructor);
STConstructor->SetScintillatorTransformation(G4Transform3D(G4RotationMatrix(),
G4ThreeVector(0., 50. * mm, 0.));
STConstructor->SetScintillatorName(“scintillator”);
STConstructor->ConstructASensitiveDetector();
G4ScintillatorTile * scintillator = STConstructor-
>ConstructScintillator(ScintiDimensions, path/to/scintillator/property/file,
pointer-to-physical-world-volume);
FConstructor->SetFibreStartPointReflective(0.98);
G4Fibre * fibre = FConstructorConstructFibre(path/to/fibre/property/file,
scintillator>GetScintillator_physicalVolume(), FibreStartPoint, FibreEndPoint);
- you can also use the property tools from GODDeSS to define the properties of your
own volumes, e.g. like:
#include <PropertyToolsManager.hh>
#include <Properties.hh>
Properties::tabular chemicalComponents_XY =
XYProperties.getTabular(“chemical_components”);