Package: hdtv
HDTV - Nuclear Spectrum AnalysisHDTV is a nuclear spectrum and coincidence matrix analysis tool.
It can load uncompressed (text), compressed, and ROOT spectra and 2D-matrices.
It calibrates spectra, fits peaks with background with different models, and cuts matrices.
HDTV is written in a mixture of C++ and Python, glued together using PyROOT.InstallationHDTV requiresCERN ROOTwith working Python bindings.pipinstallhdtvPlease note that the python package (wheel) does currently not include the compiled libraries required to run, as these depend on the root version, the python version, the compiler, and the moon phases.
Instead, these are compiled automatically at first start, which requires certain build tools (see below).Alternatively, the compilation can be triggered withhdtv--rebuild-usrfor the current user; or withhdtv--rebuild-sysfor all user (requires superuser privileges).RequirementsTo build and run HDTV, the following dependencies are required:PythonTested with 3.8, 3.9, 3.10, and 3.11Packages: numpy scipy matplotlib prompt_toolkit>=3.0.37 uncertaintiesPackages for development & testing: docutils pytest pytest-covCern ROOT6Tested with version 6.26 and higherNeeds to be compiled against the correct python version and with support for C++14 or higher.In python,import ROOTmust succeed.System packages may be available on some systems, e.g.<tool> install root python3-rootcmake, gcc, g++ (or similar, in a somewhat modern version)libx11-dev<tool> install libx11-6 libx11-devUsage with dockerWith docker installed, build the image with:gitclonehttps://github.com/janmayer/hdtv.gitcdhdtv
dockerbuild--taghdtv.On Linux and MacOS, no further installation is required and in the directory with your project you will be able to use HDTV with:dockerrun-eDISPLAY=${DISPLAY}-v/tmp/.X11-unix:/tmp/.X11-unix-v$(pwd):/work-ithdtvWhen using SELinux, the additional argument--security-opt label=type:container_runtime_tis required (before-it).On Windows, you will need to have an X-Server installed, for example with MobaXTerm, and be a bit more specific:dockerrun-eDISPLAY=<yourip>:0.0-v<fullpathtoyourfiles>:/work-ithdtve.g.docker run -e DISPLAY=192.168.178.21:0.0 -v D:\Project\Spectra:/work -it hdtv.See alsohttps://hub.docker.com/r/rootproject/root.DocumentationFor more information, including an overview of the available key
bindings, refer to thedocumentation.
Atutorialgiving an introduction
to HDTV and its basic features is also available.Further installation topicsRun locally from source directory without installationgit clone https://github.com/janmayer/hdtv.git
cd hdtv
./bin/hdtvGenerate man pages:cd doc/guide
make docHandling different ROOT versionsHDTV usesROOT.gSystem.Load(libary)to load some critical
components. These need to be compiled against theexactROOT
version imported in python. HDTV will try to automatically recompile
the libraries for the current ROOT if the available ones cannot
be loaded. This can also be forced with:hdtv --rebuild-usrWhen installed system-wide, the libraries can be recompiled once for
all users with:hdtv --rebuild-sysThis eliminates the need to reinstall HDTV after changes to the root
installation.Multiple Versions of ROOT can be used alongside, the correct library
version will be chosen automatically.