![]() |
FairShip
|
Table of contents
FairShip is the software framework for the SHiP experiment which is based on FairRoot. Its dependencies are managed with pixi — see Using pixi below. See the FairShip wiki for additional documentation.
main charmdet SHiP-2018 muflux 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.
Pixi manages all dependencies via the pixi.toml and activate.sh already included in this repository. The activation script sets FAIRSHIP and GEOMPATH (among others) to PIXI_PROJECT_ROOT, so the pixi project root must be the FairShip clone itself — it contains the required geometry/ and files/ directories. When neither DISPLAY nor WAYLAND_DISPLAY is set (ssh, containers, batch jobs), it also sets QT_QPA_PLATFORM=offscreen, as Geant4's Qt interface otherwise aborts the run. A value you set yourself is kept.
Run commands inside the environment:
Or start a shell:
Pre-built FairShip packages are available from the ship-experiment/stable channel. Because activate.sh expects geometry/, files/, and other data directories at PIXI_PROJECT_ROOT, the simplest approach is to add fairship directly to the clone:
A plain pixi run build installs the whole environment into .pixi/ inside your clone, which is enough to exceed a typical AFS quota. On lxplus, use the pixi build published on CVMFS together with the pixi cvmfs extension instead, which keeps the environment out of your AFS area.
Start from a clean shell and a FairShip clone without an old build/ directory, then:
To build a branch, check it out and rebuild:
You can add the export PATH=... line to your ~/.bashrc so the commands are available in every new shell.
Also keep the pixi cache off EOS/AFS. By default it lives in $XDG_CACHE_HOME or ~/.cache, which on lxplus are on EOS or AFS. Network filesystems are slow for the many small cache files, and a stuck I/O call can freeze pixi so that Ctrl+C has no effect. Put the cache on local disk, for example in ~/.bashrc:
/tmp is local to each lxplus node and gets cleaned up, so pixi may have to download packages again after you log in to a different node.
If pixi waits forever with this message:
a previous pixi process was probably killed while it was installing the environment and left its lock behind. In this case you can:
From your FairShip clone, remove the partial environment and its lock:
Start a shell with the FairShip environment activated:
(Or prefix individual commands with pixi run.) Then you can simulate some events, run reconstruction and analysis:
Note: Simulation output files use the naming convention {sim,geo,params}_{identifier}.root, where the identifier is either a UUID (auto-generated) or a custom tag specified with --tag. ShipReco creates a separate reconstruction file (*_rec.root) containing only digitisation and reconstruction branches. The original simulation file is not modified. ShipAna uses both files via ROOT's friend tree mechanism to access both MC truth and reconstruction data.
To simulate on the geometry of an earlier simulation, for example a standard geometry shared between productions, pass its geometry file with -g. The geometry configuration is then read from the file, so geometry options such as --vacuums or --SND cannot be given, and particles are transported through the geometry stored in the file:
The detectors still build their geometry from the stored configuration, because building is also how they register their sensitive volumes and magnetic fields, which a geometry file does not keep; the stored geometry then replaces the built one. The stored geometry may differ from the one the current code builds, for example a geometry written with an SBT of another design: the run stops only if it lacks a volume to which the current code attaches a magnetic field, and prints the other differences as a warning. Sensitive volumes are found by name, so sensitive volumes that the stored geometry lacks record no hits, and volumes of the stored geometry that the current code does not build are passive. The SBT digitisation finds each SBT cell at the fixed path cave/DecayVolume_1/T2_1/VetoLiSc_0/<cell> (vetoHit::GetNode), so SBT hit positions are right only for SBT designs that keep that hierarchy and the cell names; the warning says when they do not. A detector that the current code can no longer build from the stored configuration, such as the UBT of a geometry file from before the scintillator tiles, is left out of the run with a warning: it records no hits.
Alternatively, you can make use of the experimental analysis_toolkit to run a simple pre-selection check on the events. An example script can be found in $FAIRSHIP/examples/analysis_example.py.
Simulate MC signal events with EventCalc:
and then:
Run the event display:
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.
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.
FairShip is distributed under the GNU Lesser General Public License v3.0 or later (LGPL-3.0-or-later). See the [LICENSE](LICENSE) file for details.
Copyright is held by CERN for the benefit of the SHiP Collaboration. Some components are distributed under different licenses and copyrights - see the individual file headers and the LICENSES directory for details. This project follows the REUSE specification for licensing information.
aliBuild on top of a CVMFS-provided toolchain was the supported default up to and including release 26.05. From 26.06 onwards pixi is the recommended build path; CVMFS images of newer releases (e.g. 26.06) may still be published for convenience, but are no longer the primary distribution channel. These instructions are kept for users running existing CVMFS releases and for legacy branches (SHiP-2018, muflux). The shipdist repository (aliBuild recipes) is now in maintenance mode.