diff --git a/geant4/LEMuSR/doc/running_lem.txt b/geant4/LEMuSR/doc/running_lem.txt new file mode 100644 index 0000000..25e844c --- /dev/null +++ b/geant4/LEMuSR/doc/running_lem.txt @@ -0,0 +1,84 @@ +RUNNING THE LEM SIMULATION - A QUICK HOW-TO + +- T. Shiroka, 13.06.2008 - + +Note: G4 LEM simulations have been tested with the following versions: + geant4-09-01 and CLHEP.2.0.3.2. To install both programs refer + to the file geant_4.9_inst_log.txt located in the directory doc. + + +Preliminary operations +====================== + +Except for the g49 command, all these operations are carried out only once: + +- Check out locally the directory: + afs.psi.ch/project/nemu/svn/lem/trunk/simulation/geant4/LEMuSR + + located at: + http://savannah.psi.ch/viewcvs -> nemu/lem + +- Make sure the env.sh is somewhere in your path. BEFORE starting to use + Geant4, make sure the relevant variables are set by issuing the command: + + source /usr/local/geant4/4.9.1/env.sh + export G4VRMLFILE_VIEWER="vrmlview" # Optional (only for VRML graphics) + + Since these commands should be use every time G4 is used, insert an alias + in your e.g. .bashrc file (DO NOT leave gaps or insert CR!) + + alias g49='source /usr/local/geant4/4.9.1/env.sh; export G4VRMLFILE_VIEWER="vrmlview"; echo "On this machine the G4VRMLFILE_VIEWER=$G4VRMLFILE_VIEWER"' + + Each time one can prepare the G4 enviroment by simply typing: g49 + + +Running the macro +================= + +The final user SHOULD compile the code only once, at the beginning. +Then, each time a different macro is used there is NO need to compile. + +The information flow during program execution is linear: +input data (macro) --> executable --> output data (root) + +- To run normally (output on screen, root data on file): + lem4 1050.mac + +- To write output (output on external file, root data on file): + lem4 1050.mac > filename.txt + +- To run interactively, comment first the macro line + "/run/beamOn", then use a slightly modified syntax: + lem4 1050.mac idle + +Before running the macro, edit carefully all the relevant fields +by using the numerous existing comments as a guidance. +Preferably use an editor capable of syntax highlighting (e.g. kate), +and set it to the "shell script" mode. + +For a correctly running program (automatic features, etc.) all macros, +as well as the various field maps should be located in the directory run. +The run number at the end of the macro file name is used to save data +automatically in a root file having the SAME name (e.g. lem4_1050.root), +as the macro, but located under the directory run/data. + +The executable can be run even WITHOUT installing G4 (e.g. under Merlin). +In this case, however, the user should copy the private run-time bindings +(used by the executable) to the host machine. To list them use either: + +ldd exe_name, or +objdump -p exe_name (more advanced) + + +Analysing simulation output +=========================== + +Since most of the G4 output is written in an external root file, any root +command, script or executable could be used for analysing data. Some root +example files (e.g. for testing TOF, beam cross section, etc.) will be +added soon. + + + + +