## Geant4 ############################
* install geant4 (Mac)
% install xerces-c
+-------------------------+
| $ brew install xerces-c |
+-------------------------+
% set environment
+---------------------------------------------------+
| export G4INSTALL=/usr/local/geant4/geant4.9.6.p02 |
+---------------------------------------------------+
% get geant4 code
+-------------------------------------------------------------------+
| $ wget http://geant4.cern.ch/support/source/geant4.9.6.p02.tar.gz |
| $ cd /usr/local |
| $ mkdir geant |
| $ cd geant |
| $ tar zxvf ~/geant4.9.6.p02.tar.gz |
| $ mkdir geant4.9.6.p02-build |
| $ cd geant4.9.6.p02-build |
+-------------------------------------------------------------------+
% make
+---------------------------------------------------------------------------------------+
| $ cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DXERCESC_ROOT_DIR=/opt/local \ |
| -DGEANT4_USE_OPENGL_X11=ON -DGEANT4_USE_RAYTRACER_X11=ON -DGEANT4_INSTALL_DATA=ON \ |
| -DGEANT4_USE_GDML=ON $G4INSTALL |
| $ make -j4 |
| $ make install |
+---------------------------------------------------------------------------------------+
NOTE : ln -s /opt/X11 /usr/X11R6 is needed
% geant.sh
+---------------------+
| $ cd /usr/local/bin |
| $ source geant4.sh |
| $ cd - > /dev/null |
+---------------------+
NOTE : DYLD_LIBRARY_PATH should be ""
* cmake src with ROOT
+-----------------------------------------------------------------------+
| $ cmake -DGeant4_DIR=/usr/local/lib/Geant4-9.6.2 \ |
| -DCMAKE_MODULE_PATH=/usr/local/geant/geant4.9.6.p02/cmake/Modules \ |
| ../<src_dir> |
+-----------------------------------------------------------------------+
* install VRML (Mac)
use FreeWRL
+-------------------------------------------------------------------------------------------------+
| $ cd |
| $ cp /Volumes/FreeWRL\ 1.22.13-Pre1\ install/FreeWRL-1.22.13-pre1.pkg/Contents/Archive.pax.gz . |
| $ gunzip Archive.pax.gz |
| $ open Archive.pax |
| $ cd unidst |
| $ cp -pr Applications/FreeWRL /Applications |
| $ sudo cp -p usr/local/lib/lib* /usr/local/lib/ |
| $ sudo cp -p usr/bin/* /usr/local/bin/ |
+-------------------------------------------------------------------------------------------------+
% no need ?
+-----------------------------------------------+
| $ rm /usr/local/lib/libfree* |
| $ sudo ln -s /opt/X11/lib/libfreetype.6.dylib |
+-----------------------------------------------+
export G4VRMLFILE_VIEWER=freewrl at .zshrc
/vis/open VRML2FILE
/vis/viewer/flush
* cmake error about ROOT
if geant can not find root path,
edit /usr/local/geant/geant4.10.00/cmake/Modules/FindROOT.cmake
+---------------------------------------------+
| if(NOT ROOT_CONFIG_EXECUTABLE) |
| set(ROOT_FOUND FALSE) |
| else() |
| set(ROOT_FOUND TRUE) |
| ^set(ROOT_CONFIG_EXECUTABLE "root-config")^|
+---------------------------------------------+
* suppress G4ParticleGun messages
+------------------------------------------------------------------------------+
| ^#include "G4strstreambuf.hh"^ |
| |
| ^G4strstreambuf* oldBuffer = dynamic_cast<G4strstreambuf*>(G4cout.rdbuf(0));^|
| ... |
| particleGun->SetParticleMomentum(G4ThreeVector(px*GeV, py*GeV, pz*GeV)); |
| ... |
| ^G4cout.rdbuf(oldBuffer);^ |
+------------------------------------------------------------------------------+
* set filter for trajectries in macro
+-------------------------------------------------------------------------------+
| /vis/filtering/trajectories/create/particleFilter |
| /vis/filtering/trajectories/particleFilter-0/add <particle> |
| |
| /vis/filtering/trajectories/create/chargeFilter |
| /vis/filtering/trajectories/chargeFilter-0/add <charge> |
| |
| /vis/filtering/trajectories/create/attributeFilter |
| /vis/filtering/trajectories/attributeFilter-0/setAttribute IMag |
| /vis/filtering/trajectories/attributeFilter-0/addInterval <min> MeV <max> MeV |
+-------------------------------------------------------------------------------+
% particle
anti_proton, gamma, etc.