For successfull running on Github Codespaces one can submit an application for Free Github Education benefits.
This is an example analysis of StPicoDst:
Ststands for STAR, all classes start from itPicomeans the tree data format where only small number of numerous qualities are saved, exist alsoMicroandMini,Dstmeans Data Summary Table)
It is based on Grigory's presentation on PicoDst 2019
- Understand what
StRootis and why STAR code is placed there. - Understand what
conscommand does and what.sl7X_gccXXmeans. - Build and run one STAR maker.
- Produce one user tree (
MyTreeEvent+MyTrack) and read it.
StRoot/StPicoDstAnalysisMaker/ # user STAR package compiled by cons
MyTreeEvent.h / MyTrack.h # custom classes stored in output TTree
macros/runPicoDstAnalysisMaker.C # run maker
macros/readMyTreeEvent.C # read TTree with custom classes (no STAR)
StRoot is the STAR source tree location where analysis packages are expected.
cons discovers and builds STAR packages from StRoot/<PackageName>.
If code is outside this structure, your package library is usually not built in the standard STAR way.
cons is STAR's build command (similar role to make): it compiles C++ code and creates shared libraries used by ROOT macros.
- STAR platform/compiler setup is read.
- Build directory
.sl7X_gccXXis created or updated. - Code under
StRoot/is compiled. - Shared libraries are written to
.sl7X_gccXX/LIB.
A STAR build-output directory name:
sl7X: Scientific Linux 7 compatible build target.gccXX: compiler tag.
Example: .sl79_gcc485 means SL7.9 target with GCC 4.8.5 toolchain.
gcc485 is shorthand for GNU C++ compiler version 4.8.5.
STAR uses fixed toolchains for binary compatibility across libraries.
Run from project root:
star-shell #load into star container
cons
root -l -b -q 'macros/runPicoDstAnalysisMaker.C("st_physics_20069002_raw_1500008.picoDst.root","output_tree.root")'
root -l -b -q macros/readMyTreeEvent.C++The second part is how to handle the batch scheduler SUMS
For that, on SDCC Alma9 starub node one can run
./submit.shfor sending an example of 2 jobs to HTCondor system.
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 -lDo 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-shellusing 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"
Install Docker Desktop
brew install --cask docker-desktopThen start Docker Desktop once (so the Docker daemon is running), and enter the STAR container with your current folder available inside the container:
docker run --rm -it \
--platform linux/amd64 \
-v "$PWD":/work -w /work \
ghcr.io/star-bnl/star-sw:main-root5-gcc485 \
bash -lThis is the Docker equivalent of your Linux star-shell. It mounts the current directory into /work and drops you into bash -l unless you pass your own command.
mkdir -p ~/.local/bin && cat >~/.local/bin/star-shell <<'EOF'
#!/usr/bin/env bash
IMAGE="ghcr.io/star-bnl/star-sw:main-root5-gcc485"
# If no args provided -> interactive login shell
if [ $# -eq 0 ]; then
set -- bash -l
fi
docker run -it --rm \
--platform linux/amd64 \
-v "$PWD":/work -w /work \
"$IMAGE" "$@"
EOF
chmod +x ~/.local/bin/star-shell
# Add ~/.local/bin to PATH for zsh (default on macOS)
grep -qxF 'export PATH="$HOME/.local/bin:$PATH"' ~/.zshrc || echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
export PATH="$HOME/.local/bin:$PATH"Now you can do:
star-shell- Introduction to PicoDst (Grigory Nigmatkulov, 2019)
- Starting Data Analysis on STAR (Samantha Brovko, 2011)
- A common-MuDst tutorial (Sergey Panitkin, 2003)