STAR Tutorial
<- click
Alexandr Prozorov
For successfull running on Github Codespaces one can submit an application for Free Github Education benefits.
This is an example analysis of StPicoDst
:
St
stands for STAR, all classes start from itPico
means the tree data format where only small number of numerous qualities are saved, exist alsoMicro
andMini
,Dst
means Data Summary Table)
It is based on Grigory’s presentation on PicoDst 2019
Introduction
The starver corresponds to the latest version star pro
with compiler gcc4.85
and ROOT 5.34
version.
STAR uses cons
command to compile. This is similar to compiling projects using Make
file or performing g++
command with additional libs within complex C++
projects (whic STAR is). The cons
command will:
- create a directory
.sl7X_gccXX
where all compiled libraries will go which are used in your project - perform compilation of all your files with
.cxx
(important!) and connected headers.h
underStRoot
directory.
What this tutorial about?
- It will show how
StRoot
folder is used to compile your project. - The analysis macro will create a file with user
TTree
andQA Histograms
- The user defined
TTree
actually consists of classes MyTreeEvent.h and MyTrack.h - There is a second standalone macro which does not need any STAR infrastructure - only meantioned header files MyTreeEvent.h and MyTrack.h and can be further used for analysis on personal latptop or batchfarm.
Run instructions:
- First, you’ll need to enter the STAR container, for that, type:
star-shell
- To compile a project, perform
cons
commandcons
- Now, one can run event analysis macro using without(!) compilation (not using
+
sign at the end)root -l -b -q macros/runPicoDstAnalysisMaker.C
It will create a
.root
file with your TTree and some QA histograms. If you are interested what are these ROOT flags:-l
- no splash screen-b
- stands for batchmode (no pictures showed),-q
- quit after executing.
- Now, one can perform your analysis on this newly created TTree with compiled (!) macro - notice
+
at the endroot -l -b -q macros/readMyTreeEvent.C+
Some old presentation on DST tutorials:
- Introduction to PicoDst (Grigory Nigmatkulov, 2019)
- Starting Data Analysis on STAR (Samantha Brovko, 2011)
- A common-MuDst tutorial (Sergey Panitkin, 2003)
Remark: Running on your own laptop
In case you want to enter and run STAR container on your own laptop:
- You need to install either Docker engine or Apptainer (singularity). For simplier Apptainer (singularity) installation:
sudo apt update sudo apt install -y software-properties-common sudo add-apt-repository -y ppa:apptainer/ppa sudo apt update sudo apt install -y apptainer
- And then run commands:
git clone https://github.com/aprozo/star-tutorial.git cd star-tutorial apptainer run docker://ghcr.io/star-bnl/star-sw:main-root5-gcc485 bash -l
Important!
Do not forget to comment in your
~/.bashrc
sourcing your local Root installation (source /path/thisroot.sh
), otherwise there will be a conflict of 2 ROOT versions: one - from your local installation, another - from STAR container. - You may also create a shortcut for
star-shell
using code below:mkdir -p ~/.local/bin && cat >~/.local/bin/star-shell <<'EOF' #!/usr/bin/env bash apptainer run docker://ghcr.io/star-bnl/star-sw:main-root5-gcc485 "$@" EOF chmod +x ~/.local/bin/star-shell grep -qxF 'export PATH="$HOME/.local/bin:$PATH"' ~/.bashrc || echo 'export PATH="$HOME/.local/bin:$PATH"' >>~/.bashrc export PATH="$HOME/.local/bin:$PATH"