Table of Contents
advsndsw is the software framework of the SND@LHC collaboration for the AdvSND upgrade, based on its current framework sndsw. It is based on
the FairShip framework developed by the SHiP collaboration which in turn is
based on FairRoot, making use of the automatic python bindings provided by
PyROOT.
If you have questions or problems, please feel free to contact the @SND-LHC/core-developers. For troubleshooting and development, we plan to discuss on Mattermost.
The snd-software mailing list can be used to discuss the software and report issues. Important annoucements will be made there.
The snd-software-notifications mailing list will be used for automated notifications from Github and CI/CD etc..
Both mailing lists are self-subscribe CERN e-groups.
master- Main development branch.
All python code is required to be compatible with 3
Requires aliBuild default
release.
The aliBuild family of tools developed by ALICE is used to set up advsndsw and
its dependencies.
The basic commands are the same regardless of whether CVMFS is used:
aliBuild build <package-name> -c snddist- Build the package
<package-name>(e.g.advsndsw) and its dependencies using the recipes and configuration provided by snddist. On CVMFS, it is recommended to add--always-prefer-systemto ensure packages are used from CVMFS instead of being rebuilt. aliDoctor <package-name> -c snddist- Provide troubleshooting information and hints on which packages can be used from the system for
<package-name>and its dependencies. alienv enter <package-name> /latest -c snddist- Enter an environment with
<package-name>and its dependencies.
For more information on using aliBuild, see its
documentation (note: some things are ALICE
specific and will not apply to SND@LHC software).
On lxplus or any CC7/CC8 machine with access to CVMFS, you can do the following:
- Make sure you can access the SNDLHC CVMFS Repository
ls /cvmfs/sndlhc.cern.ch
- Source the
setUp.shscriptsource /cvmfs/sndlhc.cern.ch/SNDLHC-2024/June25/setUp.sh # recommended latest version
- If you don't want to modify the
advsndswpackage, skip step 3:This gives you by default thegit clone https://github.com/SND-LHC/advsndsw
mainbranch of the software. In case, you want to use a specific branch:cd advsndsw git checkout <branch> cd ..
- Build the software using
aliBuildaliBuild build advsndsw -c $SNDDIST --always-prefer-system --default release
If you exit your shell session and you want to go back working on it, make sure to re-execute the second step.
To load the advsndsw environment, after you build the software, you can simply use:
- Load the environment
alienv enter advsndsw/latest-main-release
However, this won't work if you are using HTCondor. In such case you can do:
eval $(alienv load advsndsw/latest-main-release --no-refresh)If you modify advsndsw, simply repeat step 4 from advsndsw's parent directory.
Commands are similar to the previous case, but without access to CVMFS you need to build the required packages from source.
-
Clone the snddist, which containts the recipes to build
advsndswand it's dependencies:git clone https://github.com/SND-LHC/snddist.git
-
If you don't want to modify the advsndsw package, skip step 2:
git clone https://github.com/SND-LHC/advsndsw
This gives you by default the master branch of the software. In case, you want to use a specific branch:
cd advsndsw git checkout <branch> cd ..
-
Install aliBuild
pipx install --user alibuild
and make sure that it is in your $PATH.
-
Build the software using aliBuild
aliBuild build advsndsw -c snddist --default release
If you run into any problems,
aliDoctorcan help determine what the problem is. -
Load the environment
alienv enter advsndsw/latest-main-release
Set up the bulk of the environment from CVMFS.
source /cvmfs/sndlhc.cern.ch/SNDLHC-2024/June25/setUp.shLoad your local advsndsw environment (see above).
alienv enter advsndsw/latest-main-releasepython $ADVSNDSW_ROOT/shipLHC/run_simSND.py --Ntuple -n 100 -f /eos/experiment/sndlhc/MonteCarlo/FLUKA/muons_up/version1/unit30_Nm.root --eMin 1.0Output files are sndLHC.Ntuple-TGeant4.root (events) and geofile_full.Ntuple-TGeant4.root (setup)
Run the event display:
python -i $ADVSNDSW_ROOT/macro/eventDisplay.py -f sndLHC.Ntuple-TGeant4.root -g geofile_full.Ntuple-TGeant4.root
// use SHiP Event Display GUI
Use quit() or Ctrl-D (i.e. EOF) to exita) Use the GUI to display events: SHiP actions / next event
b) Hovering over trajectory will display additional information :
c) At python prompt: sTree.MCTrack.Dump() will display info about all MC particles
- Transport muons, output of FLUKA simulation, to TI18 and the detector. Positive and negative muons, up and down crossing angles, exist. Possible options are setting minimum energy for transporting particles, transport only muons, increase EM cross sections of muons.
python $ADVSNDSW_ROOT/shipLHC/run_simSND.py --Ntuple -n nEvents -f /eos/experiment/sndlhc/MonteCarlo/FLUKA/muons_up/version1/unit30_Nm.root --eMin ecut- Muon deep inelastic scattering events, produced with pythia6, and then positioned in T18 and transported by Geant4:
python $ADVSNDSW_ROOT/shipLHC/run_simSND.py -F --MuDIS -n nEvents -f /eos/experiment/sndlhc/MonteCarlo/Pythia6/MuonDIS/muonDis_1001.root --eMin ecut- Neutrino events, produced by GENIE, and then positioned in T18 and transported by Geant4:
python $ADVSNDSW_ROOT/shipLHC/run_simSND.py --Genie -n nEvents -f ...- Convert MC points to detector hits. Input required, data from simulation together with the geometry file created when running simulation. New objects created are
Digi_ScifiHitstogether withCluster_ScifiandDigi_MuFilterHit, and in parallel objects to make the link to the original MC points,Digi_MuFilterHits2MCPointsandDigi_ScifiHits2MCPoints.
python $ADVSNDSW_ROOT/shipLHC/run_digiSND.py -f sndLHC.Ntuple-TGeant4.root -g geofile_full.Ntuple-TGeant4.rootDocker is not the recommended way to run advsndsw locally. It is ideal
for reproducing reproducible, stateless environments for debugging, HTCondor
and cluster use, or when a strict separation between advsndsw and the host is
desirable.
- Build an docker image from the provided
Dockerfile:git clone https://github.com/SND-LHC/advsndsw.git cd advsndsw docker build -t advsndsw .
- Run the
advsndswdocker image:docker run -i -t --rm advsndsw /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 \ advsndsw /bin/bash
-e DISPLAY=unix$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unixforwards graphics from the docker to your local system (similar tossh -X). The option-v /local_workdir:/image_workdirmounts/local_workdiron the local system as/image_workdirwithin docker.
All packages are managed in Git and GitHub. Please either use the web interface to create pull requests or issues, or send patches via email.
If your changes would also benefit FairShip, please consider making a pull-request for your changes there. We can then pick up the changes from FairShip automatically.