Skip to content

sPHENIX-Collaboration/macros

Repository files navigation

Welcome

This is the standard macros respository for sPHENIX collaboration. Following is the 10-min tutorial on using the sPHENIX macros from this wiki link.

Build Status Doxygen Singularity

Open Issues Open Pull Request Monthly Commits Last Commit

Get started

Please follow SPHENIX software day-1 checklist to get started on RHIC computing facility at BNL, or follow the sPHENIX container setup for your own computing environment.

Check out macro repository

Download the newest macro repository from GitHub:

[jinhuang@rcas2073 test]$ git clone https://github.com/sPHENIX-Collaboration/macros.git
Cloning into 'macros'...
remote: Counting objects: 1125, done.
remote: Total 1125 (delta 0), reused 0 (delta 0), pack-reused 1125
Receiving objects: 100% (1125/1125), 181.75 KiB | 0 bytes/s, done.
Resolving deltas: 100% (471/471), done.
Checking connectivity... done.
[jinhuang@rcas2073 test]$ cd macros/detectors
[jinhuang@rcas2073 detectors]$ # here are all the subdirectories with macros to run sPHENIX, fsPHENIX and EIC detector simulations

The default sPHENIX simulation + reconstruction macro is Fun4All_G4_sPHENIX.C, which is self-explanatory. It is not a black box!. You are welcome to open/edit it to work for your purpose of study.

Try an event display

Then let's see what is implemented by firing up one event:

[jinhuang@rcas2072 sPHENIX]$ source /opt/sphenix/core/bin/sphenix_setup.csh -n   # setup sPHENIX environment if not already done so
# Note, for bash users, please use /opt/sphenix/core/bin/sphenix_setup.sh instead
[jinhuang@rcas2072 sPHENIX]$ root
root [] .x Fun4All_G4_sPHENIX.C(-1) // here negative value in event number start an event display of one event
root [] .L DisplayOn.C 
root [] PHG4Reco* g4 = DisplayOn()
root [] Fun4AllServer *se = Fun4AllServer::instance();
root [] se->run(1)
root [] displaycmd() # this one show more Geant4 command we can run from the ROOT prompt

Run more events

This is simpler, just run with first parameter as the intended number of event:

[jinhuang@rcas2072 sPHENIX]$ source /opt/sphenix/core/bin/sphenix_setup.csh -n   # setup sPHENIX environment if not already done so
[jinhuang@rcas2072 sPHENIX]$ root
root [] .x Fun4All_G4_sPHENIX.C(10) // run 10 events

What next?

Now you are able to run the whole sPHENIX simulation + reconstruction chain. Many next-step topics are listed in the software page. And specifically, to use the simulation for your study, a few thing you might want to try: