diff --git a/.github/workflows/key4hep.yml b/.github/workflows/key4hep.yml
new file mode 100644
index 000000000..a20cc0962
--- /dev/null
+++ b/.github/workflows/key4hep.yml
@@ -0,0 +1,37 @@
+name: key4hep
+
+on: [push, pull_request]
+
+jobs:
+ linux:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ release: ["sw.hsf.org/key4hep",
+ "sw-nightlies.hsf.org/key4hep"]
+ steps:
+ - uses: actions/checkout@v3
+ - uses: cvmfs-contrib/github-action-cvmfs@v3
+ - uses: aidasoft/run-lcg-view@v4
+ with:
+ container: centos7
+ view-path: /cvmfs/${{ matrix.release }}
+ run: |
+ mkdir build install
+ cd build
+ cmake -DCMAKE_CXX_STANDARD=20 \
+ -DBUILD_ROOTDICT=ON \
+ -DCMAKE_CXX_FLAGS="-fdiagnostics-color=always -Werror " \
+ -DCMAKE_INSTALL_PREFIX=../install \
+ ..
+ make -k
+ make install
+ ctest --output-on-failure
+ echo "::group::Test downstream build"
+ cd -
+ export CMAKE_PREFIX_PATH=$PWD/install:$CMAKE_PREFIX_PATH
+ cd tests/downstream-project-cmake-test
+ mkdir build && cd build
+ cmake .. -DCMAKE_CXX_STANDARD=20
+ make -k
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml
index 316b15c55..084e222cb 100644
--- a/.github/workflows/linux.yml
+++ b/.github/workflows/linux.yml
@@ -14,7 +14,7 @@ jobs:
"LCG_102/x86_64-centos7-clang12-opt",
"LCG_102/x86_64-ubuntu2004-gcc9-opt"]
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: aidasoft/run-lcg-view@v4
with:
@@ -24,10 +24,16 @@ jobs:
cd build
cmake -DCMAKE_CXX_STANDARD=17 \
-DBUILD_ROOTDICT=ON \
- -DCMAKE_CXX_FLAGS="-fdiagnostics-color=always" \
+ -DCMAKE_CXX_FLAGS="-fdiagnostics-color=always -Werror" \
-DCMAKE_INSTALL_PREFIX=../install \
- -DBUILD_F77_TESTJOBS=ON \
..
make -k
make install
ctest --output-on-failure
+ echo "::group::Test downstream build"
+ cd -
+ export CMAKE_PREFIX_PATH=$PWD/install:$CMAKE_PREFIX_PATH
+ cd tests/downstream-project-cmake-test
+ mkdir build && cd build
+ cmake .. -DCMAKE_CXX_STANDARD=17
+ make -k
diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml
index c8cc98110..d3f501db7 100644
--- a/.github/workflows/python.yml
+++ b/.github/workflows/python.yml
@@ -4,12 +4,12 @@ on: [push, pull_request]
jobs:
python-lint:
- runs-on: ubuntu-18.04
+ runs-on: ubuntu-latest
strategy:
matrix:
LCG: ["LCG_98/x86_64-centos7-gcc10-opt"]
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Install CVMFS
run: |
wget --no-check-certificate https://ecsft.cern.ch/dist/cvmfs/cvmfs-release/cvmfs-release-latest_all.deb
diff --git a/.github/workflows/python_bindings.yml b/.github/workflows/python_bindings.yml
index e4c398267..1f0ea9028 100644
--- a/.github/workflows/python_bindings.yml
+++ b/.github/workflows/python_bindings.yml
@@ -9,7 +9,7 @@ jobs:
fail-fast: false
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- uses: cvmfs-contrib/github-action-cvmfs@v3
- uses: aidasoft/run-lcg-view@v4
with:
@@ -19,7 +19,7 @@ jobs:
cd build
cmake -DCMAKE_CXX_STANDARD=17 \
-DBUILD_ROOTDICT=ON \
- -DCMAKE_CXX_FLAGS="-fdiagnostics-color=always" \
+ -DCMAKE_CXX_FLAGS="-fdiagnostics-color=always -Werror " \
-DCMAKE_INSTALL_PREFIX=../install \
-G Ninja \
..
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aa18eeec3..6078318c2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,18 +2,17 @@
# cmake file for building LCIO
# @author Frank Gaede, DESY
# @author Jan Engels, DESY
-CMAKE_MINIMUM_REQUIRED( VERSION 2.8 FATAL_ERROR )
+CMAKE_MINIMUM_REQUIRED( VERSION 3.14 FATAL_ERROR )
########################################################
-
# project name
PROJECT( LCIO )
include(GNUInstallDirs)
# project version
SET( LCIO_VERSION_MAJOR 2 )
-SET( LCIO_VERSION_MINOR 17 )
+SET( LCIO_VERSION_MINOR 22 )
SET( LCIO_VERSION_PATCH 0 )
### set correct LCIO version in relevant files ############################
@@ -166,12 +165,23 @@ eval $*
ENDIF()
-# Deal with SIO
-FIND_PACKAGE( SIO QUIET )
+# Deal with SIO (we need at least 0.1 since there are no targets before)
+FIND_PACKAGE( SIO 0.1 QUIET )
IF( NOT SIO_FOUND )
MESSAGE( STATUS "SIO not found on your system. Using builtin sio" )
- ADD_SUBDIRECTORY( sio )
+ include(FetchContent)
+ FetchContent_Declare(sio_extern
+ GIT_REPOSITORY https://github.com/iLCSoft/SIO.git
+ GIT_TAG v00-02
+ GIT_SHALLOW 1
+# FIND_PACKAGE_ARGS
+)
+
+ FetchContent_MakeAvailable(sio_extern)
+
+ get_target_property(SIO_VERSION SIO::sio VERSION)
+ get_target_property(SIO_INCLUDE_DIRS SIO::sio INCLUDE_DIRECTORIES)
ENDIF()
MESSAGE( STATUS "Using SIO (${SIO_VERSION})" )
@@ -287,14 +297,6 @@ OPTION( BUILD_LCIO_EXAMPLES "Set to ON to build LCIO examples" ON )
ADD_SUBDIRECTORY( ./src/cpp lcio )
-
-# fortran examples
-OPTION( BUILD_F77_TESTJOBS "Set to ON to build LCIO F77 testjobs" OFF )
-IF( BUILD_F77_TESTJOBS )
- ADD_SUBDIRECTORY( ./src/f77 f77 )
-ENDIF()
-
-
# directory containing lcio tests
ADD_SUBDIRECTORY( ./tests )
@@ -325,3 +327,10 @@ MESSAGE( STATUS "" )
GENERATE_PACKAGE_CONFIGURATION_FILES( LCIOConfig.cmake LCIOConfigVersion.cmake )
INSTALL( FILES cmake/MacroCheckPackageLibs.cmake cmake/MacroCheckPackageVersion.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
+
+install(EXPORT ${PROJECT_NAME}Targets
+ NAMESPACE ${PROJECT_NAME}::
+ FILE "${PROJECT_NAME}Targets.cmake"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/"
+ )
+
diff --git a/README.md b/README.md
index a663de0fb..5fd144213 100644
--- a/README.md
+++ b/README.md
@@ -11,8 +11,7 @@ LCIO ( **L**inear **C**ollider **I/O** ) is a persistency framework and event da
## Introduction
LCIO is intended to be used in both simulation studies and analysis frameworks. Its light weight and portability makes it also suitable for use in detector R&D
-testbeam applications. It provides a C++ and optionally a Java implementation with a common interface (API) - a Fortran interface to the C++ implementation also exists,
-if built with ROOT, Python bindings are available .
+testbeam applications. It provides a C++ and optionally a Java implementation with a common interface (API) - if built with ROOT, Python bindings are available .
Using a common persistency format and event data model allows to easily share results and compare reconstruction algorithms.
LCIO is used by almost all groups involved in linear collider detector studies and thus has become a de facto standard.
diff --git a/cmake/FindCLHEP.cmake b/cmake/FindCLHEP.cmake
deleted file mode 100644
index 5c9715fdf..000000000
--- a/cmake/FindCLHEP.cmake
+++ /dev/null
@@ -1,86 +0,0 @@
-#############################################################
-# cmake module for finding CLHEP
-#
-# returns:
-# CLHEP_FOUND : set to TRUE or FALSE
-# CLHEP_VERSION : package version
-# CLHEP_INCLUDE_DIRS : paths to clhep includes
-# CLHEP_LIBRARY_DIRS : paths to clhep libraries
-# CLHEP_LIBRARIES : list of clhep libraries
-#
-# @author Jan Engels, DESY
-#############################################################
-
-
-# find clhep-config
-SET( CLHEP_CONFIG_EXECUTABLE CLHEP_CONFIG_EXECUTABLE-NOTFOUND )
-MARK_AS_ADVANCED( CLHEP_CONFIG_EXECUTABLE )
-FIND_PROGRAM( CLHEP_CONFIG_EXECUTABLE clhep-config PATHS ${CLHEP_DIR}/bin NO_DEFAULT_PATH )
-IF( NOT CLHEP_DIR )
- FIND_PROGRAM( CLHEP_CONFIG_EXECUTABLE clhep-config )
-ENDIF()
-
-IF( CLHEP_CONFIG_EXECUTABLE )
-
- # ==============================================
- # === CLHEP_PREFIX ===
- # ==============================================
-
- EXECUTE_PROCESS( COMMAND "${CLHEP_CONFIG_EXECUTABLE}" --prefix
- OUTPUT_VARIABLE CLHEP_ROOT
- RESULT_VARIABLE _exit_code
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
- IF( NOT _exit_code EQUAL 0 )
- SET( CLHEP_ROOT )
- ENDIF()
-
-
- # ==============================================
- # === CLHEP_VERSION ===
- # ==============================================
- INCLUDE( MacroCheckPackageVersion )
-
- EXECUTE_PROCESS( COMMAND "${CLHEP_CONFIG_EXECUTABLE}" --version
- OUTPUT_VARIABLE _output
- RESULT_VARIABLE _exit_code
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
- IF( _exit_code EQUAL 0 )
- #SEPARATE_ARGUMENTS( CLHEP_VERSION UNIX_COMMAND "${_output}" ) # needs cmake >= 2.8
- SET( CLHEP_VERSION ${_output} )
- SEPARATE_ARGUMENTS( CLHEP_VERSION )
- LIST( REMOVE_AT CLHEP_VERSION 0 ) # remove CLHEP string from output of 'clhep-config --version'
- CHECK_PACKAGE_VERSION( CLHEP ${CLHEP_VERSION} )
- ELSE()
- SET( CLHEP_VERSION )
- ENDIF()
-
-ENDIF( CLHEP_CONFIG_EXECUTABLE )
-
-
-# ---------- includes ---------------------------------------------------------
-SET( CLHEP_INCLUDE_DIRS CLHEP_INCLUDE_DIRS-NOTFOUND )
-MARK_AS_ADVANCED( CLHEP_INCLUDE_DIRS )
-
-FIND_PATH( CLHEP_INCLUDE_DIRS NAMES CLHEP/Vector/ThreeVector.h PATHS ${CLHEP_DIR}/include NO_DEFAULT_PATH )
-IF( NOT CLHEP_DIR )
- FIND_PATH( CLHEP_INCLUDE_DIRS NAMES CLHEP/Vector/ThreeVector.h )
-ENDIF()
-
-
-# ---------- libraries --------------------------------------------------------
-INCLUDE( MacroCheckPackageLibs )
-
-# only standard libraries should be passed as arguments to CHECK_PACKAGE_LIBS
-# additional components are set by cmake in variable PKG_FIND_COMPONENTS
-# first argument should be the package name
-CHECK_PACKAGE_LIBS( CLHEP CLHEP )
-
-
-
-# ---------- final checking ---------------------------------------------------
-INCLUDE( FindPackageHandleStandardArgs )
-# set CLHEP_FOUND to TRUE if all listed variables are TRUE and not empty
-FIND_PACKAGE_HANDLE_STANDARD_ARGS( CLHEP DEFAULT_MSG CLHEP_INCLUDE_DIRS CLHEP_LIBRARIES PACKAGE_VERSION_COMPATIBLE )
-
diff --git a/cmake/LCIOConfig.cmake.in b/cmake/LCIOConfig.cmake.in
index ee589b236..ef304a1d6 100644
--- a/cmake/LCIOConfig.cmake.in
+++ b/cmake/LCIOConfig.cmake.in
@@ -67,6 +67,12 @@ CHECK_PACKAGE_LIBS( LCIO lcio @CHECK_PACKAGE_SIO_LIBRARY@ )
## ---------------------------------------------------------------
+include(CMakeFindDependencyMacro)
+find_dependency(SIO @SIO_VERSION@)
+
+# Include the targets file to create the imported targets that a client can link
+# to or execute
+include("${CMAKE_CURRENT_LIST_DIR}/LCIOTargets.cmake")
# ---------- final checking ---------------------------------------------------
diff --git a/cmake/MacroGeneratePackageConfigFiles.cmake b/cmake/MacroGeneratePackageConfigFiles.cmake
index e4a7b1259..683829eee 100644
--- a/cmake/MacroGeneratePackageConfigFiles.cmake
+++ b/cmake/MacroGeneratePackageConfigFiles.cmake
@@ -9,7 +9,7 @@ MACRO( GENERATE_PACKAGE_CONFIGURATION_FILES )
CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/cmake/${arg}.in"
"${PROJECT_BINARY_DIR}/${arg}" @ONLY
)
- INSTALL( FILES "${PROJECT_BINARY_DIR}/${arg}" DESTINATION . )
+ INSTALL( FILES "${PROJECT_BINARY_DIR}/${arg}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} )
#IF( EXISTS "${_current_dir}/MacroCheckPackageLibs.cmake" )
# INSTALL( FILES "${_current_dir}/MacroCheckPackageLibs.cmake" DESTINATION cmake )
#ENDIF()
@@ -26,7 +26,7 @@ MACRO( GENERATE_PACKAGE_CONFIGURATION_FILES )
CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/cmake/${arg}.in"
"${PROJECT_BINARY_DIR}/${arg}" @ONLY
)
- INSTALL( FILES "${PROJECT_BINARY_DIR}/${arg}" DESTINATION . )
+ INSTALL( FILES "${PROJECT_BINARY_DIR}/${arg}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} )
#IF( EXISTS "${_current_dir}/MacroCheckPackageVersion.cmake" )
# INSTALL( FILES "${_current_dir}/MacroCheckPackageVersion.cmake" DESTINATION cmake )
#ENDIF()
diff --git a/cmake/ilcsoft_build_32bit_compatible.cmake b/cmake/ilcsoft_build_32bit_compatible.cmake
deleted file mode 100644
index 316376f97..000000000
--- a/cmake/ilcsoft_build_32bit_compatible.cmake
+++ /dev/null
@@ -1,26 +0,0 @@
-#---------------- 32/64 bit issues ---------------------------------------
-OPTION( BUILD_32BIT_COMPATIBLE "Set to ON to build in 32 bit compatibility mode" ON )
-
-IF( BUILD_32BIT_COMPATIBLE )
-
- IF( CMAKE_SIZEOF_VOID_P EQUAL 8 ) # 64 bit architecture detected
-
- IF( COMMAND SET_PROPERTY )
- SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS 0)
- ELSE()
- MESSAGE( "Command SET_PROPERTY not found. do you have cmake >= 2.6 ?" )
- ENDIF()
-
- SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" )
- SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" )
- SET( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -m32" )
- SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32" )
- SET( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32" )
- SET( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -m32" )
-
- ENDIF()
-
-ENDIF()
-#MESSAGE( STATUS "BUILD_32BIT_COMPATIBLE = ${BUILD_32BIT_COMPATIBLE}" )
-#-------------------------------------------------------------------------
-
diff --git a/cmake/ilcsoft_default_settings.cmake b/cmake/ilcsoft_default_settings.cmake
index de2eeb0a7..e114d969c 100644
--- a/cmake/ilcsoft_default_settings.cmake
+++ b/cmake/ilcsoft_default_settings.cmake
@@ -21,7 +21,6 @@ INCLUDE( ilcsoft_default_library_versioning )
INCLUDE( ilcsoft_default_build_output_directories )
INCLUDE( ilcsoft_default_rpath_settings )
INCLUDE( ilcsoft_default_cxx_flags )
-#INCLUDE( ilcsoft_build_32bit_compatible )
# uninstall target may only be created once per project
diff --git a/cmake/ilcsoft_default_uninstall_target.cmake b/cmake/ilcsoft_default_uninstall_target.cmake
index 08c6742ba..a997cd0b1 100644
--- a/cmake/ilcsoft_default_uninstall_target.cmake
+++ b/cmake/ilcsoft_default_uninstall_target.cmake
@@ -7,7 +7,9 @@ IF( EXISTS "${_current_dir}/cmake_uninstall.cmake.in" )
"${PROJECT_BINARY_DIR}/cmake_uninstall.cmake" @ONLY )
# add uninstall target
- ADD_CUSTOM_TARGET( uninstall "${CMAKE_COMMAND}" -P "${PROJECT_BINARY_DIR}/cmake_uninstall.cmake" )
+ if (NOT TARGET uninstall)
+ ADD_CUSTOM_TARGET( uninstall "${CMAKE_COMMAND}" -P "${PROJECT_BINARY_DIR}/cmake_uninstall.cmake" )
+ endif()
ENDIF( EXISTS "${_current_dir}/cmake_uninstall.cmake.in" )
diff --git a/cmake/manual.tex.in b/cmake/manual.tex.in
index e9bdfa9cd..469680bb9 100644
--- a/cmake/manual.tex.in
+++ b/cmake/manual.tex.in
@@ -77,7 +77,6 @@ analysis frameworks. Its light weight and portability makes it also suitable
for use in detector R\&D applications.
It provides a C++ and a Java implementation with a common interface (API).
-A Fortran interface to the C++ implementation is provided as well.
This manual is intended for application developers that want to incorporate LCIO in their
programs. This includes e.g. simulation developers as well as physicists that want to
@@ -231,11 +230,6 @@ Both ways of building LCIO will create the following libraries and executables:
lcio_event_counter
stdhepjob
- ./bin <-- f77 examples
- anajob_F
- simjob_F
- recjob_F
-
\end{verbatim}
@@ -310,8 +304,6 @@ This section gives an introduction on how to use LCIO. We describe the user inte
provide some code examples. For most of the section we focus on Java and C++ as these are the main
languages supported by LCIO. Thanks to the AID~\cite{ref_aid} tool Java and C++ hava an API which is generated
from a common source and thus very similar.
-The Fortran interface, implemented as a wrapper to the C++ implementation, is described
-in \ref{f77api}.
\subsection{Java and C++ API} \label{sec_api}
Detailed documentation of the API is provided both for Java and C++ on the
@@ -1009,16 +1001,13 @@ Of course if you use your own implementation of the EVENT interface you are also
memory management.}
-
-\input{f77api}
-
\section{Real world examples} \label{realworld}
-All the examples described above show how to use LCIO with Java, C++ and Fortran. They are build
+All the examples described above show how to use LCIO with Java and C++. They are build
with LCIO and provided as binaries in \verb#$LCIO/bin#.
%$
We also provide some examples that show how to use LCIO with some common physiscs simulation
and analysis packages, such as {\em Pythia, Root and AIDA (JAS)} in
-\verb#$LCIO/examples/java[cpp,f77]#.
+\verb#$LCIO/examples/java[cpp]#.
%$
As these examples depend on external tools and libraries they are not build by default with LCIO.
Please check the corresponding \verb$README$ files for instructions on how to build these examples:
@@ -1037,23 +1026,6 @@ This Java example creates an AIDA file from an LCIO file with some histograms
and an Ntuple. You can use any AIDA~\cite{ref_aida} compliant analysis tools for
viewing the histograms, e.g. JAS3~\cite{ref_jas}.
-\subsection{lciohbook (Fortran, Hbook)} \label{rwhbook}
-
-A Fortran example that creates an Hbook~\cite{ref_cernlib} file from an LCIO file with
-some histograms to be analyzed with PAW~\cite{ref_cernlib}.
-
-\subsection{pythia (Fortran, Pythia)} \label{rwpythia}
-
-An ASCII file of generator output can be produced by the script \verb$pythiahepevt.sh$.
-This script runs a Pythia~\cite{ref_pythia} job
-using the Pythia routine {\bf PYHEPC} to fill the \verb$hepevt$ common block
-and a modified version of {\bf LCWRITE} to create the ASCII file (is included in the script). To run this script
-one has to provide \verb$cernlib$~\cite{ref_cernlib} 2002 or later. The script has to be modified if necessary
-to provide a valid path to the \verb$cernlib$ libraries. \\
-The program {\bf PYSIMJOB} (\verb$pysimjob.F$) reads the ASCII file, fills the \verb$hepevt$ common
-block, and writes a LCIO file which is read again in a second pass to fill the \verb$hepevt$ common
-block.
-
\newpage
%\begin{latexonly}
@@ -1158,10 +1130,6 @@ See UTIL::LCStdHepRdr and EXAMPLES/stdhepjob.cc.
%{\footnotesize \verbatiminput{../../../doc/lcio.xml} }
%\newpage
-\section{Summary of Fortran API Functions} \label{ftn_summary}
-
-\input{f77summary.tex}
-
\newpage
% Create the reference section using BibTeX:
diff --git a/doc/ReleaseNotes.md b/doc/ReleaseNotes.md
index 79f0dea95..81cc6316b 100644
--- a/doc/ReleaseNotes.md
+++ b/doc/ReleaseNotes.md
@@ -1,3 +1,101 @@
+# v02-22
+
+* 2024-06-07 tmadlener ([PR#189](https://github.com/iLCSoft/LCIO/pull/189))
+ - Remove mentions of the removed F77 API (see [#161](https://github.com/iLCSoft/LCIO/pull/161)) from the documentation
+
+* 2024-06-06 tmadlener ([PR#190](https://github.com/iLCSoft/LCIO/pull/190))
+ - Remove the no longer used settings for the 32bit compatibility mode
+
+* 2024-06-06 Nazar Bartosik ([PR#147](https://github.com/iLCSoft/LCIO/pull/147))
+ - Add `Nholes` and and `subdetectorHoleNumbers` to the `Track` for keeping track of missing hits in a Track.
+
+* 2024-05-08 Bohdan Dudar ([PR#170](https://github.com/iLCSoft/LCIO/pull/170))
+ - Added new utility `dumpmctree` to draw the MC table of the event stored in the slcio file as the graphviz tree diagram, which represents parent-daughter relations visually in a easier way.
+ - `dumpmctree` is a small wrapper script around the actual `dumpmctree-dot` executable. The latter produces a `.dot` file which is then transformed into an `.svg` file via the wrapper script and the `dot` executable.
+ - The script relies on `dot` & `xdg-open` to be available on your system.
+
+* 2024-04-15 tmadlener ([PR#188](https://github.com/iLCSoft/LCIO/pull/188))
+ - Make the `PIDHandler` usable as `const` object by marking getters that do not mutate internal state as `const`
+
+# v02-21
+
+* 2024-01-15 Thomas Madlener ([PR#187](https://github.com/iLCSoft/LCIO/pull/187))
+ - Switch to c++20 for the key4hep nightlies based CI
+
+* 2024-01-11 tmadlener ([PR#184](https://github.com/iLCSoft/LCIO/pull/184))
+ - Make sure that LCIO installations can be used in downstream projects if they are built with builtin SIO. Fixes https://github.com/iLCSoft/LCIO/issues/183
+ - Add a test to make sure that this works as intended
+ - Bump the minimum required version for SIO to v00-01 in order to have CMake targets available.
+
+* 2023-12-15 jmcarcell ([PR#175](https://github.com/iLCSoft/LCIO/pull/175))
+ - Bump the minimum CMake version to 3.14
+
+* 2023-12-13 jmcarcell ([PR#178](https://github.com/iLCSoft/LCIO/pull/178))
+ - Bump the SIO version to v00-02
+ - Fix two compiler warnings with clang
+
+* 2023-12-06 Andre Rummler ([PR#181](https://github.com/iLCSoft/LCIO/pull/181))
+ - Replace the copy of SIO that is used for builtin SIO support with the necessary cmake configuration to fetch it on the fly via CMake's `FetchContent` as this simplifies the maintenance of the vendored version of SIO greatly. **This is a transparent change for users, as long as internet connection to fetch the SIO sources during building is available**
+
+# v02-20-02
+
+* 2023-12-06 tmadlener ([PR#182](https://github.com/iLCSoft/LCIO/pull/182))
+ - Also put pre-generated headers into include directories of LCIO target to make in-source builds (e.g. via. CMake's FetchContent) possible.
+
+* 2023-12-01 tmadlener ([PR#180](https://github.com/iLCSoft/LCIO/pull/180))
+ - Populate the `target_include_directories` of the `LCIO::lcio` target to make it properly usable downstream.
+
+# v02-20-01
+
+* 2023-11-14 jmcarcell ([PR#177](https://github.com/iLCSoft/LCIO/pull/177))
+ - Export targets and make sure they can be used by other CMake projects
+
+* 2023-09-07 jmcarcell ([PR#176](https://github.com/iLCSoft/LCIO/pull/176))
+ - Make an alias to `SIO::sio` when building SIO within LCIO so that it has the same target as the standalone SIO, that has the target `SIO::sio`
+
+* 2023-08-15 jmcarcell ([PR#174](https://github.com/iLCSoft/LCIO/pull/174))
+ - Make cmake respect CMAKE_INSTALL_
+
+* 2023-07-17 jmcarcell ([PR#173](https://github.com/iLCSoft/LCIO/pull/173))
+ - Drop FindCLHEP.cmake
+
+* 2023-07-17 jmcarcell ([PR#172](https://github.com/iLCSoft/LCIO/pull/172))
+ - Don't make the uninstall target if it already exists
+
+* 2023-06-13 Leonhard Reichenbach ([PR#171](https://github.com/iLCSoft/LCIO/pull/171))
+ - LCRelationNavigator: add methods `getRelatedToMaxWeightAndObject` and `getRelatedFromMaxWeightAndObject` returning both the object and the weight in a tuple
+
+# v02-20
+
+* 2023-05-30 Andre Sailer ([PR#168](https://github.com/iLCSoft/LCIO/pull/168))
+ - Pregenerated Headers: remove self-include from some headers (breaks include-what-you-use)
+ - LCIterator, LCRTRelations: remove template syntax causing errors in gcc13/c++20
+ - RunEvent, LCObject, TrackStateImpl: added default copy and move constructor and assignment operator to avoid error about "'definition of implicit copy constructor for 'LCObject' is deprecated because it has a user-declared destructor'"
+
+* 2023-05-12 tmadlener ([PR#167](https://github.com/iLCSoft/LCIO/pull/167))
+ - Fix checking of collection types to make sure patching works correctly
+
+* 2023-05-03 Thomas Madlener ([PR#166](https://github.com/iLCSoft/LCIO/pull/166))
+ - Upgrade `python-lint` workflow to run on `ubuntu-lates` since `ubuntu-18.04` runners have been removed.
+
+* 2023-05-03 Finn Johannsen ([PR#165](https://github.com/iLCSoft/LCIO/pull/165))
+ - Fixes to the on the fly collection patching that are necessary for the LCIO to EDM4hep standalone conversion.
+ - Make `CheckCollections` check the `FromType` and `ToType` collection parameters to figure out the involved types for `LCRelations`. Add them to the output of `CheckCollections::print`
+ - Make the `CheckCollectoins::patchCollections` parse these strings back for `LCRelation` collections and set them as collection parameters for collections it creates on the fly.
+ - Add a `--minimal` flag to `check_missing_cols` in order to make it possible to produce outputs that can be more easily consumbed by other programs.
+
+* 2023-05-03 Thomas Madlener ([PR#164](https://github.com/iLCSoft/LCIO/pull/164))
+ - Add Key4hep release based CI workflow
+ - Fix remaining warnings to enable `-Werror`
+ - Update *checkout* action to v3, since v2 is deprecated.
+ - **CLHEP >= 2.0** is now required for building the examples that use CLHEP functionality (`test_fourvector`).
+
+* 2023-02-10 jmcarcell ([PR#162](https://github.com/iLCSoft/LCIO/pull/162))
+ - Add test dependencies so that tests can run in parallel
+
+* 2023-02-10 jmcarcell ([PR#161](https://github.com/iLCSoft/LCIO/pull/161))
+ - Remove the deprecated C API and fortran bindings (c.f. [#137](https://github.com/iLCSoft/LCIO/pull/137) and [#151](https://github.com/iLCSoft/LCIO/issues/151))
+
# v02-19-01
* 2023-02-06 Bohdan Dudar ([PR#163](https://github.com/iLCSoft/LCIO/pull/163))
diff --git a/examples/f77/lciohbook/README b/examples/f77/lciohbook/README
deleted file mode 100644
index aed975cbf..000000000
--- a/examples/f77/lciohbook/README
+++ /dev/null
@@ -1,26 +0,0 @@
-########################################################
-#
-# lciohbook:
-# A simple script is provided that creates and runs lciohbook_F.
-# lciohbook_F opens the LCIO file test.slcio and creates
-# an hbook file lcio.hbook with a few histograms
-# for MCParticles using the the fortran interface.
-# Finally the cernlib's "paw" is called which presents
-# the histograms.
-#
-########################################################
-
- Modify the GNUmakefile according to your needs in particular the
- path to your cernlib installation is required. Provide access to paw
- (modify the PATH environment variable and add your cernlib bin dir).
-
- run:
-
- ./lciohbook_F
-
-
-or use the the script ./lciohbook to build, run and view the plots with paw.
-
-
-If lciohbook is not running please check it and modify it.
-
diff --git a/examples/f77/lciohbook/lciohbook b/examples/f77/lciohbook/lciohbook
deleted file mode 100755
index 9e6b53636..000000000
--- a/examples/f77/lciohbook/lciohbook
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh
-################### script to run the lciohbook_F executable ##################
-# #
-# input file : lcio.hbook (in this directory) #
-# output file: lcio.hbook (in this directory) #
-# #
-# paw input file : plot.kumac (in this directory) #
-# #
-###############################################################################
-
-# make lciohbook_F
-
-gmake
-
-# run lciohbook_F
-
-./lciohbook_F << EOF
-test.slcio
-EOF
-
-# run paw
-
-paw << EOF
-1
-exec plot.kumac
-kuip/shell 'sleep 5'
-EOF
-
diff --git a/examples/f77/lciohbook/lciohbook.F b/examples/f77/lciohbook/lciohbook.F
deleted file mode 100644
index a61c269bd..000000000
--- a/examples/f77/lciohbook/lciohbook.F
+++ /dev/null
@@ -1,135 +0,0 @@
-********************************************************
-*
- program lciohbook
-*
-* Simple example that opens an LCIO file and creates
-* an hbook file wit a few histograms for MCParticles
-* using the the fortran interface.
-*
-* @author: F. Gaede
-* @date: 11/03/2003
-********************************************************
- implicit none
-
-c-- hbook/paw common
- integer nwpawc
- real hmemor
- parameter(nwpawc=20000)
- common/pawc/ hmemor(nwpawc)
-
- integer lrecl, istat, icycle
-
-c-- LCIO interface
-#include "lciof77api.inc"
-
- PTRTYPE reader, event, mcp, mccol
- integer status, ievent
- integer i,j,k, nmcp, lenocc
- real costh, p(3), pxy, ptot, phi
- double precision pdouble(3)
- character*80 filename
- character*80 mcpcolname
- data mcpcolname /'MCParticle'/
-
-
- call hlimit(nwpawc)
-
-
- lrecl=1024
- call hropen(1,'lciohbk','lcio.hbook','N',lrecl,istat)
-
-c-- book some histograms
- call hbook1(10,'mcp energy',400,0.,100.,0.)
- call hbook1(20,'mcp cos(theta)',100,-1.,1.,0.)
- call hbook1(25,'mcp phi',72,-180.,180.,0.)
- call hbook1(30,'mcp e/p',50,0.8,2.,0.)
-
-
-
-c-- open LCIO file
-ccc write(*,*) 'Give LCIO file name:'
- read(*,'(a)') filename
- write(*,*) 'input file is: ', filename(1:lenocc(filename))
- write(*,*) 'histo file is: ', 'lcio.hbook'
-
- reader = lcrdrcreate()
- status = lcrdropen( reader, filename )
-
- if( status.eq.LCIO_ERROR) then
- write(*,*) ' could not open file '// filename
- goto 99
- endif
-
-
-c ---- event loop ------
- do
-
- event = lcrdrreadnextevent( reader , LCIO_READ_ONLY )
- if( event.eq.0 ) goto 11
-
- mccol = lcevtgetcollection( event, mcpcolname )
- if( mccol.eq. 0) then
- write(*,*) ' collection MCParticle not found in event'
- else
- nmcp = lccolgetnumberofelements( mccol )
-
- do i=1,nmcp
-
- mcp = lccolgetelementat( mccol, i )
- if( mcp.ne.0 ) then
-
-c --------- use only final state particles
- if( (lcmcpgetnumberofdaughters( mcp ).eq.0).and.
- $ ( lcmcpgetpdg( mcp).gt.100 ).and.
- $ ( lcmcpgetnumberofparents( mcp ).ne.0) ) then
- continue
- else
- goto 10
- endif
-
- call hfill( 10, real(lcmcpgetenergy(mcp)), 0., 1.)
- status = lcmcpgetmomentum( mcp , pdouble )
- p(1) = pdouble(1)
- p(2) = pdouble(2)
- p(3) = pdouble(3)
-
- pxy = sqrt( p(1)*p(1)+p(2)*p(2) )
- ptot = sqrt( p(1)*p(1)+p(2)*p(2)+p(3)*p(3) )
- costh = pxy/ptot*p(3)/abs(p(3))
-
- call hfill( 20, costh , 0. , 1. )
-
- phi = atan2( p(1) , p(2) )
- call hfill( 25, phi*180./3.14159 , 0. , 1. )
-
-
- if( -.00001.lt.phi.and.phi.lt.0.00001) then
- write(*,*) phi, ' - ' ,lcmcpgetpdg( mcp )
- endif
-
- call hfill
- & ( 30, real(lcmcpgetenergy(mcp))/ptot , 0., 1.)
-
- endif
- 10 continue
- enddo
- endif
- enddo
- 11 continue
-
-c ---- end event loop ------
-
-
- status = lcrdrclose( reader )
-
- 99 continue
-
-c-- write and close hbook file
- call hrout(0,icycle,' ')
- call rzstat(' ',999,' ')
- call hrend('lciohbk')
-
- end
-
-
-
diff --git a/examples/f77/lciohbook/plot.kumac b/examples/f77/lciohbook/plot.kumac
deleted file mode 100644
index d2f45948b..000000000
--- a/examples/f77/lciohbook/plot.kumac
+++ /dev/null
@@ -1,9 +0,0 @@
-
-hi/fil 1 lcio.hbook
-zon 2 2
-
-hi/plo 10
-hi/plo 20
-hi/plo 25
-hi/plo 30
-
diff --git a/examples/f77/lciohbook/test.slcio b/examples/f77/lciohbook/test.slcio
deleted file mode 100644
index f33b8464c..000000000
Binary files a/examples/f77/lciohbook/test.slcio and /dev/null differ
diff --git a/examples/f77/pythia/README b/examples/f77/pythia/README
deleted file mode 100644
index d74805b45..000000000
--- a/examples/f77/pythia/README
+++ /dev/null
@@ -1,35 +0,0 @@
-==========================================================================
-This directory contains additional examples for the Fortran interface to LCIO
-
-Pythia is required to build and run these examples.
-
-pysimjob.F:
-a program to handle input written by lcwrite which writes the content
-of the HEPEVT common to an output file.
-The file is read into the HEPEVT common and its content is written
-to a LCIO output file 'pysimjob.slcio' .
-The file is closed an read again using the utility 'levtdumpevent'
-(in $LCIO/src/cpp/src/IMPL/LCTOOLS.cc) to dump the LCIO content.
-
-pyanajob.F
-a program which analyzes the LCIO output file of pysimjob.F
-assuming that the LCIO file 'pysimjob.slcio' exists.
-
-There are also 2 scripts to support the programs
-of this directory.
-
-pythiahepevt.sh:
-a bourne shell script to run a PYTHIA job that creates
-an output file 'pythia.data' using lcwrite and a lof file 'pythiahepevt.log'
-which lists the common HEPEVT content of generated events.
-Remarks:
-lcwrite is modified to include charge information of the generated
-MC particles but the output structure is still consistent with
-the "standard" lcwrite routine.
-pythiahepevt.sh requires the cernlib 2002 or newer given by the environment
-variable CERN_ROOT (default: /cern/pro)
-
-runPysimjob.sh:
-a script to run the pysimjob_F executable
-
-==========================================================================
diff --git a/examples/f77/pythia/pyanajob.F b/examples/f77/pythia/pyanajob.F
deleted file mode 100644
index a87e46087..000000000
--- a/examples/f77/pythia/pyanajob.F
+++ /dev/null
@@ -1,300 +0,0 @@
-c**********************************************************
-c
- program pyanajob
-c
-c Trivial test program to demonstrate the use of LCIO
-c from Fortran
-c
-c H. Vogt 30/09/2003
-c**********************************************************
- implicit none
-
-
-#include "lciof77api.inc"
-#include "lciof77apiext.inc"
-
- PTRTYPE reader, event, col, mcparticlev(500), hit, pmcp
-
- integer status
- integer irun, nrun, nrunmax,
- & ievt, ievent, itim
- integer nmcpc, genst, simst, ndaughters
- character*100 coltypename
-
-c$$$ PTRTYPE lccreatereader, reader
-c$$$ PTRTYPE lcreadnextevent, event
-c$$$ PTRTYPE lcgetcollection, col
-c$$$ PTRTYPE lcgetelement, mcparticlev(1000)
-c$$$ PTRTYPE lcgetsimcalohit, hit
-c$$$ PTRTYPE pmcp
-c$$$
-c$$$ integer lcreaderopen, lcreaderclose, status
-c$$$ integer lcgeteventheader, irun, nrun, nrunmax,
-c$$$ & ievt, ievent, itim
-c$$$ integer lcgetnumberofelements, lcgetsimtrackerhit
-c$$$ integer lcgethepevt
-c$$$ integer lcdumpevent, lcdumpeventdetailed
-c$$$ integer lcgetsimcalohitnmcp, nmcpc, lcgetsimcalohitcmcp
-c$$$ integer lcgetmcparticlecont, genst, simst, ndaughters
-
- integer i, j, k, length, lenocc
- integer ncols, ncolvec
-
- integer cellid, cellid0, cellid1, pdg
- real dedx, time, energy, posv(3), momv(3), mass,
- & charge
- double precision dposv(3)
-
- integer linfile
- character*80 infile
- character*20 detname
- parameter (ncols=7)
- character*40 colnames(ncols)
- data colnames /'MCParticle',
- & 'ECAL007', 'TPC4711', 'TPC4711UserFloatExtension',
- & 'TPC4711UserIntExtension', 'AdditionalExtension',
- & 'TPCRawFADC' /
-
-
- infile = 'pysimjob.slcio'
- linfile = lenocc( infile )
-
- reader = lcrdrcreate()
- write(*,*) ' created reader at ' , reader
-
-c ---- run loop ------
- nrunmax = 1
- do irun = 1,nrunmax
-
- status = lcrdropen( reader, infile )
-
- if( status.eq.0) then
- print '(2a)', ' could not open file ', infile(1:linfile)
- return
- else
- print '(2a)', ' opened file ', infile(1:linfile)
- endif
-
-c ---- event loop ------
- do ievt = 1,100000
- event = lcrdrreadnextevent( reader , LCIO_READ_ONLY )
- if( event.eq.0 ) goto 10
-
- print '(a,z8)', ' event pointer: ', event
-
- status = lcgeteventheader( event , nrun , ievent , itim ,
- & detname )
-
-
- write(*,*) " run: ",nrun,", evt: ",ievent,
- & " det: ",detname(1:lenocc(detname))
-
-C *** Check on collections for first event of each run
- if (ievent .eq. irun) then
- status = lcdumpevent( event )
- print '(a,/,/)' , '****************************************'
- do i = 1,ncols
- col = lcevtgetcollection ( event ,
- & colnames(i)(1:lenocc(colnames(i)))//char(0) )
- if (col .ne. 0) then
- ncolvec = lccolgetnumberofelements ( col )
- coltypename = lccolgettypename ( col )
- print '(2a,i5,2a)', colnames(i)(1:lenocc(colnames(i))),
- & ' collection with ', ncolvec,
- & ' elements of type ',
- & coltypename(1:lenocc(coltypename))
-
- if (coltypename(1:lenocc(coltypename)) .eq.
- & 'MCParticle') then
- print '(a)' , 'MCParticle: pointer - content'
- do j = 1,ncolvec
- mcparticlev(j) = lccolgetelementat ( col, j )
- status = lcgetmcparticledata ( mcparticlev(j),
- & pdg , genst , simst , dposv , momv , mass, charge,
- & ndaughters)
- print '(z10,3h - ,3i6,3d12.5,5e10.3,i3)' ,
- & mcparticlev(j) ,
- & pdg , genst , simst, dposv , momv , mass , charge,
- & ndaughters
- enddo
- print '(a,a)' , 'MCParticle pointers summary: '
- print '(8z10)' , (mcparticlev(k),k=1,ncolvec)
-
-c *** for MCParticle file the HEPEVT common and print
- status = lcio2hepevt( event )
- if (status .eq. 0) then
- print '(a,a,i5)'
- & , 'PYSIMJOB: error - can not set '
- & , 'hepevt common content for event ', i
- else
- call lclist
- endif
-
- endif
-
-
- if (coltypename(1:lenocc(coltypename)) .eq.
- & 'SimTrackerHit') then
- print '(a)' , 'collection elements have:'
- do j = 1,ncolvec
- status = lcgetsimtrackerhit
- & ( col , j , cellid , dposv , dedx , time , pmcp )
- print '(i3,3d12.5,2e10.3,z10)',
- & cellid , dposv , dedx , time , pmcp
- enddo
- endif
-
- if (coltypename(1:lenocc(coltypename)) .eq.
- & 'SimCalorimeterHit') then
- print '(a)' , 'collection elements have:'
- do j = 1,ncolvec
- hit = lcgetsimcalohit
- & ( col , j , cellid0 , cellid1 , energy, posv )
- print '(2i11,4e10.3)',
- & cellid0 , cellid1 , energy, posv
- nmcpc = lcschgetnmcparticles( hit )
- print '(a)' , ' particle contributions have:'
- do k = 1,nmcpc
- status = lcgetsimcalohitmccont
- & ( hit , k , pmcp , energy , time , pdg )
- print '(5x,z10,2e10.3,i6)',
- & pmcp , energy , time , pdg
- enddo
- enddo
- endif
-
- else
- print '(3a)', 'no ', colnames(i)(1:lenocc(colnames(i))),
- & ' collection found'
- endif
- enddo
-
- endif
-
-
- enddo
-c ---- end event loop ------
-
-10 continue
- status = lcrdrclose( reader )
- print '(3a,i1)', ' closed file ', infile(1:linfile),
- & ' - status : ', status
- print '(a)', '*************************************************'
- enddo
-c ---- end run loop ------
-*
- end
-*
- SUBROUTINE LCLIST
-*****************************************************************************
-*****************************************************************************
-*
-* SUBROUTINE LCLIST(LUN)
-*
-* Purpose: List HEPEVT common
-* to printer in Linear Collider workshop formatted form
-*
-* NOTES: * All UNSTABLE particles with an average proper lifetime of
-* less than 10 mm should be decayed by the generator; others
-* (eg K0, Lambda0) should be left to the simulation.
-* This can be achieved in JETSET using MSTJ(22)=2 with the
-* default setting of PARJ(71)
-*
-* * If you are using PYTHIA/JETSET remember to fill the
-* HEPEVT commons with CALL LUHEPC(1)
-*
-* * If you are using PYTHIA 6.1 you need PYHEPC(1)
-*
-* * You must ensure that the HEPEVT commons are DOUBLE PRECISION
-* (In JETSET 7.4 they are single precision by default)
-*
-* * The event number (NEVHEP) is not written to file; the
-* simulation will take each event individually
-*
-* * For SPARTICLE codes, see
-* http://d0lblt.lbl.gov/wwwpdg/mc_numbers.htm
-*
-* * For the specifications of the HEPEVT commons see the LEP1
-* Yellow Report or the PYTHIA/JETSET manual
-*
-* * The spin part (SHEP) of the commons is not written to file
-*
-*
-* Output: to printer
-*
-* Called: Per event
-*
-* Author: Harald Vogt (hvogt@ifh.de) taken from LCWRITE
-* Author: Hywel Phillips (H.T.Phillips@rl.ac.uk)
-*
-*
-*****************************************************************************
-*****************************************************************************
-
- IMPLICIT NONE
-
-#include "hepevt0.inc"
-#include "hepevt1.inc"
-
- INTEGER LUN,I,J,K,L,M
-*
-* write event data
-*
- LUN = 6
- IF (NHEP.GT.NMXHEP) THEN
- WRITE(6,*) 'LCLIST: Error- NHEP ',NHEP,' is too big'
- WRITE(6,*) 'LCLIST: Event not written to file'
- RETURN
- ENDIF
-
- WRITE(LUN,1) NEVHEP
- 1 FORMAT(' event #:',I5)
- WRITE(LUN,10) NHEP
- DO I=1,NHEP
- WRITE(LUN,12) I,ISTHEP(I),IDHEP(I),(JMOHEP(J,I),J=1,2),
- & (JDAHEP(K,I),K=1,2),
- & (PHEP(L,I),L=1,5),
- & (VHEP(M,I),M=1,4)
- ENDDO
-
- 10 FORMAT(' # of particles in this event:',1I5,/,
- & ' I sts pID 1st_m 2nd_m',
- & ' 1st_d lst_d Px Py Pz',
- & ' E mass',
- & ' Vx Vy Vz time')
-
- 12 FORMAT(1X,I5,I4,I6,4I6,5F10.3,4E11.3)
- RETURN
-
- 999 WRITE(6,*) 'LCLIST: Error writing to file on unit ',LUN
- STOP
- END
-*
-*****************************************************************************
-*****************************************************************************
-*
-* Utility package taken from cernlib
-*
-*****************************************************************************
-*****************************************************************************
-*
- INTEGER FUNCTION LENOCC (CHV)
-C
-C CERN PROGLIB# M507 LENOCC .VERSION KERNFOR 4.21 890323
-C ORIG. March 85, A.Petrilli, re-write 21/02/89, JZ
-C
-C- Find last non-blank character in CHV
-
- CHARACTER CHV*(*)
-
- N = LEN(CHV)
-
- DO 17 JJ= N,1,-1
- IF (CHV(JJ:JJ).NE.' ') GO TO 99
- 17 CONTINUE
- JJ = 0
-
- 99 LENOCC = JJ
- RETURN
- END
-*
diff --git a/examples/f77/pythia/pysimjob.F b/examples/f77/pythia/pysimjob.F
deleted file mode 100644
index dea1568e9..000000000
--- a/examples/f77/pythia/pysimjob.F
+++ /dev/null
@@ -1,469 +0,0 @@
-
-**********************************************************************
-* *
- PROGRAM PYSIMJOB !*
-* PYSIMJOB *
-* A program to demonstrate the use of LCIO *
-* including the StdHep COMMON for MCParticle info *
-* as a check that the program works as intended. *
-* *
-* The StdHep COMMON is filled here by *
-* reading the file pythia.data written using a modified *
-* version of LCWRITE including particle charges. *
-* *
-* TO produce the file pythia.data use the script pythiahepevt.sh *
-* *
-* H. Vogt 30/09/2003 *
-**********************************************************************
- implicit none
-
-#include "lciof77api.inc"
-#include "lciof77apiext.inc"
-
- PTRTYPE writer, reader, event
- PTRTYPE header, col, mcparticle
- integer status
-
- character*80 filename
- character*80 detname, comment, subdet
-
- integer linfile, lfilename, getstring, lenocc
- integer i, j, k, irun, iev, itim, locf
-
-C *** Subdetector arrays definitions (must be consistent)- be very carfully !!!
-C usage in lcwriterunheader (brdets, ndets, chlen)
-C and lcreadnextrunheader (subdets, nsubd(io), chlenout)
-
- integer len
- integer ndets
- parameter (ndets=15)
-ccc integer chlen
-ccc parameter (chlen=4)
- character*4 brdets(ndets), chtmp
- data brdets /'vtx', 'itc', 'ftd', 'sit', 'tpc', 'bcal', 'ecal',
- & 'coil', 'yoke', 'lat', 'mask', 'bpip', 'fch',
- & 'quad', 'hall'/
-
- integer nsubd, nsubdio
- parameter (nsubd=50)
-ccc integer chlenout
-ccc parameter (chlenout=4)
- character*4 subdets(nsubd)
-
-C
-C *** Local definitions
- character*80 infile
- integer lunin, ieorun
- integer length
-
-C *** Filename of LCIO file
- filename = 'pysimjob.slcio'
- lfilename = lenocc( filename )
-
-C *** for skipping pass 1 - go to 100
-ccc go to 100
-C
-C============================================================================
-C *** PASS1 PASS1 PASS1
-C============================================================================
-
- filename = 'pysimjob.slcio'
- lfilename = lenocc( filename )
-
-C *** Open LCIO StdHep input file
- infile = 'pythia.data'
- linfile = lenocc ( infile )
- lunin = 1
-
- print *, ' '
- print '(4a)' , 'PYSIMJOB: first pass - read file ''' ,
- & infile(1:lenocc(infile)) ,
- & ''' and write LCIO file ''',
- & filename(1:lfilename) ,''''
- print '(a)' , '**************************************************'
- open (unit=lunin, status='old',
- & file=infile, form='formatted', err= 900)
-
-c *** Set charge vector for hepevt common to zero
- do i = 1,nmxhep
- chhep(i) = 0.
- end do
-
-C *** Open LCIO output
- writer = lcwrtcreate()
- status = lcwrtopen( writer, filename, LCIO_WRITE_NEW )
- if (status .eq. 0) then
- print *, 'PYSIMJOB: error - lcio file could not be opened'
- stop
- else
- print '(a,a)', 'PYSIMJOB: file opened: ', filename(1:lfilename)
- end if
-
-C *** Create, fill, and write Runheader
- irun = 9999
- status = lcwriterunheader(
- & writer , irun , 'Tesla Detector' ,
- & 'Pythia generated events' ,
- & brdets , ndets , len( brdets(1) ) )
-
-C
-C *** Loop over events to be generated.
-C
- itim = 20030923
- iev = 0
-10 continue
-
-C *** Read one pythia event written by LCWRITE into common hepevt
- call readstdhep ( lunin, ieorun )
- if (ieorun .eq. 0) then
-C *** Set event # in common hepevt
- iev = iev + 1
- nevhep = iev
-cc CALL LCLIST
-
-C *** Create event
- event = lcevtcreate()
-
-C *** Write event header
- status = lcseteventheader( event , irun , iev , itim ,
- & 'Tesla Detector' )
-
-C *** Convert hepevt common content to LCIO MCParticle collection
- status = hepevt2lcio( event )
-
- IF (status .eq. 0) THEN
- print *, 'PYSIMJOB: error - can not write hepevt common'
- & , ' for event ', iev
- END IF
-
-C *** Check on MCParticle collection
- col = lcevtgetcollection ( event , LCIO_MCPARTICLE )
-
- if (col .ne. 0) then
-
- status = lcio2hepevt( event )
- if (status .eq. 0) then
- print '(a,a,i5)'
- & , 'PYSIMJOB: error - can not set '
- & , 'hepevt common content for event ', i
- stop
- endif
-
- status = lccolgetnumberofelements ( col )
- print '(a,i5,a,z8,a,i5,a)' ,
- & 'Event ', iev , ' at pointer ' , event ,
- & ' has a MCParticle collection with ', status ,
- & ' elements'
- do j = 1,status
- mcparticle = lccolgetelementat( col, j )
- enddo
- else
- print '(a)', 'no MCParticle collection found'
- endif
-
-C *** Write this event to lcio output file
- status = lcwrtwriteevent( writer , event )
- if (status .eq. 0) then
- print *, 'PYSIMJOB: error - can not write event', iev
- stop
- else
- end if
-
-C *** Delete event
- status = lcevtdelete( event )
- end if
- if (ieorun .eq. 0) go to 10
-C
-C *** EOF on input file seen, close files, delete writer
-C
-
- status = lcwrtclose( writer )
- print '(a,a,a,i2)', ' PYSIMJOB: file ', filename(1:lfilename)
- & , ' closed, status = ' , status
- status = lcwrtdelete( writer )
- close ( unit=lunin )
-
-C============================================================================
-C *** PASS2 PASS2 PASS2
-C============================================================================
-100 continue
-
- filename = 'pysimjob.slcio'
- lfilename = lenocc( filename )
-
- print *, ' '
- print '(3a)' , 'PYSIMJOB: second pass - read file ''' ,
- & filename(:lfilename), ''' and dump events read'
- print '(a)' , '**************************************************'
-
-C *** now reopen the output as input
- reader = lcrdrcreate()
- status = lcrdropen( reader, filename )
- if( status.eq.0) then
- print '(a,a,a)', 'PYSIMJOB: error - can not open file '''
- & , filename(1:lfilename), ''' for reading'
- stop
- else
- print '(a,a)', 'PYSIMJOB: opened file: ', filename(1:lfilename)
- endif
-
-C *** Read Runheader info
- irun = 0
- detname = ' '
- comment = ' '
- do i = 1,nsubd
- subdets(i) = ' '
- enddo
-
-C nsubdio is I/O argument !
- nsubdio = nsubd
- header = lcreadnextrunheader( reader,
- & irun, detname, comment ,
- & subdets , nsubdio, len( subdets(1) ) )
-
- print '(/a)', "run header info"
- print '(a,i5)', " run: ", IRUN
- print '(a,a)', " det: ", detname(1:lenocc(detname))
- print '(a,a)', " comment: ", comment(1:lenocc(comment))
-
- print '(a)', "subdetectors:"
- do i = 1,nsubdio
- print '(a,a)', " ", subdets(i)
- end do
- print '(a,/)', "run header info finished"
-
-C *** Event loop **************************************************************
- do i = 1,1000000
- event = lcrdrreadnextevent( reader , LCIO_READ_ONLY )
- if( event.eq.0 ) goto 110
-
-C *** Get event header
- irun = 0
- iev = 0
- itim = 0
- detname = ' '
- status = lcgeteventheader( event , irun , iev , itim ,
- & detname )
-
- print '(/,a)' , '*********************************************'
- print '(a,z8)', 'event pointer for this event is: ', event
- print '(a,i5,a,i5,a,a)', " run: ",irun,", evt: ",iev
- & , ", det: ",detname(1:lenocc(detname))
- print '(a)', '************************************************'
-
-C *** Check on MCParticle collection
- col = lcevtgetcollection ( event , 'MCParticle'//char(0) )
- if (col .ne. 0) then
- status = lcio2hepevt( event )
- if (status .eq. 0) then
- print '(a,a,i5)'
- & , 'PYSIMJOB: error - can not set '
- & , 'hepevt common content for event ', i
- endif
- status = lccolgetnumberofelements ( col )
- print '(a,i5,a)', 'MCParticle collection with ', status
- & , ' elements'
- do j = 1,status
- mcparticle = lccolgetelementat ( col, j )
- enddo
- else
- print '(a)', 'no MCParticle collection found'
- endif
-
-C *** extended printout for the first 3 events
- if (i .lt. 4) then
-C List content of StdHep common
- call lclist
-C and all MCParticle pointers
- print '(a)', "all pointers of MCParticles;"
- print '(10z8)', (mcpointerv(j),j=1,nhep)
- endif
- enddo
-
-C *** End of event loop *******************************************************
-110 continue
-
-C *** EOF on input, close and delete reader and stop
- print *, 'eof on input file ', filename(1:lfilename)
- status = lcrdrclose( reader )
- print '(a,a,a,i2)', ' PYSIMJOB: file ', filename(1:lfilename)
- & , ' closed, status = ' , status
- status = lcrdrdelete( reader )
- print *, 'Job finished !'
- stop
-
-C *** Open error for pythia.data input file
-900 continue
- print '(3a)', 'PYSIMJOB: file ', infile(1:linfile),
- & ' does not exist'
- print '(a)', 'Use ''pythiahepevt.sh'' to create this file'
- stop
-C
- end
-*
- SUBROUTINE READSTDHEP (LUN, IEORUN)
-*****************************************************************************
-*****************************************************************************
-*
-* Reading of events written by LCWRITE
-*
-* Arguments:
-* LUN logical unit number for input file
-* IEORUN flag for EOF on input file
-*
-*****************************************************************************
-*****************************************************************************
-*
-
- IMPLICIT NONE
-
-#include "hepevt0.inc"
-#include "hepevt1.inc"
-
- INTEGER LUN, IEORUN
- INTEGER I, J, K, L, ICHECK
- INTEGER PYCHGE
-
-* Read one event
- IEORUN = 0
- READ (LUN, 10, IOSTAT=ICHECK) NHEP
-
- DO I = 1 , NHEP
- READ (LUN, 12, IOSTAT=ICHECK, END=999) ISTHEP(I),
- + IDHEP(I), (JMOHEP(J,I),J=1,2), (JDAHEP(L,I),L=1,2)
- READ (LUN, 11, IOSTAT=ICHECK, END=999) (PHEP(J,I),J=1,5)
- READ (LUN, 11, IOSTAT=ICHECK, END=999) (VHEP(L,I),L=1,4),
- + CHHEP(I)
-
-c$$$ write(*,1234) i,ISTHEP(I),IDHEP(I),(JMOHEP(J,I),J=1,2),
-c$$$ $ (JDAHEP(L,I),L=1,2)
- END DO
-
-c$$$ 1234 FORMAT(I3,I5,I9,4I5)
-
- RETURN
-*
- 999 CONTINUE
- PRINT *, 'EOF on HEPEVT input on unit', LUN
- IEORUN = 1
- RETURN
-*
- 10 FORMAT(1I5)
- 11 FORMAT(10F17.10)
- 12 FORMAT(I9,I9,4I5)
-*
- END
-*
- SUBROUTINE LCLIST
-*****************************************************************************
-*****************************************************************************
-*
-* SUBROUTINE LCLIST(LUN)
-*
-* Purpose: List HEPEVT common
-* to printer in Linear Collider workshop formatted form
-*
-* NOTES: * All UNSTABLE particles with an average proper lifetime of
-* less than 10 mm should be decayed by the generator; others
-* (eg K0, Lambda0) should be left to the simulation.
-* This can be achieved in JETSET using MSTJ(22)=2 with the
-* default setting of PARJ(71)
-*
-* * If you are using PYTHIA/JETSET remember to fill the
-* HEPEVT commons with CALL LUHEPC(1)
-*
-* * If you are using PYTHIA 6.1 you need PYHEPC(1)
-*
-* * You must ensure that the HEPEVT commons are DOUBLE PRECISION
-* (In JETSET 7.4 they are single precision by default)
-*
-* * The event number (NEVHEP) is not written to file; the
-* simulation will take each event individually
-*
-* * For SPARTICLE codes, see
-* http://d0lblt.lbl.gov/wwwpdg/mc_numbers.htm
-*
-* * For the specifications of the HEPEVT commons see the LEP1
-* Yellow Report or the PYTHIA/JETSET manual
-*
-* * The spin part (SHEP) of the commons is not written to file
-*
-*
-* Output: to printer
-*
-* Called: Per event
-*
-* Author: Harald Vogt (hvogt@ifh.de) taken from LCWRITE
-* ( provided by Hywel Phillips (H.T.Phillips@rl.ac.uk))
-*
-*
-*****************************************************************************
-*****************************************************************************
-
- IMPLICIT NONE
-
-#include "hepevt0.inc"
-#include "hepevt1.inc"
-
- INTEGER LUN,I,J,K,L,M
-*
-* write event data
-*
- LUN = 6
- IF (NHEP.GT.NMXHEP) THEN
- WRITE(6,*) 'LCLIST: Error- NHEP ',NHEP,' is too big'
- WRITE(6,*) 'LCLIST: Event not written to file'
- RETURN
- ENDIF
-
- WRITE(LUN,1) NEVHEP
- 1 FORMAT(' event #:',I5)
- WRITE(LUN,10) NHEP
- DO I=1,NHEP
- WRITE(LUN,12) I,ISTHEP(I),IDHEP(I),(JMOHEP(J,I),J=1,2),
- & (JDAHEP(K,I),K=1,2),
- & (PHEP(L,I),L=1,5),
- & (VHEP(M,I),M=1,4)
- ENDDO
-
- 10 FORMAT(' # of particles in this event:',1I5,/,
- & ' I sts pID 1st_m 2nd_m',
- & ' 1st_d lst_d Px Py Pz',
- & ' E mass',
- & ' Vx Vy Vz time')
-
- 12 FORMAT(1X,I5,I4,I6,4I6,5F10.3,4E11.3)
- RETURN
-
- 999 WRITE(6,*) 'LCLIST: Error writing to file on unit ',LUN
- STOP
- END
-*
-*****************************************************************************
-*****************************************************************************
-*
-* Utility package taken from cernlib
-*
-*****************************************************************************
-*****************************************************************************
-*
- INTEGER FUNCTION LENOCC (CHV)
-C
-C CERN PROGLIB# M507 LENOCC .VERSION KERNFOR 4.21 890323
-C ORIG. March 85, A.Petrilli, re-write 21/02/89, JZ
-C
-C- Find last non-blank character in CHV
-
- CHARACTER CHV*(*)
-
- N = LEN(CHV)
-
- DO 17 JJ= N,1,-1
- IF (CHV(JJ:JJ).NE.' ') GO TO 99
- 17 CONTINUE
- JJ = 0
-
- 99 LENOCC = JJ
- RETURN
- END
-*
diff --git a/examples/f77/pythia/pythiahepevt.sh b/examples/f77/pythia/pythiahepevt.sh
deleted file mode 100755
index d4bfd8cd6..000000000
--- a/examples/f77/pythia/pythiahepevt.sh
+++ /dev/null
@@ -1,404 +0,0 @@
-#!/bin/sh
-################### script to create a hepevt output ascii file ###############
-# #
-# output file: $LCIO/bin/pythia.data #
-# needs cernlib 2002 or higher #
-# #
-###############################################################################
-
-rm -rf /tmp/pyhepevt.f /tmp/pyhepevt.bin pythia.log pythia.data
-cat > /tmp/pyhepevt.f << EOF
-
-**********************************************************************
-
-C PYHEPEVT
-C A simple program to write a hepevt output ascii file
-
- PROGRAM PYHEPEVT
-
-C *** PYTHIA commonblocks.
-
-C...This file contains an almost complete listing of all PYTHIA
-C...commonblocks, and additionally some recommended other
-C...declarations. You may copy this to the top of your
-C...mina program and then eliminate unnecessary parts.
-
-C-----------------------------------------------------------------
-
-C...All real arithmetic in double precision.
- IMPLICIT DOUBLE PRECISION(A-H, O-Z)
-C...Three Pythia functions return integers, so need declaring.
- INTEGER PYK,PYCHGE,PYCOMP
-C...Parameter statement to help give large particle numbers
-C...(left- and righthanded SUSY, technicolor, excited fermions,
-C...extra dimensions).
- PARAMETER (KSUSY1=1000000,KSUSY2=2000000,KTECHN=3000000,
- &KEXCIT=4000000,KDIMEN=5000000)
-
-C...EXTERNAL statement links PYDATA on most machines.
- EXTERNAL PYDATA
-
-C...Commonblocks.
-C...The event record.
- COMMON/PYJETS/N,NPAD,K(4000,5),P(4000,5),V(4000,5)
-C...Parameters.
- COMMON/PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
-C...Particle properties + some flavour parameters.
- COMMON/PYDAT2/KCHG(500,4),PMAS(500,4),PARF(2000),VCKM(4,4)
-C...Decay information.
- COMMON/PYDAT3/MDCY(500,3),MDME(8000,2),BRAT(8000),KFDP(8000,5)
-C...Particle names
- COMMON/PYDAT4/CHAF(500,2)
- CHARACTER CHAF*16
-C...Random number generator information.
- COMMON/PYDATR/MRPY(6),RRPY(100)
-C...Selection of hard scattering subprocesses.
- COMMON/PYSUBS/MSEL,MSELPD,MSUB(500),KFIN(2,-40:40),CKIN(200)
-C...Parameters.
- COMMON/PYPARS/MSTP(200),PARP(200),MSTI(200),PARI(200)
-C...Internal variables.
- COMMON/PYINT1/MINT(400),VINT(400)
-C...Process information.
- COMMON/PYINT2/ISET(500),KFPR(500,2),COEF(500,20),ICOL(40,4,2)
-C...Parton distributions and cross sections.
- COMMON/PYINT3/XSFX(2,-40:40),ISIG(1000,3),SIGH(1000)
-C...Resonance width and secondary decay treatment.
- COMMON/PYINT4/MWID(500),WIDS(500,5)
-C...Generation and cross section statistics.
- COMMON/PYINT5/NGENPD,NGEN(0:500,3),XSEC(0:500,3)
-C...Process names.
- COMMON/PYINT6/PROC(0:500)
- CHARACTER PROC*28
-C...Total cross sections.
- COMMON/PYINT7/SIGT(0:6,0:6,0:5)
-C...Photon parton distributions: total and valence only.
- COMMON/PYINT8/XPVMD(-6:6),XPANL(-6:6),XPANH(-6:6),XPBEH(-6:6),
- &XPDIR(-6:6)
- COMMON/PYINT9/VXPVMD(-6:6),VXPANL(-6:6),VXPANH(-6:6),VXPDGM(-6:6)
-C...Supersymmetry parameters.
- COMMON/PYMSSM/IMSS(0:99),RMSS(0:99)
-C...Supersymmetry mixing matrices.
- COMMON/PYSSMT/ZMIX(4,4),UMIX(2,2),VMIX(2,2),SMZ(4),SMW(2),
- &SFMIX(16,4),ZMIXI(4,4),UMIXI(2,2),VMIXI(2,2)
-C...R-parity-violating couplings in supersymmetry.
- COMMON/PYMSRV/RVLAM(3,3,3), RVLAMP(3,3,3), RVLAMB(3,3,3)
-C...Internal parameters for R-parity-violating processes.
- COMMON/PYRVNV/AB(2,16,2),RMS(0:3),RES(6,5),IDR,IDR2,DCMASS,KFR(3)
- COMMON/PYRVPM/RM(0:3),A(2),B(2),RESM(2),RESW(2),MFLAG
- LOGICAL MFLAG
-C...Parameters for Gauss integration of supersymmetric widths.
- COMMON/PYINTS/XXM(20)
- COMMON/PYG2DX/X1
-C...Histogram information.
- COMMON/PYBINS/IHIST(4),INDX(1000),BIN(20000)
-C...HEPEVT commonblock.
- PARAMETER (NMXHEP=4000)
- COMMON/HEPEVT/NEVHEP,NHEP,ISTHEP(NMXHEP),IDHEP(NMXHEP),
- &JMOHEP(2,NMXHEP),JDAHEP(2,NMXHEP),PHEP(5,NMXHEP),VHEP(4,NMXHEP)
- DOUBLE PRECISION PHEP,VHEP
-C...User process initialization commonblock.
- INTEGER MAXPUP
- PARAMETER (MAXPUP=100)
- INTEGER IDBMUP,PDFGUP,PDFSUP,IDWTUP,NPRUP,LPRUP
- DOUBLE PRECISION EBMUP,XSECUP,XERRUP,XMAXUP
- COMMON/HEPRUP/IDBMUP(2),EBMUP(2),PDFGUP(2),PDFSUP(2),
- &IDWTUP,NPRUP,XSECUP(MAXPUP),XERRUP(MAXPUP),XMAXUP(MAXPUP),
- &LPRUP(MAXPUP)
-C...User process event common block.
- INTEGER MAXNUP
- PARAMETER (MAXNUP=500)
- INTEGER NUP,IDPRUP,IDUP,ISTUP,MOTHUP,ICOLUP
- DOUBLE PRECISION XWGTUP,SCALUP,AQEDUP,AQCDUP,PUP,VTIMUP,SPINUP
- COMMON/HEPEUP/NUP,IDPRUP,XWGTUP,SCALUP,AQEDUP,AQCDUP,IDUP(MAXNUP),
- &ISTUP(MAXNUP),MOTHUP(2,MAXNUP),ICOLUP(2,MAXNUP),PUP(5,MAXNUP),
- &VTIMUP(MAXNUP),SPINUP(MAXNUP)
-
-C *** HEPEVTCH commonblock.
- REAL CHHEP(NMXHEP)
- COMMON /HEPEVTCH/ CHHEP
- SAVE /HEPEVTCH/
-
-
- LOGICAL IFLIST
- CHARACTER*80 FILENAME
-
-C *** Set flag for listing hepevt common content
- IFLIST = .TRUE.
-
-C *** Open ascii file for output and list if requited
- LUNOUT = 1
- FILENAME = 'pythia.data'
- OPEN (UNIT=LUNOUT, STATUS='NEW',
- & FILE=FILENAME, FORM='FORMATTED')
-*
- IF (IFLIST) THEN
- LUNLIST = 2
- FILENAME = 'pythiahepevt.log'
- OPEN (UNIT=LUNLIST, STATUS='NEW',
- & FILE=FILENAME, FORM='FORMATTED')
- END IF
-
-C *** Take values from example_MyPythiaOnlyToHepMC.cxx
- MSEL = 0
- MSUB(20) = 1
- MRPY(1) = 55122
-
-C *** Tell Pythia not to write multiple copies of particles in event record.
- MSTP(128) = 2
-
-C *** Set the top mass
- PMAS(6,1) = 175.
-
-C *** Call pythia initialization
- ECMS = 14000.
- CALL PYINIT( "CMS", "p", "p", ECMS )
-
-
-C *** Loop over events to be generated.
- NEVENTS = 20
- DO IEV = 1,NEVENTS
-
-C *** Generate one pythia event
- CALL PYEVNT
-
-C *** Debugging option (activate statement below)
-ccc CALL PYLIST (2)
-
-C *** Fill hepevt common with pythia output, set event number
- CALL PYHEPC ( 1 )
- NEVHEP = IEV
-
-C *** fill hepevtch common with charge using PYTHIA utility PYCHGE
- DO I = 1,NHEP
- CHHEP(I) = PYCHGE (IDHEP(I))/3.
- END DO
-
-
-C *** List hepevt common content if requested
- IF (IFLIST) CALL LCLIST ( LUNLIST )
-
-C *** Write hepevt to file
- NEVHEP = IEV
- CALL LCWRITE ( LUNOUT )
-
-
- END DO
-
-C *** List statistics for each process type.
- CALL PYSTAT ( 1 )
-
-C *** Close output file(s)
- IF (IFLIST) CLOSE ( LUNLIST )
- CLOSE ( LUNOUT )
- print '(a,a,a,i2)', 'PYHEPEVT: hepevt output ascii file closed'
-*
- END
-*
- SUBROUTINE LCLIST (LUN)
-*****************************************************************************
-*
-* SUBROUTINE LCLIST (LUN)
-*
-* Purpose: List HEPEVT common
-* to printer in Linear Collider workshop formatted form
-*
-* NOTES: * All UNSTABLE particles with an average proper lifetime of
-* less than 10 mm should be decayed by the generator; others
-* (eg K0, Lambda0) should be left to the simulation.
-* This can be achieved in JETSET using MSTJ(22)=2 with the
-* default setting of PARJ(71)
-*
-* * If you are using PYTHIA/JETSET remember to fill the
-* HEPEVT commons with CALL LUHEPC(1)
-*
-* * If you are using PYTHIA 6.1 you need PYHEPC(1)
-*
-* * You must ensure that the HEPEVT commons are DOUBLE PRECISION
-* (In JETSET 7.4 they are single precision by default)
-*
-* * The event number (NEVHEP) is not written to file; the
-* simulation will take each event individually
-*
-* * For SPARTICLE codes, see
-* http://d0lblt.lbl.gov/wwwpdg/mc_numbers.htm
-*
-* * For the specifications of the HEPEVT commons see the LEP1
-* Yellow Report or the PYTHIA/JETSET manual
-*
-* * The spin part (SHEP) of the commons is not written to file
-*
-*
-* Output: to printer
-*
-* Called: Per event
-*
-* Author: Harald Vogt (hvogt@ifh.de) taken from LCWRITE
-* Author: Hywel Phillips (H.T.Phillips@rl.ac.uk)
-*
-*
-*****************************************************************************
-*****************************************************************************
-
- IMPLICIT NONE
-* switched to NMXHEP = 4000 for compatibility with PYTHIA 6.1
-c M.Dobbs 04.2000 NMXHEP = 2000 for compatibility with PYTHIA 5.7
- INTEGER NMXHEP
- PARAMETER (NMXHEP = 4000)
- INTEGER NEVHEP, NHEP, ISTHEP(NMXHEP), IDHEP(NMXHEP),
- & JMOHEP(2,NMXHEP), JDAHEP(2,NMXHEP)
- DOUBLE PRECISION PHEP(5,NMXHEP), VHEP(4,NMXHEP)
- COMMON /HEPEVT/ NEVHEP, NHEP, ISTHEP, IDHEP, JMOHEP, JDAHEP,
- & PHEP, VHEP
-
-* The spin part of the HEPEVT commons which is not written
- DOUBLE PRECISION SHEP(4,NMXHEP)
- COMMON /HEPSPN/ SHEP
-
-
- INTEGER LUN,I,J,K,L,M
-*
-* write event data
-*
- IF (NHEP.GT.NMXHEP) THEN
- WRITE(6,*) 'LCLIST: Error- NHEP ',NHEP,' is too big'
- WRITE(6,*) 'LCLIST: Event not written to file'
- RETURN
- ENDIF
-
- WRITE(LUN,1) NEVHEP
- 1 FORMAT(' event #:',I5)
- WRITE(LUN,10) NHEP
- DO I=1,NHEP
- WRITE(LUN,12) I,ISTHEP(I),IDHEP(I),(JMOHEP(J,I),J=1,2),
- & (JDAHEP(K,I),K=1,2),
- & (PHEP(L,I),L=1,5),
- & (VHEP(M,I),M=1,4)
- ENDDO
-
- 10 FORMAT(' # of particles in this event:',1I5,/,
- & ' I sts pID 1st_m 2nd_m',
- & ' 1st_d lst_d Px Py Pz',
- & ' E mass',
- & ' Vx Vy Vz time')
-
- 12 FORMAT(1X,I5,I4,I6,4I6,5F10.3,4E11.3)
- RETURN
-
- 999 WRITE(6,*) 'LCLIST: Error writing to file on unit ',LUN
- STOP
- END
-
- SUBROUTINE LCWRITE(LUN)
-*****************************************************************************
-*
-* SUBROUTINE LCWRITE(LUN)
-*
-* Purpose: Write HEPEVT common to output file
-* on unit LUN in Linear Collider workshop formatted form
-*
-* NOTES: * All UNSTABLE particles with an average proper lifetime of
-* less than 10 mm should be decayed by the generator; others
-* (eg K0, Lambda0) should be left to the simulation.
-* This can be achieved in JETSET using MSTJ(22)=2 with the
-* default setting of PARJ(71)
-*
-* * If you are using PYTHIA/JETSET remember to fill the
-* HEPEVT commons with CALL LUHEPC(1)
-*
-* * If you are using PYTHIA 6.1 you need PYHEPC(1)
-*
-* * You must ensure that the HEPEVT commons are DOUBLE PRECISION
-* (In JETSET 7.4 they are single precision by default)
-*
-* * The event number (NEVHEP) is not written to file; the
-* simulation will take each event individually
-*
-* * For SPARTICLE codes, see
-* http://d0lblt.lbl.gov/wwwpdg/mc_numbers.htm
-*
-* * For the specifications of the HEPEVT commons see the LEP1
-* Yellow Report or the PYTHIA/JETSET manual
-*
-* * The spin part (SHEP) of the commons is not written to file
-*
-* * The output is slightly modified to include the charge
-* (obtained by the PYTHIA utility routine PYCHGE)
-*
-*
-* Input: LUN - output file INTEGER
-*
-* Output: to file
-*
-* Called: Per event
-*
-* Author: Hywel Phillips (H.T.Phillips@rl.ac.uk)
-*
-*
-*****************************************************************************
-*****************************************************************************
-
- IMPLICIT NONE
-* switched to NMXHEP = 4000 for compatibility with PYTHIA 6.1
-c M.Dobbs 04.2000 NMXHEP = 2000 for compatibility with PYTHIA 5.7
- INTEGER NMXHEP
- PARAMETER (NMXHEP = 4000)
- INTEGER NEVHEP, NHEP, ISTHEP(NMXHEP), IDHEP(NMXHEP),
- & JMOHEP(2,NMXHEP), JDAHEP(2,NMXHEP)
- DOUBLE PRECISION PHEP(5,NMXHEP), VHEP(4,NMXHEP)
- COMMON /HEPEVT/ NEVHEP, NHEP, ISTHEP, IDHEP, JMOHEP, JDAHEP,
- & PHEP, VHEP
-
-* The spin part of the HEPEVT commons which is not written
- DOUBLE PRECISION SHEP(4,NMXHEP)
- COMMON /HEPSPN/ SHEP
-
-* The HEPEVTCH commonblock.
- REAL CHHEP(NMXHEP)
- COMMON /HEPEVTCH/ CHHEP
- SAVE /HEPEVTCH/
-
- INTEGER LUN,I,J,K
-*
-* write event data
-*
-
- IF (NHEP.GT.NMXHEP) THEN
- WRITE(6,*) 'LCWRITE: Error- NHEP ',NHEP,' is too big'
- WRITE(6,*) 'LCWRITE: Event not written to file'
- RETURN
- ENDIF
-
- WRITE(LUN,10) NHEP
- DO I=1,NHEP
- WRITE(LUN,12,ERR=999) ISTHEP(I),IDHEP(I),(JMOHEP(J,I),J=1,2),
- & (JDAHEP(K,I),K=1,2)
- WRITE(LUN,11,ERR=999) (PHEP(J,I),J=1,5)
-
-* slightly modified to include charge instead of useless vhep(5,i)
- WRITE(LUN,11,ERR=999) (VHEP(K,I),K=1,4),CHHEP(I)
- ENDDO
-
- 10 FORMAT(1I5)
- 11 FORMAT(10F17.10)
- 12 FORMAT(I9,I9,4I5)
- RETURN
-
- 999 WRITE(6,*) 'LCWRITE: Error writing to file on unit ',LUN
- STOP
- END
-
-EOF
-
-# make the life simpler for pythia (based on cernlib 2002/2003)
-# requires that the location of the cernlib script is in $PATH
-PYTHIALIB=`cernlib pythia6205 pdflib804 lapack3 mathlib`
-
-# echo g77 -o /tmp/pyhepevt.bin /tmp/pyhepevt.f ${PYTHIALIB}
-g77 -o /tmp/pyhepevt.bin /tmp/pyhepevt.f ${PYTHIALIB}
-
-# and run
-rm -f pythia.data pythiahepevt.log pyhepevt.log
-/tmp/pyhepevt.bin > pyhepevt.log
-# if logging is not wanted for this task activate next line
-#rm pythiahepevt.log pyhepevt.log
-
diff --git a/examples/f77/pythia/runPysimjob.sh b/examples/f77/pythia/runPysimjob.sh
deleted file mode 100755
index 55b5f98cc..000000000
--- a/examples/f77/pythia/runPysimjob.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/sh
-################### script to run the pysimjob_F executable ###################
-# #
-# output files: pythia.data, pysimjob_F.log #
-# #
-###############################################################################
-
-# creates pythia.data and pythiahepevt.log (needs cernlib 2002 or higher)
-pythiahepevt.sh
-
-# creates pysimjob.slcio and pysimjob_F.log
-rm -f pysimjob_F.log pysimjob.slcio
-pysimjob_F > pysimjob_F.log
-
diff --git a/sio/CMakeLists.txt b/sio/CMakeLists.txt
deleted file mode 100644
index d21c1a2c2..000000000
--- a/sio/CMakeLists.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-#
-# CMakeLists.txt for building the SIO library only
-# For the full SIO package (library, includes, binaries, examples)
-# please visit https:/github.com/iLCSoft/SIO
-#
-# @author: Remi Ete, DESY
-#
-
-PROJECT( SIO )
-
-# project version
-SET( SIO_VERSION_MAJOR 0 )
-SET( SIO_VERSION_MINOR 0 )
-SET( SIO_VERSION_PATCH 4 )
-SET( SIO_VERSION "${SIO_VERSION_MAJOR}.${SIO_VERSION_MINOR}.${SIO_VERSION_PATCH}" )
-SET( SIO_SOVERSION "${SIO_VERSION_MAJOR}.${SIO_VERSION_MINOR}" )
-
-FIND_PACKAGE( ZLIB REQUIRED )
-
-# SIO care about endianess
-INCLUDE( TestBigEndian )
-TEST_BIG_ENDIAN( BIG_ENDIAN )
-
-IF( NOT BIG_ENDIAN )
- ADD_DEFINITIONS( "-D__LITTLE_ENDIAN__" )
-ENDIF()
-
-# Build the SIO library
-FILE( GLOB_RECURSE SIO_SRCS src/*.cc )
-
-ADD_DEFINITIONS( "-DSIO_LOGLVL=0" )
-ADD_SHARED_LIBRARY( sio ${SIO_SRCS} )
-TARGET_INCLUDE_DIRECTORIES( sio PUBLIC
- $
- $
-)
-TARGET_INCLUDE_DIRECTORIES( sio SYSTEM PUBLIC ${ZLIB_INCLUDE_DIR} )
-TARGET_LINK_LIBRARIES( sio ${ZLIB_LIBRARIES} )
-INSTALL_SHARED_LIBRARY( sio DESTINATION ${CMAKE_INSTALL_LIBDIR} )
-
-# Install the sio headers as well. Necessary for the python bindings and also
-# for cases where others want to link against LCIO / this version of SIO
-INSTALL(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/include/sio DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-
-# mimic the SIOConfig.cmake variables for the LCIO project
-SET( SIO_VERSION "${SIO_VERSION}" CACHE STRING "The SIO version" )
-SET( SIO_LIBRARIES "sio" CACHE STRING "The SIO library" )
-SET( SIO_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/include" CACHE STRING "The path to SIO include directories" )
-SET( CHECK_PACKAGE_SIO_LIBRARY "sio" CACHE STRING "The name of the builtin SIO library to check when searching for LCIO package" )
diff --git a/sio/include/sio/api.h b/sio/include/sio/api.h
deleted file mode 100644
index 2f5745f20..000000000
--- a/sio/include/sio/api.h
+++ /dev/null
@@ -1,479 +0,0 @@
-#pragma once
-
-// -- sio headers
-#include
-#include
-
-// -- std headers
-#include
-#include
-#include
-#include
-#include
-
-namespace sio {
-
- class buffer ;
- class buffer_span ;
- class block ;
- class write_device ;
-
- /**
- * @brief api class.
- * Helper class to perform high level operation on sio objects
- */
- class api {
- public:
- // static API only
- api() = delete ;
-
- /**
- * @name Pointer relocation
- */
- ///@{
- /**
- * @brief Perform the pointer relocation after the record has been read.
- *
- * @param pointed_at the map of pointers "pointed at"
- * @param pointer_to the map of pointers "pointer to"
- */
- static void read_relocation( pointed_at_map& pointed_at, pointer_to_map& pointer_to ) ;
-
- /**
- * @brief Perform the pointer relocation after the record has been written.
- * This operation requires to know the beginning of the record buffer
- * address to compute the address shift
- *
- * @param rec_start the address of the start of the record
- * @param pointed_at the map of pointers "pointed at"
- * @param pointer_to the map of pointers "pointer to"
- */
- static void write_relocation( const sio::byte* rec_start, pointed_at_map& pointed_at, pointer_to_map& pointer_to ) ;
- ///@}
-
- /**
- * @name Buffer I/O
- */
- ///@{
- /**
- * @brief Read data from the buffer. The template form allows
- * for using either a sio::buffer or a sio::buffer_span object
- *
- * @param buffer the buffer to read from
- * @param ptr the address of the variable to receive
- * @param position the position in the buffer
- * @param count the number of bytes to read
- * @return the actual number of bytes read out
- */
- template
- static typename bufT::size_type read( const bufT &buffer, T *ptr, typename bufT::index_type position, typename bufT::size_type count ) ;
-
- /**
- * @brief Read data from the buffer. The template form allows
- * for using either a sio::buffer or a sio::buffer_span object
- *
- * @param buffer the buffer to read from
- * @param ptr the address of the variable to receive
- * @param length the length of the variable
- * @param position the position in the buffer
- * @param count the number of bytes to read
- * @return the actual number of bytes read out
- */
- template
- static typename bufT::size_type read( const bufT &buffer, typename bufT::pointer ptr, typename bufT::size_type length, typename bufT::index_type position, typename bufT::size_type count ) ;
-
- /**
- * @brief Write data to the buffer. The template form allows
- * for using either a sio::buffer or a sio::buffer_span object
- *
- * @param buffer the buffer to write to
- * @param ptr the address of the variable to write
- * @param position the position in the buffer
- * @param count the number of bytes to write
- * @return the actual number of bytes written out
- */
- template
- static typename bufT::size_type write( bufT &buffer, const T *const ptr, typename bufT::index_type position, typename bufT::size_type count ) ;
-
- /**
- * @brief Write data to the buffer. The template form allows
- * for using either a sio::buffer or a sio::buffer_span object
- *
- * @param buffer the buffer to write to
- * @param ptr the address of the variable to write
- * @param length the length of the variable
- * @param position the position in the buffer
- * @param count the number of bytes to write
- * @return the actual number of bytes written out
- */
- template
- static typename bufT::size_type write( bufT &buffer, typename bufT::const_pointer const ptr, typename bufT::size_type length, typename bufT::index_type position, typename bufT::size_type count ) ;
- ///@}
-
- /**
- * @name Record I/O
- */
- ///@{
- /**
- * @brief Read the next record header from the input stream.
- * On exit, the stream cursor is set after the record header, ready
- * to read the incoming record data bytes. The record header bytes
- * read out from the stream are stored in the buffer passed as third
- * argument. If the buffer is not large enough to contain all bytes,
- * it is expanded.
- *
- * @param stream the input stream
- * @param rec_info the record info to receive
- * @param outbuf the buffer containing the record info bytes
- */
- static void read_record_info( sio::ifstream &stream, record_info &rec_info, buffer &outbuf ) ;
-
- /**
- * @brief Read out the record data from the input stream. The record data
- * bytes are written in the buffer passed by reference. By default, the
- * bytes are written at the beginning of the buffer. The last argument
- * allows for specifying a shift from the start of the buffer.
- *
- * @param stream the input stream
- * @param rec_info the record info
- * @param outbuf the buffer to receive the record data bytes
- * @param buffer_shift an optional shift from the start of the buffer
- */
- static void read_record_data( sio::ifstream &stream, const record_info &rec_info, buffer &outbuf, std::size_t buffer_shift = 0 ) ;
-
- /**
- * @brief Read out the record (header + data) from the input stream.
- * Simple combination of the functions above.
- *
- * @param stream the input stream
- * @param rec_info the record info to receive
- * @param outbuf the record header + data bytes to receive
- */
- static void read_record( sio::ifstream &stream, record_info &rec_info, buffer &outbuf ) ;
-
- /**
- * @brief Read out the next record (header + data) from the input stream.
- * The 'valid' arguments is used for validating the record info.
- * You might want to skip a record before extracting the full data
- * buffer. In this case the 'valid' function should return false.
- * If the record info is validated, the record data is extracted
- * out from the stream and passed to a second callback function
- * to process it. This function also returns a boolean value
- * specifying whether the next record should be read out.
- * Example reading out a single specific record:
- * @code{cpp}
- * sio::buffer buf( 32*sio::kbyte ) ;
- * sio::ifstream stream ;
- * // ... open the stream ...
- * sio::api::read_records( stream, buf,
- * []( const sio::record_info &recinfo ) {
- * // looking for a specific record
- * return (recinfo._name == "MyRecord") ;
- * },
- * []( const sio::record_info &recinfo, buffer_span recdata ){
- * // do something the record data
- * // return false saying stop reading records
- * return false ;
- * }) ;
- * @endcode
- *
- * @param stream the input stream
- * @param rec_info the record info to receive
- * @param outbuf the record header + data bytes to receive
- */
- template
- static void read_records( sio::ifstream &stream, buffer &outbuf, ValidPred valid, ReadFunc func ) ;
-
- /**
- * @brief Read out the record (header + data) from the input stream.
- * Simple combination of the functions above. Returns the record
- * info and the buffer. The initial buffer size is set to 1 Mo and
- * might be expanded while reading out the record data if required.
- *
- * @param stream the input stream
- */
- static std::pair read_record( sio::ifstream &stream ) ;
-
- /**
- * @brief Skip the next records while the unary predicate is true.
- * The predicate must be of the following form :
- * 'bool predicate(const record_info&)'.
- *
- * @param stream the input stream
- * @param pred the unary predicate
- */
- template
- static void skip_records( sio::ifstream &stream, UnaryPredicate pred ) ;
-
- /**
- * @brief Skip the N next records from the input stream
- *
- * @param stream the input stream
- * @param nskip the number of record to skip
- */
- static void skip_n_records( sio::ifstream &stream, std::size_t nskip ) ;
-
- /**
- * @brief Skip the N next records with a specific name.
- * If a record with a different name is encountered, it is also skipped.
- *
- * @param stream the input stream
- * @param nskip the number of record to skip
- * @param name the record name to skip (only)
- */
- static void skip_records( sio::ifstream &stream, std::size_t nskip, const std::string &name ) ;
-
- /**
- * @brief Got to the next record with the spcified name
- *
- * @param stream the input stream
- * @param name the target record name
- */
- static void go_to_record( sio::ifstream &stream, const std::string &name ) ;
-
- /**
- * @brief Extract all the block info from the buffer. Skip block reading
- *
- * @param buf the input block buffer
- */
- static std::vector read_block_infos( const buffer_span &buf ) ;
-
- /**
- * @brief Extract the block info and get a buffer span of the block at the given index
- *
- * @param rec_buf the record buffer
- * @param index the index of block header start in the record buffer
- */
- static std::pair extract_block( const buffer_span &rec_buf, buffer_span::index_type index ) ;
-
- /**
- * @brief Decode the record buffer using the block decoder.
- * Loop over the blocks found in the buffer and try to decode it.
- * If the block decoder is not available, it is skipped
- *
- * @param rec_buf the record buffer pointing on the first block to decode
- * @param blocks the list of block decoder to use
- */
- static void read_blocks( const buffer_span &rec_buf, const block_list &blocks ) ;
-
- /**
- * @brief Dump the records from the input stream to the console.
- * Note that if you use a detailed printout, the record
- * is first uncompressed using zlib and the block infos
- * are printed out too.
- *
- * @param stream the input stream
- * @param skip the number of records to skip from the current position
- * @param count the number of record to printout
- * @param detailed whether to printout detailed information (block info)
- */
- static void dump_records( sio::ifstream &stream, std::size_t skip, std::size_t count, bool detailed ) ;
-
- /**
- * @brief Write the blocks in the buffer contained in the write_device.
- * For each block, a block header and the block data is written
- *
- * @param device the write device to write to
- * @param blocks the block encoder
- */
- static void write_blocks( write_device &device, const block_list &blocks ) ;
-
- /**
- * @brief Write a record in a buffer. A record_info object is returned.
- * Note that in the returned structure the fields _file_start and
- * _file_end are not filled since the writting is only done in the
- * buffer at this step. Note also that this function doesn't call
- * any compression algorithm. See overloads to get a compressed
- * buffer.
- *
- * @param name the record name
- * @param rec_buf the record buffer to receive
- * @param blocks the block list for writting
- * @param opts the record options
- */
- static record_info write_record( const std::string &name, buffer &rec_buf, const block_list& blocks, sio::options_type opts ) ;
-
- /**
- * @brief Compress the record buffer. Note that several operation are done
- * in this function:
- * - the record buffer is compressed and receive in the comp_buf
- * - the record info is updated with the compressed record data length
- * - the record header is overwritten in the record buffer
- *
- * @param rec_info the record info instance
- * @param rec_buf the record buffer
- * @param comp_buf the compressed buffer to receive
- */
- template
- static void compress_record( record_info &rec_info, buffer &rec_buf, buffer &comp_buf, compT &compressor ) ;
-
- /**
- * @brief Write the full record buffer in the output stream. The stream
- * is flushed after writing the buffer
- *
- * @param stream the output stream
- * @param rec_buf the full record buffer (header + data)
- * @param rec_info the record info to update (file start and end positions)
- */
- static void write_record( sio::ofstream &stream, const buffer_span &rec_buf, record_info &rec_info ) ;
-
- /**
- * @brief Write the record buffer in two step from two buffers. The first
- * buffer contains the record header buffer and the second the
- * record data, either compressed or uncompressed. The stream is
- * flushed after writing the two buffers
- *
- * @param stream the output stream
- * @param hdr_span the record header buffer span
- * @param data_span the record data buffer span
- * @param rec_info the record info to update (file start and end positions)
- */
- static void write_record( sio::ofstream &stream, const buffer_span &hdr_span, const buffer_span &data_span, record_info &rec_info ) ;
- ///@}
-
- /**
- * @name Compression
- */
- ///@{
- /**
- * @brief Extract the compression bit from the option word
- *
- * @param opts the options word
- */
- static bool is_compressed( options_type opts ) ;
-
- /**
- * @brief Turn on/off the compression bit in the options word
- *
- * @param opts the option word
- * @param value whether to set on/off the compression bit
- * @return the old compression bit value
- */
- static bool set_compression( options_type &opts, bool value ) ;
- ///@}
- };
-
-}
-
-#include
-#include
-#include
-
-namespace sio {
-
- template
- inline typename bufT::size_type api::read( const bufT &buffer, T *ptr, typename bufT::index_type position, typename bufT::size_type count ) {
- if( not buffer.valid() ) {
- SIO_THROW( sio::error_code::bad_state, "Buffer is invalid." ) ;
- }
- const auto bytelen = sizeof_helper::size*count ;
- const auto padlen = (bytelen + sio::padding) & sio::padding_mask ;
- SIO_DEBUG( "Reading... len: " << sizeof_helper::size << ", count: " << count << ", padlen: " << padlen << ", position: " << position ) ;
- if( position + padlen > buffer.size() ) {
- std::stringstream ss ;
- ss << "Can't read " << padlen << " bytes out of buffer (pos=" << position << ")" ;
- SIO_THROW( sio::error_code::invalid_argument, ss.str() ) ;
- }
- auto ptr_read = buffer.ptr( position ) ;
- sio::memcpy::read( ptr_read, ptr, count ) ;
- return padlen ;
- }
-
- //--------------------------------------------------------------------------
-
- template
- inline typename bufT::size_type api::write( bufT &buffer, const T *const ptr, typename bufT::index_type position, typename bufT::size_type count ) {
- if( not buffer.valid() ) {
- SIO_THROW( sio::error_code::bad_state, "Buffer is invalid." ) ;
- }
- const auto bytelen = sizeof_helper::size*count ;
- const auto padlen = (bytelen + sio::padding) & sio::padding_mask ;
- if( position + padlen >= buffer.size() ) {
- auto expand_size = std::max( buffer.size(), padlen ) ;
- buffer.expand( expand_size ) ;
- }
- auto ptr_write = buffer.ptr( position ) ;
- SIO_DEBUG( "Writing... len=" << sizeof_helper::size << ", count=" << count << ", bytelen=" << bytelen << ", padlen=" << padlen << ", position:" << position ) ;
- sio::memcpy::write( ptr, ptr_write, count ) ;
- for( auto bytcnt = bytelen; bytcnt < padlen; bytcnt++ ) {
- *(ptr_write + bytcnt) = sio::null_byte ;
- }
- return padlen ;
- }
-
- //--------------------------------------------------------------------------
-
- template
- inline void api::read_records( sio::ifstream &stream, buffer &outbuf, ValidPred valid, ReadFunc func ) {
- bool continue_extract = true ;
- while( continue_extract ) {
- sio::record_info rec_info {} ;
- api::read_record_info( stream, rec_info, outbuf ) ;
- // if user validates the record info object, we extract the record data
- auto val = valid( rec_info ) ;
- if( val ) {
- // extract the record data
- api::read_record_data( stream, rec_info, outbuf, rec_info._header_length ) ;
- // pass the record data buffer to the user (as a span)
- // stop extracting records if the function returns false
- continue_extract = func( rec_info, outbuf.span( rec_info._header_length, rec_info._data_length ) ) ;
- }
- else {
- // if not, seek to the next record
- stream.seekg( rec_info._file_end ) ;
- }
- }
- }
-
- //--------------------------------------------------------------------------
-
- template
- inline void api::skip_records( sio::ifstream &stream, UnaryPredicate pred ) {
- sio::record_info rec_info ;
- sio::buffer rec_buffer( sio::max_record_info_len ) ;
- while( 1 ) {
- // read record header
- api::read_record_info( stream, rec_info, rec_buffer ) ;
- // skip record data
- stream.seekg( rec_info._file_end ) ;
- if( not stream.good() ) {
- SIO_THROW( sio::error_code::bad_state, "ifstream is in a bad state after a seek operation!" ) ;
- }
- if( not pred( rec_info ) ) {
- break ;
- }
- }
- }
-
- //--------------------------------------------------------------------------
-
- template
- inline void api::compress_record( record_info &rec_info, buffer &rec_buf, buffer &comp_buf, compT &compressor ) {
- if( not rec_buf.valid() ) {
- SIO_THROW( sio::error_code::invalid_argument, "Record buffer is invalid" ) ;
- }
- if( not comp_buf.valid() ) {
- SIO_THROW( sio::error_code::invalid_argument, "Compression buffer is invalid" ) ;
- }
- try {
- // set the compression bit in the record options
- sio::api::set_compression( rec_info._options, true ) ;
- // compress the record buffer (but not the record header)
- auto rec_span = rec_buf.span( rec_info._header_length ) ;
- compressor.compress( rec_span, comp_buf ) ;
- rec_info._data_length = comp_buf.size() ;
- write_device device ( std::move(rec_buf) ) ;
- // fill back the record buffer with updated information on header
- device.data( rec_info._header_length ) ;
- device.data( sio::record_marker ) ;
- device.data( rec_info._options ) ;
- device.data( rec_info._data_length ) ;
- // get back the buffer
- rec_buf = device.take_buffer() ;
- }
- catch( sio::exception &e ) {
- SIO_RETHROW( e, sio::error_code::io_failure, "Couldn't compress record buffer" ) ;
- }
- }
-
-}
diff --git a/sio/include/sio/block.h b/sio/include/sio/block.h
deleted file mode 100644
index 09c28875d..000000000
--- a/sio/include/sio/block.h
+++ /dev/null
@@ -1,77 +0,0 @@
-#pragma once
-
-// -- sio headers
-#include
-
-// -- std headers
-#include
-
-namespace sio {
-
- class read_device ;
- class write_device ;
-
- /**
- * @brief block class.
- *
- * Implements to reading (writing) of record blocks from (to) a buffer.
- * Blocks are versioned and the version is written out in the block header,
- * so that on read operation, the version can be use to perform a proper
- * decoding of data.
- */
- class block {
- public:
- /// No default constructor
- block() = delete ;
- /// No copy constructor
- block( const block& ) = delete ;
- /// No move constructor
- block( block&& ) = delete ;
- /// No copy assignement
- block& operator=( const block& ) = delete ;
- /// No move assignement
- block& operator=( block&& ) = delete ;
- /// Default destructor
- virtual ~block() = default ;
-
- /**
- * @brief Constructor
- *
- * @param nam the block name
- * @param vers the block version
- */
- block( const std::string &nam, sio::version_type vers ) ;
-
- /**
- * @brief Get the block name
- */
- const std::string &name() const noexcept ;
-
- /**
- * @brief Get the block version
- */
- sio::version_type version() const noexcept ;
-
- /**
- * @brief Perform decoding of block buffer using the device
- *
- * @param device the read device containing the block buffer
- * @param vers the block version read out from the stream
- */
- virtual void read( sio::read_device &device, sio::version_type vers ) = 0 ;
-
- /**
- * @brief Perform encoding of block data in a buffer using the device
- *
- * @param device the write device containing the block buffer
- */
- virtual void write( sio::write_device &device ) = 0 ;
-
- private:
- ///< The block version
- const sio::version_type _version ;
- ///< The block name
- const std::string _name ;
- };
-
-}
\ No newline at end of file
diff --git a/sio/include/sio/buffer.h b/sio/include/sio/buffer.h
deleted file mode 100644
index 304fd4d0c..000000000
--- a/sio/include/sio/buffer.h
+++ /dev/null
@@ -1,481 +0,0 @@
-#pragma once
-
-// -- sio headers
-#include
-
-// -- std headers
-#include
-
-namespace sio {
-
- /**
- * @brief buffer_span class.
- *
- * Implements a view on a byte array without owning it.
- * A buffer_span can be obtained directly from a byte_array
- * or from a buffer using the buffer::span() methods.
- * The buffer_span class provides only const methods to
- * work with the underlying byte array, except for the
- * assignement operator which allow to change the underlying
- * byte array span. Note that the implementation stores a
- * pair of const_iterator on a byte_array. Thus the validity
- * of the buffer_span object relies on the validity of these
- * iterators.
- */
- class buffer_span {
- public:
- // traits
- using container = sio::byte_array ;
- using element_type = container::value_type ;
- using const_iterator = container::const_iterator ;
- using index_type = std::size_t ;
- using size_type = std::size_t ;
- using reference = container::reference ;
- using const_reference = container::const_reference ;
- using pointer = container::pointer ;
- using const_pointer = container::const_pointer ;
-
- public:
- /// Default copy constructor
- buffer_span( const buffer_span& ) = default ;
- /// Default move constructor
- buffer_span( buffer_span&& ) = default ;
- /// Default destructor
- ~buffer_span() = default ;
- /// Default assignement operator
- buffer_span& operator=( const buffer_span& ) = default ;
- /// Default move assignment operator
- buffer_span& operator=( buffer_span&& ) = default ;
-
- /**
- * @brief Default constructor
- */
- buffer_span() ;
-
- /**
- * @brief Constructor from a byte_array
- *
- * @param bytes the byte_array on which to construct the span
- */
- buffer_span( const container &bytes ) ;
-
- /**
- * @brief Constructor with two iterators
- *
- * @param first the start of the span
- * @param last the end of the span (not included)
- */
- buffer_span( const_iterator first, const_iterator last ) ;
-
- /**
- * @brief Constructor with iterator and bytes count
- *
- * @param first the start of the span
- * @param count the number of bytes to the end of the span
- */
- buffer_span( const_iterator first, size_type count ) ;
-
- /**
- * @name Iterators
- */
- ///{@
- /**
- * @brief Get the iterator to the start of the span
- */
- const_iterator begin() const ;
-
- /**
- * @brief Get the iterator to the end of the span
- */
- const_iterator end() const ;
- ///@}
-
- /**
- * @name Element access
- */
- ///{@
- /**
- * @brief Get the data buffer
- */
- const element_type *data() const ;
-
- /**
- * @brief Get the front element (if valid)
- */
- const_reference front() const ;
-
- /**
- * @brief Get the back element (if valid)
- */
- const_reference back() const ;
-
- /**
- * @brief Data access operator (no range check)
- *
- * @param index the index of a byte access
- */
- const_reference operator[]( index_type index ) const ;
-
- /**
- * @brief Data access operator (range check!)
- *
- * @param index the index of a byte access
- */
- const_reference at( index_type index ) const ;
-
- /**
- * @brief Get a pointer on the raw bytes at the given index
- *
- * @param index the index access
- */
- const_pointer ptr( index_type index ) const ;
- ///@}
-
- /**
- * @name Capacity
- */
- ///{@
- /**
- * @brief Get the size of the span
- */
- size_type size() const ;
-
- /**
- * @brief Whether the span is empty
- */
- bool empty() const ;
-
- /**
- * @brief Whether the span is valid, meaning not default constructed
- */
- bool valid() const ;
-
- /**
- * @brief boolean operator. Returns true if the span is valid
- */
- operator bool() const noexcept ;
- ///@}
-
- /**
- * @name Operations
- */
- ///{@
- /**
- * @brief Get a sub span from a new start, untill the end
- *
- * @param start the subspan new start
- */
- buffer_span subspan( index_type start ) const ;
-
- /**
- * @brief Get a sub span from a new start and new end
- *
- *
- * @param start the subspan new start
- * @param count the size of the subspan
- */
- buffer_span subspan( index_type start, std::size_t count ) const ;
-
- /**
- * @brief Dump the buffer into standard output
- *
- * @param base the numeric base of the output data (default octal)
- * @param line_split the number of bytes to print before a line break
- * @param max_bytes the maximum number of bytes to printout
- */
- void dump( int base = 8, unsigned int line_split = 20, size_type max_bytes = std::numeric_limits::max() ) ;
- ///@}
-
- private:
- ///< An iterator to the begin of a byte_array
- const_iterator _first{} ;
- ///< An iterator to the end of a byte_array
- const_iterator _last{} ;
- ///< Whether the span is null (invalid)
- bool _isnull {false} ;
- };
-
- //--------------------------------------------------------------------------
- //--------------------------------------------------------------------------
-
- /**
- * @brief buffer class
- */
- class buffer {
- public:
- using container = sio::byte_array ;
- using element_type = container::value_type ;
- using iterator = container::iterator ;
- using const_iterator = container::const_iterator ;
- using reverse_iterator = container::reverse_iterator ;
- using const_reverse_iterator = container::const_reverse_iterator ;
- using index_type = std::size_t ;
- using size_type = std::size_t ;
- using reference = container::reference ;
- using const_reference = container::const_reference ;
- using pointer = container::pointer ;
- using const_pointer = container::const_pointer ;
-
- public:
- /// No default constructor
- buffer() = delete ;
- /// No copy constructor
- buffer( const buffer& ) = delete ;
- /// No assignment by copy
- buffer& operator=( const buffer& ) = delete ;
-
- /**
- * @brief Constructor with buffer size
- *
- * @param len the buffer size to allocate
- */
- buffer( size_type len ) ;
-
- /**
- * @brief Constructor with byte array (move!)
- *
- * @param bytes the byte array
- */
- buffer( container &&bytes ) ;
-
- /**
- * @brief Move constructor
- *
- * @param rhs the other buffer object to move
- */
- buffer( buffer&& rhs ) ;
-
- /**
- * @brief Move assignment operator
- *
- * @param rhs the other buffer object to move
- */
- buffer& operator=( buffer&& rhs ) ;
-
- /**
- * @name Iterators
- */
- ///@{
- /**
- * @brief Get an iterator to the beginning of the byte array
- */
- const_iterator begin() const ;
-
- /**
- * @brief Get an iterator to the end of the byte array
- */
- const_iterator end() const ;
-
- /**
- * @brief Get an iterator to the beginning of the byte array
- */
- iterator begin() ;
-
- /**
- * @brief Get an iterator to the end of the byte array
- */
- iterator end() ;
-
- /**
- * @brief Get an iterator to the reverse beginning (end) of the byte array
- */
- const_reverse_iterator rbegin() const ;
-
- /**
- * @brief Get an iterator to the reverse end (begin) of the byte array
- */
- const_reverse_iterator rend() const ;
-
- /**
- * @brief Get an iterator to the reverse beginning (end) of the byte array
- */
- reverse_iterator rbegin() ;
-
- /**
- * @brief Get an iterator to the reverse end (begin) of the byte array
- */
- reverse_iterator rend() ;
- ///@}
-
- /**
- * @name Element access
- */
- ///@{
- /**
- * @brief Get a byte at the specified position
- *
- * @param index the index access
- */
- const_reference operator[]( index_type index ) const ;
-
- /**
- * @brief Get a byte at the specified position
- *
- * @param index the index access
- */
- reference operator[]( index_type index ) ;
-
- /**
- * @brief Get a byte at the specified position
- *
- * @param index the index access
- */
- const_reference at( index_type index ) const ;
-
- /**
- * @brief Get a byte at the specified position
- *
- * @param index the index access
- */
- reference at( index_type index ) ;
-
- /**
- * @brief Get a byte at the front position
- */
- const_reference front() const ;
-
- /**
- * @brief Get a byte at the front position
- */
- reference front() ;
-
- /**
- * @brief Get a byte at the back position
- */
- const_reference back() const ;
-
- /**
- * @brief Get a byte at the back position
- */
- reference back() ;
-
- /**
- * @brief Get the raw buffer bytes as an array
- */
- const_pointer data() const ;
-
- /**
- * @brief Get the raw buffer bytes as an array
- */
- pointer data() ;
-
- /**
- * @brief Get a pointer on the raw bytes at the given index
- *
- * @param index the index access
- */
- const_pointer ptr( index_type index ) const ;
-
- /**
- * @brief Get a pointer on the raw bytes at the given index
- *
- * @param index the index access
- */
- pointer ptr( index_type index ) ;
- ///@}
-
- /**
- * @name Capacity
- */
- ///@{
- /**
- * @brief Get the buffer size
- */
- size_type size() const ;
-
- /**
- * @brief Whether the buffer is empty
- */
- bool empty() const ;
-
- /**
- * @brief Get the underlying current buffer capacity
- */
- size_type capacity() const ;
- ///@}
-
- /**
- * @name Modifiers
- */
- ///@{
- /**
- * @brief Resize the buffer to the specified size
- *
- * @param newsize the new buffer size
- */
- void resize( size_type newsize ) ;
-
- /**
- * @brief Expand the buffer by adding new bytes
- *
- * @param nbytes the number of bytes to add
- * @return the new buffer size
- */
- size_type expand( size_type nbytes = 32*sio::kbyte*sio::kbyte ) ;
-
- /**
- * @brief Shrink the internal buffer to its size.
- * This doesn't modify the buffer size.
- */
- void shrink() ;
-
- /**
- * @brief Clear the buffer.
- * Note that the memory is not released until the buffer
- * gets deleted. To release the buffer memory, use shrink = true
- *
- * @param shrink whether to shrink the buffer after the clear operation
- */
- void clear( bool shrink = false ) ;
- ///@}
-
- /**
- * @name Operations
- */
- ///@{
- /**
- * @brief Re-use the buffer bytes. Creates a new buffer object
- * and move the byte container in the new buffer object.
- * The current buffer is invalidated
- */
- buffer reuse() ;
-
- /**
- * @brief Whether the buffer is valid
- *
- * The buffer may be invalidated after a move operation
- * occuring when:
- * - std::move is called
- * - buffer::reuse() is called
- */
- bool valid() const ;
-
- /**
- * @brief Get a the entire buffer as buffer_span
- */
- buffer_span span() const ;
-
- /**
- * @brief Get a sub span of the buffer
- *
- * @param start where the span starts
- */
- buffer_span span( index_type start ) const ;
-
- /**
- * @brief Get a sub span of the buffer
- *
- * @param start where the sub span starts
- * @param count the length of the sub span
- */
- buffer_span span( index_type start, size_type count ) const ;
- ///@}
-
- private:
- ///< The byte array container
- container _bytes {} ;
- ///< Whether the buffer is in a valid state
- bool _valid {true} ;
- };
-
-}
diff --git a/sio/include/sio/compression/zlib.h b/sio/include/sio/compression/zlib.h
deleted file mode 100644
index 46e106c07..000000000
--- a/sio/include/sio/compression/zlib.h
+++ /dev/null
@@ -1,58 +0,0 @@
-#pragma once
-
-// -- sio headers
-#include
-
-namespace sio {
-
- class buffer ;
- class buffer_span ;
-
- class zlib_compression {
- public:
- /// Default constructor
- zlib_compression() = default ;
- /// Default destructor
- ~zlib_compression() = default ;
-
- /**
- * @brief Set the compression level.
- * - Z_DEFAULT_COMPRESSION: default zlib compression level
- * - 0: no commpression
- * - [1-9] various levels
- * Note that above 9, the level is set to 9
- *
- * @param level the compression level to use
- */
- void set_level( int level ) ;
-
- /**
- * @brief Get the compression level
- */
- int level() const ;
-
- /**
- * @brief Uncompress the buffer and return a new buffer (reference).
- * The uncpmpressed buffer must have been resized correctly
- * before calling this function.
- *
- * @param inbuf the input buffer to uncompress
- * @param outbuf the uncompressed buffer to receive
- */
- void uncompress( const buffer_span &inbuf, buffer &outbuf ) ;
-
- /**
- * @brief Compress the buffer and return a new buffer
- *
- * @param inbuf the input buffer to compress
- * @param outbuf the output buffer to receive
- */
- void compress( const buffer_span &inbuf, buffer &outbuf ) ;
-
- private:
- ///< The compression level (on compress) - default: Z_DEFAULT_COMPRESSION (-1)
- int _level {-1} ;
- };
-
-}
-
diff --git a/sio/include/sio/definitions.h b/sio/include/sio/definitions.h
deleted file mode 100644
index b29214459..000000000
--- a/sio/include/sio/definitions.h
+++ /dev/null
@@ -1,350 +0,0 @@
-#pragma once
-
-// -- std headers
-#include
-#include
-#include
-#include
-#include
-#include