diff --git a/CMakeLists.txt b/CMakeLists.txt index c67a306aabc240dfd14608b9b4b70e35e2306b82..cae01e8ee3a13cff10e1dc01c1003d61fa415edf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,8 @@ include(FairMacros) include(WriteConfigFile) include(CheckCompiler) +include(WriteGeant4Data_jupy) +include(WriteKernelFile) # Do some basic checks # out-of-source build, unix system and @@ -82,6 +84,9 @@ list(PREPEND CMAKE_PREFIX_PATH ${SIMPATH}) unset(packages) +find_package(Python3) +MESSAGE("Python3_EXECUTABLE=${Python3_EXECUTABLE}") + #Searches for ROOT Package find_package(ROOT 6.22 CONFIG REQUIRED) if(ROOT_FOUND) diff --git a/cmake/modules/CbmGenerateConfig.cmake b/cmake/modules/CbmGenerateConfig.cmake index 73519f91a8d3cc209b8663407531ea7bf6c8d777..92716aaacb044eb7b7e5118bb177b853c5239fb6 100644 --- a/cmake/modules/CbmGenerateConfig.cmake +++ b/cmake/modules/CbmGenerateConfig.cmake @@ -1,38 +1,38 @@ macro(generate_config_files) - - # generate config files used for build directory - WRITE_CONFIG_FILE(config.sh) - WRITE_CONFIG_FILE(config.csh) - - # generate config files used for installation directory - SET(ROOT_INCLUDE_PATH - ${ROOT_INCLUDE_PATH} - "${CMAKE_INSTALL_PREFIX}/include" - "${CMAKE_INSTALL_PREFIX}/include/mvd" - "${CMAKE_INSTALL_PREFIX}/include/littrack" - "${CMAKE_INSTALL_PREFIX}/include/KF" - "${CMAKE_INSTALL_PREFIX}/include/AnalysisTree" - "${CMAKE_INSTALL_PREFIX}/include/AnalysisTreeQA" - ) - - set(CMAKE_INSTALL_LIBDIR lib) - SET(VMCWORKDIR ${CMAKE_INSTALL_PREFIX}/share/cbmroot) - - WRITE_CONFIG_FILE(config.sh_install) - WRITE_CONFIG_FILE(config.csh_install) - - Install(FILES ${CMAKE_BINARY_DIR}/config.sh_install - DESTINATION bin - RENAME CbmRootConfig.sh - ) - - Install(FILES ${CMAKE_BINARY_DIR}/check_system.sh - DESTINATION bin - ) - - Install(FILES ${CMAKE_BINARY_DIR}/config.csh_install - DESTINATION bin - RENAME CbmRootConfig.csh - ) - + # generate config files used for build directory + WRITE_CONFIG_FILE(config.sh) + WRITE_CONFIG_FILE(config.csh) + WRITE_KERNEL_FILE(CbmRootPy/kernel.json) + + # generate config files used for installation directory + SET(ROOT_INCLUDE_PATH + ${ROOT_INCLUDE_PATH} + "${CMAKE_INSTALL_PREFIX}/include" + "${CMAKE_INSTALL_PREFIX}/include/mvd" + "${CMAKE_INSTALL_PREFIX}/include/littrack" + "${CMAKE_INSTALL_PREFIX}/include/KF" + "${CMAKE_INSTALL_PREFIX}/include/AnalysisTree" + "${CMAKE_INSTALL_PREFIX}/include/AnalysisTreeQA" + ) + + set(CMAKE_INSTALL_LIBDIR lib) + SET(VMCWORKDIR ${CMAKE_INSTALL_PREFIX}/share/cbmroot) + + WRITE_CONFIG_FILE(config.sh_install) + WRITE_CONFIG_FILE(config.csh_install) + WRITE_KERNEL_FILE(CbmRootPy/kernel.json_install) + + Install(FILES ${CMAKE_BINARY_DIR}/config.sh_install + DESTINATION bin + RENAME CbmRootConfig.sh + ) + + Install(FILES ${CMAKE_BINARY_DIR}/check_system.sh + DESTINATION bin + ) + + Install(FILES ${CMAKE_BINARY_DIR}/config.csh_install + DESTINATION bin + RENAME CbmRootConfig.csh + ) endmacro() diff --git a/cmake/modules/WriteGeant4Data_jupy.cmake b/cmake/modules/WriteGeant4Data_jupy.cmake new file mode 100644 index 0000000000000000000000000000000000000000..033d3d9fcbed6f41351b822c93f094f8228667fa --- /dev/null +++ b/cmake/modules/WriteGeant4Data_jupy.cmake @@ -0,0 +1,6 @@ +MACRO(Write_Geant4Data_Variables_jupy) +Set(Geant4Data_Variables_jupy "") +foreach(DATASET ${Geant4_DATASETS}) + string(CONCAT Geant4Data_Variables_jupy ${Geant4Data_Variables_jupy} " \"${Geant4_DATASET_${DATASET}_ENVVAR}\": \"${Geant4_DATASET_${DATASET}_PATH}\",\n") +endforeach() +ENDMACRO() diff --git a/cmake/modules/WriteKernelFile.cmake b/cmake/modules/WriteKernelFile.cmake new file mode 100644 index 0000000000000000000000000000000000000000..89cef789b81a51d2d34f2177d359ca0009509edf --- /dev/null +++ b/cmake/modules/WriteKernelFile.cmake @@ -0,0 +1,199 @@ +################################################################################ + # Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # + # # + # This software is distributed under the terms of the # + # GNU Lesser General Public Licence (LGPL) version 3, # + # copied verbatim in the file "LICENSE" # + ################################################################################ + MACRO (WRITE_KERNEL_FILE filename) + + #MESSAGE(" + # Python3_FOUND=${Python3_FOUND} + # Python3_Interpreter_FOUND=${Python3_Interpreter_FOUND} + # Python3_EXECUTABLE=${Python3_EXECUTABLE} + # " + #) + + String(REGEX REPLACE "^.*(install).*$" "\\1" INSTALL_VERSION ${filename}) + String(COMPARE EQUAL "install" "${INSTALL_VERSION}" INSTALL_TRUE) + + List(REMOVE_ITEM LD_LIBRARY_PATH ${CMAKE_BINARY_DIR}/lib) + + If (INSTALL_TRUE) + SET(_INSTALLDIR ${CMAKE_INSTALL_PREFIX}) + SET(_BINDIR ${CMAKE_INSTALL_PREFIX}/bin) + #SET(VMCWORKDIR ${CMAKE_INSTALL_PREFIX}/share/fairbase) + SET(FAIRLIBDIR ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) + SET(_LD_LIBRARY_PATH ${FAIRLIBDIR} ${LD_LIBRARY_PATH}) + Else (INSTALL_TRUE) + SET(_INSTALLDIR ${CMAKE_BINARY_DIR}) + SET(_BINDIR ${CMAKE_BINARY_DIR}) + #SET(VMCWORKDIR ${CMAKE_SOURCE_DIR}) + SET(FAIRLIBDIR ${CMAKE_BINARY_DIR}/lib) + SET(_LD_LIBRARY_PATH ${FAIRLIBDIR} ${LD_LIBRARY_PATH}) + EndIf (INSTALL_TRUE) + + If(NOT DEFINED FULL_CONFIG_FILE) + Set(FULL_CONFIG_FILE "true") + EndIf(NOT DEFINED FULL_CONFIG_FILE) + + + IF(CMAKE_SYSTEM_NAME MATCHES Linux) + IF(FAIRROOTPATH) + configure_file(${FAIRROOTPATH}/share/fairbase/cmake/scripts/check_system.sh.in + ${CMAKE_CURRENT_BINARY_DIR}/check_system.sh + ) + configure_file(${FAIRROOTPATH}/share/fairbase/cmake/scripts/check_system.csh.in + ${CMAKE_CURRENT_BINARY_DIR}/check_system.csh + ) + ELSE(FAIRROOTPATH) + configure_file(${PROJECT_SOURCE_DIR}/cmake/scripts/check_system.sh.in + ${CMAKE_CURRENT_BINARY_DIR}/check_system.sh + ) + configure_file(${PROJECT_SOURCE_DIR}/cmake/scripts/check_system.csh.in + ${CMAKE_CURRENT_BINARY_DIR}/check_system.csh + ) + ENDIF(FAIRROOTPATH) + + EXECUTE_PROCESS(COMMAND lsb_release -sd + OUTPUT_VARIABLE _linux_flavour + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + IF(_linux_flavour) + STRING(REGEX REPLACE "^\"" "" _linux_flavour ${_linux_flavour}) + STRING(REGEX REPLACE "\"$" "" _linux_flavour ${_linux_flavour}) + ENDIF(_linux_flavour) + + EXECUTE_PROCESS(COMMAND uname -m + OUTPUT_VARIABLE _system + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + + ElseIf(CMAKE_SYSTEM_NAME MATCHES Darwin) + IF(FAIRROOTPATH) + configure_file(${FAIRROOTPATH}/share/fairbase/cmake/scripts/check_system_mac.sh.in + ${CMAKE_CURRENT_BINARY_DIR}/check_system.sh + ) + configure_file(${FAIRROOTPATH}/share/fairbase/cmake/scripts/check_system_mac.csh.in + ${CMAKE_CURRENT_BINARY_DIR}/check_system.csh + ) + ELSE(FAIRROOTPATH) + configure_file(${PROJECT_SOURCE_DIR}/cmake/scripts/check_system_mac.sh.in + ${CMAKE_CURRENT_BINARY_DIR}/check_system.sh + ) + configure_file(${PROJECT_SOURCE_DIR}/cmake/scripts/check_system_mac.csh.in + ${CMAKE_CURRENT_BINARY_DIR}/check_system.csh + ) + ENDIF(FAIRROOTPATH) + EXECUTE_PROCESS(COMMAND uname -sr + OUTPUT_VARIABLE _linux_flavour + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + EXECUTE_PROCESS(COMMAND uname -m + OUTPUT_VARIABLE _system + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + ENDIF(CMAKE_SYSTEM_NAME MATCHES Linux) + + + CONVERT_LIST_TO_STRING(${Geant4_INCLUDE_DIRS}) + Set(Geant4_INCLUDE_DIRS ${output}) + + CONVERT_LIST_TO_STRING(${Geant4VMC_INCLUDE_DIRS}) + Set(Geant4VMC_INCLUDE_DIRS ${output}) + + #CONVERT_LIST_TO_STRING(${Geant4VMC_CMAKE_INSTALL_LIBDIR}) + #Set(Geant4VMC_LIBRARY_DIR ${output}) + + CONVERT_LIST_TO_STRING(${Geant4VMC_MACRO_DIR}) + Set(Geant4VMC_MACRO_DIR ${output}) + + Write_Geant4Data_Variables_jupy() + + CONVERT_LIST_TO_STRING(${PYTHIA6_LIBRARY_DIR}) + Set(PYTHIA6_LIBRARY_DIR ${output}) + + CONVERT_LIST_TO_STRING(${Geant3_SYSTEM_DIR}) + Set(G3SYS ${output}) + + CONVERT_LIST_TO_STRING(${Geant3_INCLUDE_DIRS}) + Set(Geant3_INCLUDE_DIRS ${output}) + + CONVERT_LIST_TO_STRING(${Geant3_LIBRARY_DIR}) + Set(Geant3_LIBRARY_DIR ${output}) + + CONVERT_LIST_TO_STRING(${Geant3_LIBRARIES}) + Set(Geant3_LIBRARIES ${output}) + + CONVERT_LIST_TO_STRING(${ROOT_LIBRARY_DIR}) + Set(ROOT_LIBRARY_DIR ${output}) + + CONVERT_LIST_TO_STRING(${ROOT_LIBRARIES}) + Set(ROOT_LIBRARIES ${output}) + + CONVERT_LIST_TO_STRING(${ROOT_INCLUDE_DIR}) + Set(ROOT_INCLUDE_DIR ${output} ) + + #Set(VMCWORKDIR ${C}) + + Set(FAIRLIBDIR ${FAIRLIBDIR}) + + List(APPEND _LD_LIBRARY_PATH ${PYTHIA6_LIBRARY_DIR} ${Geant3_LIBRARY_DIR} ${Geant4VMC_LIBRARY_DIR}) + + List(REMOVE_DUPLICATES _LD_LIBRARY_PATH) + CONVERT_LIST_TO_STRING(${_LD_LIBRARY_PATH}) + + IF(CMAKE_SYSTEM_NAME MATCHES Linux) + Set(MY_LD_LIBRARY_PATH ${output}) + ELSE(CMAKE_SYSTEM_NAME MATCHES Linux) + IF(CMAKE_SYSTEM_NAME MATCHES Darwin) + Set(MY_DYLD_LIBRARY_PATH ${output}) + ENDIF(CMAKE_SYSTEM_NAME MATCHES Darwin) + ENDIF(CMAKE_SYSTEM_NAME MATCHES Linux) + + Set(USE_VGM 1) + + SET(PYTHONPATH ${CMAKE_SOURCE_DIR}/python ${FAIRLIBDIR} ${SIMPATH}/lib ${SIMPATH}/lib/root ${SIMPATH}/lib/Geant4 ${SIMPATH}/lib/g4py ${PYTHONPATH}) + UNIQUE(PYTHONPATH "${PYTHONPATH}") + CONVERT_LIST_TO_STRING(${PYTHONPATH}) + SET(MY_PYTHONPATH ${output}) + + SET (PATH ${ROOTSYS}/bin ${PATH}) + UNIQUE(PATH "${PATH}") + CONVERT_LIST_TO_STRING(${PATH}) + Set(MY_PATH ${output}) + + # If(FAIRSOFT_EXTERN) + # Set(PYTHIA8DATA "${SIMPATH}/share/pythia8/xmldoc") + # Else(FAIRSOFT_EXTERN) + # Set(PYTHIA8DATA "${SIMPATH}/generators/pythia8/xmldoc") + # EndIf(FAIRSOFT_EXTERN) + + CONVERT_LIST_TO_STRING(${ROOT_INCLUDE_PATH}) + Set(ROOT_INCLUDE_PATH ${output}) + + IF(${filename} MATCHES "[.]json.*$") + MESSAGE("Configuring Jupyter kernelspec file ${filename}") + String(REPLACE "_install" "" KERNELFILE ${filename}) + configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/jupyter/${KERNELFILE}.in + ${CMAKE_CURRENT_BINARY_DIR}/share/jupyter/kernels/${filename} + ) + get_filename_component(KERNELSUBPATH ${KERNELFILE} DIRECTORY) + file(COPY ${CMAKE_SOURCE_DIR}/cmake/scripts/jupyter/logo-64x64.png + DESTINATION share/jupyter/kernels/${KERNELSUBPATH} + ) + + IF(${filename} MATCHES "install$") + install( FILES ${CMAKE_BINARY_DIR}/share/jupyter/kernels/${filename} + DESTINATION share/jupyter/kernels + RENAME ${KERNELFILE} + ) + install( FILES ${CMAKE_SOURCE_DIR}/cmake/scripts/jupyter/logo-64x64.png + DESTINATION share/jupyter/kernels/${KERNELSUBPATH} + ) + ENDIF(${filename} MATCHES "install$") + + ENDIF(${filename} MATCHES "[.]json.*$") + +ENDMACRO (WRITE_KERNEL_FILE) diff --git a/cmake/scripts/jupyter/CbmRootPy/kernel.json.in b/cmake/scripts/jupyter/CbmRootPy/kernel.json.in new file mode 100644 index 0000000000000000000000000000000000000000..0398990c5840ecfe8cc330417c825d6fe7734f53 --- /dev/null +++ b/cmake/scripts/jupyter/CbmRootPy/kernel.json.in @@ -0,0 +1,39 @@ +{ + "language": "python", + "display_name": "CbmRoot Python3", + "argv": [ + "@Python3_EXECUTABLE@", + "-m", + "ipykernel_launcher", + "-f", + "{connection_file}" + ], + "env": { + "Linux_Flavour_": "@_linux_flavour@", + "System_": "@_system@", + "SIMPATH": "@SIMPATH@", + "ROOTSYS": "@ROOTSYS@", + "FAIRROOTPATH": "@FAIRROOTPATH@", + "Geant4_INCLUDE_DIRS": "@Geant4_INCLUDE_DIRS@", + "Geant4VMC_INCLUDE_DIRS": "@Geant4VMC_INCLUDE_DIRS@", + "Geant4VMC_LIBRARY_DIR": "@Geant4VMC_LIBRARY_DIR@", + "Geant4VMC_MACRO_DIR": "@Geant4VMC_MACRO_DIR@", + "PYTHIA6_LIBRARY_DIR": "@PYTHIA6_LIBRARY_DIR@", + "Geant3_INCLUDE_DIRS": "@Geant3_INCLUDE_DIRS@", + "G3SYS": "@G3SYS@", + "Geant3_LIBRARY_DIR": "@Geant3_LIBRARY_DIR@", + "USE_VGM": "1", + "PYTHIA8DATA": "@PYTHIA8DATA@", +@Geant4Data_Variables_jupy@ + "ROOT_LIBRARY_DIR": "@ROOT_LIBRARY_DIR@", + "ROOT_LIBRARIES": "@ROOT_LIBRARIES@", + "ROOT_INCLUDE_DIR": "@ROOT_INCLUDE_DIR@", + "ROOT_INCLUDE_PATH": "@Geant3_INCLUDE_DIRS@:@ROOT_INCLUDE_PATH@", + "VMCWORKDIR": "@VMCWORKDIR@", + "FAIRLIBDIR": "@FAIRLIBDIR@", + "PYTHONPATH": "@MY_PYTHONPATH@", + "DYLD_LIBRARY_PATH": "@MY_DYLD_LIBRARY_PATH@:$DYLD_LIBRARY_PATH", + "LD_LIBRARY_PATH": "@MY_LD_LIBRARY_PATH@:$LD_LIBRARY_PATH", + "PATH": "@MY_PATH@:$PATH" + } +} diff --git a/cmake/scripts/jupyter/logo-64x64.png b/cmake/scripts/jupyter/logo-64x64.png new file mode 100644 index 0000000000000000000000000000000000000000..81177c9aeaff3afbbcc91c098703ef56adb9a0d3 Binary files /dev/null and b/cmake/scripts/jupyter/logo-64x64.png differ diff --git a/docs/jupyter/Jupyter.rst b/docs/jupyter/Jupyter.rst new file mode 100644 index 0000000000000000000000000000000000000000..cd5e045e76ece20c92d1ab675fd5b441f0be57ee --- /dev/null +++ b/docs/jupyter/Jupyter.rst @@ -0,0 +1,42 @@ +Jupyter Notebooks +================= + +Jupyter Notebooks offer a large quality of life and are becoming more important with machine learning etc. Natively PandaRoot is a collection of C++ libraries which usually are collected and called through ROOT, mostly by macros. + +ROOT by itself features python bindings as well as an own C++ Kernel. With the ``%%cpp`` magic it is also possible to mix C++ code into python code. See the introduction to PyROOT_. + +.. _PyROOT: https://root.cern.ch/notebooks/HowTos/HowTo_ROOT-Notebooks.html + +Using the Kernels without installation +###################################### + +It it is enough to do the following:: + + source <build>/config.sh -p + export JUPYTER_CONFIG_DIR=$SIMPATH/etc/root/notebook + export JUPYTER_PATH=$SIMPATH/etc/root/notebook + jupyter notebook + +You now can use ROOT and CbmRoot classes in the Python3 kernel or the RootC++ kernel. Here are two example notebooks to start off with. + +Examples +######## + +- <source>/docs/jupyter/notebooks/CbmRoot.ipynb + +Install the Kernel +################## + +In some cases it is beneficial to install the Kernel to automatically be used in the system. A simple 'jupyter notebook' command in a fresh shell would allow them to be used. Also VSCode with the jupyter extension would be able to spawn such notebooks inside the integrated environment. + +The downside is that the Kernels are pointing to one specific installation of CbmRoot and its dependencies and managing multiple installations may become cumbersome. + +As a prerequisit one has to install the metakernel package in python (``pip3 install metakernel``). +To install the Kernels simply copy the folders from ``<build>/jupyter/kernels`` to the appropriate place: + +- ``~/.local/share/jupyter/kernels`` (Linux) +- ``~/Library/Jupyter/kernels`` (Mac) +- ``%APPDATA%\jupyter\kernels`` (Win) + + + diff --git a/docs/jupyter/notebooks/CbmRoot.ipynb b/docs/jupyter/notebooks/CbmRoot.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..693fbb6dcce15d902c58ef2cefa094606068260c --- /dev/null +++ b/docs/jupyter/notebooks/CbmRoot.ipynb @@ -0,0 +1,797 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "2126cfd4", + "metadata": {}, + "source": [ + "# CbmRoot Notebook\n", + "\n", + "This notebook provides code snippets how one can run simulations & analysis in a notebook, employing the CbmRoot classes." + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "3bdfe179", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Welcome to JupyROOT 6.26/10\n" + ] + } + ], + "source": [ + "# When using the CbmRootPy kernel, this also loads CbmRoot classes\n", + "import ROOT\n", + "ROOT.gROOT.SetBatch(True)\n", + "ROOT.PyConfig.DisableRootLogon = True\n", + "\n", + "import os\n" + ] + }, + { + "cell_type": "markdown", + "id": "eb5ea347", + "metadata": {}, + "source": [ + "## The transport macro\n", + "\n", + "Here we have the macro from `macro/run` just with python syntax. Note that all CBM related classes are available in the `ROOT` package/namespace.\n", + "\n", + "First we define tha macro as function, then we call it in the next cell." + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "4a329503", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "-I- CbmJupyTransport: Using input file /u/kliemt/CBM/CbmRoot/Install/share/cbmroot/input/urqmd.auau.10gev.centr.root\n", + "The file test.tra.root has been deleted.\n", + "The file test.par.root has been deleted.\n", + "The file test.geo.root has been deleted.\n", + "Target is at -44.0cm from origin\n", + "Creating a RUN object\n", + "Loading the setup\n", + "Target being generated in tra macro\n", + "Starting the RUN with 1 events\n", + "Macro finished successfully.\n", + "Real time 13.448765993118286 s, CPU time 13.010000000000002s\n", + "MaxMemory 861.9609375\n", + "CpuLoad0.9673749998072091\n", + "[INFO] File /u/kliemt/CBM/CbmRoot/Install/share/cbmroot/input/urqmd.auau.10gev.centr.root is a ROOT file.\n", + "[INFO] UnigenGenerator: Initialising...\n", + "[INFO] UnigenGenerator: Mode standard; rotate event plane to zero\n", + "[INFO] UnigenGenerator: Open input file /u/kliemt/CBM/CbmRoot/Install/share/cbmroot/input/urqmd.auau.10gev.centr.root\n", + "[INFO] UnigenGenerator: Run description\n", + "--------------------------------------------------\n", + "-I- Run Header -I-\n", + "Generator : UrQMD20030\n", + "Comment : op 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 \n", + "op 0 0 0 0 0 0 1 0 1 0 0 0 0 2 1 \n", + "op 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 \n", + "pa 0.1000E+01 0.5200E+00 0.2000E+01 0.3000E+00 0.0000E+00 0.3700E+00 0.0000E+00 0.9300E-01 0.3500E+00 0.2500E+00 0.0000E+00 0.5000E+00 \n", + "pa 0.2700E+00 0.4900E+00 0.2700E+00 0.1000E+01 0.1600E+01 0.8500E+00 0.1550E+01 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 0.0000E+00 \n", + "pa 0.9000E+00 0.5000E+02 0.1000E+01 0.1000E+01 0.1000E+01 0.1500E+01 0.1600E+01 0.0000E+00 0.2500E+01 0.1000E+00 0.3000E+01 0.2750E+00 \n", + "pa 0.4200E+00 0.1080E+01 0.8000E+00 0.5000E+00 0.0000E+00 0.5500E+00 0.5000E+01 0.8000E+00 0.5000E+00 0.8000E+06 0.1000E+01 0.2000E+01 \n", + "\n", + "Decayer : \n", + "Projectile mass : 197\n", + "Projectile charge : 79\n", + "Projectile momentum (AGeV/c) : 2.06646\n", + "Target mass : 197\n", + "Target charge : 79\n", + "Target momentum (AGeV/c) : -2.06646\n", + "Minimal impact parameter (fm) : 0\n", + "Maximal impact parameter (fm) : 0\n", + "Impact parameter weightning : -1\n", + "Minimal azimuthal angle (rad) : 0\n", + "Maximal azimuthal angle (rad) : 0\n", + "Cross-section (mb) : 0\n", + "Requested number of events : 100\n", + "--------------------------------------------------\n", + "[INFO] UnigenGenerator: sqrt(s_NN) = 4.539 GeV, p_beam = 9.99676 GeV/u\n", + "[INFO] UnigenGenerator: Lorentz transformation to lab system: beta -0.910537, gamma 2.41881\n", + "[INFO] UnigenGenerator: 100 events in input tree\n", + "[INFO] UnigenGenerator: 0 ions registered.\n", + "[INFO] Loading CbmGeoSetup from svn repository.\n", + "Setup tag: sis100_electron Revision: latest\n", + "[WARN] Media file not found for tag using default media.geo\n", + "\n", + "\n", + "[INFO] CbmTransport: Using engine TGeant3\n", + "[INFO] Media file used: /u/kliemt/CBM/CbmRoot/Install/share/cbmroot/geometry/media.geo\n", + "[INFO] -I- RegisterSetup: Registering CAVE default using cave.geo\n", + "[INFO] -I- RegisterSetup: Registering MAGNET v22a using magnet/magnet_v22a.geo.root\n", + "[INFO] -I- RegisterSetup: Registering PIPE v21d using pipe/pipe_v21d.geo.root\n", + "[INFO] -I- RegisterSetup: Registering PIPE v21i using pipe/pipe_v21i.geo.root\n", + "[INFO] -I- RegisterSetup: Registering MVD v20d_tr -ACTIVE- using mvd/mvd_v20d_tr.geo.root\n", + "[INFO] -I- RegisterSetup: Registering STS v22d -ACTIVE- using sts/sts_v22d.geo.root\n", + "[INFO] -I- RegisterSetup: Registering RICH v23a -ACTIVE- using rich/rich_v23a.geo.root\n", + "[INFO] -I- RegisterSetup: Registering TRD v20b_1e -ACTIVE- using trd/trd_v20b_1e.geo.root\n", + "[INFO] -I- RegisterSetup: Registering TOF v21a_1e -ACTIVE- using tof/tof_v21a_1e.geo.root\n", + "[INFO] -I- RegisterSetup: Registering PSD v23a -ACTIVE- using psd/psd_v23a.geo.root\n", + "[INFO] -I- RegisterSetup: Registering FSD v23i -ACTIVE- using fsd/fsd_v23i.geo.root\n", + "[INFO] -I- RegisterSetup: Registering PLATFORM v22b using passive/platform_v22b.geo.root\n", + "[INFO] Target: Material Gold, standard density, thickness 250 mum, diameter 2.5 cm, position (0, 0, -44) cm, rotation (y) 0 rad\n", + "[INFO] CbmTransport: Register magnetic field\n", + "[INFO] 0\n", + "[INFO] Filename is /u/kliemt/CBM/CbmRoot/Install/share/cbmroot/input/field_v22c.root\n", + "======================================================\n", + "---- CbmFieldMap : field_v22c\n", + "----\n", + "---- Field type : Map sym3\n", + "----\n", + "---- Field map grid : \n", + "---- x = 0.000 to 0.000 cm, 0 grid points, dx = 0.000 cm\n", + "---- y = 0.000 to 0.000 cm, 0 grid points, dy = 0.000 cm\n", + "---- z = 0.000 to 0.000 cm, 0 grid points, dz = 0.000 cm\n", + "\n", + "---- Field centre position: ( 0.000, 0.000, 0.000) cm\n", + "---- Field scaling factor: 1.000\n", + "----\n", + "---- Field at origin is ( 0.000, 0.000, 0.000) kG\n", + "======================================================\n", + "\n", + "[INFO] ----- Settings for event generator\n", + "[INFO] Beam profile:\n", + "\t x position mean 0 cm, sigma 0.1 cm\n", + "\t y position mean 0 cm, sigma 0.1 cm\n", + "\t Focal plane: z = 0 cm\n", + "\t x-z angle 0 rad (fixed)\n", + "\t y-z angle 0 rad (fixed)\n", + "[INFO] Target: Material Gold, standard density, thickness 250 mum, diameter 2.5 cm, position (0, 0, -44) cm, rotation (y) 0 rad\n", + "[INFO] Vertex smearing along beam ON\n", + "[INFO] Random event plane angle between 0 and 6.28319 rad\n", + "[INFO] Number of generators 1\n", + "OBJ: CbmUnigenGenerator\tUnigenGenerator\tCBM generator\n", + "[INFO] ----- End settings for event generator\n", + "\n", + "[INFO] FairRootFileSink initialized.\n", + "[INFO] - cbmroot_0\n", + "[INFO] - test.tra.root\n", + "[INFO] ============== FairRunSim: Initialising simulation run ==============\n", + "[INFO] FairGeoMedia: Read media \n", + "\n", + "************************************************************* \n", + " initialisation for run id 1720175896\n", + "************************************************************* \n", + "[INFO] CbmFieldMap: Reading field map from ROOT file /u/kliemt/CBM/CbmRoot/Install/share/cbmroot/input/field_v22c.root\n", + "======================================================\n", + "---- CbmFieldMap : field_v22c\n", + "----\n", + "---- Field type : Map sym3\n", + "----\n", + "---- Field map grid : \n", + "---- x = 0.000 to 302.0 cm, 152 grid points, dx = 2.000 cm\n", + "---- y = 0.000 to 302.0 cm, 152 grid points, dy = 2.000 cm\n", + "---- z = 0.000 to 502.0 cm, 252 grid points, dz = 2.000 cm\n", + "\n", + "---- Field centre position: ( 0.000, 0.000, 0.000) cm\n", + "---- Field scaling factor: 1.000\n", + "----\n", + "---- Field at origin is ( 0.004120, -10.95, -0.005054) kG\n", + "======================================================\n", + "[WARN] FairField::FillParContainer Should be implemented in User class\n", + "\n", + "[INFO] CbmTransport: Configuring VMC...\n", + "[INFO] CbmTransport: Create TGeant3TGeo\n", + "\n", + "=============================================================\n", + " Virtual Monte Carlo Library\n", + " Version 2.0 ( 10 February 2022 )\n", + "=============================================================\n", + "\n", + "=============================================================\n", + " Geant3 Virtual Monte Carlo \n", + " Version 4.1 ( 17 March 2022 )\n", + " WWW : https://vmc-project.github.io/\n", + "=============================================================\n", + "\n", + "\n", + " MZSTOR. ZEBRA table base TAB(0) in /MZCC/ at adr 123850191 761CDCF HEX\n", + "\n", + " MZSTOR. Initialize Store 0 in /GCBANK/\n", + " with Store/Table at absolute adrs 118404533 123850191\n", + " HEX 70EB5B5 761CDCF\n", + " HEX FFACE5D2 0\n", + " relative adrs -5446190 0\n", + " with 1 Str. in 2 Links in 5300 Low words in 4999970 words.\n", + " This store has a fence of 16 words.\n", + "\n", + " MZLOGL. Set Log Level 0 for store 0\n", + "1***** GEANT Version 3.21/11 Released on 100298\n", + "0***** Correction Cradle Version 0.1100\n", + "\n", + " MZDIV. Initialize Division Constant in Store 0\n", + " NW/NWMAX= 20004000000, MODE/KIND= 1 2\n", + " Division 20 initialized.\n", + "\n", + " MZLINK. Initialize Link Area /GCLINK/ for Store 0 NL/NS= 20 20\n", + "\n", + " MZLINK. Initialize Link Area /GCSLNK/ for Store 0 NL/NS= 100 100\n", + "[INFO] : Configuring global VMC settings\n", + "[INFO] : Configuring Geant3\n", + "[WARN] UnigenGenerator: Already initialised!\n", + "[INFO] Constructing MAGNET from ROOT file /u/kliemt/CBM/CbmRoot/Install/share/cbmroot/geometry/magnet/magnet_v22a.geo.root\n", + "[INFO] Constructing Pipe geometry from ROOT file /u/kliemt/CBM/CbmRoot/Install/share/cbmroot/geometry/pipe/pipe_v21d.geo.root\n", + "[INFO] Importing Pipe geometry from ROOT file /u/kliemt/CBM/CbmRoot/Install/share/cbmroot/geometry/pipe/pipe_v21i.geo.root\n", + "[INFO] Constructing MVD geometry from ROOT file /u/kliemt/CBM/CbmRoot/Install/share/cbmroot/geometry/mvd/mvd_v20d_tr.geo.root\n", + "[INFO] Importing STS geometry from ROOT file /u/kliemt/CBM/CbmRoot/Install/share/cbmroot/geometry/sts/sts_v22d.geo.root\n", + "[INFO] Importing RICH geometry from ROOT file /u/kliemt/CBM/CbmRoot/Install/share/cbmroot/geometry/rich/rich_v23a.geo.root\n", + "[INFO] Importing TRD geometry from ROOT file /u/kliemt/CBM/CbmRoot/Install/share/cbmroot/geometry/trd/trd_v20b_1e.geo.root\n", + "[INFO] Importing TOF geometry from ROOT file /u/kliemt/CBM/CbmRoot/Install/share/cbmroot/geometry/tof/tof_v21a_1e.geo.root\n", + "[INFO] Importing PSD geometry from ROOT file /u/kliemt/CBM/CbmRoot/Install/share/cbmroot/geometry/psd/psd_v23a.geo.root\n", + "[INFO] Importing FSD geometry from ROOT file /u/kliemt/CBM/CbmRoot/Install/share/cbmroot/geometry/fsd/fsd_v23i.geo.root\n", + "[INFO] Importing Platform geometry from ROOT file /u/kliemt/CBM/CbmRoot/Install/share/cbmroot/geometry/passive/platform_v22b.geo.root\n", + "\n", + "[INFO] Target: Constructing geometry...\n", + "[INFO] Target: Use material Gold, z = 79\n", + "[INFO] Target: Mother node is pipevac1_0\n", + "\n", + "[INFO] TGeometry will be imported to VMC\n", + "\n", + "0*** GSTMED *** Warning, medium = 2, value of EPSIL= 0.000E+00 reset to 1 micron\n", + "0*** GSTMED *** Warning, medium = 8, value of EPSIL= 0.000E+00 reset to 1 micron\n", + "0*** GSTMED *** Warning, medium = 9, value of EPSIL= 0.000E+00 reset to 1 micron\n", + "0*** GSTMED *** Warning, medium = 10, value of EPSIL= 0.000E+00 reset to 1 micron\n", + "0*** GSTMED *** Warning, medium = 11, value of EPSIL= 0.000E+00 reset to 1 micron\n", + "[INFO] CbmRich::ConstructOpGeometry()\n", + "[INFO] CbmRich::SetRichGlassPropertiesForGeant4() Transport engine:TGeant3\n", + "[INFO] CbmRich::SetRichGlassPropertiesForGeant4() fIsGeant4 is false. No need to set RICH glass properties. Return.\n", + "[INFO] FairMCApplication::InitGeometry: 0\n", + "[INFO] \n", + "[INFO] ==========================================================\n", + "[INFO] Initialising STS Setup \n", + "\n", + "[INFO] STS: Reading geometry from TGeoManager FAIRGeom\n", + "[INFO] STS: STS top node is sts_v22d_0\n", + "[INFO] STS: Elements in setup: \n", + "[INFO] units 20\n", + "[INFO] ladders 106\n", + "[INFO] halfladders 212\n", + "[INFO] modules 876\n", + "[INFO] sensors 876\n", + "[INFO] Sensor in map: 876 in vector 876\n", + "[INFO] STS: Setup contains 8 stations objects.\n", + "[INFO] ==========================================================\n", + "\n", + "[INFO] \n", + "[INFO] STSMC: Address map initialised with 876 sensors. \n", + "[INFO] CbmRichDigiMapManager is initialized\n", + "[INFO] fPixelPathToAddressMap.size() = 75264\n", + "[INFO] fPixelAddressToDataMap.size() = 75264\n", + "[INFO] fPmtPathToIdMap.size() = 1176\n", + "[INFO] fPmtIdToDataMap.size() = 1176\n", + "Mixture TRDgas Aeff=124.791 Zeff=51.401 rho=0.004944 radlen=1792.89 intlen=33993.1 index=243500301\n", + " Element #0 : C Z= 6.00 A= 12.01 w= 0.015\n", + " Element #1 : O Z= 8.00 A= 15.99 w= 0.041\n", + " Element #2 : XE Z= 54.00 A=131.29 w= 0.944\n", + "[INFO] Using special parameters for TRDgas\n", + "[INFO] Inspect node 0 magnet_v22a_0\n", + "[INFO] Inspect node 1 pipe_v21d_0\n", + "[INFO] Inspect node 2 pipe_v21i_0\n", + "[INFO] Inspect node 3 sts_v22d_0\n", + "[INFO] Inspect node 4 rich_v23a_0\n", + "[INFO] Inspect node 5 trd_v20b_1e_0\n", + "[INFO] Inspect node 6 tof_v21a_1e_0\n", + "[INFO] Found TOF geometry tof_v21a_1e_0\n", + "[INFO] CbmTofGeoHandler::CheckGeometryVersion: Found TOF geometry tof_v21a_1e_0, treat as Id 21a \n", + "<I> V21a module mask 0x0fdfffff\n", + "[INFO] Initialize Tasks--------------------------\n", + "[INFO] MCEventFilter: Add branch MCTrack\n", + "[INFO] MCEventFilter: Add branch MvdPoint\n", + "[INFO] MCEventFilter: Add branch StsPoint\n", + "[INFO] MCEventFilter: Add branch RichPoint\n", + "[INFO] Branch: MuchPoint not found in Tree.\n", + "[INFO] MCEventFilter: Add branch TrdPoint\n", + "[INFO] MCEventFilter: Add branch TofPoint\n", + "[INFO] MCEventFilter: Add branch FsdPoint\n", + "[INFO] MCEventFilter: Add branch PsdPoint\n", + "[INFO] Simulation RunID: 1720175896\n", + "\n", + " Calculating cross section tables, see gphysi.dat for more information\n", + "\n", + " Cross section calculation concluded successfully\n", + "[INFO] Monte Carlo Engine Initialisation with: TGeant3TGeo\n", + "[INFO] CbmTransport: Set decay modes for pi0 and eta\n", + "\n", + " *** GSDK ***: Warning, redefinition of decay for particle:\n", + "0Part Options Mass Charge Life time User words\n", + "\n", + " 17 ETA 3 0.5479E+00 0. 0.54850E-18\n", + "\n", + " *** GSDK ***: Warning, redefinition of decay for particle:\n", + "0Part Options Mass Charge Life time User words\n", + "\n", + " 7 PION 0 3 0.1350E+00 0. 0.84000E-16\n", + "[INFO] create CbmFieldPar container CbmFieldPar\n", + "[INFO] *** FairBaseParSet written to ROOT file version: 1\n", + "[INFO] *** FairGeoParSet written to ROOT file version: 1\n", + "[INFO] *** CbmGeoPassivePar written to ROOT file version: 1\n", + "[INFO] *** CbmFieldPar written to ROOT file version: 1\n", + "--------------------------------------------------------------------------------\n", + "-------------- actual containers in runtime database -------------------------\n", + "FairBaseParSet class for parameter io\n", + "FairGeoParSet class for Geo parameter\n", + "CbmGeoPassivePar Passive Geometry Parameters\n", + "CbmFieldPar Field parameter container\n", + "-------------- runs, versions ------------------------------------------------\n", + "run id\n", + " container 1st-inp 2nd-inp output\n", + "run: 1720175896\n", + " FairBaseParSet 1720175896 -1 1\n", + " FairGeoParSet 1720175896 -1 1\n", + " CbmGeoPassivePar 1720175896 -1 1\n", + " CbmFieldPar -1 -1 1\n", + "-------------- input/output --------------------------------------------------\n", + "first input: none\n", + "second input: none\n", + "output:\n", + "OBJ: FairParRootFile\ttest.par.root\t : 0 at: 0x137274f0\n", + "Root file I/O test.par.root is open\n", + "detector I/Os: FairGenericParIo\n", + "[INFO] Here I am\n", + "[INFO] Write Geant3Settings\n", + " **** GTRIGI: IEVENT= 1 IDEVT= 1 Random Seeds = ********** 0\n", + "\n", + "[INFO] EventGenerator: Generate event 1\n", + "[INFO] EventGenerator: Rotate event by 5.1107 rad\n", + "[INFO] UnigenGenerator: Event ID 1, particles 963, primaries 963, b = 0 fm, phi (source) = 0 rad , phi (generated) = -0 rad\n", + "[INFO] EventGenerator: Event ID 1, tracks 963, vertex (0.00183597, -0.272284, -44.0027) cm\n", + "[INFO] EventGenerator: Beam angle (0, 0) rad, event plane angle 5.1107 rad (total 5.1107 rad) change\n", + "[INFO] CbmFsdGeoHandler has initialized maps\n", + "[INFO] fUnitIdToSpecsMap.size() = 1\n", + "[INFO] fModuleIdToSpecsMap.size() = 372\n", + "\n", + " *** GTRACK *** More than 10000 steps, tracking abandoned!\n", + " =====> TRACK 1 STACK NR 1 NTMULT= 6622 Cerenkov TOFG = 8.002 NS\n", + " X Y Z R NAME NUMBER SLENG STEP DESTEP GEKIN MECHANISMS\n", + " -8.0599 5.8851 195.6469 9.9798 rich 1 7.9893 0.0003 0.0 eV 6.272 eV NEXT SCOR STOP\n", + " IEVENT 1 IDEVT 1 Random Seeds ********** 0 Time of flight 8.002 ns\n", + "\n", + "\n", + " *** GTRACK *** More than 10000 steps, tracking abandoned!\n", + " =====> TRACK 1 STACK NR 1 NTMULT= 6646 Cerenkov TOFG = 7.613 NS\n", + " X Y Z R NAME NUMBER SLENG STEP DESTEP GEKIN MECHANISMS\n", + " -7.6363 5.5571 184.0066 9.4443 rich 1 7.3858 0.0003 0.0 eV 4.169 eV NEXT SCOR STOP\n", + " IEVENT 1 IDEVT 1 Random Seeds ********** 0 Time of flight 7.613 ns\n", + "\n", + "\n", + " *** GTRACK *** More than 10000 steps, tracking abandoned!\n", + " =====> TRACK 1 STACK NR 1 NTMULT= 6700 Cerenkov TOFG = 6.891 NS\n", + " X Y Z R NAME NUMBER SLENG STEP DESTEP GEKIN MECHANISMS\n", + " -6.7460 5.0904 162.4149 8.4511 rich 1 5.2554 0.0002 0.0 eV 6.509 eV NEXT SCOR STOP\n", + " IEVENT 1 IDEVT 1 Random Seeds ********** 0 Time of flight 6.891 ns\n", + "\n", + " GTREVE_ROOT : Transporting primary track No 900\n", + " GTREVE_ROOT : Transporting primary track No 800\n", + " GTREVE_ROOT : Transporting primary track No 700\n", + " GTREVE_ROOT : Transporting primary track No 600\n", + " GTREVE_ROOT : Transporting primary track No 500\n", + " GTREVE_ROOT : Transporting primary track No 400\n", + " GTREVE_ROOT : Transporting primary track No 300\n", + " GTREVE_ROOT : Transporting primary track No 200\n", + " GTREVE_ROOT : Transporting primary track No 100\n", + "[INFO] CbmStack: 129478 particles, 14205 written to output.\n", + "[INFO] MCEventFilter: MCTracks 14205, Points: MVD 1583 STS 3722 RICH 6609 TRD 1883 TOF 8246 FSD 397 PSD 2829 \n", + "[INFO] MCEventFilter: Current event 1 selected for output\n", + "[INFO] MVD: 1583 points registered in this event.\n", + "[INFO] STSMC: 3722 points registered in this event.\n", + "[INFO] RICH: 6609 points registered in this event.\n", + "[INFO] TRD: 1883 points registered in this event.\n", + "[INFO] TOF: 8246 points registered in this event.\n", + "[INFO] PSDMC: 2829 points registered in this event.\n", + "[INFO] FSDMC: 397 points registered in this event.\n", + "\n", + "[INFO] MCEventFilter: Number of input events 1\n", + "[INFO] MCEventFilter: Number of output events 1 = 100 %\n", + "\n", + "\n", + "[INFO] CbmTransport: Run finished successfully.\n", + "[INFO] CbmTransport: Wall time for Init : 2.15356 s \n", + "[INFO] CbmTransport: Wall time for Run : 6.61636 s (6.61636 s / event)\n", + "[INFO] CbmTransport: Output file : test.tra.root\n", + "[INFO] CbmTransport: Parameter file : test.par.root\n", + "[INFO] CbmTransport: Geometry file : test.geo.root\n", + "\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Info in <TGeoManager::TGeoManager>: Geometry FAIRGeom, FAIR geometry created\n", + "Info in <TGeoManager::SetTopVolume>: Top volume is cave. Master volume is cave\n", + "Info in <TGeoNavigator::BuildCache>: --- Maximum geometry depth set to 100\n", + "Warning in <TGeoMaterial::ctor>: Material MAG_Vacuum defined with fractional Z=0.500000\n", + "Info in <TGeoManager::CheckGeometry>: Fixing runtime shapes...\n", + "Info in <TGeoManager::CheckGeometry>: ...Nothing to fix\n", + "Info in <TGeoManager::CloseGeometry>: Counting nodes...\n", + "Info in <TGeoManager::Voxelize>: Voxelizing...\n", + "Info in <TGeoManager::CloseGeometry>: Building cache...\n", + "Info in <TGeoManager::CountLevels>: max level = 10, max placements = 372\n", + "Info in <TGeoManager::CloseGeometry>: 577444 nodes/ 1092 volume UID's in FAIR geometry\n", + "Info in <TGeoManager::CloseGeometry>: ----------------modeler ready----------------\n", + "Error in <TExMap::Remove>: key 166863080 not found at 3052\n", + "Error in <TExMap::Remove>: key 166863280 not found at 3252\n", + "Error in <TExMap::Remove>: key 166863472 not found at 3446\n", + "Error in <TExMap::Remove>: key 166863664 not found at 3640\n", + "Error in <TExMap::Remove>: key 166863856 not found at 3834\n", + "Error in <TExMap::Remove>: key 166864048 not found at 4021\n", + "Error in <TExMap::Remove>: key 166864240 not found at 4213\n", + "Error in <TExMap::Remove>: key 166864432 not found at 4404\n", + "Error in <TExMap::Remove>: key 166864624 not found at 4597\n", + "Error in <TExMap::Remove>: key 166864816 not found at 4788\n", + "Error in <TExMap::Remove>: key 166865008 not found at 4980\n", + "Error in <TExMap::Remove>: key 166865200 not found at 5173\n", + "Error in <TExMap::Remove>: key 166865352 not found at 5325\n", + "Error in <TExMap::Remove>: key 166865552 not found at 53\n", + "Error in <TExMap::Remove>: key 166865744 not found at 245\n", + "Error in <TExMap::Remove>: key 166865936 not found at 438\n", + "Error in <TExMap::Remove>: key 166866128 not found at 630\n", + "Error in <TExMap::Remove>: key 166866320 not found at 821\n", + "Error in <TExMap::Remove>: key 166866512 not found at 1014\n", + "Error in <TExMap::Remove>: key 166866704 not found at 1205\n", + "Error in <TExMap::Remove>: key 166866896 not found at 1397\n", + "Error in <TExMap::Remove>: key 166867088 not found at 1589\n", + "Error in <TExMap::Remove>: key 166867352 not found at 1853\n", + "Error in <TExMap::Remove>: key 166870864 not found at 5365\n", + "Error in <TExMap::Remove>: key 166871016 not found at 46\n", + "Error in <TExMap::Remove>: key 166873936 not found at 2966\n", + "Error in <TExMap::Remove>: key 166874024 not found at 3054\n", + "Error in <TExMap::Remove>: key 166874112 not found at 3142\n", + "Error in <TExMap::Remove>: key 166874200 not found at 3230\n", + "Error in <TExMap::Remove>: key 166874720 not found at 3750\n", + "Error in <TExMap::Remove>: key 166874808 not found at 3838\n", + "Error in <TExMap::Remove>: key 166874896 not found at 3926\n", + "Error in <TExMap::Remove>: key 166874984 not found at 4014\n", + "Error in <TExMap::Remove>: key 166875072 not found at 4104\n", + "Error in <TExMap::Remove>: key 166875592 not found at 4622\n", + "Error in <TExMap::Remove>: key 166875680 not found at 4711\n", + "Error in <TExMap::Remove>: key 166875768 not found at 4798\n", + "Error in <TExMap::Remove>: key 166875856 not found at 4886\n", + "Error in <TExMap::Remove>: key 166875944 not found at 4975\n", + "Error in <TExMap::Remove>: key 166876032 not found at 5062\n", + "Error in <TExMap::Remove>: key 166876552 not found at 111\n", + "Error in <TExMap::Remove>: key 166876640 not found at 200\n", + "Error in <TExMap::Remove>: key 166876728 not found at 287\n", + "Error in <TExMap::Remove>: key 166876816 not found at 376\n", + "Error in <TExMap::Remove>: key 166876904 not found at 463\n", + "Error in <TExMap::Remove>: key 166876992 not found at 552\n", + "Error in <TExMap::Remove>: key 166877512 not found at 1074\n", + "Error in <TExMap::Remove>: key 166877600 not found at 1161\n", + "Error in <TExMap::Remove>: key 166877688 not found at 1247\n", + "Error in <TExMap::Remove>: key 166877776 not found at 1336\n", + "Error in <TExMap::Remove>: key 166877864 not found at 1424\n", + "Error in <TExMap::Remove>: key 166878384 not found at 1943\n", + "Error in <TExMap::Remove>: key 166878472 not found at 2031\n", + "Error in <TExMap::Remove>: key 166878560 not found at 2119\n", + "Error in <TExMap::Remove>: key 166878648 not found at 2207\n", + "Error in <TExMap::Remove>: key 166878736 not found at 2295\n", + "Error in <TExMap::Remove>: key 166878824 not found at 2383\n", + "Error in <TExMap::Remove>: key 166878912 not found at 2472\n", + "Error in <TExMap::Remove>: key 166879432 not found at 2992\n", + "Error in <TExMap::Remove>: key 166879520 not found at 3079\n", + "Error in <TExMap::Remove>: key 166879608 not found at 3168\n", + "Error in <TExMap::Remove>: key 166880128 not found at 3687\n", + "Error in <TExMap::Remove>: key 166880216 not found at 3776\n", + "Error in <TExMap::Remove>: key 166880304 not found at 3863\n", + "Error in <TExMap::Remove>: key 166880392 not found at 3951\n", + "Error in <TExMap::Remove>: key 166880912 not found at 4471\n", + "Error in <TExMap::Remove>: key 166881000 not found at 4559\n", + "Error in <TExMap::Remove>: key 166881088 not found at 4647\n", + "Error in <TExMap::Remove>: key 166881240 not found at 4799\n", + "Error in <TExMap::Remove>: key 166882440 not found at 528\n", + "Error in <TExMap::Remove>: key 166882528 not found at 616\n", + "Error in <TExMap::Remove>: key 166882616 not found at 705\n", + "Error in <TExMap::Remove>: key 173113976 not found at 596\n", + "Error in <TExMap::Remove>: key 173114064 not found at 683\n", + "Error in <TExMap::Remove>: key 243369256 not found at 2764\n", + "Error in <TExMap::Remove>: key 243369408 not found at 2917\n", + "Error in <TExMap::Remove>: key 243369560 not found at 3068\n", + "Error in <TExMap::Remove>: key 243369712 not found at 3222\n", + "Error in <TExMap::Remove>: key 243369864 not found at 3372\n", + "Error in <TExMap::Remove>: key 245541160 not found at 2682\n", + "Error in <TExMap::Remove>: key 245541360 not found at 2881\n", + "Error in <TExMap::Remove>: key 245541552 not found at 3074\n", + "Error in <TExMap::Remove>: key 245541744 not found at 3265\n", + "Error in <TExMap::Remove>: key 245541936 not found at 3461\n", + "Error in <TExMap::Remove>: key 245542128 not found at 3649\n", + "Error in <TExMap::Remove>: key 245542320 not found at 3842\n", + "Error in <TExMap::Remove>: key 245542512 not found at 4033\n", + "Error in <TExMap::Remove>: key 245542704 not found at 4226\n", + "Error in <TExMap::Remove>: key 245542896 not found at 4417\n", + "Error in <TExMap::Remove>: key 245543088 not found at 4609\n", + "Error in <TExMap::Remove>: key 245543280 not found at 4801\n", + "Error in <TExMap::Remove>: key 245543472 not found at 4993\n", + "Error in <TExMap::Remove>: key 245543664 not found at 5185\n", + "Error in <TExMap::Remove>: key 245543856 not found at 5377\n", + "Error in <TExMap::Remove>: key 245544048 not found at 99\n", + "Error in <TExMap::Remove>: key 245544240 not found at 290\n", + "Error in <TExMap::Remove>: key 245544432 not found at 486\n", + "Error in <TExMap::Remove>: key 245544624 not found at 674\n", + "Error in <TExMap::Remove>: key 245544816 not found at 866\n", + "Error in <TExMap::Remove>: key 245545008 not found at 1058\n", + "Error in <TExMap::Remove>: key 245545200 not found at 1250\n", + "Error in <TExMap::Remove>: key 245545392 not found at 1442\n", + "Error in <TExMap::Remove>: key 245545584 not found at 1635\n", + "Error in <TExMap::Remove>: key 245545776 not found at 1826\n", + "Error in <TExMap::Remove>: key 245545968 not found at 2018\n", + "Error in <TExMap::Remove>: key 245546160 not found at 2214\n", + "Error in <TExMap::Remove>: key 245546352 not found at 2402\n", + "Error in <TExMap::Remove>: key 245546544 not found at 2596\n", + "Error in <TExMap::Remove>: key 245546736 not found at 2786\n", + "Error in <TExMap::Remove>: key 245546928 not found at 2978\n", + "Error in <TExMap::Remove>: key 245547120 not found at 3170\n", + "Error in <TExMap::Remove>: key 245547312 not found at 3362\n", + "Error in <TExMap::Remove>: key 245547504 not found at 3554\n", + "Error in <TExMap::Remove>: key 245547696 not found at 3750\n", + "Error in <TExMap::Remove>: key 245547888 not found at 3940\n", + "Error in <TExMap::Remove>: key 245548080 not found at 4130\n", + "Error in <TExMap::Remove>: key 245548272 not found at 4323\n", + "Error in <TExMap::Remove>: key 245548464 not found at 4514\n", + "Error in <TExMap::Remove>: key 245548656 not found at 4708\n", + "Error in <TExMap::Remove>: key 245548848 not found at 4898\n", + "Error in <TExMap::Remove>: key 245549040 not found at 5090\n", + "Error in <TExMap::Remove>: key 245549232 not found at 5282\n", + "Error in <TExMap::Remove>: key 245549424 not found at 3\n", + "Error in <TExMap::Remove>: key 245549664 not found at 243\n", + "Error in <TExMap::Remove>: key 245549856 not found at 438\n", + "Error in <TExMap::Remove>: key 245550048 not found at 627\n", + "Error in <TExMap::Remove>: key 245550240 not found at 821\n", + "Error in <TExMap::Remove>: key 245550432 not found at 1014\n", + "Error in <TExMap::Remove>: key 245550672 not found at 1252\n", + "Error in <TExMap::Remove>: key 246287064 not found at 4532\n", + "Error in <TExMap::Remove>: key 246287200 not found at 4668\n", + "Error in <TExMap::Remove>: key 246287328 not found at 4793\n", + "Error in <TExMap::Remove>: key 246287456 not found at 4921\n", + "Error in <TExMap::Remove>: key 246287584 not found at 5049\n", + "Error in <TExMap::Remove>: key 246287712 not found at 5177\n", + "Error in <TExMap::Remove>: key 246287840 not found at 5306\n", + "Error in <TExMap::Remove>: key 246287968 not found at 5433\n", + "Error in <TExMap::Remove>: key 246288096 not found at 90\n", + "Error in <TExMap::Remove>: key 246288272 not found at 267\n" + ] + } + ], + "source": [ + "# /* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt\n", + "# SPDX-License-Identifier: GPL-3.0-only\n", + "# Authors: Volker Friese [original file committer], Ralf Kliemt */\n", + "ROOT.gROOT.Reset()\n", + "\n", + "input = \"\"\n", + "nEvents = 1\n", + "output = \"test\" \n", + "setup = \"sis100_electron\"\n", + "randomSeed = 0\n", + "overwrite = True\n", + "\n", + "# --- Logger settings ----------------------------------------------------\n", + "ROOT.FairLogger.GetLogger().SetLogScreenLevel(\"INFO\")\n", + "ROOT.FairLogger.GetLogger().SetLogVerbosityLevel(\"LOW\")\n", + "\n", + "# ----- Environment --------------------------------------------------\n", + "myName = \"CbmJupyTransport\" # this macro's name for screen output\n", + "srcDir = ROOT.gSystem.Getenv(\"VMCWORKDIR\") # top source directory\n", + "\n", + "# ----- Input file ---------------------------------------------------\n", + "# Use default input if not specified by the user\n", + "defaultInput = srcDir + \"/input/urqmd.auau.10gev.centr.root\"\n", + "inFile = input if input != \"\" else defaultInput\n", + "print(f\"-I- {myName}: Using input file {inFile}\")\n", + "\n", + "# ----- Output files -------------------------------------------------\n", + "dataset = output\n", + "outFile = dataset + \".tra.root\"\n", + "parFile = dataset + \".par.root\"\n", + "geoFile = dataset + \".geo.root\"\n", + "if overwrite:\n", + " if os.path.exists(outFile):\n", + " os.remove(outFile)\n", + " print(f\"The file {outFile} has been deleted.\")\n", + " if os.path.exists(parFile):\n", + " os.remove(parFile)\n", + " print(f\"The file {parFile} has been deleted.\")\n", + " if os.path.exists(geoFile):\n", + " os.remove(geoFile)\n", + " print(f\"The file {geoFile} has been deleted.\")\n", + "\n", + "# ----- Target properties --------------------------------------------\n", + "targetMaterial = \"Gold\"\n", + "targetThickness = 0.025 # in cm\n", + "targetDiameter = 2.5 # in cm\n", + "targetZpos = -44.0\n", + "# The target is at -44 cm from the centre of the magnet.\n", + "print(f\"Target is at {targetZpos}cm from origin\")\n", + "\n", + "# ----- Beam properties ----------------------------------------------\n", + "beamPosX = 0.\n", + "beamPosY = 0.\n", + "beamSigmaX = 0.1 # cm\n", + "beamSigmaY = 0.1 # cm\n", + "# ----- Event plane rotation -----------------------------------------\n", + "rotateEvents = True\n", + "\n", + "# --- Transport run preparation-------------------------------------------\n", + "print(\"Creating a RUN object\")\n", + "timer = ROOT.TStopwatch()\n", + "timer.Start()\n", + "run = ROOT.CbmTransport()\n", + "engine = ROOT.kGeant3\n", + "run.SetEngine(engine)\n", + "if \"pluto\" in inFile.lower():\n", + " run.AddInput(inFile, ROOT.kPluto)\n", + "else:\n", + " run.AddInput(inFile, ROOT.kUnigen)\n", + "run.SetOutFileName(outFile, overwrite)\n", + "run.SetParFileName(parFile)\n", + "run.SetGeoFileName(geoFile)\n", + "\n", + "print(\"Loading the setup\")\n", + "run.LoadSetup(setup)\n", + "if not run.GetSetup().IsActive(ROOT.ECbmModuleId.kTarget):\n", + " print(\"Target being generated in tra macro\")\n", + " run.SetTarget(targetMaterial, targetThickness, targetDiameter, 0, 0, targetZpos)\n", + "run.SetBeamPosition(beamPosX, beamPosY, beamSigmaX, beamSigmaY)\n", + "if rotateEvents: \n", + " run.SetRandomEventPlane()\n", + "run.SetRandomSeed(randomSeed)\n", + "\n", + "# --- Transport run execution -------------------------------------------\n", + "print(f\"Starting the RUN with {nEvents} events\")\n", + "run.Run(nEvents)\n", + "\n", + "# ------------------------------------------------------------------------\n", + "# ----- Finish -------------------------------------------------------\n", + "timer.Stop()\n", + "rtime = timer.RealTime()\n", + "ctime = timer.CpuTime()\n", + "sysInfo = ROOT.FairSystemInfo()\n", + "maxMemory = sysInfo.GetMaxMemory()\n", + "cpuUsage = ctime / rtime\n", + "print(f\"Macro finished successfully.\")\n", + "print(f\"Real time {rtime} s, CPU time {ctime}s\")\n", + "print(f\"MaxMemory {maxMemory}\")\n", + "print(f\"CpuLoad{cpuUsage}\")\n", + "ROOT.gROOT.Reset()\n", + "# ------------------------------------------------------------------------\n", + "# End of macro\n" + ] + }, + { + "cell_type": "markdown", + "id": "a208d11e", + "metadata": {}, + "source": [ + "## A quick plot\n", + "\n", + "Plotting with ROOT is still working. To show a canvas use its `Draw()` function." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "ef5347b0", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "\n", + "\n", + "<div id=\"root_plot_1720175905212\"\n", + " style=\"width: 696px; height: 472px\">\n", + "</div>\n", + "<script>\n", + "\n", + "function display_root_plot_1720175905212(Core) {\n", + " let obj = Core.parse({\"_typename\":\"TCanvas\",\"fUniqueID\":0,\"fBits\":3375112,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":1,\"fFillColor\":0,\"fFillStyle\":1001,\"fLeftMargin\":0.1,\"fRightMargin\":0.1,\"fBottomMargin\":0.1,\"fTopMargin\":0.1,\"fXfile\":2,\"fYfile\":2,\"fAfile\":1,\"fXstat\":0.99,\"fYstat\":0.99,\"fAstat\":2,\"fFrameFillColor\":0,\"fFrameLineColor\":1,\"fFrameFillStyle\":1001,\"fFrameLineStyle\":1,\"fFrameLineWidth\":1,\"fFrameBorderSize\":1,\"fFrameBorderMode\":0,\"fX1\":-33.5000008568168,\"fY1\":-37.6687528065408,\"fX2\":81.5000008568168,\"fY2\":339.018752806541,\"fXtoAbsPixelk\":202.747878251383,\"fXtoPixelk\":202.747878251383,\"fXtoPixel\":6.05217382285905,\"fYtoAbsPixelk\":424.800047186661,\"fYtoPixelk\":424.800047186661,\"fYtoPixel\":-1.25302802181291,\"fUtoAbsPixelk\":5e-5,\"fUtoPixelk\":5e-5,\"fUtoPixel\":696,\"fVtoAbsPixelk\":472.00005,\"fVtoPixelk\":472,\"fVtoPixel\":-472,\"fAbsPixeltoXk\":-33.5000008568168,\"fPixeltoXk\":-33.5000008568168,\"fPixeltoX\":0.165229887519589,\"fAbsPixeltoYk\":339.018752806541,\"fPixeltoYk\":-37.6687528065408,\"fPixeltoY\":-0.798066749180257,\"fXlowNDC\":0,\"fYlowNDC\":0,\"fXUpNDC\":1,\"fYUpNDC\":1,\"fWNDC\":1,\"fHNDC\":1,\"fAbsXlowNDC\":0,\"fAbsYlowNDC\":0,\"fAbsWNDC\":1,\"fAbsHNDC\":1,\"fUxmin\":-22,\"fUymin\":0,\"fUxmax\":70,\"fUymax\":301.35,\"fTheta\":30,\"fPhi\":30,\"fAspectRatio\":0,\"fNumber\":0,\"fTickx\":0,\"fTicky\":0,\"fLogx\":0,\"fLogy\":0,\"fLogz\":0,\"fPadPaint\":0,\"fCrosshair\":0,\"fCrosshairPos\":0,\"fBorderSize\":2,\"fBorderMode\":0,\"fModified\":false,\"fGridx\":false,\"fGridy\":false,\"fAbsCoord\":false,\"fEditable\":true,\"fFixedAspectRatio\":false,\"fPrimitives\":{\"_typename\":\"TList\",\"name\":\"TList\",\"arr\":[{\"_typename\":\"TFrame\",\"fUniqueID\":0,\"fBits\":8,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":1,\"fFillColor\":0,\"fFillStyle\":1001,\"fX1\":-22,\"fY1\":0,\"fX2\":70,\"fY2\":301.35,\"fBorderSize\":1,\"fBorderMode\":0},{\"_typename\":\"TH1F\",\"fUniqueID\":0,\"fBits\":9,\"fName\":\"htemp\",\"fTitle\":\"StsPoint.fZ\",\"fLineColor\":602,\"fLineStyle\":1,\"fLineWidth\":1,\"fFillColor\":0,\"fFillStyle\":1001,\"fMarkerColor\":1,\"fMarkerStyle\":1,\"fMarkerSize\":1,\"fNcells\":102,\"fXaxis\":{\"_typename\":\"TAxis\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"xaxis\",\"fTitle\":\"StsPoint.fZ\",\"fNdivisions\":510,\"fAxisColor\":1,\"fLabelColor\":1,\"fLabelFont\":42,\"fLabelOffset\":0.005,\"fLabelSize\":0.035,\"fTickLength\":0.03,\"fTitleOffset\":1,\"fTitleSize\":0.035,\"fTitleColor\":1,\"fTitleFont\":42,\"fNbins\":100,\"fXmin\":-22,\"fXmax\":70,\"fXbins\":[],\"fFirst\":1,\"fLast\":100,\"fBits2\":0,\"fTimeDisplay\":false,\"fTimeFormat\":\"\",\"fLabels\":null,\"fModLabs\":null},\"fYaxis\":{\"_typename\":\"TAxis\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"yaxis\",\"fTitle\":\"\",\"fNdivisions\":510,\"fAxisColor\":1,\"fLabelColor\":1,\"fLabelFont\":42,\"fLabelOffset\":0.005,\"fLabelSize\":0.035,\"fTickLength\":0.03,\"fTitleOffset\":0,\"fTitleSize\":0.035,\"fTitleColor\":1,\"fTitleFont\":42,\"fNbins\":1,\"fXmin\":0,\"fXmax\":1,\"fXbins\":[],\"fFirst\":0,\"fLast\":0,\"fBits2\":0,\"fTimeDisplay\":false,\"fTimeFormat\":\"\",\"fLabels\":null,\"fModLabs\":null},\"fZaxis\":{\"_typename\":\"TAxis\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"zaxis\",\"fTitle\":\"\",\"fNdivisions\":510,\"fAxisColor\":1,\"fLabelColor\":1,\"fLabelFont\":42,\"fLabelOffset\":0.005,\"fLabelSize\":0.035,\"fTickLength\":0.03,\"fTitleOffset\":1,\"fTitleSize\":0.035,\"fTitleColor\":1,\"fTitleFont\":42,\"fNbins\":1,\"fXmin\":0,\"fXmax\":1,\"fXbins\":[],\"fFirst\":0,\"fLast\":0,\"fBits2\":0,\"fTimeDisplay\":false,\"fTimeFormat\":\"\",\"fLabels\":null,\"fModLabs\":null},\"fBarOffset\":0,\"fBarWidth\":1000,\"fEntries\":3722,\"fTsumw\":3722,\"fTsumw2\":3722,\"fTsumwx\":79670.7818379402,\"fTsumwx2\":3997768.61183205,\"fMaximum\":-1111,\"fMinimum\":-1111,\"fNormFactor\":0,\"fContour\":[],\"fSumw2\":[],\"fOption\":\"\",\"fFunctions\":{\"_typename\":\"TList\",\"name\":\"TList\",\"arr\":[{\"_typename\":\"TPaveStats\",\"fUniqueID\":0,\"fBits\":9,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":1,\"fFillColor\":0,\"fFillStyle\":1001,\"fX1\":56.2000023305417,\"fY1\":254.26406628883,\"fX2\":79.2000030159951,\"fY2\":314.534065839783,\"fX1NDC\":0.780000016093254,\"fY1NDC\":0.775000005960464,\"fX2NDC\":0.980000019073486,\"fY2NDC\":0.935000002384186,\"fBorderSize\":1,\"fInit\":1,\"fShadowColor\":1,\"fCornerRadius\":0,\"fOption\":\"brNDC\",\"fName\":\"stats\",\"fTextAngle\":0,\"fTextSize\":0,\"fTextAlign\":12,\"fTextColor\":1,\"fTextFont\":42,\"fLabel\":\"\",\"fLongest\":18,\"fMargin\":0.05,\"fLines\":{\"_typename\":\"TList\",\"name\":\"TList\",\"arr\":[{\"_typename\":\"TLatex\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"\",\"fTitle\":\"htemp\",\"fTextAngle\":0,\"fTextSize\":0.0368,\"fTextAlign\":0,\"fTextColor\":0,\"fTextFont\":0,\"fX\":0,\"fY\":0,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":2,\"fLimitFactorSize\":3,\"fOriginSize\":0.0368000008165836},{\"_typename\":\"TLatex\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"\",\"fTitle\":\"Entries = 3722 \",\"fTextAngle\":0,\"fTextSize\":0,\"fTextAlign\":0,\"fTextColor\":0,\"fTextFont\":0,\"fX\":0,\"fY\":0,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":2,\"fLimitFactorSize\":3,\"fOriginSize\":0.04},{\"_typename\":\"TLatex\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"\",\"fTitle\":\"Mean = 21.41\",\"fTextAngle\":0,\"fTextSize\":0,\"fTextAlign\":0,\"fTextColor\":0,\"fTextFont\":0,\"fX\":0,\"fY\":0,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":2,\"fLimitFactorSize\":3,\"fOriginSize\":0.04},{\"_typename\":\"TLatex\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"\",\"fTitle\":\"Std Dev = 24.82\",\"fTextAngle\":0,\"fTextSize\":0,\"fTextAlign\":0,\"fTextColor\":0,\"fTextFont\":0,\"fX\":0,\"fY\":0,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":2,\"fLimitFactorSize\":3,\"fOriginSize\":0.04}],\"opt\":[\"\",\"\",\"\",\"\"]},\"fOptFit\":0,\"fOptStat\":1111,\"fFitFormat\":\"5.4g\",\"fStatFormat\":\"6.4g\",\"fParent\":{\"$ref\":3}}],\"opt\":[\"brNDC\"]},\"fBufferSize\":0,\"fBuffer\":[],\"fBinStatErrOpt\":0,\"fStatOverflows\":2,\"fArray\":{\"$arr\":\"Float32\",\"len\":102,\"p\":8,\"v\":[109,177,218,0,0,0,0,0,0,0,0,0,287,231,5,0,0,0,0,0,0,0,0,197,173,206],\"p1\":45,\"v1\":[220,236,22,0,0,0,0,0,0,0,0,152,110,148,0,0,0,0,0,0,0,0,7,193,199,0,0,0,0,0,0,0,0,0,189,114,112,0,0,0,0,0,0,0,0,37,178,202]}},{\"_typename\":\"TPaveText\",\"fUniqueID\":0,\"fBits\":9,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":1,\"fFillColor\":0,\"fFillStyle\":0,\"fX1\":12.4405170691296,\"fY1\":316.417503957222,\"fX2\":35.5594829308704,\"fY2\":337.135317074661,\"fX1NDC\":0.39948275862069,\"fY1NDC\":0.940000003948808,\"fX2NDC\":0.60051724137931,\"fY2NDC\":0.995000004768372,\"fBorderSize\":0,\"fInit\":1,\"fShadowColor\":1,\"fCornerRadius\":0,\"fOption\":\"blNDC\",\"fName\":\"title\",\"fTextAngle\":0,\"fTextSize\":0,\"fTextAlign\":22,\"fTextColor\":1,\"fTextFont\":42,\"fLabel\":\"\",\"fLongest\":11,\"fMargin\":0.05,\"fLines\":{\"_typename\":\"TList\",\"name\":\"TList\",\"arr\":[{\"_typename\":\"TLatex\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"\",\"fTitle\":\"StsPoint.fZ\",\"fTextAngle\":0,\"fTextSize\":0,\"fTextAlign\":0,\"fTextColor\":0,\"fTextFont\":0,\"fX\":0,\"fY\":0,\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":2,\"fLimitFactorSize\":3,\"fOriginSize\":0.0467500016093254}],\"opt\":[\"\"]}},{\"_typename\":\"TStyle\",\"fUniqueID\":0,\"fBits\":0,\"fName\":\"Modern\",\"fTitle\":\"Modern Style\",\"fLineColor\":1,\"fLineStyle\":1,\"fLineWidth\":1,\"fFillColor\":19,\"fFillStyle\":1001,\"fMarkerColor\":1,\"fMarkerStyle\":1,\"fMarkerSize\":1,\"fTextAngle\":0,\"fTextSize\":0.05,\"fTextAlign\":11,\"fTextColor\":1,\"fTextFont\":62,\"fXaxis\":{\"_typename\":\"TAttAxis\",\"fNdivisions\":510,\"fAxisColor\":1,\"fLabelColor\":1,\"fLabelFont\":42,\"fLabelOffset\":0.005,\"fLabelSize\":0.035,\"fTickLength\":0.03,\"fTitleOffset\":1,\"fTitleSize\":0.035,\"fTitleColor\":1,\"fTitleFont\":42},\"fYaxis\":{\"_typename\":\"TAttAxis\",\"fNdivisions\":510,\"fAxisColor\":1,\"fLabelColor\":1,\"fLabelFont\":42,\"fLabelOffset\":0.005,\"fLabelSize\":0.035,\"fTickLength\":0.03,\"fTitleOffset\":0,\"fTitleSize\":0.035,\"fTitleColor\":1,\"fTitleFont\":42},\"fZaxis\":{\"_typename\":\"TAttAxis\",\"fNdivisions\":510,\"fAxisColor\":1,\"fLabelColor\":1,\"fLabelFont\":42,\"fLabelOffset\":0.005,\"fLabelSize\":0.035,\"fTickLength\":0.03,\"fTitleOffset\":1,\"fTitleSize\":0.035,\"fTitleColor\":1,\"fTitleFont\":42},\"fBarWidth\":1,\"fBarOffset\":0,\"fColorModelPS\":0,\"fDrawBorder\":0,\"fOptLogx\":0,\"fOptLogy\":0,\"fOptLogz\":0,\"fOptDate\":0,\"fOptStat\":1111,\"fOptTitle\":1,\"fOptFile\":0,\"fOptFit\":0,\"fShowEventStatus\":0,\"fShowEditor\":0,\"fShowToolBar\":0,\"fNumberContours\":20,\"fAttDate\":{\"_typename\":\"TAttText\",\"fTextAngle\":0,\"fTextSize\":0.025,\"fTextAlign\":11,\"fTextColor\":1,\"fTextFont\":62},\"fDateX\":0.01,\"fDateY\":0.01,\"fEndErrorSize\":2,\"fErrorX\":0.5,\"fFuncColor\":2,\"fFuncStyle\":1,\"fFuncWidth\":2,\"fGridColor\":0,\"fGridStyle\":3,\"fGridWidth\":1,\"fLegendBorderSize\":1,\"fLegendFillColor\":0,\"fLegendFont\":42,\"fLegendTextSize\":0,\"fHatchesLineWidth\":1,\"fHatchesSpacing\":1,\"fFrameFillColor\":0,\"fFrameLineColor\":1,\"fFrameFillStyle\":1001,\"fFrameLineStyle\":1,\"fFrameLineWidth\":1,\"fFrameBorderSize\":1,\"fFrameBorderMode\":0,\"fHistFillColor\":0,\"fHistLineColor\":602,\"fHistFillStyle\":1001,\"fHistLineStyle\":1,\"fHistLineWidth\":1,\"fHistMinimumZero\":false,\"fHistTopMargin\":0.05,\"fCanvasPreferGL\":false,\"fCanvasColor\":0,\"fCanvasBorderSize\":2,\"fCanvasBorderMode\":0,\"fCanvasDefH\":500,\"fCanvasDefW\":700,\"fCanvasDefX\":10,\"fCanvasDefY\":10,\"fPadColor\":0,\"fPadBorderSize\":2,\"fPadBorderMode\":0,\"fPadBottomMargin\":0.1,\"fPadTopMargin\":0.1,\"fPadLeftMargin\":0.1,\"fPadRightMargin\":0.1,\"fPadGridX\":false,\"fPadGridY\":false,\"fPadTickX\":0,\"fPadTickY\":0,\"fPaperSizeX\":20,\"fPaperSizeY\":26,\"fScreenFactor\":1,\"fStatColor\":0,\"fStatTextColor\":1,\"fStatBorderSize\":1,\"fStatFont\":42,\"fStatFontSize\":0,\"fStatStyle\":1001,\"fStatFormat\":\"6.4g\",\"fStatX\":0.98,\"fStatY\":0.935,\"fStatW\":0.2,\"fStatH\":0.16,\"fStripDecimals\":true,\"fTitleAlign\":23,\"fTitleColor\":0,\"fTitleTextColor\":1,\"fTitleBorderSize\":0,\"fTitleFont\":42,\"fTitleFontSize\":0.05,\"fTitleStyle\":0,\"fTitleX\":0.5,\"fTitleY\":0.995,\"fTitleW\":0,\"fTitleH\":0,\"fLegoInnerR\":0.5,\"fLineStyles\":[\"\",\" \",\" 12 12\",\" 4 8\",\" 12 16 4 16\",\" 20 12 4 12\",\" 20 12 4 12 4 12 4 12\",\" 20 20\",\" 20 12 4 12 4 12\",\" 80 20\",\" 80 40 4 40\",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \",\" \"],\"fHeaderPS\":\"\",\"fTitlePS\":\"\",\"fFitFormat\":\"5.4g\",\"fPaintTextFormat\":\"g\",\"fLineScalePS\":3,\"fJoinLinePS\":0,\"fCapLinePS\":0,\"fTimeOffset\":788918400,\"fImageScaling\":1}],\"opt\":[\"\",\"\",\"blNDC\",\"\"]},\"fExecs\":null,\"fName\":\"c1\",\"fTitle\":\"c1\",\"fNumPaletteColor\":0,\"fNextPaletteColor\":0,\"fDISPLAY\":\"$DISPLAY\",\"fDoubleBuffer\":0,\"fRetained\":true,\"fXsizeUser\":0,\"fYsizeUser\":0,\"fXsizeReal\":20,\"fYsizeReal\":14.28571,\"fWindowTopX\":0,\"fWindowTopY\":0,\"fWindowWidth\":0,\"fWindowHeight\":0,\"fCw\":696,\"fCh\":472,\"fCatt\":{\"_typename\":\"TAttCanvas\",\"fXBetween\":2,\"fYBetween\":2,\"fTitleFromTop\":1.2,\"fXdate\":0.2,\"fYdate\":0.3,\"fAdate\":1},\"kMoveOpaque\":true,\"kResizeOpaque\":true,\"fHighLightColor\":2,\"fBatch\":true,\"kShowEventStatus\":true,\"kAutoExec\":true,\"kMenuBar\":true});\n", + " Core.settings.HandleKeys = false;\n", + " Core.draw(\"root_plot_1720175905212\", obj, \"\");\n", + "}\n", + "\n", + "function script_load_root_plot_1720175905212(src, on_error) {\n", + " let script = document.createElement('script');\n", + " script.src = src;\n", + " script.onload = function() { display_root_plot_1720175905212(JSROOT); };\n", + " script.onerror = function() { script.remove(); on_error(); };\n", + " document.head.appendChild(script);\n", + "}\n", + "\n", + "if (typeof requirejs !== 'undefined') {\n", + "\n", + " // We are in jupyter notebooks, use require.js which should be configured already\n", + " requirejs.config({\n", + " paths: { 'JSRootCore' : [ 'scripts/JSRoot.core', 'https://root.cern/js/6.1.1/scripts/JSRoot.core.min', 'https://jsroot.gsi.de/6.1.1/scripts/JSRoot.core.min' ] }\n", + " })(['JSRootCore'], function(Core) {\n", + " display_root_plot_1720175905212(Core);\n", + " });\n", + "\n", + "} else if (typeof JSROOT !== 'undefined') {\n", + "\n", + " // JSROOT already loaded, just use it\n", + " display_root_plot_1720175905212(JSROOT);\n", + "\n", + "} else {\n", + "\n", + " // We are in jupyterlab without require.js, directly loading jsroot\n", + " // Jupyterlab might be installed in a different base_url so we need to know it.\n", + " try {\n", + " var base_url = JSON.parse(document.getElementById('jupyter-config-data').innerHTML).baseUrl;\n", + " } catch(_) {\n", + " var base_url = '/';\n", + " }\n", + "\n", + " // Try loading a local version of requirejs and fallback to cdn if not possible.\n", + " script_load_root_plot_1720175905212(base_url + 'static/scripts/JSRoot.core.js', function(){\n", + " console.error('Fail to load JSROOT locally, please check your jupyter_notebook_config.py file');\n", + " script_load_root_plot_1720175905212('https://root.cern/js/6.1.1/scripts/JSRoot.core.min.js', function(){\n", + " document.getElementById(\"root_plot_1720175905212\").innerHTML = \"Failed to load JSROOT\";\n", + " });\n", + " });\n", + "}\n", + "\n", + "</script>\n" + ], + "text/plain": [ + "<IPython.core.display.HTML object>" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "ROOT.gROOT.Reset()\n", + "%jsroot on\n", + "asimfile = ROOT.TFile(\"test.tra.root\")\n", + "atree = asimfile.Get(\"cbmsim\")\n", + "canvas = ROOT.TCanvas()\n", + "atree.Draw(\"StsPoint.fZ\",\"\")\n", + "canvas.Draw()\n" + ] + } + ], + "metadata": { + "@webio": { + "lastCommId": null, + "lastKernelId": null + }, + "kernelspec": { + "display_name": "CbmRoot Python3", + "language": "python", + "name": "CbmRootPy" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.3" + }, + "vscode": { + "interpreter": { + "hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49" + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +}