forked from FairRootGroup/FairRoot
-
Notifications
You must be signed in to change notification settings - Fork 0
Project template
Radoslaw Karabowicz edited this page Jul 18, 2014
·
1 revision
FairRoot deliver meanwhile a project template that can be used as a starting point for anybody who would like to build simulation and reconstruction on FairRoot. The project Template is in the FairRoot/template/project_template directory
The template demonstrate and implement the following:
- General structure of the software (cake config files, VMC/Geant configurations, etc ..)
- Example detector with sensitive and passive volumes (NewDetector) and data class
- Particle Stack for Geant3/4 with filtering infrastructure
- Event generators (Pathia6,8) more are available directly from FairRoot
- Passive component implementation (Magnet Yoke, Beam Pipe)
- Track visualisation tool (Event display)
- A rename script which replace all the generic names to user defined ones
-
Install FairSoft
we use here "fair_install" as a directory name, you can use what you went!
mkdir ~/fair_install cd ~/fair_install #git clone https://github.com/FairRootGroup/FairSoft.git git clone -b dev https://github.com/FairRootGroup/FairSoft.git cd FairSoft ./configure.sh # 1) gcc (on Linux) 5) Clang (on OSX) # 1) No Debug Info # 2) Internet (install G4 files from internet) # path: ~/fair_install/FairSoftInst
-
Install FairRoot
# Set the shell variable SIMPATH to the installation directory export SIMPATH=~/fair_install/FairSoftInst [setenv SIMPATH ~/fair_install/FairSoftInst] cd ~/fair_install git clone -b dev https://github.com/FairRootGroup/FairRoot.git cd FairRoot mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX="~/fair_install/FairRootInst" .. make make install
To run the tests do:
# To run test: make new shell, do not define SIMPATH cd ~/fair_install/FairRoot/build make test
-
Install the template:
you need to copy the [project template] (https://github.com/FairRootGroup/FairRoot/tree/dev/templates/project_template)to you own directory
# Set the shell variable FAIRROOTPATH to the FairRoot installation directory export FAIRROOTPATH=~/fair_install/FairRootInst [setenv FAIRROOTPATH ~/fair_install/FairRootInst] cd ~/fair_install cp -rf FairRoot/templates/project_template MyTest cd MyTest ./rename.sh MyExperiment PREFIX MyDetector # Please call the script with three parameters. The first one is the # name of the project. The second one is the prefix in front of # the class names. and some directories. So this second parameter # shouldn't be to long. The third parameter is the name of the # detector you want to implement. # As an example the if you want to create a project for the Panda # experiment and you want to implement a Straw Tube Tracker (stt) # you would call the script in the following way. # ./rename.sh Panda Pnd stt cd .. mkdir build cd build cmake ../MyExperiment make . config.sh [or source config.csh]
Now you can for example simulate some events and run the event display:
root -q ../MyExperiment/macro/run_sim.C root ../MyExperiment/macro/eventDisplay.C // Click on "FairEventManager" (in the top-left pane) // Click on the "Info" tab (on top of the bottom-left pane) // Increase the "Current Event" to >0 to see the events root [1] .q