Difference between revisions of "Documentation of g4sbs"

From Hall A Wiki
Jump to: navigation, search
(Getting the code and building the program)
Line 4: Line 4:
  
 
==Getting the code and building the program==
 
==Getting the code and building the program==
 +
 +
===Prerequisites===
 +
 +
*Working [https://root.cern.ch/drupal/ ROOT] installation. '''g4sbs is not yet compatible with root version 6!'''
 +
*Working [http://geant4.web.cern.ch/geant4/ GEANT4] installation. '''For the uconn_dev branch, g4sbs is only compatible with GEANT4 version 10.x and''' later.
 +
* [http://cmake.org/ cmake] (also required in any case to build GEANT4).
 +
 +
Note on GEANT4 build options:
 +
 +
* GEANT4_INSTALL_DATA=ON is needed
 +
* On Mac OS X, I have built GEANT4 against Qt version 5.3.2. Newer versions of Qt seem to cause GEANT4 Qt-based visualization to crash.
 +
 +
===Downloading the repository===
  
 
The code is hosted on a github repository owned by JLab. To clone via ssh (preferred method on JLab batch farm), do:  
 
The code is hosted on a github repository owned by JLab. To clone via ssh (preferred method on JLab batch farm), do:  
Line 14: Line 27:
  
 
For this method to work, the ssh public key on the machine where you want to get the code must be added to your github account (see [https://help.github.com/articles/generating-ssh-keys/ Guide] to generating ssh keys and adding to your github.com account.)
 
For this method to work, the ssh public key on the machine where you want to get the code must be added to your github account (see [https://help.github.com/articles/generating-ssh-keys/ Guide] to generating ssh keys and adding to your github.com account.)
 +
 +
===Building the program===
 +
 +
Create a "build" directory that is parallel to the "g4sbs" source directory (this is not strictly required, but the build directory must be separate from the "g4sbs" directory. The following instructions assume that "build" is parallel to "g4sbs":
 +
{| class="wikitable" style="background: #BFBFBF;"
 +
|-
 +
| '''mkdir build'''
 +
|-
 +
| '''cd build'''
 +
|-
 +
| '''cmake ../g4sbs'''
 +
|-
 +
| '''make'''
 +
|}
 +
If successful, the g4sbs executable and several other files and folders will be created in the "build" directory.
  
 
==How to run the program==
 
==How to run the program==

Revision as of 18:07, 22 July 2015

Documentation page for g4sbs

This page is maintained by the UConn group (Andrew Puckett) and as of July 22, 2015 is based on the "uconn_dev" branch of g4sbs on github.

Getting the code and building the program

Prerequisites

  • Working ROOT installation. g4sbs is not yet compatible with root version 6!
  • Working GEANT4 installation. For the uconn_dev branch, g4sbs is only compatible with GEANT4 version 10.x and later.
  • cmake (also required in any case to build GEANT4).

Note on GEANT4 build options:

  • GEANT4_INSTALL_DATA=ON is needed
  • On Mac OS X, I have built GEANT4 against Qt version 5.3.2. Newer versions of Qt seem to cause GEANT4 Qt-based visualization to crash.

Downloading the repository

The code is hosted on a github repository owned by JLab. To clone via ssh (preferred method on JLab batch farm), do:

git clone git@github.com:JeffersonLab/g4sbs.git

For this method to work, the ssh public key on the machine where you want to get the code must be added to your github account (see Guide to generating ssh keys and adding to your github.com account.)

Building the program

Create a "build" directory that is parallel to the "g4sbs" source directory (this is not strictly required, but the build directory must be separate from the "g4sbs" directory. The following instructions assume that "build" is parallel to "g4sbs":

mkdir build
cd build
cmake ../g4sbs
make

If successful, the g4sbs executable and several other files and folders will be created in the "build" directory.

How to run the program

g4sbs commands

"Pre-init" vs "Post-init" commands

Setting up the magnetic field

Output ROOT tree structure

Useful links

Git Documentation Github.com homepage for g4sbs