Table of contents
FairShip is the software framework for the SHiP experiment which is based on FairRoot. The dependencies of FairShip are tracked and installed using alibuild.
master
- Main development branch.
All python code is required to be python 3. Python 2 is no longer supported.
Requires aliBuild default
release
. charmdet
- Branch for the charm cross-section measurement. Kept as reference for potential future studies.
SHiP-2018
- Frozen branch for the CDS, kept for backward compatibility.
Python 2 only.
Requires aliBuild default
fairship-2018
. muflux
- Branch for the muon flux analysis.
Python 2 only.
Requires aliBuild default
fairship-2018
.
All packages are managed in Git and GitHub. Please read the Git tutorial for SHiP first, even if you already know Git, as it explains how development is done on GitHub.
On lxplus
this is the recommended way to use FairShip
. CVMFS can also be setup on your own machine (please see the CVMFS documentation)
-
Download the FairShip software
git clone https://github.com/ShipSoft/FairShip.git
-
Make sure you can access the SHiP CVMFS Repository
ls /cvmfs/ship.cern.ch
-
Source the
setUp.sh
script from the CVMFS release you want to use (replace$SHIP_RELEASE
with the release you want to use):source /cvmfs/ship.cern.ch/$SHIP_RELEASE/setUp.sh
Info about different releases can be found in a dedicated repository. Please report issues with particular releases or the setup script there.
-
Build the software using aliBuild
aliBuild build FairShip --always-prefer-system --config-dir $SHIPDIST --defaults release
If you are not building
master
, you will need to select the appropriate default (see Branches).
If you exit your shell session and you want to go back working on it, make sure to re-execute the third step.
To load the FairShip environment, after you build the software you can simply use:
- Load the environment
alienv enter FairShip/latest
However, this won't work if you are using HTCondor. In such case you can do:
eval $(alienv load FairShip/latest --no-refresh)
Commands are similar to the previous case, but without access to CVMFS you need to build the required packages.
-
Install
alibuild
usingpipx
(recommended) orpip
. -
Clone the FairShip repository:
git clone https://github.com/ShipSoft/FairShip.git
-
Clone the shipdist repository, which contains the recipes to build the software stack:
git clone https://github.com/ShipSoft/shipdist.git
-
Build the software using aliBuild:
aliBuild build FairShip --config-dir $SHIPDIST --defaults release
NB: Depending on the platform you might have to pass the
--always-prefer-system
or--force-unknown-architecture
flags to aliBuild. For debugging,aliDoctor
is very useful! -
Load the environment
alienv enter FairShip/latest
Set up the bulk of the environment from CVMFS (see the dedicated repository for information about the available releases):
source /cvmfs/ship.cern.ch/$SHIP_RELEASE/setUp.sh
Load your local FairShip environment.
alienv enter (--shellrc) FairShip/latest
Now you can for example simulate some events, run reconstruction and analysis:
python $FAIRSHIP/macro/run_simScript.py
>> Macro finished succesfully.
>> Output file is ship.conical.Pythia8-TGeant4.root
python $FAIRSHIP/macro/ShipReco.py -f ship.conical.Pythia8-TGeant4.root -g geofile_full.conical.Pythia8-TGeant4.root
>> finishing pyExit
python -i $FAIRSHIP/macro/ShipAna.py -f ship.conical.Pythia8-TGeant4_rec.root -g geofile_full.conical.Pythia8-TGeant4.root
>> finished making plots
Run the event display:
python -i $FAIRSHIP/macro/eventDisplay.py -f ship.conical.Pythia8-TGeant4_rec.root -g geofile_full.conical.Pythia8-TGeant4.root
// use SHiP Event Display GUI
Use quit() or Ctrl-D (i.e. EOF) to exit
Docker is not the recommended way to run FairShip
locally. It is ideal
for reproducing reproducible, stateless environments for debugging, HTCondor
and cluster use, or when a strict separation between FairShip
and the host is
desirable.
- Build an docker image from the provided
Dockerfile
:git clone https://github.com/ShipSoft/FairShip.git cd FairShip docker build -t fairship .
- Run the
FairShip
docker image:docker run -i -t --rm fairship /bin/bash
- Advanced docker run options:
The option
docker run -i -t --rm \ -e DISPLAY=unix$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix \ -v /local_workdir:/image_workdir \ fairship /bin/bash
-e DISPLAY=unix$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix
forwards graphics from the docker to your local system (similar tossh -X
). The option-v /local_workdir:/image_workdir
mounts/local_workdir
on the local system as/image_workdir
within docker.
Please see the wiki for FAQs and common issues.
An automatic class reference is built using Doxygen from comments in the C++ code. Improving the comments will improve this documentation.
- Any and all contributions are welcome!
- Contributions via pull requests are preferred, but if you require help with git, don't hesitate to write reach out to us.
- Please split your work into small commits with self-contained changes to make them easy to review and check.
- To help us consistently improve the quality of our code, please try to follow the C++ and Python guidelines.