Geant4Examples: Difference between revisions
(Created page with " The Geant4 package includes examples on now to create standalone Geant4 examples. Mu2e runs Geant4 from within an art module so these examples are not illustrative of how we...") |
No edit summary |
||
Line 15: | Line 15: | ||
# mkdir G4Examples | # mkdir G4Examples | ||
# cd G4Examples | # cd G4Examples | ||
# | # mu2einit | ||
# muse setup | # muse setup | ||
# rsync -ar $GEANT4_DIR/source/geant4-v*/examples/basic/B1 . | # rsync -ar $GEANT4_DIR/source/geant4-v*/examples/basic/B1 . |
Revision as of 21:26, 19 July 2024
The Geant4 package includes examples on now to create standalone Geant4 examples. Mu2e runs Geant4 from within an art module so these examples are not illustrative of how we use it. However understanding the first few Geant4 examples are good way to learn the basics of how to use Geant4; if you will work on Mu2e support for Geant4, we recommend understanding these examples before you see how Mu2e uses Geant4.
As of March 2024, the relevant Geant4 documentation is at these links:
- https://geant4.web.cern.ch/
- https://geant4.web.cern.ch/docs/getting-started
- https://geant4-userdoc.web.cern.ch/Doxygen/examples_doc/html/index.html
- https://geant4-userdoc.web.cern.ch/Doxygen/examples_doc/html/README_basic.html
- https://geant4-userdoc.web.cern.ch/Doxygen/examples_doc/html/README_HowToRun.html
The instructions on the CERN HowToRun page need some modifications to run in the Mu2e environment. The following describes how to install, build and run the basic example B1. These examples use G4 graphics and they work most easily if you do run the following commands from within a ComputingLogin#VNC session.
- Start in a clean shell
- mkdir G4Examples
- cd G4Examples
- mu2einit
- muse setup
- rsync -ar $GEANT4_DIR/source/geant4-v*/examples/basic/B1 .
- mkdir B1_build
- cd B1_build
- cmake -DGeant4_DIR=$GEANT4_FQ_DIR/lib/cmake/Geant4 ../B1
- make -j 4 B1
- ./exampleB1
- Following the run-time instructions in ../B1/README
Study how the examples works, using
- Using ../B1/README and the source code in ../B1
- This web page: https://geant4-userdoc.web.cern.ch/UsersGuides/ForApplicationDeveloper/html/index.html
If you wish to try other examples, follow the above pattern and make the directories peers of B1 and B1_build.
Notes:
- Step 5: will choose the highest numbered envset in /cvmfs/mu2e.opensciencegrid.org/DataFiles/Muse/. It will also print a warning message that is safe to ignore.
- Step 6 copies the example code from the G4 distribution to the local disk.
- Steps 9 and 10 each take about 5 seconds on an unloaded mu2egpvm.
- Step 11 runs the example