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 -#include -#include -#ifdef __APPLE__ -#include <_types.h> -#include <_types/_uint16_t.h> -#include <_types/_uint32_t.h> -#include <_types/_uint64_t.h> -#include <_types/_uint8_t.h> -#include -#include -#else -#include -#endif - -// ---------------------------------------------------------------------------- -// Deal with 'endian-ness'. Try to base this on the processor type (because -// the operating system doesn't guarantee endian-ness ... Linux runs happily -// on both x86 CPUs (little endian) and PPC CPUs (big endian)). -// -// Branch on flag provided by compiler: -// -// OS CPU Macro Provided by Endian-ness -// ------------ ------------ ------------ ------------ ----------- -// AIX PPC(?) _AIX GNU compiler Big -// OSF1 Alpha __alpha__ GNU compiler Little -// Linux x86 __i386__ GNU compiler Little -// Linux Opteron _LP64 GNU compiler Little -// Linux itanium _LP64 GNU compiler Little -// SunOS Sparc __sparc__ GNU compiler Big -// Windows/NT Alpha _M_ALPHA VC compiler Little -// Windows/NT x86 _M_IX86 VC compiler Little -// Windows/NT MIPS _M_MRX000 VC compiler ? -// Windows/NT PPC _M_PPC VC compiler Big -// ---------------------------------------------------------------------------- -#if defined(__alpha__) || defined(__i386__) || defined(_M_ALPHA) || defined(_M_IX86) || defined(_LP64) || defined(__LITTLE_ENDIAN__) -#define SIO_LITTLE_ENDIAN -#endif - -#if defined(_AIX) || defined(__sparc__) || defined(_M_PPC) || ( defined(__APPLE_CC__) && !defined(__LITTLE_ENDIAN__) ) -#define SIO_BIG_ENDIAN -#endif - -#if !defined(SIO_LITTLE_ENDIAN) && !defined(SIO_BIG_ENDIAN) -#error "Couldn't determine endianess on this plateform!" -#endif - -/** - * sio (simple io) namespace. - * Holds a persistency implementation using sio - */ -namespace sio { - - // ---------------------------------------------------------------------------- - // Deal with pointer length. Currently, the only problem is alpha which uses - // 64 bit pointers. - // - // OS CPU Macro Provided by Pointer size - // ------------ ------------ ------------ ------------ ----------- - // AIX PPC(?) _AIX GNU compiler 4 bytes - // OSF1 Alpha __alpha__ GNU compiler 8 bytes - // Linux x86 __i386__ GNU compiler 4 bytes - // Linux Opteron _LP64 _ GNU compiler 8 bytes - // Linux Itanium _LP64 GNU compiler 8 bytes - // SunOS Sparc __sparc__ GNU compiler 4 bytes - // Windows/NT Alpha _M_ALPHA VC compiler 8 bytes - // Windows/NT x86 _M_IX86 VC compiler 4 bytes - // Windows/NT MIPS _M_MRX000 VC compiler ? bytes - // Windows/NT PPC _M_PPC VC compiler 4 bytes - // ---------------------------------------------------------------------------- - // Old check was problematic because both macros could evaluate to true, and it would - // also be possible that sio::ptr_type was not defined at all. Change as needed. - // --JM -#if defined(__alpha__) || defined(_M_ALPHA) || defined(_LP64) - using ptr_type = std::size_t ; -#else - using ptr_type = unsigned int ; -#endif - - class block ; - class read_device ; - class write_device ; - class buffer ; - class buffer_span ; - - // Bytes related types - using byte = char ; - using byte_array = std::vector ; - using byte_traits = std::char_traits ; - // Other types - using index_type = std::size_t ; - using options_type = unsigned int ; - using version_type = uint32_t ; - using pointed_at_map = std::map< void*, void* > ; - using pointer_to_map = std::multimap< void*, void* > ; - using ifstream = std::ifstream ; - using ofstream = std::ofstream ; - using fstream = std::fstream ; - using block_ptr = std::shared_ptr ; - using block_list = std::vector ; - - /// The null byte definition - static constexpr byte null_byte = '\0' ; - - static constexpr byte padding_bytes [4] = {null_byte} ; - /// Kilo byte unit - static constexpr std::size_t kbyte = 0x00000400 ; - /// Mega byte unit - static constexpr std::size_t mbyte = 0x00100000 ; - /// The compression bit mask - static constexpr unsigned int compression_bit = 0x00000001 ; - /// The bit alignment mask - static constexpr unsigned int bit_align = 0x00000003 ; - /// The additional padding added in buffer IO - static constexpr unsigned int padding = 3 ; - /// The additional padding mask - static constexpr unsigned int padding_mask = 0xfffffffc ; - /// The record marker - static constexpr unsigned int record_marker = 0xabadcafe ; - /// The block marker - static constexpr unsigned int block_marker = 0xdeadbeef ; - /// The maximum length of a record name - static constexpr std::size_t max_record_name_len = 64 ; - /// The maximum length of a record_info in memory - static constexpr std::size_t max_record_info_len = 2*sizeof(sio::ifstream::pos_type) + 5*sizeof(unsigned int) + max_record_name_len ; - - // TODO: Do we still need all of this ?? - static constexpr std::size_t single_len = 1 ; - static constexpr std::size_t double_len = 2 ; - static constexpr std::size_t quad_len = 4 ; - static constexpr std::size_t octo_len = 8 ; - - /** - * @brief record_info struct. - * - * Holds simple descriptive fields on record - */ - struct record_info { - ///< Position of the record start in the file - sio::ifstream::pos_type _file_start {0} ; - ///< Position of the record end in the file - sio::ifstream::pos_type _file_end {0} ; - ///< The size of the record header in memory - unsigned int _header_length {0} ; - ///< The record options - unsigned int _options {0} ; - ///< The size of the record data read out from the file - unsigned int _data_length {0} ; - ///< The size of the record data after uncompression (if compressed) - unsigned int _uncompressed_length {0} ; - ///< The record name - std::string _name {} ; - }; - - /** - * @brief block_info struct. - * - * Holds simple descriptive fields on block - */ - struct block_info { - ///< The start position of the block in the record buffer - unsigned int _record_start {0} ; - ///< The end position of the block in the record buffer - unsigned int _record_end {0} ; - ///< The size of the block header in memory - unsigned int _header_length {0} ; - ///< The block version - unsigned int _version {0} ; - ///< The size of the block data - unsigned int _data_length {0} ; - ///< The block name - std::string _name {} ; - }; - - /** - * @brief Streaming operator for record_info - */ - inline std::ostream &operator<<( std::ostream &stream, const record_info &info ) { - stream << "- name: " << info._name << std::endl ; - stream << "- file pos: " << info._file_start << " - " << info._file_end << std::endl ; - stream << "- header len: " << info._header_length << std::endl ; - stream << "- options: " << info._options << std::endl ; - stream << "- compressed len: " << info._data_length << std::endl ; - stream << "- uncompressed len: " << info._uncompressed_length << std::endl ; - return stream ; - } - - /** - * @brief Streaming operator for block_info - */ - inline std::ostream &operator<<( std::ostream &stream, const block_info &info ) { - stream << "- name: " << info._name << std::endl ; - stream << "- record pos: " << info._record_start << " - " << info._record_end << std::endl ; - stream << "- header len: " << info._header_length << std::endl ; - stream << "- version: " << info._version << std::endl ; - stream << "- data len: " << info._data_length << std::endl ; - return stream ; - } - - /** - * @brief Validate a name. - * - * SIO only accepts names starting with (regular expression) [A-Za-z_] - * and continuing with [A-Za-z0-9_] (which most people will recognize - * as the definition of a C/C++ variable name). - * - * @param name the string name to test - */ - inline bool validate( const std::string &name ) { - auto cname = name.c_str() ; - if( *cname < 0 ) { - return false; - } - if( !isalpha( (int)*cname ) && *cname != '_' ) { - return false; - } - for( cname += 1; *cname != '\0'; cname++ ) { - if( *cname < 0 ) { - return false; - } - if( !isalnum( (int)*cname ) && *cname != '_' ) { - return false; - } - } - return true; - } - - /** - * @brief Validate a record name - * - * @param name the record name to validate - */ - inline bool valid_record_name( const std::string &name ) { - if( not sio::validate( name ) ) { - return false ; - } - if( name.size() > sio::max_record_name_len ) { - return false ; - } - return true ; - } -} - -// SIO_LOGLVL defines the log level. The verbosity is fixed -// at compile time to avoid performance issue due to logging -// Log levels: -// - silent: 0 -// - debug: 1 -// - info: 2 -// - warning: 3 -// - error: 4 -#ifndef SIO_LOGLVL -#define SIO_LOGLVL 2 -#endif - -#if SIO_LOGLVL > 3 -#define SIO_DEBUG( message ) std::cout << "[SIO DEBUG] " << __FUNCTION__ << " - " << message << std::endl -#else -#define SIO_DEBUG( message ) -#endif - -#if SIO_LOGLVL > 2 -#define SIO_INFO( message ) std::cout << "[SIO INFO] - " << __FUNCTION__ << " - " << message << std::endl -#else -#define SIO_INFO( message ) -#endif - -#if SIO_LOGLVL > 1 -#define SIO_WARNING( message ) std::cout << "[SIO WARNING] - " << __FUNCTION__ << " - " << message << std::endl -#else -#define SIO_WARNING( message ) -#endif - -#if SIO_LOGLVL > 0 -#define SIO_ERROR( message ) std::cout << "[SIO ERROR] - " << __FUNCTION__ << " - " << message << std::endl -#else -#define SIO_ERROR( message ) -#endif - -// address cast -#define SIO_BYTE_CAST(pntr) (reinterpret_cast((pntr))) -#define SIO_CBYTE_CAST(pntr) (reinterpret_cast((pntr))) -#define SIO_UCHAR_CAST(pntr) (reinterpret_cast((pntr))) -#define SIO_CUCHAR_CAST(pntr) (reinterpret_cast((pntr))) - -// version decoding/encoding for backward compatibility -#define SIO_VERSION_MAJOR( v ) sio::version::major_version( v ) -#define SIO_VERSION_MINOR( v ) sio::version::minor_version( v ) -#define SIO_VERSION_ENCODE( maj, min ) sio::version::encode_version( maj, min ) - -#ifdef SIO_MACROS_WITH_EXCEPTION -#warning "SIO_MACROS_WITH_EXCEPTION activated!" -// Read or write data -#define SIO_DATA( dev, pnt, cnt ) \ - try { \ - SIO_DEBUG( "Reading/writing " << #pnt << " of size " << cnt ); \ - dev.data( pnt, cnt ) ; \ - } \ - catch( sio::exception &e ) { \ - SIO_RETHROW( e, sio::error_code::io_failure, "Failed to read or write data!" ) ; \ - } - -// Specialized macro for simple data reading/writing -#define SIO_SDATA( dev, dat ) \ - try { \ - SIO_DEBUG( "Simple reading/writing " << #dat ); \ - dev.data( dat ) ; \ - } \ - catch( sio::exception &e ) { \ - SIO_RETHROW( e, sio::error_code::io_failure, "Failed to read or write data!" ) ; \ - } - -// Read or write a pointer (pointer to) -#define SIO_PNTR( dev, pnt ) \ - try { \ - SIO_DEBUG( "Reading/writing pointer to" << #pnt ); \ - dev.pointer_to( (sio::ptr_type*)pnt ) ; \ - } \ - catch( sio::exception &e ) { \ - SIO_RETHROW( e, sio::error_code::io_failure, "Failed to read or write pointer to!" ) ; \ - } - -// Read or write a pointer tag (pointed at) -#define SIO_PTAG( dev, pnt ) \ - try { \ - SIO_DEBUG( "Reading/writing pointed at" << #pnt ); \ - dev.pointed_at( (sio::ptr_type*)pnt ) ; \ - } \ - catch( sio::exception &e ) { \ - SIO_RETHROW( e, sio::error_code::io_failure, "Failed to read or write pointed at!" ) ; \ - } -#else -// Read or write data -#define SIO_DATA( dev, pnt, cnt ) dev.data( pnt, cnt ) -// Specialized macro for simple data reading/writing -#define SIO_SDATA( dev, dat ) dev.data( dat ) -// Read or write a pointer (pointer to) -#define SIO_PNTR( dev, pnt ) dev.pointer_to( (sio::ptr_type*)pnt ) -// Read or write a pointer tag (pointed at) -#define SIO_PTAG( dev, pnt ) dev.pointed_at( (sio::ptr_type*)pnt ) - -#endif diff --git a/sio/include/sio/exception.h b/sio/include/sio/exception.h deleted file mode 100644 index c00f44868..000000000 --- a/sio/include/sio/exception.h +++ /dev/null @@ -1,147 +0,0 @@ -#pragma once - -// -- std headers -#include -#include - -// exception helper macros -#define SIO_THROW( code, message ) throw sio::exception( code, __LINE__, __FUNCTION__, __FILE__, message ) -#define SIO_RETHROW( orig, code, message ) throw sio::exception( orig, code, __LINE__, __FUNCTION__, __FILE__, message ) - -namespace sio { - - /** - * @brief error_code enumerator - */ - enum class error_code : unsigned int { - invalid_argument, - not_found, - already_open, - open_fail, - not_open, - eof, - io_failure, - no_marker, - compress_error, - bad_state, - bad_alloc, - out_of_range - }; - - //-------------------------------------------------------------------------- - //-------------------------------------------------------------------------- - - /** - * @brief error_code_helper class. - * - * Helper class for error_code manipulation - */ - class error_code_helper { - public: - // static API only - error_code_helper() = delete ; - - public: - /** - * @brief Convert error_code to string - * - * @param code the code to convert - */ - static std::string to_string( error_code code ) noexcept ; - }; - - //-------------------------------------------------------------------------- - //-------------------------------------------------------------------------- - - /** - * @brief exception class - * - * Main sio exception class. - */ - class exception : public std::exception { - public: - exception() = delete ; - exception( const exception & ) = default ; - ~exception() = default ; - - /** - * @brief Constructor - * - * @param code the error code - * @param line the exception line number - * @param func the function name in which the exception has been thrown - * @param fname the file in which the exception has been thrown - * @param msg the exception message - */ - exception( error_code code, unsigned int line, const std::string &func, const std::string &fname, const std::string &msg ) ; - - /** - * @brief Constructor - * - * @param rhs any possible class having a method what() returning a string - * @param code the error code - * @param line the exception line number - * @param func the function name in which the exception has been thrown - * @param fname the file in which the exception has been thrown - * @param msg the exception message - */ - template - exception( const T &rhs, error_code code, unsigned int line, const std::string &func, const std::string &fname, const std::string &msg ) ; - - /** - * @brief Get the full exception message - */ - const char* what() const noexcept override ; - - /** - * @brief Get the associated error code - */ - sio::error_code code() const ; - - protected: - /** - * @brief Helper function creating the full exception message - * - * @param code the error code - * @param line the exception line number - * @param func the function name in which the exception has been thrown - * @param fname the file in which the exception has been thrown - * @param msg the exception message - */ - std::string message( error_code code, unsigned int line, const std::string &func, const std::string &fname, const std::string &msg ) const ; - - /** - * @brief Helper function creating the full exception message - * - * @param a previous message to prepend in the message (plus a line break) - * @param code the error code - * @param line the exception line number - * @param func the function name in which the exception has been thrown - * @param fname the file in which the exception has been thrown - * @param msg the exception message - */ - std::string message( const std::string &previous, error_code code, unsigned int line, const std::string &func, const std::string &fname, const std::string &msg ) const ; - - protected: - ///< The associated error code - const error_code _code ; - ///< The full exception message - const std::string _message ; - }; - - //-------------------------------------------------------------------------- - - template - inline exception::exception( - const T &rhs, - error_code code, - unsigned int line, - const std::string &func, - const std::string &fname, - const std::string &msg ) : - _code( code ) , - _message( message(rhs.what(), code, line, func, fname, msg) ) { - /* nop */ - } - -} diff --git a/sio/include/sio/io_device.h b/sio/include/sio/io_device.h deleted file mode 100644 index f877bb0ec..000000000 --- a/sio/include/sio/io_device.h +++ /dev/null @@ -1,383 +0,0 @@ -#pragma once - -// -- sio headers -#include -#include - -namespace sio { - - class buffer ; - class buffer_span ; - - /** - * @brief read_device class. - * - * Holds a buffer_span and a cursor allowing to read - * data sequentially, moving the cursor after reading. - */ - class read_device { - public: - using cursor_type = std::size_t ; - using size_type = std::size_t ; - - public: - /// Default constructor - read_device() = default ; - /// Default copy constructor - read_device( const read_device & ) = default ; - /// Default move constructor - read_device( read_device && ) = default ; - /// Default assignement operator - read_device& operator=( const read_device & ) = default ; - /// Default move assignement operator - read_device& operator=( read_device && ) = default ; - /// Default destructor - ~read_device() = default ; - - /** - * @brief Constructor with buffer span - * - * @param buf the input buffer span - */ - read_device( buffer_span buf ) ; - - /** - * @name Buffer - */ - ///{@ - /** - * @brief Set the buffer span to use (move) - * - * @param buf the buffer to use - */ - void set_buffer( buffer_span &&buf ) ; - - /** - * @brief Set the buffer span to use (copy) - * - * @param buf the buffer to use - */ - void set_buffer( const buffer_span &buf ) ; - ///@} - - /** - * @name Cursor - */ - ///{@ - /** - * @brief Get the cursor position - */ - cursor_type position() const ; - - /** - * @brief Seek the cursor at a given position - * - * @param pos the new cursor position - */ - void seek( cursor_type pos ) ; - ///@} - - /** - * @name I/O operations - */ - ///{@ - /** - * @brief Read out a variable from the buffer. Move the cursor accordingly - * - * @param var the variable to receive - */ - template - void data( T &var ) ; - - /** - * @brief Read out a vector from the buffer. Move the cursor accordingly - * - * @param vars the vector to receive - */ - template - void data( std::vector &vars ) ; - - /** - * @brief Read out an array of variables from the buffer. Move the cursor accordingly - * - * @param var the address of the array - * @param count the number of element to read out - */ - template - void data( T *var, size_type count ) ; - - /** - * @brief Read out a "pointer to" pointer from the buffer. - * A new entry is created for a future relocation. - * The pointer relocation is performed at the end of record reading - * - * @param ptr the address to register - */ - void pointer_to( ptr_type *ptr ) ; - - /** - * @brief Read out a "pointed at" pointer from the buffer. - * A new entry is created for a future relocation. - * The pointer relocation is performed at the end of record reading - * - * @param ptr the address to register - */ - void pointed_at( ptr_type *ptr ) ; - - /** - * @brief Perform the pointer relocation after the whole record has - * been read. The pointers are relocated and the pointer maps - * are cleared - */ - void pointer_relocation() ; - ///@} - - private: - ///< The buffer span - buffer_span _buffer {} ; - ///< The device cursor - cursor_type _cursor {0} ; - ///< The map of pointer "pointed at" - pointed_at_map _pointed_at {} ; - ///< The map of pointer "pointer to" - pointer_to_map _pointer_to {} ; - }; - - //-------------------------------------------------------------------------- - //-------------------------------------------------------------------------- - - /** - * @brief write_device class. - * - * Holds a buffer and provide a api to write data sequentially - * to this buffer by using a cursor - */ - class write_device { - public: - using cursor_type = std::size_t ; - using size_type = std::size_t ; - - public: - /// No default constructor - write_device() = delete ; - /// Default copy constructor - write_device( const write_device & ) = delete ; - /// Default move constructor - write_device( write_device && ) = default ; - /// Default assignement operator - write_device& operator=( const write_device & ) = delete ; - /// Default move assignement operator - write_device& operator=( write_device && ) = default ; - /// Default destructor - ~write_device() = default ; - /// Constructor with buffer - write_device( buffer&& buf ) ; - - /** - * @name Buffer - */ - ///{@ - /** - * @brief Set the buffer to use (move) - * - * @param buf the buffer to use - */ - void set_buffer( buffer&& buf ) ; - - /** - * @brief Take out the buffer from the device. - * The buffer in the device becomes invalid - */ - buffer take_buffer() ; - ///@} - - /** - * @name Cursor - */ - ///{@ - /** - * @brief Get the cursor position - */ - cursor_type position() const ; - - /** - * @brief Seek the cursor at a given position - * - * @param pos the new cursor position - */ - void seek( cursor_type pos ) ; - ///@} - - /** - * @name I/O operations - */ - ///{@ - /** - * @brief Write out a variable to the buffer. Move the cursor accordingly - * - * @param var the variable to write - */ - template - void data( const T &var ) ; - - /** - * @brief Write out a vector to the buffer. Move the cursor accordingly - * - * @param vars the vector to write - */ - template - void data( const std::vector &vars ) ; - - /** - * @brief Write out an array of variables to the buffer. Move the cursor accordingly - * - * @param var the address of the array - * @param count the number of element to write out - */ - template - void data( const T *const var, size_type count ) ; - - /** - * @brief Write out a "pointer to" pointer to the buffer. - * A new entry is created for a future relocation. - * The pointer relocation is performed at the end of record writting - * - * @param ptr the address to register - */ - void pointer_to( ptr_type *ptr ) ; - - /** - * @brief Write out a "pointed at" pointer to the buffer. - * A new entry is created for a future relocation. - * The pointer relocation is performed at the end of record writting - * - * @param ptr the address to register - */ - void pointed_at( ptr_type *ptr ) ; - - /** - * @brief Perform the pointer relocation after the whole record has - * been written. The pointers are relocated and the pointer maps - * are cleared - */ - void pointer_relocation() ; - ///@} - - private: - ///< The buffer in which to write - buffer _buffer ; - ///< The device cursor - cursor_type _cursor {0} ; - ///< The map of pointer "pointed at" - pointed_at_map _pointed_at {} ; - ///< The map of pointer "pointer to" - pointer_to_map _pointer_to {} ; - }; - -} - -#include - -namespace sio { - - //-------------------------------------------------------------------------- - - // specialization of string - template <> - inline void read_device::data( std::string &var ) { - int len(0) ; - data( len ) ; - var.resize( len ) ; - data( &var[0], len ) ; - } - - //-------------------------------------------------------------------------- - - // specialization of vector of strings - template <> - inline void read_device::data( std::vector &vars ) { - int len (0) ; - data( len ) ; - if( len > 0 ) { - vars.resize( len ) ; - for( std::string &str : vars ) { - data( str ) ; - } - } - } - - //-------------------------------------------------------------------------- - - template - inline void read_device::data( T &var ) { - data( &var, 1 ) ; - } - - //-------------------------------------------------------------------------- - - template - inline void read_device::data( std::vector &vars ) { - int len (0) ; - data( len ) ; - if( len > 0 ) { - vars.resize( len ) ; - data( &vars[0], len ) ; - } - } - - //-------------------------------------------------------------------------- - - template - inline void read_device::data( T *var, size_type count ) { - _cursor += sio::api::read( _buffer, var, _cursor, count ) ; - } - - //-------------------------------------------------------------------------- - //-------------------------------------------------------------------------- - - // specialization for string - template <> - inline void write_device::data( const std::string &var ) { - int len = var.size() ; - data( len ) ; - data( var.data(), len ) ; - } - - //-------------------------------------------------------------------------- - - // specialization for vector of strings - template <> - inline void write_device::data( const std::vector &vars ) { - data( static_cast(vars.size()) ) ; - if( not vars.empty() ) { - for( auto &str : vars ) { - data( str ) ; - } - } - } - - //-------------------------------------------------------------------------- - - template - inline void write_device::data( const T &var ) { - data( &var, 1 ) ; - } - - //-------------------------------------------------------------------------- - - template - inline void write_device::data( const std::vector &vars ) { - data( (int)vars.size() ) ; - if( not vars.empty() ) { - data( &vars[0], vars.size() ) ; - } - } - - //-------------------------------------------------------------------------- - - template - inline void write_device::data( const T *const var, size_type count ) { - _cursor += sio::api::write( _buffer, var, _cursor, count ) ; - } - -} diff --git a/sio/include/sio/memcpy.h b/sio/include/sio/memcpy.h deleted file mode 100644 index 93bf79cd0..000000000 --- a/sio/include/sio/memcpy.h +++ /dev/null @@ -1,119 +0,0 @@ -#pragma once - -// -- sio headers -#include - -// -- std headers -#include // std::memcpy, std::size_t - -namespace sio { - - /** - * @brief sizeof_helper struct. - * Helper structure to hardcode the size of some types. - * This is there to ensure backward compatibility with - * the old SIO implementation - */ - template - struct sizeof_helper { - static constexpr std::size_t size = sizeof(T) ; - }; - -#define SIO_FORCE_SIZEOF( TYPE, SIZE ) \ - template <> \ - struct sizeof_helper { \ - static constexpr std::size_t size = SIZE ; \ - } - - SIO_FORCE_SIZEOF( char, 1 ) ; - SIO_FORCE_SIZEOF( unsigned char, 1 ) ; - SIO_FORCE_SIZEOF( short, 2 ) ; - SIO_FORCE_SIZEOF( unsigned short, 2 ) ; - SIO_FORCE_SIZEOF( int , 4 ) ; - SIO_FORCE_SIZEOF( unsigned int , 4 ) ; -#if defined(_AIX) || defined(__alpha__) || defined(__i386__) || defined(__sparc__) || defined(__APPLE_CC__) || defined(_LP64) - SIO_FORCE_SIZEOF( long long , 8 ) ; - SIO_FORCE_SIZEOF( unsigned long long , 8 ) ; -#else - SIO_FORCE_SIZEOF( __int64 , 8 ) ; - SIO_FORCE_SIZEOF( unsigned __int64 , 8 ) ; -#endif - SIO_FORCE_SIZEOF( float , 4 ) ; - SIO_FORCE_SIZEOF( double , 8 ) ; - -#undef SIO_FORCE_SIZEOF - - //-------------------------------------------------------------------------- - //-------------------------------------------------------------------------- - - /** - * @brief memcpy class - * - * Perform raw data copy and deals with plateform endian-ness - */ - class memcpy { - public: - // static API only - memcpy() = delete ; - - /** - * @brief Perform a reverse byte copy - * - * @param from the input bytes address to copy - * @param dest the output destination of copied bytes - * @param size the size of the element in the bytes - * @param count the number of elements to copy - */ - static void reverse_copy( const sio::byte *const from, sio::byte *dest, std::size_t size, std::size_t count ) ; - - /** - * @brief Perform a byte array copy - * - * @param from the input bytes address to copy - * @param dest the output destination of copied bytes - * @param size the size of the element in the bytes - * @param count the number of elements to copy - */ - static void copy( const sio::byte *const from, sio::byte *dest, std::size_t size, std::size_t count ) ; - - /** - * @brief Template overload of raw copy (see above) for writing. - * The size of the template parameter is evaluated using the - * helper structure sizeof_helper. - * - * @param from the array to copy - * @param dest the destination byte pointer - * @param count the number of elements to copy - */ - template - static void write( const T *const from, sio::byte *dest, std::size_t count ) ; - - /** - * @brief Template overload of raw copy (see above) for reading. - * The size of the template parameter is evaluated using the - * helper structure sizeof_helper. - * - * @param from the bytes to copy - * @param dest the destination array - * @param count the number of elements to copy - */ - template - static void read( const sio::byte *const from, T *dest, std::size_t count ) ; - }; - - //-------------------------------------------------------------------------- - //-------------------------------------------------------------------------- - - template - inline void memcpy::write( const T *const from, sio::byte *dest, std::size_t count ) { - sio::memcpy::copy( reinterpret_cast(from), dest, sizeof_helper::size, count ) ; - } - - //-------------------------------------------------------------------------- - - template - inline void memcpy::read( const sio::byte *const from, T *dest, std::size_t count ) { - sio::memcpy::copy( from, reinterpret_cast(dest), sizeof_helper::size, count ) ; - } - -} diff --git a/sio/include/sio/version.h b/sio/include/sio/version.h deleted file mode 100644 index e8e564e26..000000000 --- a/sio/include/sio/version.h +++ /dev/null @@ -1,47 +0,0 @@ -#pragma once - -// -- sio headers -#include - -namespace sio { - - /** - * @brief version class. - * - * Helper class to encode or decode version in a single variable - */ - class version { - public: - using version_type = sio::version_type ; - using major_type = uint16_t ; - using minor_type = uint16_t ; - - public: - // static API only - version() = delete ; - - /** - * @brief Encode a version from a major and minor version number - * - * @param major the major version number - * @param minor the minor version number - */ - static version_type encode_version( major_type major, minor_type minor ) noexcept ; - - /** - * @brief Decode a minor version number from the version number - * - * @param version the full version number - */ - static minor_type minor_version( version_type version ) noexcept ; - - /** - * @brief Decode a major version number from the version number - * - * @param version the full version number - */ - static major_type major_version( version_type version ) noexcept ; - }; - -} - diff --git a/sio/src/api.cc b/sio/src/api.cc deleted file mode 100644 index a55aa3646..000000000 --- a/sio/src/api.cc +++ /dev/null @@ -1,596 +0,0 @@ -// -- sio headers -#include -#include -#include -#include -#include -#include -#include -#include - -// -- std headers -#include -#include -#include -#include -#include - -namespace sio { - - void api::read_relocation( pointed_at_map& pointed_at, pointer_to_map& pointer_to ) { - // Pointer relocation on read. - // Some of these variables are a little terse! Expanded meanings: - // ptol: Iterator pointing to lower bound in the 'pointer to' multimap - // ptoh: Iterator pointing to upper bound in the 'pointer to' multimap - // ptoi: Iterator for the 'pointer to' multimap (runs [ptol, ptoh) ) - // pati: Iterator in the 'pointed at' map (search map for ptol->first) - auto ptol = pointer_to.begin() ; - while( ptol != pointer_to.end() ) { - auto ptoh = pointer_to.upper_bound( ptol->first ) ; - auto pati = pointed_at.find( ptol->first ) ; - bool pat_found( pati != pointed_at.end() ) ; - // if the pointed at object is not found we set the pointer to null - for( auto ptoi = ptol; ptoi != ptoh; ptoi++ ) { - auto pointer = static_cast( ptoi->second ) ; - *pointer = ( pat_found ? reinterpret_cast( pati->second ) : 0 ) ; - } - ptol = ptoh ; - } - } - - //-------------------------------------------------------------------------- - - void api::write_relocation( buffer::const_pointer rec_start, pointed_at_map& pointed_at, pointer_to_map& pointer_to ) { - // Pointer relocation on write. - // Some of these variables are a little terse! Expanded meanings: - // ptol: Iterator pointing to lower bound in the 'pointer to' multimap - // ptoh: Iterator pointing to upper bound in the 'pointer to' multimap - // ptoi: Iterator for the 'pointer to' multimap (runs [ptol, ptoh) ) - // pati: Iterator in the 'pointed at' map (search map for ptol->first) - unsigned int match = 0x00000001 ; - auto ptol = pointer_to.begin() ; - while( ptol != pointer_to.end() ) { - auto ptoh = pointer_to.upper_bound( ptol->first ) ; - auto pati = pointed_at.find( ptol->first ) ; - if( pati != pointed_at.end() ) { - auto pointer = rec_start + reinterpret_cast( pati->second ) ; - sio::memcpy::write( &match, (sio::byte*)pointer, 1 ) ; - for( auto ptoi = ptol; ptoi != ptoh; ptoi++ ) { - pointer = rec_start + reinterpret_cast( ptoi->second ) ; - sio::memcpy::write( &match, (sio::byte*)pointer, 1 ) ; - } - } - match++ ; - ptol = ptoh ; - } - } - - //-------------------------------------------------------------------------- - - void api::read_record_info( sio::ifstream &stream, record_info &rec_info, buffer &outbuf ) { - if( not stream.is_open() ) { - SIO_THROW( sio::error_code::not_open, "ifstream is not open!" ) ; - } - if( not stream.good() ) { - SIO_THROW( sio::error_code::bad_state, "ifstream is in a bad state!" ) ; - } - rec_info._file_start = stream.tellg() ; - outbuf.resize( sio::max_record_info_len ) ; - SIO_DEBUG( "Reading first record bytes of input stream at position: " << stream.tellg() ) ; - stream.read( outbuf.data(), 8 ) ; - if( stream.eof() ) { - SIO_THROW( sio::error_code::eof, "Reached end of file !" ) ; - } - if( not stream.good() ) { - SIO_THROW( sio::error_code::bad_state, "ifstream is in a bad state after reading first record bytes!" ) ; - } - unsigned int marker(0) ; - read_device device( outbuf.span() ) ; - // Interpret: 1) The length of the record header. - // 2) The record marker. - device.data( rec_info._header_length ) ; - device.data( marker ) ; - if( marker != sio::record_marker ) { - stream.setstate( sio::ifstream::failbit ) ; - SIO_THROW( sio::error_code::no_marker, "Record marker not found!" ) ; - } - // Interpret: 3) The options word. - // 4) The length of the record data (compressed). - // 5) The length of the record name (uncompressed). - // 6) The length of the record name. - // 7) The record name. - stream.read( outbuf.ptr(8), rec_info._header_length-8 ) ; - device.seek( 8 ) ; - device.data( rec_info._options ) ; - device.data( rec_info._data_length ) ; - device.data( rec_info._uncompressed_length ) ; - unsigned int name_length(0) ; - device.data( name_length ) ; - if( name_length > sio::max_record_name_len ) { - SIO_THROW( sio::error_code::no_marker, "Invalid record name size (limited)" ) ; - } - rec_info._name.assign( name_length, '\0' ) ; - device.data( &(rec_info._name[0]), name_length ) ; - const auto compressed = sio::api::is_compressed( rec_info._options ) ; - // if the record is compressed skip the read pointer over - // any padding bytes that may have been inserted to make - // the next record header start on a four byte boundary in the file. - auto tot_len = rec_info._data_length + rec_info._header_length ; - SIO_DEBUG( "Total len before: " << tot_len ) ; - if( compressed ) { - tot_len += ((4 - (rec_info._data_length & sio::bit_align)) & sio::bit_align) ; - } - SIO_DEBUG( "Total len after padding: " << tot_len ) ; - rec_info._file_end = rec_info._file_start ; - rec_info._file_end += tot_len ; - // a bit of debugging ... - SIO_DEBUG( "=== Read record info ====" ) ; - SIO_DEBUG( rec_info ) ; - SIO_DEBUG( "read_record_info: Resizing buffer to " << rec_info._header_length ) ; - outbuf.resize( rec_info._header_length ) ; - } - - //-------------------------------------------------------------------------- - - void api::read_record_data( sio::ifstream &stream, const record_info &rec_info, buffer &outbuf, std::size_t buffer_shift ) { - if( not stream.is_open() ) { - SIO_THROW( sio::error_code::not_open, "ifstream is not open!" ) ; - } - if( not stream.good() ) { - SIO_THROW( sio::error_code::bad_state, "ifstream is in a bad state!" ) ; - } - // resize the buffer to the expected read size. - // this may not re-allocate the buffer internally - // if it was large enough - outbuf.resize( buffer_shift + rec_info._data_length ) ; - // go to record start - auto seek_pos = rec_info._file_start ; - seek_pos += rec_info._header_length ; - stream.seekg( seek_pos ) ; - if( not stream.good() ) { - SIO_THROW( sio::error_code::bad_state, "ifstream is in a bad state after a seek operation!" ) ; - } - stream.read( outbuf.ptr( buffer_shift ), rec_info._data_length ) ; - if( not stream.good() ) { - SIO_THROW( sio::error_code::io_failure, "ifstream is in a bad state after a read operation!" ) ; - } - if( not stream.seekg( rec_info._file_end ).good() ) { - SIO_THROW( sio::error_code::bad_state, "ifstream is in a bad state after a seek operation!" ) ; - } - SIO_DEBUG( "read_record_data: Resizing buffer to " << buffer_shift + rec_info._data_length ) ; - outbuf.resize( buffer_shift + rec_info._data_length ) ; - } - - //-------------------------------------------------------------------------- - - void api::read_record( sio::ifstream &stream, record_info &rec_info, buffer &outbuf ) { - // read out the record info - api::read_record_info( stream, rec_info, outbuf ) ; - // read out the record data in the buffer. Shift the buffer position by the - // size of the record header to keep the record header bytes in the buffer too. - api::read_record_data( stream, rec_info, outbuf, rec_info._header_length ) ; - } - - //-------------------------------------------------------------------------- - - std::pair api::read_record( sio::ifstream &stream ) { - record_info rec_info ; - buffer outbuf( sio::mbyte ) ; - api::read_record( stream, rec_info, outbuf ) ; - return std::make_pair( rec_info, std::move( outbuf ) ) ; - } - - //-------------------------------------------------------------------------- - - void api::skip_n_records( sio::ifstream &stream, std::size_t nskip ) { - std::size_t counter = 0 ; - api::skip_records( stream, [&]( const record_info & ) { - ++ counter ; - return ( counter < nskip ) ; - }) ; - } - - //-------------------------------------------------------------------------- - - void api::skip_records( sio::ifstream &stream, std::size_t nskip, const std::string &name ) { - std::size_t counter = 0 ; - api::skip_records( stream, [&]( const record_info &rec_info ) { - if( name == rec_info._name ) { - ++ counter ; - } - return ( counter < nskip ) ; - }) ; - } - - //-------------------------------------------------------------------------- - - void api::go_to_record( sio::ifstream &stream, const std::string &name ) { - record_info goto_info ; - api::skip_records( stream, [&]( const record_info &rec_info ) { - if( name == rec_info._name ) { - goto_info = rec_info ; - return false ; - } - return true ; - }) ; - stream.seekg( goto_info._file_start ) ; - if( not stream.good() ) { - SIO_THROW( sio::error_code::bad_state, "ifstream is in a bad state after a seek operation!" ) ; - } - } - - //-------------------------------------------------------------------------- - - std::vector api::read_block_infos( const buffer_span &buf ) { - if( not buf.valid() ) { - SIO_THROW( sio::error_code::bad_state, "Buffer is invalid." ) ; - } - std::vector block_infos ; - buffer_span::index_type current_pos (0) ; - while( 1 ) { - // end of block buffer ? - if( current_pos >= buf.size() ) { - break ; - } - auto block_data = sio::api::extract_block( buf, current_pos ) ; - current_pos = block_data.first._record_end ; - block_infos.push_back( block_data.first ) ; - } - return block_infos ; - } - - //-------------------------------------------------------------------------- - - std::pair api::extract_block( const buffer_span &rec_buf, buffer_span::index_type index ) { - if( index >= rec_buf.size() ) { - SIO_THROW( sio::error_code::invalid_argument, "Start of block pointing after end of record!" ) ; - } - block_info info ; - SIO_DEBUG( "Block buffer size is " << rec_buf.size() ) ; - SIO_DEBUG( "Block index is " << index ) ; - read_device device( rec_buf.subspan( index ) ) ; - info._record_start = index ; - unsigned int marker(0), block_len(0) ; - device.data( block_len ) ; - SIO_DEBUG( "Block len is " << block_len ) ; - device.data( marker ) ; - // check for a block marker - if( sio::block_marker != marker ) { - std::stringstream ss ; - ss << "Block marker not found (block marker: " << sio::block_marker <<", record marker: " << sio::record_marker << ", got " << marker << ")" ; - SIO_THROW( sio::error_code::no_marker, ss.str() ) ; - } - device.data( info._version ) ; - unsigned int name_len(0) ; - device.data( name_len ) ; - info._name.assign( name_len, '\0' ) ; - device.data( &(info._name[0]), name_len ) ; - info._header_length = device.position() ; - info._data_length = block_len - info._header_length ; - device.seek( block_len ) ; - info._record_end = index + block_len ; - return std::make_pair( info, rec_buf.subspan( index, block_len ) ) ; - } - - //-------------------------------------------------------------------------- - - void api::read_blocks( const buffer_span &rec_buf, const std::vector>& blocks ) { - if( not rec_buf.valid() ) { - SIO_THROW( sio::error_code::bad_state, "Buffer is invalid." ) ; - } - buffer_span::index_type current_pos (0) ; - read_device device ; - while( 1 ) { - // end of block buffer ? - if( current_pos >= rec_buf.size() ) { - break ; - } - auto block_data = sio::api::extract_block( rec_buf, current_pos ) ; - current_pos = block_data.first._record_end ; - // look for the block decoder - auto block_iter = std::find_if( blocks.begin(), blocks.end(), [&]( std::shared_ptr blk ) { - return ( blk->name() == block_data.first._name ) ; - }) ; - // skip the block if no decoder - if( blocks.end() == block_iter ) { - continue ; - } - // prepare the read device - device.set_buffer( block_data.second ) ; - device.seek( block_data.first._header_length ) ; - try { - (*block_iter)->read( device, block_data.first._version ) ; - } - catch( sio::exception &e ) { - SIO_RETHROW( e, sio::error_code::io_failure, "Failed to decode block buffer (" + block_data.first._name + ")" ) ; - } - } - device.pointer_relocation() ; - } - - //-------------------------------------------------------------------------- - - void api::dump_records( sio::ifstream &stream, std::size_t skip, std::size_t count, bool detailed ) { - try { - // skip records first - if( skip > 0 ) { - sio::api::skip_n_records( stream, skip ) ; - } - sio::record_info rec_info ; - sio::buffer info_buffer( sio::max_record_info_len ) ; - sio::buffer rec_buffer( sio::mbyte ) ; - sio::buffer uncomp_rec_buffer( sio::mbyte ) ; - unsigned int record_counter (0) ; - const unsigned int tab_len = 117 ; - if( not detailed ) { - std::cout << std::string( tab_len, '-' ) << std::endl ; - std::cout << - std::setw(30) << std::left << "Record name " << " | " << - std::setw(15) << "Start" << " | " << - std::setw(15) << "End" << " | " << - std::setw(12) << "Options" << " | " << - std::setw(10) << "Header len" << " | " << - std::setw(15) << "Data len" << - std::endl ; - std::cout << std::string( tab_len, '-' ) << std::endl ; - } - while(1) { - if( record_counter >= count ) { - break ; - } - SIO_DEBUG( "Start reading next record info from stream" ) ; - sio::api::read_record_info( stream, rec_info, info_buffer ) ; - if( detailed ) { - SIO_DEBUG( "Detailed: Start reading next record data from stream" ) ; - sio::api::read_record_data( stream, rec_info, rec_buffer ) ; - } - // seek after the record to read the next record info - stream.seekg( rec_info._file_end ) ; - ++ record_counter ; - if( detailed ) { - std::cout << std::string( tab_len, '-' ) << std::endl ; - std::cout << - std::setw(30) << std::left << "Record name " << " | " << - std::setw(15) << "Start" << " | " << - std::setw(15) << "End" << " | " << - std::setw(12) << "Options" << " | " << - std::setw(10) << "Header len" << " | " << - std::setw(15) << "Data len" << - std::endl ; - } - std::stringstream size_str ; - size_str << rec_info._data_length << " (" << rec_info._uncompressed_length << ")" ; - std::cout << - std::setw(30) << std::left << rec_info._name << " | " << - std::setw(15) << rec_info._file_start << " | " << - std::setw(15) << rec_info._file_end << " | " << - std::setw(12) << rec_info._options << " | " << - std::setw(10) << rec_info._header_length << " | " << - std::setw(15) << size_str.str() << - std::endl ; - if( detailed ) { - std::cout << std::string( tab_len, '-' ) << std::endl ; - std::cout << - std::setw(30) << std::left << "Block name " << " | " << - std::setw(15) << "Start" << " | " << - std::setw(15) << "End" << " | " << - std::setw(12) << "Version" << " | " << - std::setw(10) << "Header len" << " | " << - std::setw(15) << "Data len" << - std::endl ; - std::cout << std::string( tab_len, '-' ) << std::endl ; - const bool compressed = sio::api::is_compressed( rec_info._options ) ; - if( compressed ) { - // FIXME use zlib by default ?? - sio::zlib_compression compressor ; - uncomp_rec_buffer.resize( rec_info._uncompressed_length ) ; - compressor.uncompress( rec_buffer.span(), uncomp_rec_buffer ) ; - } - sio::buffer_span device_buffer = compressed ? uncomp_rec_buffer.span() : rec_buffer.span( 0, rec_info._data_length ) ; - SIO_DEBUG( "Start extracting block infos" ) ; - auto block_infos = sio::api::read_block_infos( device_buffer ) ; - SIO_DEBUG( "Number of blocks found: " << block_infos.size() ) ; - for( auto binfo : block_infos ) { - std::stringstream version_str ; - version_str << sio::version::major_version( binfo._version ) << "." << sio::version::minor_version( binfo._version ) ; - std::cout << - std::setw(30) << std::left << binfo._name << " | " << - std::setw(15) << binfo._record_start << " | " << - std::setw(15) << binfo._record_end << " | " << - std::setw(12) << version_str.str() << " | " << - std::setw(10) << binfo._header_length << " | " << - std::setw(15) << binfo._data_length << - std::endl ; - } - std::cout << std::endl ; - } - } - } - catch( sio::exception &e ) { - // we are finished ! - if( e.code() == sio::error_code::eof ) { - return ; - } - throw e ; - } - } - - //-------------------------------------------------------------------------- - - void api::write_blocks( write_device &device, const block_list &blocks ) { - for( auto blk : blocks ) { - auto blk_ptr = blk ; - try { - auto block_start = device.position() ; - auto block_name = blk_ptr->name() ; - unsigned int blkname_len = block_name.size() ; - // write the block header. It will be updated after - // the block has been written - device.data( sio::block_marker ) ; - device.data( sio::block_marker ) ; - device.data( blk_ptr->version() ) ; - device.data( blkname_len ) ; - device.data( block_name.c_str(), blkname_len ) ; - // write the block data - blk_ptr->write( device ) ; - // fill back the block length in block header - auto blk_end = device.position() ; - unsigned int blklen = blk_end - block_start ; - SIO_DEBUG( "Block len :" << blklen ) ; - device.seek( block_start ) ; - device.data( blklen ) ; - device.seek( blk_end ) ; - } - catch( sio::exception &e ) { - SIO_RETHROW( e, sio::error_code::io_failure, "Couldn't write block to buffer (" + blk_ptr->name() + ")" ) ; - } - } - device.pointer_relocation() ; - } - - //-------------------------------------------------------------------------- - - record_info api::write_record( const std::string &name, buffer &rec_buf, const block_list& blocks, sio::options_type opts ) { - if( not sio::valid_record_name( name ) ) { - SIO_THROW( sio::error_code::invalid_argument, "Record name '" + name + "' is invalid" ) ; - } - if( not rec_buf.valid() ) { - SIO_THROW( sio::error_code::invalid_argument, "Buffer is invalid" ) ; - } - try { - sio::api::set_compression( opts, false ) ; - record_info info ; - info._options = opts ; - info._name = name ; - write_device device( std::move(rec_buf) ) ; - // Output: 1) A placeholder for the record header length. - // 2) A 'framing' marker (to help in debugging). - // 3) An options word. - // 4) A placeholder for the record data length (compressed). - // 5) A placeholder for the record data length (uncompressed). - // 6) The length of the record name. - // 7) The record name. - device.data( sio::record_marker ) ; - device.data( sio::record_marker ) ; - device.data( opts ) ; - auto datalen_pos = device.position() ; - device.data( sio::record_marker ) ; - device.data( sio::record_marker ) ; - unsigned int name_len = name.size() ; - device.data( name_len ) ; - device.data( &(name[0]), name_len ) ; - // write back the header len - info._header_length = device.position() ; - device.seek( 0 ) ; - device.data( info._header_length ) ; - device.seek( info._header_length ) ; - // write the blocks - sio::api::write_blocks( device, blocks ) ; - // fill the data length and uncompressed record length - auto end_pos = device.position() ; - device.seek( datalen_pos ) ; - info._data_length = end_pos - info._header_length ; - info._uncompressed_length = end_pos - info._header_length ; - device.data( info._data_length ) ; - device.data( info._uncompressed_length ) ; - // get back the buffer - rec_buf = std::move( device.take_buffer() ) ; - rec_buf.resize( end_pos ) ; - return info ; - } - catch( sio::exception &e ) { - SIO_RETHROW( e, sio::error_code::io_failure, "Couldn't write record into buffer" ) ; - } - } - - //-------------------------------------------------------------------------- - - void api::write_record( sio::ofstream &stream, const buffer_span &rec_buf, record_info &rec_info ) { - if( not stream.is_open() ) { - SIO_THROW( sio::error_code::not_open, "ofstream is not open!" ) ; - } - if( not stream.good() ) { - SIO_THROW( sio::error_code::bad_state, "ofstream is in a bad state!" ) ; - } - if( not rec_buf.valid() ) { - SIO_THROW( sio::error_code::invalid_argument, "The record buffer is not valid" ) ; - } - rec_info._file_start = stream.tellp() ; - // write data - if( not stream.write( rec_buf.data(), rec_buf.size() ).good() ) { - SIO_THROW( sio::error_code::io_failure, "Couldn't write record buffer to output stream" ) ; - } - // always add some padding bytes at the end - auto padlen = (4 - (rec_buf.size() & sio::bit_align)) & sio::bit_align; - if( padlen > 0 ) { - SIO_DEBUG( "Writing " << padlen << " bytes for padding ..." ) ; - if( not stream.write( sio::padding_bytes, padlen ).good() ) { - SIO_THROW( sio::error_code::io_failure, "Couldn't write record buffer padding to output stream" ) ; - } - } - // flush the stream - if( not stream.flush().good() ) { - SIO_THROW( sio::error_code::io_failure, "Couldn't flush output stream" ) ; - } - rec_info._file_end = stream.tellp() ; - SIO_DEBUG( "Written record with info :\n" << rec_info ) ; - } - - //-------------------------------------------------------------------------- - - void api::write_record( sio::ofstream &stream, const buffer_span &hdr_span, const buffer_span &data_span, record_info &rec_info ) { - if( not stream.is_open() ) { - SIO_THROW( sio::error_code::not_open, "ofstream is not open!" ) ; - } - if( not stream.good() ) { - SIO_THROW( sio::error_code::bad_state, "ofstream is in a bad state!" ) ; - } - if( not hdr_span.valid() ) { - SIO_THROW( sio::error_code::invalid_argument, "The record header buffer is not valid" ) ; - } - if( not data_span.valid() ) { - SIO_THROW( sio::error_code::invalid_argument, "The record data buffer is not valid" ) ; - } - rec_info._file_start = stream.tellp() ; - // write record header - if( not stream.write( hdr_span.data(), hdr_span.size() ).good() ) { - SIO_THROW( sio::error_code::io_failure, "Couldn't write record header buffer to output stream" ) ; - } - // write record data - if( not stream.write( data_span.data(), data_span.size() ).good() ) { - SIO_THROW( sio::error_code::io_failure, "Couldn't write record data buffer to output stream" ) ; - } - // always add some padding bytes at the end - auto padlen = (4 - (data_span.size() & sio::bit_align)) & sio::bit_align; - if( padlen > 0 ) { - SIO_DEBUG( "Writing " << padlen << " bytes for padding ..." ) ; - if( not stream.write( sio::padding_bytes, padlen ).good() ) { - SIO_THROW( sio::error_code::io_failure, "Couldn't write record buffer padding to output stream" ) ; - } - } - // flush the stream - if( not stream.flush().good() ) { - SIO_THROW( sio::error_code::io_failure, "Couldn't flush output stream" ) ; - } - rec_info._file_end = stream.tellp() ; - SIO_DEBUG( "Written record with info :\n" << rec_info ) ; - } - - //-------------------------------------------------------------------------- - - bool api::is_compressed( options_type opts ) { - return static_cast( opts & sio::compression_bit ) ; - } - - //-------------------------------------------------------------------------- - - bool api::set_compression( options_type &opts, bool value ) { - bool out = sio::api::is_compressed( opts ) ; - opts &= ~sio::compression_bit ; - if( value ) { - opts |= sio::compression_bit ; - } - return out ; - } - -} diff --git a/sio/src/block.cc b/sio/src/block.cc deleted file mode 100644 index b213e9ecd..000000000 --- a/sio/src/block.cc +++ /dev/null @@ -1,27 +0,0 @@ -// -- sio headers -#include -#include - -namespace sio { - - block::block( const std::string &nam, sio::version_type vers ) : - _version(vers), - _name(nam) { - if( not sio::validate( _name ) ) { - SIO_THROW( sio::error_code::invalid_argument, "Block name '" + _name + "' is invalid!" ) ; - } - } - - //-------------------------------------------------------------------------- - - const std::string &block::name() const noexcept { - return _name ; - } - - //-------------------------------------------------------------------------- - - sio::version_type block::version() const noexcept { - return _version ; - } - -} \ No newline at end of file diff --git a/sio/src/buffer.cc b/sio/src/buffer.cc deleted file mode 100644 index a20fd7aae..000000000 --- a/sio/src/buffer.cc +++ /dev/null @@ -1,399 +0,0 @@ -// -- sio headers -#include -#include - -// -- std headers -#include -#include - -namespace sio { - - buffer_span::buffer_span() : - _isnull(true) { - /* nop */ - } - - //-------------------------------------------------------------------------- - - buffer_span::buffer_span( const container &bytes ) : - _first( bytes.begin() ), - _last( bytes.end() ) { - /* nop */ - } - - //-------------------------------------------------------------------------- - - buffer_span::buffer_span( const_iterator first, const_iterator last ) : - _first(first), - _last(last) { - /* nop */ - } - - //-------------------------------------------------------------------------- - - buffer_span::buffer_span( const_iterator first, std::size_t count ) : - _first(first), - _last(std::next(first, count)) { - /* nop */ - } - - //-------------------------------------------------------------------------- - - buffer_span::const_iterator buffer_span::begin() const { - return _first ; - } - - //-------------------------------------------------------------------------- - - buffer_span::const_iterator buffer_span::end() const { - return _last ; - } - - //-------------------------------------------------------------------------- - - const buffer_span::element_type *buffer_span::data() const { - return _isnull ? nullptr : &(*_first) ; - } - - //-------------------------------------------------------------------------- - - buffer_span::const_reference buffer_span::front() const { - return (*_first) ; - } - - //-------------------------------------------------------------------------- - - buffer_span::const_reference buffer_span::back() const { - return *(_last-1) ; - } - - //-------------------------------------------------------------------------- - - buffer_span::const_reference buffer_span::operator[]( index_type index ) const { - return data() [ index ] ; - } - - //-------------------------------------------------------------------------- - - buffer_span::const_reference buffer_span::at( index_type index ) const { - if( index >= size() ) { - std::stringstream ss ; - ss << "index: " << index << ", size: " << size() ; - SIO_THROW( error_code::out_of_range, ss.str() ) ; - } - return data() [ index ] ; - } - - //-------------------------------------------------------------------------- - - buffer_span::const_pointer buffer_span::ptr( index_type index ) const { - return data() + index ; - } - - //-------------------------------------------------------------------------- - - std::size_t buffer_span::size() const { - return _isnull ? 0 : std::distance( _first, _last ) ; - } - - //-------------------------------------------------------------------------- - - bool buffer_span::empty() const { - return (size() == 0) ; - } - - //-------------------------------------------------------------------------- - - bool buffer_span::valid() const { - return (not _isnull) ; - } - - //-------------------------------------------------------------------------- - - buffer_span::operator bool() const noexcept { - return valid() ; - } - - //-------------------------------------------------------------------------- - - buffer_span buffer_span::subspan( index_type start ) const { - if( start > size() ) { - std::stringstream ss ; - ss << "start: " << start << ", size: " << size() ; - SIO_THROW( error_code::out_of_range, ss.str() ) ; - } - return buffer_span( std::next(_first, start) , _last ) ; - } - - //-------------------------------------------------------------------------- - - buffer_span buffer_span::subspan( index_type start, std::size_t count ) const { - if( start+count > size() ) { - std::stringstream ss ; - ss << "start: " << start << ", count: " << count << ", size: " << size() ; - SIO_THROW( error_code::out_of_range, ss.str() ) ; - } - return buffer_span( std::next(_first, start) , std::next(_first, start+count) ) ; - } - - //-------------------------------------------------------------------------- - - void buffer_span::dump( int base, unsigned int line_split, size_type max_bytes ) { - std::ios_base::fmtflags f( std::cout.flags() ); - for( size_type i=0 ; i max_bytes ) { - break ; - } - } - std::cout << std::endl ; - std::cout.flags( f ); - } - - //-------------------------------------------------------------------------- - //-------------------------------------------------------------------------- - - buffer::buffer( size_type len ) : - _bytes( len, sio::null_byte ) { - if( 0 == len ) { - SIO_THROW( sio::error_code::invalid_argument, "Can't construct a buffer with length of 0!" ) ; - } - } - - //-------------------------------------------------------------------------- - - buffer::buffer( container &&bytes ) : - _bytes( std::move( bytes ) ) { - /* nop */ - } - - //-------------------------------------------------------------------------- - - buffer::buffer( buffer&& rhs ) { - _bytes = std::move( rhs._bytes ) ; - _valid = rhs._valid ; - rhs._valid = false ; - } - - //-------------------------------------------------------------------------- - - buffer& buffer::operator=( buffer&& rhs ) { - _bytes = std::move( rhs._bytes ) ; - _valid = rhs._valid ; - rhs._valid = false ; - return *this ; - } - - //-------------------------------------------------------------------------- - - buffer::const_iterator buffer::begin() const { - return _bytes.begin() ; - } - - //-------------------------------------------------------------------------- - - buffer::const_iterator buffer::end() const { - return _bytes.end() ; - } - - //-------------------------------------------------------------------------- - - buffer::iterator buffer::begin() { - return _bytes.begin() ; - } - - //-------------------------------------------------------------------------- - - buffer::iterator buffer::end() { - return _bytes.end() ; - } - - //-------------------------------------------------------------------------- - - buffer::const_reverse_iterator buffer::rbegin() const { - return _bytes.rbegin() ; - } - - //-------------------------------------------------------------------------- - - buffer::const_reverse_iterator buffer::rend() const { - return _bytes.rend() ; - } - - //-------------------------------------------------------------------------- - - buffer::reverse_iterator buffer::rbegin() { - return _bytes.rbegin() ; - } - - //-------------------------------------------------------------------------- - - buffer::reverse_iterator buffer::rend() { - return _bytes.rend() ; - } - - //-------------------------------------------------------------------------- - - buffer::const_reference buffer::operator[]( index_type index ) const { - return _bytes [ index ] ; - } - - //-------------------------------------------------------------------------- - - buffer::reference buffer::operator[]( index_type index ) { - return _bytes [ index ] ; - } - - //-------------------------------------------------------------------------- - - buffer::const_reference buffer::at( index_type index ) const { - return _bytes.at( index ) ; - } - - //-------------------------------------------------------------------------- - - buffer::reference buffer::at( index_type index ) { - return _bytes.at( index ) ; - } - - //-------------------------------------------------------------------------- - - buffer::const_reference buffer::front() const { - return _bytes.front() ; - } - - //-------------------------------------------------------------------------- - - buffer::reference buffer::front() { - return _bytes.front() ; - } - - //-------------------------------------------------------------------------- - - buffer::const_reference buffer::back() const { - return _bytes.back() ; - } - - //-------------------------------------------------------------------------- - - buffer::reference buffer::back() { - return _bytes.back() ; - } - - //-------------------------------------------------------------------------- - - buffer::const_pointer buffer::data() const { - return _bytes.data() ; - } - - //-------------------------------------------------------------------------- - - buffer::pointer buffer::data() { - return _bytes.data() ; - } - - //-------------------------------------------------------------------------- - - buffer::const_pointer buffer::ptr( index_type index ) const { - return &(_bytes[ index ]) ; - } - - //-------------------------------------------------------------------------- - - buffer::pointer buffer::ptr( index_type index ) { - return &(_bytes[ index ]) ; - } - - //-------------------------------------------------------------------------- - - buffer::size_type buffer::size() const { - return _bytes.size() ; - } - - //-------------------------------------------------------------------------- - - bool buffer::empty() const { - return _bytes.empty() ; - } - - //-------------------------------------------------------------------------- - - buffer::size_type buffer::capacity() const { - return _bytes.capacity() ; - } - - //-------------------------------------------------------------------------- - - void buffer::resize( size_type newsize ) { - _bytes.resize( newsize ) ; - } - - //-------------------------------------------------------------------------- - - buffer::size_type buffer::expand( std::size_t nbytes ) { - auto len = size() ; - resize( len + nbytes ) ; - return len ; - } - - //-------------------------------------------------------------------------- - - void buffer::shrink() { - _bytes.shrink_to_fit() ; - } - - //-------------------------------------------------------------------------- - - void buffer::clear( bool shrink ) { - _bytes.clear() ; - if( shrink ) { - _bytes.shrink_to_fit() ; - } - } - - //-------------------------------------------------------------------------- - - buffer buffer::reuse() { - buffer new_buffer( std::move( _bytes ) ) ; - _valid = false ; - return new_buffer ; - } - - //-------------------------------------------------------------------------- - - bool buffer::valid() const { - return _valid ; - } - - //-------------------------------------------------------------------------- - - buffer_span buffer::span() const { - return buffer_span( begin() , end() ) ; - } - - //-------------------------------------------------------------------------- - - buffer_span buffer::span( index_type start ) const { - if( start > size() ) { - std::stringstream ss ; - ss << "start: " << start << ", size: " << size() ; - SIO_THROW( error_code::out_of_range, ss.str() ) ; - } - return buffer_span( std::next(begin(), start) , end() ) ; - } - - //-------------------------------------------------------------------------- - - buffer_span buffer::span( index_type start, size_type count ) const { - if( start+count > size() ) { - std::stringstream ss ; - ss << "start: " << start << ", count: " << count << ", size: " << size() ; - SIO_THROW( error_code::out_of_range, ss.str() ) ; - } - return buffer_span( std::next(begin(), start) , std::next(begin(), start+count) ) ; - } - -} diff --git a/sio/src/compression/zlib.cc b/sio/src/compression/zlib.cc deleted file mode 100644 index 56f828e88..000000000 --- a/sio/src/compression/zlib.cc +++ /dev/null @@ -1,73 +0,0 @@ -#include - -// -- sio headers -#include -#include - -// -- zlib headers -#include - -// -- std headers -#include - -namespace sio { - - void zlib_compression::set_level( int level ) { - if(level < 0) { - _level = Z_DEFAULT_COMPRESSION; - } - else if(level > 9) { - _level = 9; - } - else { - _level = level; - } - } - - //-------------------------------------------------------------------------- - - int zlib_compression::level() const { - return _level ; - } - - //-------------------------------------------------------------------------- - - void zlib_compression::uncompress( const buffer_span &inbuf, buffer &outbuf ) { - if( not inbuf.valid() ) { - SIO_THROW( sio::error_code::invalid_argument, "Buffer is not valid" ) ; - } - // zlib uncompress requires to pass an address of uLongf type ... - uLongf outsize = outbuf.size() ; - auto zstat = ::uncompress( (Bytef*)outbuf.data(), &outsize, (const Bytef*)inbuf.data(), inbuf.size() ) ; - if( Z_OK != zstat ) { - std::stringstream ss ; - ss << "Zlib uncompression failed with status " << zstat ; - SIO_THROW( sio::error_code::compress_error, ss.str() ) ; - } - SIO_DEBUG( "ZLIB uncompress OK!" ) ; - } - - //-------------------------------------------------------------------------- - - void zlib_compression::compress( const buffer_span &inbuf, buffer &outbuf ) { - if( not inbuf.valid() ) { - SIO_THROW( sio::error_code::invalid_argument, "Buffer is not valid" ) ; - } - // comp_bound is a first estimate of the compressed size. - // After compression, the real output size is returned, - // this is why the buffer is resized after calling compress2(). - auto comp_bound = ::compressBound( inbuf.size() ) ; - if( outbuf.size() < comp_bound ) { - outbuf.resize( comp_bound ) ; - } - auto zstat = ::compress2( reinterpret_cast(outbuf.data()), &comp_bound, reinterpret_cast(inbuf.data()), inbuf.size(), _level ) ; - if( Z_OK != zstat ) { - std::stringstream ss ; - ss << "Zlib compression failed with status " << zstat ; - SIO_THROW( sio::error_code::compress_error, ss.str() ) ; - } - outbuf.resize( comp_bound ) ; - SIO_DEBUG( "ZLIB compress OK!" ) ; - } - -} diff --git a/sio/src/exception.cc b/sio/src/exception.cc deleted file mode 100644 index a82cb3e87..000000000 --- a/sio/src/exception.cc +++ /dev/null @@ -1,81 +0,0 @@ -// -- std headers -#include - -namespace sio { - - inline std::string error_code_helper::to_string( error_code code ) noexcept { - switch( code ) { - case error_code::invalid_argument: return "invalid_argument" ; - case error_code::not_found: return "not_found" ; - case error_code::already_open: return "already_open" ; - case error_code::open_fail: return "open_fail" ; - case error_code::not_open: return "not_open" ; - case error_code::eof: return "eof" ; - case error_code::io_failure: return "io_failure" ; - case error_code::no_marker: return "no_marker" ; - case error_code::compress_error: return "compress_error" ; - case error_code::bad_state: return "bad_state" ; - case error_code::bad_alloc: return "bad_alloc" ; - case error_code::out_of_range: return "out_of_range" ; - default: return "unknown" ; - } - } - - //-------------------------------------------------------------------------- - //-------------------------------------------------------------------------- - - exception::exception( - error_code code, - unsigned int line, - const std::string &func, - const std::string &fname, - const std::string &msg ) : - _code( code ), - _message( message(code, line, func, fname, msg) ) { - /* nop */ - } - - //-------------------------------------------------------------------------- - - const char* exception::what() const noexcept { - return _message.c_str() ; - } - - //-------------------------------------------------------------------------- - - sio::error_code exception::code() const { - return _code ; - } - - //-------------------------------------------------------------------------- - - std::string exception::message( - error_code code, - unsigned int line, - const std::string &func, - const std::string &fname, - const std::string &msg ) const { - return fname + - " (l." + std::to_string(line) + ") in " + - func + ": " + msg + - " [" + error_code_helper::to_string( code ) + "]" ; - } - - //-------------------------------------------------------------------------- - - std::string exception::message( - const std::string &previous, - error_code code, - unsigned int line, - const std::string &func, - const std::string &fname, - const std::string &msg ) const { - if( previous.empty() ) { - return message(code, line, func, fname, msg) ; - } - else { - return previous + "\n" + message(code, line, func, fname, msg) ; - } - } - -} diff --git a/sio/src/io_device.cc b/sio/src/io_device.cc deleted file mode 100644 index 420e63653..000000000 --- a/sio/src/io_device.cc +++ /dev/null @@ -1,164 +0,0 @@ -// -- sio headers -#include -#include - -namespace sio { - - read_device::read_device( buffer_span buf ) : - _buffer(std::move(buf)) { - /* nop */ - } - - //-------------------------------------------------------------------------- - - void read_device::set_buffer( const buffer_span &buf ) { - _buffer = buf ; - } - - //-------------------------------------------------------------------------- - - void read_device::set_buffer( buffer_span &&buf ) { - _buffer = buf ; - } - - //-------------------------------------------------------------------------- - - read_device::cursor_type read_device::position() const { - return _cursor ; - } - - //-------------------------------------------------------------------------- - - void read_device::seek( cursor_type pos ) { - if( pos > _buffer.size() ) { - SIO_THROW( sio::error_code::out_of_range, "Can't seek device cursor: out of range!" ) ; - } - _cursor = pos ; - } - - //-------------------------------------------------------------------------- - - void read_device::pointer_to( ptr_type *ptr ) { - // Read. Keep a record of the "match" quantity read from the buffer and - // the location in memory which will need relocating. - // Placeholder value for 'pointer to' - unsigned int match = 0 ; - data( match ) ; - // Ignore match = 0x00000000. This is basically a null pointer which can - // never be relocated, so don't fill the multimap with a lot of useless - // information. - if( match != 0x00000000 ) { - sio::pointer_to_map::value_type entry = { reinterpret_cast(match), ptr } ; - _pointer_to.insert( entry ) ; - } - *ptr = static_cast( match ) ; - } - - //-------------------------------------------------------------------------- - - void read_device::pointed_at( ptr_type *ptr ) { - // Read. Keep a record of the "match" quantity read from the buffer and - // the location in memory which will need relocating. - unsigned int match = 0 ; - data( match ) ; - // Ignore match = SIO_ptag. This is basically a pointer target which was - // never relocated when the record was written. i.e. nothing points to it! - // Don't clutter the maps with information that can never be used. - if( match != 0xffffffff ) { - pointed_at_map::value_type entry = { reinterpret_cast( match ), ptr } ; - _pointed_at.insert( entry ) ; - } - } - - //-------------------------------------------------------------------------- - - void read_device::pointer_relocation() { - sio::api::read_relocation( _pointed_at, _pointer_to ) ; - _pointer_to.clear() ; - _pointed_at.clear() ; - } - - //-------------------------------------------------------------------------- - //-------------------------------------------------------------------------- - - write_device::write_device( buffer&& buf ) : - _buffer( std::move( buf ) ) { - /* nop */ - } - - //-------------------------------------------------------------------------- - - void write_device::set_buffer( buffer&& buf ) { - _buffer = std::move( buf ) ; - } - - //-------------------------------------------------------------------------- - - buffer write_device::take_buffer() { - return std::move( _buffer ) ; - } - - //-------------------------------------------------------------------------- - - write_device::cursor_type write_device::position() const { - return _cursor ; - } - - //-------------------------------------------------------------------------- - - void write_device::seek( cursor_type pos ) { - if( pos > _buffer.size() ) { - SIO_THROW( sio::error_code::out_of_range, "Can't seek device cursor: out of range!" ) ; - } - _cursor = pos ; - } - - //-------------------------------------------------------------------------- - - void write_device::pointer_to( ptr_type *ptr ) { - // Write. Keep a record of the "match" quantity (i.e. the value of the - // pointer (which may be different lengths on different machines!)) and - // the current offset in the output buffer. Put a placeholder in the - // output buffer (it will be overwritten at the "output relocation" stage). - // - // Placeholder value for 'pointer to' - unsigned int SIO_pntr = 0x00000000 ; - // ptr is really a pointer-to-a-pointer. This routine is most interested - // in the value of *xfer when treated as a pointer. C++ tends to object - // to this as being 'not type safe'. To keep the compiler happy (and purists - // miserable), do one 'reinterpret_cast' immediately to make later code - // easier to read. - // Indirect ptr (actually **ptr) - void *ifer = reinterpret_cast(*ptr) ; - // Ignore NULL pointers. These are always recorded in the buffer with a - // zero match word (and are treated specially when read back). There's no - // point in putting useless information in the maps. - if( nullptr != ifer ) { - sio::pointer_to_map::value_type entry = { ifer, reinterpret_cast( _buffer.ptr(_cursor) - _buffer.data() ) } ; - _pointer_to.insert( entry ) ; - } - data( SIO_pntr ) ; - } - - //-------------------------------------------------------------------------- - - void write_device::pointed_at( ptr_type *ptr ) { - // Write. Save the memory location of this object along with the offset - // in the output buffer where the generated match quantity must go. Put - // a placeholder in the output buffer (it will be overwritten at the "output - // relocation" stage). - unsigned int SIO_ptag = 0xffffffff ; - sio::pointed_at_map::value_type entry = { ptr, reinterpret_cast( _buffer.ptr(_cursor) - _buffer.data() ) } ; - _pointed_at.insert( entry ) ; - data( SIO_ptag ) ; - } - - //-------------------------------------------------------------------------- - - void write_device::pointer_relocation() { - sio::api::write_relocation( _buffer.data(), _pointed_at, _pointer_to ) ; - _pointer_to.clear() ; - _pointed_at.clear() ; - } - -} diff --git a/sio/src/memcpy.cc b/sio/src/memcpy.cc deleted file mode 100644 index 60f6a4f9f..000000000 --- a/sio/src/memcpy.cc +++ /dev/null @@ -1,24 +0,0 @@ -// -- sio headers -#include - -namespace sio { - - void memcpy::reverse_copy( const sio::byte *const from, sio::byte * dest, std::size_t size, std::size_t count ) { - for( std::size_t s=0 ; s - -namespace sio { - - version::version_type version::encode_version( major_type major, minor_type minor ) noexcept { - return (((major) << 16) + (minor)) ; - } - - //-------------------------------------------------------------------------- - - version::minor_type version::minor_version( version_type version ) noexcept { - return ((version) & 0x0000ffff) ; - } - - //-------------------------------------------------------------------------- - - version::major_type version::major_version( version_type version ) noexcept { - return (((version) & 0xffff0000) >> 16) ; - } - -} \ No newline at end of file diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt index c2389a0a0..f6092a99a 100644 --- a/src/cpp/CMakeLists.txt +++ b/src/cpp/CMakeLists.txt @@ -4,33 +4,6 @@ # @author Jan Engels, DESY ################################# -SET( LCIO_CPPFORT_SRCS - ./src/CPPFORT/HEPEVT.cc - ./src/CPPFORT/lccah.cc - ./src/CPPFORT/lcclu.cc - ./src/CPPFORT/lccol.cc - ./src/CPPFORT/lcevt.cc - ./src/CPPFORT/lcgob.cc - ./src/CPPFORT/lciof77apiext.cc - ./src/CPPFORT/lcmcp.cc - ./src/CPPFORT/lcobv.cc - ./src/CPPFORT/lcpid.cc - ./src/CPPFORT/lcrcp.cc - ./src/CPPFORT/lcrdr.cc - ./src/CPPFORT/lcrdrrep.cc - ./src/CPPFORT/lcrel.cc - ./src/CPPFORT/lcrhd.cc - ./src/CPPFORT/lcrnv.cc - ./src/CPPFORT/lcsch.cc - ./src/CPPFORT/lcsth.cc - ./src/CPPFORT/lctph.cc - ./src/CPPFORT/lctrh.cc - ./src/CPPFORT/lctrk.cc - ./src/CPPFORT/lcvec.cc - ./src/CPPFORT/lcvtx.cc - ./src/CPPFORT/lcwrt.cc -) - SET( LCIO_IMPL_SRCS ./src/IMPL/AccessChecked.cc ./src/IMPL/CalorimeterHitImpl.cc @@ -230,7 +203,6 @@ if( LCIO_GENERATE_HEADERS ) SET( IO_AID_HEADERS_DEP_LIST ${AID_HEADERS_LIST};${CXX_HEADERS_LIST} ) # make source files depend on generated header files + aid files - SET_SOURCE_FILES_PROPERTIES( ${LCIO_CPPFORT_SRCS} PROPERTIES OBJECT_DEPENDS "${EVENT_AID_HEADERS_DEP_LIST};${IO_AID_HEADERS_DEP_LIST}" ) SET_SOURCE_FILES_PROPERTIES( ${LCIO_IMPL_SRCS} PROPERTIES OBJECT_DEPENDS "${EVENT_AID_HEADERS_DEP_LIST}" ) SET_SOURCE_FILES_PROPERTIES( ${LCIO_IOIMPL_SRCS} PROPERTIES OBJECT_DEPENDS "${IO_AID_HEADERS_DEP_LIST}" ) # ---------------------------------------------------------------------------- @@ -253,22 +225,13 @@ endif() #ADD_DEFINITIONS( "-Wall -ansi -pedantic" ) #ADD_DEFINITIONS( "-Wno-long-long -fno-strict-aliasing" ) -#---- special flags for cfortran code : -------- -SET_SOURCE_FILES_PROPERTIES( - ${LCIO_CPPFORT_SRCS} PROPERTIES - COMPILE_FLAGS "-Df2cFortran -Wno-unused" -) -# ---------------------------------------------------------------------------- - - - # -------- include directories ----------------------------------------------- INCLUDE_DIRECTORIES( BEFORE "${LCIO_AID_HEADERS_OUTPUT_DIR}" ) INCLUDE_DIRECTORIES( BEFORE "${LCIO_CXX_HEADERS_DIR}" ) # install public headers -INSTALL_DIRECTORY( ${LCIO_CXX_HEADERS_DIR}/ DESTINATION include +INSTALL_DIRECTORY( ${LCIO_CXX_HEADERS_DIR}/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" PATTERN "*.txt" EXCLUDE #PATTERN "*empty_ignore.h" EXCLUDE PATTERN "*/SIO/*" EXCLUDE @@ -280,14 +243,12 @@ INSTALL_DIRECTORY( ${LCIO_CXX_HEADERS_DIR}/ DESTINATION include ) # install aid generated c++ headers -INSTALL_DIRECTORY( ${LCIO_AID_HEADERS_OUTPUT_DIR}/ DESTINATION include ) +INSTALL_DIRECTORY( ${LCIO_AID_HEADERS_OUTPUT_DIR}/ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ) # ---------------------------------------------------------------------------- -# ------- libraries lcio + lcioF77 ------------------------------------------- -ADD_LIBRARY( lcioF77 STATIC ${LCIO_CPPFORT_SRCS} ) -INSTALL( TARGETS lcioF77 DESTINATION ${CMAKE_INSTALL_LIBDIR} ) +# ------- libraries lcio ------------------------------------------- ADD_SHARED_LIBRARY( lcio ${LCIO_IMPL_SRCS} @@ -296,13 +257,18 @@ ADD_SHARED_LIBRARY( lcio ${LCIO_SIO_SRCS} ${LCIO_MT_SRCS} ) -INSTALL_SHARED_LIBRARY( lcio DESTINATION ${CMAKE_INSTALL_LIBDIR} ) +INSTALL_SHARED_LIBRARY( lcio DESTINATION ${CMAKE_INSTALL_LIBDIR} EXPORT LCIOTargets ) +target_include_directories(lcio PUBLIC + $ + $ + $ +) -TARGET_LINK_LIBRARIES( lcio ${CMAKE_THREAD_LIBS_INIT} ) -TARGET_LINK_LIBRARIES( lcio ${SIO_LIBRARIES} ) -TARGET_LINK_LIBRARIES( lcioF77 lcio ) +TARGET_LINK_LIBRARIES( lcio PUBLIC ${CMAKE_THREAD_LIBS_INIT} ) +TARGET_LINK_LIBRARIES( lcio PRIVATE SIO::sio ) -ADD_CUSTOM_TARGET( lib DEPENDS lcio lcioF77 ) +ADD_CUSTOM_TARGET( lib DEPENDS lcio ) +ADD_LIBRARY( LCIO::lcio ALIAS lcio ) # ---------------------------------------------------------------------------- @@ -409,7 +375,7 @@ IF( BUILD_ROOTDICT ) INCLUDE_DIRECTORIES( SYSTEM "${ROOT_INCLUDE_DIRS}" ) ADD_SHARED_LIBRARY( lcioDict ${lcio_rootdict_sources} ) - TARGET_LINK_LIBRARIES( lcioDict ${ROOT_LIBRARIES} lcio ) + TARGET_LINK_LIBRARIES( lcioDict ${ROOT_LIBRARIES} LCIO::lcio SIO::sio) IF( APPLE ) @@ -477,8 +443,8 @@ MACRO( ADD_LCIO_EXAMPLE file ) ADD_DEPENDENCIES( examples bin_${file} ) #MESSAGE( STATUS "ADD_LCIO_EXAMPLE: ${file} ./src/EXAMPLE/${file}.cc" ) SET_TARGET_PROPERTIES( bin_${file} PROPERTIES OUTPUT_NAME ${file} ) - TARGET_LINK_LIBRARIES( bin_${file} lcio ) - INSTALL( TARGETS bin_${file} DESTINATION bin ) + TARGET_LINK_LIBRARIES( bin_${file} PRIVATE lcio ) + INSTALL( TARGETS bin_${file} DESTINATION "${CMAKE_INSTALL_BINDIR}" ) ENDMACRO() ADD_LCIO_EXAMPLE( simjob ) @@ -487,6 +453,7 @@ IF( NOT BUILD_ROOTDICT ) ENDIF() ADD_LCIO_EXAMPLE( recjob ) ADD_LCIO_EXAMPLE( dumpevent ) +ADD_LCIO_EXAMPLE( dumpmctree-dot ) ADD_LCIO_EXAMPLE( copyfix ) ADD_LCIO_EXAMPLE( stdhepjob ) ADD_LCIO_EXAMPLE( stdhepjob_new ) @@ -502,9 +469,11 @@ ADD_LCIO_EXAMPLE( lcio_performance ) ADD_LCIO_EXAMPLE( lcio_parallel_read ) ADD_LCIO_EXAMPLE( lcio_parallel_processing ) +INSTALL(PROGRAMS ${CMAKE_CURRENT_LIST_DIR}/src/EXAMPLE/dumpmctree DESTINATION ${CMAKE_INSTALL_BINDIR}) + IF( BUILD_ROOTDICT ) ADD_LCIO_EXAMPLE( lcio_io_benchmark ) - TARGET_LINK_LIBRARIES( bin_lcio_io_benchmark ${ROOT_LIBRARIES} ) + TARGET_LINK_LIBRARIES( bin_lcio_io_benchmark PRIVATE ${ROOT_LIBRARIES} ) ENDIF() IF( BUILD_LCIO_EXAMPLES ) diff --git a/src/cpp/include/CPPFORT/HEPEVT.h b/src/cpp/include/CPPFORT/HEPEVT.h deleted file mode 100644 index d654ca0a2..000000000 --- a/src/cpp/include/CPPFORT/HEPEVT.h +++ /dev/null @@ -1,42 +0,0 @@ -// -*- C++ -*- -/**Interface to StdHep fortran COMMON /HEPEVT/ - * - * @author H. Vogt - * @version Sep 30, 2003 - */ - - -#ifndef HEPEVT_H -#define HEPEVT_H 1 - -#include "EVENT/LCIO.h" -#include "EVENT/LCEvent.h" -#include "EVENT/MCParticle.h" -#include "IMPL/LCEventImpl.h" -#include "IMPL/LCCollectionVec.h" -#include "IMPL/MCParticleImpl.h" - -#include "lcio.h" -#include "Exceptions.h" -#include "hepevt0.h" -#include "hepevt1.h" - -namespace HEPEVTIMPL{ - - class HEPEVT{ - - public: - - /** StdHep fortran interface to read from or write to the COMMON /HEPEVT/. - * fromHepEvt reads from COMMON /HEPEVT/. - * toHepEvt fills COMMON /HEPEVT/. - */ - static void fromHepEvt(EVENT::LCEvent* evt, const char* mcColName=0) ; - static void toHepEvt(const EVENT::LCEvent* evt, const char* mcColName=0) ; - - }; // class - -} // namespace HEPEVTIMPL - -#endif /* ifndef HEPEVT_H */ - diff --git a/src/cpp/include/CPPFORT/cfortran.h b/src/cpp/include/CPPFORT/cfortran.h deleted file mode 100644 index ed23011d8..000000000 --- a/src/cpp/include/CPPFORT/cfortran.h +++ /dev/null @@ -1,2363 +0,0 @@ -/* cfortran.h 4.3 */ -/* http://www-zeus.desy.de/~burow/cfortran/ */ -/* Burkhard Burow burow@desy.de 1990 - 2001. */ - -#ifndef __CFORTRAN_LOADED -#define __CFORTRAN_LOADED - -/* - THIS FILE IS PROPERTY OF BURKHARD BUROW. IF YOU ARE USING THIS FILE YOU - SHOULD ALSO HAVE ACCESS TO CFORTRAN.DOC WHICH PROVIDES TERMS FOR USING, - MODIFYING, COPYING AND DISTRIBUTING THE CFORTRAN.H PACKAGE. -*/ - -/* - Avoid symbols already used by compilers and system *.h: - __ - OSF1 zukal06 V3.0 347 alpha, cc -c -std1 cfortest.c - - */ - - -/* First prepare for the C compiler. */ - -#ifndef ANSI_C_preprocessor /* i.e. user can override. */ -#ifdef __CF__KnR -#define ANSI_C_preprocessor 0 -#else -#ifdef __STDC__ -#define ANSI_C_preprocessor 1 -#else -#define _cfleft 1 -#define _cfright -#define _cfleft_cfright 0 -#define ANSI_C_preprocessor _cfleft/**/_cfright -#endif -#endif -#endif - -#if ANSI_C_preprocessor -#define _0(A,B) A##B -#define _(A,B) _0(A,B) /* see cat,xcat of K&R ANSI C p. 231 */ -#define _2(A,B) A##B /* K&R ANSI C p.230: .. identifier is not replaced */ -#define _3(A,B,C) _(A,_(B,C)) -#else /* if it turns up again during rescanning. */ -#define _(A,B) A/**/B -#define _2(A,B) A/**/B -#define _3(A,B,C) A/**/B/**/C -#endif - -#if (defined(vax)&&defined(unix)) || (defined(__vax__)&&defined(__unix__)) -#define VAXUltrix -#endif - -#include /* NULL [in all machines stdio.h] */ -#include /* strlen, memset, memcpy, memchr. */ -#if !( defined(VAXUltrix) || defined(sun) || (defined(apollo)&&!defined(__STDCPP__)) ) -#include /* malloc,free */ -#else -#include /* Had to be removed for DomainOS h105 10.4 sys5.3 425t*/ -#ifdef apollo -#define __CF__APOLLO67 /* __STDCPP__ is in Apollo 6.8 (i.e. ANSI) and onwards */ -#endif -#endif - -#if !defined(__GNUC__) && !defined(__sun) && (defined(sun)||defined(VAXUltrix)||defined(lynx)) -#define __CF__KnR /* Sun, LynxOS and VAX Ultrix cc only supports K&R. */ - /* Manually define __CF__KnR for HP if desired/required.*/ -#endif /* i.e. We will generate Kernighan and Ritchie C. */ -/* Note that you may define __CF__KnR before #include cfortran.h, in order to -generate K&R C instead of the default ANSI C. The differences are mainly in the -function prototypes and declarations. All machines, except the Apollo, work -with either style. The Apollo's argument promotion rules require ANSI or use of -the obsolete std_$call which we have not implemented here. Hence on the Apollo, -only C calling FORTRAN subroutines will work using K&R style.*/ - - -/* Remainder of cfortran.h depends on the Fortran compiler. */ - -#if defined(CLIPPERFortran) || defined(pgiFortran) -#define f2cFortran -#endif - -/* VAX/VMS does not let us \-split long #if lines. */ -/* Split #if into 2 because some HP-UX can't handle long #if */ -#if !(defined(NAGf90Fortran)||defined(f2cFortran)||defined(hpuxFortran)||defined(apolloFortran)||defined(sunFortran)||defined(IBMR2Fortran)||defined(CRAYFortran)) -#if !(defined(mipsFortran)||defined(DECFortran)||defined(vmsFortran)||defined(CONVEXFortran)||defined(PowerStationFortran)||defined(AbsoftUNIXFortran)||defined(AbsoftProFortran)||defined(SXFortran)) -/* If no Fortran compiler is given, we choose one for the machines we know. */ -#if defined(lynx) || defined(VAXUltrix) -#define f2cFortran /* Lynx: Only support f2c at the moment. - VAXUltrix: f77 behaves like f2c. - Support f2c or f77 with gcc, vcc with f2c. - f77 with vcc works, missing link magic for f77 I/O.*/ -#endif -#if defined(__hpux) /* 921107: Use __hpux instead of __hp9000s300 */ -#define hpuxFortran /* Should also allow hp9000s7/800 use.*/ -#endif -#if defined(apollo) -#define apolloFortran /* __CF__APOLLO67 also defines some behavior. */ -#endif -#if defined(sun) || defined(__sun) -#define sunFortran -#endif -#if defined(_IBMR2) -#define IBMR2Fortran -#endif -#if defined(_CRAY) -#define CRAYFortran /* _CRAYT3E also defines some behavior. */ -#endif -#if defined(_SX) -#define SXFortran -#endif -#if defined(mips) || defined(__mips) -#define mipsFortran -#endif -#if defined(vms) || defined(__vms) -#define vmsFortran -#endif -#if defined(__alpha) && defined(__unix__) -#define DECFortran -#endif -#if defined(__convex__) -#define CONVEXFortran -#endif -#if defined(VISUAL_CPLUSPLUS) -#define PowerStationFortran -#endif -#endif /* ...Fortran */ -#endif /* ...Fortran */ - -/* Split #if into 2 because some HP-UX can't handle long #if */ -#if !(defined(NAGf90Fortran)||defined(f2cFortran)||defined(hpuxFortran)||defined(apolloFortran)||defined(sunFortran)||defined(IBMR2Fortran)||defined(CRAYFortran)) -#if !(defined(mipsFortran)||defined(DECFortran)||defined(vmsFortran)||defined(CONVEXFortran)||defined(PowerStationFortran)||defined(AbsoftUNIXFortran)||defined(AbsoftProFortran)||defined(SXFortran)) -/* If your compiler barfs on ' #error', replace # with the trigraph for # */ - #error "cfortran.h: Can't find your environment among:\ - - MIPS cc and f77 2.0. (e.g. Silicon Graphics, DECstations, ...) \ - - IBM AIX XL C and FORTRAN Compiler/6000 Version 01.01.0000.0000 \ - - VAX VMS CC 3.1 and FORTRAN 5.4. \ - - Alpha VMS DEC C 1.3 and DEC FORTRAN 6.0. \ - - Alpha OSF DEC C and DEC Fortran for OSF/1 AXP Version 1.2 \ - - Apollo DomainOS 10.2 (sys5.3) with f77 10.7 and cc 6.7. \ - - CRAY \ - - NEC SX-4 SUPER-UX \ - - CONVEX \ - - Sun \ - - PowerStation Fortran with Visual C++ \ - - HP9000s300/s700/s800 Latest test with: HP-UX A.08.07 A 9000/730 \ - - LynxOS: cc or gcc with f2c. \ - - VAXUltrix: vcc,cc or gcc with f2c. gcc or cc with f77. \ - - f77 with vcc works; but missing link magic for f77 I/O. \ - - NO fort. None of gcc, cc or vcc generate required names.\ - - f2c : Use #define f2cFortran, or cc -Df2cFortran \ - - NAG f90: Use #define NAGf90Fortran, or cc -DNAGf90Fortran \ - - Absoft UNIX F77: Use #define AbsoftUNIXFortran or cc -DAbsoftUNIXFortran \ - - Absoft Pro Fortran: Use #define AbsoftProFortran \ - - Portland Group Fortran: Use #define pgiFortran" -/* Compiler must throw us out at this point! */ -#endif -#endif - - -#if defined(VAXC) && !defined(__VAXC) -#define OLD_VAXC -#pragma nostandard /* Prevent %CC-I-PARAMNOTUSED. */ -#endif - -/* Throughout cfortran.h we use: UN = Uppercase Name. LN = Lowercase Name. */ - -#if defined(f2cFortran) || defined(NAGf90Fortran) || defined(DECFortran) || defined(mipsFortran) || defined(apolloFortran) || defined(sunFortran) || defined(CONVEXFortran) || defined(SXFortran) || defined(extname) -#define CFC_(UN,LN) _(LN,_) /* Lowercase FORTRAN symbols. */ -#define orig_fcallsc(UN,LN) CFC_(UN,LN) -#else -#if defined(CRAYFortran) || defined(PowerStationFortran) || defined(AbsoftProFortran) -#ifdef _CRAY /* (UN), not UN, circumvents CRAY preprocessor bug. */ -#define CFC_(UN,LN) (UN) /* Uppercase FORTRAN symbols. */ -#else /* At least VISUAL_CPLUSPLUS barfs on (UN), so need UN. */ -#define CFC_(UN,LN) UN /* Uppercase FORTRAN symbols. */ -#endif -#define orig_fcallsc(UN,LN) CFC_(UN,LN) /* CRAY insists on arg.'s here. */ -#else /* For following machines one may wish to change the fcallsc default. */ -#define CF_SAME_NAMESPACE -#ifdef vmsFortran -#define CFC_(UN,LN) LN /* Either case FORTRAN symbols. */ - /* BUT we usually use UN for C macro to FORTRAN routines, so use LN here,*/ - /* because VAX/VMS doesn't do recursive macros. */ -#define orig_fcallsc(UN,LN) UN -#else /* HP-UX without +ppu or IBMR2 without -qextname. NOT reccomended. */ -#define CFC_(UN,LN) LN /* Lowercase FORTRAN symbols. */ -#define orig_fcallsc(UN,LN) CFC_(UN,LN) -#endif /* vmsFortran */ -#endif /* CRAYFortran PowerStationFortran */ -#endif /* ....Fortran */ - -#define fcallsc(UN,LN) orig_fcallsc(UN,LN) -#define preface_fcallsc(P,p,UN,LN) CFC_(_(P,UN),_(p,LN)) -#define append_fcallsc(P,p,UN,LN) CFC_(_(UN,P),_(LN,p)) - -#define C_FUNCTION(UN,LN) fcallsc(UN,LN) -#define FORTRAN_FUNCTION(UN,LN) CFC_(UN,LN) - -#ifndef COMMON_BLOCK -#ifndef CONVEXFortran -#ifndef CLIPPERFortran -#if !(defined(AbsoftUNIXFortran)||defined(AbsoftProFortran)) -#define COMMON_BLOCK(UN,LN) CFC_(UN,LN) -#else -#define COMMON_BLOCK(UN,LN) _(_C,LN) -#endif /* AbsoftUNIXFortran or AbsoftProFortran */ -#else -#define COMMON_BLOCK(UN,LN) _(LN,__) -#endif /* CLIPPERFortran */ -#else -#define COMMON_BLOCK(UN,LN) _3(_,LN,_) -#endif /* CONVEXFortran */ -#endif /* COMMON_BLOCK */ - -#ifndef DOUBLE_PRECISION -#if defined(CRAYFortran) && !defined(_CRAYT3E) -#define DOUBLE_PRECISION long double -#else -#define DOUBLE_PRECISION double -#endif -#endif - -#ifndef FORTRAN_REAL -#if defined(CRAYFortran) && defined(_CRAYT3E) -#define FORTRAN_REAL double -#else -#define FORTRAN_REAL float -#endif -#endif - -#ifdef CRAYFortran -#ifdef _CRAY -#include -#else -#include "fortran.h" /* i.e. if crosscompiling assume user has file. */ -#endif -#define FLOATVVVVVVV_cfPP (FORTRAN_REAL *) /* Used for C calls FORTRAN. */ -/* CRAY's double==float but CRAY says pointers to doubles and floats are diff.*/ -#define VOIDP (void *) /* When FORTRAN calls C, we don't know if C routine - arg.'s have been declared float *, or double *. */ -#else -#define FLOATVVVVVVV_cfPP -#define VOIDP -#endif - -#ifdef vmsFortran -#if defined(vms) || defined(__vms) -#include -#else -#include "descrip.h" /* i.e. if crosscompiling assume user has file. */ -#endif -#endif - -#ifdef sunFortran -#if defined(sun) || defined(__sun) -#include /* Sun's FLOATFUNCTIONTYPE, ASSIGNFLOAT, RETURNFLOAT. */ -#else -#include "math.h" /* i.e. if crosscompiling assume user has file. */ -#endif -/* At least starting with the default C compiler SC3.0.1 of SunOS 5.3, - * FLOATFUNCTIONTYPE, ASSIGNFLOAT, RETURNFLOAT are not required and not in - * , since sun C no longer promotes C float return values to doubles. - * Therefore, only use them if defined. - * Even if gcc is being used, assume that it exhibits the Sun C compiler - * behavior in order to be able to use *.o from the Sun C compiler. - * i.e. If FLOATFUNCTIONTYPE, etc. are in math.h, they required by gcc. - */ -#endif - -#ifndef apolloFortran -#define COMMON_BLOCK_DEF(DEFINITION, NAME) extern DEFINITION NAME -#define CF_NULL_PROTO -#else /* HP doesn't understand #elif. */ -/* Without ANSI prototyping, Apollo promotes float functions to double. */ -/* Note that VAX/VMS, IBM, Mips choke on 'type function(...);' prototypes. */ -#define CF_NULL_PROTO ... -#ifndef __CF__APOLLO67 -#define COMMON_BLOCK_DEF(DEFINITION, NAME) \ - DEFINITION NAME __attribute((__section(NAME))) -#else -#define COMMON_BLOCK_DEF(DEFINITION, NAME) \ - DEFINITION NAME #attribute[section(NAME)] -#endif -#endif - -#ifdef __cplusplus -#undef CF_NULL_PROTO -#define CF_NULL_PROTO ... -#endif - - -#ifndef USE_NEW_DELETE -#ifdef __cplusplus -#define USE_NEW_DELETE 1 -#else -#define USE_NEW_DELETE 0 -#endif -#endif -#if USE_NEW_DELETE -#define _cf_malloc(N) new char[N] -#define _cf_free(P) delete[] P -#else -#define _cf_malloc(N) (char *)malloc(N) -#define _cf_free(P) free(P) -#endif - -#ifdef mipsFortran -#define CF_DECLARE_GETARG int f77argc; char **f77argv -#define CF_SET_GETARG(ARGC,ARGV) f77argc = ARGC; f77argv = ARGV -#else -#define CF_DECLARE_GETARG -#define CF_SET_GETARG(ARGC,ARGV) -#endif - -#ifdef OLD_VAXC /* Allow %CC-I-PARAMNOTUSED. */ -#pragma standard -#endif - -#define AcfCOMMA , -#define AcfCOLON ; - -/*-------------------------------------------------------------------------*/ - -/* UTILITIES USED WITHIN CFORTRAN.H */ - -#define _cfMIN(A,B) (As) { /* Need this to handle NULL string.*/ - while (e>s && *--e==t); /* Don't follow t's past beginning. */ - e[*e==t?0:1] = '\0'; /* Handle s[0]=t correctly. */ -} return s; } - -/* kill_trailingn(s,t,e) will kill the trailing t's in string s. e normally -points to the terminating '\0' of s, but may actually point to anywhere in s. -s's new '\0' will be placed at e or earlier in order to remove any trailing t's. -If es) { /* Watch out for neg. length string.*/ - while (e>s && *--e==t); /* Don't follow t's past beginning. */ - e[*e==t?0:1] = '\0'; /* Handle s[0]=t correctly. */ -} return s; } - -/* Note the following assumes that any element which has t's to be chopped off, -does indeed fill the entire element. */ -#ifndef __CF__KnR -static char *vkill_trailing(char* cstr, int elem_len, int sizeofcstr, char t) -#else -static char *vkill_trailing( cstr, elem_len, sizeofcstr, t) - char* cstr; int elem_len; int sizeofcstr; char t; -#endif -{ int i; -for (i=0; i= 4.3 gives message: - zow35> cc -c -DDECFortran cfortest.c - cfe: Fatal: Out of memory: cfortest.c - zow35> - Old __hpux had the problem, but new 'HP-UX A.09.03 A 9000/735' is fine - if using -Aa, otherwise we have a problem. - */ -#ifndef MAX_PREPRO_ARGS -#if !defined(__GNUC__) && (defined(VAXUltrix) || defined(__CF__APOLLO67) || (defined(sun)&&!defined(__sun)) || defined(_CRAY) || defined(__ultrix__) || (defined(__hpux)&&defined(__CF__KnR))) -#define MAX_PREPRO_ARGS 31 -#else -#define MAX_PREPRO_ARGS 99 -#endif -#endif - -#if defined(AbsoftUNIXFortran) || defined(AbsoftProFortran) -/* In addition to explicit Absoft stuff, only Absoft requires: - - DEFAULT coming from _cfSTR. - DEFAULT could have been called e.g. INT, but keep it for clarity. - - M term in CFARGT14 and CFARGT14FS. - */ -#define ABSOFT_cf1(T0) _(T0,_cfSTR)(0,ABSOFT1,0,0,0,0,0) -#define ABSOFT_cf2(T0) _(T0,_cfSTR)(0,ABSOFT2,0,0,0,0,0) -#define ABSOFT_cf3(T0) _(T0,_cfSTR)(0,ABSOFT3,0,0,0,0,0) -#define DEFAULT_cfABSOFT1 -#define LOGICAL_cfABSOFT1 -#define STRING_cfABSOFT1 ,MAX_LEN_FORTRAN_FUNCTION_STRING -#define DEFAULT_cfABSOFT2 -#define LOGICAL_cfABSOFT2 -#define STRING_cfABSOFT2 ,unsigned D0 -#define DEFAULT_cfABSOFT3 -#define LOGICAL_cfABSOFT3 -#define STRING_cfABSOFT3 ,D0 -#else -#define ABSOFT_cf1(T0) -#define ABSOFT_cf2(T0) -#define ABSOFT_cf3(T0) -#endif - -/* _Z introduced to cicumvent IBM and HP silly preprocessor warning. - e.g. "Macro CFARGT14 invoked with a null argument." - */ -#define _Z - -#define CFARGT14S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \ - S(T1,1) S(T2,2) S(T3,3) S(T4,4) S(T5,5) S(T6,6) S(T7,7) \ - S(T8,8) S(T9,9) S(TA,10) S(TB,11) S(TC,12) S(TD,13) S(TE,14) -#define CFARGT27S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \ - S(T1,1) S(T2,2) S(T3,3) S(T4,4) S(T5,5) S(T6,6) S(T7,7) \ - S(T8,8) S(T9,9) S(TA,10) S(TB,11) S(TC,12) S(TD,13) S(TE,14) \ - S(TF,15) S(TG,16) S(TH,17) S(TI,18) S(TJ,19) S(TK,20) S(TL,21) \ - S(TM,22) S(TN,23) S(TO,24) S(TP,25) S(TQ,26) S(TR,27) - -#define CFARGT14FS(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \ - F(T1,1,0) F(T2,2,1) F(T3,3,1) F(T4,4,1) F(T5,5,1) F(T6,6,1) F(T7,7,1) \ - F(T8,8,1) F(T9,9,1) F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1) \ - M CFARGT14S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) -#define CFARGT27FS(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \ - F(T1,1,0) F(T2,2,1) F(T3,3,1) F(T4,4,1) F(T5,5,1) F(T6,6,1) F(T7,7,1) \ - F(T8,8,1) F(T9,9,1) F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1) \ - F(TF,15,1) F(TG,16,1) F(TH,17,1) F(TI,18,1) F(TJ,19,1) F(TK,20,1) F(TL,21,1) \ - F(TM,22,1) F(TN,23,1) F(TO,24,1) F(TP,25,1) F(TQ,26,1) F(TR,27,1) \ - M CFARGT27S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) - -#if !(defined(PowerStationFortran)||defined(hpuxFortran800)) -/* Old CFARGT14 -> CFARGT14FS as seen below, for Absoft cross-compile yields: - SunOS> cc -c -Xa -DAbsoftUNIXFortran c.c - "c.c", line 406: warning: argument mismatch - Haven't checked if this is ANSI C or a SunOS bug. SunOS -Xs works ok. - Behavior is most clearly seen in example: - #define A 1 , 2 - #define C(X,Y,Z) x=X. y=Y. z=Z. - #define D(X,Y,Z) C(X,Y,Z) - D(x,A,z) - Output from preprocessor is: x = x . y = 1 . z = 2 . - #define CFARGT14(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \ - CFARGT14FS(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) -*/ -#define CFARGT14(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \ - F(T1,1,0) F(T2,2,1) F(T3,3,1) F(T4,4,1) F(T5,5,1) F(T6,6,1) F(T7,7,1) \ - F(T8,8,1) F(T9,9,1) F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1) \ - M CFARGT14S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) -#define CFARGT27(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \ - F(T1,1,0) F(T2,2,1) F(T3,3,1) F(T4,4,1) F(T5,5,1) F(T6,6,1) F(T7,7,1) \ - F(T8,8,1) F(T9,9,1) F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1) \ - F(TF,15,1) F(TG,16,1) F(TH,17,1) F(TI,18,1) F(TJ,19,1) F(TK,20,1) F(TL,21,1) \ - F(TM,22,1) F(TN,23,1) F(TO,24,1) F(TP,25,1) F(TQ,26,1) F(TR,27,1) \ - M CFARGT27S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) - -#define CFARGT20(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \ - F(T1,1,0) F(T2,2,1) F(T3,3,1) F(T4,4,1) F(T5,5,1) F(T6,6,1) F(T7,7,1) \ - F(T8,8,1) F(T9,9,1) F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1) \ - F(TF,15,1) F(TG,16,1) F(TH,17,1) F(TI,18,1) F(TJ,19,1) F(TK,20,1) \ - S(T1,1) S(T2,2) S(T3,3) S(T4,4) S(T5,5) S(T6,6) S(T7,7) \ - S(T8,8) S(T9,9) S(TA,10) S(TB,11) S(TC,12) S(TD,13) S(TE,14) \ - S(TF,15) S(TG,16) S(TH,17) S(TI,18) S(TJ,19) S(TK,20) -#define CFARGTA14(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE) \ - F(T1,A1,1,0) F(T2,A2,2,1) F(T3,A3,3,1) F(T4,A4,4,1) F(T5,A5,5,1) F(T6,A6,6,1) \ - F(T7,A7,7,1) F(T8,A8,8,1) F(T9,A9,9,1) F(TA,AA,10,1) F(TB,AB,11,1) F(TC,AC,12,1) \ - F(TD,AD,13,1) F(TE,AE,14,1) S(T1,1) S(T2,2) S(T3,3) S(T4,4) \ - S(T5,5) S(T6,6) S(T7,7) S(T8,8) S(T9,9) S(TA,10) \ - S(TB,11) S(TC,12) S(TD,13) S(TE,14) -#if MAX_PREPRO_ARGS>31 -#define CFARGTA20(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) \ - F(T1,A1,1,0) F(T2,A2,2,1) F(T3,A3,3,1) F(T4,A4,4,1) F(T5,A5,5,1) F(T6,A6,6,1) \ - F(T7,A7,7,1) F(T8,A8,8,1) F(T9,A9,9,1) F(TA,AA,10,1) F(TB,AB,11,1) F(TC,AC,12,1) \ - F(TD,AD,13,1) F(TE,AE,14,1) F(TF,AF,15,1) F(TG,AG,16,1) F(TH,AH,17,1) F(TI,AI,18,1) \ - F(TJ,AJ,19,1) F(TK,AK,20,1) S(T1,1) S(T2,2) S(T3,3) S(T4,4) \ - S(T5,5) S(T6,6) S(T7,7) S(T8,8) S(T9,9) S(TA,10) \ - S(TB,11) S(TC,12) S(TD,13) S(TE,14) S(TF,15) S(TG,16) \ - S(TH,17) S(TI,18) S(TJ,19) S(TK,20) -#define CFARGTA27(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) \ - F(T1,A1,1,0) F(T2,A2,2,1) F(T3,A3,3,1) F(T4,A4,4,1) F(T5,A5,5,1) F(T6,A6,6,1) \ - F(T7,A7,7,1) F(T8,A8,8,1) F(T9,A9,9,1) F(TA,AA,10,1) F(TB,AB,11,1) F(TC,AC,12,1) \ - F(TD,AD,13,1) F(TE,AE,14,1) F(TF,AF,15,1) F(TG,AG,16,1) F(TH,AH,17,1) F(TI,AI,18,1) \ - F(TJ,AJ,19,1) F(TK,AK,20,1) F(TL,AL,21,1) F(TM,AM,22,1) F(TN,AN,23,1) F(TO,AO,24,1) \ - F(TP,AP,25,1) F(TQ,AQ,26,1) F(TR,AR,27,1) S(T1,1) S(T2,2) S(T3,3) \ - S(T4,4) S(T5,5) S(T6,6) S(T7,7) S(T8,8) S(T9,9) \ - S(TA,10) S(TB,11) S(TC,12) S(TD,13) S(TE,14) S(TF,15) \ - S(TG,16) S(TH,17) S(TI,18) S(TJ,19) S(TK,20) S(TL,21) \ - S(TM,22) S(TN,23) S(TO,24) S(TP,25) S(TQ,26) S(TR,27) -#endif -#else -#define CFARGT14(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \ - F(T1,1,0) S(T1,1) F(T2,2,1) S(T2,2) F(T3,3,1) S(T3,3) F(T4,4,1) S(T4,4) \ - F(T5,5,1) S(T5,5) F(T6,6,1) S(T6,6) F(T7,7,1) S(T7,7) F(T8,8,1) S(T8,8) \ - F(T9,9,1) S(T9,9) F(TA,10,1) S(TA,10) F(TB,11,1) S(TB,11) F(TC,12,1) S(TC,12) \ - F(TD,13,1) S(TD,13) F(TE,14,1) S(TE,14) -#define CFARGT27(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \ - F(T1,1,0) S(T1,1) F(T2,2,1) S(T2,2) F(T3,3,1) S(T3,3) F(T4,4,1) S(T4,4) \ - F(T5,5,1) S(T5,5) F(T6,6,1) S(T6,6) F(T7,7,1) S(T7,7) F(T8,8,1) S(T8,8) \ - F(T9,9,1) S(T9,9) F(TA,10,1) S(TA,10) F(TB,11,1) S(TB,11) F(TC,12,1) S(TC,12) \ - F(TD,13,1) S(TD,13) F(TE,14,1) S(TE,14) F(TF,15,1) S(TF,15) F(TG,16,1) S(TG,16) \ - F(TH,17,1) S(TH,17) F(TI,18,1) S(TI,18) F(TJ,19,1) S(TJ,19) F(TK,20,1) S(TK,20) \ - F(TL,21,1) S(TL,21) F(TM,22,1) S(TM,22) F(TN,23,1) S(TN,23) F(TO,24,1) S(TO,24) \ - F(TP,25,1) S(TP,25) F(TQ,26,1) S(TQ,26) F(TR,27,1) S(TR,27) - -#define CFARGT20(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \ - F(T1,1,0) S(T1,1) F(T2,2,1) S(T2,2) F(T3,3,1) S(T3,3) F(T4,4,1) S(T4,4) \ - F(T5,5,1) S(T5,5) F(T6,6,1) S(T6,6) F(T7,7,1) S(T7,7) F(T8,8,1) S(T8,8) \ - F(T9,9,1) S(T9,9) F(TA,10,1) S(TA,10) F(TB,11,1) S(TB,11) F(TC,12,1) S(TC,12) \ - F(TD,13,1) S(TD,13) F(TE,14,1) S(TE,14) F(TF,15,1) S(TF,15) F(TG,16,1) S(TG,16) \ - F(TH,17,1) S(TH,17) F(TI,18,1) S(TI,18) F(TJ,19,1) S(TJ,19) F(TK,20,1) S(TK,20) -#define CFARGTA14(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE) \ - F(T1,A1,1,0) S(T1,1) F(T2,A2,2,1) S(T2,2) F(T3,A3,3,1) S(T3,3) \ - F(T4,A4,4,1) S(T4,4) F(T5,A5,5,1) S(T5,5) F(T6,A6,6,1) S(T6,6) \ - F(T7,A7,7,1) S(T7,7) F(T8,A8,8,1) S(T8,8) F(T9,A9,9,1) S(T9,9) \ - F(TA,AA,10,1) S(TA,10) F(TB,AB,11,1) S(TB,11) F(TC,AC,12,1) S(TC,12) \ - F(TD,AD,13,1) S(TD,13) F(TE,AE,14,1) S(TE,14) -#if MAX_PREPRO_ARGS>31 -#define CFARGTA20(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) \ - F(T1,A1,1,0) S(T1,1) F(T2,A2,2,1) S(T2,2) F(T3,A3,3,1) S(T3,3) \ - F(T4,A4,4,1) S(T4,4) F(T5,A5,5,1) S(T5,5) F(T6,A6,6,1) S(T6,6) \ - F(T7,A7,7,1) S(T7,7) F(T8,A8,8,1) S(T8,8) F(T9,A9,9,1) S(T9,9) \ - F(TA,AA,10,1) S(TA,10) F(TB,AB,11,1) S(TB,11) F(TC,AC,12,1) S(TC,12) \ - F(TD,AD,13,1) S(TD,13) F(TE,AE,14,1) S(TE,14) F(TF,AF,15,1) S(TF,15) \ - F(TG,AG,16,1) S(TG,16) F(TH,AH,17,1) S(TH,17) F(TI,AI,18,1) S(TI,18) \ - F(TJ,AJ,19,1) S(TJ,19) F(TK,AK,20,1) S(TK,20) -#define CFARGTA27(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) \ - F(T1,A1,1,0) S(T1,1) F(T2,A2,2,1) S(T2,2) F(T3,A3,3,1) S(T3,3) \ - F(T4,A4,4,1) S(T4,4) F(T5,A5,5,1) S(T5,5) F(T6,A6,6,1) S(T6,6) \ - F(T7,A7,7,1) S(T7,7) F(T8,A8,8,1) S(T8,8) F(T9,A9,9,1) S(T9,9) \ - F(TA,AA,10,1) S(TA,10) F(TB,AB,11,1) S(TB,11) F(TC,AC,12,1) S(TC,12) \ - F(TD,AD,13,1) S(TD,13) F(TE,AE,14,1) S(TE,14) F(TF,AF,15,1) S(TF,15) \ - F(TG,AG,16,1) S(TG,16) F(TH,AH,17,1) S(TH,17) F(TI,AI,18,1) S(TI,18) \ - F(TJ,AJ,19,1) S(TJ,19) F(TK,AK,20,1) S(TK,20) F(TL,AL,21,1) S(TL,21) \ - F(TM,AM,22,1) S(TM,22) F(TN,AN,23,1) S(TN,23) F(TO,AO,24,1) S(TO,24) \ - F(TP,AP,25,1) S(TP,25) F(TQ,AQ,26,1) S(TQ,26) F(TR,AR,27,1) S(TR,27) -#endif -#endif - - -#define PROTOCCALLSFSUB1( UN,LN,T1) \ - PROTOCCALLSFSUB14(UN,LN,T1,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0) -#define PROTOCCALLSFSUB2( UN,LN,T1,T2) \ - PROTOCCALLSFSUB14(UN,LN,T1,T2,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0) -#define PROTOCCALLSFSUB3( UN,LN,T1,T2,T3) \ - PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0) -#define PROTOCCALLSFSUB4( UN,LN,T1,T2,T3,T4) \ - PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0) -#define PROTOCCALLSFSUB5( UN,LN,T1,T2,T3,T4,T5) \ - PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0) -#define PROTOCCALLSFSUB6( UN,LN,T1,T2,T3,T4,T5,T6) \ - PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0) -#define PROTOCCALLSFSUB7( UN,LN,T1,T2,T3,T4,T5,T6,T7) \ - PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0) -#define PROTOCCALLSFSUB8( UN,LN,T1,T2,T3,T4,T5,T6,T7,T8) \ - PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0) -#define PROTOCCALLSFSUB9( UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9) \ - PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,CF_0,CF_0,CF_0,CF_0,CF_0) -#define PROTOCCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA) \ - PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,CF_0,CF_0,CF_0,CF_0) -#define PROTOCCALLSFSUB11(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB) \ - PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,CF_0,CF_0,CF_0) -#define PROTOCCALLSFSUB12(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC) \ - PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,CF_0,CF_0) -#define PROTOCCALLSFSUB13(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD) \ - PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,CF_0) - - -#define PROTOCCALLSFSUB15(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF) \ - PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,CF_0,CF_0,CF_0,CF_0,CF_0) -#define PROTOCCALLSFSUB16(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG) \ - PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,CF_0,CF_0,CF_0,CF_0) -#define PROTOCCALLSFSUB17(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH) \ - PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,CF_0,CF_0,CF_0) -#define PROTOCCALLSFSUB18(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI) \ - PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,CF_0,CF_0) -#define PROTOCCALLSFSUB19(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ) \ - PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,CF_0) - -#define PROTOCCALLSFSUB21(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL) \ - PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0) -#define PROTOCCALLSFSUB22(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM) \ - PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,CF_0,CF_0,CF_0,CF_0,CF_0) -#define PROTOCCALLSFSUB23(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN) \ - PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,CF_0,CF_0,CF_0,CF_0) -#define PROTOCCALLSFSUB24(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO) \ - PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,CF_0,CF_0,CF_0) -#define PROTOCCALLSFSUB25(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP) \ - PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,CF_0,CF_0) -#define PROTOCCALLSFSUB26(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ) \ - PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,CF_0) - - -#ifndef FCALLSC_QUALIFIER -#ifdef VISUAL_CPLUSPLUS -#define FCALLSC_QUALIFIER __stdcall -#else -#define FCALLSC_QUALIFIER -#endif -#endif - -#ifdef __cplusplus -#define CFextern extern "C" -#else -#define CFextern extern -#endif - - -#ifdef CFSUBASFUN -#define PROTOCCALLSFSUB0(UN,LN) \ - PROTOCCALLSFFUN0( VOID,UN,LN) -#define PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \ - PROTOCCALLSFFUN14(VOID,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) -#define PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)\ - PROTOCCALLSFFUN20(VOID,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) -#define PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)\ - PROTOCCALLSFFUN27(VOID,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) -#else -/* Note: Prevent compiler warnings, null #define PROTOCCALLSFSUB14/20 after - #include-ing cfortran.h if calling the FORTRAN wrapper within the same - source code where the wrapper is created. */ -#define PROTOCCALLSFSUB0(UN,LN) _(VOID,_cfPU)(CFC_(UN,LN))(); -#ifndef __CF__KnR -#define PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \ - _(VOID,_cfPU)(CFC_(UN,LN))( CFARGT14(NCF,KCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) ); -#define PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)\ - _(VOID,_cfPU)(CFC_(UN,LN))( CFARGT20(NCF,KCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) ); -#define PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)\ - _(VOID,_cfPU)(CFC_(UN,LN))( CFARGT27(NCF,KCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) ); -#else -#define PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \ - PROTOCCALLSFSUB0(UN,LN) -#define PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \ - PROTOCCALLSFSUB0(UN,LN) -#define PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \ - PROTOCCALLSFSUB0(UN,LN) -#endif -#endif - - -#ifdef OLD_VAXC /* Allow %CC-I-PARAMNOTUSED. */ -#pragma standard -#endif - - -#define CCALLSFSUB1( UN,LN,T1, A1) \ - CCALLSFSUB5 (UN,LN,T1,CF_0,CF_0,CF_0,CF_0,A1,0,0,0,0) -#define CCALLSFSUB2( UN,LN,T1,T2, A1,A2) \ - CCALLSFSUB5 (UN,LN,T1,T2,CF_0,CF_0,CF_0,A1,A2,0,0,0) -#define CCALLSFSUB3( UN,LN,T1,T2,T3, A1,A2,A3) \ - CCALLSFSUB5 (UN,LN,T1,T2,T3,CF_0,CF_0,A1,A2,A3,0,0) -#define CCALLSFSUB4( UN,LN,T1,T2,T3,T4, A1,A2,A3,A4)\ - CCALLSFSUB5 (UN,LN,T1,T2,T3,T4,CF_0,A1,A2,A3,A4,0) -#define CCALLSFSUB5( UN,LN,T1,T2,T3,T4,T5, A1,A2,A3,A4,A5) \ - CCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,CF_0,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,0,0,0,0,0) -#define CCALLSFSUB6( UN,LN,T1,T2,T3,T4,T5,T6, A1,A2,A3,A4,A5,A6) \ - CCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,T6,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,0,0,0,0) -#define CCALLSFSUB7( UN,LN,T1,T2,T3,T4,T5,T6,T7, A1,A2,A3,A4,A5,A6,A7) \ - CCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,T6,T7,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,0,0,0) -#define CCALLSFSUB8( UN,LN,T1,T2,T3,T4,T5,T6,T7,T8, A1,A2,A3,A4,A5,A6,A7,A8) \ - CCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,0,0) -#define CCALLSFSUB9( UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,A1,A2,A3,A4,A5,A6,A7,A8,A9)\ - CCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,0) -#define CCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA)\ - CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,0,0,0,0) -#define CCALLSFSUB11(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB)\ - CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,0,0,0) -#define CCALLSFSUB12(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC)\ - CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,0,0) -#define CCALLSFSUB13(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD)\ - CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,0) - -#ifdef __cplusplus -#define CPPPROTOCLSFSUB0( UN,LN) -#define CPPPROTOCLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) -#define CPPPROTOCLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) -#define CPPPROTOCLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) -#else -#define CPPPROTOCLSFSUB0(UN,LN) \ - PROTOCCALLSFSUB0(UN,LN) -#define CPPPROTOCLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \ - PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) -#define CPPPROTOCLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \ - PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) -#define CPPPROTOCLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \ - PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) -#endif - -#ifdef CFSUBASFUN -#define CCALLSFSUB0(UN,LN) CCALLSFFUN0(UN,LN) -#define CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE)\ - CCALLSFFUN14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE) -#else -/* do{...}while(0) allows if(a==b) FORT(); else BORT(); */ -#define CCALLSFSUB0( UN,LN) do{CPPPROTOCLSFSUB0(UN,LN) CFC_(UN,LN)();}while(0) -#define CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE)\ -do{VVCF(T1,A1,B1) VVCF(T2,A2,B2) VVCF(T3,A3,B3) VVCF(T4,A4,B4) VVCF(T5,A5,B5) \ - VVCF(T6,A6,B6) VVCF(T7,A7,B7) VVCF(T8,A8,B8) VVCF(T9,A9,B9) VVCF(TA,AA,B10) \ - VVCF(TB,AB,B11) VVCF(TC,AC,B12) VVCF(TD,AD,B13) VVCF(TE,AE,B14) \ - CPPPROTOCLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \ - ACF(LN,T1,A1,1) ACF(LN,T2,A2,2) ACF(LN,T3,A3,3) \ - ACF(LN,T4,A4,4) ACF(LN,T5,A5,5) ACF(LN,T6,A6,6) ACF(LN,T7,A7,7) \ - ACF(LN,T8,A8,8) ACF(LN,T9,A9,9) ACF(LN,TA,AA,10) ACF(LN,TB,AB,11) \ - ACF(LN,TC,AC,12) ACF(LN,TD,AD,13) ACF(LN,TE,AE,14) \ - CFC_(UN,LN)( CFARGTA14(AACF,JCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE) );\ - WCF(T1,A1,1) WCF(T2,A2,2) WCF(T3,A3,3) WCF(T4,A4,4) WCF(T5,A5,5) \ - WCF(T6,A6,6) WCF(T7,A7,7) WCF(T8,A8,8) WCF(T9,A9,9) WCF(TA,AA,10) \ - WCF(TB,AB,11) WCF(TC,AC,12) WCF(TD,AD,13) WCF(TE,AE,14) }while(0) -#endif - - -#if MAX_PREPRO_ARGS>31 -#define CCALLSFSUB15(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF)\ - CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,CF_0,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,0,0,0,0,0) -#define CCALLSFSUB16(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG)\ - CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,0,0,0,0) -#define CCALLSFSUB17(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH)\ - CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,0,0,0) -#define CCALLSFSUB18(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI)\ - CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,0,0) -#define CCALLSFSUB19(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ)\ - CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,0) - -#ifdef CFSUBASFUN -#define CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH, \ - TI,TJ,TK, A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) \ - CCALLSFFUN20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH, \ - TI,TJ,TK, A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) -#else -#define CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH, \ - TI,TJ,TK, A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) \ -do{VVCF(T1,A1,B1) VVCF(T2,A2,B2) VVCF(T3,A3,B3) VVCF(T4,A4,B4) VVCF(T5,A5,B5) \ - VVCF(T6,A6,B6) VVCF(T7,A7,B7) VVCF(T8,A8,B8) VVCF(T9,A9,B9) VVCF(TA,AA,B10) \ - VVCF(TB,AB,B11) VVCF(TC,AC,B12) VVCF(TD,AD,B13) VVCF(TE,AE,B14) VVCF(TF,AF,B15) \ - VVCF(TG,AG,B16) VVCF(TH,AH,B17) VVCF(TI,AI,B18) VVCF(TJ,AJ,B19) VVCF(TK,AK,B20) \ - CPPPROTOCLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \ - ACF(LN,T1,A1,1) ACF(LN,T2,A2,2) ACF(LN,T3,A3,3) ACF(LN,T4,A4,4) \ - ACF(LN,T5,A5,5) ACF(LN,T6,A6,6) ACF(LN,T7,A7,7) ACF(LN,T8,A8,8) \ - ACF(LN,T9,A9,9) ACF(LN,TA,AA,10) ACF(LN,TB,AB,11) ACF(LN,TC,AC,12) \ - ACF(LN,TD,AD,13) ACF(LN,TE,AE,14) ACF(LN,TF,AF,15) ACF(LN,TG,AG,16) \ - ACF(LN,TH,AH,17) ACF(LN,TI,AI,18) ACF(LN,TJ,AJ,19) ACF(LN,TK,AK,20) \ - CFC_(UN,LN)( CFARGTA20(AACF,JCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) ); \ - WCF(T1,A1,1) WCF(T2,A2,2) WCF(T3,A3,3) WCF(T4,A4,4) WCF(T5,A5,5) WCF(T6,A6,6) \ - WCF(T7,A7,7) WCF(T8,A8,8) WCF(T9,A9,9) WCF(TA,AA,10) WCF(TB,AB,11) WCF(TC,AC,12) \ - WCF(TD,AD,13) WCF(TE,AE,14) WCF(TF,AF,15) WCF(TG,AG,16) WCF(TH,AH,17) WCF(TI,AI,18) \ - WCF(TJ,AJ,19) WCF(TK,AK,20) }while(0) -#endif -#endif /* MAX_PREPRO_ARGS */ - -#if MAX_PREPRO_ARGS>31 -#define CCALLSFSUB21(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL)\ - CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,0,0,0,0,0,0) -#define CCALLSFSUB22(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM)\ - CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,CF_0,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,0,0,0,0,0) -#define CCALLSFSUB23(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN)\ - CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,0,0,0,0) -#define CCALLSFSUB24(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO)\ - CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,0,0,0) -#define CCALLSFSUB25(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP)\ - CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,0,0) -#define CCALLSFSUB26(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ)\ - CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,0) - -#ifdef CFSUBASFUN -#define CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR, \ - A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) \ - CCALLSFFUN27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR, \ - A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) -#else -#define CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR, \ - A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) \ -do{VVCF(T1,A1,B1) VVCF(T2,A2,B2) VVCF(T3,A3,B3) VVCF(T4,A4,B4) VVCF(T5,A5,B5) \ - VVCF(T6,A6,B6) VVCF(T7,A7,B7) VVCF(T8,A8,B8) VVCF(T9,A9,B9) VVCF(TA,AA,B10) \ - VVCF(TB,AB,B11) VVCF(TC,AC,B12) VVCF(TD,AD,B13) VVCF(TE,AE,B14) VVCF(TF,AF,B15) \ - VVCF(TG,AG,B16) VVCF(TH,AH,B17) VVCF(TI,AI,B18) VVCF(TJ,AJ,B19) VVCF(TK,AK,B20) \ - VVCF(TL,AL,B21) VVCF(TM,AM,B22) VVCF(TN,AN,B23) VVCF(TO,AO,B24) VVCF(TP,AP,B25) \ - VVCF(TQ,AQ,B26) VVCF(TR,AR,B27) \ - CPPPROTOCLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \ - ACF(LN,T1,A1,1) ACF(LN,T2,A2,2) ACF(LN,T3,A3,3) ACF(LN,T4,A4,4) \ - ACF(LN,T5,A5,5) ACF(LN,T6,A6,6) ACF(LN,T7,A7,7) ACF(LN,T8,A8,8) \ - ACF(LN,T9,A9,9) ACF(LN,TA,AA,10) ACF(LN,TB,AB,11) ACF(LN,TC,AC,12) \ - ACF(LN,TD,AD,13) ACF(LN,TE,AE,14) ACF(LN,TF,AF,15) ACF(LN,TG,AG,16) \ - ACF(LN,TH,AH,17) ACF(LN,TI,AI,18) ACF(LN,TJ,AJ,19) ACF(LN,TK,AK,20) \ - ACF(LN,TL,AL,21) ACF(LN,TM,AM,22) ACF(LN,TN,AN,23) ACF(LN,TO,AO,24) \ - ACF(LN,TP,AP,25) ACF(LN,TQ,AQ,26) ACF(LN,TR,AR,27) \ - CFC_(UN,LN)( CFARGTA27(AACF,JCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR,\ - A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) ); \ - WCF(T1,A1,1) WCF(T2,A2,2) WCF(T3,A3,3) WCF(T4,A4,4) WCF(T5,A5,5) WCF(T6,A6,6) \ - WCF(T7,A7,7) WCF(T8,A8,8) WCF(T9,A9,9) WCF(TA,AA,10) WCF(TB,AB,11) WCF(TC,AC,12) \ - WCF(TD,AD,13) WCF(TE,AE,14) WCF(TF,AF,15) WCF(TG,AG,16) WCF(TH,AH,17) WCF(TI,AI,18) \ - WCF(TJ,AJ,19) WCF(TK,AK,20) WCF(TL,AL,21) WCF(TM,AM,22) WCF(TN,AN,23) WCF(TO,AO,24) \ - WCF(TP,AP,25) WCF(TQ,AQ,26) WCF(TR,AR,27) }while(0) -#endif -#endif /* MAX_PREPRO_ARGS */ - -/*-------------------------------------------------------------------------*/ - -/* UTILITIES FOR C TO CALL FORTRAN FUNCTIONS */ - -/*N.B. PROTOCCALLSFFUNn(..) generates code, whether or not the FORTRAN - function is called. Therefore, especially for creator's of C header files - for large FORTRAN libraries which include many functions, to reduce - compile time and object code size, it may be desirable to create - preprocessor directives to allow users to create code for only those - functions which they use. */ - -/* The following defines the maximum length string that a function can return. - Of course it may be undefine-d and re-define-d before individual - PROTOCCALLSFFUNn(..) as required. It would also be nice to have this derived - from the individual machines' limits. */ -#define MAX_LEN_FORTRAN_FUNCTION_STRING 0x4FE - -/* The following defines a character used by CFORTRAN.H to flag the end of a - string coming out of a FORTRAN routine. */ -#define CFORTRAN_NON_CHAR 0x7F - -#ifdef OLD_VAXC /* Prevent %CC-I-PARAMNOTUSED. */ -#pragma nostandard -#endif - -#define _SEP_(TN,C,cfCOMMA) _(__SEP_,C)(TN,cfCOMMA) -#define __SEP_0(TN,cfCOMMA) -#define __SEP_1(TN,cfCOMMA) _Icf(2,SEP,TN,cfCOMMA,0) -#define INT_cfSEP(T,B) _(A,B) -#define INTV_cfSEP(T,B) INT_cfSEP(T,B) -#define INTVV_cfSEP(T,B) INT_cfSEP(T,B) -#define INTVVV_cfSEP(T,B) INT_cfSEP(T,B) -#define INTVVVV_cfSEP(T,B) INT_cfSEP(T,B) -#define INTVVVVV_cfSEP(T,B) INT_cfSEP(T,B) -#define INTVVVVVV_cfSEP(T,B) INT_cfSEP(T,B) -#define INTVVVVVVV_cfSEP(T,B) INT_cfSEP(T,B) -#define PINT_cfSEP(T,B) INT_cfSEP(T,B) -#define PVOID_cfSEP(T,B) INT_cfSEP(T,B) -#define ROUTINE_cfSEP(T,B) INT_cfSEP(T,B) -#define SIMPLE_cfSEP(T,B) INT_cfSEP(T,B) -#define VOID_cfSEP(T,B) INT_cfSEP(T,B) /* For FORTRAN calls C subr.s.*/ -#define STRING_cfSEP(T,B) INT_cfSEP(T,B) -#define STRINGV_cfSEP(T,B) INT_cfSEP(T,B) -#define PSTRING_cfSEP(T,B) INT_cfSEP(T,B) -#define PSTRINGV_cfSEP(T,B) INT_cfSEP(T,B) -#define PNSTRING_cfSEP(T,B) INT_cfSEP(T,B) -#define PPSTRING_cfSEP(T,B) INT_cfSEP(T,B) -#define ZTRINGV_cfSEP(T,B) INT_cfSEP(T,B) -#define PZTRINGV_cfSEP(T,B) INT_cfSEP(T,B) - -#if defined(SIGNED_BYTE) || !defined(UNSIGNED_BYTE) -#ifdef OLD_VAXC -#define INTEGER_BYTE char /* Old VAXC barfs on 'signed char' */ -#else -#define INTEGER_BYTE signed char /* default */ -#endif -#else -#define INTEGER_BYTE unsigned char -#endif -#define BYTEVVVVVVV_cfTYPE INTEGER_BYTE -#define DOUBLEVVVVVVV_cfTYPE DOUBLE_PRECISION -#define FLOATVVVVVVV_cfTYPE FORTRAN_REAL -#define INTVVVVVVV_cfTYPE int -#define LOGICALVVVVVVV_cfTYPE int -#define LONGVVVVVVV_cfTYPE long -#define SHORTVVVVVVV_cfTYPE short -#define PBYTE_cfTYPE INTEGER_BYTE -#define PDOUBLE_cfTYPE DOUBLE_PRECISION -#define PFLOAT_cfTYPE FORTRAN_REAL -#define PINT_cfTYPE int -#define PLOGICAL_cfTYPE int -#define PLONG_cfTYPE long -#define PSHORT_cfTYPE short - -#define CFARGS0(A,T,V,W,X,Y,Z) _3(T,_cf,A) -#define CFARGS1(A,T,V,W,X,Y,Z) _3(T,_cf,A)(V) -#define CFARGS2(A,T,V,W,X,Y,Z) _3(T,_cf,A)(V,W) -#define CFARGS3(A,T,V,W,X,Y,Z) _3(T,_cf,A)(V,W,X) -#define CFARGS4(A,T,V,W,X,Y,Z) _3(T,_cf,A)(V,W,X,Y) -#define CFARGS5(A,T,V,W,X,Y,Z) _3(T,_cf,A)(V,W,X,Y,Z) - -#define _Icf(N,T,I,X,Y) _(I,_cfINT)(N,T,I,X,Y,0) -#define _Icf4(N,T,I,X,Y,Z) _(I,_cfINT)(N,T,I,X,Y,Z) -#define BYTE_cfINT(N,A,B,X,Y,Z) DOUBLE_cfINT(N,A,B,X,Y,Z) -#define DOUBLE_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INT,B,X,Y,Z,0) -#define FLOAT_cfINT(N,A,B,X,Y,Z) DOUBLE_cfINT(N,A,B,X,Y,Z) -#define INT_cfINT(N,A,B,X,Y,Z) DOUBLE_cfINT(N,A,B,X,Y,Z) -#define LOGICAL_cfINT(N,A,B,X,Y,Z) DOUBLE_cfINT(N,A,B,X,Y,Z) -#define LONG_cfINT(N,A,B,X,Y,Z) DOUBLE_cfINT(N,A,B,X,Y,Z) -#define SHORT_cfINT(N,A,B,X,Y,Z) DOUBLE_cfINT(N,A,B,X,Y,Z) -#define PBYTE_cfINT(N,A,B,X,Y,Z) PDOUBLE_cfINT(N,A,B,X,Y,Z) -#define PDOUBLE_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,PINT,B,X,Y,Z,0) -#define PFLOAT_cfINT(N,A,B,X,Y,Z) PDOUBLE_cfINT(N,A,B,X,Y,Z) -#define PINT_cfINT(N,A,B,X,Y,Z) PDOUBLE_cfINT(N,A,B,X,Y,Z) -#define PLOGICAL_cfINT(N,A,B,X,Y,Z) PDOUBLE_cfINT(N,A,B,X,Y,Z) -#define PLONG_cfINT(N,A,B,X,Y,Z) PDOUBLE_cfINT(N,A,B,X,Y,Z) -#define PSHORT_cfINT(N,A,B,X,Y,Z) PDOUBLE_cfINT(N,A,B,X,Y,Z) -#define BYTEV_cfINT(N,A,B,X,Y,Z) DOUBLEV_cfINT(N,A,B,X,Y,Z) -#define BYTEVV_cfINT(N,A,B,X,Y,Z) DOUBLEVV_cfINT(N,A,B,X,Y,Z) -#define BYTEVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVV_cfINT(N,A,B,X,Y,Z) -#define BYTEVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVV_cfINT(N,A,B,X,Y,Z) -#define BYTEVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z) -#define BYTEVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z) -#define BYTEVVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z) -#define DOUBLEV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTV,B,X,Y,Z,0) -#define DOUBLEVV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTVV,B,X,Y,Z,0) -#define DOUBLEVVV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTVVV,B,X,Y,Z,0) -#define DOUBLEVVVV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTVVVV,B,X,Y,Z,0) -#define DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTVVVVV,B,X,Y,Z,0) -#define DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTVVVVVV,B,X,Y,Z,0) -#define DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTVVVVVVV,B,X,Y,Z,0) -#define FLOATV_cfINT(N,A,B,X,Y,Z) DOUBLEV_cfINT(N,A,B,X,Y,Z) -#define FLOATVV_cfINT(N,A,B,X,Y,Z) DOUBLEVV_cfINT(N,A,B,X,Y,Z) -#define FLOATVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVV_cfINT(N,A,B,X,Y,Z) -#define FLOATVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVV_cfINT(N,A,B,X,Y,Z) -#define FLOATVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z) -#define FLOATVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z) -#define FLOATVVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z) -#define INTV_cfINT(N,A,B,X,Y,Z) DOUBLEV_cfINT(N,A,B,X,Y,Z) -#define INTVV_cfINT(N,A,B,X,Y,Z) DOUBLEVV_cfINT(N,A,B,X,Y,Z) -#define INTVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVV_cfINT(N,A,B,X,Y,Z) -#define INTVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVV_cfINT(N,A,B,X,Y,Z) -#define INTVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z) -#define INTVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z) -#define INTVVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z) -#define LOGICALV_cfINT(N,A,B,X,Y,Z) DOUBLEV_cfINT(N,A,B,X,Y,Z) -#define LOGICALVV_cfINT(N,A,B,X,Y,Z) DOUBLEVV_cfINT(N,A,B,X,Y,Z) -#define LOGICALVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVV_cfINT(N,A,B,X,Y,Z) -#define LOGICALVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVV_cfINT(N,A,B,X,Y,Z) -#define LOGICALVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z) -#define LOGICALVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z) -#define LOGICALVVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z) -#define LONGV_cfINT(N,A,B,X,Y,Z) DOUBLEV_cfINT(N,A,B,X,Y,Z) -#define LONGVV_cfINT(N,A,B,X,Y,Z) DOUBLEVV_cfINT(N,A,B,X,Y,Z) -#define LONGVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVV_cfINT(N,A,B,X,Y,Z) -#define LONGVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVV_cfINT(N,A,B,X,Y,Z) -#define LONGVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z) -#define LONGVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z) -#define LONGVVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z) -#define SHORTV_cfINT(N,A,B,X,Y,Z) DOUBLEV_cfINT(N,A,B,X,Y,Z) -#define SHORTVV_cfINT(N,A,B,X,Y,Z) DOUBLEVV_cfINT(N,A,B,X,Y,Z) -#define SHORTVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVV_cfINT(N,A,B,X,Y,Z) -#define SHORTVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVV_cfINT(N,A,B,X,Y,Z) -#define SHORTVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z) -#define SHORTVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z) -#define SHORTVVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z) -#define PVOID_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,B,B,X,Y,Z,0) -#define ROUTINE_cfINT(N,A,B,X,Y,Z) PVOID_cfINT(N,A,B,X,Y,Z) -/*CRAY coughs on the first, - i.e. the usual trouble of not being able to - define macros to macros with arguments. - New ultrix is worse, it coughs on all such uses. - */ -/*#define SIMPLE_cfINT PVOID_cfINT*/ -#define SIMPLE_cfINT(N,A,B,X,Y,Z) PVOID_cfINT(N,A,B,X,Y,Z) -#define VOID_cfINT(N,A,B,X,Y,Z) PVOID_cfINT(N,A,B,X,Y,Z) -#define STRING_cfINT(N,A,B,X,Y,Z) PVOID_cfINT(N,A,B,X,Y,Z) -#define STRINGV_cfINT(N,A,B,X,Y,Z) PVOID_cfINT(N,A,B,X,Y,Z) -#define PSTRING_cfINT(N,A,B,X,Y,Z) PVOID_cfINT(N,A,B,X,Y,Z) -#define PSTRINGV_cfINT(N,A,B,X,Y,Z) PVOID_cfINT(N,A,B,X,Y,Z) -#define PNSTRING_cfINT(N,A,B,X,Y,Z) PVOID_cfINT(N,A,B,X,Y,Z) -#define PPSTRING_cfINT(N,A,B,X,Y,Z) PVOID_cfINT(N,A,B,X,Y,Z) -#define ZTRINGV_cfINT(N,A,B,X,Y,Z) PVOID_cfINT(N,A,B,X,Y,Z) -#define PZTRINGV_cfINT(N,A,B,X,Y,Z) PVOID_cfINT(N,A,B,X,Y,Z) -#define CF_0_cfINT(N,A,B,X,Y,Z) - - -#define UCF(TN,I,C) _SEP_(TN,C,cfCOMMA) _Icf(2,U,TN,_(A,I),0) -#define UUCF(TN,I,C) _SEP_(TN,C,cfCOMMA) _SEP_(TN,1,I) -#define UUUCF(TN,I,C) _SEP_(TN,C,cfCOLON) _Icf(2,U,TN,_(A,I),0) -#define INT_cfU(T,A) _(T,VVVVVVV_cfTYPE) A -#define INTV_cfU(T,A) _(T,VVVVVV_cfTYPE) * A -#define INTVV_cfU(T,A) _(T,VVVVV_cfTYPE) * A -#define INTVVV_cfU(T,A) _(T,VVVV_cfTYPE) * A -#define INTVVVV_cfU(T,A) _(T,VVV_cfTYPE) * A -#define INTVVVVV_cfU(T,A) _(T,VV_cfTYPE) * A -#define INTVVVVVV_cfU(T,A) _(T,V_cfTYPE) * A -#define INTVVVVVVV_cfU(T,A) _(T,_cfTYPE) * A -#define PINT_cfU(T,A) _(T,_cfTYPE) * A -#define PVOID_cfU(T,A) void *A -#define ROUTINE_cfU(T,A) void (*A)(CF_NULL_PROTO) -#define VOID_cfU(T,A) void A /* Needed for C calls FORTRAN sub.s. */ -#define STRING_cfU(T,A) char *A /* via VOID and wrapper. */ -#define STRINGV_cfU(T,A) char *A -#define PSTRING_cfU(T,A) char *A -#define PSTRINGV_cfU(T,A) char *A -#define ZTRINGV_cfU(T,A) char *A -#define PZTRINGV_cfU(T,A) char *A - -/* VOID breaks U into U and UU. */ -#define INT_cfUU(T,A) _(T,VVVVVVV_cfTYPE) A -#define VOID_cfUU(T,A) /* Needed for FORTRAN calls C sub.s. */ -#define STRING_cfUU(T,A) char *A - - -#define BYTE_cfPU(A) CFextern INTEGER_BYTE FCALLSC_QUALIFIER A -#define DOUBLE_cfPU(A) CFextern DOUBLE_PRECISION FCALLSC_QUALIFIER A -#if ! (defined(FLOATFUNCTIONTYPE)&&defined(ASSIGNFLOAT)&&defined(RETURNFLOAT)) -#define FLOAT_cfPU(A) CFextern FORTRAN_REAL FCALLSC_QUALIFIER A -#else -#define FLOAT_cfPU(A) CFextern FLOATFUNCTIONTYPE FCALLSC_QUALIFIER A -#endif -#define INT_cfPU(A) CFextern int FCALLSC_QUALIFIER A -#define LOGICAL_cfPU(A) CFextern int FCALLSC_QUALIFIER A -#define LONG_cfPU(A) CFextern long FCALLSC_QUALIFIER A -#define SHORT_cfPU(A) CFextern short FCALLSC_QUALIFIER A -#define STRING_cfPU(A) CFextern void FCALLSC_QUALIFIER A -#define VOID_cfPU(A) CFextern void FCALLSC_QUALIFIER A - -#define BYTE_cfE INTEGER_BYTE A0; -#define DOUBLE_cfE DOUBLE_PRECISION A0; -#if ! (defined(FLOATFUNCTIONTYPE)&&defined(ASSIGNFLOAT)&&defined(RETURNFLOAT)) -#define FLOAT_cfE FORTRAN_REAL A0; -#else -#define FLOAT_cfE FORTRAN_REAL AA0; FLOATFUNCTIONTYPE A0; -#endif -#define INT_cfE int A0; -#define LOGICAL_cfE int A0; -#define LONG_cfE long A0; -#define SHORT_cfE short A0; -#define VOID_cfE -#ifdef vmsFortran -#define STRING_cfE static char AA0[1+MAX_LEN_FORTRAN_FUNCTION_STRING]; \ - static fstring A0 = \ - {MAX_LEN_FORTRAN_FUNCTION_STRING,DSC$K_DTYPE_T,DSC$K_CLASS_S,AA0};\ - memset(AA0, CFORTRAN_NON_CHAR, MAX_LEN_FORTRAN_FUNCTION_STRING);\ - *(AA0+MAX_LEN_FORTRAN_FUNCTION_STRING)='\0'; -#else -#ifdef CRAYFortran -#define STRING_cfE static char AA0[1+MAX_LEN_FORTRAN_FUNCTION_STRING]; \ - static _fcd A0; *(AA0+MAX_LEN_FORTRAN_FUNCTION_STRING)='\0';\ - memset(AA0,CFORTRAN_NON_CHAR, MAX_LEN_FORTRAN_FUNCTION_STRING);\ - A0 = _cptofcd(AA0,MAX_LEN_FORTRAN_FUNCTION_STRING); -#else -/* 'cc: SC3.0.1 13 Jul 1994' barfs on char A0[0x4FE+1]; - * char A0[0x4FE +1]; char A0[1+0x4FE]; are both OK. */ -#define STRING_cfE static char A0[1+MAX_LEN_FORTRAN_FUNCTION_STRING]; \ - memset(A0, CFORTRAN_NON_CHAR, \ - MAX_LEN_FORTRAN_FUNCTION_STRING); \ - *(A0+MAX_LEN_FORTRAN_FUNCTION_STRING)='\0'; -#endif -#endif -/* ESTRING must use static char. array which is guaranteed to exist after - function returns. */ - -/* N.B.i) The diff. for 0 (Zero) and >=1 arguments. - ii)That the following create an unmatched bracket, i.e. '(', which - must of course be matched in the call. - iii)Commas must be handled very carefully */ -#define INT_cfGZ(T,UN,LN) A0=CFC_(UN,LN)( -#define VOID_cfGZ(T,UN,LN) CFC_(UN,LN)( -#ifdef vmsFortran -#define STRING_cfGZ(T,UN,LN) CFC_(UN,LN)(&A0 -#else -#if defined(CRAYFortran) || defined(AbsoftUNIXFortran) || defined(AbsoftProFortran) -#define STRING_cfGZ(T,UN,LN) CFC_(UN,LN)( A0 -#else -#define STRING_cfGZ(T,UN,LN) CFC_(UN,LN)( A0,MAX_LEN_FORTRAN_FUNCTION_STRING -#endif -#endif - -#define INT_cfG(T,UN,LN) INT_cfGZ(T,UN,LN) -#define VOID_cfG(T,UN,LN) VOID_cfGZ(T,UN,LN) -#define STRING_cfG(T,UN,LN) STRING_cfGZ(T,UN,LN), /*, is only diff. from _cfG*/ - -#define BYTEVVVVVVV_cfPP -#define INTVVVVVVV_cfPP /* These complement FLOATVVVVVVV_cfPP. */ -#define DOUBLEVVVVVVV_cfPP -#define LOGICALVVVVVVV_cfPP -#define LONGVVVVVVV_cfPP -#define SHORTVVVVVVV_cfPP -#define PBYTE_cfPP -#define PINT_cfPP -#define PDOUBLE_cfPP -#define PLOGICAL_cfPP -#define PLONG_cfPP -#define PSHORT_cfPP -#define PFLOAT_cfPP FLOATVVVVVVV_cfPP - -#define BCF(TN,AN,C) _SEP_(TN,C,cfCOMMA) _Icf(2,B,TN,AN,0) -#define INT_cfB(T,A) (_(T,VVVVVVV_cfTYPE)) A -#define INTV_cfB(T,A) A -#define INTVV_cfB(T,A) (A)[0] -#define INTVVV_cfB(T,A) (A)[0][0] -#define INTVVVV_cfB(T,A) (A)[0][0][0] -#define INTVVVVV_cfB(T,A) (A)[0][0][0][0] -#define INTVVVVVV_cfB(T,A) (A)[0][0][0][0][0] -#define INTVVVVVVV_cfB(T,A) (A)[0][0][0][0][0][0] -#define PINT_cfB(T,A) _(T,_cfPP)&A -#define STRING_cfB(T,A) (char *) A -#define STRINGV_cfB(T,A) (char *) A -#define PSTRING_cfB(T,A) (char *) A -#define PSTRINGV_cfB(T,A) (char *) A -#define PVOID_cfB(T,A) (void *) A -#define ROUTINE_cfB(T,A) (cfCAST_FUNCTION)A -#define ZTRINGV_cfB(T,A) (char *) A -#define PZTRINGV_cfB(T,A) (char *) A - -#define SCF(TN,NAME,I,A) _(TN,_cfSTR)(3,S,NAME,I,A,0,0) -#define DEFAULT_cfS(M,I,A) -#define LOGICAL_cfS(M,I,A) -#define PLOGICAL_cfS(M,I,A) -#define STRING_cfS(M,I,A) ,sizeof(A) -#define STRINGV_cfS(M,I,A) ,( (unsigned)0xFFFF*firstindexlength(A) \ - +secondindexlength(A)) -#define PSTRING_cfS(M,I,A) ,sizeof(A) -#define PSTRINGV_cfS(M,I,A) STRINGV_cfS(M,I,A) -#define ZTRINGV_cfS(M,I,A) -#define PZTRINGV_cfS(M,I,A) - -#define HCF(TN,I) _(TN,_cfSTR)(3,H,cfCOMMA, H,_(C,I),0,0) -#define HHCF(TN,I) _(TN,_cfSTR)(3,H,cfCOMMA,HH,_(C,I),0,0) -#define HHHCF(TN,I) _(TN,_cfSTR)(3,H,cfCOLON, H,_(C,I),0,0) -#define H_CF_SPECIAL unsigned -#define HH_CF_SPECIAL -#define DEFAULT_cfH(M,I,A) -#define LOGICAL_cfH(S,U,B) -#define PLOGICAL_cfH(S,U,B) -#define STRING_cfH(S,U,B) _(A,S) _(U,_CF_SPECIAL) B -#define STRINGV_cfH(S,U,B) STRING_cfH(S,U,B) -#define PSTRING_cfH(S,U,B) STRING_cfH(S,U,B) -#define PSTRINGV_cfH(S,U,B) STRING_cfH(S,U,B) -#define PNSTRING_cfH(S,U,B) STRING_cfH(S,U,B) -#define PPSTRING_cfH(S,U,B) STRING_cfH(S,U,B) -#define ZTRINGV_cfH(S,U,B) -#define PZTRINGV_cfH(S,U,B) - -/* Need VOID_cfSTR because Absoft forced function types go through _cfSTR. */ -/* No spaces inside expansion. They screws up macro catenation kludge. */ -#define VOID_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define BYTE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define DOUBLE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define FLOAT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define INT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define LOGICAL_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,LOGICAL,A,B,C,D,E) -#define LONG_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define SHORT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define BYTEV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define BYTEVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define BYTEVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define BYTEVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define BYTEVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define BYTEVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define BYTEVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define DOUBLEV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define DOUBLEVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define DOUBLEVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define DOUBLEVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define DOUBLEVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define DOUBLEVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define DOUBLEVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define FLOATV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define FLOATVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define FLOATVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define FLOATVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define FLOATVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define FLOATVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define FLOATVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define INTV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define INTVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define INTVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define INTVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define INTVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define INTVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define INTVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define LOGICALV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define LOGICALVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define LOGICALVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define LOGICALVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define LOGICALVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define LOGICALVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define LOGICALVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define LONGV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define LONGVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define LONGVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define LONGVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define LONGVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define LONGVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define LONGVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define SHORTV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define SHORTVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define SHORTVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define SHORTVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define SHORTVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define SHORTVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define SHORTVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define PBYTE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define PDOUBLE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define PFLOAT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define PINT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define PLOGICAL_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PLOGICAL,A,B,C,D,E) -#define PLONG_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define PSHORT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define STRING_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,STRING,A,B,C,D,E) -#define PSTRING_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PSTRING,A,B,C,D,E) -#define STRINGV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,STRINGV,A,B,C,D,E) -#define PSTRINGV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PSTRINGV,A,B,C,D,E) -#define PNSTRING_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PNSTRING,A,B,C,D,E) -#define PPSTRING_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PPSTRING,A,B,C,D,E) -#define PVOID_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define ROUTINE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define SIMPLE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E) -#define ZTRINGV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,ZTRINGV,A,B,C,D,E) -#define PZTRINGV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PZTRINGV,A,B,C,D,E) -#define CF_0_cfSTR(N,T,A,B,C,D,E) - -/* See ACF table comments, which explain why CCF was split into two. */ -#define CCF(NAME,TN,I) _(TN,_cfSTR)(5,C,NAME,I,_(A,I),_(B,I),_(C,I)) -#define DEFAULT_cfC(M,I,A,B,C) -#define LOGICAL_cfC(M,I,A,B,C) A=C2FLOGICAL( A); -#define PLOGICAL_cfC(M,I,A,B,C) *A=C2FLOGICAL(*A); -#ifdef vmsFortran -#define STRING_cfC(M,I,A,B,C) (B.clen=strlen(A),B.f.dsc$a_pointer=A, \ - C==sizeof(char*)||C==(unsigned)(B.clen+1)?B.f.dsc$w_length=B.clen: \ - (memset((A)+B.clen,' ',C-B.clen-1),A[B.f.dsc$w_length=C-1]='\0')); - /* PSTRING_cfC to beware of array A which does not contain any \0. */ -#define PSTRING_cfC(M,I,A,B,C) (B.dsc$a_pointer=A, C==sizeof(char*) ? \ - B.dsc$w_length=strlen(A): (A[C-1]='\0',B.dsc$w_length=strlen(A), \ - memset((A)+B.dsc$w_length,' ',C-B.dsc$w_length-1), B.dsc$w_length=C-1)); -#else -#define STRING_cfC(M,I,A,B,C) (B.clen=strlen(A), \ - C==sizeof(char*)||C==(unsigned)(B.clen+1)?B.flen=B.clen: \ - (memset((A)+B.clen,' ',C-B.clen-1),A[B.flen=C-1]='\0')); -#define PSTRING_cfC(M,I,A,B,C) (C==sizeof(char*)? B=strlen(A): \ - (A[C-1]='\0',B=strlen(A),memset((A)+B,' ',C-B-1),B=C-1)); -#endif - /* For CRAYFortran for (P)STRINGV_cfC, B.fs is set, but irrelevant. */ -#define STRINGV_cfC(M,I,A,B,C) \ - AATRINGV_cfA( A,B,(C/0xFFFF)*(C%0xFFFF),C/0xFFFF,C%0xFFFF) -#define PSTRINGV_cfC(M,I,A,B,C) \ - APATRINGV_cfA( A,B,(C/0xFFFF)*(C%0xFFFF),C/0xFFFF,C%0xFFFF) -#define ZTRINGV_cfC(M,I,A,B,C) \ - AATRINGV_cfA( A,B, (_3(M,_ELEMS_,I))*((_3(M,_ELEMLEN_,I))+1), \ - (_3(M,_ELEMS_,I)), (_3(M,_ELEMLEN_,I))+1 ) -#define PZTRINGV_cfC(M,I,A,B,C) \ - APATRINGV_cfA( A,B, (_3(M,_ELEMS_,I))*((_3(M,_ELEMLEN_,I))+1), \ - (_3(M,_ELEMS_,I)), (_3(M,_ELEMLEN_,I))+1 ) - -#define BYTE_cfCCC(A,B) &A -#define DOUBLE_cfCCC(A,B) &A -#if !defined(__CF__KnR) -#define FLOAT_cfCCC(A,B) &A - /* Although the VAX doesn't, at least the */ -#else /* HP and K&R mips promote float arg.'s of */ -#define FLOAT_cfCCC(A,B) &B /* unprototyped functions to double. Cannot */ -#endif /* use A here to pass the argument to FORTRAN. */ -#define INT_cfCCC(A,B) &A -#define LOGICAL_cfCCC(A,B) &A -#define LONG_cfCCC(A,B) &A -#define SHORT_cfCCC(A,B) &A -#define PBYTE_cfCCC(A,B) A -#define PDOUBLE_cfCCC(A,B) A -#define PFLOAT_cfCCC(A,B) A -#define PINT_cfCCC(A,B) A -#define PLOGICAL_cfCCC(A,B) B=A /* B used to keep a common W table. */ -#define PLONG_cfCCC(A,B) A -#define PSHORT_cfCCC(A,B) A - -#define CCCF(TN,I,M) _SEP_(TN,M,cfCOMMA) _Icf(3,CC,TN,_(A,I),_(B,I)) -#define INT_cfCC(T,A,B) _(T,_cfCCC)(A,B) -#define INTV_cfCC(T,A,B) A -#define INTVV_cfCC(T,A,B) A -#define INTVVV_cfCC(T,A,B) A -#define INTVVVV_cfCC(T,A,B) A -#define INTVVVVV_cfCC(T,A,B) A -#define INTVVVVVV_cfCC(T,A,B) A -#define INTVVVVVVV_cfCC(T,A,B) A -#define PINT_cfCC(T,A,B) _(T,_cfCCC)(A,B) -#define PVOID_cfCC(T,A,B) A -#if defined(apolloFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran) -#define ROUTINE_cfCC(T,A,B) &A -#else -#define ROUTINE_cfCC(T,A,B) A -#endif -#define SIMPLE_cfCC(T,A,B) A -#ifdef vmsFortran -#define STRING_cfCC(T,A,B) &B.f -#define STRINGV_cfCC(T,A,B) &B -#define PSTRING_cfCC(T,A,B) &B -#define PSTRINGV_cfCC(T,A,B) &B -#else -#ifdef CRAYFortran -#define STRING_cfCC(T,A,B) _cptofcd(A,B.flen) -#define STRINGV_cfCC(T,A,B) _cptofcd(B.s,B.flen) -#define PSTRING_cfCC(T,A,B) _cptofcd(A,B) -#define PSTRINGV_cfCC(T,A,B) _cptofcd(A,B.flen) -#else -#define STRING_cfCC(T,A,B) A -#define STRINGV_cfCC(T,A,B) B.fs -#define PSTRING_cfCC(T,A,B) A -#define PSTRINGV_cfCC(T,A,B) B.fs -#endif -#endif -#define ZTRINGV_cfCC(T,A,B) STRINGV_cfCC(T,A,B) -#define PZTRINGV_cfCC(T,A,B) PSTRINGV_cfCC(T,A,B) - -#define BYTE_cfX return A0; -#define DOUBLE_cfX return A0; -#if ! (defined(FLOATFUNCTIONTYPE)&&defined(ASSIGNFLOAT)&&defined(RETURNFLOAT)) -#define FLOAT_cfX return A0; -#else -#define FLOAT_cfX ASSIGNFLOAT(AA0,A0); return AA0; -#endif -#define INT_cfX return A0; -#define LOGICAL_cfX return F2CLOGICAL(A0); -#define LONG_cfX return A0; -#define SHORT_cfX return A0; -#define VOID_cfX return ; -#if defined(vmsFortran) || defined(CRAYFortran) -#define STRING_cfX return kill_trailing( \ - kill_trailing(AA0,CFORTRAN_NON_CHAR),' '); -#else -#define STRING_cfX return kill_trailing( \ - kill_trailing( A0,CFORTRAN_NON_CHAR),' '); -#endif - -#define CFFUN(NAME) _(__cf__,NAME) - -/* Note that we don't use LN here, but we keep it for consistency. */ -#define CCALLSFFUN0(UN,LN) CFFUN(UN)() - -#ifdef OLD_VAXC /* Allow %CC-I-PARAMNOTUSED. */ -#pragma standard -#endif - -#define CCALLSFFUN1( UN,LN,T1, A1) \ - CCALLSFFUN5 (UN,LN,T1,CF_0,CF_0,CF_0,CF_0,A1,0,0,0,0) -#define CCALLSFFUN2( UN,LN,T1,T2, A1,A2) \ - CCALLSFFUN5 (UN,LN,T1,T2,CF_0,CF_0,CF_0,A1,A2,0,0,0) -#define CCALLSFFUN3( UN,LN,T1,T2,T3, A1,A2,A3) \ - CCALLSFFUN5 (UN,LN,T1,T2,T3,CF_0,CF_0,A1,A2,A3,0,0) -#define CCALLSFFUN4( UN,LN,T1,T2,T3,T4, A1,A2,A3,A4)\ - CCALLSFFUN5 (UN,LN,T1,T2,T3,T4,CF_0,A1,A2,A3,A4,0) -#define CCALLSFFUN5( UN,LN,T1,T2,T3,T4,T5, A1,A2,A3,A4,A5) \ - CCALLSFFUN10(UN,LN,T1,T2,T3,T4,T5,CF_0,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,0,0,0,0,0) -#define CCALLSFFUN6( UN,LN,T1,T2,T3,T4,T5,T6, A1,A2,A3,A4,A5,A6) \ - CCALLSFFUN10(UN,LN,T1,T2,T3,T4,T5,T6,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,0,0,0,0) -#define CCALLSFFUN7( UN,LN,T1,T2,T3,T4,T5,T6,T7, A1,A2,A3,A4,A5,A6,A7) \ - CCALLSFFUN10(UN,LN,T1,T2,T3,T4,T5,T6,T7,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,0,0,0) -#define CCALLSFFUN8( UN,LN,T1,T2,T3,T4,T5,T6,T7,T8, A1,A2,A3,A4,A5,A6,A7,A8) \ - CCALLSFFUN10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,0,0) -#define CCALLSFFUN9( UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,A1,A2,A3,A4,A5,A6,A7,A8,A9)\ - CCALLSFFUN10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,0) -#define CCALLSFFUN10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA)\ - CCALLSFFUN14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,0,0,0,0) -#define CCALLSFFUN11(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB)\ - CCALLSFFUN14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,0,0,0) -#define CCALLSFFUN12(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC)\ - CCALLSFFUN14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,0,0) -#define CCALLSFFUN13(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD)\ - CCALLSFFUN14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,0) - -#define CCALLSFFUN14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE)\ -((CFFUN(UN)( BCF(T1,A1,0) BCF(T2,A2,1) BCF(T3,A3,1) BCF(T4,A4,1) BCF(T5,A5,1) \ - BCF(T6,A6,1) BCF(T7,A7,1) BCF(T8,A8,1) BCF(T9,A9,1) BCF(TA,AA,1) \ - BCF(TB,AB,1) BCF(TC,AC,1) BCF(TD,AD,1) BCF(TE,AE,1) \ - SCF(T1,LN,1,A1) SCF(T2,LN,2,A2) SCF(T3,LN,3,A3) SCF(T4,LN,4,A4) \ - SCF(T5,LN,5,A5) SCF(T6,LN,6,A6) SCF(T7,LN,7,A7) SCF(T8,LN,8,A8) \ - SCF(T9,LN,9,A9) SCF(TA,LN,10,AA) SCF(TB,LN,11,AB) SCF(TC,LN,12,AC) \ - SCF(TD,LN,13,AD) SCF(TE,LN,14,AE)))) - -/* N.B. Create a separate function instead of using (call function, function -value here) because in order to create the variables needed for the input -arg.'s which may be const.'s one has to do the creation within {}, but these -can never be placed within ()'s. Therefore one must create wrapper functions. -gcc, on the other hand may be able to avoid the wrapper functions. */ - -/* Prototypes are needed to correctly handle the value returned correctly. N.B. -Can only have prototype arg.'s with difficulty, a la G... table since FORTRAN -functions returning strings have extra arg.'s. Don't bother, since this only -causes a compiler warning to come up when one uses FCALLSCFUNn and CCALLSFFUNn -for the same function in the same source code. Something done by the experts in -debugging only.*/ - -#define PROTOCCALLSFFUN0(F,UN,LN) \ -_(F,_cfPU)( CFC_(UN,LN))(CF_NULL_PROTO); \ -static _Icf(2,U,F,CFFUN(UN),0)() {_(F,_cfE) _Icf(3,GZ,F,UN,LN) ABSOFT_cf1(F));_(F,_cfX)} - -#define PROTOCCALLSFFUN1( T0,UN,LN,T1) \ - PROTOCCALLSFFUN5 (T0,UN,LN,T1,CF_0,CF_0,CF_0,CF_0) -#define PROTOCCALLSFFUN2( T0,UN,LN,T1,T2) \ - PROTOCCALLSFFUN5 (T0,UN,LN,T1,T2,CF_0,CF_0,CF_0) -#define PROTOCCALLSFFUN3( T0,UN,LN,T1,T2,T3) \ - PROTOCCALLSFFUN5 (T0,UN,LN,T1,T2,T3,CF_0,CF_0) -#define PROTOCCALLSFFUN4( T0,UN,LN,T1,T2,T3,T4) \ - PROTOCCALLSFFUN5 (T0,UN,LN,T1,T2,T3,T4,CF_0) -#define PROTOCCALLSFFUN5( T0,UN,LN,T1,T2,T3,T4,T5) \ - PROTOCCALLSFFUN10(T0,UN,LN,T1,T2,T3,T4,T5,CF_0,CF_0,CF_0,CF_0,CF_0) -#define PROTOCCALLSFFUN6( T0,UN,LN,T1,T2,T3,T4,T5,T6) \ - PROTOCCALLSFFUN10(T0,UN,LN,T1,T2,T3,T4,T5,T6,CF_0,CF_0,CF_0,CF_0) -#define PROTOCCALLSFFUN7( T0,UN,LN,T1,T2,T3,T4,T5,T6,T7) \ - PROTOCCALLSFFUN10(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,CF_0,CF_0,CF_0) -#define PROTOCCALLSFFUN8( T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8) \ - PROTOCCALLSFFUN10(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,CF_0,CF_0) -#define PROTOCCALLSFFUN9( T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9) \ - PROTOCCALLSFFUN10(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,CF_0) -#define PROTOCCALLSFFUN10(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA) \ - PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,CF_0,CF_0,CF_0,CF_0) -#define PROTOCCALLSFFUN11(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB) \ - PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,CF_0,CF_0,CF_0) -#define PROTOCCALLSFFUN12(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC) \ - PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,CF_0,CF_0) -#define PROTOCCALLSFFUN13(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD) \ - PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,CF_0) - -/* HP/UX 9.01 cc requires the blank between '_Icf(3,G,T0,UN,LN) CCCF(T1,1,0)' */ - -#ifndef __CF__KnR -#define PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \ - _(T0,_cfPU)(CFC_(UN,LN))(CF_NULL_PROTO); static _Icf(2,U,T0,CFFUN(UN),0)( \ - CFARGT14FS(UCF,HCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) ) \ -{ CFARGT14S(VCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) _(T0,_cfE) \ - CCF(LN,T1,1) CCF(LN,T2,2) CCF(LN,T3,3) CCF(LN,T4,4) CCF(LN,T5,5) \ - CCF(LN,T6,6) CCF(LN,T7,7) CCF(LN,T8,8) CCF(LN,T9,9) CCF(LN,TA,10) \ - CCF(LN,TB,11) CCF(LN,TC,12) CCF(LN,TD,13) CCF(LN,TE,14) _Icf(3,G,T0,UN,LN) \ - CFARGT14(CCCF,JCF,ABSOFT_cf1(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)); \ - WCF(T1,A1,1) WCF(T2,A2,2) WCF(T3,A3,3) WCF(T4,A4,4) WCF(T5,A5,5) \ - WCF(T6,A6,6) WCF(T7,A7,7) WCF(T8,A8,8) WCF(T9,A9,9) WCF(TA,A10,10) \ - WCF(TB,A11,11) WCF(TC,A12,12) WCF(TD,A13,13) WCF(TE,A14,14) _(T0,_cfX)} -#else -#define PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \ - _(T0,_cfPU)(CFC_(UN,LN))(CF_NULL_PROTO); static _Icf(2,U,T0,CFFUN(UN),0)( \ - CFARGT14FS(UUCF,HHCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) ) \ - CFARGT14FS(UUUCF,HHHCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) ; \ -{ CFARGT14S(VCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) _(T0,_cfE) \ - CCF(LN,T1,1) CCF(LN,T2,2) CCF(LN,T3,3) CCF(LN,T4,4) CCF(LN,T5,5) \ - CCF(LN,T6,6) CCF(LN,T7,7) CCF(LN,T8,8) CCF(LN,T9,9) CCF(LN,TA,10) \ - CCF(LN,TB,11) CCF(LN,TC,12) CCF(LN,TD,13) CCF(LN,TE,14) _Icf(3,G,T0,UN,LN) \ - CFARGT14(CCCF,JCF,ABSOFT_cf1(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)); \ - WCF(T1,A1,1) WCF(T2,A2,2) WCF(T3,A3,3) WCF(T4,A4,4) WCF(T5,A5,5) \ - WCF(T6,A6,6) WCF(T7,A7,7) WCF(T8,A8,8) WCF(T9,A9,9) WCF(TA,A10,10) \ - WCF(TB,A11,11) WCF(TC,A12,12) WCF(TD,A13,13) WCF(TE,A14,14) _(T0,_cfX)} -#endif - -/*-------------------------------------------------------------------------*/ - -/* UTILITIES FOR FORTRAN TO CALL C ROUTINES */ - -#ifdef OLD_VAXC /* Prevent %CC-I-PARAMNOTUSED. */ -#pragma nostandard -#endif - -#if defined(vmsFortran) || defined(CRAYFortran) -#define DCF(TN,I) -#define DDCF(TN,I) -#define DDDCF(TN,I) -#else -#define DCF(TN,I) HCF(TN,I) -#define DDCF(TN,I) HHCF(TN,I) -#define DDDCF(TN,I) HHHCF(TN,I) -#endif - -#define QCF(TN,I) _(TN,_cfSTR)(1,Q,_(B,I), 0,0,0,0) -#define DEFAULT_cfQ(B) -#define LOGICAL_cfQ(B) -#define PLOGICAL_cfQ(B) -#define STRINGV_cfQ(B) char *B; unsigned int _(B,N); -#define STRING_cfQ(B) char *B=NULL; -#define PSTRING_cfQ(B) char *B=NULL; -#define PSTRINGV_cfQ(B) STRINGV_cfQ(B) -#define PNSTRING_cfQ(B) char *B=NULL; -#define PPSTRING_cfQ(B) - -#ifdef __sgi /* Else SGI gives warning 182 contrary to its C LRM A.17.7 */ -#define ROUTINE_orig *(void**)& -#else -#define ROUTINE_orig (void *) -#endif - -#define ROUTINE_1 ROUTINE_orig -#define ROUTINE_2 ROUTINE_orig -#define ROUTINE_3 ROUTINE_orig -#define ROUTINE_4 ROUTINE_orig -#define ROUTINE_5 ROUTINE_orig -#define ROUTINE_6 ROUTINE_orig -#define ROUTINE_7 ROUTINE_orig -#define ROUTINE_8 ROUTINE_orig -#define ROUTINE_9 ROUTINE_orig -#define ROUTINE_10 ROUTINE_orig -#define ROUTINE_11 ROUTINE_orig -#define ROUTINE_12 ROUTINE_orig -#define ROUTINE_13 ROUTINE_orig -#define ROUTINE_14 ROUTINE_orig -#define ROUTINE_15 ROUTINE_orig -#define ROUTINE_16 ROUTINE_orig -#define ROUTINE_17 ROUTINE_orig -#define ROUTINE_18 ROUTINE_orig -#define ROUTINE_19 ROUTINE_orig -#define ROUTINE_20 ROUTINE_orig -#define ROUTINE_21 ROUTINE_orig -#define ROUTINE_22 ROUTINE_orig -#define ROUTINE_23 ROUTINE_orig -#define ROUTINE_24 ROUTINE_orig -#define ROUTINE_25 ROUTINE_orig -#define ROUTINE_26 ROUTINE_orig -#define ROUTINE_27 ROUTINE_orig - -#define TCF(NAME,TN,I,M) _SEP_(TN,M,cfCOMMA) _(TN,_cfT)(NAME,I,_(A,I),_(B,I),_(C,I)) -#define BYTE_cfT(M,I,A,B,D) *A -#define DOUBLE_cfT(M,I,A,B,D) *A -#define FLOAT_cfT(M,I,A,B,D) *A -#define INT_cfT(M,I,A,B,D) *A -#define LOGICAL_cfT(M,I,A,B,D) F2CLOGICAL(*A) -#define LONG_cfT(M,I,A,B,D) *A -#define SHORT_cfT(M,I,A,B,D) *A -#define BYTEV_cfT(M,I,A,B,D) A -#define DOUBLEV_cfT(M,I,A,B,D) A -#define FLOATV_cfT(M,I,A,B,D) VOIDP A -#define INTV_cfT(M,I,A,B,D) A -#define LOGICALV_cfT(M,I,A,B,D) A -#define LONGV_cfT(M,I,A,B,D) A -#define SHORTV_cfT(M,I,A,B,D) A -#define BYTEVV_cfT(M,I,A,B,D) (void *)A /* We have to cast to void *,*/ -#define BYTEVVV_cfT(M,I,A,B,D) (void *)A /* since we don't know the */ -#define BYTEVVVV_cfT(M,I,A,B,D) (void *)A /* dimensions of the array. */ -#define BYTEVVVVV_cfT(M,I,A,B,D) (void *)A /* i.e. Unfortunately, can't */ -#define BYTEVVVVVV_cfT(M,I,A,B,D) (void *)A /* check that the type */ -#define BYTEVVVVVVV_cfT(M,I,A,B,D) (void *)A /* matches the prototype. */ -#define DOUBLEVV_cfT(M,I,A,B,D) (void *)A -#define DOUBLEVVV_cfT(M,I,A,B,D) (void *)A -#define DOUBLEVVVV_cfT(M,I,A,B,D) (void *)A -#define DOUBLEVVVVV_cfT(M,I,A,B,D) (void *)A -#define DOUBLEVVVVVV_cfT(M,I,A,B,D) (void *)A -#define DOUBLEVVVVVVV_cfT(M,I,A,B,D) (void *)A -#define FLOATVV_cfT(M,I,A,B,D) (void *)A -#define FLOATVVV_cfT(M,I,A,B,D) (void *)A -#define FLOATVVVV_cfT(M,I,A,B,D) (void *)A -#define FLOATVVVVV_cfT(M,I,A,B,D) (void *)A -#define FLOATVVVVVV_cfT(M,I,A,B,D) (void *)A -#define FLOATVVVVVVV_cfT(M,I,A,B,D) (void *)A -#define INTVV_cfT(M,I,A,B,D) (void *)A -#define INTVVV_cfT(M,I,A,B,D) (void *)A -#define INTVVVV_cfT(M,I,A,B,D) (void *)A -#define INTVVVVV_cfT(M,I,A,B,D) (void *)A -#define INTVVVVVV_cfT(M,I,A,B,D) (void *)A -#define INTVVVVVVV_cfT(M,I,A,B,D) (void *)A -#define LOGICALVV_cfT(M,I,A,B,D) (void *)A -#define LOGICALVVV_cfT(M,I,A,B,D) (void *)A -#define LOGICALVVVV_cfT(M,I,A,B,D) (void *)A -#define LOGICALVVVVV_cfT(M,I,A,B,D) (void *)A -#define LOGICALVVVVVV_cfT(M,I,A,B,D) (void *)A -#define LOGICALVVVVVVV_cfT(M,I,A,B,D) (void *)A -#define LONGVV_cfT(M,I,A,B,D) (void *)A -#define LONGVVV_cfT(M,I,A,B,D) (void *)A -#define LONGVVVV_cfT(M,I,A,B,D) (void *)A -#define LONGVVVVV_cfT(M,I,A,B,D) (void *)A -#define LONGVVVVVV_cfT(M,I,A,B,D) (void *)A -#define LONGVVVVVVV_cfT(M,I,A,B,D) (void *)A -#define SHORTVV_cfT(M,I,A,B,D) (void *)A -#define SHORTVVV_cfT(M,I,A,B,D) (void *)A -#define SHORTVVVV_cfT(M,I,A,B,D) (void *)A -#define SHORTVVVVV_cfT(M,I,A,B,D) (void *)A -#define SHORTVVVVVV_cfT(M,I,A,B,D) (void *)A -#define SHORTVVVVVVV_cfT(M,I,A,B,D) (void *)A -#define PBYTE_cfT(M,I,A,B,D) A -#define PDOUBLE_cfT(M,I,A,B,D) A -#define PFLOAT_cfT(M,I,A,B,D) VOIDP A -#define PINT_cfT(M,I,A,B,D) A -#define PLOGICAL_cfT(M,I,A,B,D) ((*A=F2CLOGICAL(*A)),A) -#define PLONG_cfT(M,I,A,B,D) A -#define PSHORT_cfT(M,I,A,B,D) A -#define PVOID_cfT(M,I,A,B,D) A -#if defined(apolloFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran) -#define ROUTINE_cfT(M,I,A,B,D) _(ROUTINE_,I) (*A) -#else -#define ROUTINE_cfT(M,I,A,B,D) _(ROUTINE_,I) A -#endif -/* A == pointer to the characters - D == length of the string, or of an element in an array of strings - E == number of elements in an array of strings */ -#define TTSTR( A,B,D) \ - ((B=_cf_malloc(D+1))[D]='\0', memcpy(B,A,D), kill_trailing(B,' ')) -#define TTTTSTR( A,B,D) (!(D<4||A[0]||A[1]||A[2]||A[3]))?NULL: \ - memchr(A,'\0',D) ?A : TTSTR(A,B,D) -#define TTTTSTRV( A,B,D,E) (_(B,N)=E,B=_cf_malloc(_(B,N)*(D+1)), (void *) \ - vkill_trailing(f2cstrv(A,B,D+1, _(B,N)*(D+1)), D+1,_(B,N)*(D+1),' ')) -#ifdef vmsFortran -#define STRING_cfT(M,I,A,B,D) TTTTSTR( A->dsc$a_pointer,B,A->dsc$w_length) -#define STRINGV_cfT(M,I,A,B,D) TTTTSTRV(A->dsc$a_pointer, B, \ - A->dsc$w_length , A->dsc$l_m[0]) -#define PSTRING_cfT(M,I,A,B,D) TTSTR( A->dsc$a_pointer,B,A->dsc$w_length) -#define PPSTRING_cfT(M,I,A,B,D) A->dsc$a_pointer -#else -#ifdef CRAYFortran -#define STRING_cfT(M,I,A,B,D) TTTTSTR( _fcdtocp(A),B,_fcdlen(A)) -#define STRINGV_cfT(M,I,A,B,D) TTTTSTRV(_fcdtocp(A),B,_fcdlen(A), \ - num_elem(_fcdtocp(A),_fcdlen(A),_3(M,_STRV_A,I))) -#define PSTRING_cfT(M,I,A,B,D) TTSTR( _fcdtocp(A),B,_fcdlen(A)) -#define PPSTRING_cfT(M,I,A,B,D) _fcdtocp(A) -#else -#define STRING_cfT(M,I,A,B,D) TTTTSTR( A,B,D) -#define STRINGV_cfT(M,I,A,B,D) TTTTSTRV(A,B,D, num_elem(A,D,_3(M,_STRV_A,I))) -#define PSTRING_cfT(M,I,A,B,D) TTSTR( A,B,D) -#define PPSTRING_cfT(M,I,A,B,D) A -#endif -#endif -#define PNSTRING_cfT(M,I,A,B,D) STRING_cfT(M,I,A,B,D) -#define PSTRINGV_cfT(M,I,A,B,D) STRINGV_cfT(M,I,A,B,D) -#define CF_0_cfT(M,I,A,B,D) - -#define RCF(TN,I) _(TN,_cfSTR)(3,R,_(A,I),_(B,I),_(C,I),0,0) -#define DEFAULT_cfR(A,B,D) -#define LOGICAL_cfR(A,B,D) -#define PLOGICAL_cfR(A,B,D) *A=C2FLOGICAL(*A); -#define STRING_cfR(A,B,D) if (B) _cf_free(B); -#define STRINGV_cfR(A,B,D) _cf_free(B); -/* A and D as defined above for TSTRING(V) */ -#define RRRRPSTR( A,B,D) if (B) memcpy(A,B, _cfMIN(strlen(B),D)), \ - (D>strlen(B)?memset(A+strlen(B),' ', D-strlen(B)):0), _cf_free(B); -#define RRRRPSTRV(A,B,D) c2fstrv(B,A,D+1,(D+1)*_(B,N)), _cf_free(B); -#ifdef vmsFortran -#define PSTRING_cfR(A,B,D) RRRRPSTR( A->dsc$a_pointer,B,A->dsc$w_length) -#define PSTRINGV_cfR(A,B,D) RRRRPSTRV(A->dsc$a_pointer,B,A->dsc$w_length) -#else -#ifdef CRAYFortran -#define PSTRING_cfR(A,B,D) RRRRPSTR( _fcdtocp(A),B,_fcdlen(A)) -#define PSTRINGV_cfR(A,B,D) RRRRPSTRV(_fcdtocp(A),B,_fcdlen(A)) -#else -#define PSTRING_cfR(A,B,D) RRRRPSTR( A,B,D) -#define PSTRINGV_cfR(A,B,D) RRRRPSTRV(A,B,D) -#endif -#endif -#define PNSTRING_cfR(A,B,D) PSTRING_cfR(A,B,D) -#define PPSTRING_cfR(A,B,D) - -#define BYTE_cfFZ(UN,LN) INTEGER_BYTE FCALLSC_QUALIFIER fcallsc(UN,LN)( -#define DOUBLE_cfFZ(UN,LN) DOUBLE_PRECISION FCALLSC_QUALIFIER fcallsc(UN,LN)( -#define INT_cfFZ(UN,LN) int FCALLSC_QUALIFIER fcallsc(UN,LN)( -#define LOGICAL_cfFZ(UN,LN) int FCALLSC_QUALIFIER fcallsc(UN,LN)( -#define LONG_cfFZ(UN,LN) long FCALLSC_QUALIFIER fcallsc(UN,LN)( -#define SHORT_cfFZ(UN,LN) short FCALLSC_QUALIFIER fcallsc(UN,LN)( -#define VOID_cfFZ(UN,LN) void FCALLSC_QUALIFIER fcallsc(UN,LN)( -#ifndef __CF__KnR -/* The void is req'd by the Apollo, to make this an ANSI function declaration. - The Apollo promotes K&R float functions to double. */ -#define FLOAT_cfFZ(UN,LN) FORTRAN_REAL FCALLSC_QUALIFIER fcallsc(UN,LN)(void -#ifdef vmsFortran -#define STRING_cfFZ(UN,LN) void FCALLSC_QUALIFIER fcallsc(UN,LN)(fstring *AS -#else -#ifdef CRAYFortran -#define STRING_cfFZ(UN,LN) void FCALLSC_QUALIFIER fcallsc(UN,LN)(_fcd AS -#else -#if defined(AbsoftUNIXFortran) || defined(AbsoftProFortran) -#define STRING_cfFZ(UN,LN) void FCALLSC_QUALIFIER fcallsc(UN,LN)(char *AS -#else -#define STRING_cfFZ(UN,LN) void FCALLSC_QUALIFIER fcallsc(UN,LN)(char *AS, unsigned D0 -#endif -#endif -#endif -#else -#if ! (defined(FLOATFUNCTIONTYPE)&&defined(ASSIGNFLOAT)&&defined(RETURNFLOAT)) -#define FLOAT_cfFZ(UN,LN) FORTRAN_REAL FCALLSC_QUALIFIER fcallsc(UN,LN)( -#else -#define FLOAT_cfFZ(UN,LN) FLOATFUNCTIONTYPE FCALLSC_QUALIFIER fcallsc(UN,LN)( -#endif -#if defined(vmsFortran) || defined(CRAYFortran) || defined(AbsoftUNIXFortran) -#define STRING_cfFZ(UN,LN) void FCALLSC_QUALIFIER fcallsc(UN,LN)(AS -#else -#define STRING_cfFZ(UN,LN) void FCALLSC_QUALIFIER fcallsc(UN,LN)(AS, D0 -#endif -#endif - -#define BYTE_cfF(UN,LN) BYTE_cfFZ(UN,LN) -#define DOUBLE_cfF(UN,LN) DOUBLE_cfFZ(UN,LN) -#ifndef __CF_KnR -#define FLOAT_cfF(UN,LN) FORTRAN_REAL FCALLSC_QUALIFIER fcallsc(UN,LN)( -#else -#define FLOAT_cfF(UN,LN) FLOAT_cfFZ(UN,LN) -#endif -#define INT_cfF(UN,LN) INT_cfFZ(UN,LN) -#define LOGICAL_cfF(UN,LN) LOGICAL_cfFZ(UN,LN) -#define LONG_cfF(UN,LN) LONG_cfFZ(UN,LN) -#define SHORT_cfF(UN,LN) SHORT_cfFZ(UN,LN) -#define VOID_cfF(UN,LN) VOID_cfFZ(UN,LN) -#define STRING_cfF(UN,LN) STRING_cfFZ(UN,LN), - -#define INT_cfFF -#define VOID_cfFF -#ifdef vmsFortran -#define STRING_cfFF fstring *AS; -#else -#ifdef CRAYFortran -#define STRING_cfFF _fcd AS; -#else -#define STRING_cfFF char *AS; unsigned D0; -#endif -#endif - -#define INT_cfL A0= -#define STRING_cfL A0= -#define VOID_cfL - -#define INT_cfK -#define VOID_cfK -/* KSTRING copies the string into the position provided by the caller. */ -#ifdef vmsFortran -#define STRING_cfK \ - memcpy(AS->dsc$a_pointer,A0,_cfMIN(AS->dsc$w_length,(A0==NULL?0:strlen(A0))));\ - AS->dsc$w_length>(A0==NULL?0:strlen(A0))? \ - memset(AS->dsc$a_pointer+(A0==NULL?0:strlen(A0)),' ', \ - AS->dsc$w_length-(A0==NULL?0:strlen(A0))):0; -#else -#ifdef CRAYFortran -#define STRING_cfK \ - memcpy(_fcdtocp(AS),A0, _cfMIN(_fcdlen(AS),(A0==NULL?0:strlen(A0))) ); \ - _fcdlen(AS)>(A0==NULL?0:strlen(A0))? \ - memset(_fcdtocp(AS)+(A0==NULL?0:strlen(A0)),' ', \ - _fcdlen(AS)-(A0==NULL?0:strlen(A0))):0; -#else -#define STRING_cfK memcpy(AS,A0, _cfMIN(D0,(A0==NULL?0:strlen(A0))) ); \ - D0>(A0==NULL?0:strlen(A0))?memset(AS+(A0==NULL?0:strlen(A0)), \ - ' ', D0-(A0==NULL?0:strlen(A0))):0; -#endif -#endif - -/* Note that K.. and I.. can't be combined since K.. has to access data before -R.., in order for functions returning strings which are also passed in as -arguments to work correctly. Note that R.. frees and hence may corrupt the -string. */ -#define BYTE_cfI return A0; -#define DOUBLE_cfI return A0; -#if ! (defined(FLOATFUNCTIONTYPE)&&defined(ASSIGNFLOAT)&&defined(RETURNFLOAT)) -#define FLOAT_cfI return A0; -#else -#define FLOAT_cfI RETURNFLOAT(A0); -#endif -#define INT_cfI return A0; -#ifdef hpuxFortran800 -/* Incredibly, functions must return true as 1, elsewhere .true.==0x01000000. */ -#define LOGICAL_cfI return ((A0)?1:0); -#else -#define LOGICAL_cfI return C2FLOGICAL(A0); -#endif -#define LONG_cfI return A0; -#define SHORT_cfI return A0; -#define STRING_cfI return ; -#define VOID_cfI return ; - -#ifdef OLD_VAXC /* Allow %CC-I-PARAMNOTUSED. */ -#pragma standard -#endif - -#define FCALLSCSUB0( CN,UN,LN) FCALLSCFUN0(VOID,CN,UN,LN) -#define FCALLSCSUB1( CN,UN,LN,T1) FCALLSCFUN1(VOID,CN,UN,LN,T1) -#define FCALLSCSUB2( CN,UN,LN,T1,T2) FCALLSCFUN2(VOID,CN,UN,LN,T1,T2) -#define FCALLSCSUB3( CN,UN,LN,T1,T2,T3) FCALLSCFUN3(VOID,CN,UN,LN,T1,T2,T3) -#define FCALLSCSUB4( CN,UN,LN,T1,T2,T3,T4) \ - FCALLSCFUN4(VOID,CN,UN,LN,T1,T2,T3,T4) -#define FCALLSCSUB5( CN,UN,LN,T1,T2,T3,T4,T5) \ - FCALLSCFUN5(VOID,CN,UN,LN,T1,T2,T3,T4,T5) -#define FCALLSCSUB6( CN,UN,LN,T1,T2,T3,T4,T5,T6) \ - FCALLSCFUN6(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6) -#define FCALLSCSUB7( CN,UN,LN,T1,T2,T3,T4,T5,T6,T7) \ - FCALLSCFUN7(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7) -#define FCALLSCSUB8( CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8) \ - FCALLSCFUN8(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8) -#define FCALLSCSUB9( CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9) \ - FCALLSCFUN9(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9) -#define FCALLSCSUB10(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA) \ - FCALLSCFUN10(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA) -#define FCALLSCSUB11(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB) \ - FCALLSCFUN11(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB) -#define FCALLSCSUB12(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC) \ - FCALLSCFUN12(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC) -#define FCALLSCSUB13(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD) \ - FCALLSCFUN13(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD) -#define FCALLSCSUB14(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \ - FCALLSCFUN14(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) -#define FCALLSCSUB15(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF) \ - FCALLSCFUN15(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF) -#define FCALLSCSUB16(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG) \ - FCALLSCFUN16(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG) -#define FCALLSCSUB17(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH) \ - FCALLSCFUN17(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH) -#define FCALLSCSUB18(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI) \ - FCALLSCFUN18(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI) -#define FCALLSCSUB19(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ) \ - FCALLSCFUN19(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ) -#define FCALLSCSUB20(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \ - FCALLSCFUN20(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) -#define FCALLSCSUB21(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL) \ - FCALLSCFUN21(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL) -#define FCALLSCSUB22(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM) \ - FCALLSCFUN22(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM) -#define FCALLSCSUB23(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN) \ - FCALLSCFUN23(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN) -#define FCALLSCSUB24(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO) \ - FCALLSCFUN24(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO) -#define FCALLSCSUB25(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP) \ - FCALLSCFUN25(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP) -#define FCALLSCSUB26(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ) \ - FCALLSCFUN26(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ) -#define FCALLSCSUB27(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \ - FCALLSCFUN27(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) - - -#define FCALLSCFUN1( T0,CN,UN,LN,T1) \ - FCALLSCFUN5 (T0,CN,UN,LN,T1,CF_0,CF_0,CF_0,CF_0) -#define FCALLSCFUN2( T0,CN,UN,LN,T1,T2) \ - FCALLSCFUN5 (T0,CN,UN,LN,T1,T2,CF_0,CF_0,CF_0) -#define FCALLSCFUN3( T0,CN,UN,LN,T1,T2,T3) \ - FCALLSCFUN5 (T0,CN,UN,LN,T1,T2,T3,CF_0,CF_0) -#define FCALLSCFUN4( T0,CN,UN,LN,T1,T2,T3,T4) \ - FCALLSCFUN5 (T0,CN,UN,LN,T1,T2,T3,T4,CF_0) -#define FCALLSCFUN5( T0,CN,UN,LN,T1,T2,T3,T4,T5) \ - FCALLSCFUN10(T0,CN,UN,LN,T1,T2,T3,T4,T5,CF_0,CF_0,CF_0,CF_0,CF_0) -#define FCALLSCFUN6( T0,CN,UN,LN,T1,T2,T3,T4,T5,T6) \ - FCALLSCFUN10(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,CF_0,CF_0,CF_0,CF_0) -#define FCALLSCFUN7( T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7) \ - FCALLSCFUN10(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,CF_0,CF_0,CF_0) -#define FCALLSCFUN8( T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8) \ - FCALLSCFUN10(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,CF_0,CF_0) -#define FCALLSCFUN9( T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9) \ - FCALLSCFUN10(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,CF_0) -#define FCALLSCFUN10(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA) \ - FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,CF_0,CF_0,CF_0,CF_0) -#define FCALLSCFUN11(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB) \ - FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,CF_0,CF_0,CF_0) -#define FCALLSCFUN12(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC) \ - FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,CF_0,CF_0) -#define FCALLSCFUN13(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD) \ - FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,CF_0) - - -#define FCALLSCFUN15(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF) \ - FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,CF_0,CF_0,CF_0,CF_0,CF_0) -#define FCALLSCFUN16(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG) \ - FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,CF_0,CF_0,CF_0,CF_0) -#define FCALLSCFUN17(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH) \ - FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,CF_0,CF_0,CF_0) -#define FCALLSCFUN18(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI) \ - FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,CF_0,CF_0) -#define FCALLSCFUN19(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ) \ - FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,CF_0) -#define FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \ - FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0) -#define FCALLSCFUN21(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL) \ - FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0) -#define FCALLSCFUN22(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM) \ - FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,CF_0,CF_0,CF_0,CF_0,CF_0) -#define FCALLSCFUN23(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN) \ - FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,CF_0,CF_0,CF_0,CF_0) -#define FCALLSCFUN24(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO) \ - FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,CF_0,CF_0,CF_0) -#define FCALLSCFUN25(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP) \ - FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,CF_0,CF_0) -#define FCALLSCFUN26(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ) \ - FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,CF_0) - - -#ifndef __CF__KnR -#define FCALLSCFUN0(T0,CN,UN,LN) CFextern _(T0,_cfFZ)(UN,LN) ABSOFT_cf2(T0)) \ - {_Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0) CN(); _Icf(0,K,T0,0,0) _(T0,_cfI)} - -#define FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \ - CFextern _(T0,_cfF)(UN,LN) \ - CFARGT14(NCF,DCF,ABSOFT_cf2(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) ) \ - { CFARGT14S(QCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \ - _Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0) CN( TCF(LN,T1,1,0) TCF(LN,T2,2,1) \ - TCF(LN,T3,3,1) TCF(LN,T4,4,1) TCF(LN,T5,5,1) TCF(LN,T6,6,1) TCF(LN,T7,7,1) \ - TCF(LN,T8,8,1) TCF(LN,T9,9,1) TCF(LN,TA,10,1) TCF(LN,TB,11,1) TCF(LN,TC,12,1) \ - TCF(LN,TD,13,1) TCF(LN,TE,14,1) ); _Icf(0,K,T0,0,0) \ - CFARGT14S(RCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) _(T0,_cfI) } - -#define FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \ - CFextern _(T0,_cfF)(UN,LN) \ - CFARGT27(NCF,DCF,ABSOFT_cf2(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) ) \ - { CFARGT27S(QCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \ - _Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0) CN( TCF(LN,T1,1,0) TCF(LN,T2,2,1) \ - TCF(LN,T3,3,1) TCF(LN,T4,4,1) TCF(LN,T5,5,1) TCF(LN,T6,6,1) TCF(LN,T7,7,1) \ - TCF(LN,T8,8,1) TCF(LN,T9,9,1) TCF(LN,TA,10,1) TCF(LN,TB,11,1) TCF(LN,TC,12,1) \ - TCF(LN,TD,13,1) TCF(LN,TE,14,1) TCF(LN,TF,15,1) TCF(LN,TG,16,1) TCF(LN,TH,17,1) \ - TCF(LN,TI,18,1) TCF(LN,TJ,19,1) TCF(LN,TK,20,1) TCF(LN,TL,21,1) TCF(LN,TM,22,1) \ - TCF(LN,TN,23,1) TCF(LN,TO,24,1) TCF(LN,TP,25,1) TCF(LN,TQ,26,1) TCF(LN,TR,27,1) ); _Icf(0,K,T0,0,0) \ - CFARGT27S(RCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) _(T0,_cfI) } - -#else -#define FCALLSCFUN0(T0,CN,UN,LN) CFextern _(T0,_cfFZ)(UN,LN) ABSOFT_cf3(T0)) _Icf(0,FF,T0,0,0)\ - {_Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0) CN(); _Icf(0,K,T0,0,0) _(T0,_cfI)} - -#define FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \ - CFextern _(T0,_cfF)(UN,LN) \ - CFARGT14(NNCF,DDCF,ABSOFT_cf3(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)) _Icf(0,FF,T0,0,0) \ - CFARGT14FS(NNNCF,DDDCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE); \ - { CFARGT14S(QCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \ - _Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0) CN( TCF(LN,T1,1,0) TCF(LN,T2,2,1) \ - TCF(LN,T3,3,1) TCF(LN,T4,4,1) TCF(LN,T5,5,1) TCF(LN,T6,6,1) TCF(LN,T7,7,1) \ - TCF(LN,T8,8,1) TCF(LN,T9,9,1) TCF(LN,TA,10,1) TCF(LN,TB,11,1) TCF(LN,TC,12,1) \ - TCF(LN,TD,13,1) TCF(LN,TE,14,1) ); _Icf(0,K,T0,0,0) \ - CFARGT14S(RCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) _(T0,_cfI)} - -#define FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \ - CFextern _(T0,_cfF)(UN,LN) \ - CFARGT27(NNCF,DDCF,ABSOFT_cf3(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)) _Icf(0,FF,T0,0,0) \ - CFARGT27FS(NNNCF,DDDCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR); \ - { CFARGT27S(QCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \ - _Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0) CN( TCF(LN,T1,1,0) TCF(LN,T2,2,1) \ - TCF(LN,T3,3,1) TCF(LN,T4,4,1) TCF(LN,T5,5,1) TCF(LN,T6,6,1) TCF(LN,T7,7,1) \ - TCF(LN,T8,8,1) TCF(LN,T9,9,1) TCF(LN,TA,10,1) TCF(LN,TB,11,1) TCF(LN,TC,12,1) \ - TCF(LN,TD,13,1) TCF(LN,TE,14,1) TCF(LN,TF,15,1) TCF(LN,TG,16,1) TCF(LN,TH,17,1) \ - TCF(LN,TI,18,1) TCF(LN,TJ,19,1) TCF(LN,TK,20,1) TCF(LN,TL,21,1) TCF(LN,TM,22,1) \ - TCF(LN,TN,23,1) TCF(LN,TO,24,1) TCF(LN,TP,25,1) TCF(LN,TQ,26,1) TCF(LN,TR,27,1) ); _Icf(0,K,T0,0,0) \ - CFARGT27S(RCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) _(T0,_cfI)} - -#endif - - -#endif /* __CFORTRAN_LOADED */ diff --git a/src/cpp/include/CPPFORT/cpointer.h b/src/cpp/include/CPPFORT/cpointer.h deleted file mode 100644 index 11a12fbe6..000000000 --- a/src/cpp/include/CPPFORT/cpointer.h +++ /dev/null @@ -1,35 +0,0 @@ -/**Fortran interface - define the length of pointers - * this has to made machine independent ... - * - * @author Vogt - * @version Sep 30, 2003 - * @modif Mar 19, 2004 (PTRTYPE changed to long - 64bit compatibility - * - */ -#ifndef CPOINTER_H -#define CPOINTER_H 1 - -typedef long PTRTYPE ; -#define CFORTRANPNTR LONG -#define CFORTRANPNTRV LONGV - -#include -typedef std::vector PointerVec ; - -/** Template for casting from integers to LCIO classes - * First template is the resulting type, second argument is the original - * type that was used when the pointer was passed to fortran. - */ - -template T* f2c_pointer(PTRTYPE ptr){ - - if(! (ptr) ) return 0 ; - - O* o_ptr = reinterpret_cast( ptr ) ; - - return dynamic_cast( o_ptr ) ; -} - -#define C2F_POINTER(T,ptr) reinterpret_cast( dynamic_cast( (ptr) ) ) - -#endif diff --git a/src/cpp/include/CPPFORT/deprecation.h b/src/cpp/include/CPPFORT/deprecation.h deleted file mode 100644 index efbe85842..000000000 --- a/src/cpp/include/CPPFORT/deprecation.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef LCIO_CPPFORT_DEPRECATION_MACRO_H -#define LCIO_CPPFORT_DEPRECATION_MACRO_H - -#define LCIO_DEPRECATED_CAPI \ - [[deprecated("C-API of LCIO is deprecated and slated for removal in one of the next releases")]] - -#endif diff --git a/src/cpp/include/CPPFORT/hepevt0.h b/src/cpp/include/CPPFORT/hepevt0.h deleted file mode 100644 index 1330ab7cf..000000000 --- a/src/cpp/include/CPPFORT/hepevt0.h +++ /dev/null @@ -1,65 +0,0 @@ -// -*- C++ -*- - /**StdHep fortran interface to the COMMON /HEPEVT/ - * used for MCParticle data - * - * @author Vogt - * @version Sep 30, 2003 - */ - -/* -** Basic HEPEVT COMMON block -C ------------------------------------------------------------------ -C - integer NMXHEP - parameter (NMXHEP=4000) - common/HEPEVT/NEVHEP,NHEP,ISTHEP(NMXHEP),IDHEP(NMXHEP), - &JMOHEP(2,NMXHEP),JDAHEP(2,NMXHEP),PHEP(5,NMXHEP),VHEP(4,NMXHEP) - integer NEVHEP,NHEP,ISTHEP,IDHEP,JMOHEP,JDAHEP - double precision PHEP,VHEP - save /HEPEVT/ -C... NEVHEP - event number -C... NHEP - number of entries in this event -C... ISTHEP(..) - status code -C... IDHEP(..) - particle ID, P.D.G. standard -C... JMOHEP(1,..) - position of mother particle in list -C... JMOHEP(2,..) - position of second mother particle in list -C... JDAHEP(1,..) - position of first daughter in list -C... JDAHEP(2,..) - position of last daughter in list -C... PHEP(1,..) - x momentum in GeV/c -C... PHEP(2,..) - y momentum in GeV/c -C... PHEP(3,..) - z momentum in GeV/c -C... PHEP(4,..) - energy in GeV -C... PHEP(5,..) - mass in GeV/c**2 -C... VHEP(1,..) - x vertex position in mm -C... VHEP(2,..) - y vertex position in mm -C... VHEP(3,..) - z vertex position in mm -C... VHEP(4,..) - production time in mm/c -C -C ------------------------------------------------------------------- -C -*/ - -/* note that to avoid alignment problems, structures and common blocks - should be in the order: double precision, real, integer. -*/ - -#define NMXHEP 4000 -struct hepevt_t { -int nevhep; /* The event number */ -int nhep; /* The number of entries in this event */ -int isthep[NMXHEP]; /* The Particle id */ -int idhep[NMXHEP]; /* The particle id */ -int jmohep[NMXHEP][2]; /* The position of the mother particle */ -int jdahep[NMXHEP][2]; /* Position of the first daughter... */ -double phep[NMXHEP][5]; /* 4-Momentum, mass */ -double vhep[NMXHEP][4]; /* Vertex information */ -}; - -/* prototypes */ -extern "C" -{ -extern struct hepevt_t hepevt_; -} - -#define FTNhep hepevt_ - diff --git a/src/cpp/include/CPPFORT/hepevt1.h b/src/cpp/include/CPPFORT/hepevt1.h deleted file mode 100644 index 7460d06a0..000000000 --- a/src/cpp/include/CPPFORT/hepevt1.h +++ /dev/null @@ -1,42 +0,0 @@ -// -*- C++ -*- - /**StdHep fortran interface to the COMMON /HEPEVT1/ - * used for MCParticle pointers and charges - * - * @author Vogt - * @version Sep 30, 2003 - */ - -/* -** HEPEVT1 COMMON block for MCParticle pointers -C ------------------------------------------------------------------ -C - integer NMXHEP - parameter (NMXHEP=4000) - common /HEPEVT1/ MCPOINTERV(NMXHEP), MCCHARGEV(NMXHEP) - integer MCPOINTERV - real MCCHARGEV - save /HEPEVT1/ -C... MCPOINTERV - vector containing MCParticle pointer -C... MCCHARGEV - vector containing MCParticle charge -C -C ------------------------------------------------------------------- -C -*/ - - -#include "cpointer.h" - -#define NMXHEP 4000 -struct hepevt1_t { -PTRTYPE mcpointerv[NMXHEP]; /* The MCParticle pointer */ -float mcchargev[NMXHEP]; /* The MCParticle charge */ -}; - -/* prototypes */ -extern "C" -{ -extern struct hepevt1_t hepevt1_; -} - -#define FTNhep1 hepevt1_ - diff --git a/src/cpp/include/CPPFORT/lccah.h b/src/cpp/include/CPPFORT/lccah.h deleted file mode 100644 index 47219fa8d..000000000 --- a/src/cpp/include/CPPFORT/lccah.h +++ /dev/null @@ -1,63 +0,0 @@ -/**Header file for the f77-wrapper functions of the CalorimeterHitImpl class. - * - * @author F. Gaede - * @version Oct 11, 2003 - */ - -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - - -LCIO_DEPRECATED_CAPI PTRTYPE lccahcreate() ; -LCIO_DEPRECATED_CAPI int lccahdelete( PTRTYPE calhit ) ; -LCIO_DEPRECATED_CAPI int lccahid( PTRTYPE calhit ) ; - -LCIO_DEPRECATED_CAPI int lccahgetcellid0( PTRTYPE calhit ) ; -LCIO_DEPRECATED_CAPI int lccahgetcellid1( PTRTYPE calhit ) ; -LCIO_DEPRECATED_CAPI float lccahgetenergy( PTRTYPE calhit ) ; -LCIO_DEPRECATED_CAPI float lccahgetenergyerr( PTRTYPE calhit ) ; -LCIO_DEPRECATED_CAPI float lccahgettime( PTRTYPE calhit ) ; -LCIO_DEPRECATED_CAPI int lccahgetposition( PTRTYPE calhit, float * ) ; -LCIO_DEPRECATED_CAPI int lccahgettype( PTRTYPE calhit ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lccahgetrawhit( PTRTYPE calhit ) ; - -LCIO_DEPRECATED_CAPI int lccahsetcellid0( PTRTYPE calhit, int id0) ; -LCIO_DEPRECATED_CAPI int lccahsetcellid1( PTRTYPE calhit, int id1) ; -LCIO_DEPRECATED_CAPI int lccahsetenergy( PTRTYPE calhit, float en) ; -LCIO_DEPRECATED_CAPI int lccahsetenergyerr( PTRTYPE calhit, float enerr) ; -LCIO_DEPRECATED_CAPI int lccahsettime( PTRTYPE calhit, float time) ; -LCIO_DEPRECATED_CAPI int lccahsetposition( PTRTYPE calhit, float pos[3]) ; -LCIO_DEPRECATED_CAPI int lccahsettype( PTRTYPE calhit, int type ) ; -LCIO_DEPRECATED_CAPI int lccahsetrawhit( PTRTYPE calhit, PTRTYPE rawHit ) ; - -// now the fortran wrappers from cfortran.h -extern "C"{ -FCALLSCFUN0(CFORTRANPNTR, lccahcreate,LCCAHCREATE, lccahcreate ) -FCALLSCFUN1(INT, lccahdelete, LCCAHDELETE, lccahdelete, CFORTRANPNTR ) -FCALLSCFUN1(INT, lccahid, LCCAHID, lccahid, CFORTRANPNTR ) - -FCALLSCFUN1(INT, lccahgetcellid0, LCCAHGETCELLID0, lccahgetcellid0, CFORTRANPNTR ) -FCALLSCFUN1(INT, lccahgetcellid1, LCCAHGETCELLID1, lccahgetcellid1, CFORTRANPNTR ) -FCALLSCFUN1(FLOAT, lccahgetenergy, LCCAHGETENERGY, lccahgetenergy, CFORTRANPNTR ) -FCALLSCFUN1(FLOAT, lccahgetenergyerr, LCCAHGETENERGYERR, lccahgetenergyerr, CFORTRANPNTR ) -FCALLSCFUN1(FLOAT, lccahgettime, LCCAHGETTIME, lccahgettime, CFORTRANPNTR ) -FCALLSCFUN2(INT, lccahgetposition,LCCAHGETPOSITION,lccahgetposition, CFORTRANPNTR, FLOATV ) -FCALLSCFUN1(INT, lccahgettype, LCCAHGETTYPE, lccahgettype, CFORTRANPNTR ) - -FCALLSCFUN1(CFORTRANPNTR, lccahgetrawhit, LCCAHGETRAWHIT, lccahgetrawhit, CFORTRANPNTR ) - -FCALLSCFUN2(INT, lccahsetcellid0,LCCAHSETCELLID0,lccahsetcellid0, CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lccahsetcellid1,LCCAHSETCELLID1,lccahsetcellid1, CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lccahsetenergy,LCCAHSETENERGY,lccahsetenergy, CFORTRANPNTR, FLOAT ) -FCALLSCFUN2(INT, lccahsetenergyerr,LCCAHSETENERGYERR,lccahsetenergyerr, CFORTRANPNTR, FLOAT ) -FCALLSCFUN2(INT, lccahsettime,LCCAHSETTIME,lccahsettime, CFORTRANPNTR, FLOAT ) -FCALLSCFUN2(INT, lccahsetposition,LCCAHSETPOSITION,lccahsetposition, CFORTRANPNTR, FLOATV ) -FCALLSCFUN2(INT, lccahsettype, LCCAHSETTYPE, lccahsettype, CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lccahsetrawhit, LCCAHSETRAWHIT, lccahsetrawhit, CFORTRANPNTR, INT ) -} - diff --git a/src/cpp/include/CPPFORT/lcclu.h b/src/cpp/include/CPPFORT/lcclu.h deleted file mode 100644 index 1747423df..000000000 --- a/src/cpp/include/CPPFORT/lcclu.h +++ /dev/null @@ -1,100 +0,0 @@ -/**Header file for the f77-wrapper functions of the Cluster Class. - * - * @author H. Vogt - * @version May 10, 2004 - */ -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - -LCIO_DEPRECATED_CAPI PTRTYPE lcclucreate() ; -LCIO_DEPRECATED_CAPI int lccludelete( PTRTYPE clu ) ; - -LCIO_DEPRECATED_CAPI int lccluid( PTRTYPE clu ) ; -LCIO_DEPRECATED_CAPI int lcclugettype( PTRTYPE clu ) ; -// int lcclutesttype( PTRTYPE clu , int bit ) ; - -LCIO_DEPRECATED_CAPI float lcclugetenergy( PTRTYPE clu ) ; -LCIO_DEPRECATED_CAPI float lcclugetenergyerr( PTRTYPE clu ) ; -LCIO_DEPRECATED_CAPI int lcclugetposition( PTRTYPE clu, float* pos ) ; -LCIO_DEPRECATED_CAPI int lcclugetpositionerror( PTRTYPE clu, float* poserr ) ; -LCIO_DEPRECATED_CAPI float lcclugetitheta( PTRTYPE clu ) ; -LCIO_DEPRECATED_CAPI float lcclugetiphi( PTRTYPE clu ) ; -LCIO_DEPRECATED_CAPI int lcclugetdirectionerror( PTRTYPE clu, float* direrr ) ; - -// int lcclugetshape( PTRTYPE clu, float* shape ) ; -// int lcclugetparticletype( PTRTYPE clu, float* weights) ; - -LCIO_DEPRECATED_CAPI PTRTYPE lcclugetshape( PTRTYPE clu ) ; - -LCIO_DEPRECATED_CAPI PTRTYPE lcclugetparticleids( PTRTYPE clu ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcclugetclusters( PTRTYPE clu ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcclugetcalorimeterhits( PTRTYPE clu ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcclugetsubdetectorenergies( PTRTYPE clu ) ; - -LCIO_DEPRECATED_CAPI int lcclusettypebit( PTRTYPE clu, int index, int val ) ; -LCIO_DEPRECATED_CAPI int lcclusetenergy( PTRTYPE clu, float energy ) ; -LCIO_DEPRECATED_CAPI int lcclusetenergyerr( PTRTYPE clu, float enerr ) ; -LCIO_DEPRECATED_CAPI int lcclusetposition( PTRTYPE clu, float* refpoint ) ; -LCIO_DEPRECATED_CAPI int lcclusetpositionerror( PTRTYPE clu, float* poserr ) ; -LCIO_DEPRECATED_CAPI int lcclusetitheta( PTRTYPE clu, float theta ) ; -LCIO_DEPRECATED_CAPI int lcclusetiphi( PTRTYPE clu, float phi ) ; -LCIO_DEPRECATED_CAPI int lcclusetdirectionerror( PTRTYPE clu, float* direrr ) ; -LCIO_DEPRECATED_CAPI int lcclusetshape( PTRTYPE clu, PTRTYPE pshapevec ) ; -LCIO_DEPRECATED_CAPI int lccluaddparticleid( PTRTYPE clu, PTRTYPE pid ) ; -LCIO_DEPRECATED_CAPI int lccluaddcluster( PTRTYPE clu, PTRTYPE clus ) ; -LCIO_DEPRECATED_CAPI int lccluaddhit( PTRTYPE clu, PTRTYPE calohit, float weigth ) ; - -// fg: these methods have no direct correspondence in the C++ API as there the vector is manipulated -// directly through the interface -LCIO_DEPRECATED_CAPI int lcclugethitcontributions( PTRTYPE clu, float* ener, int* nener ) ; -LCIO_DEPRECATED_CAPI int lcclusetsubdetectorenergies( PTRTYPE cluster, float* floatv, const int nfloatv ) ; - -// now the fortran wrappers from cfortran.h -extern "C"{ - -FCALLSCFUN0(CFORTRANPNTR, lcclucreate, LCCLUCREATE, lcclucreate ) -FCALLSCFUN1(INT, lccludelete, LCCLUDELETE, lccludelete, CFORTRANPNTR ) - -FCALLSCFUN1(INT, lccluid, LCCLUID, lccluid, CFORTRANPNTR) -FCALLSCFUN1(INT, lcclugettype, LCCLUGETTYPE, lcclugettype, CFORTRANPNTR) -// FCALLSCFUN2(INT, lcclutesttype, LCCLUTESTTYPE,lcclutesttype, CFORTRANPNTR, INT ) -FCALLSCFUN1(FLOAT, lcclugetenergy, LCCLUGETENERGY, lcclugetenergy, CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lcclugetenergyerr, LCCLUGETENERGYERR, lcclugetenergyerr, CFORTRANPNTR) -FCALLSCFUN2(INT, lcclugetposition, LCCLUGETPOSITION, lcclugetposition, CFORTRANPNTR, FLOATV) -FCALLSCFUN2(INT, lcclugetpositionerror, LCCLUGETPOSITIONERROR, lcclugetpositionerror, CFORTRANPNTR, FLOATV) -FCALLSCFUN1(FLOAT, lcclugetitheta, LCCLUGETITHETA, lcclugetitheta, CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lcclugetiphi, LCCLUGETIPHI, lcclugetiphi, CFORTRANPNTR) -FCALLSCFUN2(INT, lcclugetdirectionerror, LCCLUGETDIRECTIONERROR, lcclugetdirectionerror, CFORTRANPNTR, FLOATV) -FCALLSCFUN1(CFORTRANPNTR, lcclugetshape, LCCLUGETSHAPE, lcclugetshape, CFORTRANPNTR ) -FCALLSCFUN1(CFORTRANPNTR, lcclugetparticleids, LCCLUGETPARTICLEIDS, lcclugetparticleids, CFORTRANPNTR ) - -FCALLSCFUN1(CFORTRANPNTR, lcclugetclusters, LCCLUGETCLUSTERS, lcclugetclusters, CFORTRANPNTR) -FCALLSCFUN1(CFORTRANPNTR, lcclugetcalorimeterhits, LCCLUGETCALORIMETERHITS, lcclugetcalorimeterhits, CFORTRANPNTR) -FCALLSCFUN1(CFORTRANPNTR, lcclugetsubdetectorenergies, LCCLUGETSUBDETECTORENERGIES, lcclugetsubdetectorenergies, CFORTRANPNTR) -FCALLSCFUN3(INT, lcclugethitcontributions, LCCLUGETHITCONTRIBUTIONS, lcclugethitcontributions, CFORTRANPNTR, FLOATV, INTV) - -FCALLSCFUN3(INT, lcclusettypebit, LCCLUSETTYPEBIT, lcclusettypebit, CFORTRANPNTR, INT, INT) -FCALLSCFUN2(INT, lcclusetenergy, LCCLUSETENERGY, lcclusetenergy, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lcclusetenergyerr, LCCLUSETENERGYERR, lcclusetenergyerr, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lcclusetposition, LCCLUSETPOSITION, lcclusetposition, CFORTRANPNTR, FLOATV) -FCALLSCFUN2(INT, lcclusetpositionerror, LCCLUSETPOSITIONERROR, lcclusetpositionerror, CFORTRANPNTR, FLOATV) -FCALLSCFUN2(INT, lcclusetitheta, LCCLUSETITHETA, lcclusetitheta, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lcclusetiphi, LCCLUSETIPHI, lcclusetiphi, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lcclusetdirectionerror, LCCLUSETDIRECTIONERROR, lcclusetdirectionerror, CFORTRANPNTR, FLOATV) -FCALLSCFUN2(INT, lcclusetshape, LCCLUSETSHAPE, lcclusetshape, CFORTRANPNTR, CFORTRANPNTR ) -// FCALLSCFUN2(INT, lcclusetemweight, LCCLUSETEMWEIGHT, lcclusetemweight, CFORTRANPNTR, FLOAT) -// FCALLSCFUN2(INT, lcclusethadweight, LCCLUSETHADWEIGHT, lcclusethadweight, CFORTRANPNTR, FLOAT) -// FCALLSCFUN2(INT, lcclusetmuonweight, LCCLUSETMUONWEIGHT, lcclusetmuonweight, CFORTRANPNTR, FLOAT) - -FCALLSCFUN2(INT, lccluaddparticleid, LCCLUADDPARTICLEID, lccluaddparticleid, CFORTRANPNTR, CFORTRANPNTR) -FCALLSCFUN2(INT, lccluaddcluster, LCCLUADDCLUSTER, lccluaddcluster, CFORTRANPNTR, CFORTRANPNTR) -FCALLSCFUN3(INT, lccluaddhit, LCCLUADDHIT, lccluaddhit, CFORTRANPNTR, CFORTRANPNTR, FLOAT) -FCALLSCFUN3(INT, lcclusetsubdetectorenergies, LCCLUSETSUBDETECTORENERGIES, lcclusetsubdetectorenergies, CFORTRANPNTR, FLOATV, INT ) - -} - diff --git a/src/cpp/include/CPPFORT/lccol.h b/src/cpp/include/CPPFORT/lccol.h deleted file mode 100644 index 947b57af8..000000000 --- a/src/cpp/include/CPPFORT/lccol.h +++ /dev/null @@ -1,55 +0,0 @@ -/**Header file for the f77-wrapper functions of the LCCollectionVec class. - * - * @author F. Gaede - * @version Oct 10, 2003 - */ -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - -// the collection interface -LCIO_DEPRECATED_CAPI PTRTYPE lccolcreate( const char* colname ) ; -LCIO_DEPRECATED_CAPI int lccoldelete( PTRTYPE collection ) ; - -LCIO_DEPRECATED_CAPI int lccolgetnumberofelements( PTRTYPE collection ) ; -LCIO_DEPRECATED_CAPI char* lccolgettypename( PTRTYPE collection ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lccolgetelementat( PTRTYPE collection, int index ) ; -LCIO_DEPRECATED_CAPI int lccolgetflag(PTRTYPE collection) ; - -LCIO_DEPRECATED_CAPI bool lccolistransient(PTRTYPE collection) ; -LCIO_DEPRECATED_CAPI int lccolsettransient(PTRTYPE collection, bool value) ; - -LCIO_DEPRECATED_CAPI bool lccolisdefault(PTRTYPE collection) ; -LCIO_DEPRECATED_CAPI int lccolsetdefault(PTRTYPE collection, bool value) ; - -LCIO_DEPRECATED_CAPI int lccolsetflag(PTRTYPE collection, int flag) ; -LCIO_DEPRECATED_CAPI int lccoladdelement(PTRTYPE collection, PTRTYPE object) ; -LCIO_DEPRECATED_CAPI int lccolremoveelementat(PTRTYPE collection, int i) ; - -// now the fortran wrappers from cfortran.h -extern "C"{ -FCALLSCFUN1(CFORTRANPNTR, lccolcreate, LCCOLCREATE, lccolcreate, STRING ) -FCALLSCFUN1(INT, lccoldelete, LCCOLDELETE, lccoldelete, CFORTRANPNTR ) - -FCALLSCFUN1(INT, lccolgetnumberofelements,LCCOLGETNUMBEROFELEMENTS,lccolgetnumberofelements,CFORTRANPNTR) -FCALLSCFUN1(STRING, lccolgettypename, LCCOLGETTYPENAME, lccolgettypename, CFORTRANPNTR ) -FCALLSCFUN2(CFORTRANPNTR, lccolgetelementat, LCCOLGETELEMENTAT, lccolgetelementat, CFORTRANPNTR, INT ) -FCALLSCFUN1(INT, lccolgetflag, LCCOLGETFLAG, lccolgetflag, CFORTRANPNTR ) - -FCALLSCFUN1(LOGICAL, lccolistransient, LCCOLISTRANSIENT, lccolistransient, CFORTRANPNTR ) -FCALLSCFUN2(INT, lccolsettransient, LCCOLSETTRANSIENT, lccolsettransient, CFORTRANPNTR, LOGICAL ) - -FCALLSCFUN1(LOGICAL, lccolisdefault, LCCOLISDEFAULT, lccolisdefault, CFORTRANPNTR ) -FCALLSCFUN2(INT, lccolsetdefault, LCCOLSETDEFAULT, lccolsetdefault, CFORTRANPNTR, LOGICAL ) - -FCALLSCFUN2(INT, lccolsetflag, LCCOLSETFLAG, lccolsetflag, CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lccoladdelement, LCCOLADDELEMENT, lccoladdelement, CFORTRANPNTR, CFORTRANPNTR ) -FCALLSCFUN2(INT, lccolremoveelementat, LCCOLREMOVEELEMENTAT, lccolremoveelementat, CFORTRANPNTR, INT ) - - -} - diff --git a/src/cpp/include/CPPFORT/lcevt.h b/src/cpp/include/CPPFORT/lcevt.h deleted file mode 100644 index eff5f4cd7..000000000 --- a/src/cpp/include/CPPFORT/lcevt.h +++ /dev/null @@ -1,66 +0,0 @@ - -/**Header file for the f77-wrapper functions of the LCEventImpl class. - * - * @author F. Gaede - * @version Oct 10, 2003 - */ - -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - -// the event interface -LCIO_DEPRECATED_CAPI PTRTYPE lcevtcreate() ; -LCIO_DEPRECATED_CAPI int lcevtdelete( PTRTYPE event ) ; - -LCIO_DEPRECATED_CAPI int lcevtgetrunnumber( PTRTYPE event ) ; -LCIO_DEPRECATED_CAPI int lcevtgeteventnumber( PTRTYPE event ) ; -LCIO_DEPRECATED_CAPI char* lcevtgetdetectorname( PTRTYPE event ); - -LCIO_DEPRECATED_CAPI long lcevtgettimestamp( PTRTYPE event ) ; - -LCIO_DEPRECATED_CAPI PTRTYPE lcevtgetcollectionnames( PTRTYPE event ) ; -// PTRTYPE lcevtgettrelationnames( PTRTYPE event ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcevtgetcollection( PTRTYPE event, const char* colname ) ; -// PTRTYPE lcevtgetrelation( PTRTYPE event, const char* name ) ; - -LCIO_DEPRECATED_CAPI int lcevtaddcollection( PTRTYPE event, PTRTYPE collection , char* colname ) ; -LCIO_DEPRECATED_CAPI int lcevtremovecollection( PTRTYPE event, char* name ) ; -// int lcevtaddrelation( PTRTYPE event, PTRTYPE relation, char* name ) ; -// int lcevtremoverelation( PTRTYPE event, const char* name ) ; - -LCIO_DEPRECATED_CAPI int lcevtsetrunnumber( PTRTYPE event, int rn ) ; -LCIO_DEPRECATED_CAPI int lcevtseteventnumber( PTRTYPE event, int en ) ; -LCIO_DEPRECATED_CAPI int lcevtsetdetectorname( PTRTYPE event, char* dn ) ; -LCIO_DEPRECATED_CAPI int lcevtsettimestamp( PTRTYPE event, long ts ) ; - -// now the fortran wrappers from cfortran.h -extern "C"{ - -FCALLSCFUN0(CFORTRANPNTR, lcevtcreate,LCEVTCREATE, lcevtcreate ) -FCALLSCFUN1(INT, lcevtdelete, LCEVTDELETE, lcevtdelete, CFORTRANPNTR ) - -FCALLSCFUN1(INT, lcevtgetrunnumber, LCEVTGETRUNNUMBER,lcevtgetrunnumber, CFORTRANPNTR ) -FCALLSCFUN1(INT, lcevtgeteventnumber, LCEVTGETEVENTNUMBER,lcevtgeteventnumber, CFORTRANPNTR ) -FCALLSCFUN1(STRING, lcevtgetdetectorname, LCEVTGETDETECTORNAME, lcevtgetdetectorname, CFORTRANPNTR ) -FCALLSCFUN1(LONG, lcevtgettimestamp, LCEVTGETTIMESTAMP,lcevtgettimestamp, CFORTRANPNTR ) -FCALLSCFUN1(CFORTRANPNTR, lcevtgetcollectionnames, LCEVTGETCOLLECTIONNAMES, lcevtgetcollectionnames, CFORTRANPNTR ) -// FCALLSCFUN1(CFORTRANPNTR, lcevtgettrelationnames, LCEVTGETTRELATIONNAMES, lcevtgettrelationnames, CFORTRANPNTR ) -FCALLSCFUN2(CFORTRANPNTR, lcevtgetcollection, LCEVTGETCOLLECTION, lcevtgetcollection, CFORTRANPNTR, STRING ) -// FCALLSCFUN2(CFORTRANPNTR, lcevtgetrelation, LCEVTGETRELATION, lcevtgetrelation, CFORTRANPNTR, STRING ) - -FCALLSCFUN3(INT, lcevtaddcollection,LCEVTADDCOLLECTION,lcevtaddcollection,CFORTRANPNTR, CFORTRANPNTR, STRING ) -FCALLSCFUN2(INT, lcevtremovecollection, LCEVTREMOVECOLLECTION, lcevtremovecollection, CFORTRANPNTR, STRING ) -// FCALLSCFUN3(INT, lcevtaddrelation, LCEVTADDRELATION, lcevtaddrelation, CFORTRANPNTR, CFORTRANPNTR, STRING ) -// FCALLSCFUN2(INT, lcevtremoverelation, LCEVTREMOVERELATION, lcevtremoverelation, CFORTRANPNTR,STRING ) - -FCALLSCFUN2(INT, lcevtsetrunnumber, LCEVTSETRUNNUMBER, lcevtsetrunnumber, CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lcevtseteventnumber, LCEVTSETEVENTNUMBER, lcevtseteventnumber, CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lcevtsetdetectorname, LCEVTSETDETECTORNAME, lcevtsetdetectorname, CFORTRANPNTR, STRING ) -FCALLSCFUN2(INT, lcevtsettimestamp, LCEVTSETTIMESTAMP, lcevtsettimestamp, CFORTRANPNTR, LONG ) -} - diff --git a/src/cpp/include/CPPFORT/lcgob.h b/src/cpp/include/CPPFORT/lcgob.h deleted file mode 100644 index 06a7f5281..000000000 --- a/src/cpp/include/CPPFORT/lcgob.h +++ /dev/null @@ -1,57 +0,0 @@ -/**Header file for the f77-wrapper functions of the LCGenericObject class. - * - * @author H. Vogte - * @version Sep 15, 2004 - */ -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - -// the genericobject interface -LCIO_DEPRECATED_CAPI PTRTYPE lcgobcreate() ; -LCIO_DEPRECATED_CAPI PTRTYPE lcgobcreatefixed( int nint, int nfloat, int ndouble ) ; -LCIO_DEPRECATED_CAPI int lcgobdelete( PTRTYPE genericobject ) ; - -LCIO_DEPRECATED_CAPI int lcgobid( PTRTYPE genericobject ) ; -LCIO_DEPRECATED_CAPI int lcgobgetnint( PTRTYPE genericobject ) ; -LCIO_DEPRECATED_CAPI int lcgobgetnfloat( PTRTYPE genericobject ) ; -LCIO_DEPRECATED_CAPI int lcgobgetndouble( PTRTYPE genericobject ) ; -LCIO_DEPRECATED_CAPI int lcgobgetintval( PTRTYPE genericobject, int index ) ; -LCIO_DEPRECATED_CAPI float lcgobgetfloatval( PTRTYPE genericobject, int index ) ; -LCIO_DEPRECATED_CAPI double lcgobgetdoubleval( PTRTYPE genericobject, int index ) ; - -LCIO_DEPRECATED_CAPI int lcgobsetintval( PTRTYPE genericobject, int index, int value) ; -LCIO_DEPRECATED_CAPI int lcgobsetfloatval( PTRTYPE genericobject, int index, float value) ; -LCIO_DEPRECATED_CAPI int lcgobsetdoubleval( PTRTYPE genericobject, int index, double value) ; - -LCIO_DEPRECATED_CAPI bool lcgobisfixedsize(PTRTYPE genericobject) ; -LCIO_DEPRECATED_CAPI char* lcgobgettypename(PTRTYPE genericobject) ; -LCIO_DEPRECATED_CAPI char* lcgobgetdatadescription(PTRTYPE genericobject) ; - -// now the fortran wrappers from cfortran.h -extern "C"{ -FCALLSCFUN0(CFORTRANPNTR, lcgobcreate, LCGOBCREATE, lcgobcreate ) -FCALLSCFUN3(CFORTRANPNTR, lcgobcreatefixed, LCGOBCREATEFIXED, lcgobcreatefixed, INT, INT, INT ) -FCALLSCFUN1(INT, lcgobdelete, LCGOBDELETE, lcgobdelete, CFORTRANPNTR ) - -FCALLSCFUN1(INT, lcgobid, LCGOBID, lcgobid, CFORTRANPNTR ) -FCALLSCFUN1(INT, lcgobgetnint, LCGOBGETNINT, lcgobgetnint, CFORTRANPNTR ) -FCALLSCFUN1(INT, lcgobgetnfloat, LCGOBGETNFLOAT, lcgobgetnfloat, CFORTRANPNTR ) -FCALLSCFUN1(INT, lcgobgetndouble, LCGOBGETNDOUBLE, lcgobgetndouble, CFORTRANPNTR ) -FCALLSCFUN2(INT, lcgobgetintval, LCGOBGETINTVAL, lcgobgetintval, CFORTRANPNTR, INT ) -FCALLSCFUN2(FLOAT, lcgobgetfloatval, LCGOBGETFLOATVAL, lcgobgetfloatval, CFORTRANPNTR, INT ) -FCALLSCFUN2(DOUBLE, lcgobgetdoubleval, LCGOBGETDOUBLEVAL, lcgobgetdoubleval, CFORTRANPNTR, INT ) - -FCALLSCFUN3(INT, lcgobsetintval, LCGOBSETINTVAL, lcgobsetintval, CFORTRANPNTR, INT, INT ) -FCALLSCFUN3(INT, lcgobsetfloatval, LCGOBSETFLOATVAL, lcgobsetfloatval, CFORTRANPNTR, INT, FLOAT ) -FCALLSCFUN3(INT, lcgobsetdoubleval, LCGOBSETDOUBLEVAL, lcgobsetdoubleval, CFORTRANPNTR, INT, DOUBLE ) - -FCALLSCFUN1(LOGICAL, lcgobisfixedsize, LCGOBISFIXEDSIZE, lcgobisfixedsize, CFORTRANPNTR ) -FCALLSCFUN1(STRING, lcgobgettypename, LCGOBGETTYPENAME, lcgobgettypename, CFORTRANPNTR ) -FCALLSCFUN1(STRING, lcgobgetdatadescription, LCGOBGETDATADESCRIPTION, lcgobgetdatadescription, CFORTRANPNTR ) -} - diff --git a/src/cpp/include/CPPFORT/lciof77apiext.h b/src/cpp/include/CPPFORT/lciof77apiext.h deleted file mode 100644 index cdb4f27cb..000000000 --- a/src/cpp/include/CPPFORT/lciof77apiext.h +++ /dev/null @@ -1,297 +0,0 @@ -/**Header file for additional f77-wrapper functions. - * These functions add some convenient methods to the low level interface. - * Typically they allow to access all of the data of a particular object with - * one call. - * - * @modified by F.Gaede (combined convenient api in one file and renamed some functions) - * - * @author H. Vogt - * @version Sep 30, 2003 - * @modif Mar 19, 2004 (PTRTYPE consistency) - * - */ - -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -//--------------- convenient method to open a list of files for reading (read-only) - -/**Opens a list of files for reading (read-only). - */ -LCIO_DEPRECATED_CAPI int lcrdropenchain( PTRTYPE reader, void* filenamesv, const int nfiles, const int nchfilename ); - -//--------------- convenient methods to read/write the run header - -/**Write a run header to the specified writer with the given data. - */ -LCIO_DEPRECATED_CAPI int lcwriterunheader( PTRTYPE writer, const int irun, const char* detname, const char* descr, - void* sdnamevec, const int nsubd, const int nchsubd) ; - -/**Read the next run header and fills the return arguments with the data. - */ -LCIO_DEPRECATED_CAPI PTRTYPE lcreadnextrunheader( PTRTYPE reader, int* irun, void* detname, void* descr, - void* sdnamevec, int* nsubd, const int nchsubd) ; - -//--------------- convenient methods for the event interface - -/**Set the complete event header data in the event. - */ -LCIO_DEPRECATED_CAPI int lcseteventheader( PTRTYPE event, const int irun, const int ievent, - const int timestamp, const char* detname ); - -/**Read the complete event header data from the event. - */ -LCIO_DEPRECATED_CAPI int lcgeteventheader( PTRTYPE event, int* irun, int* ievent, int* timestamp, void* detname ); - -/**Dump the run header to the stdout - */ -LCIO_DEPRECATED_CAPI int lcdumprunheader( PTRTYPE runheader ) ; - -/**Dump the event to the stdout - one line per collection. - */ -LCIO_DEPRECATED_CAPI int lcdumpevent( PTRTYPE event ) ; - -/**Detailed dump of all the data in the event to stdout. - */ -LCIO_DEPRECATED_CAPI int lcdumpeventdetailed( PTRTYPE event ) ; - -//--------------- convenient methods for the mcparticle interface - - -/**Return all the data of the specified MCParticle in the arguments. - */ -LCIO_DEPRECATED_CAPI int lcgetmcparticledata( PTRTYPE mcparticle, int* pdg, int* genstatus, int* simstatus - , double* prodvtx, float* momentum, float* mass, float* charge, - int* ndaughters ) ; - - -/**Fill the hepevt common block with the MCParicle data in the LCIO event. - */ -LCIO_DEPRECATED_CAPI int lcio2hepevt( PTRTYPE event ) ; - -/**Create an MCParticle collection from the hepevt common block and add it to the event. - */ -LCIO_DEPRECATED_CAPI int hepevt2lcio( PTRTYPE event ) ; - - - -//--------------- convenient methods for SimTrackerHits - -/**Add a new SimTrackerHit with the given data to the collection. - */ -LCIO_DEPRECATED_CAPI int lcaddsimtrackerhit( PTRTYPE col, int cellID, double* pos, float dEdx, - float time, PTRTYPE mcp ) ; - -/**Return all the data from the specified SimTrackerHit in the arguments. - */ -LCIO_DEPRECATED_CAPI int lcgetsimtrackerhit( PTRTYPE col, int i, int* cellID, double* pos, float* dEdx, - float* time, PTRTYPE* mcp ) ; - - -//--------------- convenient methods for SimCalorimeterHits - -/**Add a new SimCalorimeterHit with the given data to the collection. - * Returns a pointer the new hit. - */ -LCIO_DEPRECATED_CAPI PTRTYPE lcaddsimcalohit( PTRTYPE col, int cellID0, int cellID1, float energy, float* pos ) ; - -/**Return the data of the specified SimCalorimeterHit in the arguments. - */ -LCIO_DEPRECATED_CAPI PTRTYPE lcgetsimcalohit( PTRTYPE col, int i, int* cellID0, int* cellID1, float* energy, - float* pos ) ; - -/**Return the specified contribution of a MCParticle to the hit in the arguments. - */ -LCIO_DEPRECATED_CAPI int lcgetsimcalohitmccont( PTRTYPE hit, int i, PTRTYPE* mcp, float* energy, float* time, - int* pdg ) ; - - -/**Create an object vector -*/ -LCIO_DEPRECATED_CAPI PTRTYPE lcobjectvectorcreate( PTRTYPE* ocjectv, const int nobjv ) ; - -/**Create an LC int vector -*/ -LCIO_DEPRECATED_CAPI PTRTYPE lcintvectorcreate( int* intv, const int nintv ) ; - -/**Create a LC float vector -*/ -LCIO_DEPRECATED_CAPI PTRTYPE lcfloatvectorcreate( float* floatv, const int nfloatv ) ; - -/**Create a LC string vector -*/ -LCIO_DEPRECATED_CAPI PTRTYPE lcstringvectorcreate( void* stringv, const int nstringv, const int nchstringv) ; - -/**Return the content of a LC int vector -*/ -LCIO_DEPRECATED_CAPI int lcgetintvector( PTRTYPE vector, int* intv, int* nintv ) ; - -/**Return the content of a LC float vector -*/ -LCIO_DEPRECATED_CAPI int lcgetfloatvector( PTRTYPE vector, float* floatv, int* nfloatv ) ; - -/**Return the content of a LC string vector -*/ -LCIO_DEPRECATED_CAPI int lcgetstringvector( PTRTYPE vector, void* stringv, int* nstringv, const int nchstringv) ; - - -/**Create/Delete an int vector -*/ -LCIO_DEPRECATED_CAPI PTRTYPE intvectorcreate( int* intv, const int nintv ) ; -LCIO_DEPRECATED_CAPI int intvectordelete( PTRTYPE vector ) ; - -/**Create/Delete a float vector -*/ -LCIO_DEPRECATED_CAPI PTRTYPE floatvectorcreate( float* floatv, const int nfloatv ) ; -LCIO_DEPRECATED_CAPI int floatvectordelete( PTRTYPE vector ) ; - -/**Create/Delete a string vector -*/ -LCIO_DEPRECATED_CAPI PTRTYPE stringvectorcreate( void* stringv, const int nstringv, const int nchstringv) ; -LCIO_DEPRECATED_CAPI int stringvectordelete( PTRTYPE vector ) ; - -/**Create/Delete a pointer vector -*/ -LCIO_DEPRECATED_CAPI PTRTYPE pointervectorcreate( PTRTYPE* pointerv, const int npointerv ) ; -LCIO_DEPRECATED_CAPI int pointervectordelete( PTRTYPE vector ) ; - - -/**Return the content of an int vector -*/ -LCIO_DEPRECATED_CAPI int getintvector( PTRTYPE vector, int* intv, int* nintv ) ; - -/**Return the content of a float vector -*/ -LCIO_DEPRECATED_CAPI int getfloatvector( PTRTYPE vector, float* floatv, int* nfloatv ) ; - -/**Return the content of a string vector -*/ -LCIO_DEPRECATED_CAPI int getstringvector( PTRTYPE vector, void* stringv, int* nstringv, const int nchstringv) ; - -/**Return the content of a pointer vector -*/ -LCIO_DEPRECATED_CAPI int getpointervector( PTRTYPE vector, PTRTYPE* pointerv, int* npointerv ) ; - - - -//--------------- convenient methods for the interface nterface to store generic named parameters -//--------------- of type int, float and string. - -/**For the set methods: -*/ -LCIO_DEPRECATED_CAPI int lcsetparameters( const char* classname, PTRTYPE classp, const char* method, - const char* key, PTRTYPE vecp) ; - - -/**For the get methods: -*/ -LCIO_DEPRECATED_CAPI int lcgetparameters( const char* classname, PTRTYPE classp, const char* method, - const char* key, PTRTYPE vecp) ; - - -// now the fortran wrappers from cfortran.h -extern "C"{ - -#define lcrdropenchain_STRV_A2 NUM_ELEM_ARG(3) -FCALLSCFUN4(INT, lcrdropenchain, LCRDRDOPENCHAIN, lcrdropenchain, - CFORTRANPNTR, STRINGV, INT, INT) - - -#define lcwriterunheader_STRV_A5 NUM_ELEM_ARG(6) -FCALLSCFUN7(INT, lcwriterunheader, LCWRITERUNHEADER, lcwriterunheader, CFORTRANPNTR, INT, - STRING, STRING, STRINGV, INT, INT) -#define lcreadnextrunheader_STRV_A3 NUM_ELEMS(1) -#define lcreadnextrunheader_STRV_A4 NUM_ELEMS(1) -#define lcreadnextrunheader_STRV_A5 NUM_ELEM_ARG(6) -FCALLSCFUN7(CFORTRANPNTR, lcreadnextrunheader, LCREADNEXTRUNHEADER, lcreadnextrunheader, - CFORTRANPNTR, INTV, PSTRINGV, PSTRINGV, PSTRINGV, INTV, INT) - - -FCALLSCFUN5(INT, lcseteventheader, LCSETEVENTHEADER, lcseteventheader, CFORTRANPNTR, - INT, INT, INT, STRING ) -#define lcgeteventheader_STRV_A5 NUM_ELEMS(1) -FCALLSCFUN5(INT, lcgeteventheader, LCGETEVENTHEADER, lcgeteventheader, CFORTRANPNTR, INTV, - INTV, INTV, PSTRINGV ) -FCALLSCFUN1(INT, lcdumprunheader, LCDUMPRUNHEADER, lcdumprunheader, CFORTRANPNTR ) -FCALLSCFUN1(INT, lcdumpevent, LCDUMPEVENT, lcdumpevent, CFORTRANPNTR ) -FCALLSCFUN1(INT, lcdumpeventdetailed, LCDUMPEVENTDETAILED, lcdumpeventdetailed,CFORTRANPNTR) - - -FCALLSCFUN9(INT, lcgetmcparticledata, LCGETMCPARTICLEDATA, lcgetmcparticledata, - CFORTRANPNTR , INTV , INTV , INTV, DOUBLEV , FLOATV , FLOATV , FLOATV , INTV ) -FCALLSCFUN1(INT, lcio2hepevt, LCIO2HEPEVT, lcio2hepevt , CFORTRANPNTR ) -FCALLSCFUN1(INT, hepevt2lcio, HEPEVT2LCIO, hepevt2lcio, CFORTRANPNTR ) - - -FCALLSCFUN6(INT, lcaddsimtrackerhit , LCADDSIMTRACKERHIT , lcaddsimtrackerhit, - CFORTRANPNTR , INT , DOUBLEV , FLOAT , FLOAT , CFORTRANPNTR ) - -FCALLSCFUN7(INT, lcgetsimtrackerhit, LCGETSIMTRACKERHIT, lcgetsimtrackerhit, - CFORTRANPNTR , INT , INTV , DOUBLEV , FLOATV , FLOATV , CFORTRANPNTRV ) - - -FCALLSCFUN5(CFORTRANPNTR, lcaddsimcalohit, LCADDSIMCALOHIT, lcaddsimcalohit, - CFORTRANPNTR, INT , INT, FLOAT, FLOATV ) -FCALLSCFUN6(CFORTRANPNTR , lcgetsimcalohit, LCGETSIMCALOHIT, lcgetsimcalohit, - CFORTRANPNTR , INT , INTV , INTV , FLOATV , FLOATV ) -FCALLSCFUN6(INT, lcgetsimcalohitmccont, LCGETSIMCALOHITMCCONT, lcgetsimcalohitmccont, - CFORTRANPNTR , INT , CFORTRANPNTRV, FLOATV , FLOATV , INTV ) - -FCALLSCFUN2(CFORTRANPNTR, lcobjectvectorcreate, LCOBJECTVECTORCREATE , lcobjectvectorcreate, - CFORTRANPNTRV, INT ) -FCALLSCFUN2(CFORTRANPNTR, lcintvectorcreate, LCINTVECTORCREATE , lcintvectorcreate, - INTV, INT ) -FCALLSCFUN2(CFORTRANPNTR, lcfloatvectorcreate, LCFLOATVECTORCREATE , lcfloatvectorcreate, - FLOATV, INT ) -#define lcstringvectorcreate_STRV_A1 NUM_ELEM_ARG(2) -FCALLSCFUN3(CFORTRANPNTR, lcstringvectorcreate, LCSTRINGVECTORCREATE , lcstringvectorcreate, - PSTRINGV, INT, INT ) - -FCALLSCFUN3(INT, lcgetintvector, LCGETINTVECTOR , lcgetintvector, - CFORTRANPNTR , INTV, INTV ) -FCALLSCFUN3(INT, lcgetfloatvector, LCGETFLOATVECTOR , lcgetfloatvector, - CFORTRANPNTR , FLOATV, INTV ) -#define lcgetstringvector_STRV_A2 NUM_ELEM_ARG(3) -FCALLSCFUN4(INT, lcgetstringvector, LCGETSTRINGVECTOR , lcgetstringvector, - CFORTRANPNTR , PSTRINGV, INTV, INT ) - - -FCALLSCFUN2(CFORTRANPNTR, intvectorcreate, INTVECTORCREATE , intvectorcreate, - INTV, INT ) -FCALLSCFUN1(INT, intvectordelete, INTVECTORDELETE, intvectordelete, - CFORTRANPNTR) -FCALLSCFUN2(CFORTRANPNTR, floatvectorcreate, FLOATVECTORCREATE , floatvectorcreate, - FLOATV, INT ) -FCALLSCFUN1(INT, floatvectordelete, FLOATVECTORDELETE, floatvectordelete, - CFORTRANPNTR) -#define stringvectorcreate_STRV_A1 NUM_ELEM_ARG(2) -FCALLSCFUN3(CFORTRANPNTR, stringvectorcreate, STRINGVECTORCREATE , stringvectorcreate, - PSTRINGV, INT, INT ) -FCALLSCFUN1(INT, stringvectordelete, STRINGVECTORDELETE, stringvectordelete, - CFORTRANPNTR) -FCALLSCFUN2(CFORTRANPNTR, pointervectorcreate, POINTERVECTORCREATE , pointervectorcreate, - CFORTRANPNTRV, INT ) -FCALLSCFUN1(INT, pointervectordelete, POINTERVECTORDELETE, pointervectordelete, - CFORTRANPNTR) - -FCALLSCFUN3(INT, getintvector, GETINTVECTOR , getintvector, - CFORTRANPNTR , INTV, INTV ) -FCALLSCFUN3(INT, getfloatvector, GETFLOATVECTOR , getfloatvector, - CFORTRANPNTR , FLOATV, INTV ) -#define getstringvector_STRV_A2 NUM_ELEM_ARG(3) -FCALLSCFUN4(INT, getstringvector, GETSTRINGVECTOR , getstringvector, - CFORTRANPNTR , PSTRINGV, INTV, INT ) -FCALLSCFUN3(INT, getpointervector, GETPOINTERVECTOR , getpointervector, - CFORTRANPNTR , CFORTRANPNTRV, INTV ) - - -FCALLSCFUN5(INT, lcsetparameters, LCSETPARAMETERS, lcsetparameters, - STRING, CFORTRANPNTR, STRING, STRING, CFORTRANPNTR ) - -FCALLSCFUN5(INT, lcgetparameters, LCGETPARAMETERS, lcgetparameters, - STRING, CFORTRANPNTR, STRING, STRING, CFORTRANPNTR ) - -} - diff --git a/src/cpp/include/CPPFORT/lcmcp.h b/src/cpp/include/CPPFORT/lcmcp.h deleted file mode 100644 index 6cda36de6..000000000 --- a/src/cpp/include/CPPFORT/lcmcp.h +++ /dev/null @@ -1,86 +0,0 @@ -/**Header file for the f77-wrapper functions of the LCMCParticleImpl class. - * - * @author F. Gaede - * @version Oct 11, 2003 - */ -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - -LCIO_DEPRECATED_CAPI PTRTYPE lcmcpcreate() ; -LCIO_DEPRECATED_CAPI int lcmcpdelete( PTRTYPE mcparticle ) ; -LCIO_DEPRECATED_CAPI int lcmcpgetnumberofparents( PTRTYPE mcparticle ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcmcpgetparent( PTRTYPE mcparticle , int i ) ; -// PTRTYPE lcmcpgetsecondparent( PTRTYPE mcparticle ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcmcpgetdaughter( PTRTYPE mcparticle, int i ) ; -LCIO_DEPRECATED_CAPI int lcmcpgetendpoint( PTRTYPE mcparticle, double* ep) ; -LCIO_DEPRECATED_CAPI int lcmcpgetnumberofdaughters( PTRTYPE mcparticle ) ; -LCIO_DEPRECATED_CAPI int lcmcpgetpdg( PTRTYPE mcparticle ) ; -LCIO_DEPRECATED_CAPI int lcmcpgetgeneratorstatus( PTRTYPE mcparticle ) ; -LCIO_DEPRECATED_CAPI int lcmcpgetsimulatorstatus( PTRTYPE mcparticle ) ; -LCIO_DEPRECATED_CAPI int lcmcpgetvertex( PTRTYPE mcparticle, double* vtx ) ; -LCIO_DEPRECATED_CAPI float lcmcpgettime( PTRTYPE mcparticle ) ; -LCIO_DEPRECATED_CAPI int lcmcpgetmomentum( PTRTYPE mcparticle, double* p) ; -LCIO_DEPRECATED_CAPI double lcmcpgetmass( PTRTYPE mcparticle ) ; -LCIO_DEPRECATED_CAPI float lcmcpgetcharge( PTRTYPE mcparticle ) ; -LCIO_DEPRECATED_CAPI double lcmcpgetenergy( PTRTYPE mcparticle ) ; -LCIO_DEPRECATED_CAPI int lcmcpgetspin( PTRTYPE mcparticle, float* spin ) ; -LCIO_DEPRECATED_CAPI int lcmcpgetcolorflow( PTRTYPE mcparticle, int* cflow ) ; - -LCIO_DEPRECATED_CAPI int lcmcpaddparent( PTRTYPE mcparticle, PTRTYPE parent ) ; -// int lcmcpsetsecondparent( PTRTYPE mcparticle, PTRTYPE parent ) ; -// int lcmcpadddaughter( PTRTYPE mcparticle, PTRTYPE daughter ) ; -LCIO_DEPRECATED_CAPI int lcmcpsetpdg( PTRTYPE mcparticle, int pdg ) ; -LCIO_DEPRECATED_CAPI int lcmcpsetgeneratorstatus( PTRTYPE mcparticle, int status ) ; -LCIO_DEPRECATED_CAPI int lcmcpsetsimulatorstatus( PTRTYPE mcparticle, int status ) ; -LCIO_DEPRECATED_CAPI int lcmcpsetvertex( PTRTYPE mcparticle, double vtx[3] ) ; -LCIO_DEPRECATED_CAPI int lcmcpsetendpoint( PTRTYPE mcparticle, double pnt[3] ) ; -LCIO_DEPRECATED_CAPI int lcmcpsetmomentum( PTRTYPE mcparticle, float p[3] ); -LCIO_DEPRECATED_CAPI int lcmcpsetmass( PTRTYPE mcparticle, float m) ; -LCIO_DEPRECATED_CAPI int lcmcpsetcharge( PTRTYPE mcparticle, float c ) ; -LCIO_DEPRECATED_CAPI int lcmcpsetspin( PTRTYPE mcparticle, float spin[3] ) ; -LCIO_DEPRECATED_CAPI int lcmcpsetcolorflow( PTRTYPE mcparticle, int cflow[2] ) ; - -// now the fortran wrappers from cfortran.h -extern "C"{ -FCALLSCFUN0(CFORTRANPNTR, lcmcpcreate,LCMCPCREATE, lcmcpcreate ) -FCALLSCFUN1(INT, lcmcpdelete, LCMCPDELETE, lcmcpdelete, CFORTRANPNTR ) - -FCALLSCFUN1(INT, lcmcpgetnumberofparents, LCMCPGETNUMBEROFPARENTS, lcmcpgetnumberofparents, CFORTRANPNTR ) -FCALLSCFUN2(CFORTRANPNTR, lcmcpgetparent, LCMCPGETPARENT, lcmcpgetparent, CFORTRANPNTR , INT) -// FCALLSCFUN1(CFORTRANPNTR, lcmcpgetsecondparent, LCMCPGETSECONDPARENT, lcmcpgetsecondparent, CFORTRANPNTR ) -FCALLSCFUN2(CFORTRANPNTR, lcmcpgetdaughter,lcmcpgetdaughter,lcmcpgetdaughter, CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lcmcpgetendpoint,LCMCPGETENDPOINT,lcmcpgetendpoint, CFORTRANPNTR, DOUBLEV ) -FCALLSCFUN1(INT, lcmcpgetnumberofdaughters, LCMCPGETNUMBEROFDAUGHTERS, lcmcpgetnumberofdaughters, CFORTRANPNTR ) -FCALLSCFUN1(INT, lcmcpgetpdg,LCMCPGETPDG, lcmcpgetpdg, CFORTRANPNTR ) -FCALLSCFUN1(INT, lcmcpgetgeneratorstatus, LCMCPGETGENERATORSTATUS, lcmcpgetgeneratorstatus, CFORTRANPNTR ) -FCALLSCFUN1(INT, lcmcpgetsimulatorstatus, LCMCPGETSIMULATORSTATUS, lcmcpgetsimulatorstatus, CFORTRANPNTR ) -FCALLSCFUN2(INT, lcmcpgetvertex,LCMCPGETVERTEX,lcmcpgetvertex, CFORTRANPNTR, DOUBLEV ) -FCALLSCFUN1(FLOAT, lcmcpgettime, LCMCPGETTIME, lcmcpgettime, CFORTRANPNTR ) -FCALLSCFUN2(INT, lcmcpgetmomentum,LCMCPGETMOMENTUM,lcmcpgetmomentum, CFORTRANPNTR, DOUBLEV ) -FCALLSCFUN1(DOUBLE, lcmcpgetmass, LCMCPGETMASS, lcmcpgetmass, CFORTRANPNTR ) -FCALLSCFUN1(FLOAT, lcmcpgetcharge,LCMCPGETCHARGE,lcmcpgetcharge, CFORTRANPNTR ) -FCALLSCFUN1(DOUBLE, lcmcpgetenergy, LCMCPGETENERGY, lcmcpgetenergy, CFORTRANPNTR ) -FCALLSCFUN2(INT, lcmcpgetspin, LCMCPGETSPIN, lcmcpgetspin, CFORTRANPNTR, FLOATV) -FCALLSCFUN2(INT, lcmcpgetcolorflow, LCMCPGETCOLORFLOW, lcmcpgetcolorflow, CFORTRANPNTR, INTV) - - -FCALLSCFUN2(INT, lcmcpaddparent,LCMCPADDPARENT,lcmcpaddparent, CFORTRANPNTR, CFORTRANPNTR ) -// FCALLSCFUN2(INT, lcmcpsetsecondparent,LCMCPSETSECONDPARENT,lcmcpsetsecondparent, CFORTRANPNTR, CFORTRANPNTR ) -// FCALLSCFUN2(INT, lcmcpadddaughter,LCMCPADDDAUGHTER,lcmcpadddaughter, CFORTRANPNTR, CFORTRANPNTR ) -FCALLSCFUN2(INT, lcmcpsetpdg,LCMCPSETPDG,lcmcpsetpdg, CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lcmcpsetgeneratorstatus,LCMCPSETGENERATORSTATUS,lcmcpsetgeneratorstatus, CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lcmcpsetsimulatorstatus,LCMCPSETSIMULATORSTATUS,lcmcpsetsimulatorstatus, CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lcmcpsetvertex,LCMCPSETVERTEX,lcmcpsetvertex, CFORTRANPNTR, DOUBLEV ) -FCALLSCFUN2(INT, lcmcpsetendpoint,LCMCPSETENDPOINT,lcmcpsetendpoint, CFORTRANPNTR, DOUBLEV ) -FCALLSCFUN2(INT, lcmcpsetmomentum,LCMCPSETMOMENTUM,lcmcpsetmomentum, CFORTRANPNTR, FLOATV ) -FCALLSCFUN2(INT, lcmcpsetmass,LCMCPSETMASS,lcmcpsetmass, CFORTRANPNTR, FLOAT ) -FCALLSCFUN2(INT, lcmcpsetcharge, LCMCPSETCHARGE, lcmcpsetcharge, CFORTRANPNTR, FLOAT ) -FCALLSCFUN2(INT, lcmcpsetspin, LCMCPSETSPIN, lcmcpsetspin, CFORTRANPNTR, FLOATV) -FCALLSCFUN2(INT, lcmcpsetcolorflow, LCMCPSETCOLORFLOW, lcmcpsetcolorflow, CFORTRANPNTR, INTV) -} - diff --git a/src/cpp/include/CPPFORT/lcobv.h b/src/cpp/include/CPPFORT/lcobv.h deleted file mode 100644 index 18ee03995..000000000 --- a/src/cpp/include/CPPFORT/lcobv.h +++ /dev/null @@ -1,33 +0,0 @@ -/**Header file for the f77-wrapper functions of the LCRelationNavigator class. - * - * @author H. Vogt - * @version sep 14, 2004 - */ - -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - -// the RelationNavigator interface -LCIO_DEPRECATED_CAPI int lcobvgetlength( PTRTYPE vector ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcobvgetobject( PTRTYPE vector, int index ) ; -LCIO_DEPRECATED_CAPI int lcobvgetobjectid( PTRTYPE vector, int index ) ; -LCIO_DEPRECATED_CAPI float lcobvgetweight( PTRTYPE vector, int index ) ; - -// now the fortran wrappers from cfortran.h -extern "C"{ -FCALLSCFUN1(INT, lcobvgetlength, LCOBVGETLENGTH, lcobvgetlength, - CFORTRANPNTR ) -FCALLSCFUN2(CFORTRANPNTR, lcobvgetobject, LCOBVGETOBJECT, lcobvgetobject, - CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lcobvgetobjectid, LCOBVGETOBJECTID, lcobvgetobjectid, - CFORTRANPNTR, INT ) -FCALLSCFUN2(FLOAT, lcobvgetweight, LCOBVGETWEIGHT, lcobvgetweight, - CFORTRANPNTR, INT ) - -} - diff --git a/src/cpp/include/CPPFORT/lcpid.h b/src/cpp/include/CPPFORT/lcpid.h deleted file mode 100644 index 539858ba2..000000000 --- a/src/cpp/include/CPPFORT/lcpid.h +++ /dev/null @@ -1,59 +0,0 @@ -/**Header file for the f77-wrapper functions of the ParticleID Class. - * - * @author H. Vogt - * @version May 10, 2004 - */ -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - -LCIO_DEPRECATED_CAPI PTRTYPE lcpidcreate() ; -LCIO_DEPRECATED_CAPI int lcpiddelete( PTRTYPE pid ) ; - -LCIO_DEPRECATED_CAPI int lcpidid( PTRTYPE pid ) ; -LCIO_DEPRECATED_CAPI int lcpidgettype( PTRTYPE pid ) ; -LCIO_DEPRECATED_CAPI int lcpidgetpdg( PTRTYPE pid ) ; -LCIO_DEPRECATED_CAPI float lcpidgetlikelihood( PTRTYPE pid ) ; - -LCIO_DEPRECATED_CAPI int lcpidgetalgorithmtype( PTRTYPE pid ) ; -LCIO_DEPRECATED_CAPI int lcpidgetparameters( PTRTYPE pid, float* vec, int* nvec ) ; - -LCIO_DEPRECATED_CAPI int lcpidsettype( PTRTYPE pid, int type ) ; -LCIO_DEPRECATED_CAPI int lcpidsetpdg( PTRTYPE pid, int pdg ) ; -LCIO_DEPRECATED_CAPI int lcpidsetlikelihood( PTRTYPE pid, float logl ) ; - -LCIO_DEPRECATED_CAPI int lcpidsetalgorithmtype( PTRTYPE pid, int algo ) ; -LCIO_DEPRECATED_CAPI int lcpidaddparameter( PTRTYPE pid, float param ) ; - - -// now the fortran wrappers from cfortran.h -extern "C"{ - -FCALLSCFUN0(CFORTRANPNTR, lcpidcreate, LCPIDCREATE, lcpidcreate ) -FCALLSCFUN1(INT, lcpiddelete, LCPIDDELETE, lcpiddelete, CFORTRANPNTR ) - -FCALLSCFUN1(INT, lcpidid, LCPIDID, lcpidid, CFORTRANPNTR) -FCALLSCFUN1(INT, lcpidgettype, LCPIDGETTYPE, lcpidgettype, CFORTRANPNTR) -FCALLSCFUN1(INT, lcpidgetpdg, LCPIDGETPDG, lcpidgetpdg, CFORTRANPNTR) - -FCALLSCFUN1(FLOAT, lcpidgetlikelihood, LCPIDGETLIKELIHOOD, lcpidgetlikelihood, CFORTRANPNTR) - - -FCALLSCFUN1(INT, lcpidgetalgorithmtype, LCPIDGETALGORITHMTYPE, lcpidgetalgorithmtype, CFORTRANPNTR ) -FCALLSCFUN3(INT, lcpidgetparameters, LCPIDGETPARAMETERS, lcpidgetparameters, CFORTRANPNTR, FLOATV, INTV) - -FCALLSCFUN2(INT, lcpidsettype, LCPIDSETTYPE, lcpidsettype, CFORTRANPNTR, INT) -FCALLSCFUN2(INT, lcpidsetpdg, LCPIDSETPDG, lcpidsetpdg, CFORTRANPNTR, INT) - -FCALLSCFUN2(INT, lcpidsetlikelihood, LCPIDSETLIKELIHOOD, lcpidsetlikelihood, CFORTRANPNTR, FLOAT) - -FCALLSCFUN2(INT, lcpidsetalgorithmtype, LCPIDSETALGORITHMTYPE, lcpidsetalgorithmtype, CFORTRANPNTR, INT) -FCALLSCFUN2(INT, lcpidaddparameter, LCPIDADDPARAMETER, lcpidaddparameter, CFORTRANPNTR, FLOAT) - -} - - diff --git a/src/cpp/include/CPPFORT/lcrcp.h b/src/cpp/include/CPPFORT/lcrcp.h deleted file mode 100644 index e1da019c1..000000000 --- a/src/cpp/include/CPPFORT/lcrcp.h +++ /dev/null @@ -1,105 +0,0 @@ -/**Header file for the f77-wrapper functions of the ReconstructedParticle Class. - * - * @author H. Vogt - * @version May 10, 2004 - */ -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - -LCIO_DEPRECATED_CAPI PTRTYPE lcrcpcreate() ; -LCIO_DEPRECATED_CAPI int lcrcpdelete( PTRTYPE rcp ) ; - -LCIO_DEPRECATED_CAPI int lcrcpid( PTRTYPE rcp ) ; -LCIO_DEPRECATED_CAPI int lcrcpgettype( PTRTYPE rcp ) ; -LCIO_DEPRECATED_CAPI bool lcrcpiscompound( PTRTYPE rcp ) ; -LCIO_DEPRECATED_CAPI int lcrcpgetmomentum( PTRTYPE rcp, float* p ) ; -LCIO_DEPRECATED_CAPI float lcrcpgetenergy( PTRTYPE rcp ) ; -LCIO_DEPRECATED_CAPI int lcrcpgetcovmatrix( PTRTYPE rcp, float* cvmtx ) ; -LCIO_DEPRECATED_CAPI float lcrcpgetmass( PTRTYPE rcp ) ; -LCIO_DEPRECATED_CAPI float lcrcpgetcharge( PTRTYPE rcp ) ; -LCIO_DEPRECATED_CAPI int lcrcpgetreferencepoint( PTRTYPE rcp, float* refpoint ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcrcpgetparticleids( PTRTYPE rcp ) ; -LCIO_DEPRECATED_CAPI float lcrcpgetgoodnessofpid( PTRTYPE pid ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcrcpgetparticles( PTRTYPE rcp ) ; -// int lcrcpgetparticleweights( PTRTYPE rcp, float* weights, int* nweights ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcrcpgetclusters( PTRTYPE rcp ) ; -// int lcrcpgetclusterweights( PTRTYPE rcp, float* weights, int* nweights ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcrcpgettracks( PTRTYPE rcp ) ; -// int lcrcpgettrackweights( PTRTYPE rcp, float* weights, int* nweights ) ; -// PTRTYPE lcrcpgetmcparticles( PTRTYPE rcp ) ; -// int lcrcpgetmcparticleweights( PTRTYPE rcp, float* weights, int* nweights ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcrcpgetstartvertex( PTRTYPE rcp ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcrcpgetendvertex( PTRTYPE rcp ) ; - - -LCIO_DEPRECATED_CAPI int lcrcpsettype( PTRTYPE rcp, int type ) ; -LCIO_DEPRECATED_CAPI int lcrcpsetcompound( PTRTYPE rcp, bool lcompound ) ; -LCIO_DEPRECATED_CAPI int lcrcpsetmomentum( PTRTYPE rcp, float* p ) ; -LCIO_DEPRECATED_CAPI int lcrcpsetenergy( PTRTYPE rcp, float energy ) ; -LCIO_DEPRECATED_CAPI int lcrcpsetcovmatrix( PTRTYPE rcp, float* cvmtx ) ; -LCIO_DEPRECATED_CAPI int lcrcpsetmass( PTRTYPE rcp, float xmass) ; -LCIO_DEPRECATED_CAPI int lcrcpsetcharge( PTRTYPE rcp, float charge ) ; -LCIO_DEPRECATED_CAPI int lcrcpsetreferencepoint( PTRTYPE rcp, float* refpoint ) ; -LCIO_DEPRECATED_CAPI int lcrcpaddparticleid( PTRTYPE rcp, PTRTYPE id ) ; -LCIO_DEPRECATED_CAPI int lcrcpsetgoodnessofpid( PTRTYPE pid, float good ) ; -LCIO_DEPRECATED_CAPI int lcrcpaddparticle( PTRTYPE rcp, PTRTYPE particle ) ; -LCIO_DEPRECATED_CAPI int lcrcpaddcluster( PTRTYPE rcp, PTRTYPE clus ) ; -LCIO_DEPRECATED_CAPI int lcrcpaddtrack( PTRTYPE rcp, PTRTYPE track) ; -// int lcrcpaddmcparticle( PTRTYPE rcp, PTRTYPE mcp, float weigth ) ; -LCIO_DEPRECATED_CAPI int lcrcpsetstartvertex( PTRTYPE rcp, PTRTYPE vtx ) ; - - -// now the fortran wrappers from cfortran.h -extern "C"{ - -FCALLSCFUN0(CFORTRANPNTR, lcrcpcreate, LCRCPCREATE, lcrcpcreate ) -FCALLSCFUN1(INT, lcrcpdelete, LCRCPDELETE, lcrcpdelete, CFORTRANPNTR ) - -FCALLSCFUN1(INT, lcrcpid, LCRCPID, lcrcpid, CFORTRANPNTR) -FCALLSCFUN1(INT, lcrcpgettype, LCRCPGETTYPE, lcrcpgettype, CFORTRANPNTR) -FCALLSCFUN1(LOGICAL, lcrcpiscompound, LCRCPISCOMPOUND, lcrcpiscompound, CFORTRANPNTR) -FCALLSCFUN2(INT, lcrcpgetmomentum, LCRCPGETMOMENTUM, lcrcpgetmomentum, CFORTRANPNTR, FLOATV) -FCALLSCFUN1(FLOAT, lcrcpgetenergy, LCRCPGETENERGY, lcrcpgetenergy, CFORTRANPNTR) -FCALLSCFUN2(INT, lcrcpgetcovmatrix, LCRCPGETCOVMATRIX, lcrcpgetcovmatrix, CFORTRANPNTR, FLOATV) -FCALLSCFUN1(FLOAT, lcrcpgetmass, LCRCPGETMASS, lcrcpgetmass, CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lcrcpgetcharge, LCRCPGETCHARGE, lcrcpgetcharge, CFORTRANPNTR) -FCALLSCFUN2(INT, lcrcpgetreferencepoint, LCRCPGETREFERENCEPOINT, lcrcpgetreferencepoint, CFORTRANPNTR, FLOATV) -FCALLSCFUN1(CFORTRANPNTR, lcrcpgetparticleids, LCRCPGETPARTICLEIDS, lcrcpgetparticleids, CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lcrcpgetgoodnessofpid, LCRCPGETGOODNESSOFPID, lcrcpgetgoodnessofpid, CFORTRANPNTR) -FCALLSCFUN1(CFORTRANPNTR, lcrcpgetparticles, LCRCPGETPARTICLES, lcrcpgetparticles, CFORTRANPNTR) -// FCALLSCFUN3(INT, lcrcpgetparticleweights, LCRCPGETPARTICLEWEIGHTS, lcrcpgetparticleweights, CFORTRANPNTR, FLOATV, INTV) -FCALLSCFUN1(CFORTRANPNTR, lcrcpgetclusters, LCRCPGETCLUSTERS, lcrcpgetclusters, CFORTRANPNTR) -// FCALLSCFUN3(INT, lcrcpgetclusterweights, LCRCPGETCLUSTERWEIGHTS, lcrcpgetclusterweights, CFORTRANPNTR, FLOATV, INTV) -FCALLSCFUN1(CFORTRANPNTR, lcrcpgettracks, LCRCPGETTRACKS, lcrcpgettracks, CFORTRANPNTR) -// FCALLSCFUN3(INT, lcrcpgettrackweights, LCRCPGETTRACKWEIGHTS, lcrcpgettrackweights, CFORTRANPNTR, FLOATV, INTV) -// FCALLSCFUN1(CFORTRANPNTR, lcrcpgetmcparticles, LCRCPGETMCPARTICLES, lcrcpgetmcparticles, CFORTRANPNTR) -// FCALLSCFUN3(INT, lcrcpgetmcparticleweights, LCRCPGETMCPARTICLEWEIGHTS, lcrcpgetmcparticleweights, -// CFORTRANPNTR, FLOATV, INTV) -FCALLSCFUN1(CFORTRANPNTR, lcrcpgetstartvertex, LCRCPGETSTARTVERTEX, lcrcpgetstartvertex, CFORTRANPNTR) -FCALLSCFUN1(CFORTRANPNTR, lcrcpgetendvertex, LCRCPGETENDVERTEX, lcrcpgetendvertex, CFORTRANPNTR) - - -FCALLSCFUN2(INT, lcrcpsettype, LCRCPSETTYPE, lcrcpsettype, CFORTRANPNTR, INT) -// FCALLSCFUN2(INT, lcrcpsetcompound, LCRCPSETCOMPOUND, lcrcpsetcompound, CFORTRANPNTR, LOGICAL) -FCALLSCFUN2(INT, lcrcpsetmomentum, LCRCPSETMOMENTUM, lcrcpsetmomentum, CFORTRANPNTR, FLOATV) -FCALLSCFUN2(INT, lcrcpsetenergy, LCRCPSETENERGY, lcrcpsetenergy, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lcrcpsetcovmatrix, LCRCPSETCOVMATRIX, lcrcpsetcovmatrix, CFORTRANPNTR, FLOATV) -FCALLSCFUN2(INT, lcrcpsetmass, LCRCPSETMASS, lcrcpsetmass, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lcrcpsetcharge, LCRCPSETCHARGE, lcrcpsetcharge, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lcrcpsetreferencepoint, LCRCPSETREFERENCEPOINT, lcrcpsetreferencepoint, CFORTRANPNTR, FLOATV) -FCALLSCFUN2(INT, lcrcpaddparticleid, LCRCPADDPARTICLEID, lcrcpaddparticleid, CFORTRANPNTR, CFORTRANPNTR) -FCALLSCFUN2(INT, lcrcpsetgoodnessofpid, LCRCPSETGOODNESSOFPID, lcrcpsetgoodnessofpid, CFORTRANPNTR, FLOAT) - -FCALLSCFUN2(INT, lcrcpaddparticle, LCRCPADDPARTICLE, lcrcpaddparticle, CFORTRANPNTR, CFORTRANPNTR ) -FCALLSCFUN2(INT, lcrcpaddcluster, LCRCPADDCLUSTER, lcrcpaddcluster, CFORTRANPNTR, CFORTRANPNTR) -FCALLSCFUN2(INT, lcrcpaddtrack, LCRCPADDTRACK, lcrcpaddtrack, CFORTRANPNTR, CFORTRANPNTR) -// FCALLSCFUN3(INT, lcrcpaddmcparticle, LCRCPADDMCPARTICLE, lcrcpaddmcparticle, CFORTRANPNTR, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lcrcpsetstartvertex, LCRCPSETSTARTVERTEX, lcrcpsetstartvertex, CFORTRANPNTR, CFORTRANPNTR ) -} - - diff --git a/src/cpp/include/CPPFORT/lcrdr.h b/src/cpp/include/CPPFORT/lcrdr.h deleted file mode 100644 index d2d730af3..000000000 --- a/src/cpp/include/CPPFORT/lcrdr.h +++ /dev/null @@ -1,45 +0,0 @@ - -/**Header file for the f77-wrapper functions of the LCReader class. - * - * @author F. Gaede - * @version Oct 10, 2003 - */ - -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - -LCIO_DEPRECATED_CAPI PTRTYPE lcrdrcreate() ; -LCIO_DEPRECATED_CAPI int lcrdrdelete( PTRTYPE reader ) ; - -LCIO_DEPRECATED_CAPI int lcrdropen( PTRTYPE reader, const char* filename ) ; -LCIO_DEPRECATED_CAPI int lcrdrclose( PTRTYPE reader ) ; -LCIO_DEPRECATED_CAPI int lcrdrreadstream( PTRTYPE reader, int maxRecord ) ; - -LCIO_DEPRECATED_CAPI PTRTYPE lcrdrreadnextrunheader(PTRTYPE reader, int accessMode) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcrdrreadnextevent(PTRTYPE reader, int accessMode) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcrdrreadevent(PTRTYPE reader, int runNumber, int evtNumber ); - -LCIO_DEPRECATED_CAPI int lcrdrskipnevents( PTRTYPE reader, int n ) ; - -extern "C"{ - -FCALLSCFUN0(CFORTRANPNTR, lcrdrcreate, LCRDRCREATE, lcrdrcreate ) -FCALLSCFUN1(INT, lcrdrdelete, LCRDRDELETE, lcrdrdelete, CFORTRANPNTR ) - -FCALLSCFUN2(INT, lcrdropen, LCRDROPEN, lcrdropen, CFORTRANPNTR, STRING ) -FCALLSCFUN1(INT, lcrdrclose, LCRDRCLOSE, lcrdrclose, CFORTRANPNTR ) -FCALLSCFUN2(INT, lcrdrreadstream, LCRDRREADSTREAM, lcrdrreadstream, CFORTRANPNTR, INT ) - -FCALLSCFUN2(CFORTRANPNTR,lcrdrreadnextrunheader,LCRDRREADNEXTRUNHEADER,lcrdrreadnextrunheader,CFORTRANPNTR,INT) -FCALLSCFUN2(CFORTRANPNTR,lcrdrreadnextevent,LCRDRREADNEXTEVENT,lcrdrreadnextevent,CFORTRANPNTR,INT) -FCALLSCFUN3(CFORTRANPNTR,lcrdrreadevent,LCRDRREADEVENT,lcrdrreadevent,CFORTRANPNTR,INT,INT) - -FCALLSCFUN2(INT, lcrdrskipnevents, LCRDRSKIPNEVENTS, lcrdrskipnevents, CFORTRANPNTR, INT ) - -} - diff --git a/src/cpp/include/CPPFORT/lcrdrrep.h b/src/cpp/include/CPPFORT/lcrdrrep.h deleted file mode 100644 index dfc3ff013..000000000 --- a/src/cpp/include/CPPFORT/lcrdrrep.h +++ /dev/null @@ -1,35 +0,0 @@ - -/**Header file for the f77-wrapper function of the RunEventProcessor class. - * - * @author H. Vogt - * @version Jun 22, 2004 - */ - -#include "cfortran.h" -#include "cpointer.h" - -#include "lcio.h" - -#include "IO/LCWriter.h" -#include "IO/LCReader.h" -#include "IO/LCEventListener.h" -#include "IO/LCRunListener.h" -#include "IOIMPL/LCFactory.h" - -#include "EVENT/LCIO.h" -#include "EVENT/LCStrVec.h" -#include "IMPL/LCRunHeaderImpl.h" -#include "IMPL/LCEventImpl.h" - -#include "deprecation.h" - -//--------------- convenient method to open a file and process it by the RunEventProcessor class -/**Opens a file for reading, register run and event listener, and process the input stream - */ -LCIO_DEPRECATED_CAPI int lcrdreventprocessor( PTRTYPE filenamevec ) ; - -// now the fortran wrappers from cfortran.h -extern "C"{ -FCALLSCFUN1(INT, lcrdreventprocessor, LCRDREVENTPROCESSOR, lcrdreventprocessor, CFORTRANPNTR ) -} - diff --git a/src/cpp/include/CPPFORT/lcrel.h b/src/cpp/include/CPPFORT/lcrel.h deleted file mode 100644 index ab0b4d70b..000000000 --- a/src/cpp/include/CPPFORT/lcrel.h +++ /dev/null @@ -1,45 +0,0 @@ -/**Header file for the f77-wrapper functions of the LCRelation class. - * - * @author H. Vogt - * @version Jun 23, 2004 - */ - -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - -// the relation interface -LCIO_DEPRECATED_CAPI PTRTYPE lcrelcreate0() ; -LCIO_DEPRECATED_CAPI PTRTYPE lcrelcreate( PTRTYPE objectfrom, PTRTYPE objectto, float weight ) ; -LCIO_DEPRECATED_CAPI int lcreldelete( PTRTYPE relation ) ; - -LCIO_DEPRECATED_CAPI int lcrelid(PTRTYPE relation) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcrelgetfrom( PTRTYPE relation ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcrelgetto( PTRTYPE relation ) ; -LCIO_DEPRECATED_CAPI float lcrelgetweight( PTRTYPE relation ) ; - -LCIO_DEPRECATED_CAPI int lcrelsetfrom(PTRTYPE relation, PTRTYPE object ) ; -LCIO_DEPRECATED_CAPI int lcrelsetto(PTRTYPE relation, PTRTYPE object ) ; -LCIO_DEPRECATED_CAPI int lcrelsetweight(PTRTYPE relation,float weight ) ; - -// now the fortran wrappers from cfortran.h -extern "C"{ -FCALLSCFUN0(CFORTRANPNTR, lcrelcreate0, LCRELCREATE0, lcrelcreate0 ) -FCALLSCFUN3(CFORTRANPNTR, lcrelcreate, LCRELCREATE, lcrelcreate, CFORTRANPNTR, CFORTRANPNTR, FLOAT ) -FCALLSCFUN1(INT, lcreldelete, LCRELDELETE, lcreldelete, CFORTRANPNTR ) - -FCALLSCFUN1(INT, lcrelid, LCRELID, lcrelid, CFORTRANPNTR ) -FCALLSCFUN1(CFORTRANPNTR, lcrelgetfrom, LCRELGETFROM, lcrelgetfrom, CFORTRANPNTR ) -FCALLSCFUN1(CFORTRANPNTR, lcrelgetto, LCRELGETTO, lcrelgetto, CFORTRANPNTR ) -FCALLSCFUN1(FLOAT, lcrelgetweight, LCRELGETWEIGHT, lcrelgetweight, CFORTRANPNTR ) - -FCALLSCFUN2(INT, lcrelsetfrom, LCRELSETFROM, lcrelsetfrom, CFORTRANPNTR, CFORTRANPNTR ) -FCALLSCFUN2(INT, lcrelsetto, LCRELSETTO, lcrelsetto, CFORTRANPNTR, CFORTRANPNTR ) -FCALLSCFUN2(INT, lcrelsetweight, LCRELSETWEIGHT, lcrelsetweight, CFORTRANPNTR, FLOAT ) - -} - diff --git a/src/cpp/include/CPPFORT/lcrhd.h b/src/cpp/include/CPPFORT/lcrhd.h deleted file mode 100644 index e64e6bb25..000000000 --- a/src/cpp/include/CPPFORT/lcrhd.h +++ /dev/null @@ -1,48 +0,0 @@ -/**Header file for the f77-wrapper functions of the LCEventImpl class. - * - * @author F. Gaede - * @version Oct 11, 2003 - */ - -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - -LCIO_DEPRECATED_CAPI PTRTYPE lcrhdcreate() ; -LCIO_DEPRECATED_CAPI int lcrhddelete( PTRTYPE runHeader ) ; -LCIO_DEPRECATED_CAPI int lcrhdgetrunnumber( PTRTYPE runHeader ) ; - -LCIO_DEPRECATED_CAPI char* lcrhdgetdetectorname( PTRTYPE runHeader ) ; -LCIO_DEPRECATED_CAPI char* lcrhdgetdescription( PTRTYPE runHeader ) ; - -LCIO_DEPRECATED_CAPI PTRTYPE lcrhdgetactivesubdetectors(PTRTYPE runHeader) ; - -LCIO_DEPRECATED_CAPI int lcrhdsetrunnumber( PTRTYPE runHeader, int rn) ; -LCIO_DEPRECATED_CAPI int lcrhdsetdetectorname( PTRTYPE runHeader, const char* dn) ; -LCIO_DEPRECATED_CAPI int lcrhdsetdescription( PTRTYPE runHeader, const char* dsc) ; -LCIO_DEPRECATED_CAPI int lcrhdaddactivesubdetector( PTRTYPE runHeader, const char* adn) ; - - -// now the fortran wrappers from cfortran.h -extern "C"{ -FCALLSCFUN0(CFORTRANPNTR, lcrhdcreate,LCRHDCREATE, lcrhdcreate ) -FCALLSCFUN1(INT, lcrhddelete, LCRHDDELETE, lcrhddelete, CFORTRANPNTR ) - -FCALLSCFUN1(INT, lcrhdgetrunnumber, LCRHDGETRUNNUMBER, lcrhdgetrunnumber, CFORTRANPNTR ) -FCALLSCFUN1(STRING, lcrhdgetdetectorname, LCRHDGETDETECTORNAME, lcrhdgetdetectorname, CFORTRANPNTR ) -FCALLSCFUN1(STRING, lcrhdgetdescription, LCRHDGETDESCRIPTION, lcrhdgetdescription, CFORTRANPNTR ) - -FCALLSCFUN1(CFORTRANPNTR, lcrhdgetactivesubdetectors, LCRHDGETACTIVESUBDETECTORS, - lcrhdgetactivesubdetectors, CFORTRANPNTR ) - -FCALLSCFUN2(INT, lcrhdsetrunnumber, LCRHDSETRUNNUMBER, lcrhdsetrunnumber, CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lcrhdsetdetectorname, LCRHDSETDETECTORNAME,lcrhdsetdetectorname, CFORTRANPNTR, STRING ) -FCALLSCFUN2(INT, lcrhdsetdescription, LCRHDSETDESCRIPTION,lcrhdsetdescription, CFORTRANPNTR, STRING ) -FCALLSCFUN2(INT, lcrhdaddactivesubdetector, LCRHDADDACTIVESUBDETECTOR,lcrhdaddactivesubdetector, CFORTRANPNTR, STRING ) -} - diff --git a/src/cpp/include/CPPFORT/lcrnv.h b/src/cpp/include/CPPFORT/lcrnv.h deleted file mode 100644 index a81f24cbe..000000000 --- a/src/cpp/include/CPPFORT/lcrnv.h +++ /dev/null @@ -1,55 +0,0 @@ -/**Header file for the f77-wrapper functions of the LCRelationNavigator class. - * - * @author H. Vogt - * @version sep 14, 2004 - */ - -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - -// the RelationNavigator interface -LCIO_DEPRECATED_CAPI PTRTYPE lcrnvcreate( const char* fromType, const char* toType ) ; -LCIO_DEPRECATED_CAPI int lcrnvdelete( PTRTYPE relation ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcrnvcreatefromcollection( PTRTYPE collection ) ; - -LCIO_DEPRECATED_CAPI char* lcrnvgetfromtype( PTRTYPE relation ) ; -LCIO_DEPRECATED_CAPI char* lcrnvgettotype( PTRTYPE relation ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcrnvgetrelatedtoobjects( PTRTYPE relation, PTRTYPE object ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcrnvgetrelatedfromobjects( PTRTYPE relation, PTRTYPE object ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcrnvgetrelatedtoweights ( PTRTYPE relation, PTRTYPE object ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcrnvgetrelatedfromweights ( PTRTYPE relation, PTRTYPE object ) ; - -LCIO_DEPRECATED_CAPI int lcrnvgaddrelation(PTRTYPE relation, PTRTYPE objectfrom, PTRTYPE objectto, float weight ) ; -LCIO_DEPRECATED_CAPI int lcrnvgremoverelation(PTRTYPE relation, PTRTYPE objectfrom, PTRTYPE objectto ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcrnvcreatecollection(PTRTYPE relation ) ; - -// now the fortran wrappers from cfortran.h -extern "C"{ -FCALLSCFUN2(CFORTRANPNTR, lcrnvcreate, LCRNVCREATE, lcrnvcreate, STRING, STRING ) -FCALLSCFUN1(INT, lcrnvdelete, LCRNVDELETE, lcrnvdelete, CFORTRANPNTR ) -FCALLSCFUN1(CFORTRANPNTR, lcrnvcreatefromcollection, LCRNVCREATEFROMCOLLECTION, lcrnvcreatefromcollection, CFORTRANPNTR ) - -FCALLSCFUN1(STRING, lcrnvgetfromtype, LCRNVGETFROMTYPE, lcrnvgetfromtype, CFORTRANPNTR ) -FCALLSCFUN1(STRING, lcrnvgettotype, LCRNVGETTOTYPE, lcrnvgettotype, CFORTRANPNTR ) -FCALLSCFUN2(CFORTRANPNTR, lcrnvgetrelatedtoobjects, LCRNVGETRELATEDTOOBJECTS, lcrnvgetrelatedtoobjects, - CFORTRANPNTR, CFORTRANPNTR ) -FCALLSCFUN2(CFORTRANPNTR, lcrnvgetrelatedfromobjects, LCRNVGETRELATEDFROMOBJECTS, lcrnvgetrelatedfromobjects, - CFORTRANPNTR, CFORTRANPNTR ) -FCALLSCFUN2(CFORTRANPNTR, lcrnvgetrelatedtoweights, LCRNVGETRELATEDTOWEIGHTS, lcrnvgetrelatedtoweights, - CFORTRANPNTR, CFORTRANPNTR ) -FCALLSCFUN2(CFORTRANPNTR, lcrnvgetrelatedfromweights, LCRNVGETRELATEDFROMWEIGHTS, lcrnvgetrelatedfromweights, - CFORTRANPNTR, CFORTRANPNTR ) - -FCALLSCFUN4(INT, lcrnvgaddrelation, LCRNVGADDRELATION, lcrnvgaddrelation, - CFORTRANPNTR, CFORTRANPNTR, CFORTRANPNTR, FLOAT ) -FCALLSCFUN3(INT, lcrnvgremoverelation, LCRNVGREMOVERELATION, lcrnvgremoverelation, - CFORTRANPNTR, CFORTRANPNTR, CFORTRANPNTR ) -FCALLSCFUN1(CFORTRANPNTR, lcrnvcreatecollection, LCRNVCREATECOLLECTION, lcrnvcreatecollection, CFORTRANPNTR ) - -} - diff --git a/src/cpp/include/CPPFORT/lcsch.h b/src/cpp/include/CPPFORT/lcsch.h deleted file mode 100644 index d0fe5c92b..000000000 --- a/src/cpp/include/CPPFORT/lcsch.h +++ /dev/null @@ -1,61 +0,0 @@ -/**Header file for the f77-wrapper functions of the SimCalorimeterHitImpl class. - * - * @author F. Gaede - * @version Oct 11, 2003 - */ - -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - -LCIO_DEPRECATED_CAPI PTRTYPE lcschcreate() ; -LCIO_DEPRECATED_CAPI int lcschdelete( PTRTYPE simcalhit ) ; - -LCIO_DEPRECATED_CAPI int lcschid( PTRTYPE simcalhit ) ; -LCIO_DEPRECATED_CAPI int lcschgetcellid0( PTRTYPE simcalhit ) ; -LCIO_DEPRECATED_CAPI int lcschgetcellid1( PTRTYPE simcalhit ) ; -LCIO_DEPRECATED_CAPI float lcschgetenergy( PTRTYPE simcalhit ) ; -LCIO_DEPRECATED_CAPI int lcschgetposition( PTRTYPE simcalhit, float * ) ; -LCIO_DEPRECATED_CAPI int lcschgetnmcparticles( PTRTYPE simcalhit ) ; -LCIO_DEPRECATED_CAPI int lcschgetnmccontributions( PTRTYPE simcalhit ) ; - -LCIO_DEPRECATED_CAPI PTRTYPE lcschgetparticlecont( PTRTYPE simcalhit, int i) ; -LCIO_DEPRECATED_CAPI float lcschgetenergycont( PTRTYPE simcalhit, int i) ; -LCIO_DEPRECATED_CAPI float lcschgettimecont( PTRTYPE simcalhit, int i) ; -LCIO_DEPRECATED_CAPI int lcschgetpdgcont( PTRTYPE simcalhit, int i) ; - -LCIO_DEPRECATED_CAPI int lcschsetcellid0( PTRTYPE simcalhit, int id0) ; -LCIO_DEPRECATED_CAPI int lcschsetcellid1( PTRTYPE simcalhit, int id1) ; -LCIO_DEPRECATED_CAPI int lcschsetenergy( PTRTYPE simcalhit, float en) ; -LCIO_DEPRECATED_CAPI int lcschsetposition( PTRTYPE simcalhit, float pos[3]) ; -LCIO_DEPRECATED_CAPI int lcschaddmcparticlecontribution( PTRTYPE simcalhit, PTRTYPE mcparticle, float en,float t, int pdg ) ; - -// now the fortran wrappers from cfortran.h -extern "C"{ -FCALLSCFUN0(CFORTRANPNTR, lcschcreate,LCSCHCREATE, lcschcreate ) -FCALLSCFUN1(INT, lcschdelete, LCSCHDELETE, lcschdelete, CFORTRANPNTR ) - -FCALLSCFUN1(INT, lcschid, LCSCHID, lcschid, CFORTRANPNTR ) -FCALLSCFUN1(INT, lcschgetcellid0, LCSCHGETCELLID0, lcschgetcellid0, CFORTRANPNTR ) -FCALLSCFUN1(INT, lcschgetcellid1, LCSCHGETCELLID1, lcschgetcellid1, CFORTRANPNTR ) -FCALLSCFUN1(FLOAT, lcschgetenergy, LCSCHGETENERGY, lcschgetenergy, CFORTRANPNTR ) -FCALLSCFUN2(INT, lcschgetposition,LCSCHGETPOSITION,lcschgetposition, CFORTRANPNTR, FLOATV ) -FCALLSCFUN1(INT, lcschgetnmcparticles,LCSCHGETNMCPARTICLES,lcschgetnmcparticles, CFORTRANPNTR ) -FCALLSCFUN1(INT, lcschgetnmccontributions,LCSCHGETNMCCONTRIBUTIONS,lcschgetnmccontributions, CFORTRANPNTR ) - -FCALLSCFUN2(CFORTRANPNTR, lcschgetparticlecont,LCSCHGETPARTICLECONT,lcschgetparticlecont,CFORTRANPNTR,INT ) -FCALLSCFUN2(FLOAT, lcschgetenergycont,LCSCHGETENERGYCONT,lcschgetenergycont,CFORTRANPNTR, INT ) -FCALLSCFUN2(FLOAT, lcschgettimecont,LCSCHGETTIMECONT,lcschgettimecont,CFORTRANPNTR,INT ) - -FCALLSCFUN2(INT, lcschsetcellid0,LCSCHSETCELLID0,lcschsetcellid0, CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lcschsetcellid1,LCSCHSETCELLID1,lcschsetcellid1, CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lcschsetenergy,LCSCHSETENERGY,lcschsetenergy, CFORTRANPNTR, FLOAT ) -FCALLSCFUN2(INT, lcschsetposition,LCSCHSETPOSITION,lcschsetposition, CFORTRANPNTR, FLOATV ) -FCALLSCFUN5(INT, lcschaddmcparticlecontribution,LCSCHADDMCPARTICLECONTRIBUTION,lcschaddmcparticlecontribution, CFORTRANPNTR, CFORTRANPNTR, FLOAT, FLOAT, INT ) - -} - diff --git a/src/cpp/include/CPPFORT/lcsth.h b/src/cpp/include/CPPFORT/lcsth.h deleted file mode 100644 index 2bd51e411..000000000 --- a/src/cpp/include/CPPFORT/lcsth.h +++ /dev/null @@ -1,74 +0,0 @@ -/**Header file for the f77-wrapper functions of the SimTrackerHitImpl class. - * - * @author F. Gaede - * @version Oct 10, 2003 - */ -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - -LCIO_DEPRECATED_CAPI PTRTYPE lcsthcreate() ; -LCIO_DEPRECATED_CAPI int lcsthdelete( PTRTYPE hit ) ; - -LCIO_DEPRECATED_CAPI int lcsthgetcellid( PTRTYPE hit ) ; -LCIO_DEPRECATED_CAPI int lcsthgetcellid0( PTRTYPE hit ) ; -LCIO_DEPRECATED_CAPI int lcsthgetcellid1( PTRTYPE hit ) ; -LCIO_DEPRECATED_CAPI double lcsthgetposition( PTRTYPE hit, int index ) ; -LCIO_DEPRECATED_CAPI float lcsthgetmomentum( PTRTYPE hit, int index ) ; -LCIO_DEPRECATED_CAPI float lcsthgetpathlength ( PTRTYPE hit ) ; -LCIO_DEPRECATED_CAPI float lcsthgetdedx( PTRTYPE hit ) ; -LCIO_DEPRECATED_CAPI float lcsthgetedep( PTRTYPE hit ) ; -LCIO_DEPRECATED_CAPI float lcsthgettime( PTRTYPE hit ) ; -LCIO_DEPRECATED_CAPI int lcsthgetquality( PTRTYPE hit ) ; - -LCIO_DEPRECATED_CAPI PTRTYPE lcsthgetmcparticle( PTRTYPE hit ) ; - -LCIO_DEPRECATED_CAPI int lcsthsetcellid0( PTRTYPE hit, int id ) ; -LCIO_DEPRECATED_CAPI int lcsthsetcellid1( PTRTYPE hit, int id ) ; -LCIO_DEPRECATED_CAPI int lcsthsetposition( PTRTYPE hit, double pos[3] ) ; -LCIO_DEPRECATED_CAPI int lcsthsetmomentum( PTRTYPE hit, float pos[3] ) ; -LCIO_DEPRECATED_CAPI int lcsthsetmomentumxyz( PTRTYPE hit, float px, float py, float pz ) ; -LCIO_DEPRECATED_CAPI int lcsthsetpathlength( PTRTYPE hit, float pathLength ) ; -LCIO_DEPRECATED_CAPI int lcsthsetdedx( PTRTYPE hit, float dEdX ) ; -LCIO_DEPRECATED_CAPI int lcsthsetedep( PTRTYPE hit, float e ) ; -LCIO_DEPRECATED_CAPI int lcsthsettime( PTRTYPE hit, float t ) ; -LCIO_DEPRECATED_CAPI int lcsthsetmcparticle( PTRTYPE hit, PTRTYPE particle ) ; -LCIO_DEPRECATED_CAPI int lcsthsetquality( PTRTYPE hit, int quality ) ; - -// now the fortran wrappers from cfortran.h -extern "C"{ - -FCALLSCFUN0(CFORTRANPNTR, lcsthcreate, LCSTHCREATE, lcsthcreate ) -FCALLSCFUN1(INT, lcsthdelete, LCSTHDELETE, lcsthdelete, CFORTRANPNTR ) - -FCALLSCFUN1(INT, lcsthgetcellid,LCSTHGETCELLID,lcsthgetcellid,CFORTRANPNTR) -FCALLSCFUN1(INT, lcsthgetcellid0,LCSTHGETCELLID0,lcsthgetcellid0,CFORTRANPNTR) -FCALLSCFUN1(INT, lcsthgetcellid1,LCSTHGETCELLID1,lcsthgetcellid1,CFORTRANPNTR) -FCALLSCFUN2(DOUBLE, lcsthgetposition, LCSTHGETPOSITION, lcsthgetposition, CFORTRANPNTR, INT ) -FCALLSCFUN2(FLOAT, lcsthgetmomentum, LCSTHGETMOMENTUM, lcsthgetmomentum, CFORTRANPNTR, INT ) -FCALLSCFUN1(FLOAT, lcsthgetpathlength,LCSTHGETPATHLENGTH,lcsthgetpathlength,CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lcsthgetdedx,LCSTHGETDEDX,lcsthgetdedx,CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lcsthgetedep,LCSTHGETEDEP,lcsthgetedep,CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lcsthgettime,LCSTHGETTIME,lcsthgettime,CFORTRANPNTR) -FCALLSCFUN1(INT, lcsthgetquality,LCSTHGETQUALITY,lcsthgetquality,CFORTRANPNTR) - -FCALLSCFUN1(CFORTRANPNTR,lcsthgetmcparticle,LCSTHGETMCPARTICLE,lcsthgetmcparticle,CFORTRANPNTR) - -FCALLSCFUN2(INT, lcsthsetcellid0, LCSTHSETCELLID0, lcsthsetcellid0, CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lcsthsetcellid1, LCSTHSETCELLID1, lcsthsetcellid1, CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lcsthsetposition, LCSTHSETPOSITION, lcsthsetposition, CFORTRANPNTR, DOUBLEV ) -FCALLSCFUN2(INT, lcsthsetmomentum, LCSTHSETMOMENTUM, lcsthsetmomentum, CFORTRANPNTR, FLOATV ) -FCALLSCFUN4(INT, lcsthsetmomentumxyz, LCSTHSETMOMENTUMXYZ, lcsthsetmomentumxyz, CFORTRANPNTR, - FLOAT, FLOAT, FLOAT ) -FCALLSCFUN2(INT, lcsthsetpathlength, LCSTHSETPATHLENGTH, lcsthsetpathlength, CFORTRANPNTR, FLOAT ) -FCALLSCFUN2(INT, lcsthsetdedx, LCSTHSETDEDX, lcsthsetdedx, CFORTRANPNTR, FLOAT ) -FCALLSCFUN2(INT, lcsthsetedep, LCSTHSETEDEP, lcsthsetedep, CFORTRANPNTR, FLOAT ) -FCALLSCFUN2(INT, lcsthsettime, LCSTHSETTIME, lcsthsettime, CFORTRANPNTR, FLOAT ) -FCALLSCFUN2(INT, lcsthsetmcparticle, LCSTHSETMCPARTICLE, lcsthsetmcparticle, CFORTRANPNTR, CFORTRANPNTR ) -FCALLSCFUN2(INT, lcsthsetquality, LCSTHSETQUALITY, lcsthsetquality, CFORTRANPNTR, INT ) -} - diff --git a/src/cpp/include/CPPFORT/lctph.h b/src/cpp/include/CPPFORT/lctph.h deleted file mode 100644 index 3d5c87d97..000000000 --- a/src/cpp/include/CPPFORT/lctph.h +++ /dev/null @@ -1,56 +0,0 @@ -/**Header file for the f77-wrapper functions of the TPCHitImpl class. - * - * @author F. Gaede - * @version Oct 10, 2003 - */ -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - -LCIO_DEPRECATED_CAPI PTRTYPE lctphcreate() ; -LCIO_DEPRECATED_CAPI int lctphdelete( PTRTYPE hit ) ; - -LCIO_DEPRECATED_CAPI int lctphid( PTRTYPE hit ) ; -LCIO_DEPRECATED_CAPI int lctphgetcellid( PTRTYPE hit ) ; -LCIO_DEPRECATED_CAPI float lctphgettime( PTRTYPE hit ) ; -LCIO_DEPRECATED_CAPI float lctphgcharge( PTRTYPE hit ) ; -LCIO_DEPRECATED_CAPI int lctphgetquality( PTRTYPE hit ) ; - -LCIO_DEPRECATED_CAPI int lctphgetnrawdatawords( PTRTYPE hit ) ; -LCIO_DEPRECATED_CAPI int lctphgetrawdataword( PTRTYPE hit, int i) ; - -LCIO_DEPRECATED_CAPI int lctphsetcellid( PTRTYPE hit, int id ) ; -LCIO_DEPRECATED_CAPI int lctphsettime( PTRTYPE hit, float t ); -LCIO_DEPRECATED_CAPI int lctphsetcharge( PTRTYPE hit, float c ); -LCIO_DEPRECATED_CAPI int lctphsetquality( PTRTYPE hit, int q ); -LCIO_DEPRECATED_CAPI int lctphsetrawdata( PTRTYPE hit, int* rawData, int size ) ; -//int lctphinitrawdataarray( PTRTYPE hit, int size ) ; - -// now the fortran wrappers from cfortran.h -extern "C"{ - -FCALLSCFUN0(CFORTRANPNTR, lctphcreate, LCTPHCREATE, lctphcreate ) -FCALLSCFUN1(INT, lctphdelete, LCTPHDELETE, lctphdelete, CFORTRANPNTR ) - -FCALLSCFUN1(INT, lctphid, LCTPHID, lctphdid, CFORTRANPNTR ) -FCALLSCFUN1(INT, lctphgetcellid,LCTPHGETCELLID,lctphgetcellid,CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lctphgettime,LCTPHGETTIME,lctphgettime,CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lctphgcharge,LCTPHGCHARGE,lctphgcharge,CFORTRANPNTR) -FCALLSCFUN1(INT, lctphgetquality,LCTPHGETQUALITY,lctphgetquality,CFORTRANPNTR) - -FCALLSCFUN1(INT, lctphgetnrawdatawords,LCTPHGETNRAWDATAWORDS,lctphgetnrawdatawords,CFORTRANPNTR) -FCALLSCFUN2(INT, lctphgetrawdataword,LCTPHGETRAWDATAWORD,lctphgetrawdataword,CFORTRANPNTR,INT) - -FCALLSCFUN2(INT, lctphsetcellid, LCTPHSETCELLID, lctphsetcellid, CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lctphsettime, LCTPHSETTIME, lctphsettime, CFORTRANPNTR, FLOAT ) -FCALLSCFUN2(INT, lctphsetcharge, LCTPHSETCHARGE, lctphsetcharge, CFORTRANPNTR, FLOAT ) -FCALLSCFUN2(INT, lctphsetquality, LCTPHSETQUALITY, lctphsetquality, CFORTRANPNTR, INT ) -FCALLSCFUN3(INT, lctphsetrawdata, LCTPHSETRAWDATA, lctphsetrawdata, CFORTRANPNTR, INTV, INT ) - //FCALLSCFUN2(INT, lctphinitrawdataarray, LCTPHINITRAWDATAARRAY, lctphinitrawdataarray, CFORTRANPNTR, INT ) - -} - diff --git a/src/cpp/include/CPPFORT/lctrh.h b/src/cpp/include/CPPFORT/lctrh.h deleted file mode 100644 index dccc7cc78..000000000 --- a/src/cpp/include/CPPFORT/lctrh.h +++ /dev/null @@ -1,80 +0,0 @@ -/**Header file for the f77-wrapper functions of the Track Class. - * - * @author H. Vogt - * @version $Id: lctrh.h,v 1.10 2010-06-02 10:59:33 engels Exp $ - */ -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - -LCIO_DEPRECATED_CAPI PTRTYPE lctrhcreate() ; -LCIO_DEPRECATED_CAPI int lctrhdelete( PTRTYPE trh ) ; - -LCIO_DEPRECATED_CAPI int lctrhid( PTRTYPE trh ) ; -LCIO_DEPRECATED_CAPI int lctrhgetposition( PTRTYPE trh, double* pos ) ; -LCIO_DEPRECATED_CAPI int lctrhgetcovmatrix( PTRTYPE trh, float* cvmtx ) ; -LCIO_DEPRECATED_CAPI float lctrhgetdedx( PTRTYPE trh ) ; -LCIO_DEPRECATED_CAPI float lctrhgetedep( PTRTYPE trh ) ; -LCIO_DEPRECATED_CAPI float lctrhgetedeperr( PTRTYPE trh ) ; -LCIO_DEPRECATED_CAPI float lctrhgettime( PTRTYPE trh ) ; -//char* lctrhgettype( PTRTYPE trh ) ; -LCIO_DEPRECATED_CAPI int lctrhgettype( PTRTYPE trh ) ; -LCIO_DEPRECATED_CAPI int lctrhgetquality( PTRTYPE trh ) ; -LCIO_DEPRECATED_CAPI int lctrhgetcellid0( PTRTYPE trh ) ; -LCIO_DEPRECATED_CAPI int lctrhgetcellid1( PTRTYPE trh ) ; - -LCIO_DEPRECATED_CAPI PTRTYPE lctrhgetrawhits( PTRTYPE trh ) ; - -LCIO_DEPRECATED_CAPI int lctrhsetposition( PTRTYPE trh, double* pos ) ; -LCIO_DEPRECATED_CAPI int lctrhsetcovmatrix( PTRTYPE trh, float* cvmtx ) ; -LCIO_DEPRECATED_CAPI int lctrhsetdedx( PTRTYPE trh, float dedx ) ; -LCIO_DEPRECATED_CAPI int lctrhsetedep( PTRTYPE trh, float e ) ; -LCIO_DEPRECATED_CAPI int lctrhsetedeperr( PTRTYPE trh, float e ) ; -LCIO_DEPRECATED_CAPI int lctrhsettime( PTRTYPE trh, float time ) ; -LCIO_DEPRECATED_CAPI int lctrhsettype( PTRTYPE trh, int type ) ; -LCIO_DEPRECATED_CAPI int lctrhsetquality( PTRTYPE trh, int q ); -LCIO_DEPRECATED_CAPI int lctrhsetcellid0( PTRTYPE trh, int id0) ; -LCIO_DEPRECATED_CAPI int lctrhsetcellid1( PTRTYPE trh, int id1) ; -LCIO_DEPRECATED_CAPI int lctrhaddrawhit( PTRTYPE trh, PTRTYPE rawhit ) ; - - -// now the fortran wrappers from cfortran.h -extern "C"{ - -FCALLSCFUN0(CFORTRANPNTR, lctrhcreate, LCTRHCREATE, lctrhcreate ) -FCALLSCFUN1(INT, lctrhdelete, LCTRHDELETE, lctrhdelete, CFORTRANPNTR ) - -FCALLSCFUN1(INT, lctrhid, LCTRHID, lctrhid, CFORTRANPNTR) -FCALLSCFUN2(INT, lctrhgetposition, LCTRHGETPOSITION, lctrhgetposition, CFORTRANPNTR, DOUBLEV ) -FCALLSCFUN2(INT, lctrhgetcovmatrix, LCTRHGETCOVMATRIX, lctrhgetcovmatrix, CFORTRANPNTR, FLOATV) -FCALLSCFUN1(FLOAT, lctrhgetdedx, LCTRHGETDEDX, lctrhgetdedx, CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lctrhgetedep, LCTRHGETEDEP, lctrhgetedep, CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lctrhgetedeperr, LCTRHGETEDEPERR, lctrhgetedeperr, CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lctrhgettime, LCTRHGETTIME, lctrhgettime, CFORTRANPNTR) - //FCALLSCFUN1(STRING, lctrhgettype, LCTRHGETTYPE, lctrhgettype, CFORTRANPNTR ) -FCALLSCFUN1(INT, lctrhgettype, LCTRHGETTYPE, lctrhgettype, CFORTRANPNTR ) -FCALLSCFUN1(INT, lctrhgetquality,LCTRHGETQUALITY, lctrhgetquality,CFORTRANPNTR) -FCALLSCFUN1(INT, lctrhgetcellid0, LCTRHGETCELLID0, lctrhgetcellid0, CFORTRANPNTR ) -FCALLSCFUN1(INT, lctrhgetcellid1, LCTRHGETCELLID1, lctrhgetcellid1, CFORTRANPNTR ) -FCALLSCFUN1(CFORTRANPNTR, lctrhgetrawhits, LCTRHGETRAWHITS, lctrhgetrawhits, CFORTRANPNTR) - -FCALLSCFUN2(INT, lctrhsetposition, LCTRHSETPOSITION, lctrhsetposition, CFORTRANPNTR, DOUBLEV) -FCALLSCFUN2(INT, lctrhsetcovmatrix, LCTRHSETCOVMATRIX, lctrhsetcovmatrix, CFORTRANPNTR, FLOATV) -FCALLSCFUN2(INT, lctrhsetdedx, LCTRHSETDEDX, lctrhsetdedx, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lctrhsetedep, LCTRHSETEDEP, lctrhsetedep, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lctrhsetedeperr, LCTRHSETEDEPERR, lctrhsetedeperr, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lctrhsettime, LCTRHSETTIME, lctrhsettime, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lctrhsettype, LCTRHSETTYPE, lctrhsettype, CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lctrhsetquality, LCTRHSETQUALITY, lctrhsetquality, CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lctrhsetcellid0,LCTRHSETCELLID0,lctrhsetcellid0, CFORTRANPNTR, INT ) -FCALLSCFUN2(INT, lctrhsetcellid1,LCTRHSETCELLID1,lctrhsetcellid1, CFORTRANPNTR, INT ) - -FCALLSCFUN2(INT, lctrhaddrawhit, LCTRHADDRAWHIT, lctrhaddrawhit, CFORTRANPNTR, CFORTRANPNTR) - -} - - diff --git a/src/cpp/include/CPPFORT/lctrk.h b/src/cpp/include/CPPFORT/lctrk.h deleted file mode 100644 index 0c8f7b676..000000000 --- a/src/cpp/include/CPPFORT/lctrk.h +++ /dev/null @@ -1,109 +0,0 @@ -/**Header file for the f77-wrapper functions of the Track Class. - * - * @author H. Vogt - * @version May 10, 2004 - */ -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - -LCIO_DEPRECATED_CAPI PTRTYPE lctrkcreate() ; -LCIO_DEPRECATED_CAPI int lctrkdelete( PTRTYPE trk ) ; - -LCIO_DEPRECATED_CAPI int lctrkid( PTRTYPE trk ) ; -LCIO_DEPRECATED_CAPI int lctrkgettype( PTRTYPE trk ) ; -// int lctrktesttype( PTRTYPE trk , int bit ) ; - -LCIO_DEPRECATED_CAPI float lctrkgetd0( PTRTYPE trk ) ; -LCIO_DEPRECATED_CAPI float lctrkgetphi( PTRTYPE trk ) ; -LCIO_DEPRECATED_CAPI float lctrkgetomega( PTRTYPE trk ) ; -LCIO_DEPRECATED_CAPI float lctrkgetz0( PTRTYPE trk ) ; -LCIO_DEPRECATED_CAPI float lctrkgettanlambda( PTRTYPE trk ) ; - -LCIO_DEPRECATED_CAPI int lctrkgetcovmatrix( PTRTYPE trk, float* cvmtx ) ; -LCIO_DEPRECATED_CAPI int lctrkgetreferencepoint( PTRTYPE trk, float* refpoint ) ; -//int lctrkisreferencepointpca( PTRTYPE trk ) ; -LCIO_DEPRECATED_CAPI float lctrkgetchi2( PTRTYPE trk ) ; -LCIO_DEPRECATED_CAPI int lctrkgetndf( PTRTYPE trk ) ; -LCIO_DEPRECATED_CAPI float lctrkgetdedx( PTRTYPE trk ) ; -LCIO_DEPRECATED_CAPI float lctrkgetdedxerror( PTRTYPE trk ) ; -LCIO_DEPRECATED_CAPI float lctrkgetradiusofinnermosthit( PTRTYPE trk ) ; -LCIO_DEPRECATED_CAPI int lctrkgetsubdetectorhitnumbers( PTRTYPE trk, int* intv, int* nintv) ; -LCIO_DEPRECATED_CAPI PTRTYPE lctrkgettracks( PTRTYPE trk ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lctrkgettrackerhits( PTRTYPE trk ) ; - -LCIO_DEPRECATED_CAPI int lctrksettypebit( PTRTYPE trk, int index, int val ) ; -LCIO_DEPRECATED_CAPI int lctrksetomega( PTRTYPE trk, float omega ) ; -LCIO_DEPRECATED_CAPI int lctrksettanlambda( PTRTYPE trk, float tanlambda ) ; -LCIO_DEPRECATED_CAPI int lctrksetphi( PTRTYPE trk, float phi ) ; -LCIO_DEPRECATED_CAPI int lctrksetd0( PTRTYPE trk, float d0 ) ; -LCIO_DEPRECATED_CAPI int lctrksetz0( PTRTYPE trk, float z0 ) ; -LCIO_DEPRECATED_CAPI int lctrksetcovmatrix( PTRTYPE trk, float* cvmtx ) ; -LCIO_DEPRECATED_CAPI int lctrksetreferencepoint( PTRTYPE trk, float* refpoint ) ; -//int lctrksetisreferencepointpca( PTRTYPE trk , int val) ; -LCIO_DEPRECATED_CAPI int lctrksetchi2( PTRTYPE trk, float chi2 ) ; -LCIO_DEPRECATED_CAPI int lctrksetndf( PTRTYPE trk, int ndf ) ; -LCIO_DEPRECATED_CAPI int lctrksetdedx( PTRTYPE trk, float dedx ) ; -LCIO_DEPRECATED_CAPI int lctrksetdedxerror( PTRTYPE trk, float dedxerr ) ; -LCIO_DEPRECATED_CAPI int lctrksetradiusofinnermosthit( PTRTYPE trk , float r) ; -LCIO_DEPRECATED_CAPI int lctrkaddtrack( PTRTYPE trk, PTRTYPE track ) ; -LCIO_DEPRECATED_CAPI int lctrkaddhit( PTRTYPE trk, PTRTYPE hit ) ; - -// fg: this method has no direct correspondence in the C++ API as there the vector is manipulated -// directly through it's interface via getSubdetectorHitNumbers -LCIO_DEPRECATED_CAPI int lctrksetsubdetectorhitnumbers( PTRTYPE trk, int* intv, const int nintv ) ; - - -// now the fortran wrappers from cfortran.h -extern "C"{ - -FCALLSCFUN0(CFORTRANPNTR, lctrkcreate, LCTRKCREATE, lctrkcreate ) -FCALLSCFUN1(INT, lctrkdelete, LCTRKDELETE, lctrkdelete, CFORTRANPNTR ) - -FCALLSCFUN1(INT, lctrkid, LCTRKID, lctrkid, CFORTRANPNTR) -FCALLSCFUN1(INT, lctrkgettype, LCTRKGETTYPE, lctrkgettype, CFORTRANPNTR) -// FCALLSCFUN2(INT, lctrktesttype, LCTRKTESTTYPE,lctrktesttype, CFORTRANPNTR, INT ) -FCALLSCFUN1(FLOAT, lctrkgetomega, LCTRKGETOMEGA, lctrkgetomega, CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lctrkgettanlambda, LCTRKGETTANLAMBDA, lctrkgettanlambda, CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lctrkgetphi, LCTRKGETPHI, lctrkgetphi, CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lctrkgetd0, LCTRKGETD0, lctrkgetd0, CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lctrkgetz0, LCTRKGETZ0, lctrkgetz0, CFORTRANPNTR) -FCALLSCFUN2(INT, lctrkgetcovmatrix, LCTRKGETCOVMATRIX, lctrkgetcovmatrix, CFORTRANPNTR, FLOATV) -FCALLSCFUN2(INT, lctrkgetreferencepoint, LCTRKGETREFERENCEPOINT, lctrkgetreferencepoint, CFORTRANPNTR, FLOATV) -//FCALLSCFUN1(INT, lctrkisreferencepointpca, LCTRKISREFERENCEPOINTPCA, lctrkisreferencepointpca, CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lctrkgetchi2, LCTRKGETCHI2, lctrkgetchi2, CFORTRANPNTR) -FCALLSCFUN1(INT, lctrkgetndf, LCTRKGETNDF, lctrkgetndf, CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lctrkgetdedx, LCTRKGETDEDX, lctrkgetdedx, CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lctrkgetdedxerror, LCTRKGETDEDXERROR, lctrkgetdedxerror, CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lctrkgetradiusofinnermosthit, LCTRKGETRADIUSOFINNERMOSTHIT, lctrkgetradiusofinnermosthit, CFORTRANPNTR) -FCALLSCFUN3(INT, lctrkgetsubdetectorhitnumbers, LCTRKGETSUBDETECTORHITNUMBERS, lctrkgetsubdetectorhitnumbers, CFORTRANPNTR, INTV, INTV) -FCALLSCFUN1(CFORTRANPNTR, lctrkgettracks, LCTRKGETTRACKS, lctrkgettracks, CFORTRANPNTR) -FCALLSCFUN1(CFORTRANPNTR, lctrkgettrackerhits, LCTRKGETTRACKERHITS, lctrkgettrackerhits, CFORTRANPNTR) - - -FCALLSCFUN3(INT, lctrksettypebit, LCTRKSETTYPEBIT, lctrksettypebit, CFORTRANPNTR, INT, INT) -FCALLSCFUN2(INT, lctrksetomega, LCTRKSETOMEGA, lctrksetomega, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lctrksettanlambda, LCTRKSETTANLAMBDA, lctrksettanlambda, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lctrksetphi, LCTRKSETPHI, lctrksetphi, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lctrksetd0, LCTRKSETD0, lctrksetd0, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lctrksetz0, LCTRKSETZ0, lctrksetz0, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lctrksetcovmatrix, LCTRKSETCOVMATRIX, lctrksetcovmatrix, CFORTRANPNTR, FLOATV) -FCALLSCFUN2(INT, lctrksetreferencepoint, LCTRKSETREFERENCEPOINT, lctrksetreferencepoint, CFORTRANPNTR, FLOATV) -//FCALLSCFUN2(INT,lctrksetisreferencepointpca, LCTRKSETISREFERENCEPOINTPCA, lctrksetisreferencepointpca, CFORTRANPNTR, INT) -FCALLSCFUN2(INT, lctrksetchi2, LCTRKSETCHI2, lctrksetchi2, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lctrksetndf, LCTRKSETNDF, lctrksetndf, CFORTRANPNTR, INT) -FCALLSCFUN2(INT, lctrksetdedx, LCTRKSETDEDX, lctrksetdedx, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lctrksetdedxerror, LCTRKSETDEDXERROR, lctrksetdedxerror, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lctrksetradiusofinnermosthit, LCTRKSETRADIUSOFINNERMOSTHIT, lctrksetradiusofinnermosthit, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lctrkaddtrack, LCTRKADDTRACK, lctrkaddtrack, CFORTRANPNTR, CFORTRANPNTR) -FCALLSCFUN2(INT, lctrkaddhit, LCTRKADDHIT, lctrkaddhit, CFORTRANPNTR, CFORTRANPNTR) - -FCALLSCFUN3(INT, lctrksetsubdetectorhitnumbers, LCTRKSETSUBDETECTORHITNUMBERS, lctrksetsubdetectorhitnumbers, CFORTRANPNTR, INTV, INT ) - -} - - diff --git a/src/cpp/include/CPPFORT/lcvec.h b/src/cpp/include/CPPFORT/lcvec.h deleted file mode 100644 index 0420fd57a..000000000 --- a/src/cpp/include/CPPFORT/lcvec.h +++ /dev/null @@ -1,70 +0,0 @@ -/**Header file for the f77-wrapper functions for stl vectors. - * - * @author F. Gaede - * @version Nov 3, 2003 - */ - - -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -#include -#include - - -typedef std::vector LCStrVec ; -typedef std::vector PointerVec ; - - -// define an interface to a LC string/int/float vector -LCIO_DEPRECATED_CAPI int lcsvcgetlength(PTRTYPE strvec) ; -LCIO_DEPRECATED_CAPI char* lcsvcgetstringat(PTRTYPE strvec, int index) ; - -LCIO_DEPRECATED_CAPI int lcivcgetlength(PTRTYPE intvec) ; -LCIO_DEPRECATED_CAPI int lcivcgetintat(PTRTYPE intvec, int index) ; - -LCIO_DEPRECATED_CAPI int lcfvcgetlength(PTRTYPE floatvec) ; -LCIO_DEPRECATED_CAPI float lcfvcgetfloatat(PTRTYPE floatvec, int index) ; - -// define an interface to read a standard string/int/pointer/float vector -LCIO_DEPRECATED_CAPI int stringvectorgetlength(PTRTYPE strvec) ; -LCIO_DEPRECATED_CAPI char* stringvectorgetelement(PTRTYPE strvec, int index) ; - -LCIO_DEPRECATED_CAPI int intvectorgetlength(PTRTYPE intvec) ; -LCIO_DEPRECATED_CAPI int intvectorgetelement(PTRTYPE intvec, int index) ; - -LCIO_DEPRECATED_CAPI int pointervectorgetlength(PTRTYPE intvec) ; -LCIO_DEPRECATED_CAPI PTRTYPE pointervectorgetelement(PTRTYPE intvec, int index) ; - -LCIO_DEPRECATED_CAPI int floatvectorgetlength(PTRTYPE floatvec) ; -LCIO_DEPRECATED_CAPI float floatvectorgetelement(PTRTYPE floatvec, int index) ; - -// now the fortran wrappers from cfortran.h -extern "C"{ - -FCALLSCFUN1(INT, lcsvcgetlength, LCSVCGETLENGTH, lcsvcgetlength, CFORTRANPNTR ) -FCALLSCFUN2(STRING, lcsvcgetstringat, LCSVCGETSTRINGAT, lcsvcgetstringat, CFORTRANPNTR, INT ) - -FCALLSCFUN1(INT, lcivcgetlength, LCIVCGETLENGTH, lcivcgetlength, CFORTRANPNTR ) -FCALLSCFUN2(INT, lcivcgetintat, LCIVCGETINTAT, lcivcgetintat, CFORTRANPNTR, INT ) - -FCALLSCFUN1(INT, lcfvcgetlength, LCFVCGETLENGTH, lcfvcgetlength, CFORTRANPNTR ) -FCALLSCFUN2(FLOAT, lcfvcgetfloatat, LCFVCGETFLOATAT, lcfvcgetfloatat, CFORTRANPNTR, INT ) - - -FCALLSCFUN1(INT, stringvectorgetlength, STRINGVECTORGETLENGTH, stringvectorgetlength, CFORTRANPNTR ) -FCALLSCFUN2(STRING, stringvectorgetelement, STRINGVECTORGETELEMENT, stringvectorgetelement, CFORTRANPNTR, INT ) - -FCALLSCFUN1(INT, intvectorgetlength, INTVECTORGETLENGTH, intvectorgetlength, CFORTRANPNTR ) -FCALLSCFUN2(INT, intvectorgetelement, INTVECTORGETELEMENT, intvectorgetelement, CFORTRANPNTR, INT ) - -FCALLSCFUN1(INT, pointervectorgetlength, POINTERVECTORGETLENGTH, pointervectorgetlength, CFORTRANPNTR ) -FCALLSCFUN2(CFORTRANPNTR, pointervectorgetelement, POINTERVECTORGETELEMENT, pointervectorgetelement, CFORTRANPNTR, INT ) - -FCALLSCFUN1(INT, floatvectorgetlength, FLOATVECTORGETLENGTH, floatvectorgetlength, CFORTRANPNTR ) -FCALLSCFUN2(FLOAT, floatvectorgetelement, FLOATVECTORGETELEMENT, floatvectorgetelement, CFORTRANPNTR, INT ) - -} - diff --git a/src/cpp/include/CPPFORT/lcvtx.h b/src/cpp/include/CPPFORT/lcvtx.h deleted file mode 100644 index 20f231c65..000000000 --- a/src/cpp/include/CPPFORT/lcvtx.h +++ /dev/null @@ -1,63 +0,0 @@ -/**Header file for the f77-wrapper functions of the Vertex Class. - * - * @author engels - * @version Aug 28, 2006 - */ -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - -LCIO_DEPRECATED_CAPI PTRTYPE lcvtxcreate() ; -LCIO_DEPRECATED_CAPI int lcvtxdelete( PTRTYPE vtx ) ; - -LCIO_DEPRECATED_CAPI int lcvtxid( PTRTYPE vtx ) ; -LCIO_DEPRECATED_CAPI bool lcvtxisprimary( PTRTYPE vtx ) ; -LCIO_DEPRECATED_CAPI char* lcvtxgetalgorithmtype( PTRTYPE vtx ) ; -LCIO_DEPRECATED_CAPI float lcvtxgetchi2( PTRTYPE vtx ) ; -LCIO_DEPRECATED_CAPI float lcvtxgetprobability( PTRTYPE vtx ) ; -LCIO_DEPRECATED_CAPI int lcvtxgetposition( PTRTYPE vtx, float* pos ) ; -LCIO_DEPRECATED_CAPI int lcvtxgetcovmatrix( PTRTYPE vtx, float* cvmtx ) ; -LCIO_DEPRECATED_CAPI int lcvtxgetparameters( PTRTYPE vtx, float* vec, int* nvec ) ; -LCIO_DEPRECATED_CAPI PTRTYPE lcvtxgetassociatedparticle( PTRTYPE vtx ) ; - -LCIO_DEPRECATED_CAPI int lcvtxsetprimary( PTRTYPE vtx, bool pri ) ; -LCIO_DEPRECATED_CAPI int lcvtxsetalgorithmtype( PTRTYPE vtx, char* type ) ; -LCIO_DEPRECATED_CAPI int lcvtxsetchi2( PTRTYPE vtx, float chi2 ) ; -LCIO_DEPRECATED_CAPI int lcvtxsetprobability( PTRTYPE vtx, float prob ) ; -LCIO_DEPRECATED_CAPI int lcvtxsetposition( PTRTYPE vtx, float* pos ) ; -LCIO_DEPRECATED_CAPI int lcvtxsetcovmatrix( PTRTYPE vtx, float* cvmtx ) ; -LCIO_DEPRECATED_CAPI int lcvtxaddparameter( PTRTYPE vtx, float param ) ; -LCIO_DEPRECATED_CAPI int lcvtxsetassociatedparticle( PTRTYPE vtx, PTRTYPE rcp ) ; - -// now the fortran wrappers from cfortran.h -extern "C"{ - -FCALLSCFUN0(CFORTRANPNTR, lcvtxcreate, LCVTXCREATE, lcvtxcreate ) -FCALLSCFUN1(INT, lcvtxdelete, LCVTXDELETE, lcvtxdelete, CFORTRANPNTR ) - -FCALLSCFUN1(INT, lcvtxid, LCVTXID, lcvtxid, CFORTRANPNTR) -FCALLSCFUN1(LOGICAL, lcvtxisprimary, LCVTXISPRIMARY, lcvtxisprimary, CFORTRANPNTR) -FCALLSCFUN1(STRING, lcvtxgetalgorithmtype, LCVTXGETALGORITHMTYPE, lcvtxgetalgorithmtype, CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lcvtxgetchi2, LCVTXGETCHI2, lcvtxgetchi2, CFORTRANPNTR) -FCALLSCFUN1(FLOAT, lcvtxgetprobability, LCVTXGETPROBABILITY, lcvtxgetprobability, CFORTRANPNTR) -FCALLSCFUN2(INT, lcvtxgetposition, LCVTXGETPOSITION, lcvtxgetposition, CFORTRANPNTR, FLOATV) -FCALLSCFUN2(INT, lcvtxgetcovmatrix, LCVTXGETCOVMATRIX, lcvtxgetcovmatrix, CFORTRANPNTR, FLOATV) -FCALLSCFUN3(INT, lcvtxgetparameters, LCVTXGETPARAMETERS, lcvtxgetparameters, CFORTRANPNTR, FLOATV, INTV) -FCALLSCFUN1(CFORTRANPNTR, lcvtxgetassociatedparticle, LCVTXGETASSOCIATEDPARTICLE, lcvtxgetassociatedparticle, CFORTRANPNTR) - -FCALLSCFUN2(INT, lcvtxsetprimary, LCVTXSETPRIMARY, lcvtxsetprimary, CFORTRANPNTR, LOGICAL) -FCALLSCFUN2(INT, lcvtxsetalgorithmtype, LCVTXSETALGORITHMTYPE, lcvtxsetalgorithmtype, CFORTRANPNTR, STRING) -FCALLSCFUN2(INT, lcvtxsetchi2, LCVTXSETCHI2, lcvtxsetchi2, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lcvtxsetprobability, LCVTXSETPROBABILITY, lcvtxsetprobability, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lcvtxsetposition, LCVTXSETPOSITION, lcvtxsetposition, CFORTRANPNTR, FLOATV) -FCALLSCFUN2(INT, lcvtxsetcovmatrix, LCVTXSETCOVMATRIX, lcvtxsetcovmatrix, CFORTRANPNTR, FLOATV) -FCALLSCFUN2(INT, lcvtxaddparameter, LCVTXADDPARAMETER, lcvtxaddparameter, CFORTRANPNTR, FLOAT) -FCALLSCFUN2(INT, lcvtxsetassociatedparticle, LCVTXSETASSOCIATEDPARTICLE, lcvtxsetassociatedparticle, CFORTRANPNTR, CFORTRANPNTR ) - -} - - diff --git a/src/cpp/include/CPPFORT/lcwrt.h b/src/cpp/include/CPPFORT/lcwrt.h deleted file mode 100644 index 52c5779e1..000000000 --- a/src/cpp/include/CPPFORT/lcwrt.h +++ /dev/null @@ -1,38 +0,0 @@ -/**Header file for the f77-wrapper functions of the LCWriter class. - * - * @author F. Gaede - * @version Oct 10, 2003 - */ - -#include "cfortran.h" -#include "cpointer.h" - -#include "deprecation.h" - -// Warning: dont use "_" in function names as this causes two many -// trailing underscores on Linux - -LCIO_DEPRECATED_CAPI PTRTYPE lcwrtcreate() ; -LCIO_DEPRECATED_CAPI int lcwrtdelete( PTRTYPE writer ) ; - -// the writer interface -LCIO_DEPRECATED_CAPI int lcwrtopen( PTRTYPE writer, const char* filename , int writeMode ) ; -LCIO_DEPRECATED_CAPI int lcwrtclose( PTRTYPE writer ) ; - -LCIO_DEPRECATED_CAPI int lcwrtwriterunheader( PTRTYPE writer, PTRTYPE header) ; -LCIO_DEPRECATED_CAPI int lcwrtwriteevent( PTRTYPE writer, PTRTYPE event) ; - - -// now the fortran wrappers from cfortran.h -extern "C"{ -FCALLSCFUN0(CFORTRANPNTR, lcwrtcreate, LCWRTCREATE, lcwrtcreate ) -FCALLSCFUN1(INT, lcwrtdelete, LCWRTDELETE, lcwrtdelete, CFORTRANPNTR ) - -FCALLSCFUN3(INT, lcwrtopen, LCWRTOPEN, lcwrtopen, CFORTRANPNTR, STRING ,INT ) -FCALLSCFUN1(INT, lcwrtclose, LCWRTCLOSE, lcwrtclose, CFORTRANPNTR ) - -FCALLSCFUN2(INT, lcwrtwriterunheader,LCWRTWRITERUNHEADER,lcwrtwriterunheader,CFORTRANPNTR,CFORTRANPNTR ) -FCALLSCFUN2(INT, lcwrtwriteevent,LCWRTWRITEEVENT,lcwrtwriteevent,CFORTRANPNTR,CFORTRANPNTR ) - -} - diff --git a/src/cpp/include/IMPL/AccessChecked.h b/src/cpp/include/IMPL/AccessChecked.h index 24c1774bb..ada5e8dd9 100644 --- a/src/cpp/include/IMPL/AccessChecked.h +++ b/src/cpp/include/IMPL/AccessChecked.h @@ -22,7 +22,8 @@ namespace IMPL { public: AccessChecked() ; - virtual ~AccessChecked() { /* nop */; } + AccessChecked(const AccessChecked&) = default; + virtual ~AccessChecked() = default; virtual int simpleUID() const { return _id ; } protected: diff --git a/src/cpp/include/IMPL/TrackStateImpl.h b/src/cpp/include/IMPL/TrackStateImpl.h index 7f61de303..122d6a207 100644 --- a/src/cpp/include/IMPL/TrackStateImpl.h +++ b/src/cpp/include/IMPL/TrackStateImpl.h @@ -27,6 +27,9 @@ namespace IMPL { /** Default constructor, initializes values to 0. */ TrackStateImpl() ; + TrackStateImpl(TrackStateImpl&&) = default ; + TrackStateImpl(TrackStateImpl const&) = default ; + TrackStateImpl& operator=(TrackStateImpl const&) = default ; TrackStateImpl(int location, float d0, float phi, float omega, float z0, float tanLambda, const float* covMatrix, const float* reference) ; TrackStateImpl(int location, float d0, float phi, float omega, float z0, float tanLambda, const EVENT::FloatVec& covMatrix, const float* reference) ; /** Copy constructor which takes as an argument an EVENT::TrackState reference */ @@ -35,7 +38,7 @@ namespace IMPL { /// Destructor. - virtual ~TrackStateImpl() ; + virtual ~TrackStateImpl() = default; virtual int id() const { return simpleUID() ; } diff --git a/src/cpp/include/LCRTRelations.h b/src/cpp/include/LCRTRelations.h index ec0e4b909..bef2ac959 100644 --- a/src/cpp/include/LCRTRelations.h +++ b/src/cpp/include/LCRTRelations.h @@ -69,17 +69,17 @@ namespace lcrtrel_helper{ typedef U tag ; // this ensures that a new class instance is created for every user extension static const int allowed_to_call_ext = b ; - LCBaseTraits(const LCBaseTraits&) = delete ; - LCBaseTraits& operator=(const LCBaseTraits&) = delete ; + LCBaseTraits(const LCBaseTraits&) = delete ; + LCBaseTraits& operator=(const LCBaseTraits&) = delete ; public: /** Constructor */ - inline LCBaseTraits() { + inline LCBaseTraits() { _pointer = (ptr) I::init(); } /** Destructor */ - inline ~LCBaseTraits() { + inline ~LCBaseTraits() { D::clean( _pointer ); } @@ -268,11 +268,11 @@ namespace lcrtrel{ /** Constructor */ - LCIntExtension() = default ; + LCIntExtension() = default ; /** Destructor */ - ~LCIntExtension() = default ; + ~LCIntExtension() = default ; /** Extension data access */ inline ptr& pointer() { @@ -301,11 +301,11 @@ namespace lcrtrel{ /** Constructor */ - LCFloatExtension() = default ; + LCFloatExtension() = default ; /** Destructor */ - ~LCFloatExtension() = default ; + ~LCFloatExtension() = default ; /** Extension data access */ inline ptr& pointer() { @@ -327,11 +327,11 @@ namespace lcrtrel{ /** Constructor */ - LCBoolExtension() = default ; + LCBoolExtension() = default ; /** Destructor */ - ~LCBoolExtension() = default ; + ~LCBoolExtension() = default ; /** Extension data access */ inline ptr& pointer() { diff --git a/src/cpp/include/SIO/RunEventMap.h b/src/cpp/include/SIO/RunEventMap.h index d118334c3..36f8d1390 100644 --- a/src/cpp/include/SIO/RunEventMap.h +++ b/src/cpp/include/SIO/RunEventMap.h @@ -15,6 +15,9 @@ namespace SIO { typedef long long long64 ; RunEvent() = default ; + RunEvent(RunEvent const&) = default ; + RunEvent(RunEvent&&) = default ; + RunEvent& operator=(RunEvent const&) = default ; ~RunEvent() = default ; RunEvent(int run, int evt): RunNum( run ), EvtNum( evt ) {} RunEvent(long64 runEvt): RunNum( (runEvt >> 32 ) & 0xffffffff ), EvtNum( runEvt & 0xffffffff ) {} diff --git a/src/cpp/include/SIO/SIOReader.h b/src/cpp/include/SIO/SIOReader.h index 7712ba5e8..91d19b34a 100644 --- a/src/cpp/include/SIO/SIOReader.h +++ b/src/cpp/include/SIO/SIOReader.h @@ -62,7 +62,7 @@ namespace SIO { EVENT::LCRunHeader * readNextRunHeader() override ; /** Same as readNextRunHeader() but allows to set the access mode - * LCIO::READ_ONLY (default) or LCIO::Update. + * EVENT::LCIO::READ_ONLY (default) or EVENT::LCIO::UPDATE. * * @throws IOException */ @@ -77,7 +77,7 @@ namespace SIO { /** Same as readNextRunHeader() but allows to set the access mode - * LCIO::READ_ONLY (default) or LCIO::Update + * EVENT::LCIO::READ_ONLY (default) or EVENT::LCIO::UPDATE * * @throws IOException */ @@ -135,7 +135,7 @@ namespace SIO { EVENT::LCRunHeader * readRunHeader(int runNumber ) override ; /** Same as LCEvent* readRunHeader(int runNumber) - * allowing to set the access mode LCIO::READ_ONLY (default) or LCIO::Update. + * allowing to set the access mode EVENT::LCIO::READ_ONLY (default) or EVENT::LCIO::UPDATE. * * @throws IOException */ @@ -150,7 +150,7 @@ namespace SIO { /** Same as LCEvent* readEvent(int runNumber, int evtNumber - * allowing to set the access mode LCIO::READ_ONLY (default) or LCIO::Update. + * allowing to set the access mode EVENT::LCIO::READ_ONLY (default) or EVENT::LCIO::UPDATE. * * @throws IOException */ diff --git a/src/cpp/include/UTIL/CheckCollections.h b/src/cpp/include/UTIL/CheckCollections.h index 28cfc6f39..03b3b1621 100644 --- a/src/cpp/include/UTIL/CheckCollections.h +++ b/src/cpp/include/UTIL/CheckCollections.h @@ -30,16 +30,20 @@ namespace UTIL { virtual ~CheckCollections() = default ; /** Checks the file for missing collections - can be called repeadedly on different files. + The quiet flag makes this function not produce any output. */ - void checkFile( const std::string& fileName ) ; + void checkFile( const std::string& fileName, bool quiet=false) ; /** Checks all files for missing collections. + The quiet flag makes this function not produce any output. */ - void checkFiles( const std::vector& fileNames ) ; + void checkFiles( const std::vector& fileNames, bool quiet=false) ; - /** dump result of check to stream */ - void print( std::ostream& os ) const ; + /** dump result of check to stream. The minimal flag reduces the output of + * this function. + */ + void print( std::ostream& os ,bool minimal=false) const ; /** Returns the collections that are not present in all events checked with checkFiles() with their names and types. diff --git a/src/cpp/include/UTIL/CollectionParameterMap.h b/src/cpp/include/UTIL/CollectionParameterMap.h index 41454b49b..ba1c9416f 100644 --- a/src/cpp/include/UTIL/CollectionParameterMap.h +++ b/src/cpp/include/UTIL/CollectionParameterMap.h @@ -47,6 +47,7 @@ namespace UTIL{ */ map_type& map() { return _map ; } + const map_type& map() const { return _map; } protected: diff --git a/src/cpp/include/UTIL/LCFourVector.h b/src/cpp/include/UTIL/LCFourVector.h index 60bb0a5d3..6ef409364 100644 --- a/src/cpp/include/UTIL/LCFourVector.h +++ b/src/cpp/include/UTIL/LCFourVector.h @@ -6,11 +6,6 @@ #include "CLHEP/Vector/LorentzVector.h" -// CLHEP 1.9 and higher introduce a namespace: -namespace CLHEP{} -using namespace CLHEP ; - - namespace UTIL { @@ -27,13 +22,13 @@ namespace UTIL { * @version Mar 12, 2004 */ template - class LCFourVector : public HepLorentzVector { + class LCFourVector : public CLHEP::HepLorentzVector { protected: const TT* _lcObj = nullptr ; public: - virtual ~LCFourVector() { /*no_op*/; } + virtual ~LCFourVector() = default; LCFourVector(const LCFourVector& ) = default ; LCFourVector& operator=(const LCFourVector& ) = default ; diff --git a/src/cpp/include/UTIL/LCFourVector.icc b/src/cpp/include/UTIL/LCFourVector.icc index 6f1f1d0fd..ca29f8982 100644 --- a/src/cpp/include/UTIL/LCFourVector.icc +++ b/src/cpp/include/UTIL/LCFourVector.icc @@ -3,23 +3,20 @@ #include "Exceptions.h" -using namespace EVENT; -using namespace IMPL; - namespace UTIL{ - typedef LCFourVector MCParticle4V ; - typedef LCFourVector MCParticleI4V ; + typedef LCFourVector MCParticle4V ; + typedef LCFourVector MCParticleI4V ; - typedef LCFourVector ReconstructedParticle4V ; - typedef LCFourVector ReconstructedParticleI4V ; + typedef LCFourVector ReconstructedParticle4V ; + typedef LCFourVector ReconstructedParticleI4V ; // specializations for the different LCObjects that have 4 vector information template<> - inline LCFourVector::LCFourVector( const MCParticle* mcPart ) : + inline LCFourVector::LCFourVector( const EVENT::MCParticle* mcPart ) : HepLorentzVector(mcPart->getMomentum()[0], mcPart->getMomentum()[1], mcPart->getMomentum()[2], @@ -28,12 +25,12 @@ namespace UTIL{ { } template<> - inline LCFourVector::LCFourVector(const LCObject* lcObj){ + inline LCFourVector::LCFourVector(const EVENT::LCObject* lcObj){ - _lcObj = dynamic_cast( lcObj ) ; + _lcObj = dynamic_cast( lcObj ) ; if( _lcObj == 0 ) - throw Exception("Dynamic cast failed for LCFourVector() !") ; + throw EVENT::Exception("Dynamic cast failed for LCFourVector() !") ; const double* p = _lcObj->getMomentum() ; setPx( p[0] ) ; @@ -45,7 +42,7 @@ namespace UTIL{ } template<> - inline LCFourVector::LCFourVector(const ReconstructedParticle* part ): + inline LCFourVector::LCFourVector(const EVENT::ReconstructedParticle* part ): HepLorentzVector(part->getMomentum()[0], part->getMomentum()[1], part->getMomentum()[2], @@ -54,12 +51,12 @@ namespace UTIL{ { } template<> - inline LCFourVector::LCFourVector(const LCObject* lcObj){ + inline LCFourVector::LCFourVector(const EVENT::LCObject* lcObj){ - _lcObj = dynamic_cast( lcObj ) ; + _lcObj = dynamic_cast( lcObj ) ; if( _lcObj == 0 ) - throw Exception("Dynamic cast failed for LCFourVector() !") ; + throw EVENT::Exception("Dynamic cast failed for LCFourVector() !") ; const double* p = _lcObj->getMomentum() ; setPx( p[0] ) ; diff --git a/src/cpp/include/UTIL/LCIterator.h b/src/cpp/include/UTIL/LCIterator.h index 2a823a947..b7e05b80b 100644 --- a/src/cpp/include/UTIL/LCIterator.h +++ b/src/cpp/include/UTIL/LCIterator.h @@ -38,7 +38,7 @@ namespace UTIL { template class LCIterator{ - LCIterator() {} + LCIterator() {} public: @@ -47,7 +47,7 @@ namespace UTIL { * this will behave the same as an empty collection - use operator() to * test, if the collection exists. */ - LCIterator( EVENT::LCEvent* evt, const std::string& name ) : _i(0), _col(0) { + LCIterator( EVENT::LCEvent* evt, const std::string& name ) : _i(0), _col(0) { try{ @@ -74,7 +74,7 @@ namespace UTIL { /** Constructor for the given collection. */ - LCIterator( const EVENT::LCCollection* col) : _i(0) , _col( col ) { + LCIterator( const EVENT::LCCollection* col) : _i(0) , _col( col ) { _n = (_col ? _col->getNumberOfElements() : 0 ) ; diff --git a/src/cpp/include/UTIL/LCRelationNavigator.h b/src/cpp/include/UTIL/LCRelationNavigator.h index 37d06895d..e655442f4 100644 --- a/src/cpp/include/UTIL/LCRelationNavigator.h +++ b/src/cpp/include/UTIL/LCRelationNavigator.h @@ -12,11 +12,11 @@ namespace UTIL { /** The LCRelationNavigator makes repeated lookup of relations more conveneient and efficient. - * The relations are treated symmetrical, i.e. lookup of relations is equally efficient and + * The relations are treated symmetrical, i.e. lookup of relations is equally efficient and * fast for either direction (from-to and to-from) * at the price of a slower (by a factor of ~2) modification speed. - * - * @author gaede + * + * @author gaede * @version $Id: LCRelationNavigator.h,v 1.2 2004-09-06 14:35:51 gaede Exp $ */ @@ -36,32 +36,32 @@ namespace UTIL { class LCRelationNavigator { - - typedef std::map< EVENT::LCObject* , std::pair< EVENT::LCObjectVec , EVENT::FloatVec > > RelMap ; - public: + typedef std::map< EVENT::LCObject* , std::pair< EVENT::LCObjectVec , EVENT::FloatVec > > RelMap ; + + public: /** Default constructor */ LCRelationNavigator(const std::string &fromType, const std::string &toType) : _from( fromType ), _to( toType ) { /* nop */; } - + /**Create the navigator object from an existing collection of relations */ LCRelationNavigator( const EVENT::LCCollection* col ) ; - + /// Destructor. ~LCRelationNavigator() { /* nop */; } - + /**The type of the 'from' objects in this relation. */ const std::string & getFromType() const ; - + /**The type of the 'to' objects in this relation. */ const std::string & getToType() const ; - + /** All objects that the given from-object is related to. * LCObjects are of type getToType(). */ @@ -72,18 +72,18 @@ namespace UTIL { */ const EVENT::LCObjectVec & getRelatedFromObjects(EVENT::LCObject * to) const ; - /** The weights of the relations returned by a call to getRelatedToObjects(from). + /** The weights of the relations returned by a call to getRelatedToObjects(from). * @see getRelatedToObjects */ const EVENT::FloatVec & getRelatedToWeights(EVENT::LCObject * from) const ; - /** The weights of the relations returned by a call to getRelatedFromObjects(to). + /** The weights of the relations returned by a call to getRelatedFromObjects(to). * @see getRelatedFromObjects */ const EVENT::FloatVec & getRelatedFromWeights(EVENT::LCObject * to) const ; - /** Return the object related to the given from-object with the highest (recalculated/decoded in case a decode function object argument is specified) weight. - * LCObject is of type getToType(). DecodeF is a function object (anything + /** Return the object related to the given from-object with the highest (recalculated/decoded in case a decode function object argument is specified) weight and the (decoded) weight. + * LCObject is of type getToType(). DecodeF is a function object (anything * callable with the right signature works) that returns recalculated weight * based on the weight stored in relation collection. It is meant be used to decode * physicaly meaningful weight in case it is stored in any way encoded. @@ -91,18 +91,18 @@ namespace UTIL { * The required signature is float(float weight) which returns recalculated weight. */ template - const EVENT::LCObject* getRelatedToMaxWeightObject(EVENT::LCObject* from, DecodeF&& decode = identity ) const{ + std::tuple getRelatedToMaxWeightAndObject(EVENT::LCObject* from, DecodeF&& decode = identity ) const{ const auto& objects = getRelatedToObjects(from); - if ( objects.empty() ) return nullptr; + if ( objects.empty() ) return std::make_tuple(0., nullptr); const auto& weights = getRelatedToWeights(from); size_t i = getMaxWeightIdx(weights, decode); - return objects[i]; + return std::make_tuple(decode(weights[i]), objects[i]); } - /** Return the object related to the given to-object with the highest (recalculated/decoded in case a decode function object argument is specified) weight. - * LCObject is of type getFromType(). DecodeF is a function object (anything + /** Return the object related to the given to-object with the highest (recalculated/decoded in case a decode function object argument is specified) weight and the (decoded) weight. + * LCObject is of type getFromType(). DecodeF is a function object (anything * callable with the right signature works) that returns recalculated weight * based on the weight stored in LCRelation collection. It is meant be used to decode * physicaly meaningful weight in case it is stored in any way encoded. @@ -110,18 +110,46 @@ namespace UTIL { * The required signature is float(float weight) which returns recalculated weight. */ template - const EVENT::LCObject* getRelatedFromMaxWeightObject(EVENT::LCObject* to, DecodeF&& decode = identity ) const{ + std::tuple getRelatedFromMaxWeightAndObject(EVENT::LCObject* to, DecodeF&& decode = identity ) const{ const auto& objects = getRelatedFromObjects(to); - if ( objects.empty() ) return nullptr; + if ( objects.empty() ) return std::make_tuple(0., nullptr); const auto& weights = getRelatedFromWeights(to); size_t i = getMaxWeightIdx(weights, decode); - return objects[i]; + return std::make_tuple(decode(weights[i]), objects[i]); + } + + + /** Return the object related to the given from-object with the highest (recalculated/decoded in case a decode function object argument is specified) weight. + * LCObject is of type getToType(). DecodeF is a function object (anything + * callable with the right signature works) that returns recalculated weight + * based on the weight stored in relation collection. It is meant be used to decode + * physicaly meaningful weight in case it is stored in any way encoded. + * By default DecodeF simply returns identical number stored inside LCRelation collection without any modifications. + * The required signature is float(float weight) which returns recalculated weight. + */ + template + const EVENT::LCObject* getRelatedToMaxWeightObject(EVENT::LCObject* from, DecodeF&& decode = identity ) const{ + return std::get<1>(getRelatedToMaxWeightAndObject(from, decode)); + } + + + /** Return the object related to the given to-object with the highest (recalculated/decoded in case a decode function object argument is specified) weight. + * LCObject is of type getFromType(). DecodeF is a function object (anything + * callable with the right signature works) that returns recalculated weight + * based on the weight stored in LCRelation collection. It is meant be used to decode + * physicaly meaningful weight in case it is stored in any way encoded. + * By default DecodeF simply returns identical number stored inside LCRelation collection without any modifications. + * The required signature is float(float weight) which returns recalculated weight. + */ + template + const EVENT::LCObject* getRelatedFromMaxWeightObject(EVENT::LCObject* to, DecodeF&& decode = identity ) const{ + return std::get<1>(getRelatedFromMaxWeightAndObject(to, decode)); } /** Return the highest (recalculated/decoded in case a decode function object argument is specified) weight among all objects the given from-object is related to. - * DecodeF is a function object (anything + * DecodeF is a function object (anything * callable with the right signature works) that returns recalculated weight * based on the weight stored in LCRelation collection. It is meant be used to decode * physicaly meaningful weight in case it is stored in any way encoded. @@ -130,16 +158,11 @@ namespace UTIL { */ template float getRelatedToMaxWeight(EVENT::LCObject* from, DecodeF&& decode = identity ) const { - const auto& objects = getRelatedToObjects(from); - if ( objects.empty() ) return 0.; - - const auto& weights = getRelatedToWeights(from); - size_t i = getMaxWeightIdx(weights, decode); - return decode(weights[i]); + return std::get<0>(getRelatedToMaxWeightAndObject(from, decode)); } /** Return the highest (recalculated/decoded in case a decode function object argument is specified) weight among all objects the given to-object is related to. - * DecodeF is a function object (anything + * DecodeF is a function object (anything * callable with the right signature works) that returns recalculated weight * based on the weight stored in LCRelation collection. It is meant be used to decode * physicaly meaningful weight in case it is stored in any way encoded. @@ -148,24 +171,19 @@ namespace UTIL { */ template float getRelatedFromMaxWeight(EVENT::LCObject* to, DecodeF&& decode = identity ) const { - const auto& objects = getRelatedFromObjects(to); - if ( objects.empty() ) return 0.; - - const auto& weights = getRelatedFromWeights(to); - size_t i = getMaxWeightIdx(weights, decode); - return decode(weights[i]); + return std::get<0>(getRelatedFromMaxWeightAndObject(to, decode)); } /** Adds a relation. If there is already an existing relation between the two given objects * the weight (or default weight 1.0) is added to that relationship's weight. */ void addRelation(EVENT::LCObject * from, EVENT::LCObject * to, float weight = 1.0) ; - + /** Remove a given relation. */ void removeRelation(EVENT::LCObject * from, EVENT::LCObject * to) ; - /** Remove a given relation. To reduce the weight of the relationship, call + /** Remove a given relation. To reduce the weight of the relationship, call * addRelation( from, to, weight ) with weight<0. */ EVENT::LCCollection * createLCCollection() ; @@ -183,7 +201,7 @@ namespace UTIL { mutable RelMap _rMap{} ; std::string _from ; std::string _to ; - + }; // class } // namespace EVENT diff --git a/src/cpp/include/UTIL/LCWarning.h b/src/cpp/include/UTIL/LCWarning.h index 21cf13ed0..a8bfcd97c 100644 --- a/src/cpp/include/UTIL/LCWarning.h +++ b/src/cpp/include/UTIL/LCWarning.h @@ -39,7 +39,6 @@ class LCWarning { ~LCWarning(); //{} LCWarning( const LCWarning& ) ; LCWarning & operator=(const LCWarning &); - static LCWarning& instance ; struct _warning_cfg_struct{ diff --git a/src/cpp/include/UTIL/PIDHandler.h b/src/cpp/include/UTIL/PIDHandler.h index c6049fbfb..fb1b287cc 100644 --- a/src/cpp/include/UTIL/PIDHandler.h +++ b/src/cpp/include/UTIL/PIDHandler.h @@ -66,27 +66,27 @@ namespace UTIL{ /** Return the typeID of algorithm algoName - throws UnknownAlgorithm. */ - int getAlgorithmID( const std::string& algoName ) ; + int getAlgorithmID( const std::string& algoName ) const ; /** Return the name of the algorithm with id - throws UnknownAlgorithm. */ - const std::string& getAlgorithmName( int algoID ) ; + const std::string& getAlgorithmName( int algoID ) const ; /** The index of parameter pName for the algorithm with algorithmID - throws UnknownAlgoritm. */ - int getParameterIndex( int algorithmID, const std::string& pName ) ; + int getParameterIndex( int algorithmID, const std::string& pName ) const; /** Return the (first) ParticleID object for the given algorithm and particle (or cluster) - throws UnknownAlgorithm. * If no object is found for the given algorithmID a default initialized dummy object is returned. * Only use if you know there is only one PID object for the algorithms or if you simply want the most likely * PID for this algorithm. */ - const EVENT::ParticleID& getParticleID( EVENT::LCObject* particle , int algorithmID ) ; + const EVENT::ParticleID& getParticleID( EVENT::LCObject* particle , int algorithmID ) const ; /** Return all PID objects for a given algorithm - ordered with decreasing likelihood - throws UnknownAlgorithm. */ - EVENT::ParticleIDVec getParticleIDs( EVENT::LCObject* p , int id ) ; + EVENT::ParticleIDVec getParticleIDs( EVENT::LCObject* p , int id ) const ; /** Set the particleID algorithm that is used for this particle's kinematic variables @@ -97,11 +97,11 @@ namespace UTIL{ /** The names of parameters for the algorithm with algorithmID - throws UnknownAlgoritm. */ - const EVENT::StringVec& getParameterNames( int algorithmID ) ; + const EVENT::StringVec& getParameterNames( int algorithmID ) const; /** Return the IDs of all known Algorithms. */ - const EVENT::IntVec& getAlgorithmIDs() ; + const EVENT::IntVec& getAlgorithmIDs() const; /** Set the particleID information for this particle (or cluster) - throws UnknownAlgorithm. diff --git a/src/cpp/include/pre-generated/EVENT/CalorimeterHit.h b/src/cpp/include/pre-generated/EVENT/CalorimeterHit.h index da0f3cb24..05d775b77 100644 --- a/src/cpp/include/pre-generated/EVENT/CalorimeterHit.h +++ b/src/cpp/include/pre-generated/EVENT/CalorimeterHit.h @@ -35,7 +35,7 @@ class CalorimeterHit : public LCObject { public: /// Destructor. - virtual ~CalorimeterHit() { /* nop */; } + virtual ~CalorimeterHit() = default; /** Useful typedef for template programming with LCIO */ diff --git a/src/cpp/include/pre-generated/EVENT/Cluster.h b/src/cpp/include/pre-generated/EVENT/Cluster.h index 149c76bcc..f4a0efaf0 100644 --- a/src/cpp/include/pre-generated/EVENT/Cluster.h +++ b/src/cpp/include/pre-generated/EVENT/Cluster.h @@ -8,7 +8,6 @@ #define EVENT_CLUSTER_H 1 #include "EVENT/CalorimeterHit.h" -#include "EVENT/Cluster.h" #include "EVENT/LCObject.h" #include "EVENT/ParticleID.h" #include "LCIOSTLTypes.h" diff --git a/src/cpp/include/pre-generated/EVENT/LCObject.h b/src/cpp/include/pre-generated/EVENT/LCObject.h index 6b2e0ea93..06b331de7 100644 --- a/src/cpp/include/pre-generated/EVENT/LCObject.h +++ b/src/cpp/include/pre-generated/EVENT/LCObject.h @@ -31,7 +31,12 @@ class LCObject : public LCRTRelations { public: /// Destructor. - virtual ~LCObject() { /* nop */; } + virtual ~LCObject() = default; + + LCObject() = default ; + LCObject(LCObject const&) = default ; + LCObject(LCObject&&) = default ; + LCObject& operator=(LCObject const&) = default ; /** Returns an object id for internal (debugging) use in LCIO. */ diff --git a/src/cpp/include/pre-generated/EVENT/MCParticle.h b/src/cpp/include/pre-generated/EVENT/MCParticle.h index 1e2d88a0b..224a712a2 100644 --- a/src/cpp/include/pre-generated/EVENT/MCParticle.h +++ b/src/cpp/include/pre-generated/EVENT/MCParticle.h @@ -8,7 +8,6 @@ #define EVENT_MCPARTICLE_H 1 #include "EVENT/LCObject.h" -#include "EVENT/MCParticle.h" #include "empty_ignore.h" #include diff --git a/src/cpp/include/pre-generated/EVENT/ReconstructedParticle.h b/src/cpp/include/pre-generated/EVENT/ReconstructedParticle.h index f46b6005f..c7b875747 100644 --- a/src/cpp/include/pre-generated/EVENT/ReconstructedParticle.h +++ b/src/cpp/include/pre-generated/EVENT/ReconstructedParticle.h @@ -10,7 +10,6 @@ #include "EVENT/Cluster.h" #include "EVENT/LCObject.h" #include "EVENT/ParticleID.h" -#include "EVENT/ReconstructedParticle.h" #include "EVENT/Track.h" #include "LCIOSTLTypes.h" #include "empty_ignore.h" diff --git a/src/cpp/include/pre-generated/EVENT/Track.h b/src/cpp/include/pre-generated/EVENT/Track.h index ee3ed497d..bd5e5da93 100644 --- a/src/cpp/include/pre-generated/EVENT/Track.h +++ b/src/cpp/include/pre-generated/EVENT/Track.h @@ -8,7 +8,6 @@ #define EVENT_TRACK_H 1 #include "EVENT/LCObject.h" -#include "EVENT/Track.h" #include "EVENT/TrackState.h" #include "EVENT/TrackerHit.h" #include "LCIOSTLTypes.h" diff --git a/src/cpp/include/pre-generated/EVENT/TrackState.h b/src/cpp/include/pre-generated/EVENT/TrackState.h index 01bba8689..f7c33e4a6 100644 --- a/src/cpp/include/pre-generated/EVENT/TrackState.h +++ b/src/cpp/include/pre-generated/EVENT/TrackState.h @@ -26,9 +26,6 @@ typedef std::vector TrackStateVec ; class TrackState : public LCObject { public: - /// Destructor. - virtual ~TrackState() { /* nop */; } - /** Useful typedef for template programming with LCIO */ typedef TrackState lcobject_type ; diff --git a/src/cpp/include/pre-generated/IO/LCReader.h b/src/cpp/include/pre-generated/IO/LCReader.h index 41be0a720..bcfe03283 100644 --- a/src/cpp/include/pre-generated/IO/LCReader.h +++ b/src/cpp/include/pre-generated/IO/LCReader.h @@ -62,7 +62,7 @@ class LCReader { virtual EVENT::LCRunHeader * readNextRunHeader() = 0; /** Same as readNextRunHeader() but allows to set the access mode - * LCIO::READ_ONLY (default) or LCIO::Update. + * EVENT::LCIO::READ_ONLY (default) or EVENT::LCIO::UPDATE. * * @throws IOException */ @@ -76,7 +76,7 @@ class LCReader { virtual EVENT::LCEvent * readNextEvent() = 0; /** Same as readNextEvent() but allows to set the access mode - * LCIO::READ_ONLY (default) or LCIO::Update. + * EVENT::LCIO::READ_ONLY (default) or EVENT::LCIO::UPDATE. * * @throws IOException */ @@ -127,7 +127,7 @@ class LCReader { virtual EVENT::LCRunHeader * readRunHeader(int runNumber) = 0; /** Same as LCEvent* readRunHeader(int runNumber) - * allowing to set the access mode LCIO::READ_ONLY (default) or LCIO::Update. + * allowing to set the access mode EVENT::LCIO::READ_ONLY (default) or EVENT::LCIO::UPDATE. * * @throws IOException */ @@ -141,7 +141,7 @@ class LCReader { virtual EVENT::LCEvent * readEvent(int runNumber, int evtNumber) = 0; /** Same as LCEvent* readEvent(int runNumber, int evtNumber) - * allowing to set the access mode LCIO::READ_ONLY (default) or LCIO::Update. + * allowing to set the access mode EVENT::LCIO::READ_ONLY (default) or EVENT::LCIO::UPDATE. * * @throws IOException */ diff --git a/src/cpp/src/CPPFORT/HEPEVT.cc b/src/cpp/src/CPPFORT/HEPEVT.cc deleted file mode 100644 index 22ded69f7..000000000 --- a/src/cpp/src/CPPFORT/HEPEVT.cc +++ /dev/null @@ -1,210 +0,0 @@ - -#include "CPPFORT/HEPEVT.h" - -#include -#include -#include -using namespace std ; - -using namespace lcio ; - -namespace HEPEVTIMPL{ - - void HEPEVT::fromHepEvt(LCEvent * evt, const char* mcpColName){ - - float* p = new float[3] ; - - // create and add mc particles from stdhep COMMON - LCCollectionVec* mcVec = new LCCollectionVec( LCIO::MCPARTICLE ) ; - - // create a particle instance for each HEPEVT entry - // and add it to the collection - leave parent relations empty - int* NMCPART = &FTNhep.nhep; - for(int j=0;j < *NMCPART;j++) - { - MCParticleImpl* mcp = new MCParticleImpl ; - mcp->setPDG( FTNhep.idhep[j] ) ; - mcp->setGeneratorStatus( FTNhep.isthep[j] ) ; - mcp->setSimulatorStatus( 0 ) ; - - // now momentum, vertex, charge - for(int k=0;k<3;k++) p[k] = (float)FTNhep.phep[j][k]; - mcp->setMomentum( p ); - mcp->setMass( (float)FTNhep.phep[j][4] ) ; - mcp->setVertex( FTNhep.vhep[j] ) ; - - // finally store pointer and set charge - mcp->setCharge( FTNhep1.mcchargev[j] ) ; - - mcVec->push_back( mcp ) ; - } - - // now loop one more time and add parent relations - // NB: this assumes that the parent relations are consistent, i.e. any particle - // referred to as daughter in the hepevt common block refers to the corresponding - // particle as mother - for(int j=0;j < *NMCPART;j++) { - MCParticleImpl* mcp = dynamic_cast( mcVec->getElementAt( j ) ) ; - - // now get parents if required and set daughter if parent1 is defined - int parent1 = FTNhep.jmohep[j][0] ; - int parent2 = FTNhep.jmohep[j][1] ; - - if( parent1 > 0 ) { - MCParticle* mom = dynamic_cast( mcVec->getElementAt( parent1-1 ) ) ; - mcp->addParent( mom ) ; - if( parent2 > 0 ) - for(int i = parent1 ; i < parent2 ; i++ ){ - MCParticle* mom2 = dynamic_cast( mcVec->getElementAt( i ) ) ; - mcp->addParent( mom2 ) ; - } - } - } - - std::string colName("MCParticle") ; - if( mcpColName != 0 ) - colName = mcpColName ; - - // add all collection to the event - evt->addCollection( (LCCollection*) mcVec , colName ) ; - - // now fill pointers for MCParticle collection - LCEventImpl* evtimpl = reinterpret_cast(evt) ; - LCCollection* getmcVec = evtimpl->getCollection( "MCParticle" ) ; - int nelem = getmcVec->getNumberOfElements() ; - for(int j=0;j < nelem; j++) - { - FTNhep1.mcpointerv[j] = reinterpret_cast( getmcVec->getElementAt( j ) ) ; - } - - delete[] p ; - } // end of fromHepEvt - -/* ============================================================================================================= */ - - void HEPEVT::toHepEvt(const LCEvent* evt, const char* mcpColName){ - - int* kmax = new int ; - double* maxxyz = new double; - - - // set event number in stdhep COMMON - FTNhep.nevhep = evt->getEventNumber() ; - - std::string colName("MCParticle") ; - if( mcpColName != 0 ) - colName = mcpColName ; - - // fill MCParticles into stdhep COMMON - LCCollection* mcVec = evt->getCollection( colName ) ; - FTNhep.nhep = mcVec->getNumberOfElements() ; - int* NMCPART = &FTNhep.nhep ; - - for(int j=0;j < *NMCPART;j++) - { - - //for each MCParticle fill hepevt common line - const MCParticle* mcp = - dynamic_cast( mcVec->getElementAt( j ) ) ; - - FTNhep.idhep[j] = mcp->getPDG() ; - FTNhep.isthep[j] = mcp->getGeneratorStatus() ; - - // store mother indices - FTNhep.jmohep[j][0] = 0 ; - FTNhep.jmohep[j][1] = 0 ; - const MCParticle* mcpp = 0 ; - int nparents = mcp->getParents().size() ; - if( nparents > 0 ) mcpp = mcp->getParents()[0] ; - - try{ - for(int jjm=0;jjm < *NMCPART;jjm++) - { - if (mcpp == dynamic_cast(mcVec->getElementAt( jjm )) ){ - FTNhep.jmohep[j][0] = jjm + 1 ; - break ; - } - } - }catch(exception& e){ - } - if ( FTNhep.jmohep[j][0] > 0 ) - { - try{ - const MCParticle* mcpsp = 0 ; - if( mcp->getParents().size() > 1 ) mcpsp = mcp->getParents()[ nparents-1 ] ; - - for(int jjj=0;jjj < *NMCPART;jjj++) - { - - if (mcpsp == dynamic_cast(mcVec->getElementAt( jjj )) ){ - FTNhep.jmohep[j][1] = jjj + 1 ; - break ; - } - } - }catch(exception& e){ - FTNhep.jmohep[j][1] = 0 ; - } - } - - - // store daugther indices - FTNhep.jdahep[j][0] = 0 ; - FTNhep.jdahep[j][1] = 0 ; - // for the StdHep convention particles with GeneratorStatus = 3 have no daughters - if ( FTNhep.isthep[j] != 3 ) - { - int ndaugthers = mcp->getDaughters().size() ; - - if (ndaugthers > 0) - { - const MCParticle* mcpd = mcp->getDaughters()[0] ; - for (int jjj=0; jjj < *NMCPART; jjj++) - { - const MCParticle* mcpdtest = dynamic_cast(mcVec->getElementAt( jjj )) ; - if ( mcpd == mcpdtest ) - { - FTNhep.jdahep[j][0] = jjj + 1 ; - FTNhep.jdahep[j][1] = FTNhep.jdahep[j][0] + ndaugthers -1 ; - break ; - } - } - } - } - - // now momentum, energy, and mass - for(int k=0;k<3;k++) FTNhep.phep[j][k] = (double)mcp->getMomentum()[k] ; - FTNhep.phep[j][3] = (double)mcp->getEnergy() ; - FTNhep.phep[j][4] = (double)mcp->getMass() ; - - // get vertex and production time - *kmax = 0 ; - *maxxyz = 0. ; - for(int k=0;k<3;k++){ - FTNhep.vhep[j][k] = mcp->getVertex()[k] ; - if ( fabs( FTNhep.vhep[j][k] ) > *maxxyz ){ - *maxxyz = fabs( FTNhep.vhep[j][k] ) ; - *kmax = k ; - } - } - if ( mcpp != 0 && *maxxyz > 0. ) - { - FTNhep.vhep[j][3] = FTNhep.vhep[FTNhep.jmohep[j][0]-1][3] - + (mcp->getVertex()[*kmax] - mcpp->getVertex()[*kmax]) * mcpp->getEnergy() - / mcpp->getMomentum()[*kmax] ; - } - else - { - FTNhep.vhep[j][3] = 0. ; // no production time for MCParticle - } - - // finally store pointer and get charge - FTNhep1.mcpointerv[j] = reinterpret_cast( (mcp) ) ; - FTNhep1.mcchargev[j] = mcp->getCharge() ; - } - - delete kmax ; - delete maxxyz ; - } // end of toHepEvt - -} //namespace HEPEVTIMPL - diff --git a/src/cpp/src/CPPFORT/lccah.cc b/src/cpp/src/CPPFORT/lccah.cc deleted file mode 100644 index ef02a225f..000000000 --- a/src/cpp/src/CPPFORT/lccah.cc +++ /dev/null @@ -1,98 +0,0 @@ -#include "CPPFORT/lccah.h" - -#include "lcio.h" -#include "IMPL/CalorimeterHitImpl.h" - -using namespace lcio ; - - -PTRTYPE lccahcreate(){ - CalorimeterHitImpl* hit = new CalorimeterHitImpl ; - return C2F_POINTER( LCObject*, hit ) ; -} -int lccahdelete( PTRTYPE calhit ) { - CalorimeterHitImpl* hit = f2c_pointer( calhit ) ; - delete hit ; - return LCIO::SUCCESS ; -} -int lccahid( PTRTYPE calhit ) { - CalorimeterHitImpl* hit = f2c_pointer( calhit ) ; - return hit->id() ; -} - -int lccahgetcellid0( PTRTYPE calhit ) { - CalorimeterHitImpl* hit = f2c_pointer( calhit ) ; - return hit->getCellID0() ; -} -int lccahgetcellid1( PTRTYPE calhit ) { - CalorimeterHitImpl* hit = f2c_pointer( calhit ) ; - return hit->getCellID1() ; -} -float lccahgetenergy( PTRTYPE calhit ) { - CalorimeterHitImpl* hit = f2c_pointer( calhit ) ; - return hit->getEnergy() ; -} -float lccahgetenergyerr( PTRTYPE calhit ) { - CalorimeterHitImpl* hit = f2c_pointer( calhit ) ; - return hit->getEnergyError() ; -} -float lccahgettime( PTRTYPE calhit ) { - CalorimeterHitImpl* hit = f2c_pointer( calhit ) ; - return hit->getTime() ; -} -int lccahgetposition( PTRTYPE calhit, float *pos) { - CalorimeterHitImpl* hit = f2c_pointer( calhit ) ; - for(int i=0;i<3; *pos++ = hit->getPosition()[i++] ) ; - return LCIO::SUCCESS ; -} -int lccahgettype( PTRTYPE calhit ) { - CalorimeterHitImpl* hit = f2c_pointer( calhit ) ; - return hit->getType() ; -} - -PTRTYPE lccahgetrawhit( PTRTYPE calhit ) { - CalorimeterHitImpl* hit = f2c_pointer( calhit ) ; - return C2F_POINTER( LCObject*, hit->getRawHit() ) ; -} - -int lccahsetcellid0( PTRTYPE calhit, int id0) { - CalorimeterHitImpl* hit = f2c_pointer( calhit ) ; - hit->setCellID0( id0 ) ; - return LCIO::SUCCESS ; -} -int lccahsetcellid1( PTRTYPE calhit, int id1) { - CalorimeterHitImpl* hit = f2c_pointer( calhit ) ; - hit->setCellID1( id1 ) ; - return LCIO::SUCCESS ; -} -int lccahsetenergy( PTRTYPE calhit, float en) { - CalorimeterHitImpl* hit = f2c_pointer( calhit ) ; - hit->setEnergy( en ) ; - return LCIO::SUCCESS ; -} -int lccahsetenergyerr( PTRTYPE calhit, float enerr) { - CalorimeterHitImpl* hit = f2c_pointer( calhit ) ; - hit->setEnergyError( enerr ) ; - return LCIO::SUCCESS ; -} -int lccahsettime( PTRTYPE calhit, float time) { - CalorimeterHitImpl* hit = f2c_pointer( calhit ) ; - hit->setTime( time ) ; - return LCIO::SUCCESS ; -} -int lccahsetposition( PTRTYPE calhit, float pos[3]) { - CalorimeterHitImpl* hit = f2c_pointer( calhit ) ; - hit->setPosition( pos ) ; - return LCIO::SUCCESS ; -} -int lccahsettype( PTRTYPE calhit, int type) { - CalorimeterHitImpl* hit = f2c_pointer( calhit ) ; - hit->setType( type ) ; - return LCIO::SUCCESS ; -} -int lccahsetrawhit(PTRTYPE calhit, PTRTYPE rawHit) { - CalorimeterHitImpl* hit = f2c_pointer( calhit ) ; - hit->setRawHit( f2c_pointer( rawHit ) ) ; - return LCIO::SUCCESS ; -} - diff --git a/src/cpp/src/CPPFORT/lcclu.cc b/src/cpp/src/CPPFORT/lcclu.cc deleted file mode 100644 index 8eba76080..000000000 --- a/src/cpp/src/CPPFORT/lcclu.cc +++ /dev/null @@ -1,247 +0,0 @@ -#include "CPPFORT/lcclu.h" - -#include "lcio.h" -#include "IMPL/ClusterImpl.h" - -using namespace lcio ; - -#include - -// create delete Cluster - -PTRTYPE lcclucreate(){ - ClusterImpl* clu = new ClusterImpl ; - return C2F_POINTER( LCObject*, clu ) ; -} -int lccludelete( PTRTYPE cluster ){ - ClusterImpl* clu = f2c_pointer( cluster ) ; - delete clu ; - return LCIO::SUCCESS ; -} - - -// get Methods - -int lccluid( PTRTYPE cluster ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - return clu->id() ; -} - -int lcclugettype( PTRTYPE cluster ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - return clu->getType() ; -} - -// int lcclutesttype( PTRTYPE cluster , int bit ) { -// ClusterImpl* clu = f2c_pointer( cluster ) ; -// return clu->testType( bit ) ; -// } - -float lcclugetenergy( PTRTYPE cluster ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - return clu->getEnergy() ; -} -float lcclugetenergyerr( PTRTYPE cluster ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - return clu->getEnergyError() ; -} -int lcclugetposition( PTRTYPE cluster, float* pos ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - for( int i=0 ; i<3 ; *pos++ = clu->getPosition()[i++] ) ; - return LCIO::SUCCESS ; -} - -int lcclugetpositionerror( PTRTYPE cluster, float poserr[6] ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - for( int i=0 ; i<6 ; *poserr++ = clu->getPositionError()[i++] ) ; - return LCIO::SUCCESS ; -} - -float lcclugetitheta( PTRTYPE cluster ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - return clu->getITheta() ; -} - -float lcclugetiphi( PTRTYPE cluster ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - return clu->getIPhi() ; -} - -int lcclugetdirectionerror( PTRTYPE cluster, float direrr[3] ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - for( int i=0 ; i<3 ; *direrr++ = clu->getDirectionError()[i++] ) ; - return LCIO::SUCCESS ; -} - -// int lcclugetparticletype( PTRTYPE cluster, float weights[3] ) { -// ClusterImpl* clu = f2c_pointer( cluster ) ; -// for( int i=0 ; i<3 ; *weights++ = clu->getParticleType()[i++] ) ; -// return LCIO::SUCCESS ; -// } - -// int lcclugetshape( PTRTYPE cluster, float shape[6] ) { -// ClusterImpl* clu = f2c_pointer( cluster ) ; -// for( int i=0 ; i<6 ; *shape++ = clu->getShape()[i++] ) ; -// return LCIO::SUCCESS ; -// } - -PTRTYPE lcclugetshape( PTRTYPE cluster ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - const FloatVec& shape = clu->getShape(); - return reinterpret_cast( &shape ); -} - -PTRTYPE lcclugetparticleids( PTRTYPE cluster ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - const ParticleIDVec& idvect = clu->getParticleIDs(); - return reinterpret_cast( &idvect ); -} - -PTRTYPE lcclugetclusters( PTRTYPE cluster ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - const ClusterVec& idvect = clu->getClusters(); - return reinterpret_cast( &idvect ); -} - -PTRTYPE lcclugetcalorimeterhits( PTRTYPE cluster ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - const CalorimeterHitVec& idvect = clu->getCalorimeterHits(); - return reinterpret_cast( &idvect ); -} - -PTRTYPE lcclugetsubdetectorenergies( PTRTYPE cluster ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - const FloatVec& idvect = clu->getSubdetectorEnergies(); - return reinterpret_cast( &idvect ); -} - -int lcclugethitcontributions( PTRTYPE cluster, float* weights, int* nweights ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - int ntot = *nweights -1 ; - for(unsigned int l=0;lgetCalorimeterHits().size();l++){ - if ( l > (unsigned)ntot ) { - std::cout << "LCCluster: in getHitContributions more than " << ntot << "weights to store" << std::endl ; - return LCIO::ERROR ; - } - *weights++ = clu->getHitContributions()[l] ; - } - *nweights = (int)(clu->getCalorimeterHits().size() + 1); - return LCIO::SUCCESS ; -} - - -// set,add Methods - -// int lcclusettype( PTRTYPE cluster, int type ) { -// ClusterImpl* clu = f2c_pointer( cluster ) ; -// clu->setType( type ) ; -// return LCIO::SUCCESS ; -// } -int lcclusettypebit( PTRTYPE cluster, int bit , int val) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - clu->setTypeBit( bit , val ) ; - return LCIO::SUCCESS ; -} - -int lcclusetenergy( PTRTYPE cluster, float energy ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - clu->setEnergy( energy ) ; - return LCIO::SUCCESS ; -} - -int lcclusetenergyerr( PTRTYPE cluster, float enerr ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - clu->setEnergyError( enerr ) ; - return LCIO::SUCCESS ; -} - -int lcclusetposition( PTRTYPE cluster, float pos[3] ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - clu->setPosition( pos ) ; - return LCIO::SUCCESS ; -} - - -int lcclusetpositionerror( PTRTYPE cluster, float errpos[3] ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - clu->setPositionError( errpos ) ; - return LCIO::SUCCESS ; -} - -int lcclusetitheta( PTRTYPE cluster, float theta) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - clu->setITheta( theta ) ; - return LCIO::SUCCESS ; -} - -int lcclusetiphi( PTRTYPE cluster, float phi ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - clu->setIPhi( phi ) ; - return LCIO::SUCCESS ; -} - -int lcclusetdirectionerror( PTRTYPE cluster, float errdir[3] ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - clu->setDirectionError( errdir ) ; - return LCIO::SUCCESS ; -} - -int lcclusetshape( PTRTYPE cluster, PTRTYPE vector ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - FloatVec* shape = reinterpret_cast(vector) ; - clu->setShape( *shape ) ; - return LCIO::SUCCESS ; -} - -// int lcclusetemweight( PTRTYPE cluster, float weight) { -// ClusterImpl* clu = f2c_pointer( cluster ) ; -// clu->setEMWeight( weight ) ; -// return LCIO::SUCCESS ; -// } - -// int lcclusethadweight( PTRTYPE cluster, float weight) { -// ClusterImpl* clu = f2c_pointer( cluster ) ; -// clu->setHADWeight( weight ) ; -// return LCIO::SUCCESS ; -// } - -// int lcclusetmuonweight( PTRTYPE cluster, float weight) { -// ClusterImpl* clu = f2c_pointer( cluster ) ; -// clu->setMuonWeight( weight ) ; -// return LCIO::SUCCESS ; -// } - - -int lccluaddparticleid( PTRTYPE cluster, PTRTYPE pid) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - ParticleID* cpid = f2c_pointer( pid ) ; - clu->addParticleID( cpid ) ; - return LCIO::SUCCESS ; -} - -int lccluaddcluster( PTRTYPE cluster, PTRTYPE clus) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - Cluster* cclus = f2c_pointer( clus ) ; - clu->addCluster( cclus ) ; - return LCIO::SUCCESS ; -} - -int lccluaddhit( PTRTYPE cluster, PTRTYPE calohit, float weight ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - CalorimeterHit* ccalh = f2c_pointer( calohit ) ; - clu->addHit( ccalh, weight ) ; - return LCIO::SUCCESS ; -} - -int lcclusetsubdetectorenergies( PTRTYPE cluster, float* floatv, const int nfloatv ) { - ClusterImpl* clu = f2c_pointer( cluster ) ; - FloatVec& floatvec = clu->subdetectorEnergies() ; - floatvec.resize( nfloatv ) ; - for(int j=0;j - -using namespace lcio ; -using namespace std ; - -PTRTYPE lccolcreate( const char* colname ){ - LCCollectionVec* col = new LCCollectionVec( colname ) ; - return reinterpret_cast( col ) ; -} -int lccoldelete( PTRTYPE collection ){ - LCCollectionVec* col = reinterpret_cast(collection) ; - delete col ; - return LCIO::SUCCESS ; -} - -int lccolgetnumberofelements( PTRTYPE collection ){ - LCCollectionVec* col = reinterpret_cast(collection) ; - return col->getNumberOfElements() ; -} - -char* lccolgettypename( PTRTYPE collection ){ - const LCCollectionVec* col = reinterpret_cast( (collection) ) ; - return const_cast( col->getTypeName().c_str() ) ; -} - -PTRTYPE lccolgetelementat( PTRTYPE collection, int index ){ - LCCollectionVec* col = reinterpret_cast(collection) ; -// return reinterpret_cast( col->getElementAt( index - 1 ) ) ; - return C2F_POINTER( LCObject*, col->getElementAt( index - 1 ) ) ; -} - -int lccolgetflag(PTRTYPE collection){ - LCCollectionVec* col = reinterpret_cast(collection) ; - return col->getFlag() ; -} - -bool lccolistransient(PTRTYPE collection){ - LCCollectionVec* col = reinterpret_cast(collection) ; - return col->isTransient() ; -} - -int lccolsettransient(PTRTYPE collection, bool value){ - LCCollectionVec* col = reinterpret_cast(collection) ; - col->setTransient( value) ; - return LCIO::SUCCESS ; -} -bool lccolisdefault(PTRTYPE collection){ - LCCollectionVec* col = reinterpret_cast(collection) ; - return col->isDefault() ; -} - -int lccolsetdefault(PTRTYPE collection, bool value){ - LCCollectionVec* col = reinterpret_cast(collection) ; - col->setDefault( value) ; - return LCIO::SUCCESS ; -} - -int lccolsetflag(PTRTYPE collection, int flag){ - LCCollectionVec* col = reinterpret_cast(collection) ; - col->setFlag( flag) ; - return LCIO::SUCCESS ; -} -int lccoladdelement(PTRTYPE collection, PTRTYPE object){ - try{ - LCCollectionVec* col = reinterpret_cast(collection) ; - col->addElement( reinterpret_cast(object) ) ; - - }catch(...){ return LCIO::ERROR ; } - return LCIO::SUCCESS ; -} - -int lccolremoveelementat(PTRTYPE collection, int i){ - try{ - LCCollectionVec* col = reinterpret_cast(collection) ; - col->removeElementAt( i ) ; - }catch(...){ return LCIO::ERROR ; } - return LCIO::SUCCESS ; -} - diff --git a/src/cpp/src/CPPFORT/lcevt.cc b/src/cpp/src/CPPFORT/lcevt.cc deleted file mode 100644 index e766c66d3..000000000 --- a/src/cpp/src/CPPFORT/lcevt.cc +++ /dev/null @@ -1,127 +0,0 @@ -#include "CPPFORT/lcevt.h" - -#include "lcio.h" -#include "IOIMPL/LCFactory.h" -#include "IMPL/LCRunHeaderImpl.h" -#include "IMPL/LCEventImpl.h" -#include "IMPL/LCCollectionVec.h" -#include "IMPL/LCTOOLS.h" -#include - - -using namespace lcio ; - - -PTRTYPE lcevtcreate(){ - LCEventImpl* event = new LCEventImpl() ; - return reinterpret_cast( event ) ; -} - -int lcevtdelete( PTRTYPE event ){ - LCEventImpl* evt = reinterpret_cast(event) ; - delete evt ; - return LCIO::SUCCESS ; -} - -int lcevtgetrunnumber( PTRTYPE event ){ - LCEventImpl* evt = reinterpret_cast(event) ; - return evt->getRunNumber() ; -} - -int lcevtgeteventnumber( PTRTYPE event ){ - LCEventImpl* evt = reinterpret_cast(event) ; - return evt->getEventNumber() ; -} - -char* lcevtgetdetectorname( PTRTYPE event ){ - LCEventImpl* evt = reinterpret_cast(event) ; - return const_cast (evt->getDetectorName().c_str() ) ; -} - -PTRTYPE lcevtgetcollectionnames( PTRTYPE event ){ - LCEventImpl* evt = reinterpret_cast(event) ; - return reinterpret_cast ( evt->getCollectionNames() ) ; -} - -// PTRTYPE lcevtgettrelationnames( PTRTYPE event ){ -// LCEventImpl* evt = reinterpret_cast(event) ; -// return reinterpret_cast ( evt->getRelationNames() ) ; -// } - -long lcevtgettimestamp( PTRTYPE event ) -{ - LCEventImpl* evt = reinterpret_cast(event) ; - return evt->getTimeStamp() ; -} - -PTRTYPE lcevtgetcollection(PTRTYPE event, const char* colname){ - try{ - LCEventImpl* evt = reinterpret_cast(event) ; - return reinterpret_cast( evt->getCollection( colname ) ) ; - }catch(...){ return 0 ;} -} - -// PTRTYPE lcevtgetrelation(PTRTYPE event, const char* colname){ -// try{ -// LCEventImpl* evt = reinterpret_cast(event) ; -// return reinterpret_cast( evt->getRelation( colname ) ) ; -// }catch(...){ return 0 ;} -// } - -int lcevtaddcollection( PTRTYPE event, PTRTYPE collection, char* colname ){ - try{ - LCEventImpl* evt = reinterpret_cast(event) ; - LCCollectionVec* col = reinterpret_cast(collection) ; - evt->addCollection( col , colname ) ; - }catch(...){ return LCIO::ERROR ; } - return LCIO::SUCCESS ; -} - -int lcevtremovecollection( PTRTYPE event, char* colname ){ - try{ - LCEventImpl* evt = reinterpret_cast(event) ; - evt->removeCollection( colname ) ; - }catch(...){ return LCIO::ERROR ; } - return LCIO::SUCCESS ; -} - -// int lcevtaddrelation( PTRTYPE event, PTRTYPE relation, char* colname ){ -// try{ -// LCEventImpl* evt = reinterpret_cast(event) ; -// LCRelation* rel = reinterpret_cast(relation) ; -// evt->addRelation( rel , colname ) ; -// }catch(...){ return LCIO::ERROR ; } -// return LCIO::SUCCESS ; -// } - -// int lcevtremoverelation( PTRTYPE event, const char* colname ){ -// try{ -// LCEventImpl* evt = reinterpret_cast(event) ; -// evt->removeRelation( colname ) ; -// }catch(...){ return LCIO::ERROR ; } -// return LCIO::SUCCESS ; -// } - -int lcevtsetrunnumber( PTRTYPE event, int rn ){ - LCEventImpl* evt = reinterpret_cast(event) ; - evt->setRunNumber( rn ) ; - return LCIO::SUCCESS ; -} - -int lcevtseteventnumber( PTRTYPE event, int en ){ - LCEventImpl* evt = reinterpret_cast(event) ; - evt->setEventNumber( en ) ; - return LCIO::SUCCESS ; -} - -int lcevtsetdetectorname( PTRTYPE event, char* dn ){ - LCEventImpl* evt = reinterpret_cast(event) ; - evt->setDetectorName( dn ) ; - return LCIO::SUCCESS ; -} - -int lcevtsettimestamp( PTRTYPE event, long ts ){ - LCEventImpl* evt = reinterpret_cast(event) ; - evt->setTimeStamp( ts ) ; - return LCIO::SUCCESS ; -} diff --git a/src/cpp/src/CPPFORT/lcgob.cc b/src/cpp/src/CPPFORT/lcgob.cc deleted file mode 100644 index 0c6db5b6e..000000000 --- a/src/cpp/src/CPPFORT/lcgob.cc +++ /dev/null @@ -1,98 +0,0 @@ - -#include "lcio.h" -#include "CPPFORT/lcgob.h" -#include "IMPL/LCGenericObjectImpl.h" - -#include - -using namespace lcio ; - - PTRTYPE lcgobcreate(){ - LCGenericObjectImpl* object = new LCGenericObjectImpl() ; - return reinterpret_cast( object ) ; - } - - PTRTYPE lcgobcreatefixed( int nint, int nfloat, int ndouble ){ - LCGenericObjectImpl* object = new LCGenericObjectImpl( nint, nfloat, ndouble ) ; - return reinterpret_cast( object ) ; - - } - - int lcgobdelete( PTRTYPE genericobject ){ - LCGenericObjectImpl* object = reinterpret_cast( genericobject ) ; - delete object ; - return LCIO::SUCCESS ; - - } - - int lcgobid( PTRTYPE genericobject ){ - LCGenericObjectImpl* object = reinterpret_cast( genericobject ) ; - return object->id() ; - } - - int lcgobgetnint( PTRTYPE genericobject ){ - LCGenericObjectImpl* object = reinterpret_cast( genericobject ) ; - return object->getNInt() ; - } - - int lcgobgetnfloat( PTRTYPE genericobject ){ - LCGenericObjectImpl* object = reinterpret_cast( genericobject ) ; - return object->getNFloat() ; - } - - int lcgobgetndouble( PTRTYPE genericobject ){ - LCGenericObjectImpl* object = reinterpret_cast( genericobject ) ; - return object->getNDouble() ; - } - - int lcgobgetintval( PTRTYPE genericobject, int index ){ - LCGenericObjectImpl* object = reinterpret_cast( genericobject ) ; - return object->getIntVal(index-1) ; - } - - float lcgobgetfloatval( PTRTYPE genericobject, int index ){ - LCGenericObjectImpl* object = reinterpret_cast( genericobject ) ; - return object->getFloatVal(index-1) ; - } - - double lcgobgetdoubleval( PTRTYPE genericobject, int index ){ - LCGenericObjectImpl* object = reinterpret_cast( genericobject ) ; - return object->getDoubleVal(index-1) ; - } - - - int lcgobsetintval( PTRTYPE genericobject, int index, int value ){ - LCGenericObjectImpl* object = reinterpret_cast( genericobject ) ; - object->setIntVal(index-1, value) ; - return LCIO::SUCCESS ; - } - - int lcgobsetfloatval( PTRTYPE genericobject, int index, float value ){ - LCGenericObjectImpl* object = reinterpret_cast( genericobject ) ; - object->setFloatVal(index-1, value) ; - return LCIO::SUCCESS ; - } - - int lcgobsetdoubleval( PTRTYPE genericobject, int index, double value ){ - LCGenericObjectImpl* object = reinterpret_cast( genericobject ) ; - object->setDoubleVal(index-1, value) ; - return LCIO::SUCCESS ; - } - - - bool lcgobisfixedsize( PTRTYPE genericobject ){ - LCGenericObjectImpl* object = reinterpret_cast( genericobject ) ; - return object->isFixedSize() ; - } - - char* lcgobgettypename( PTRTYPE genericobject ){ - LCGenericObjectImpl* object = reinterpret_cast( genericobject ) ; - return const_cast( object->getTypeName().c_str() ) ; - } - - char* lcgobgetdatadescription( PTRTYPE genericobject ){ - LCGenericObjectImpl* object = reinterpret_cast( genericobject ) ; - return const_cast( object->getDataDescription().c_str() ) ; - } - - diff --git a/src/cpp/src/CPPFORT/lciof77apiext.cc b/src/cpp/src/CPPFORT/lciof77apiext.cc deleted file mode 100644 index 0b9052104..000000000 --- a/src/cpp/src/CPPFORT/lciof77apiext.cc +++ /dev/null @@ -1,622 +0,0 @@ -#include "CPPFORT/lciof77apiext.h" - -#include "lcio.h" - -#include "IOIMPL/LCFactory.h" -#include "IMPL/LCRunHeaderImpl.h" -#include "IMPL/LCEventImpl.h" -#include "IMPL/LCCollectionVec.h" -#include "IMPL/SimTrackerHitImpl.h" -#include "IMPL/SimCalorimeterHitImpl.h" -#include "IMPL/LCTOOLS.h" - -#include "CPPFORT/HEPEVT.h" -#include "EVENT/LCIntVec.h" -#include "EVENT/LCFloatVec.h" -#include "EVENT/LCStrVec.h" - -#include -#include - -// typedef std::vector LCStrVec ; - -#include - - -using namespace lcio ; -using namespace std ; -using namespace HEPEVTIMPL ; - - -static std::vector filenamelist ; - -int do_set_method (LCParameters& params, const char* method, const char* key, PTRTYPE vector); -int do_get_method (const LCParameters& params, const char* method, const char* key, PTRTYPE vector); - - -int lcrdropenchain( PTRTYPE reader, void* filenamesv , const int nfiles , const int nchfilename ){ - - - try { -// if an old filenamelist exist clear it - - if ( filenamelist.size() > 0 ) filenamelist.clear() ; - int elemlen = nchfilename +1 ; - PTRTYPE stringpos = reinterpret_cast( filenamesv ) ; - for (int j=0;j < nfiles;j++) - { - char* filename = reinterpret_cast( stringpos ) ; - filenamelist.push_back( filename ) ; - stringpos = stringpos + elemlen ; - } - LCReader* lcReader = reinterpret_cast( (reader) ) ; - lcReader->open( filenamelist ) ; - return LCIO::SUCCESS ; - }catch( Exception& e1) { - std::cerr << "Exception in LCRdrOpenChain: " << e1.what() << std::endl ; - return LCIO::ERROR ; - } -} - -int lcwriterunheader( PTRTYPE writer , const int irun , const char* detname , - const char* description , void* sdnamevec , const int nsubd, - const int nchsd){ - - try { - LCWriter* lcWriter = reinterpret_cast( (writer) ) ; - LCRunHeaderImpl* runHdr = new LCRunHeaderImpl ; - runHdr->setRunNumber( irun ) ; - runHdr->setDetectorName( detname ) ; - runHdr->setDescription( description ) ; - - int elemlen = nchsd + 1 ; - PTRTYPE stringpos = reinterpret_cast( sdnamevec ) ; - for (int j=0;j < nsubd;j++) - { - char* subdetectorname = reinterpret_cast( stringpos ) ; - runHdr->addActiveSubdetector( subdetectorname ) ; - stringpos = stringpos + elemlen ; - } - lcWriter->writeRunHeader( runHdr ) ; - delete runHdr ; - return LCIO::SUCCESS ; - }catch( Exception& e1) { - std::cerr << "Exception in LCWriteRunHeader: " << e1.what() << std::endl ; - return LCIO::ERROR ; - } -} - -PTRTYPE lcreadnextrunheader(PTRTYPE reader , int* irun , void* detname , void* description , - void* sdnamevec , int* nsubd , const int nchsubd){ - - LCReader* lcReader = reinterpret_cast( (reader) ) ; - try { - LCRunHeader* runHdr = lcReader->readNextRunHeader() ; - *irun = runHdr->getRunNumber() ; - - PTRTYPE stringpos ; - stringpos = reinterpret_cast( detname ) ; - char* detnam = reinterpret_cast( stringpos ) ; - const char* detectorname = runHdr->getDetectorName().c_str() ; - strcpy(detnam,detectorname) ; - stringpos = reinterpret_cast( description ) ; - char* descr = reinterpret_cast( stringpos ) ; - const char* rundescription = runHdr->getDescription().c_str() ; - strcpy(descr,rundescription) ; - - const std::vector* strVec = runHdr->getActiveSubdetectors() ; - - int elemlen = nchsubd + 1; - *nsubd = strVec->size() ; - stringpos = reinterpret_cast( sdnamevec ) ; - for( std::vector::const_iterator name = strVec->begin() ; name != strVec->end() ; name++){ - std::string out = *name ; - char* tmpname = reinterpret_cast( stringpos ) ; - const char* subdname = const_cast( out.c_str() ) ; - strcpy(tmpname,subdname) ; - stringpos = stringpos + elemlen ; - } - - return reinterpret_cast(runHdr) ; - }catch( Exception& e1) { - std::cerr << "Exception in LCReadNextRunHeader: " << e1.what() << std::endl ; - return LCIO::ERROR ; - } -} - - - -int lcseteventheader( PTRTYPE event, const int irun, const int ievent, const int timestamp, const char* detname ){ - LCEventImpl* lcEventImpl = reinterpret_cast( (event) ) ; - lcEventImpl->setRunNumber( irun ) ; - lcEventImpl->setEventNumber( ievent ) ; - lcEventImpl->setTimeStamp( timestamp ) ; - lcEventImpl->setDetectorName( detname ) ; - return LCIO::SUCCESS ; -} - -int lcgeteventheader( PTRTYPE event, int* irun, int* ievent, int* timestamp, void* detname ){ - LCEventImpl* lcEvent = reinterpret_cast( (event) ) ; - *irun = lcEvent->getRunNumber() ; - *ievent = lcEvent->getEventNumber() ; - *timestamp = lcEvent->getTimeStamp() ; - PTRTYPE stringpos = reinterpret_cast( detname ) ; - char* detnam = reinterpret_cast( stringpos ) ; - const char* detectorname = lcEvent->getDetectorName().c_str() ; - strcpy(detnam,detectorname) ; - return LCIO::SUCCESS ; -} -int lcdumprunheader( PTRTYPE runheader ){ - LCRunHeader* runhdr = reinterpret_cast( (runheader) ) ; - LCTOOLS::dumpRunHeader( runhdr ) ; - return LCIO::SUCCESS ; -} - -int lcdumpevent( PTRTYPE event ){ - LCEventImpl* lcEvent = reinterpret_cast( (event) ) ; - LCTOOLS::dumpEvent( lcEvent ) ; - return LCIO::SUCCESS ; -} - -int lcdumpeventdetailed ( PTRTYPE event ){ - LCEventImpl* lcEvent = reinterpret_cast( (event) ) ; - LCTOOLS::dumpEventDetailed( lcEvent ) ; - return LCIO::SUCCESS ; -} - - -int lcgetmcparticledata( PTRTYPE mcparticle, int* pdg, int* genstatus, int* simstatus - , double* prodvtx, float* momentum, float* mass, float* charge, - int* ndaughters ){ - - MCParticle* lcMCParticle = f2c_pointer( mcparticle ) ; - - *pdg = lcMCParticle->getPDG() ; - *genstatus = lcMCParticle->getGeneratorStatus() ; - *simstatus = lcMCParticle->getSimulatorStatus() ; - const double* dtmp = lcMCParticle->getVertex() ; - for(int k=0;k<3;k++) *prodvtx++ = dtmp[k] ; - - - const double* tmp = lcMCParticle->getMomentum() ; - - for(int k=0;k<3;k++) *momentum++ = (float) tmp[k] ; - *mass = lcMCParticle->getMass() ; - *charge = lcMCParticle->getCharge() ; - *ndaughters = lcMCParticle->getDaughters().size() ; - return LCIO::SUCCESS ; -} - - -int lcaddsimtrackerhit( PTRTYPE collectionvec, int cellID0, double* pos, float dEdx, - float time, PTRTYPE mcp ){ - - LCCollectionVec* lcCollectionVec = reinterpret_cast( (collectionvec) ) ; - SimTrackerHitImpl* hit = new SimTrackerHitImpl ; - MCParticle* mmcp = f2c_pointer( mcp ) ; - - hit->setCellID0( cellID0 ) ; - hit->setPosition( pos ) ; - hit->setEDep( dEdx ) ; - hit->setTime( time ) ; - hit->setMCParticle( mmcp ) ; - - lcCollectionVec->push_back( hit ) ; - return LCIO::SUCCESS ; -} - -int lcgetsimtrackerhit( PTRTYPE collection, int i, int* cellID, double* pos, float* dEdx, float* time, PTRTYPE* mcp ){ - LCCollectionVec* lcCollection = reinterpret_cast( (collection) ) ; - SimTrackerHit* hit = dynamic_cast( lcCollection->getElementAt( i-1 ) ) ; - - *cellID = hit->getCellID() ; - const double* tmp = hit->getPosition() ; - for(int k=0;k<3;k++) *pos++ = tmp[k] ; - *dEdx = hit->getdEdx() ; - *time = hit->getTime() ; - *mcp = reinterpret_cast( hit->getMCParticle() ) ; - return LCIO::SUCCESS ; -} - - -PTRTYPE lcaddsimcalohit( PTRTYPE col, int cellID0, int cellID1, float energy, float* pos ) { - LCCollectionVec* lcCollection = reinterpret_cast( col ) ; - SimCalorimeterHitImpl* lcHit = new SimCalorimeterHitImpl ; - lcHit->setCellID0( cellID0 ) ; - lcHit->setCellID1( cellID1 ) ; - lcHit->setEnergy( energy ) ; - lcHit->setPosition( pos ) ; - lcCollection->addElement( lcHit ) ; - return C2F_POINTER( LCObject*, lcHit ) ; -} - - -PTRTYPE lcgetsimcalohit( PTRTYPE collection, int i, int* cellID0, int* cellID1, - float* energy, float* pos ) { - - LCCollectionVec* lcCollection = reinterpret_cast( collection ) ; - - // checking on i ! - const int Nelements = lcCollection->getNumberOfElements() ; - if (i < 0 && i > Nelements-1) { - std::cerr << "Exception in LCGetSimCaloHit: index " << i << " out of range" << std::endl ; - return LCIO::ERROR ; - } - - SimCalorimeterHit* lcHit = dynamic_cast( lcCollection->getElementAt( i-1 ) ) ; - *cellID0 = lcHit->getCellID0() ; - *cellID1 = lcHit->getCellID1() ; - *energy = lcHit->getEnergy() ; - const float* tmp = lcHit->getPosition() ; - for(int k=0;k<3;k++) *pos++ = tmp[k] ; - - return C2F_POINTER( LCObject*, lcHit ) ; -} - -int lcgetsimcalohitmccont( PTRTYPE hit, int i, PTRTYPE* mcp, float* energy, float* time, int* pdg ) { - - SimCalorimeterHitImpl* lcHit = f2c_pointer( hit ) ; -// checking on i ! - const int Nelements = lcHit->getNMCContributions() ; - if (i < 0 && i > Nelements-1) { - std::cerr << "Exception in lcgetsimcalohitmccont: index " << i << " out of range" << std::endl ; - return LCIO::ERROR ; - } - - *mcp = C2F_POINTER( LCObject*, lcHit->getParticleCont(i-1) ) ; - *energy = lcHit->getEnergyCont( i-1 ) ; - *time = lcHit->getTimeCont( i-1 ) ; - *pdg = lcHit->getPDGCont( i-1 ) ; - return LCIO::SUCCESS ; -} - -int hepevt2lcio( PTRTYPE evtout ){ - LCEventImpl* lcEvent = reinterpret_cast( evtout ) ; - try { - HEPEVT::fromHepEvt( lcEvent ) ; - return LCIO::SUCCESS ; - }catch( Exception& e1) { - std::cerr << "Exception in lcio2hepevt: " << e1.what() << std::endl ; - return LCIO::ERROR ; - } -} - - -int lcio2hepevt( PTRTYPE event ){ - LCEvent* lcEvent = reinterpret_cast( event ) ; - try { - HEPEVT::toHepEvt( lcEvent ) ; - return LCIO::SUCCESS ; - }catch( Exception& e1) { - std::cerr << "Exception in hepevt2lcio: " << e1.what() << std::endl ; - return LCIO::ERROR ; - } -} - - -PTRTYPE lcobjectvectorcreate( PTRTYPE* objectv, const int nobjv ){ - LCObjectVec* objVec = new LCObjectVec ; - for(int j=0;j( objectv[j] ) ; - objVec->push_back( obj ) ; - } - return reinterpret_cast( objVec ) ; -} - -PTRTYPE lcintvectorcreate( int* intv, const int nintv ){ - LCIntVec* intVec = new LCIntVec ; - for(int j=0;jpush_back( intv[j] ) ; - return reinterpret_cast( intVec ) ; -} - -PTRTYPE lcfloatvectorcreate( float* floatv, const int nfloatv ){ - LCFloatVec* floatVec = new LCFloatVec ; - for(int j=0;jpush_back( floatv[j] ) ; - return reinterpret_cast( floatVec ) ; -} - -PTRTYPE lcstringvectorcreate( void* stringv, const int nstringv, const int nchstringv){ - LCStrVec* stringVec = new LCStrVec ; - int elemlen = nchstringv + 1; - PTRTYPE stringpos = 0 ; - stringpos = reinterpret_cast( stringv ) ; - for(int j=0;j( stringpos ) ; - stringVec->push_back( mystring ) ; - stringpos = stringpos + elemlen ; - } - return reinterpret_cast( stringVec ) ; -} - -int lcgetintvector( PTRTYPE vector, int* intv, int* nintv ){ - LCIntVec* intVec = f2c_pointer(vector) ; - int intVecLength = 0; - intVecLength = intVec->size() ; - if (intVecLength > *nintv) { - std::cerr << "Warning in lcgetintvector: vector size " << intVecLength - << " larger then target array size " << *nintv << std::endl ; - intVecLength = *nintv ; - } - else { - *nintv = intVecLength ; - } - for (int j=0;j < intVecLength;j++) *intv++ = (*intVec)[j] ; - return LCIO::SUCCESS ; -} - -int lcgetfloatvector( PTRTYPE vector, float* floatv, int* nfloatv ){ - LCFloatVec* floatVec = f2c_pointer(vector) ; - int floatVecLength = 0 ; - floatVecLength = floatVec->size() ; - if (floatVecLength > *nfloatv) { - std::cerr << "Warning in lcgetfloatvector: vector size " << floatVecLength - << " larger then target array size " << *nfloatv << std::endl ; - floatVecLength = *nfloatv ; - } - else { - *nfloatv = floatVecLength ; - } - for (int j=0;j < floatVecLength;j++) *floatv++ = (*floatVec)[j] ; - return LCIO::SUCCESS ; -} - - -int lcgetstringvector( PTRTYPE vector, void* stringv, int* nstringv, const int nchstringv){ - LCStrVec* stringVec = reinterpret_cast(vector) ; - int stringVecLength = 0 ; - stringVecLength = stringVec->size() ; - if (stringVecLength > *nstringv) { - std::cerr << "Warning in lcgetstringvector: vector size " << stringVecLength - << " larger then target array size " << *nstringv << std::endl ; - stringVecLength = *nstringv ; - } - else { - *nstringv = stringVecLength ; - } - int elemlen = nchstringv + 1; - PTRTYPE stringpos = 0 ; - stringpos = reinterpret_cast( stringv ) ; - for (int j=0;j < stringVecLength;j++) { - char* outstring = const_cast( (*stringVec)[j].c_str() ); - char* tmpstring = reinterpret_cast( stringpos ) ; - strcpy(tmpstring,outstring) ; - stringpos = stringpos + elemlen ; - } - return LCIO::SUCCESS ; -} - - -PTRTYPE intvectorcreate( int* intv, const int nintv ){ - IntVec* intVec = new IntVec ; - for(int j=0;jpush_back( intv[j] ) ; - return reinterpret_cast( intVec ) ; -} - -int intvectordelete( PTRTYPE vector ){ - IntVec* intVec = reinterpret_cast(vector) ; - delete intVec ; - return LCIO::SUCCESS ; -} - -PTRTYPE floatvectorcreate( float* floatv, const int nfloatv ){ - FloatVec* floatVec = new FloatVec ; - for(int j=0;jpush_back( floatv[j] ) ; - return reinterpret_cast( floatVec ) ; -} - -int floatvectordelete( PTRTYPE vector ){ - FloatVec* floatVec = reinterpret_cast(vector) ; - delete floatVec ; - return LCIO::SUCCESS ; -} - -PTRTYPE stringvectorcreate( void* stringv, const int nstringv, const int nchstringv){ - StringVec* stringVec = new StringVec ; - int elemlen = nchstringv + 1; - PTRTYPE stringpos = 0 ; - stringpos = reinterpret_cast( stringv ) ; - for(int j=0;j( stringpos ) ; - stringVec->push_back( mystring ) ; - stringpos = stringpos + elemlen ; - } - return reinterpret_cast( stringVec ) ; -} - -int stringvectordelete( PTRTYPE vector ){ - StringVec* stringVec = reinterpret_cast(vector) ; - delete stringVec ; - return LCIO::SUCCESS ; -} - -PTRTYPE pointervectorcreate( PTRTYPE* pointerv, const int npointerv ){ - PointerVec* pointerVec = new PointerVec ; - for(int j=0;jpush_back( pointerv[j] ) ; - return reinterpret_cast( pointerVec ) ; -} - -int pointervectordelete( PTRTYPE vector ){ - PointerVec* pointerVec = reinterpret_cast(vector) ; - delete pointerVec ; - return LCIO::SUCCESS ; -} - - -int getintvector( PTRTYPE vector, int* intv, int* nintv ){ - IntVec* intVec = reinterpret_cast(vector) ; - int intVecLength = 0; - intVecLength = intVec->size() ; - if (intVecLength > *nintv) { - std::cerr << "Warning in getintvector: vector size " << intVecLength - << " larger then target array size " << *nintv << std::endl ; - intVecLength = *nintv ; - } - else { - *nintv = intVecLength ; - } - for (int j=0;j < intVecLength;j++) *intv++ = (*intVec)[j] ; - return LCIO::SUCCESS ; -} - -int getfloatvector( PTRTYPE vector, float* floatv, int* nfloatv ){ - FloatVec* floatVec = reinterpret_cast(vector) ; - int floatVecLength = 0 ; - floatVecLength = floatVec->size() ; - if (floatVecLength > *nfloatv) { - std::cerr << "Warning in getfloatvector: vector size " << floatVecLength - << " larger then target array size " << *nfloatv << std::endl ; - floatVecLength = *nfloatv ; - } - else { - *nfloatv = floatVecLength ; - } - for (int j=0;j < floatVecLength;j++) *floatv++ = (*floatVec)[j] ; - return LCIO::SUCCESS ; -} - - -int getstringvector( PTRTYPE vector, void* stringv, int* nstringv, const int nchstringv){ - StringVec* stringVec = reinterpret_cast(vector) ; - int stringVecLength = 0 ; - stringVecLength = stringVec->size() ; - if (stringVecLength > *nstringv) { - std::cerr << "Warning in getstringvector: vector size " << stringVecLength - << " larger then target array size " << *nstringv << std::endl ; - stringVecLength = *nstringv ; - } - else { - *nstringv = stringVecLength ; - } - int elemlen = nchstringv + 1; - PTRTYPE stringpos = 0 ; - stringpos = reinterpret_cast( stringv ) ; - for (int j=0;j < stringVecLength;j++) { - char* outstring = const_cast( (*stringVec)[j].c_str() ); - char* tmpstring = reinterpret_cast( stringpos ) ; - strcpy(tmpstring,outstring) ; - stringpos = stringpos + elemlen ; - } - return LCIO::SUCCESS ; -} - -int getpointervector( PTRTYPE vector, PTRTYPE* pointerv, int* npointerv ){ - PointerVec* pointerVec = reinterpret_cast(vector) ; - int pointerVecLength = 0; - pointerVecLength = pointerVec->size() ; - if (pointerVecLength > *npointerv) { - std::cerr << "Warning in getpointervector: vector size " << pointerVecLength - << " larger then target array size " << *npointerv << std::endl ; - pointerVecLength = *npointerv ; - } - else { - *npointerv = pointerVecLength ; - } - for (int j=0;j < pointerVecLength;j++) *pointerv++ = (*pointerVec)[j] ; - return LCIO::SUCCESS ; -} - - - -int lcsetparameters (const char* class_name, PTRTYPE classp, const char* method, const char* key, PTRTYPE vecp){ - const std::string & classname = class_name ; - if (classname == LCIO::LCRUNHEADER) { - LCRunHeaderImpl* rhd = reinterpret_cast(classp) ; - return do_set_method (rhd->parameters(), method, key, vecp) ; - } - else if (classname == LCIO::LCEVENT) { - LCEventImpl* evt = reinterpret_cast(classp) ; - return do_set_method (evt->parameters(), method, key, vecp) ; - } - else if (classname == LCIO::LCCOLLECTION) { - LCCollectionVec* col = reinterpret_cast(classp) ; - return do_set_method (col->parameters(), method, key, vecp) ; - } - else { - std::cerr << "Warning in lcsetparameters: unknown class name " << classname << std::endl ; - return LCIO::ERROR ; - } -} - -int lcgetparameters (const char* class_name, PTRTYPE classp, const char* method, const char* key, PTRTYPE vecp){ - const std::string & classname = class_name ; - if (classname == LCIO::LCRUNHEADER) { - LCRunHeaderImpl* rhd = reinterpret_cast(classp) ; - return do_get_method (rhd->getParameters(), method, key, vecp) ; - } - else if (classname == LCIO::LCEVENT) { - LCEventImpl* evt = reinterpret_cast(classp) ; - return do_get_method (evt->getParameters(), method, key, vecp) ; - } - else if (classname == LCIO::LCCOLLECTION) { - LCCollectionVec* col = reinterpret_cast(classp) ; - return do_get_method (col->getParameters(), method, key, vecp) ; - } - else { - std::cerr << "Warning in lcgetparameters: unknown class name " << classname << std::endl ; - return LCIO::ERROR ; - } - -} - -int do_set_method (LCParameters& params, const char* my_method, const char* key, PTRTYPE vector) { - const std::string & method = my_method ; - if (method == string("setIntValues")) { - IntVec* intVec = reinterpret_cast(vector) ; - params.setValues(key, *intVec) ; - return LCIO::SUCCESS ; - } - else if (method == string("setFloatValues")) { - FloatVec* floatVec = reinterpret_cast(vector) ; - params.setValues(key, *floatVec) ; - return LCIO::SUCCESS ; - } - else if (method == string("setStringValues")) { - StringVec* stringVec = reinterpret_cast(vector) ; - params.setValues(key, *stringVec) ; - return LCIO::SUCCESS ; - } - else { - std::cerr << "Warning in lcsetparameters: unknown method name " << method << std::endl ; - return LCIO::ERROR ; - } -} - -int do_get_method (const LCParameters& params, const char* my_method, const char* key, PTRTYPE vector) { - const std::string & method = my_method ; - if (method == string("getIntValues")) { - IntVec* intVec = f2c_pointer(vector) ; - params.getIntVals(key, *intVec) ; - return LCIO::SUCCESS ; - } - else if (method == string("getFloatValues")) { - FloatVec* floatVec = f2c_pointer(vector) ; - params.getFloatVals(key, *floatVec) ; - return LCIO::SUCCESS ; - } - else if (method == string("getStringValues")) { - StringVec* stringVec = f2c_pointer(vector) ; - params.getStringVals(key, *stringVec) ; - return LCIO::SUCCESS ; - } - else if (method == string("getIntKeys")) { - StringVec* stringVec = f2c_pointer(vector) ; - params.getIntKeys(*stringVec) ; - return LCIO::SUCCESS ; - } - else if (method == string("getFloatKeys")) { - StringVec* stringVec = f2c_pointer(vector) ; - params.getFloatKeys(*stringVec) ; - return LCIO::SUCCESS ; - } - else if (method == string("getStringtKeys")) { - StringVec* stringVec = f2c_pointer(vector) ; - params.getStringKeys(*stringVec) ; - return LCIO::SUCCESS ; - } - else { - std::cerr << "Warning in lcgetparameters: unknown method name " << method << std::endl ; - return LCIO::ERROR ; - } -} - - diff --git a/src/cpp/src/CPPFORT/lcmcp.cc b/src/cpp/src/CPPFORT/lcmcp.cc deleted file mode 100644 index 93711fef8..000000000 --- a/src/cpp/src/CPPFORT/lcmcp.cc +++ /dev/null @@ -1,171 +0,0 @@ -#include "CPPFORT/lcmcp.h" - -#include "lcio.h" -#include "IMPL/MCParticleImpl.h" - -using namespace lcio ; - -#include - - -PTRTYPE lcmcpcreate(){ - MCParticleImpl* mcp = new MCParticleImpl ; - - // uncomment to demonstrate that the addresses are different depending on the - // type of the pointer.... - // cout << "lcmcpcreate: " << C2F_POINTER( LCObject*, mcp ) << ", " - // << C2F_POINTER( MCParticleData*, mcp ) << ", " - // << C2F_POINTER( MCParticle*, mcp ) << ", " - // << C2F_POINTER( MCParticleImpl*, mcp ) << endl ; - return C2F_POINTER( LCObject*, mcp ) ; -} -int lcmcpdelete( PTRTYPE mcparticle ){ - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - delete mcp ; - return LCIO::SUCCESS ; -} -int lcmcpgetnumberofparents( PTRTYPE mcparticle ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - return mcp->getParents().size() ; -} -PTRTYPE lcmcpgetparent( PTRTYPE mcparticle, int i ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - return C2F_POINTER(LCObject*, mcp->getParents()[i] ) ; -} -// PTRTYPE lcmcpgetsecondparent( PTRTYPE mcparticle ) { -// MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; -// return C2F_POINTER(LCObject*, mcp->getSecondParent() ) ; -// } -PTRTYPE lcmcpgetdaughter( PTRTYPE mcparticle, int i ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - return C2F_POINTER(LCObject*, mcp->getDaughters()[i-1] ) ; -} -int lcmcpgetendpoint( PTRTYPE mcparticle, double* ep) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - for( int i=0 ; i<3 ; *ep++ = mcp->getEndpoint()[i++] ) ; - return LCIO::SUCCESS ; -} -int lcmcpgetnumberofdaughters( PTRTYPE mcparticle ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - return mcp->getDaughters().size() ; -} -int lcmcpgetpdg( PTRTYPE mcparticle ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - return mcp->getPDG() ; -} -int lcmcpgetgeneratorstatus( PTRTYPE mcparticle ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - return mcp->getGeneratorStatus() ; -} -int lcmcpgetsimulatorstatus( PTRTYPE mcparticle ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - return mcp->getSimulatorStatus() ; -} -int lcmcpgetvertex( PTRTYPE mcparticle, double* vtx ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - for( int i=0 ; i<3 ; *vtx++ = mcp->getVertex()[i++] ) ; - return LCIO::SUCCESS ; -} -float lcmcpgettime( PTRTYPE mcparticle ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - return mcp->getTime() ; -} -int lcmcpgetmomentum( PTRTYPE mcparticle, double* p) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - for( int i=0 ; i<3 ; *p++ = mcp->getMomentum()[i++] ) ; - return LCIO::SUCCESS ; -} -double lcmcpgetmass( PTRTYPE mcparticle ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - return mcp->getMass() ; -} -float lcmcpgetcharge( PTRTYPE mcparticle ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - return mcp->getCharge() ; -} -double lcmcpgetenergy( PTRTYPE mcparticle ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - return mcp->getEnergy() ; -} - -int lcmcpgetspin( PTRTYPE mcparticle, float* spin ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - for( int i=0 ; i<3 ; *spin++ = mcp->getSpin()[i++] ) ; - return LCIO::SUCCESS ; -} -int lcmcpgetcolorflow( PTRTYPE mcparticle, int* cflow ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - for( int i=0 ; i<2 ; *cflow++ = mcp->getColorFlow()[i++] ) ; - return LCIO::SUCCESS ; -} - - -int lcmcpaddparent( PTRTYPE mcparticle, PTRTYPE parent ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - MCParticle* mom = f2c_pointer( parent ) ; - mcp->addParent( mom ) ; - return LCIO::SUCCESS ; -} -// int lcmcpsetsecondparent( PTRTYPE mcparticle, PTRTYPE parent ) { -// MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; -// MCParticle* mom = f2c_pointer( parent ) ; -// mcp->setSecondParent( mom ) ; -// return LCIO::SUCCESS ; -// } -// int lcmcpadddaughter( PTRTYPE mcparticle, PTRTYPE daughter ) { -// MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; -// MCParticle* dgh = f2c_pointer( daughter ) ; -// mcp->addDaughter( dgh ) ; -// return LCIO::SUCCESS ; -// } -int lcmcpsetpdg( PTRTYPE mcparticle, int pdg ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - mcp->setPDG( pdg ) ; - return LCIO::SUCCESS ; -} -int lcmcpsetgeneratorstatus( PTRTYPE mcparticle, int status ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - mcp->setGeneratorStatus( status ) ; - return LCIO::SUCCESS ; -} -int lcmcpsetsimulatorstatus( PTRTYPE mcparticle, int status ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - mcp->setSimulatorStatus( status ) ; - return LCIO::SUCCESS ; -} -int lcmcpsetvertex( PTRTYPE mcparticle, double vtx[3] ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - mcp->setVertex( vtx ) ; - return LCIO::SUCCESS ; -} -int lcmcpsetendpoint( PTRTYPE mcparticle, double pnt[3] ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - mcp->setEndpoint( pnt ) ; - return LCIO::SUCCESS ; -} -int lcmcpsetmomentum( PTRTYPE mcparticle, float p[3] ){ - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - mcp->setMomentum( p ) ; - return LCIO::SUCCESS ; -} -int lcmcpsetmass( PTRTYPE mcparticle, float m) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - mcp->setMass( m ) ; - return LCIO::SUCCESS ; -} -int lcmcpsetcharge( PTRTYPE mcparticle, float c ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - mcp->setCharge( c ) ; - return LCIO::SUCCESS ; -} -int lcmcpsetspin( PTRTYPE mcparticle, float spin[3] ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - mcp->setSpin( spin ) ; - return LCIO::SUCCESS ; -} -int lcmcpsetcolorflow( PTRTYPE mcparticle, int cflow[2] ) { - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - mcp->setColorFlow( cflow ) ; - return LCIO::SUCCESS ; -} - diff --git a/src/cpp/src/CPPFORT/lcobv.cc b/src/cpp/src/CPPFORT/lcobv.cc deleted file mode 100644 index b816589d4..000000000 --- a/src/cpp/src/CPPFORT/lcobv.cc +++ /dev/null @@ -1,52 +0,0 @@ - -#include "CPPFORT/lcobv.h" -#include "UTIL/LCRelationNavigator.h" - -#include "lcio.h" -#include "IMPL/LCRelationImpl.h" -#include "EVENT/LCCollection.h" -#include "EVENT/LCObject.h" -#include "LCIOSTLTypes.h" - -#include -#include - -using namespace lcio ; - -typedef std::map< EVENT::LCObject* , std::pair< EVENT::LCObjectVec , EVENT::FloatVec > > RelMap ; - - int lcobvgetlength( PTRTYPE vector ){ - const LCObjectVec* vec = reinterpret_cast( vector ) ; - return vec->size() ; - } - - PTRTYPE lcobvgetobject( PTRTYPE vector, int index){ - const LCObjectVec* vec = reinterpret_cast( vector ) ; - // LCObject* obj = vec->at(index-1) ; - if( index < 1 || index > (int) vec->size() ) - throw Exception("lcobvgetobject : out_of_range " ) ; - - LCObject* obj = (*vec)[ index-1 ] ; - return C2F_POINTER( LCObject*, obj ) ; - } - - int lcobvgetobjectid( PTRTYPE vector, int index){ - const LCObjectVec* vec = reinterpret_cast( vector ) ; - // LCObject* obj = vec->at(index-1) ; - if( index < 1 || index > (int) vec->size() ) - throw Exception("lcobvgetobjectid : out_of_range " ) ; - - LCObject* obj = (*vec)[ index-1 ] ; - return obj->id() ; - } - -float lcobvgetweight( PTRTYPE vector, int index){ - const FloatVec* vec = reinterpret_cast( vector ) ; - // return vec->at(index-1) ; - if( index < 1 || index > (int) vec->size() ) - throw Exception("lcobvgetweight : out_of_range " ) ; - - return (*vec)[ index-1 ] ; -} - - diff --git a/src/cpp/src/CPPFORT/lcpid.cc b/src/cpp/src/CPPFORT/lcpid.cc deleted file mode 100644 index c3ec3a3af..000000000 --- a/src/cpp/src/CPPFORT/lcpid.cc +++ /dev/null @@ -1,99 +0,0 @@ -#include "CPPFORT/lcpid.h" - -#include "lcio.h" -#include "IMPL/ParticleIDImpl.h" -#include "EVENT/LCFloatVec.h" - -using namespace lcio ; - -#include - -// create delete ParticleID - -PTRTYPE lcpidcreate(){ - ParticleIDImpl* pid = new ParticleIDImpl ; - return C2F_POINTER( LCObject*, pid ) ; -} -int lcpiddelete( PTRTYPE pidit ){ - ParticleIDImpl* pid = f2c_pointer( pidit ) ; - delete pid ; - return LCIO::SUCCESS ; -} - - -// get Methods - -int lcpidid( PTRTYPE pidit ) { - ParticleIDImpl* pid = f2c_pointer( pidit ) ; - return pid->id() ; -} - -int lcpidgettype( PTRTYPE pidit ) { - ParticleIDImpl* pid = f2c_pointer( pidit ) ; - return pid->getType() ; -} - -int lcpidgetpdg( PTRTYPE pidit ) { - ParticleIDImpl* pid = f2c_pointer( pidit ) ; - return pid->getPDG() ; -} - -float lcpidgetlikelihood( PTRTYPE pidit ) { - ParticleIDImpl* pid = f2c_pointer( pidit ) ; - return pid->getLikelihood() ; -} - -int lcpidgetalgorithmtype( PTRTYPE pidit ) { - ParticleIDImpl* pid = f2c_pointer( pidit ) ; - return pid->getAlgorithmType() ; -} - -int lcpidgetparameters( PTRTYPE pidit, float* vec, int* nvec ) { - ParticleIDImpl* pid = f2c_pointer( pidit ) ; - int ntot = *nvec - 1 ; - const FloatVec* floatVec = &pid->getParameters() ; - for(unsigned int l=0;lsize();l++){ - if ( l > (unsigned)(ntot) ) { - std::cout << "LCParticleID: in getParameters more than " << ntot << "weights to store" << std::endl ; - return LCIO::ERROR ; - } - *vec++ = (*floatVec)[l] ; - } - *nvec = (int)(floatVec->size() + 1); - return LCIO::SUCCESS ; -} - - -// set,add Methods - -int lcpidsettype( PTRTYPE pidit, int type ) { - ParticleIDImpl* pid = f2c_pointer( pidit ) ; - pid->setType( type ) ; - return LCIO::SUCCESS ; -} - -int lcpidsetpdg( PTRTYPE pidit, int pdg ) { - ParticleIDImpl* pid = f2c_pointer( pidit ) ; - pid->setPDG( pdg ) ; - return LCIO::SUCCESS ; -} - -int lcpidsetlikelihood( PTRTYPE pidit, float logl) { - ParticleIDImpl* pid = f2c_pointer( pidit ) ; - pid->setLikelihood( logl ) ; - return LCIO::SUCCESS ; -} - -int lcpidsetalgorithmtype( PTRTYPE pidit, int ident ) { - ParticleIDImpl* pid = f2c_pointer( pidit ) ; - pid->setAlgorithmType( ident ) ; - return LCIO::SUCCESS ; -} - -int lcpidaddparameter( PTRTYPE pidit, float param) { - ParticleIDImpl* pid = f2c_pointer( pidit ) ; - pid->addParameter( param ) ; - return LCIO::SUCCESS ; -} - - diff --git a/src/cpp/src/CPPFORT/lcrcp.cc b/src/cpp/src/CPPFORT/lcrcp.cc deleted file mode 100644 index 9fa33379c..000000000 --- a/src/cpp/src/CPPFORT/lcrcp.cc +++ /dev/null @@ -1,280 +0,0 @@ -#include "CPPFORT/lcrcp.h" - -#include "lcio.h" -#include "IMPL/ReconstructedParticleImpl.h" -#include "IMPL/VertexImpl.h" - -using namespace lcio ; - -#include - -// create delete ReconstructedParticle - -PTRTYPE lcrcpcreate(){ - ReconstructedParticleImpl* rcp = new ReconstructedParticleImpl ; - return C2F_POINTER( LCObject*, rcp ) ; -} -int lcrcpdelete( PTRTYPE recopart ){ - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - delete rcp ; - return LCIO::SUCCESS ; -} - - -// get Methods - -int lcrcpid( PTRTYPE recopart ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - return rcp->id() ; -} - -int lcrcpgettype( PTRTYPE recopart ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - return rcp->getType() ; -} - -bool lcrcpiscompound ( PTRTYPE recopart ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - return rcp->isCompound() ; -} - -int lcrcpgetmomentum( PTRTYPE recopart, float* p ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - for( int i=0 ; i<3 ; *p++ = rcp->getMomentum()[i++] ) ; - return LCIO::SUCCESS ; -} - -float lcrcpgetenergy( PTRTYPE recopart ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - return rcp->getEnergy() ; -} - -int lcrcpgetcovmatrix( PTRTYPE recopart, float cvmtx[NCOVARIANCE] ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - for( int i=0 ; igetCovMatrix()[i] ; - return LCIO::SUCCESS ; -} - -float lcrcpgetmass( PTRTYPE recopart ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - return rcp->getMass() ; -} - -float lcrcpgetcharge( PTRTYPE recopart ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - return rcp->getCharge() ; -} - -int lcrcpgetreferencepoint( PTRTYPE recopart, float refpoint[3] ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - for( int i=0 ; i<3 ; *refpoint++ = rcp->getReferencePoint()[i++] ) ; - return LCIO::SUCCESS ; -} - -PTRTYPE lcrcpgetparticleids( PTRTYPE recopart ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - const ParticleIDVec& idvect = rcp->getParticleIDs(); - return reinterpret_cast( &idvect ); -} - -float lcrcpgetgoodnessofpid( PTRTYPE recopart ) { - ReconstructedParticleImpl* rcp = f2c_pointer(recopart ) ; - return rcp->getGoodnessOfPID() ; -} - -PTRTYPE lcrcpgetparticles( PTRTYPE recopart ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - const ReconstructedParticleVec& idvect = rcp->getParticles(); - return reinterpret_cast( &idvect ); -} - - -// int lcrcpgetparticleweights( PTRTYPE recopart, float* weights, int* nweights ) { -// ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; -// int ntot = *nweights - 1 ; -// for(unsigned int l=0;lgetParticles().size();l++){ -// if ( l > (unsigned)ntot ) { -// std::cout << "LCReconstructedParticle: in getParticleWeights more than " -// << ntot << "weights to store" << std::endl ; -// return LCIO::ERROR ; -// } -// *weights++ = rcp->getParticleWeights()[l] ; -// } -// *nweights = (int)(rcp->getParticles().size() + 1); -// return LCIO::SUCCESS ; -// } - -PTRTYPE lcrcpgetclusters( PTRTYPE recopart ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - const ClusterVec& idvect = rcp->getClusters(); - return reinterpret_cast( &idvect ); -} - - -// int lcrcpgetclusterweights( PTRTYPE recopart, float* weights, int* nweights ) { -// ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; -// int ntot = *nweights - 1; -// for(unsigned int l=0;lgetClusters().size();l++){ -// if ( l > (unsigned)ntot ) { -// std::cout << "LCReconstructedParticle: in getClusterWeights more than " -// << ntot << "weights to store" << std::endl ; -// return LCIO::ERROR ; -// } -// *weights++ = rcp->getClusterWeights()[l] ; -// } -// *nweights = (int)(rcp->getClusters().size() + 1) ; -// return LCIO::SUCCESS ; -// } - -PTRTYPE lcrcpgettracks( PTRTYPE recopart ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - const TrackVec& idvect = rcp->getTracks(); - return reinterpret_cast( &idvect ); -} - -// int lcrcpgettrackweights( PTRTYPE recopart, float* weights, int* nweights ) { -// ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; -// int ntot = *nweights - 1; -// for(unsigned int l=0;lgetTracks().size();l++){ -// if ( l > (unsigned)ntot ) { -// std::cout << "LCReconstructedParticle: in getTrackWeights more than " -// << ntot << "weights to store" << std::endl ; -// return LCIO::ERROR ; -// } -// *weights++ = rcp->getTrackWeights()[l] ; -// } -// *nweights = (int)(rcp->getTracks().size() + 1) ; -// return LCIO::SUCCESS ; -// } - -// PTRTYPE lcrcpgetmcparticles( PTRTYPE recopart ) { -// ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; -// const MCParticleVec& idvect = rcp->getMCParticles(); -// return reinterpret_cast( &idvect ); -// } - -// int lcrcpgetmcparticleweights( PTRTYPE recopart, float* weights, int* nweights ) { -// ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; -// int ntot = *nweights - 1 ; -// for(unsigned int l=0;lgetMCParticles().size();l++){ -// if ( l > (unsigned)ntot ) { -// std::cout << "LCReconstructedParticle: in getMCParticleWeights more than " -// << ntot << "weights to store" << std::endl ; -// return LCIO::ERROR ; -// } -// *weights++ = rcp->getMCParticleWeights()[l] ; -// } -// *nweights = (int)(rcp->getMCParticles().size() + 1); -// return LCIO::SUCCESS ; -// } -PTRTYPE lcrcpgetstartvertex( PTRTYPE recopart ) { - ReconstructedParticle* rcp = f2c_pointer( recopart ) ; - Vertex* vtx = rcp->getStartVertex(); - return reinterpret_cast( vtx ); -} - -PTRTYPE lcrcpgetendvertex( PTRTYPE recopart ) { - ReconstructedParticle* rcp = f2c_pointer( recopart ) ; - Vertex* vtx = rcp->getEndVertex(); - return reinterpret_cast( vtx ); -} - - -// set,add Methods - -int lcrcpsettype( PTRTYPE recopart, int type ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - rcp->setType( type ) ; - return LCIO::SUCCESS ; -} - -// int lcrcpsetcompound( PTRTYPE recopart, bool lcompound ) { -// ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; -// rcp->setCompound( lcompound ) ; -// return LCIO::SUCCESS ; -// } - -int lcrcpsetmomentum( PTRTYPE recopart, float p[3] ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - rcp->setMomentum( p ) ; - return LCIO::SUCCESS ; -} - -int lcrcpsetenergy( PTRTYPE recopart, float energy ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - rcp->setEnergy( energy ) ; - return LCIO::SUCCESS ; -} - -int lcrcpsetcovmatrix( PTRTYPE recopart, float cvmtx[NCOVARIANCE] ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - rcp->setCovMatrix( cvmtx ) ; - return LCIO::SUCCESS ; -} - -int lcrcpsetmass( PTRTYPE recopart, float xmass) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - rcp->setMass( xmass ) ; - return LCIO::SUCCESS ; -} - -int lcrcpsetcharge( PTRTYPE recopart, float charge ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - rcp->setCharge( charge ) ; - return LCIO::SUCCESS ; -} - -int lcrcpsetreferencepoint( PTRTYPE recopart, float refpoint[3] ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - rcp->setReferencePoint( refpoint ) ; - return LCIO::SUCCESS ; -} - -int lcrcpaddparticleid( PTRTYPE recopart, PTRTYPE pid ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - ParticleID* ppid = f2c_pointer( pid ) ; - rcp->addParticleID( ppid ) ; - return LCIO::SUCCESS ; -} - -int lcrcpsetgoodnessofpid( PTRTYPE recopart, float good) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - rcp->setGoodnessOfPID( good ) ; - return LCIO::SUCCESS ; -} - -int lcrcpaddparticle( PTRTYPE recopart, PTRTYPE particle ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - ReconstructedParticle* rparticle = f2c_pointer( particle ) ; - rcp->addParticle( rparticle ) ; - return LCIO::SUCCESS ; -} - -int lcrcpaddcluster( PTRTYPE recopart, PTRTYPE clus ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - Cluster* cclus = f2c_pointer( clus ) ; - rcp->addCluster( cclus ) ; - return LCIO::SUCCESS ; -} - -int lcrcpaddtrack( PTRTYPE recopart, PTRTYPE track ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - Track* ctrack = f2c_pointer( track ) ; - rcp->addTrack( ctrack ) ; - return LCIO::SUCCESS ; -} - -// int lcrcpaddmcparticle( PTRTYPE recopart, PTRTYPE particle ) { -// ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; -// MCParticle* mmcp = f2c_pointer( particle ) ; -// rcp->addMCParticle( mmcp ) ; -// return LCIO::SUCCESS ; -// } - -int lcrcpsetstartvertex( PTRTYPE recopart, PTRTYPE vertex ) { - ReconstructedParticleImpl* rcp = f2c_pointer( recopart ) ; - Vertex* vtx = f2c_pointer( vertex ) ; - rcp->setStartVertex( vtx ) ; - return LCIO::SUCCESS ; -} - diff --git a/src/cpp/src/CPPFORT/lcrdr.cc b/src/cpp/src/CPPFORT/lcrdr.cc deleted file mode 100644 index 8af83fb8b..000000000 --- a/src/cpp/src/CPPFORT/lcrdr.cc +++ /dev/null @@ -1,68 +0,0 @@ -#include "CPPFORT/lcrdr.h" - -#include "lcio.h" -#include "Exceptions.h" -#include "IOIMPL/LCFactory.h" -#include "IMPL/LCRunHeaderImpl.h" -#include "IMPL/LCEventImpl.h" -#include "IMPL/LCTOOLS.h" -#include - -using namespace lcio ; - - -PTRTYPE lcrdrcreate(){ - LCReader* lcReader = IOIMPL::LCFactory::getInstance()->createLCReader() ; - return reinterpret_cast(lcReader) ; -} - -int lcrdrdelete(PTRTYPE reader){ - LCReader* lcReader = reinterpret_cast( (reader) ) ; - delete lcReader ; - return LCIO::SUCCESS ; -} - -int lcrdropen(PTRTYPE reader, const char* filename ){ - try{ - LCReader* lcReader = reinterpret_cast(reader) ; - lcReader->open( filename ) ; - }catch(...){ return LCIO::ERROR ; } - return LCIO::SUCCESS ; -} - -int lcrdrclose(PTRTYPE reader){ - try{ - LCReader* lcReader = reinterpret_cast(reader) ; - lcReader->close() ; - }catch(...){ return LCIO::ERROR ; } - return LCIO::SUCCESS ; -} - -int lcrdrreadstream(PTRTYPE reader, int maxRecord){ - try{ - LCReader* lcReader = reinterpret_cast(reader) ; - lcReader->readStream( maxRecord ) ; - }catch(...){ return LCIO::ERROR ; } - return LCIO::SUCCESS ; -} - -PTRTYPE lcrdrreadnextrunheader(PTRTYPE reader, int accessMode){ - LCReader* rdr = reinterpret_cast(reader) ; - return C2F_POINTER( LCRunHeader*, rdr->readNextRunHeader( accessMode ) ) ; -} - -PTRTYPE lcrdrreadnextevent(PTRTYPE reader, int accessMode){ - LCReader* rdr = reinterpret_cast(reader) ; - return C2F_POINTER( LCEvent*, rdr->readNextEvent( accessMode ) ); -} - -PTRTYPE lcrdrreadevent(PTRTYPE reader, int runNumber, int evtNumber ){ - LCReader* rdr = reinterpret_cast(reader) ; - return C2F_POINTER( LCEvent*, rdr->readEvent( runNumber, evtNumber ) ); -} - -int lcrdrskipnevents( PTRTYPE reader, int n ) { - LCReader* rdr = reinterpret_cast(reader) ; - rdr->skipNEvents( n ) ; - return LCIO::SUCCESS ; -} diff --git a/src/cpp/src/CPPFORT/lcrdrrep.cc b/src/cpp/src/CPPFORT/lcrdrrep.cc deleted file mode 100644 index f46e7f725..000000000 --- a/src/cpp/src/CPPFORT/lcrdrrep.cc +++ /dev/null @@ -1,31 +0,0 @@ - -#include "CPPFORT/lcrdrrep.h" - -using namespace std ; -using namespace lcio ; - -#include "lcrdrrep.icc" -int lcrdreventprocessor( PTRTYPE filenamevec ){ - - StringVec* filenameVec = reinterpret_cast(filenamevec); - - // create reader and writer for input and output streams - LCReader* lcReader = LCFactory::getInstance()->createLCReader() ; - - lcReader->open( *filenameVec ) ; - - { - RunEventProcessor evtProc ; - - lcReader->registerLCRunListener( &evtProc ) ; - lcReader->registerLCEventListener( &evtProc ) ; - - lcReader->readStream() ; - - } - - lcReader->close() ; - delete lcReader ; - return 0 ; -} - diff --git a/src/cpp/src/CPPFORT/lcrdrrep.icc b/src/cpp/src/CPPFORT/lcrdrrep.icc deleted file mode 100644 index 71fed2fea..000000000 --- a/src/cpp/src/CPPFORT/lcrdrrep.icc +++ /dev/null @@ -1,57 +0,0 @@ - -extern "C"{ - void processevent_( PTRTYPE* ) ; - void modifyevent_( PTRTYPE* ) ; - void processrunheader_( PTRTYPE* ) ; - void modifyrunheader_( PTRTYPE* ) ; -// void processevent_( PTRTYPE* ) {} -// void modifyevent_( PTRTYPE* ) {} -// void processrunheader_( PTRTYPE* ) {} -// void modifyrunheader_( PTRTYPE* ) {} -} - - -class RunEventProcessor : public LCRunListener, public LCEventListener{ - -public: - - RunEventProcessor() { - - } - - ~RunEventProcessor(){ - - } - - void processEvent( LCEvent * evt ) { /* used for 'read only' access*/ - - PTRTYPE event = reinterpret_cast( evt ) ; - processevent_( &event ) ; - - } - - void modifyEvent( LCEvent * evt ) { - - PTRTYPE event = reinterpret_cast( evt ) ; - modifyevent_ ( &event ) ; - - } - - - void processRunHeader( LCRunHeader* run ){ - - PTRTYPE header = reinterpret_cast( run ) ; - processrunheader_ ( &header ) ; - - } - - void modifyRunHeader(LCRunHeader* run ){ - - PTRTYPE header = reinterpret_cast( run ) ; - modifyrunheader_ ( &header ) ; - - } - -} ; - - diff --git a/src/cpp/src/CPPFORT/lcrel.cc b/src/cpp/src/CPPFORT/lcrel.cc deleted file mode 100644 index d3f0b9010..000000000 --- a/src/cpp/src/CPPFORT/lcrel.cc +++ /dev/null @@ -1,69 +0,0 @@ - -#include "CPPFORT/lcrel.h" - -#include "lcio.h" -#include "IMPL/LCRelationImpl.h" -#include - -using namespace lcio ; - -PTRTYPE lcrelcreate0(){ - LCRelationImpl* relation = new LCRelationImpl() ; - return reinterpret_cast( relation ) ; -} - -PTRTYPE lcrelcreate( PTRTYPE objectfrom, PTRTYPE objectto, float weight ){ - LCObject* objf = f2c_pointer( objectfrom ) ; - LCObject* objt = f2c_pointer( objectto ) ; - LCRelationImpl* relation = new LCRelationImpl( objf, objt, weight ) ; - return reinterpret_cast( relation ) ; -} - -int lcreldelete( PTRTYPE relation ){ - LCRelationImpl* rel = reinterpret_cast( relation ) ; - delete rel ; - return LCIO::SUCCESS ; -} - -int lcrelid( PTRTYPE relation ){ - LCRelationImpl* rel = reinterpret_cast( relation ) ; - return rel->id() ; -} - -PTRTYPE lcrelgetfrom( PTRTYPE relation ){ - LCRelationImpl* rel = reinterpret_cast( relation ) ; - LCObject* object = rel->getFrom() ; - return reinterpret_cast( object ) ; -} - -PTRTYPE lcrelgetto( PTRTYPE relation ){ - LCRelationImpl* rel = reinterpret_cast( relation ) ; - LCObject* object = rel->getTo() ; - return reinterpret_cast( object ) ; -} - -float lcrelgetweight( PTRTYPE relation ){ - LCRelationImpl* rel = reinterpret_cast( relation ) ; - return rel->getWeight() ; -} - -int lcrelsetfrom(PTRTYPE relation, PTRTYPE object ){ - LCRelationImpl* rel = reinterpret_cast( relation ) ; - LCObject* obj = f2c_pointer( object ) ; - rel->setFrom( obj ) ; - return LCIO::SUCCESS ; -} - -int lcrelsetto(PTRTYPE relation, PTRTYPE object ){ - LCRelationImpl* rel = reinterpret_cast( relation ) ; - LCObject* obj = f2c_pointer( object ) ; - rel->setTo( obj ) ; - return LCIO::SUCCESS ; -} - -int lcrelsetweight(PTRTYPE relation, float weight ){ - LCRelationImpl* rel = reinterpret_cast( relation ) ; - rel->setWeight( weight ) ; - return LCIO::SUCCESS ; -} - diff --git a/src/cpp/src/CPPFORT/lcrhd.cc b/src/cpp/src/CPPFORT/lcrhd.cc deleted file mode 100644 index d8b001ffb..000000000 --- a/src/cpp/src/CPPFORT/lcrhd.cc +++ /dev/null @@ -1,66 +0,0 @@ -#include "CPPFORT/lcrhd.h" - -#include "lcio.h" -#include "Exceptions.h" -#include "IOIMPL/LCFactory.h" -#include "IMPL/LCRunHeaderImpl.h" -#include "IMPL/LCEventImpl.h" -#include "IMPL/LCTOOLS.h" -#include - -using namespace lcio ; - - -PTRTYPE lcrhdcreate(){ - LCRunHeaderImpl* rhd = new LCRunHeaderImpl ; - return reinterpret_cast(rhd) ; -} - -int lcrhddelete( PTRTYPE runHeader ){ - LCRunHeaderImpl* rhd = reinterpret_cast(runHeader) ; - delete rhd ; - return LCIO::SUCCESS ; -} -int lcrhdgetrunnumber( PTRTYPE runHeader ){ - LCRunHeaderImpl* rhd = reinterpret_cast(runHeader) ; - return rhd->getRunNumber() ; -} -char* lcrhdgetdetectorname( PTRTYPE runHeader ){ - LCRunHeaderImpl* rhd = reinterpret_cast(runHeader) ; - return const_cast( rhd->getDetectorName().c_str() ); -} -char* lcrhdgetdescription( PTRTYPE runHeader ){ - LCRunHeaderImpl* rhd = reinterpret_cast(runHeader) ; - return const_cast( rhd->getDescription().c_str() ); -} - - -PTRTYPE lcrhdgetactivesubdetectors(PTRTYPE runHeader){ - LCRunHeaderImpl* rhd = reinterpret_cast(runHeader) ; - return reinterpret_cast( rhd->getActiveSubdetectors() ) ; -} - -int lcrhdsetrunnumber( PTRTYPE runHeader, int rn){ - LCRunHeaderImpl* rhd = reinterpret_cast(runHeader) ; - rhd->setRunNumber( rn ) ; - return LCIO::SUCCESS ; -} -int lcrhdsetdetectorname( PTRTYPE runHeader, const char* dn){ - LCRunHeaderImpl* rhd = reinterpret_cast(runHeader) ; - rhd->setDetectorName( dn ) ; - return LCIO::SUCCESS ; -} -int lcrhdsetdescription( PTRTYPE runHeader, const char* dsc){ - LCRunHeaderImpl* rhd = reinterpret_cast(runHeader) ; - rhd->setDescription( dsc ) ; - return LCIO::SUCCESS ; -} -int lcrhdaddactivesubdetector( PTRTYPE runHeader, const char* adn){ - LCRunHeaderImpl* rhd = reinterpret_cast(runHeader) ; - rhd->addActiveSubdetector( adn ) ; - return LCIO::SUCCESS ; -} - - - - diff --git a/src/cpp/src/CPPFORT/lcrnv.cc b/src/cpp/src/CPPFORT/lcrnv.cc deleted file mode 100644 index eac09cda7..000000000 --- a/src/cpp/src/CPPFORT/lcrnv.cc +++ /dev/null @@ -1,96 +0,0 @@ - -#include "CPPFORT/lcrnv.h" -#include "UTIL/LCRelationNavigator.h" - -#include "lcio.h" -#include "IMPL/LCRelationImpl.h" -#include "EVENT/LCCollection.h" -#include "EVENT/LCObject.h" -#include "LCIOSTLTypes.h" - -#include - -using namespace lcio ; - - PTRTYPE lcrnvcreate( const char* fromType, const char* toType ){ - LCRelationNavigator* relation = new LCRelationNavigator( fromType, toType ) ; - return reinterpret_cast( relation ) ; - - } - - int lcrnvdelete( PTRTYPE relation ){ - LCRelationNavigator* rel = reinterpret_cast( relation ) ; - delete rel ; - return LCIO::SUCCESS ; - - } - - PTRTYPE lcrnvcreatefromcollection( PTRTYPE collection ){ - LCCollection* col = reinterpret_cast( collection ) ; - LCRelationNavigator* relation = new LCRelationNavigator( col ) ; - return reinterpret_cast( relation ) ; - - } - - char* lcrnvgetfromtype( PTRTYPE relation ){ - LCRelationNavigator* rel = reinterpret_cast( relation ) ; - return const_cast(rel->getFromType().c_str() ) ; - } - - char* lcrnvgettotype( PTRTYPE relation ){ - LCRelationNavigator* rel = reinterpret_cast( relation ) ; - return const_cast(rel->getToType().c_str() ) ; - } - - PTRTYPE lcrnvgetrelatedtoobjects( PTRTYPE relation, PTRTYPE object ){ - LCRelationNavigator* rel = reinterpret_cast( relation ) ; - LCObject* obj = f2c_pointer( object ) ; - const LCObjectVec& vec = rel->getRelatedToObjects( obj ) ; - return reinterpret_cast( &vec ) ; - } - - PTRTYPE lcrnvgetrelatedfromobjects( PTRTYPE relation, PTRTYPE object ){ - LCRelationNavigator* rel = reinterpret_cast( relation ) ; - LCObject* obj = f2c_pointer( object ) ; - const LCObjectVec& vec = rel->getRelatedFromObjects( obj ) ; - return reinterpret_cast( &vec ) ; - } - - PTRTYPE lcrnvgetrelatedtoweights ( PTRTYPE relation, PTRTYPE object ){ - LCRelationNavigator* rel = reinterpret_cast( relation ) ; - LCObject* obj = f2c_pointer( object ) ; - const FloatVec & vec = rel->getRelatedToWeights( obj ) ; - return reinterpret_cast( &vec ) ; - } - - PTRTYPE lcrnvgetrelatedfromweights ( PTRTYPE relation, PTRTYPE object ){ - LCRelationNavigator* rel = reinterpret_cast( relation ) ; - LCObject* obj = f2c_pointer( object ) ; - const FloatVec & vec = rel->getRelatedFromWeights( obj ) ; - return reinterpret_cast( &vec ) ; - } - - int lcrnvgaddrelation(PTRTYPE relation, PTRTYPE objectfrom, PTRTYPE objectto, float weight ){ - LCRelationNavigator* rel = reinterpret_cast( relation ) ; - LCObject* objf = f2c_pointer( objectfrom ) ; - LCObject* objt = f2c_pointer( objectto ) ; - rel->addRelation( objf, objt, weight ) ; - return LCIO::SUCCESS ; - } - - int lcrnvgremoverelation(PTRTYPE relation, PTRTYPE objectfrom, PTRTYPE objectto ){ - LCRelationNavigator* rel = reinterpret_cast( relation ) ; - LCObject* objf = f2c_pointer( objectfrom ) ; - LCObject* objt = f2c_pointer( objectto ) ; - rel->removeRelation( objf, objt ) ; - return LCIO::SUCCESS ; - } - - PTRTYPE lcrnvcreatecollection(PTRTYPE relation ){ - LCRelationNavigator* rel = reinterpret_cast( relation ) ; - LCCollection* col = rel->createLCCollection() ; - return reinterpret_cast( col ) ; - - } - - diff --git a/src/cpp/src/CPPFORT/lcsch.cc b/src/cpp/src/CPPFORT/lcsch.cc deleted file mode 100644 index 17fe65c1f..000000000 --- a/src/cpp/src/CPPFORT/lcsch.cc +++ /dev/null @@ -1,99 +0,0 @@ -#include "CPPFORT/lcsch.h" - -#include "lcio.h" -#include "IMPL/SimCalorimeterHitImpl.h" -#include "IMPL/MCParticleImpl.h" - - -using namespace lcio ; - - -PTRTYPE lcschcreate(){ - SimCalorimeterHitImpl* hit = new SimCalorimeterHitImpl ; - return C2F_POINTER( LCObject*, hit ) ; -} -int lcschdelete( PTRTYPE simcalhit ) { - SimCalorimeterHitImpl* hit = f2c_pointer( simcalhit ) ; - delete hit ; - return LCIO::SUCCESS ; -} - -// get Methods - -int lcschid( PTRTYPE simcalhit ) { - SimCalorimeterHitImpl* hit = f2c_pointer( simcalhit ) ; - return hit->id() ; -} - -int lcschgetcellid0( PTRTYPE simcalhit ) { - SimCalorimeterHitImpl* hit = f2c_pointer( simcalhit ) ; - return hit->getCellID0() ; -} -int lcschgetcellid1( PTRTYPE simcalhit ) { - SimCalorimeterHitImpl* hit = f2c_pointer( simcalhit ) ; - return hit->getCellID1() ; -} -float lcschgetenergy( PTRTYPE simcalhit ) { - SimCalorimeterHitImpl* hit = f2c_pointer( simcalhit ) ; - return hit->getEnergy() ; -} -int lcschgetposition( PTRTYPE simcalhit, float *pos) { - SimCalorimeterHitImpl* hit = f2c_pointer( simcalhit ) ; - for(int i=0;i<3; *pos++ = hit->getPosition()[i++] ) ; - return LCIO::SUCCESS ; -} -int lcschgetnmcparticles( PTRTYPE simcalhit ) { - SimCalorimeterHitImpl* hit = f2c_pointer( simcalhit ) ; - return hit->getNMCContributions() ; -} - -int lcschgetnmccontributions( PTRTYPE simcalhit ) { - SimCalorimeterHitImpl* hit = f2c_pointer( simcalhit ) ; - return hit->getNMCContributions() ; -} - -PTRTYPE lcschgetparticlecont( PTRTYPE simcalhit, int i) { - SimCalorimeterHitImpl* hit = f2c_pointer( simcalhit ) ; - return C2F_POINTER( LCObject*, hit->getParticleCont( i-1 ) ) ; -} -float lcschgetenergycont( PTRTYPE simcalhit, int i) { - SimCalorimeterHitImpl* hit = f2c_pointer( simcalhit ) ; - return hit->getEnergyCont( i-1 ) ; -} -float lcschgettimecont( PTRTYPE simcalhit, int i) { - SimCalorimeterHitImpl* hit = f2c_pointer( simcalhit ) ; - return hit->getTimeCont( i-1 ) ; -} -int lcschgetpdgcont( PTRTYPE simcalhit, int i) { - SimCalorimeterHitImpl* hit = f2c_pointer( simcalhit ) ; - return hit->getPDGCont( i-1 ) ; -} - -// set,add Methods - -int lcschsetcellid0( PTRTYPE simcalhit, int id0) { - SimCalorimeterHitImpl* hit = f2c_pointer( simcalhit ) ; - hit->setCellID0( id0 ) ; - return LCIO::SUCCESS ; -} -int lcschsetcellid1( PTRTYPE simcalhit, int id1) { - SimCalorimeterHitImpl* hit = f2c_pointer( simcalhit ) ; - hit->setCellID1( id1 ) ; - return LCIO::SUCCESS ; -} -int lcschsetenergy( PTRTYPE simcalhit, float en) { - SimCalorimeterHitImpl* hit = f2c_pointer( simcalhit ) ; - hit->setEnergy( en ) ; - return LCIO::SUCCESS ; -} -int lcschsetposition( PTRTYPE simcalhit, float pos[3]) { - SimCalorimeterHitImpl* hit = f2c_pointer( simcalhit ) ; - hit->setPosition( pos ) ; - return LCIO::SUCCESS ; -} -int lcschaddmcparticlecontribution( PTRTYPE simcalhit, PTRTYPE mcparticle, float en, float t, int pdg ) { - SimCalorimeterHitImpl* hit = f2c_pointer( simcalhit ) ; - MCParticleImpl* mcp = f2c_pointer( mcparticle ) ; - hit->addMCParticleContribution( mcp, en, t, pdg ) ; - return LCIO::SUCCESS ; -} diff --git a/src/cpp/src/CPPFORT/lcsth.cc b/src/cpp/src/CPPFORT/lcsth.cc deleted file mode 100644 index 0fbd80d12..000000000 --- a/src/cpp/src/CPPFORT/lcsth.cc +++ /dev/null @@ -1,146 +0,0 @@ -#include "CPPFORT/lcsth.h" - -#include "lcio.h" -#include "Exceptions.h" -#include "IOIMPL/LCFactory.h" -#include "IMPL/LCCollectionVec.h" -#include "IMPL/SimTrackerHitImpl.h" -#include "IMPL/LCTOOLS.h" -#include - -using namespace lcio ; -using namespace std ; - -PTRTYPE lcsthcreate(){ - SimTrackerHitImpl* hit = new SimTrackerHitImpl ; - return C2F_POINTER( LCObject*, hit ) ; -} - -int lcsthdelete( PTRTYPE hit ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - delete sth ; - return LCIO::SUCCESS ; -} - -int lcsthgetcellid( PTRTYPE hit ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - return sth->getCellID0() ; -} -int lcsthgetcellid0( PTRTYPE hit ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - return sth->getCellID0() ; -} - -int lcsthgetcellid1( PTRTYPE hit ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - return sth->getCellID1() ; -} - - -double lcsthgetposition( PTRTYPE hit, int index ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - return sth->getPosition()[index] ; -} - -float lcsthgetmomentum( PTRTYPE hit, int index ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - return sth->getMomentum()[index] ; -} - -float lcsthgetpathlength( PTRTYPE hit ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - return sth->getPathLength() ; -} - -// DEPRECATED. use lcsthgetedep -float lcsthgetdedx( PTRTYPE hit ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - return sth->getEDep() ; -} - -float lcsthgetedep( PTRTYPE hit ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - return sth->getEDep() ; -} - -float lcsthgettime( PTRTYPE hit ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - return sth->getTime() ; -} - -PTRTYPE lcsthgetmcparticle( PTRTYPE hit ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - return C2F_POINTER( LCObject*, sth->getMCParticle() ); -} - -int lcsthgetquality( PTRTYPE hit ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - return sth->getQuality() ; -} - -int lcsthsetcellid0( PTRTYPE hit, int id ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - sth->setCellID0( id ) ; - return LCIO::SUCCESS ; -} -int lcsthsetcellid1( PTRTYPE hit, int id ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - sth->setCellID1( id ) ; - return LCIO::SUCCESS ; -} - -int lcsthsetposition( PTRTYPE hit, double pos[3] ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - sth->setPosition( pos ) ; - return LCIO::SUCCESS ; -} - -int lcsthsetmomentum( PTRTYPE hit, float pos[3] ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - sth->setMomentum( pos ) ; - return LCIO::SUCCESS ; -} - -int lcsthsetmomentumxyz( PTRTYPE hit, float px, float py, float pz ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - sth->setMomentum( px, py, pz ) ; - return LCIO::SUCCESS ; -} - -int lcsthsetpathlength(PTRTYPE hit, float pathLength) { - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - sth->setPathLength( pathLength ) ; - return LCIO::SUCCESS ; -} - -// DEPRECATED. use lcsthsetedep() -int lcsthsetdedx( PTRTYPE hit, float dEdX ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - sth->setEDep( dEdX ) ; - return LCIO::SUCCESS ; -} - -int lcsthsetedep( PTRTYPE hit, float e ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - sth->setEDep( e ) ; - return LCIO::SUCCESS ; -} - -int lcsthsettime( PTRTYPE hit, float t ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - sth->setTime( t ) ; - return LCIO::SUCCESS ; -} - -int lcsthsetmcparticle( PTRTYPE hit, PTRTYPE particle ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - MCParticle* mcp = f2c_pointer( particle ) ; - sth->setMCParticle( mcp ) ; - return LCIO::SUCCESS ; -} - -int lcsthsetquality( PTRTYPE hit, int quality ){ - SimTrackerHitImpl* sth = f2c_pointer( hit ) ; - sth->setQuality( quality ) ; - return LCIO::SUCCESS ; -} diff --git a/src/cpp/src/CPPFORT/lctph.cc b/src/cpp/src/CPPFORT/lctph.cc deleted file mode 100644 index f6f0b99c7..000000000 --- a/src/cpp/src/CPPFORT/lctph.cc +++ /dev/null @@ -1,85 +0,0 @@ -#include "CPPFORT/lctph.h" - -#include "lcio.h" -#include "IMPL/TPCHitImpl.h" - -using namespace lcio ; - -PTRTYPE lctphcreate(){ - TPCHitImpl* hit = new TPCHitImpl ; - return C2F_POINTER( LCObject*, hit ) ; -} - -int lctphdelete( PTRTYPE hit ){ - TPCHitImpl* tph = f2c_pointer( hit ) ; - delete tph ; - return LCIO::SUCCESS ; -} - -int lctphid( PTRTYPE hit ) { - TPCHitImpl* tph = f2c_pointer( hit ) ; - return tph->id() ; -} - -int lctphgetcellid( PTRTYPE hit ){ - TPCHitImpl* tph = f2c_pointer( hit ) ; - return tph->getCellID() ; -} -float lctphgettime( PTRTYPE hit ){ - TPCHitImpl* tph = f2c_pointer( hit ) ; - return tph->getTime() ; -} - -float lctphgcharge( PTRTYPE hit ){ - TPCHitImpl* tph = f2c_pointer( hit ) ; - return tph->getCharge() ; -} -int lctphgetquality( PTRTYPE hit ) { - TPCHitImpl* tph = f2c_pointer( hit ) ; - return tph->getQuality() ; -} - -int lctphgetnrawdatawords( PTRTYPE hit ) { - TPCHitImpl* tph = f2c_pointer( hit ) ; - return tph->getNRawDataWords() ; -} -int lctphgetrawdataword( PTRTYPE hit, int i) { - TPCHitImpl* tph = f2c_pointer( hit ) ; - return tph->getRawDataWord( i-1 ) ; -} - - -int lctphsetcellid( PTRTYPE hit, int id ){ - TPCHitImpl* tph = f2c_pointer( hit ) ; - tph->setCellID( id ) ; - return LCIO::SUCCESS ; -} -int lctphsettime( PTRTYPE hit, float t ){ - TPCHitImpl* tph = f2c_pointer( hit ) ; - tph->setTime( t ) ; - return LCIO::SUCCESS ; -} -int lctphsetcharge( PTRTYPE hit, float c ){ - TPCHitImpl* tph = f2c_pointer( hit ) ; - tph->setCharge( c ) ; - return LCIO::SUCCESS ; -} -int lctphsetquality( PTRTYPE hit, int q ){ - TPCHitImpl* tph = f2c_pointer( hit ) ; - tph->setQuality( q ) ; - return LCIO::SUCCESS ; -} -int lctphsetrawdata( PTRTYPE hit, int* rawData, int size ){ - TPCHitImpl* tph = f2c_pointer( hit ) ; - tph->setRawData( rawData, size ) ; - return LCIO::SUCCESS ; -} -// int lctphinitrawdataarray( PTRTYPE hit, int size ){ -// TPCHitImpl* tph = f2c_pointer( hit ) ; -// tph->initRawDataArray( size ) ; -// return LCIO::SUCCESS ; -// } - - - - diff --git a/src/cpp/src/CPPFORT/lctrh.cc b/src/cpp/src/CPPFORT/lctrh.cc deleted file mode 100644 index 7ae33ae1c..000000000 --- a/src/cpp/src/CPPFORT/lctrh.cc +++ /dev/null @@ -1,165 +0,0 @@ -#include "CPPFORT/lctrh.h" - -#include "lcio.h" -#include "IMPL/TrackerHitImpl.h" - -using namespace lcio ; - -#include - -// create delete TrackerHit - -PTRTYPE lctrhcreate(){ - TrackerHitImpl* trh = new TrackerHitImpl ; - return C2F_POINTER( LCObject*, trh ) ; -} -int lctrhdelete( PTRTYPE trhit ){ - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - delete trh ; - return LCIO::SUCCESS ; -} - - -// get Methods - -int lctrhid( PTRTYPE trhit ) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - return trh->id() ; -} - -int lctrhgetposition( PTRTYPE trhit, double dpos[3] ) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - for( int i=0 ; i<3 ; i++ ) dpos[i] = trh->getPosition()[i] ; - return LCIO::SUCCESS ; -} - -int lctrhgetcovmatrix( PTRTYPE trhit, float cvmtx[TRKHITNCOVMATRIX] ) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - for( int i=0 ; igetCovMatrix()[i] ; - return LCIO::SUCCESS ; -} - -// DEPRECATED. use lctrhgetedep() -float lctrhgetdedx( PTRTYPE trhit ) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - return trh->getEDep() ; -} - -float lctrhgetedep( PTRTYPE trhit ) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - return trh->getEDep() ; -} - -float lctrhgetedeperr( PTRTYPE trhit ) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - return trh->getEDepError() ; -} - -float lctrhgettime( PTRTYPE trhit ) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - return trh->getTime() ; -} - -// char* lctrhgettype( PTRTYPE trhit ) { -// TrackerHitImpl* trh = f2c_pointer( trhit ) ; -// return const_cast( trh->getType().c_str() ) ; -// } - -int lctrhgettype( PTRTYPE trhit ) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - return trh->getType() ; -} - -int lctrhgetquality( PTRTYPE trhit ) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - return trh->getQuality() ; -} - -int lctrhgetcellid0( PTRTYPE trhit ) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - return trh->getCellID0() ; -} -int lctrhgetcellid1( PTRTYPE trhit ) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - return trh->getCellID1() ; -} - - -PTRTYPE lctrhgetrawhits( PTRTYPE trhit ) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; -// const TPCHit& hit = trh->getRawHits(); -// return reinterpret_cast( &hit ); - return reinterpret_cast( &trh->getRawHits() ); -} - - -// set,add Methods - -int lctrhsetposition( PTRTYPE trhit, double dpos[3] ) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - trh->setPosition( dpos ) ; - return LCIO::SUCCESS ; -} - -int lctrhsetcovmatrix( PTRTYPE trhit, float cvmtx[TRKHITNCOVMATRIX] ) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - trh->setCovMatrix( cvmtx ) ; - return LCIO::SUCCESS ; -} - -// DEPRECATED. use lctrhsetedep() -int lctrhsetdedx( PTRTYPE trhit, float dedx) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - trh->setEDep( dedx ) ; - return LCIO::SUCCESS ; -} - -int lctrhsetedep( PTRTYPE trhit, float e ) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - trh->setEDep( e ) ; - return LCIO::SUCCESS ; -} - -int lctrhsetedeperr( PTRTYPE trhit, float e ) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - trh->setEDepError( e ) ; - return LCIO::SUCCESS ; -} - -int lctrhsettime( PTRTYPE trhit, float time) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - trh->setTime( time ) ; - return LCIO::SUCCESS ; -} - -int lctrhsettype( PTRTYPE trhit, int type) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - trh->setType( type ) ; - return LCIO::SUCCESS ; -} - -int lctrhsetquality( PTRTYPE trhit, int q) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - trh->setQuality( q ) ; - return LCIO::SUCCESS ; -} - -int lctrhsetcellid0( PTRTYPE trhit, int id0) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - trh->setCellID0( id0 ) ; - return LCIO::SUCCESS ; -} -int lctrhsetcellid1( PTRTYPE trhit, int id1) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - trh->setCellID1( id1 ) ; - return LCIO::SUCCESS ; -} - -int lctrhaddrawhit( PTRTYPE trhit, PTRTYPE rawhit ) { - TrackerHitImpl* trh = f2c_pointer( trhit ) ; - LCObject* hit = f2c_pointer( rawhit ) ; - trh->rawHits().push_back( hit ) ; - return LCIO::SUCCESS ; -} - - diff --git a/src/cpp/src/CPPFORT/lcvec.cc b/src/cpp/src/CPPFORT/lcvec.cc deleted file mode 100644 index f7e6f047d..000000000 --- a/src/cpp/src/CPPFORT/lcvec.cc +++ /dev/null @@ -1,80 +0,0 @@ -#include "CPPFORT/lcvec.h" -#include "EVENT/LCIntVec.h" -#include "EVENT/LCFloatVec.h" - -using namespace EVENT ; - -// define an interface to read a LC string/int/float vector - -int lcsvcgetlength(PTRTYPE strvec){ - LCStrVec* strVec = reinterpret_cast(strvec) ; - return strVec->size() ; -} - -char* lcsvcgetstringat(PTRTYPE strvec, int index){ - LCStrVec* strVec = reinterpret_cast(strvec) ; - return const_cast( (*strVec)[index-1].c_str() ); -} - -int lcivcgetlength(PTRTYPE intvec){ - LCIntVec* intVec = reinterpret_cast(intvec) ; - return intVec->size() ; -} - -int lcivcgetintat(PTRTYPE intvec, int index){ - LCIntVec* intVec = reinterpret_cast(intvec) ; - return (*intVec)[index-1] ; -} - -int lcfvcgetlength(PTRTYPE floatvec){ - LCFloatVec* floatVec = reinterpret_cast(floatvec) ; - return floatVec->size() ; -} - -float lcfvcgetfloatat(PTRTYPE floatvec, int index){ - LCFloatVec* floatVec = reinterpret_cast(floatvec) ; - return (*floatVec)[index-1] ; -} - -// define an interface to read a standard string/int/float vector - -int stringvectorgetlength(PTRTYPE strvec){ - StringVec* strVec = reinterpret_cast(strvec) ; - return strVec->size() ; -} - -char* stringvectorgetelement(PTRTYPE strvec, int index){ - StringVec* strVec = reinterpret_cast(strvec) ; - return const_cast( (*strVec)[index-1].c_str() ); -} - -int intvectorgetlength(PTRTYPE intvec){ - IntVec* intVec = reinterpret_cast(intvec) ; - return intVec->size() ; -} - -int intvectorgetelement(PTRTYPE intvec, int index){ - IntVec* intVec = reinterpret_cast(intvec) ; - return (*intVec)[index-1] ; -} - -int pointervectorgetlength(PTRTYPE pointervec){ - PointerVec* pointerVec = reinterpret_cast(pointervec) ; - return pointerVec->size() ; -} - -PTRTYPE pointervectorgetelement(PTRTYPE pointervec, int index){ - PointerVec* pointerVec = reinterpret_cast(pointervec) ; - return (*pointerVec)[index-1] ; -} - -int floatvectorgetlength(PTRTYPE floatvec){ - FloatVec* floatVec = reinterpret_cast(floatvec) ; - return floatVec->size() ; -} \ - -float floatvectorgetelement(PTRTYPE floatvec, int index){ - FloatVec* floatVec = reinterpret_cast(floatvec) ; - return (*floatVec)[index-1] ; -} - diff --git a/src/cpp/src/CPPFORT/lcvtx.cc b/src/cpp/src/CPPFORT/lcvtx.cc deleted file mode 100644 index a28972400..000000000 --- a/src/cpp/src/CPPFORT/lcvtx.cc +++ /dev/null @@ -1,135 +0,0 @@ -#include "CPPFORT/lcvtx.h" - -#include "lcio.h" -#include "IMPL/VertexImpl.h" -#include "IMPL/ReconstructedParticleImpl.h" - -using namespace lcio ; - -#include - -// create delete Vertex - -PTRTYPE lcvtxcreate(){ - VertexImpl* vtx = new VertexImpl ; - return C2F_POINTER( LCObject*, vtx ) ; -} -int lcvtxdelete( PTRTYPE vertex ){ - VertexImpl* vtx = f2c_pointer( vertex ) ; - delete vtx ; - return LCIO::SUCCESS ; -} - - -// get Methods - -int lcvtxid( PTRTYPE vertex ) { - VertexImpl* vtx = f2c_pointer( vertex ) ; - return vtx->id() ; -} - -bool lcvtxisprimary ( PTRTYPE vertex ) { - VertexImpl* vtx = f2c_pointer( vertex ) ; - return vtx->isPrimary() ; -} - -char* lcvtxgetalgorithmtype ( PTRTYPE vertex ) { - VertexImpl* vtx = f2c_pointer( vertex ) ; - return const_cast( vtx->getAlgorithmType().c_str() ); -} - -float lcvtxgetchi2( PTRTYPE vertex ) { - VertexImpl* vtx = f2c_pointer( vertex ) ; - return vtx->getChi2() ; -} - -float lcvtxgetprobability( PTRTYPE vertex ) { - VertexImpl* vtx = f2c_pointer( vertex ) ; - return vtx->getProbability() ; -} - -int lcvtxgetposition( PTRTYPE vertex, float pos[3] ) { - VertexImpl* vtx = f2c_pointer( vertex ) ; - for( int i=0 ; i<3 ; *pos++ = vtx->getPosition()[i++] ) ; - return LCIO::SUCCESS ; -} - -int lcvtxgetcovmatrix( PTRTYPE vertex, float cvmtx[VTXCOVMATRIX] ) { - VertexImpl* vtx = f2c_pointer( vertex ) ; - for( int i=0 ; igetCovMatrix()[i] ; - return LCIO::SUCCESS ; -} - -int lcvtxgetparameters( PTRTYPE vertex, float* vec, int* nvec ) { - VertexImpl* vtx = f2c_pointer( vertex ) ; - int ntot = *nvec - 1 ; - const FloatVec* floatVec = &vtx->getParameters() ; - for(unsigned int l=0; l < floatVec->size(); l++){ - if ( l > (unsigned)(ntot) ) { - std::cout << "LCVertex: in getParameters more than " << ntot << "parameters to store" << std::endl ; - return LCIO::ERROR ; - } - *vec++ = (*floatVec)[l] ; - } - *nvec = (int)(floatVec->size() + 1); - return LCIO::SUCCESS ; -} - -PTRTYPE lcvtxgetassociatedparticle( PTRTYPE vertex ) { - Vertex* vtx = f2c_pointer( vertex ) ; - ReconstructedParticle* recP = vtx->getAssociatedParticle(); - return reinterpret_cast( recP ); -} - - -// set,add Methods - -int lcvtxsetprimary( PTRTYPE vertex, bool pri ) { - VertexImpl* vtx = f2c_pointer( vertex ) ; - vtx->setPrimary( pri ) ; - return LCIO::SUCCESS ; -} - -int lcvtxsetalgorithmtype( PTRTYPE vertex, char* type ) { - VertexImpl* vtx = f2c_pointer( vertex ) ; - vtx->setAlgorithmType( type ) ; - return LCIO::SUCCESS ; -} - -int lcvtxsetchi2( PTRTYPE vertex, float chi2 ) { - VertexImpl* vtx = f2c_pointer( vertex ) ; - vtx->setChi2( chi2 ) ; - return LCIO::SUCCESS ; -} - -int lcvtxsetprobability( PTRTYPE vertex, float probability ) { - VertexImpl* vtx = f2c_pointer( vertex ) ; - vtx->setProbability( probability ) ; - return LCIO::SUCCESS ; -} - -int lcvtxsetposition( PTRTYPE vertex, float pos[3] ) { - VertexImpl* vtx = f2c_pointer( vertex ) ; - vtx->setPosition( pos ) ; - return LCIO::SUCCESS ; -} - -int lcvtxsetcovmatrix( PTRTYPE vertex, float cvmtx[VTXCOVMATRIX] ) { - VertexImpl* vtx = f2c_pointer( vertex ) ; - vtx->setCovMatrix( cvmtx ) ; - return LCIO::SUCCESS ; -} - -int lcvtxaddparameter( PTRTYPE vertex, float param) { - VertexImpl* vtx = f2c_pointer( vertex ) ; - vtx->addParameter( param ) ; - return LCIO::SUCCESS ; -} - -int lcvtxsetassociatedparticle( PTRTYPE vertex, PTRTYPE particle ) { - VertexImpl* vtx = f2c_pointer( vertex ) ; - ReconstructedParticle* rcp = f2c_pointer( particle ) ; - vtx->setAssociatedParticle( rcp ) ; - return LCIO::SUCCESS ; -} - diff --git a/src/cpp/src/CPPFORT/lcwrt.cc b/src/cpp/src/CPPFORT/lcwrt.cc deleted file mode 100644 index 3be0c3c25..000000000 --- a/src/cpp/src/CPPFORT/lcwrt.cc +++ /dev/null @@ -1,69 +0,0 @@ -#include "CPPFORT/lcwrt.h" - -#include "lcio.h" -#include "IOIMPL/LCFactory.h" -#include "IMPL/LCRunHeaderImpl.h" -#include "IMPL/LCEventImpl.h" -#include - -using namespace lcio ; - -#define LCWRITER_PNTR( writer ) if(! (writer) ) return 0 ; \ -LCWriter* lcWriter = reinterpret_cast( (writer) ) ; - - -PTRTYPE lcwrtcreate(){ - LCWriter* lcWriter = LCFactory::getInstance()->createLCWriter() ; - return reinterpret_cast(lcWriter) ; -} - -int lcwrtdelete(PTRTYPE writer){ - LCWRITER_PNTR( writer ) ; - delete lcWriter ; - return LCIO::SUCCESS ; -} - -int lcwrtopen(PTRTYPE writer, const char* filename, int writeMode ){ - try{ - LCWriter* wrt = reinterpret_cast( writer ) ; - wrt->open( filename , writeMode ) ; - - }catch(...){ return LCIO::ERROR ; } - return LCIO::SUCCESS ; - -} - -int lcwrtclose(PTRTYPE writer){ - try{ - LCWriter* wrt = reinterpret_cast( writer ) ; - wrt->close() ; - }catch(...){ return LCIO::ERROR ; } - - return LCIO::SUCCESS ; -} - -int lcwrtwriterunheader( PTRTYPE writer, PTRTYPE header){ - try{ - - LCWriter* wrt = reinterpret_cast( writer ) ; - LCRunHeader* hdr = reinterpret_cast( header ) ; - - wrt->writeRunHeader( hdr ) ; - - }catch(...){ return LCIO::ERROR ; } - - return LCIO::SUCCESS ; -} -int lcwrtwriteevent( PTRTYPE writer, PTRTYPE event){ - - try{ - - LCWriter* wrt = reinterpret_cast( writer ) ; - LCEvent* evt = reinterpret_cast( event ) ; - - wrt->writeEvent( evt ) ; - - }catch(...){ return LCIO::ERROR ; } - - return LCIO::SUCCESS ; -} diff --git a/src/cpp/src/EXAMPLE/check_missing_cols.cc b/src/cpp/src/EXAMPLE/check_missing_cols.cc index d265a03de..f3f900373 100644 --- a/src/cpp/src/EXAMPLE/check_missing_cols.cc +++ b/src/cpp/src/EXAMPLE/check_missing_cols.cc @@ -14,35 +14,45 @@ static std::vector FILEN ; int main(int argc, char** argv ){ // read file names from command line (only argument) + bool minimal = false ; if( argc < 2) { - std::cout << " usage: check_missing_cols [[input-file2],...]" << std::endl << std::endl ; + std::cout << " usage: check_missing_cols [--minimal] [[input-file2],...]" << std::endl << std::endl ; exit(1) ; } for(int i=1 ; i < argc ; i++){ + if (argv[i] == std::string("--minimal")){ + minimal = true ; + continue ; + } + FILEN.push_back( argv[i] ) ; } int nFiles = argc-1 ; + if (minimal == true){ + nFiles --; + } - MT::LCReader lcReader(0) ; - - std::cout << "patch_events: will open and read from files: " << std::endl ; - - for(int i=0 ; i < nFiles ; i++){ - - lcReader.open( FILEN[i] ) ; - - std::cout << std::endl << " " << FILEN[i] - << " [ nEvt = " << lcReader.getNumberOfEvents() << " ] " - << std::endl ; + if (minimal == false){ + MT::LCReader lcReader(0) ; - lcReader.close() ; - } - + std::cout << "patch_events: will open and read from files: " << std::endl ; + + for(int i=0 ; i < nFiles ; i++){ + + lcReader.open( FILEN[i] ) ; + + std::cout << std::endl << " " << FILEN[i] + << " [ nEvt = " << lcReader.getNumberOfEvents() << " ] " + << std::endl ; + + lcReader.close() ; + } + } UTIL::CheckCollections colCheck ; - colCheck.checkFiles( FILEN ) ; + colCheck.checkFiles( FILEN ,minimal) ; - colCheck.print( std::cout ) ; + colCheck.print( std::cout ,minimal) ; return 0 ; diff --git a/src/cpp/src/EXAMPLE/dumpmctree b/src/cpp/src/EXAMPLE/dumpmctree new file mode 100755 index 000000000..3d9e29ab7 --- /dev/null +++ b/src/cpp/src/EXAMPLE/dumpmctree @@ -0,0 +1,31 @@ +#!/bin/bash + +if ! dumpmctree-dot -h > /dev/null 2>&1; then + echo "dumpmctree-dot executable not found. Make sure it's on PATH" + exit 1 +fi + +# Store the full argument list to pass it on after we have sorted out the help +ARGS=("$@") + +while [ $# != 0 ]; do + case "$1" in + -h|--help) + dumpmctree-dot -h + exit 0 + ;; + *) + shift + ;; + esac +done + +if dumpmctree-dot "${ARGS[@]}"; then + if [ -f dumpmctree.svg ]; then + mv -f dumpmctree.svg dumpmctree.svg.bkp + fi + dot -Tsvg dumpmctree_tmp.dot > dumpmctree.svg + xdg-open dumpmctree.svg +else + exit 1 +fi diff --git a/src/cpp/src/EXAMPLE/dumpmctree-dot.cc b/src/cpp/src/EXAMPLE/dumpmctree-dot.cc new file mode 100644 index 000000000..b1297e981 --- /dev/null +++ b/src/cpp/src/EXAMPLE/dumpmctree-dot.cc @@ -0,0 +1,812 @@ +#include "EVENT/LCCollection.h" +#include "EVENT/MCParticle.h" +#include "EVENT/LCEvent.h" + +#include "IO/LCReader.h" +#include "IOIMPL/LCFactory.h" + +#include +#include +#include +#include +#include +#include + +using namespace EVENT; +using namespace IO; +using IOIMPL::LCFactory; + +const static std::map pdg2strMap ={ + {91, "Cluster"}, + {92, "Hadronization"}, + {94, "Start pythia"}, + + // quarks + {1, "d"}, + {-1, "-d"}, + {2, "u"}, + {-2, "-u"}, + {3, "s"}, + {-3, "-s"}, + {4, "c"}, + {-4, "-c"}, + {5, "b"}, + {-5, "-b"}, + {6, "t"}, + {-6, "-t"}, + {7, "b'"}, + {-7, "-b'"}, + {8, "t'"}, + {-8, "-t'"}, + {9, "g"}, + + // leptons + {11, "e-"}, + {-11, "e+"}, + {12, "νe"}, + {-12, "νe"}, + {13, "μ-"}, + {-13, "μ+"}, + {14, "νμ"}, + {-14, "νμ"}, + {15, "τ-"}, + {-15, "τ+"}, + {16, "ντ"}, + {-16, "ντ"}, + //Gauge and Higgs Boson + {21, "g"}, + {22, "γ"}, + {23, "Z0"}, + {24, "W+"}, + {-24, "W-"}, + {25, "H0"}, + // Higgs? + // light mesons I=1 + {111, "π0"}, + {-111, "π0"}, + {211, "π+"}, + {-211, "π-"}, + {9000111, "a0(980)0"}, + {-9000111, "a0(980)0"}, + {9000211, "a0(980)+"}, + {-9000211, "a0(980)-"}, + {100111, "π(1300)0"}, + {-100111, "π(1300)0"}, + {100211, "π(1300)+"}, + {-100211, "π(1300)-"}, + {10111, "a0(1450)0"}, + {-10111, "a0(1450)0"}, + {10211, "a0(1450)+"}, + {-10211, "a0(1450)-"}, + {9010111, "π(1800)0"}, + {-9010111, "π(1800)0"}, + {9010211, "π(1800)+"}, + {-9010211, "π(1800)-"}, + {113, "ρ(770)0"}, + {-113, "ρ(770)0"}, + {213, "ρ(770)+"}, + {-213, "ρ(770)-"}, + {10113, "b1(1235)0"}, + {-10113, "b1(1235)0"}, + {10213, "b1(1235)+"}, + {-10213, "b1(1235)-"}, + {20113, "a1(1260)0"}, + {-20113, "a1(1260)0"}, + {20213, "a1(1260)+"}, + {-20213, "a1(1260)-"}, + {9000113, "π1(1400)0"}, + {-9000113, "π1(1400)0"}, + {9000213, "π1(1400)+"}, + {-9000213, "π1(1400)-"}, + {100113, "ρ(1450)0"}, + {-100113, "ρ(1450)0"}, + {100213, "ρ(1450)+"}, + {-100213, "ρ(1450)-"}, + {9010113, "π1(1600)0"}, + {-9010113, "π1(1600)0"}, + {9010213, "π1(1600)+"}, + {-9010213, "π1(1600)-"}, + {9020113, "a1(1640)0"}, + {-9020113, "a1(1640)0"}, + {9020213, "a1(1640)+"}, + {-9020213, "a1(1640)-"}, + {30113, "ρ(1700)0"}, + {-30113, "ρ(1700)0"}, + {30213, "ρ(1700)+"}, + {-30213, "ρ(1700)-"}, + {9030113, "ρ(1900)0"}, + {-9030113, "ρ(1900)0"}, + {9030213, "ρ(1900)+"}, + {-9030213, "ρ(1900)-"}, + {9040113, "ρ(2150)0"}, + {-9040113, "ρ(2150)0"}, + {9040213, "ρ(2150)+"}, + {-9040213, "ρ(2150)-"}, + {115, "a2(1320)0"}, + {-115, "a2(1320)0"}, + {215, "a2(1320)+"}, + {-215, "a2(1320)-"}, + {10115, "π2(1670)0"}, + {-10115, "π2(1670)0"}, + {10215, "π2(1670)+"}, + {-10215, "π2(1670)-"}, + {9000115, "a2(1700)0"}, + {-9000115, "a2(1700)0"}, + {9000215, "a2(1700)+"}, + {-9000215, "a2(1700)-"}, + {9010115, "π2(2100)0"}, + {-9010115, "π2(2100)0"}, + {9010215, "π2(2100)+"}, + {-9010215, "π2(2100)-"}, + {117, "ρ3(1690)0"}, + {-117, "ρ3(1690)0"}, + {217, "ρ3(1690)+"}, + {-217, "ρ3(1690)-"}, + {9000117, "ρ3(1990)0"}, + {-9000117, "ρ3(1990)0"}, + {9000217, "ρ3(1990)+"}, + {-9000217, "ρ3(1990)-"}, + {9010117, "ρ3(2250)0"}, + {-9010117, "ρ3(2250)0"}, + {9010217, "ρ3(2250)+"}, + {-9010217, "ρ3(2250)-"}, + {119, "a4(2040)0"}, + {-119, "a4(2040)0"}, + {219, "a4(2040)+"}, + {-219, "a4(2040)-"}, + + + // light mesons I=0 + {221, "η"}, + {-221, "η"}, + {331, "η\'"}, + {-331, "η\'"}, + {9000221, "f0(600)"}, + {-9000221, "f0(600)"}, + {9010221, "f0(980)"}, + {-9010221, "f0(980)"}, + {100221, "η(1295)"}, + {-100221, "η(1295)"}, + {10221, "f0(1370)"}, + {-10221, "f0(1370)"}, + {9020221, "η(1405)"}, + {-9020221, "η(1405)"}, + {100331, "η(1475)"}, + {-100331, "η(1475)"}, + {9030221, "f0(1500)"}, + {-9030221, "f0(1500)"}, + {10331, "f0(1710)"}, + {-10331, "f0(1710)"}, + {9040221, "η(1760)"}, + {-9040221, "η(1760)"}, + {9050221, "f0(2020)"}, + {-9050221, "f0(2020)"}, + {9060221, "f0(2100)"}, + {-9060221, "f0(2100)"}, + {9070221, "f0(2200)"}, + {-9070221, "f0(2200)"}, + {9080221, "η(2225)"}, + {-9080221, "η(2225)"}, + {223, "ω"}, + {-223, "ω"}, + {333, "φ"}, + {-333, "φ"}, + {10223, "h1(1170)"}, + {-10223, "h1(1170)"}, + {20223, "f1(1285)"}, + {-20223, "f1(1285)"}, + {10333, "h1(1380)"}, + {-10333, "h1(1380)"}, + {20333, "f1(1420)"}, + {-20333, "f1(1420)"}, + {100223, "ω(1420)"}, + {-100223, "ω(1420)"}, + {9000223, "f1(1510)"}, + {-9000223, "f1(1510)"}, + {9010223, "h1(1595)"}, + {-9010223, "h1(1595)"}, + {30223, "ω(1650)"}, + {-30223, "ω(1650)"}, + {100333, "φ(1680)"}, + {-100333, "φ(1680)"}, + {225, "f2(1270)"}, + {-225, "f2(1270)"}, + {9000225, "f2(1430)"}, + {-9000225, "f2(1430)"}, + {335, "f2\'(1525)"}, + {-335, "f2\'(1525)"}, + {9010225, "f2(1565)"}, + {-9010225, "f2(1565)"}, + {9020225, "f2(1640)"}, + {-9020225, "f2(1640)"}, + {10225, "η2(1645)"}, + {-10225, "η2(1645)"}, + {9030225, "f2(1810)"}, + {-9030225, "f2(1810)"}, + {10335, "η2(1870)"}, + {-10335, "η2(1870)"}, + {9040225, "f2(1910)"}, + {-9040225, "f2(1910)"}, + {9050225, "f2(1950)"}, + {-9050225, "f2(1950)"}, + {9060225, "f2(2010)"}, + {-9060225, "f2(2010)"}, + {9070225, "f2(2150)"}, + {-9070225, "f2(2150)"}, + {9080225, "f2(2300)"}, + {-9080225, "f2(2300)"}, + {9090225, "f2(2340)"}, + {-9090225, "f2(2340)"}, + {227, "ω3(1670)"}, + {-227, "ω3(1670)"}, + {337, "φ3(1850)"}, + {-337, "φ3(1850)"}, + {229, "f4(2050)"}, + {-229, "f4(2050)"}, + {9000229, "fJ(2220)"}, + {-9000229, "fJ(2220)"}, + {9010229, "f4(2300)"}, + {-9010229, "f4(2300)"}, + + // strange mesons + {130, "KL0"}, + {-130, "KL0"}, + {310, "KS0"}, + {-310, "KS0"}, + {311, "K0"}, + {-311, "K0"}, + {321, "K+"}, + {-321, "K-"}, + {9000311, "K0*(800)0"}, + {-9000311, "K0*(800)0"}, + {9000321, "K0*(800)+"}, + {-9000321, "K0*(800)-"}, + {10311, "K0*(1430)0"}, + {-10311, "K0*(1430)0"}, + {10321, "K0*(1430)+"}, + {-10321, "K0*(1430)-"}, + {100311, "K(1460)0"}, + {-100311, "K(1460)0"}, + {100321, "K(1460)+"}, + {-100321, "K(1460)-"}, + {9010311, "K(1830)0"}, + {-9010311, "K(1830)0"}, + {9010321, "K(1830)+"}, + {-9010321, "K(1830)-"}, + {9020311, "K0*(1950)0"}, + {-9020311, "K0*(1950)0"}, + {9020321, "K0*(1950)+"}, + {-9020321, "K0*(1950)-"}, + {313, "K*(892)0"}, + {-313, "K*(892)0"}, + {323, "K*(892)+"}, + {-323, "K*(892)-"}, + {10313, "K1(1270)0"}, + {-10313, "K1(1270)0"}, + {10323, "K1(1270)+"}, + {-10323, "K1(1270)-"}, + {20313, "K1(1400)0"}, + {-20313, "K1(1400)0"}, + {20323, "K1(1400)+"}, + {-20323, "K1(1400)-"}, + {100313, "K*(1410)0"}, + {-100313, "K*(1410)0"}, + {100323, "K*(1410)+"}, + {-100323, "K*(1410)-"}, + {9000313, "K1(1650)0"}, + {-9000313, "K1(1650)0"}, + {9000323, "K1(1650)+"}, + {-9000323, "K1(1650)-"}, + {30313, "K*(1680)0"}, + {-30313, "K*(1680)0"}, + {30323, "K*(1680)+"}, + {-30323, "K*(1680)-"}, + {315, "K2*(1430)0"}, + {-315, "K2*(1430)0"}, + {325, "K2*(1430)+"}, + {-325, "K2*(1430)-"}, + {9000315, "K2(1580)0"}, + {-9000315, "K2(1580)0"}, + {9000325, "K2(1580)+"}, + {-9000325, "K2(1580)-"}, + {10315, "K2(1770)0"}, + {-10315, "K2(1770)0"}, + {10325, "K2(1770)+"}, + {-10325, "K2(1770)-"}, + {20315, "K2(1820)0"}, + {-20315, "K2(1820)0"}, + {20325, "K2(1820)+"}, + {-20325, "K2(1820)-"}, + {9010315, "K2*(1980)0"}, + {-9010315, "K2*(1980)0"}, + {9010325, "K2*(1980)+"}, + {-9010325, "K2*(1980)-"}, + {9020315, "K2(2250)0"}, + {-9020315, "K2(2250)0"}, + {9020325, "K2(2250)+"}, + {-9020325, "K2(2250)-"}, + {317, "K3*(1780)0"}, + {-317, "K3*(1780)0"}, + {327, "K3*(1780)+"}, + {-327, "K3*(1780)-"}, + {9010317, "K3(2320)0"}, + {-9010317, "K3(2320)0"}, + {9010327, "K3(2320)+"}, + {-9010327, "K3(2320)-"}, + {319, "K4*(2045)0"}, + {-319, "K4*(2045)0"}, + {329, "K4*(2045)+"}, + {-329, "K4*(2045)-"}, + {9000319, "K4(2500)0"}, + {-9000319, "K4(2500)0"}, + {9000329, "K4(2500)+"}, + {-9000329, "K4(2500)-"}, + + + //charmed mesons + {411, "D+"}, + {-411, "D-"}, + {421, "D0"}, + {-421, "D0"}, + {10411, "D0*(2400)+"}, + {-10411, "D0*(2400)-"}, + {10421, "D0*(2400)0"}, + {-10421, "D0*(2400)0"}, + {413, "D*(2010)+"}, + {-413, "D*(2010)-"}, + {423, "D*(2007)0"}, + {-423, "D*(2007)0"}, + {10413, "D1(2420)+"}, + {-10413, "D1(2420)-"}, + {10423, "D1(2420)0"}, + {-10423, "D1(2420)0"}, + {20413, "D1(H)+"}, + {-20413, "D1(H)-"}, + {20423, "D1(2430)0"}, + {-20423, "D1(2430)0"}, + {415, "D2*(2460)+"}, + {-415, "D2*(2460)-"}, + {425, "D2*(2460)0"}, + {-425, "D2*(2460)0"}, + {431, "Ds+"}, + {-431, "Ds-"}, + {10431, "Ds0*(2317)+"}, + {-10431, "Ds0*(2317)-"}, + {433, "Ds*+"}, + {-433, "Ds*-"}, + {10433, "Ds1(2536)+"}, + {-10433, "Ds1(2536)-"}, + {20433, "Ds1(2460)+"}, + {-20433, "Ds1(2460)-"}, + {435, "Ds2*(2573)+"}, + {-435, "Ds2*(2573)-"}, + + //bottom mesons + {511, "B0"}, + {-511, "B0"}, + {521, "B+"}, + {-521, "B-"}, + {10511, "B0*0"}, + {-10511, "B0*0"}, + {10521, "B0*+"}, + {-10521, "B0*-"}, + {513, "B*0"}, + {-513, "B*0"}, + {523, "B*+"}, + {-523, "B*-"}, + {10513, "B1(L)0"}, + {-10513, "B1(L)0"}, + {10523, "B1(L)+"}, + {-10523, "B1(L)-"}, + {20513, "B1(H)0"}, + {-20513, "B1(H)0"}, + {20523, "B1(H)+"}, + {-20523, "B1(H)-"}, + {515, "B2*0"}, + {-515, "B2*0"}, + {525, "B2*+"}, + {-525, "B2*-"}, + {531, "Bs0"}, + {-531, "Bs0"}, + {10531, "Bs0*0"}, + {-10531, "Bs0*0"}, + {533, "Bs*0"}, + {-533, "Bs*0"}, + {10533, "Bs1(L)0"}, + {-10533, "Bs1(L)0"}, + {20533, "Bs1(H)0"}, + {-20533, "Bs1(H)0"}, + {535, "Bs2*0"}, + {-535, "Bs2*0"}, + {541, "Bc+"}, + {-541, "Bc-"}, + {10541, "Bc0*+"}, + {-10541, "Bc0*-"}, + {543, "Bc*+"}, + {-543, "Bc*-"}, + {10543, "Bc1(L)+"}, + {-10543, "Bc1(L)-"}, + {20543, "Bc1(H)+"}, + {-20543, "Bc1(H)-"}, + {545, "Bc2+"}, + {-545, "Bc2-"}, + + //cc mesons + {441, "ηc(1S)"}, + {-441, "ηc(1S)"}, + {10441, "χc0(1P)"}, + {-10441, "χc0(1P)"}, + {100441, "ηc(2S)"}, + {-100441, "ηc(2S)"}, + {443, "J/ψ(1S)"}, + {-443, "J/ψ(1S)"}, + {10443, "hc(1P)"}, + {-10443, "hc(1P)"}, + {20443, "χc1(1P)"}, + {-20443, "χc1(1P)"}, + {100443, "ψ(2S)"}, + {-100443, "ψ(2S)"}, + {30443, "ψ(3770)"}, + {-30443, "ψ(3770)"}, + {9000443, "ψ(4040)"}, + {-9000443, "ψ(4040)"}, + {9010443, "ψ(4160)"}, + {-9010443, "ψ(4160)"}, + {9020443, "ψ(4415)"}, + {-9020443, "ψ(4415)"}, + {445, "χc2(1P)"}, + {-445, "χc2(1P)"}, + {100445, "χc2(2P)"}, + {-100445, "χc2(2P)"}, + + //light baryons + {2212, "p+"}, + {-2212, "p-"}, + {2112, "n"}, + {-2112, "n"}, + {2224, "Δ++"}, + {-2224, "Δ--"}, + {2214, "Δ+"}, + {-2214, "Δ+"}, + {2114, "Δ0"}, + {-2114, "Δ0"}, + {1114, "Δ-"}, + {-1114, "Δ-"}, + //strange baryons + {3122, "Λ"}, + {-3122, "Λ"}, + {3222, "Σ+"}, + {-3222, "Σ+"}, + {3212, "Σ0"}, + {-3212, "Σ0"}, + {3112, "Σ-"}, + {-3112, "Σ-"}, + {3224, "Σ*+"}, + {-3224, "Σ*+"}, + {3214, "Σ*0"}, + {-3214, "Σ*0"}, + {3114, "Σ*-"}, + {-3114, "Σ*-"}, + {3322, "Ξ0"}, + {-3322, "Ξ0"}, + {3312, "Ξ-"}, + {-3312, "Ξ-"}, + {3324, "Ξ*0"}, + {-3324, "Ξ*0"}, + {3314, "Ξ*-"}, + {-3314, "Ξ*-"}, + {3334, "Ω-"}, + {-3334, "Ω-"}, + //charmed baryons + {4122, "Λc+"}, + {-4122, "Λc-"}, + {4222, "Σc++"}, + {-4222, "Σc--"}, + {4212, "Σc+"}, + {-4212, "Σc-"}, + {4112, "Σc0"}, + {-4112, "Σc0"}, + {4224, "Σc*++"}, + {-4224, "Σc*--"}, + {4214, "Σc*+"}, + {-4214, "Σc*-"}, + {4114, "Σc*0"}, + {-4114, "Σc*0"}, + {4232, "Ξc+"}, + {-4232, "Ξc-"}, + {4132, "Ξc0"}, + {-4132, "Ξc0"}, + {4322, "Ξc\'+"}, + {-4322, "Ξc\'-"}, + {4312, "Ξc\'0"}, + {-4312, "Ξc\'0"}, + {4324, "Ξc*+"}, + {-4324, "Ξc*-"}, + {4314, "Ξc*0"}, + {-4314, "Ξc*0"}, + {4332, "Ωc0"}, + {-4332, "Ωc0"}, + {4334, "Ωc*0"}, + {-4334, "Ωc*0"}, + {4412, "Ξcc+"}, + {-4412, "Ξcc-"}, + {4422, "Ξcc++"}, + {-4422, "Ξcc--"}, + {4414, "Ξcc*+"}, + {-4414, "Ξcc*-"}, + {4424, "Ξcc*++"}, + {-4424, "Ξcc*--"}, + {4432, "Ωcc+"}, + {-4432, "Ωcc-"}, + {4434, "Ωcc*+"}, + {-4434, "Ωcc*-"}, + {4444, "Ωccc++"}, + {-4444, "Ωccc--"}, + //bottom baryons + {5122, "Λb0"}, + {-5122, "Λb0"}, + {5112, "Σb-"}, + {-5112, "Σb-"}, + {5212, "Σb0"}, + {-5212, "Σb0"}, + {5222, "Σb+"}, + {-5222, "Σb+"}, + {5114, "Σb*-"}, + {-5114, "Σb*-"}, + {5214, "Σb*0"}, + {-5214, "Σb*0"}, + {5224, "Σb*+"}, + {-5224, "Σb*+"}, + {5132, "Ξb-"}, + {-5132, "Ξb-"}, + {5232, "Ξb0"}, + {-5232, "Ξb0"}, + {5312, "Ξb\'-"}, + {-5312, "Ξb\'-"}, + {5322, "Ξb\'0"}, + {-5322, "Ξb\'0"}, + {5314, "Ξb*-"}, + {-5314, "Ξb*-"}, + {5324, "Ξb*0"}, + {-5324, "Ξb*0"}, + {5332, "Ωb-"}, + {-5332, "Ωb-"}, + {5334, "Ωb*-"}, + {-5334, "Ωb*-"}, + {5142, "Ξbc0"}, + {-5142, "Ξbc0"}, + {5242, "Ξbc+"}, + {-5242, "Ξbc-"}, + {5412, "Ξbc\'0"}, + {-5412, "Ξbc\'0"}, + {5422, "Ξbc\'+"}, + {-5422, "Ξbc\'-"}, + {5414, "Ξbc*0"}, + {-5414, "Ξbc*0"}, + {5424, "Ξbc*+"}, + {-5424, "Ξbc*-"}, + {5342, "Ωbc0"}, + {-5342, "Ωbc0"}, + {5432, "Ωbc\'0"}, + {-5432, "Ωbc\'0"}, + {5434, "Ωbc*0"}, + {-5434, "Ωbc*0"}, + {5442, "Ωbcc+"}, + {-5442, "Ωbcc-"}, + {5444, "Ωbcc*+"}, + {-5444, "Ωbcc*-"}, + {5512, "Ξbb-"}, + {-5512, "Ξbb+"}, + {5522, "Ξbb0"}, + {-5522, "Ξbb0"}, + {5514, "Ξbb*-"}, + {-5514, "Ξbb*+"}, + {5524, "Ξbb*0"}, + {-5524, "Ξbb*0"}, + {5532, "Ωbb-"}, + {-5532, "Ωbb+"}, + {5534, "Ωbb*-"}, + {-5534, "Ωbb*+"}, + {5542, "Ωbbc0"}, + {-5542, "Ωbbc0"}, + {5544, "Ωbbc*0"}, + {-5544, "Ωbbc*0"}, + {5554, "Ωbbb-"}, + {-5554, "Ωbbb+"} +}; + +bool isBeforeHadronisation(MCParticle* mc){ + if ( mc->getPDG() == 92 || mc->getPDG() == 91 || mc->getPDG() == 94 ) return true; + for(auto daughter : mc->getDaughters() ){ + if ( isBeforeHadronisation(daughter) ) return true; + } + return false; +} + +bool isAfterHadronization(MCParticle* mc){ + if ( mc->getPDG() == 92 || mc->getPDG() == 91 || mc->getPDG() == 94 ) return true; + for( auto parent : mc->getParents() ){ + if ( isAfterHadronization(parent) ) return true; + } + return false; +} + + +void drawMcTree(LCEvent* event, bool drawSimulated, bool drawParton, bool drawOverlay){ + // initialize maps to store variables attached to the MC particles + std::map p2idx; + + const std::vector* colNames = event->getCollectionNames(); + std::string mcColName; + if ( std::find(colNames->begin(), colNames->end(), "MCParticle") != colNames->end() ){ + mcColName = "MCParticle"; + } + else if ( std::find(colNames->begin(), colNames->end(), "MCParticlesSkimmed") != colNames->end() ){ + mcColName = "MCParticlesSkimmed"; + } + else{ + std::cout<<"No MCParticles collection found"<getCollection(mcColName); + + //get interaction point + MCParticle* mc0 = static_cast (mcCol->getElementAt(0)); + auto ip = mc0->getVertex(); + + // Fill MCParticle pointer-to-variable maps + for(int i=0; i< mcCol->getNumberOfElements(); ++i){ + MCParticle* mc = static_cast (mcCol->getElementAt(i)); + p2idx[mc] = i; + } + + //fill the stringstream content for the dot file + std::stringstream nodes; + std::stringstream labels; + + auto isRejected = [&](MCParticle* mc) -> bool { + return (!drawSimulated && mc->isCreatedInSimulation()) || + (!drawOverlay && mc->isOverlay()) || + (!drawParton && (isBeforeHadronisation(mc) && (!(mc->getPDG() == 91 || mc->getPDG() == 92))) ); + }; + + + for(int i=0; i < mcCol->getNumberOfElements(); ++i){ + MCParticle* mc = static_cast (mcCol->getElementAt(i)); + if ( isRejected(mc) ) continue; + + //for each of this considered particles add daughters relations, excluding above-mentioned particles again + for( auto daughter : mc->getDaughters() ){ + if ( isRejected(daughter) ) continue; + nodes<<" "<"<getPDG(); + std::string label; + if ( auto it = pdg2strMap.find(pdg); it != pdg2strMap.end() ){ + label = it->second; + } + else{ + label = std::to_string(pdg); + } + double dToIP = std::hypot( mc->getVertex()[0]-ip[0], mc->getVertex()[1]-ip[1], mc->getVertex()[2]-ip[2] ); + double pt = std::hypot( mc->getMomentum()[0], mc->getMomentum()[1] ); + double pz = mc->getMomentum()[2]; + labels<"<"<"; + if ( isBeforeHadronisation(mc) ) labels<<" style=\"filled\" fillcolor=\"burlywood4\""; + else if ( mc->isOverlay() && mc->isCreatedInSimulation() ) labels<<" style=\"filled\" fillcolor=\"darkorange4\""; + else if ( mc->isOverlay() ) labels<<" style=\"filled\" fillcolor=\"dimgray\""; + else if ( mc->isCreatedInSimulation() ) labels<<" style=\"filled\" fillcolor=\"darkorange\""; + labels<<"];"<createLCReader() ; + lcReader->setReadCollectionNames({"MCParticle", "MCParticlesSkimmed"}); + + lcReader->open(filename); + lcReader->skipNEvents(eventNumber - 1); + LCEvent* event = lcReader->readNextEvent(); + if(!event){ + std::cerr << " File has less events than required " << eventNumber << std::endl; + return 1; + } + + // Do actuall drawing here + drawMcTree(event, drawSimulated, drawParton, drawOverlay); + lcReader->close(); + return 0; +} diff --git a/src/cpp/src/EXAMPLE/lcio_io_benchmark.cc b/src/cpp/src/EXAMPLE/lcio_io_benchmark.cc index b6fee6f4d..805c3e0c0 100644 --- a/src/cpp/src/EXAMPLE/lcio_io_benchmark.cc +++ b/src/cpp/src/EXAMPLE/lcio_io_benchmark.cc @@ -182,7 +182,7 @@ int main(int argc, char** argv ){ lcReader->readStream(); } } - catch(IO::EndOfDataException) { + catch(IO::EndOfDataException&) { } diff --git a/src/cpp/src/IMPL/TrackImpl.cc b/src/cpp/src/IMPL/TrackImpl.cc index 6db811c03..45b7a5e42 100644 --- a/src/cpp/src/IMPL/TrackImpl.cc +++ b/src/cpp/src/IMPL/TrackImpl.cc @@ -21,7 +21,7 @@ namespace IMPL { } // copy constructor - TrackImpl::TrackImpl(const TrackImpl& o) + TrackImpl::TrackImpl(const TrackImpl& o) : AccessChecked(o) { *this = o ; // call operator = diff --git a/src/cpp/src/IMPL/TrackStateImpl.cc b/src/cpp/src/IMPL/TrackStateImpl.cc index 46d89df51..7745c8dd8 100644 --- a/src/cpp/src/IMPL/TrackStateImpl.cc +++ b/src/cpp/src/IMPL/TrackStateImpl.cc @@ -82,10 +82,6 @@ namespace IMPL { } - - - TrackStateImpl::~TrackStateImpl() { /* no-op */ } - int TrackStateImpl::getLocation() const { return _location ;} float TrackStateImpl::getD0() const { return _d0 ;} float TrackStateImpl::getPhi() const { return _phi ; } diff --git a/src/cpp/src/SIO/SIOTrackHandler.cc b/src/cpp/src/SIO/SIOTrackHandler.cc index aa506c7c9..ef71de027 100644 --- a/src/cpp/src/SIO/SIOTrackHandler.cc +++ b/src/cpp/src/SIO/SIOTrackHandler.cc @@ -50,7 +50,9 @@ namespace SIO { SIO_DATA( device , &(trk->_ndf) , 1 ) ; SIO_DATA( device , &(trk->_dEdx) , 1 ) ; SIO_DATA( device , &(trk->_dEdxError) , 1 ) ; - SIO_DATA( device , &(trk->_nholes) , 1 ) ; + if (vers > SIO_VERSION_ENCODE(2, 21)) { + SIO_DATA( device , &(trk->_nholes) , 1 ) ; + } SIO_DATA( device , &( trk->_radiusOfInnermostHit ) , 1 ) ; int nHitNumbers ; SIO_DATA( device, &nHitNumbers , 1 ) ; @@ -58,11 +60,13 @@ namespace SIO { for( int i=0 ; i_subdetectorHitNumbers[i] ), 1 ) ; } - int nHoleNumbers ; - SIO_DATA( device, &nHoleNumbers , 1 ) ; - trk->subdetectorHoleNumbers().resize( nHoleNumbers ) ; - for( int i=0 ; i_subdetectorHoleNumbers[i] ), 1 ) ; + if (vers > SIO_VERSION_ENCODE(2, 21)) { + int nHoleNumbers ; + SIO_DATA( device, &nHoleNumbers , 1 ) ; + trk->subdetectorHoleNumbers().resize( nHoleNumbers ) ; + for( int i=0 ; i_subdetectorHoleNumbers[i] ), 1 ) ; + } } int nTracks ; SIO_DATA( device, &nTracks , 1 ) ; diff --git a/src/cpp/src/UTIL/CheckCollections.cc b/src/cpp/src/UTIL/CheckCollections.cc index 66c21b28c..2c58c7b1d 100644 --- a/src/cpp/src/UTIL/CheckCollections.cc +++ b/src/cpp/src/UTIL/CheckCollections.cc @@ -9,18 +9,16 @@ namespace UTIL{ - void CheckCollections::checkFiles( const std::vector& fileNames ){ + void CheckCollections::checkFiles( const std::vector& fileNames, bool quiet){ for( auto n : fileNames ) - checkFile( n ) ; + checkFile( n ,quiet) ; } - void CheckCollections::checkFile( const std::string& fileName ){ - - MT::LCReader lcReader(0) ; + void CheckCollections::checkFile( const std::string& fileName, bool quiet){ + MT::LCReader lcReader(MT::LCReader::directAccess) ; lcReader.open( fileName ) ; - //----------- the event loop ----------- while( const auto evt = lcReader.readNextEventHeader() ) { @@ -33,8 +31,33 @@ namespace UTIL{ if( it == _map.end() ){ auto col = evt->getCollection( name ) ; - - const auto[ itx, inserted] = _map.emplace( name, std::make_pair( col->getTypeName() , 0 ) ) ; + // If the type of a collection is LCRelation we want to read the entire + // collections instead of just the header to get the 'ToType' and + // 'FromType'. setReadCollectionNames({name}) allows reading of only + // certain collections by name instead of an entire event. This flag has to + // be unset after reading in order for the reading of the headers to + // function properly. + std::string typeString; + if (col->getTypeName() == "LCRelation"){ + lcReader.setReadCollectionNames({name}); + auto fullEvt = lcReader.readEvent(evt->getRunNumber(), evt->getEventNumber()); + lcReader.setReadCollectionNames({}); + + auto fullcol = fullEvt->getCollection( name ) ; + const auto& params = fullcol->getParameters(); + const auto& fromType = params.getStringVal("FromType"); + const auto& toType = params.getStringVal("ToType"); + if (quiet == false){ + if (fromType == ""|| toType == ""){ + std::cout<< "WARNING! : Relation " << name <<" does not have the 'FromType' and 'ToType' set."<getTypeName(); + } + const auto[ itx, inserted] = _map.emplace( name, std::make_pair( std::move(typeString) , 0 ) ) ; it = itx ; } @@ -68,49 +91,87 @@ namespace UTIL{ return s ; } - void CheckCollections::patchCollections(EVENT::LCEvent* evt ) const { + // Obtain the from and to type from the encoded "LCRelation[From,To]" + std::tuple getToFromType(const std::string_view fullType) { + auto delim = fullType.find(','); + constexpr auto prefixLen = 11u; // length of "LCRelation[" - for(auto c : _patchCols ){ + return {fullType.substr(prefixLen, delim - prefixLen), + fullType.substr(delim + 1, fullType.size() - delim - 2)}; // need to strip final "]" as well + } - try{ + void CheckCollections::patchCollections(EVENT::LCEvent* evt ) const { - evt->getCollection( c.first ) ; + for(const auto& c : _patchCols ){ + try{ + auto* coll = evt->getCollection( c.first ) ; + // For LCRelations we still have to check whether the FromType and + // ToType are set and correct in case they are not + if (coll->getTypeName() == "LCRelation") { + auto& params = coll->parameters(); + if (params.getStringVal("FromType").empty() || params.getStringVal("ToType").empty()) { + const auto [from, to] = getToFromType(c.second); + params.setValue("FromType", std::string(from)); + params.setValue("ToType", std::string(to)); + } + } } catch( EVENT::DataNotAvailableException& e) { - - evt->addCollection( new IMPL::LCCollectionVec(c.second), c.first ) ; + //10 is the length of the String LCRelation after which the bracket is and the "ToType" and "FromType" start. + if (c.second.size() > 10 && c.second[10] == '[') { + auto relationColl = new IMPL::LCCollectionVec("LCRelation"); + auto& params = relationColl->parameters(); + + const auto [from, to] = getToFromType(c.second); + params.setValue("FromType", std::string(from)); + params.setValue("ToType", std::string(to)); + evt->addCollection( relationColl, c.first ) ; + } else { + evt->addCollection( new IMPL::LCCollectionVec(c.second), c.first ) ; + } } } } - void CheckCollections::print( std::ostream& os ) const { + void CheckCollections::print( std::ostream& os ,bool minimal) const { unsigned width = 50 ; - + if (minimal == false){ os << " ================================================================ " << std::endl ; os << std::endl << " " << _nEvents << " events read " << std::endl ; os << " collections that are not in all events : [# events where col is present]" << std::endl ; os << " ================================================================ " << std::endl ; - - for(auto e : _map ){ - - if( e.second.second != _nEvents ) - os << " " << std::setw(width) << std::left << e.first << " " <second ; } - const std::string& PIDHandler::getAlgorithmName( int algoID ) { + const std::string& PIDHandler::getAlgorithmName( int algoID ) const { - CPMINV::iterator it = _cpmInv.find( algoID ) ; + const auto it = _cpmInv.find( algoID ) ; if( it == _cpmInv.end() ){ @@ -182,10 +182,10 @@ namespace UTIL{ - int PIDHandler::getParameterIndex( int algorithmID, const std::string& name ) { + int PIDHandler::getParameterIndex( int algorithmID, const std::string& name ) const { - PNM::iterator nit = _pNames.find( algorithmID ) ; + const auto nit = _pNames.find( algorithmID ) ; if( nit == _pNames.end() ){ @@ -209,9 +209,9 @@ namespace UTIL{ } - const StringVec& PIDHandler::getParameterNames( int id ) { + const StringVec& PIDHandler::getParameterNames( int id ) const { - PNM::iterator nit = _pNames.find( id ) ; + const auto nit = _pNames.find( id ) ; if( nit == _pNames.end() ){ @@ -222,7 +222,7 @@ namespace UTIL{ return nit->second ; } - const IntVec& PIDHandler::getAlgorithmIDs() { + const IntVec& PIDHandler::getAlgorithmIDs() const { return _ids ; } @@ -231,7 +231,7 @@ namespace UTIL{ void PIDHandler::setParticleIDUsed( ReconstructedParticleImpl* p , int id ) { - PNM::iterator nit = _pNames.find( id ) ; + const auto nit = _pNames.find( id ) ; if( nit == _pNames.end() ){ @@ -277,9 +277,9 @@ namespace UTIL{ } - ParticleIDVec PIDHandler::getParticleIDs( LCObject* p , int id ) { + ParticleIDVec PIDHandler::getParticleIDs( LCObject* p , int id ) const { - PNM::iterator nit = _pNames.find( id ) ; + const auto nit = _pNames.find( id ) ; if( nit == _pNames.end() ){ @@ -320,9 +320,9 @@ namespace UTIL{ return pidVID ; } - const ParticleID& PIDHandler::getParticleID( LCObject* p , int id ) { + const ParticleID& PIDHandler::getParticleID( LCObject* p , int id ) const { - PNM::iterator nit = _pNames.find( id ) ; + const auto nit = _pNames.find( id ) ; if( nit == _pNames.end() ){ diff --git a/src/f77/CMakeLists.txt b/src/f77/CMakeLists.txt deleted file mode 100644 index 9f1719ebd..000000000 --- a/src/f77/CMakeLists.txt +++ /dev/null @@ -1,61 +0,0 @@ -############################################## -# cmake file for building fortran examples -# @author Jan Engels, DESY -############################################## - -# project name -PROJECT( LCIOF77 Fortran ) - -# ${CMAKE_Fortran_FLAGS} do not get propagated from the parent CMakeLists because -# this CMakeLists contains the line PROJECT( .... ) -#IF( BUILD_32BIT_COMPATIBLE ) -# SET( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -m32" ) -#ENDIF() - -IF( CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" ) - EXECUTE_PROCESS( COMMAND ${CMAKE_Fortran_COMPILER} -dumpversion OUTPUT_VARIABLE GFORTRAN_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE ) - - IF( ${GFORTRAN_VERSION} VERSION_GREATER 4.3 ) - # fix for gcc 4.4 compiler (Error: Arithmetic overflow) - MESSAGE( STATUS "adding -fno-range-check fortran compiler flag" ) - SET( CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fno-range-check" ) - ENDIF() - IF ( ${GFORTRAN_VERSION} VERSION_GREATER 10 ) - # fix the BOZ literal constant errors that are treated more stringent - # starting from gcc10 (turns the errors into warnings) - MESSAGE(STATUS "adding -fallow-invalid-boz fortran compiler flag") - SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fallow-invalid-boz") - ENDIF() -ENDIF() - - -#------------------------------------------------------------------------- - - -# fortran testjobs -SET( f77_bins - anajob - recjob - simjob - simjob_chain -) - -# create symbolic bin target for calling targets bin_XXX -ADD_CUSTOM_TARGET( f77 ) - -# loop through list of binaries -FOREACH( bin ${f77_bins} ) - # create target for binary - ADD_EXECUTABLE( f77_${bin} ${bin}.F ) - SET_TARGET_PROPERTIES( f77_${bin} PROPERTIES OUTPUT_NAME ${bin}_F ) - # tell bin target to call this bin_XXX target - ADD_DEPENDENCIES( f77 f77_${bin} ) - - #FIXME: frtbegin g2c and gfortran needs to be tested - #TARGET_LINK_LIBRARIES( f77_${bin} lcio lcioF77 frtbegin g2c ) - TARGET_LINK_LIBRARIES( f77_${bin} lcio lcioF77 ) - - # install binary commando - INSTALL( TARGETS f77_${bin} DESTINATION bin ) -ENDFOREACH() - diff --git a/src/f77/README b/src/f77/README deleted file mode 100644 index 71372d520..000000000 --- a/src/f77/README +++ /dev/null @@ -1,14 +0,0 @@ - -========================================================================== -This directory contains 2 examples for the Fortran interface to LCIO - -anajob.F: -a simple program to read a file 'simjob.slcio' written by simjob -(executable of $LCIO/src/cpp/src/EXAMPLE/simjob.cc) to test some -wrapper functions of the f77api and the f77apiext - -simjob.F: -a program -1st - creating LCIO output written to the file 'f_simjob.slcio' -2nd - reading this file and writing some info to standard output - diff --git a/src/f77/anajob.F b/src/f77/anajob.F deleted file mode 100644 index 6f844c84e..000000000 --- a/src/f77/anajob.F +++ /dev/null @@ -1,190 +0,0 @@ -*********************************************************** -* - program anajob -* -* A program to demonstrate the use of the -* fortran interface to LCIO for reading LCIO files. -* -* H. Vogt 30/09/2003 -* modified by F. Gaede 10/30/2003 -* Bug corrected by H. Vogt 03/19/2004 -* -*********************************************************** - implicit none - -#include "lciof77api.inc" -#include "lciof77apiext.inc" - - PTRTYPE reader, event, runhdr, detnames - PTRTYPE pcolnamev, pcol, pobject - - integer nargs, nFiles, nEvents - integer status, irun, ievent - integer i, k, ii, nactdet, ncolname - character*80 detname, descr - - character*40 colname, colnamev(20), filenames(20) - character*40 colname1, colname2 - integer nintv, nfloatv, nelem, ncolnames - integer intv(10) - real floatv(10) - - -c---- read file names from command line (only argument) - nargs = iargc() - if (nargs .lt. 1) then - print *, ' usage: anajob [[input-file2],...]' - stop - else if (nargs .gt. 20) then - print *, ' usage: more than max = 20 file names given' - stop - end if - do i = 1, nargs - call getarg (i, filenames(i)) - end do - nFiles = nargs - - reader = lcrdrcreate() - -c---- first we read the run information - -c---- for reading from one file only use sth. like: -c---- filename = 'recjob.slcio' -c---- status = lcrdropen( reader, filename ) - status = lcrdropenchain( reader, filenames(1), nFiles, - & len(filenames(1)) ) - - if( status .eq. LCIO_ERROR ) then - write(*,*) ' could not open files ' - stop - else - write(*,*) 'will open and read from files: ' - write(*,'(5x,a)') - & ( filenames(i)(1:lnblnk(filenames(i)) ),i=1,nFiles) - endif - - -c---- loop over all run headers - 1 continue - runhdr = lcrdrreadnextrunheader( reader, LCIO_READ_ONLY ) - if( runhdr .eq. 0 ) go to 10 - - status = lcdumprunheader( runhdr ) -ccc detname = lcrhdgetdetectorname( runHdr ) -ccc descr = lcrhdgetdescription( runHdr ) -ccc write(*,'(a,i2,4a)') ' Run :', lcrhdgetrunnumber( runHdr ), -ccc & ' - ', detname(1:lnblnk(detname)), -ccc & ': ', descr(1:lnblnk(descr)) - -c---- this is additional compared to anajob.cc -ccc write(*,*) " active subdetectors : " -ccc detnames = lcrhdgetactivesubdetectors( runHdr ) -ccc nactdet = lcsvcgetlength( detnames ) -ccc do i=1,nactdet -ccc write(*,*) lcsvcgetstringat( detnames, i ) -ccc end do -c---- check string vector access of extended f77api (additional compared to anajob.cc) -ccc ncolnames = 20 -ccc status = lcgetstringvector -ccc & ( detnames, colnamev, ncolnames, len(colnamev(1)) ) -ccc write(*,*) 'testing lcgetstringvector' -ccc write(*,*) 'subdetectors found: ', ncolnames -ccc write(*,*) (colnamev(i),i=1,ncolnames) - - go to 1 - - 10 continue - - status = lcrdrclose( reader ) - -c---- now loop over the file(s) again and dump event data - - status = lcrdropenchain( reader, filenames(1), nFiles, - & len(filenames(1)) ) - write(*,*) - if ( status .eq. 0 ) then - write(*,*) " could not reopen files " - stop - else - write(*,*) 'will reopen and read from files: ' - write(*,'(5x,a)') - & ( filenames(i)(1:lnblnk(filenames(i)) ),i=1,nFiles) - endif - - nEvents = 0 - - -c---- ---fg: debugging only: -c status = lcrdrskipnevents( reader, 97 ) - -c---- ---- event loop ------ - - 20 continue - event = lcrdrreadnextevent( reader, LCIO_READ_ONLY ) - if( event .eq. 0 ) go to 30 - - status = lcdumpevent( event ) - nEvents = nEvents + 1 - go to 20 - -c---- the following is scipped but may be used for methods tests -c print only 1st event - - if (k .ne. 1) go to 110 - -* get collection names - pcolnamev = lcevtgetcollectionnames( event ) - ncolname = lcsvcgetlength( pcolnamev ) - print *, 'collection names found' - do i = 1,ncolname - colname = lcsvcgetstringat(pcolnamev , i ) - print *, colname - end do - -c check access to vectors (int, float) - colname1 = 'TPC4711UserIntExtension' - colname2 = 'TPC4711UserFloatExtension' - pcol = lcevtgetcollection( event , colname2) - nelem = lccolgetnumberofelements( pcol ) - print *, 'testing lcgetfloatvector' - print *, 'collection TPC4711UserFloatExtension has ', - & nelem, ' elements' - do i = 1,nelem - pobject = lccolgetelementat( pcol, i ) - nfloatv = 10 - status = lcgetfloatvector( pobject, floatv, nfloatv ) - print '(a,i3,a,i3,a,10f10.5)', - & 'floatv ', i, ' has ', nfloatv, ' elements: ', - & (floatv(ii),ii=1,nfloatv) - end do - - pcol = lcevtgetcollection( event, colname1 ) - nelem = lccolgetnumberofelements( pcol ) - print *, 'testing lcgetintvector' - print *, 'collection TPC4711UserIntExtension has ', - & nelem, ' elements' - do i = 1,nelem - pobject = lccolgetelementat( pcol, i ) - nintv = 10 - status = lcgetintvector( pobject, intv, nintv ) - print '(a,i3,a,i3,a,10i10)', - & 'intv ', i, ' has ', nintv, ' elements: ', - & (intv(ii),ii=1,nintv) - end do - - 110 continue - -c---- -------- end of event loop ----------- - 30 continue - write(*,*) - write(*,*) '', nEvents, ' events read from files: ' - write(*,'(5x,a)') - & ( filenames(i)(1:lnblnk(filenames(i)) ),i=1,nFiles) - - - - status = lcrdrclose( reader ) - status = lcrdrdelete( reader ) - - end - diff --git a/src/f77/hepevt0.inc b/src/f77/hepevt0.inc deleted file mode 100644 index dafa03dc6..000000000 --- a/src/f77/hepevt0.inc +++ /dev/null @@ -1,14 +0,0 @@ - -c#ifndef HEPEVT_H -c#define HEPEVT_H 1 - -C *** HEPEVT commonblock. - INTEGER NMXHEP - PARAMETER (NMXHEP=4000) - INTEGER NEVHEP, NHEP, ISTHEP(NMXHEP), IDHEP(NMXHEP) - INTEGER JMOHEP(2,NMXHEP), JDAHEP(2,NMXHEP) - DOUBLE PRECISION PHEP(5,NMXHEP), VHEP(4,NMXHEP) - COMMON /HEPEVT/ NEVHEP, NHEP, ISTHEP, IDHEP, JMOHEP, JDAHEP, - & PHEP, VHEP - SAVE /HEPEVT/ -c#endif diff --git a/src/f77/hepevt1.inc b/src/f77/hepevt1.inc deleted file mode 100644 index b24ab5fd3..000000000 --- a/src/f77/hepevt1.inc +++ /dev/null @@ -1,13 +0,0 @@ - -c#ifndef HEPEVT1_H -c#define HEPEVT1_H 1 - -#include "lciof77pointer.inc" - -C *** HEPEVT1 commonblock. - PTRTYPE MCPOINTERV(NMXHEP) - REAL CHHEP(NMXHEP) - COMMON /HEPEVT1/ MCPOINTERV, CHHEP - SAVE /HEPEVT1/ - -c#endif diff --git a/src/f77/lciof77api.inc b/src/f77/lciof77api.inc deleted file mode 100644 index cc93213cd..000000000 --- a/src/f77/lciof77api.inc +++ /dev/null @@ -1,371 +0,0 @@ -**************************************************** -* Include file for the low level Fortran interface -* of LCIO. There is on function for each method of -* al the relevenat classes in LCIO. Please include -* this file in your Fortran program and use the -* C++ API documentation and the naming convention -* described in the users manual to find the -* fortran function you need. -* -* F.Gaede -* 10/30/2003 -* H. Vogt -* 05/06/2004 (reconstruction part added) -* -* $Id: lciof77api.inc,v 1.43 2010-06-02 10:59:33 engels Exp $ -*************************************************** - -#include "lciof77pointer.inc" - - -c----- the LCReader interface - PTRTYPE lcrdrcreate - integer lcrdrdelete, lcrdropen, lcrdrclose, lcrdrreadstream - integer lcrdrskipnevents - PTRTYPE lcrdrreadnextrunheader - PTRTYPE lcrdrreadnextevent - PTRTYPE lcrdrreadevent - -c-----the LCWriter interface - PTRTYPE lcwrtcreate - integer lcwrtdelete, lcwrtopen, lcwrtclose - integer lcwrtwriterunheader, lcwrtwriteevent - -c-----the LCRunHeader interface - PTRTYPE lcrhdcreate - PTRTYPE lcrhdgetactivesubdetectors - integer lcrhddelete, lcrhdgetrunnumber - character*80 lcrhdgetdetectorname - character*1024 lcrhdgetdescription - integer lcrhdsetrunnumber, lcrhdsetdetectorname - integer lcrhdsetdescription, lcrhdaddactivesubdetector - -c-----the LCStrVec, LCIntVec, LCFloatVec interface - integer lcsvcgetlength, lcivcgetlength, lcfvcgetlength - character*80 lcsvcgetstringat - integer lcivcgetintat - real lcfvcgetfloatat - -c-----the StringVec, IntVec, FloatVec PointerVec interface - integer stringvectorgetlength - integer intvectorgetlength - integer floatvectorgetlength - integer pointervectorgetlength - - character*80 stringvectorgetelement - integer intvectorgetelement - real floatvectorgetelement - PTRTYPE pointervectorgetelement - - -c-----the LCRelationNavigator interface - PTRTYPE lcrnvcreate, lcrnvcreatefromcollection - PTRTYPE lcrnvgetrelatedtoobjects, lcrnvgetrelatedfromobjects - PTRTYPE lcrnvgetrelatedtoweights, lcrnvgetrelatedfromweights - PTRTYPE lcrnvcreatecollection - integer lcrnvdelete, lcrnvgaddrelation, lcrnvgremoverelation - character*80 lcrnvgetfromtype, lcrnvgettotype - -c-----the LCRelationNavigator utility interface - PTRTYPE lcobvgetobject - integer lcobvgetlength, lcobvgetobjectid - real lcobvgetweight - -c-----the LCEvent interface - PTRTYPE lcevtcreate, lcevtgetcollection, lcevtgetcollectionnames - PTRTYPE lcevtgettrelationnames, lcevtgetrelation - integer lcevtdelete - integer lcevtgetrunnumber, lcevtgeteventnumber - character*80 lcevtgetdetectorname - integer*8 lcevtgettimestamp - integer lcevtaddcollection, lcevtremovecollection - integer lcevtsetrunnumber, lcevtseteventnumber - integer lcevtsetdetectorname, lcevtsettimestamp - -c-----the LCCollection interface - PTRTYPE lccolcreate, lccolgetelementat - integer lccoldelete, lccolgetnumberofelements - character*80 lccolgettypename - integer lccolsettransient,lccolsetdefault - logical lccolistransient,lccolisdefault - integer lccolgetflag, lccolsetflag, lccoladdelement - integer lccolremoveelementat - -c-----the LCRelation interface - PTRTYPE lcrelcreate0, lcrelcreate, lcrelgetfrom, lcrelgetto - integer lcreldelete, lcrelid - integer lcrelsetfrom, lcrelsetto, lcrelsetweight - real lcrelgetweight - -c-----the LCGenericObject interface - PTRTYPE lcgobcreate, lcgobcreatefixed - integer lcgobdelete, lcgobid, lcgobgetintval - integer lcgobgetnint, lcgobgetnfloat, lcgobgetndouble - integer lcgobsetintval, lcgobsetfloatval, lcgobsetdoubleval - real lcgobgetfloatval - logical lcgobisfixedsize - double precision lcgobgetdoubleval - character*80 lcgobgettypename - character*256 lcgobgetdatadescription - -c-----the MCParticle interface - PTRTYPE lcmcpcreate - integer lcmcpgetnumberofparents, lcmcpgetnumberofdaughters - PTRTYPE lcmcpgetparent, lcmcpgetdaughter - integer lcmcpdelete, lcmcpgetendpoint - integer lcmcpgetpdg, lcmcpgetgeneratorstatus - integer lcmcpgetsimulatorstatus - integer lcmcpgetvertex, lcmcpgetmomentum - integer lcmcpgetspin, lcmcpgetcolorflow - real lcmcpgettime, lcmcpgetcharge - double precision lcmcpgetmass, lcmcpgetenergy - integer lcmcpaddparent, lcmcpadddaughter - integer lcmcpsetpdg, lcmcpsetgeneratorstatus - integer lcmcpsetsimulatorstatus, lcmcpsetvertex - integer lcmcpsetendpoint, lcmcpsetmomentum, lcmcpsetmass - integer lcmcpsetcharge - integer lcmcpsetspin, lcmcpsetcolorflow - -c-----the SimTrackerHit interface - PTRTYPE lcsthcreate, lcsthgetmcparticle - integer lcsthdelete, lcsthgetcellid, lcsthgetcellid0, lcsthgetcellid1 - real lcsthgetdedx, lcsthgetedep, lcsthgettime - double precision lcsthgetposition - real lcsthgetmomentum, lcsthgetpathlength - integer lcsthsetcellid0, lcsthsetcellid1, lcsthsetposition - integer lcsthsetedep, lcsthsetdedx - integer lcsthsettime, lcsthsetmcparticle, lcsthsetmomentum - integer lcsthsetmomentumxyz, lcsthsetpathlength - -c-----the TPCHitImpl interface - PTRTYPE lctphcreate - integer lctphid, lctphdelete, lctphgetcellid, lctphgetquality - integer lctphgetnrawdatawords, lctphgetrawdataword - real lctphgettime, lctphgcharge - integer lctphsetcellid, lctphsettime, lctphsetcharge - integer lctphsetquality, lctphsetrawdata - - -c-----the SimCalorimeterHit interface - PTRTYPE lcschcreate - integer lcschdelete, lcschid - integer lcschgetcellid0, lcschgetcellid1 - real lcschgetenergy, lcschgetenergycont, lcschgettimecont - integer lcschgetposition, lcschgetnmcparticles - integer lcschgetnmccontributions - PTRTYPE lcschgetparticlecont - integer lcschgetpdgcont - integer lcschsetcellid0, lcschsetcellid1, lcschsetenergy - integer lcschsetposition, lcschaddmcparticlecontribution - -c-----the CalorimeterHit interface - PTRTYPE lccahcreate - integer lccahid, lccahdelete, lccahgetcellid0, lccahgetcellid1 - real lccahgetenergy, lccahgetenergyerr, lccahgettime - integer lccahgetposition,lccahgettype,lccahgetrawhit - integer lccahsetcellid0, lccahsetcellid1 - integer lccahsetenergy, lccahsetenergyerr - integer lccahsetposition, lccahsettime,lccahsettype,lccahsetrawhit - -c-----the Cluster interface - PTRTYPE lcclucreate - integer lccludelete, lccluid - - integer lcclugettype, lcclugetposition - integer lcclugetpositionerror, lcclugetdirectionerror - real lcclugetenergy, lcclugetenergyerr, lcclugetitheta - real lcclugetiphi - PTRTYPE lcclugetshape, lcclugetparticleids, lcclugetclusters - PTRTYPE lcclugetcalorimeterhits, lcclugetsubdetectorenergies - integer lcclugethitcontributions - - integer lcclusettypebit, lcclusetenergy, lcclusetenergyerr - integer lcclusetposition - integer lcclusetpositionerror,lcclusetitheta, lcclusetiphi - integer lcclusetdirectionerror - integer lcclusetshape - integer lccluaddparticleid, lccluaddcluster, lccluaddhit - integer lcclusetsubdetectorenergies - -c-----the ParticleID interface - PTRTYPE lcpidcreate - integer lcpiddelete, lcpidid - - integer lcpidgettype, lcpidgetpdg - real lcpidgetlikelihood - integer lcpidgetparameters, lcpidgetalgorithmtype - - integer lcpidsettype, lcpidsetpdg, lcpidsetlikelihood - integer lcpidsetalgorithmtype - integer lcpidaddparameter - integer unknownpdg - parameter (unknownpdg=999999) - -c-----the ReconstructedParticle interface - PTRTYPE lcrcpcreate - integer lcrcpdelete, lcrcpid - - logical lcrcpisprimary - integer lcrcpgettype, lcrcpgetmomentum, lcrcpgetcovmatrix - integer lcrcpgetreferencepoint, lcrcpgetgoodnessofpid - real lcrcpgetenergy, lcrcpgetmass, lcrcpgetcharge - PTRTYPE lcrcpgetparticleids, lcrcpgetparticles - PTRTYPE lcrcpgetclusters, lcrcpgettracks - PTRTYPE lcrcpgetstartvertex, lcrcpgetendvertex - - integer lcrcpsettype, lcrcpsetmomentum, lcrcpsetenergy - integer lcrcpsetcovmatrix, lcrcpsetmass, lcrcpsetcharge - integer lcrcpsetreferencepoint, lcrcpsetgoodnessofpid - integer lcrcpsetstartvertex - integer lcrcpaddparticleid - integer lcrcpaddparticle, lcrcpaddcluster, lcrcpaddtrack - -c-----the Vertex interface - PTRTYPE lcvtxcreate - integer lcvtxdelete, lcvtxid - - logical lcvtxisprimary - character*80 lcvtxgetalgorithmtype - integer lcvtxgetposition, lcvtxgetcovmatrix, lcvtxgetparameters - real lcvtxgetchi2, lcvtxgetprobability - PTRTYPE lcvtxgetassociatedparticle - - integer lcvtxsetprimary, lcvtxsetchi2, lcvtxsetprobability - integer lcvtxsetposition, lcvtxsetcovmatrix, lcvtxaddparameter - integer lcvtxsetalgorithmtype, lcvtxsetassociatedparticle - -c-----the TrackerHit interface - PTRTYPE lctrhcreate, lctrhgetrawhits - integer lctrhdelete, lctrhid, lctrhgetposition, lctrhgetcovmatrix - integer lctrhgettype, lctrhgetquality - real lctrhgetdedx, lctrhgetedep, lctrhgetedeperr, lctrhgettime - integer lctrhsetposition, lctrhsetcovmatrix - integer lctrhsettime, lctrhsettype, lctrhsetquality - integer lctrhsetdedx, lctrhsetedep, lctrhsetedeperr - integer lctrhaddrawhit - -c-----the Track interface - PTRTYPE lctrkcreate, lctrkgettracks, lctrkgettrackerhits - PTRTYPE lctrkgetsubdetectorhitnumbers - integer lctrkdelete, lctrkid - integer lctrkgettype, lctrkgetcovmatrix -c-----integer lctrkgetreferencepoint, lctrkgetisreferencepointpca - integer lctrkgetreferencepoint - real lctrkgetomega, lctrkgettanlambda, lctrkgetphi, lctrkgetd0 - real lctrkgetz0, lctrkgetchi2, lctrkgetdedx, lctrkgetdedxerror - real lctrkgetradiusofinnermosthit - integer lctrkgetndf - integer lctrksettypebit, lctrksetomega, lctrksettanlambda - integer lctrksetphi, lctrksetd0, lctrksetz0, lctrksetcovmatrix - integer lctrksetreferencepoint, lctrksetchi2, lctrksetdedx -c-----integer lctrksetisreferencepointpca, lctrksetndf - integer lctrksetndf - integer lctrksetdedxerror, lctrkaddtrack, lctrkaddhit - integer lctrksetradiusofinnermosthit,lctrksetsubdetectorhitnumbers - -c---- constants as defined in EVENT::LCIO - - integer LCIO_CHBIT_LONG - integer LCIO_CHBIT_BARREL - integer LCIO_CHBIT_ID1 - integer LCIO_CHBIT_PDG - integer LCIO_CHBIT_STEP - integer LCIO_RCHBIT_LONG - integer LCIO_RCHBIT_BARREL - integer LCIO_RCHBIT_ID1 - integer LCIO_RCHBIT_NO_PTR - integer LCIO_RCHBIT_TIME - integer LCIO_RCHBIT_ENERGY_ERROR - integer LCIO_RTHBIT_ID1 - integer LCIO_RTHPBIT_ID1 - integer LCIO_RTHZBIT_ID1 - integer LCIO_THBIT_BARREL - integer LCIO_THBIT_MOMENTUM - integer LCIO_THBIT_ID1 - integer LCIO_TRBIT_HITS - integer LCIO_CLBIT_HITS - integer LCIO_TPCBIT_RAW - integer LCIO_TPCBIT_NO_PTR - integer LCIO_LCREL_WEIGHTED - integer LCIO_GOBIT_FIXED - integer LCIO_READ_ONLY - integer LCIO_UPDATE - integer LCIO_ERROR - integer LCIO_SUCCESS - integer LCIO_WRITE_NEW - integer LCIO_WRITE_APPEND - - parameter (LCIO_CHBIT_LONG=31, LCIO_CHBIT_BARREL=30, - & LCIO_CHBIT_STEP=28, LCIO_CHBIT_PDG=28, - & LCIO_CHBIT_ID1=29) - parameter (LCIO_RCHBIT_LONG=31, LCIO_RCHBIT_BARREL=30, - & LCIO_RCHBIT_ID1=29, LCIO_RCHBIT_NO_PTR=28, - & LCIO_RCHBIT_TIME=27, LCIO_RCHBIT_ENERGY_ERROR=26) - parameter (LCIO_RTHBIT_ID1=31) - parameter (LCIO_RTHPBIT_ID1=31) - parameter (LCIO_RTHZBIT_ID1=31) - parameter (LCIO_THBIT_BARREL=31, LCIO_THBIT_MOMENTUM=30, - & LCIO_THBIT_ID1=29) - parameter (LCIO_TRBIT_HITS=31) - parameter (LCIO_CLBIT_HITS=31) - parameter (LCIO_TPCBIT_RAW=31, LCIO_TPCBIT_NO_PTR=30) - parameter (LCIO_LCREL_WEIGHTED=31) - parameter (LCIO_GOBIT_FIXED=31) - parameter (LCIO_READ_ONLY=0, LCIO_UPDATE=1) - parameter (LCIO_ERROR=0, LCIO_SUCCESS=1) - parameter (LCIO_WRITE_NEW=0, LCIO_WRITE_APPEND =1) - - character*32 LCIO_LCEVENT - character*32 LCIO_LCCOLLECTION - character*32 LCIO_LCRUNHEADER - character*32 LCIO_MCPARTICLE - character*32 LCIO_SIMCALORIMETERHIT - character*32 LCIO_RAWCALORIMETERHIT - character*32 LCIO_CALORIMETERHIT - character*32 LCIO_SIMTRACKERHIT - character*32 LCIO_TPCHIT - character*32 LCIO_TRACKERHIT - character*32 LCIO_LCSTRVEC - character*32 LCIO_LCFLOATVEC - character*32 LCIO_LCINTVEC - character*32 LCIO_TRACK - character*32 LCIO_CLUSTER - character*32 LCIO_RECONSTRUCTEDPARTICLE - character*32 LCIO_VERTEX - character*32 LCIO_LCRELATION - character*32 LCIO_LCGENERICOBJECT - - data LCIO_LCEVENT /'LCEvent'/ - data LCIO_LCCOLLECTION /'LCCollection'/ - data LCIO_LCRUNHEADER /'LCRunHeader'/ - data LCIO_MCPARTICLE /'MCParticle'/ - data LCIO_SIMCALORIMETERHIT /'SimCalorimeterHit'/ - data LCIO_RAWCALORIMETERHIT /'RawCalorimeterHit'/ - data LCIO_CALORIMETERHIT /'CalorimeterHit'/ - data LCIO_SIMTRACKERHIT /'SimTrackerHit'/ - data LCIO_TPCHIT /'TPCHit'/ - data LCIO_TRACKERHIT /'TrackerHit'/ - data LCIO_LCSTRVEC /'LCStrVec'/ - data LCIO_LCFLOATVEC /'LCFloatVec'/ - data LCIO_LCINTVEC /'LCIntVec'/ - data LCIO_TRACK /'Track'/ - data LCIO_CLUSTER /'Cluster'/ - data LCIO_RECONSTRUCTEDPARTICLE /'ReconstructedParticle'/ - data LCIO_VERTEX /'Vertex'/ - data LCIO_LCRELATION /'LCRelation'/ - data LCIO_LCGENERICOBJECT /'LCGenericObject'/ - -c---- bit positions for the simulation flag - - integer BITEndpoint, BITCreatedInSimulation, BITBackscatter, - & BITVertexIsNotEndpointOfParent, BITDecayedInTracker, - & BITDecayedInCalorimeter, BITLeftDetector, BITStopped - parameter (BITEndpoint = 31, - & BITCreatedInSimulation = 30, - & BITBackscatter = 29, - & BITVertexIsNotEndpointOfParent = 28, - & BITDecayedInTracker = 27, - & BITDecayedInCalorimeter = 26, - & BITLeftDetector = 25, - & BITStopped = 24) - diff --git a/src/f77/lciof77apiext.inc b/src/f77/lciof77apiext.inc deleted file mode 100644 index 202fd5dc6..000000000 --- a/src/f77/lciof77apiext.inc +++ /dev/null @@ -1,244 +0,0 @@ -************************************************************* -* Include file for the convenient functions of the -* Fortran interface to LCIO. -* For documentation purpose the C style function declarations -* are provided. -* -* F.Gaede -* 10/30/2003 -************************************************************* - -#include "lciof77pointer.inc" - -c --------------- convenient method to open a list of files for reading (read-only) - -* Opens a list of files for reading (read-only). -* -* int lcrdropenchain( PTRTYPE reader, -* void* filenamesv, const int nfiles, const int nchfilename ); - integer lcrdropenchain - -c --------------- convenient methods to read/write the run header - -* Write a run header to the specified writer with the given data. -* -* int lcwriterunheader(PTRTYPE writer,int irun, const char* detname, const char* descr, -* void* sdnamevec, const int nsubd, const int nchsubd) ; - integer lcwriterunheader - -* Read the next run header and fills the return arguments with the data. -* -* PTRTYPE lcreadnextrunheader(PTRTYPE reader, int* irun, void* detname, void* descr, -* void* sdnamevec, int* nsubd, const int nchsubd) ; - - PTRTYPE lcreadnextrunheader - -c --------------- convenient methods for the event interface - -* Set the complete event header data in the event. -* -* int lcseteventheader( PTRTYPE event, const int irun, const int ievent, -* const int timestamp, const char* detname ); - - integer lcseteventheader - -* Read the complete event header data from the event. -* -* int lcgeteventheader(PTRTYPE event, int* irun, int* ievent, int* timestamp, void* detname ); - - integer lcgeteventheader - -* Dump the run header to the stdout -* -* int lcdumprunheader( PTRTYPE runheader ) ; - - integer lcdumprunheader - -* Dump the event to the stdout - one line per collection. -* -* int lcdumpevent( PTRTYPE event ) ; - - integer lcdumpevent - -* Detailed dump of all the data in the event to stdout. -* -* int lcdumpeventdetailed( PTRTYPE event ) ; - - integer lcdumpeventdetailed - -c --------------- convenient methods for the mcparticle interface - - -* Return all the data of the specified MCParticle in the arguments. -* -* int lcgetmcparticledata( PTRTYPE mcparticle, int* pdg, int* hepevtstatus, double* prodvtx, -* float* momentum, float* mass, float* charge, int* ndaughters ) ; - - integer lcgetmcparticledata - -* Fill the hepevt common block with the MCParicle data in the LCIO event. -* -* int lcio2hepevt( PTRTYPE event ) ; - - integer lcio2hepevt - -* Create an MCParticle collection from the hepevt common block and add it to the event. -* -* int hepevt2lcio( PTRTYPE event ) ; - - integer hepevt2lcio - - -c --------------- convenient methods for SimTrackerHits - -* Add a new SimTrackerHit with the given data to the collection. -* -* int lcaddsimtrackerhit( PTRTYPE col, int cellID, double* pos, float dEdx, -* float time, PTRTYPE mcp ) ; - - integer lcaddsimtrackerhit - -* Return all the data from the specified SimTrackerHit in the arguments. -* -* int lcgetsimtrackerhit( PTRTYPE col, int i, int* cellID, double* pos, float* dEdx, -* float* time, PTRTYPE* mcp ) ; - - integer lcgetsimtrackerhit - -c --------------- convenient methods for SimCalorimeterHits - -* Add a new SimCalorimeterHit with the given data to the collection. -* Returns a pointer the new hit. -* -* PTRTYPE lcaddsimcalohit( PTRTYPE col, int cellID0, int cellID1, float energy, float* pos ) ; - - PTRTYPE lcaddsimcalohit - -* Return the data of the specified SimCalorimeterHit in the arguments. -* -* int lcgetsimcalohit( PTRTYPE col, int i, int* cellID0, int* cellID1, float* energy, -* float* pos ) ; - - PTRTYPE lcgetsimcalohit - -* Return the specified contribution of a MCParticle to the hit in the arguments. -* -* int lcgetsimcalohitmccont( PTRTYPE hit, int i, PTRTYPE* mcp, float* energy, float* time, -* int* pdg ) ; - - integer lcgetsimcalohitmccont - - -c --------------- convenient methods for the vector interface - -* Create a complete LC vector of Integers -* -* PTRTYPE lcintvectorcreate ( int* intv, const int nintv ) - - PTRTYPE lcintvectorcreate - -* Create a complete LC vector of Floats -* -* PTRTYPE lcfloatvectorcreate ( float* floatv , const int nfloatv ) - - PTRTYPE lcfloatvectorcreate - -* Create a complete LC vector of Strings -* -* PTRTYPE lcstringvectorcreate ( void* stringv, const int nstringv, const int nchstringv) - - PTRTYPE lcstringvectorcreate - -* Get the complete LC vector of Integers -* -* int lcgetintvector( PTRTYPE vector, int* intv, int* nintv ) - - integer lcgetintvector - -* Get the complete LC vector of Floats -* -* int lcgetfloatvector( PTRTYPE vector, float* floatv , int* nfloatv ) - - integer lcgetfloatvector - -* Get the complete LC vector of Strings -* -* int lcgetstringvector( PTRTYPE vector, void* stringv, int* nstringv, const int nchstringv) - - integer lcgetstringvector - - -* Create/Delete a complete vector of Integers -* -* PTRTYPE intvectorcreate ( int* intv, const int nintv ) -* int intvectordelete( PTRTYPE vector ) - - PTRTYPE intvectorcreate - integer intvectordelete - -* Createe/Delete a complete vector of Floats -* -* PTRTYPE floatvectorcreate ( float* floatv , const int nfloatv ) -* int floatvectordelete( PTRTYPE vector ) - - PTRTYPE floatvectorcreate - integer floatvectordelete - -* Createe/Delete a complete vector of Strings -* -* PTRTYPE stringvectorcreate ( void* stringv, const int nstringv, const int nchstringv) -* int stringvectordelete( PTRTYPE vector ) - - PTRTYPE stringvectorcreate - integer stringvectordelete - -* Createe/Delete a complete vector of Pointers -* -* PTRTYPE pointervectorcreate( PTRTYPE* pointerv, const int npointerv ) -* int pointervectordelete( PTRTYPE vector ) - - PTRTYPE pointervectorcreate - integer pointervectordelete - - -* Get the complete vector of Integers -* -* int getintvector( PTRTYPE vector, int* intv, int* nintv ) - - integer getintvector - -* Get the complete vector of Floats -* -* int getfloatvector( PTRTYPE vector, float* floatv , int* nfloatv ) - - integer getfloatvector - -* Get the complete vector of Strings -* -* int getstringvector( PTRTYPE vector, void* stringv, int* nstringv, const int nchstringv) - - integer getstringvector - -* Get the complete vector of Pointers -* -* int getpointervector( PTRTYPE vector, PTRTYPE* pointerv, int* npointerv ) - - integer getpointervector - - -* Set methods for LCParameters -* -* int lcsetparameters ( const char* classname, PTRTYPE classp, const char* method, const char* key, PTRTYPE vecp) - - integer lcsetparameters - -* Get methods for LCParameters -* -* int lcgetparameters ( const char* classname, PTRTYPE classp, const char* method, const char* key, PTRTYPE vecp) - - integer lcgetparameters - -c---- need to define the HEPEVT common block -#include "hepevt0.inc" -#include "hepevt1.inc" - diff --git a/src/f77/lciof77pointer.inc b/src/f77/lciof77pointer.inc deleted file mode 100644 index bdf6877b2..000000000 --- a/src/f77/lciof77pointer.inc +++ /dev/null @@ -1,51 +0,0 @@ -**************************************************** -* Include file for the low level Fortran interface -* of LCIO. -* Definition of PTRTYPE which may be architecture -* dependent (taken from sio package) -* must be included from includes using PTRTYPE -* -* H.Vogt -* 03/19/2004 -*************************************************** - -C Check for 32/64 bit architetures - -** ---------------------------------------------------------------------------- -** Deal with pointer length. Currently, the only problem is alpha which uses -** 64 bit pointers. -** -** OS CPU Macro Provided by Pointer size -** ------------ ------------ ------------ ------------ ----------- -** AIX PPC(?) _AIX GNU compiler 4 bytes -** OSF1 Alpha __alpha__ GNU compiler 8 bytes -** Linux x86 __i386__ GNU compiler 4 bytes -** Linux Opteron _LP64 GNU compiler 8 bytes -** Linux Itanium _LP64 GNU compiler 8 bytes -** SunOS Sparc __sparc__ GNU compiler 4 bytes -** Windows/NT Alpha _M_ALPHA VC compiler 8 bytes -** Windows/NT x86 _M_IX86 VC compiler 4 bytes -** Windows/NT MIPS _M_MRX000 VC compiler ? bytes -** Windows/NT PPC _M_PPC VC compiler 4 bytes -** ---------------------------------------------------------------------------- -#if defined(__alpha__) || defined(_M_ALPHA) || defined(_LP64) -#define PTRTYPE integer*8 -#endif - -#if defined(_AIX) || defined(__i386__) || defined(__sparc__) || defined(_M_IX86) || defined(_M_PPC) -#define PTRTYPE integer -#endif - - -C fallback if no arch string is defined -#ifndef PTRTYPE -#ifdef __SIZEOF_SIZE_T__ -C guess sizeof(size_t) is probably sizeof(void*) -#define PTRTYPE integer*__SIZEOF_SIZE_T__ -#else -C make a random guess, tends to work on 32 bit systems -#define PTRTYPE integer -#endif -! ifdef __SIZEOF_SIZE_T__ -#endif -! ifndef PTRTYPE diff --git a/src/f77/recjob.F b/src/f77/recjob.F deleted file mode 100644 index a1346f60a..000000000 --- a/src/f77/recjob.F +++ /dev/null @@ -1,789 +0,0 @@ - -#define RAND_MAX 2147483647 -#define INT_MAX 2147483647 - -********************************************************************** -* * - PROGRAM RECJOB !* -* RECOJOB * -* A program to demonstrate the use of the low level * -* fortran interface to LCIO for writing LCIO files. * -* (it is in closest correspondence to recjob.cc) * -* * -* H. Vogt 05/06/2004 * -* updated: 21/09/2004 (H.V.) * -* * -********************************************************************** - - implicit none - - integer nargs, nFiles, i - character*40 filenames(20),fileoname - - nFiles = 1 - filenames(1) = 'f_recjob.slcio' - filenames(2) = 'f_simjob.slcio' - fileoname = filenames(1) - -c---- read file names from command line arguments - nargs = iargc() - if (nargs .lt. 1) then -ccc print *, ' usage: recjob ', -ccc & ' [[input-file2],...]' -ccc print *, ' filenames must have less then 40 characters' -ccc print *, ' up to 20 filenames are accepted' -ccc print *, ' no arguments given - using default' -ccc print * -ccc else if (nargs .gt. 20) then -ccc print *, ' usage: more than max = 20 file names given' -ccc stop - else - do i = 1, nargs - call getarg (i, filenames(i)) - end do - nFiles = nargs - 1 -c--- make consistent with recjob.cc, if nargs > 0 - nFiles = 1 - fileoname = filenames(2) - filenames(2) = filenames(1) - end if - - call srand ( 1234 ) - - call event_processor ( fileoname, filenames(2), nFiles ) - - stop - - end - -********************************************************************** -* * - subroutine event_processor ( fileoname, fileinames, nifiles ) !* -* * -********************************************************************** - - implicit none - -#include "recjob.inc" - - character*40 fileinames(*), fileoname - integer nifiles - - PTRTYPE pstrv - integer lcrdreventprocessor - -*** create LCStrvec of input file names - pstrv = stringvectorcreate ( fileinames, - & nifiles, len (fileinames(1)) ) - -*** create writer, open output file - writer = lcwrtcreate() - status = lcwrtopen( writer, fileoname , LCIO_WRITE_NEW ) - if( status.eq.LCIO_ERROR) then - write(*,*) ' could not open file ', - & fileoname(1:lnblnk(fileoname)) - call exit (1) - endif - -*** create reader, open input file chain, start event loop - ievent = 0 - status = lcrdreventprocessor( pstrv ) - -*** end of event processing, close I/O files - ievent = ievent - status = lcwrtclose ( writer ) - write(*,*) "----------------------------------------------------" - write(*,*) " added collection: 'SomeClusters' and 'SomeTracks'" - write(*,*) " to ", ievent, " events" - write(*,*) " and added one extra MCParticle to each event." - write(*,*) "----------------------------------------------------" - - status = lcwrtdelete( writer ) - - stop - - end - - -********************************************************************** -* * - subroutine processrunheader ( pheader ) !* -* * -********************************************************************** -* - implicit none - -#include "recjob.inc" - - PTRTYPE pheader - -*** just copy run headers to the outputfile - header = pheader - status = lcwrtwriterunheader ( writer, header ) -* - end - -********************************************************************** -* * - subroutine modifyrunheader ( pheader ) !* -* * -********************************************************************** -* - implicit none - - PTRTYPE pheader - -*** do nothing for runheader here - - end - -********************************************************************** -* * - subroutine processevent ( pevent ) !* -* * -* used for 'read only' access * -* * -********************************************************************** - - implicit none - -#include "recjob.inc" - - PTRTYPE pevent - -*** increase event counter, set event pointer - eventi = pevent - ievent = ievent + 1 - -*** create some tracks and add them to the event - call tracks - -*** create some clusters and add them to the event - call clusters - -*** add some vertices - call vertices - -** add some reconstructed particles - call reco_particles - - end - -********************************************************************** -* * - subroutine tracks !* -* * -********************************************************************** - - implicit none - -#include "recjob.inc" - - PTRTYPE helpp, intvpp, intvp, lcgetpointerfromaddress, pvec - integer tpcflag, ntpchits, ntracks, cellid, trkflag, i, j, k - integer ihit1, ihit2, ihit3 - integer ntracker, vtxindex, sitindex, tpcindex, intv(20), nintv - integer typevalues - real cov(6), covt(15), refp(3) - character*30 colname1, colname2, typenames, trackernames(3), - & relation - double precision dpos(3), dhelp - -*** in order to be able to point back to hits, we need to create -*** generic TrackerHits from the TPCHits first - colname1 = 'TPCRawFADC' - tpchitcol = lcevtgetcollection( eventi , colname1 ) -*** fg20040824 -> THE LOGIC IS REVERSED - NO NEED TO SET A BIT TO GET THE POINTER FLAG -ccc tpcflag = lccolgetflag ( tpchitcol ) -ccc tpcflag = ibset ( tpcflag, LCIO_TPCBIT_PTR ) -ccc status = lccolsetflag ( tpchitcol, tpcflag ) - - trackerhitcol = lccolcreate ( LCIO_TRACKERHIT ) - ntpchits = lccolgetnumberofelements ( tpchitcol ) - - do i = 1, ntpchits - trhitp = lctrhcreate () - tpchit = lccolgetelementat ( tpchitcol, i) - status = lctrhsetdedx ( trhitp, lctphgcharge ( tpchit ) ) - status = lctrhsettime ( trhitp, lctphgettime ( tpchit ) ) - cellid = lctphgetcellid ( tpchit ) - dpos(1) = iand ( cellid, z'ff' ) - dpos(2) = ishft ( iand ( cellid, z'ff00' ) , -8 ) - dpos(3) = ishft ( iand ( cellid, z'ff0000' ) , -16 ) - status = lctrhsetposition ( trhitp, dpos ) - - status = lctrhaddrawhit ( trhitp, tpchit ) ! store the original raw data hit - status = lctrhaddrawhit ( trhitp, tpchit ) ! for testing add the same raw hit twice - - do j = 1, 6 - cov(j) = i - end do - status = lctrhsetcovmatrix ( trhitp, cov ) - status = lccoladdelement ( trackerhitcol, trhitp ) - end do - -*** set the parameters to decode the type information in the collection -*** for the time being this has to be done manually -*** in the future we should provide a more convenient mechanism to -*** decode this sort of meta information - typenames = LCIO_TPCHIT - typevalues = 1 - pvec = stringvectorcreate( typenames, 1, - & len ( typenames ) ) - status = lcsetparameters( LCIO_LCCOLLECTION, trackerhitcol, - & 'setStringValues', 'TrackerHitTypeNames', pvec) - pvec = intvectorcreate( typevalues, 1 ) - status = lcsetparameters( LCIO_LCCOLLECTION, trackerhitcol, - & 'setIntValues', 'TrackerHitTypeValues', pvec) - - colname2 = 'TrackerHits' - status = lcevtaddcollection ( eventi, trackerhitcol, colname2 ) - -*** now the tracks -*** if we want to point back to the hits we need to set the flag - trackcol = lccolcreate ( LCIO_TRACK ) - trkflag = 0 - trkflag = ibset ( trkflag, LCIO_TRBIT_HITS ) - status = lccolsetflag ( trackcol, trkflag ) - -*** set the hit numbers and create string vector of tracker names - ntracker = 3 - vtxindex = 1 - sitindex = 2 - tpcindex = 3 - ntracks = 10 - trackernames(vtxindex) = 'VTX' - trackernames(sitindex) = 'SIT' - trackernames(tpcindex) = 'TPC' - pvec = stringvectorcreate( trackernames(1), ntracker, - & len ( trackernames(1) ) ) - - do i = 1, ntracks - trkp = lctrkcreate () - status = lctrksettypebit ( trkp, 7, 1 ) - status = lctrksetomega ( trkp, i*1.1 ) - status = lctrksettanlambda ( trkp, real (i*m_pi/10.) ) - status = lctrksetphi ( trkp, real (i*m_pi/5.) ) - status = lctrksetd0 ( trkp, i*1. ) - status = lctrksetz0 ( trkp, i*10. ) - status = lctrksetchi2 ( trkp, 1.01 ) - status = lctrksetndf ( trkp, 42 ) - status = lctrksetradiusofinnermosthit ( trkp, 3.141592 ) - - status = lcsetparameters( LCIO_LCCOLLECTION, trackcol, - & 'setStringValues', 'TrackSubdetectorNames', pvec ) - - intv(vtxindex) = 12 - intv(sitindex) = 24 - intv(tpcindex) = 36 -ccc now check lctrksetsubdetectorhitnumbers, lctrkgetsubdetectorhitnumbers -ccc if ( i .gt. 3 ) then -ccc intv(i) = i*10 +i -ccc ntracker = i -ccc end if - status = lctrksetsubdetectorhitnumbers ( trkp, intv, ntracker ) -ccc nintv = 6 -ccc status = lctrkgetsubdetectorhitnumbers ( trkp, intv, nintv ) -ccc print *, nintv, ' Integers found' -ccc do j = 1, nintv -ccc print *, 'Integer at ',j,' is', intv(j) -ccc end do - - status = lctrksetdedx ( trkp, 3.14159 ) - status = lctrksetdedxerror ( trkp, 42. ) - do j = 1,15 - covt(j) = j - end do - status = lctrksetcovmatrix (trkp, covt ) - refp(1) = 12. - refp(2) = 123456789. - refp(3) = .0987654321 - status = lctrksetreferencepoint (trkp, refp ) - -*** add some random hits (c++ counts from 0, fortran api from 1) - - dhelp = dble ( lccolgetnumberofelements ( trackerhitcol )) - ihit1 = dhelp * irand( 0 )/RAND_MAX - ihit2 = dhelp * irand( 0 )/RAND_MAX - ihit3 = dhelp * irand( 0 )/RAND_MAX - helpp = lccolgetelementat ( trackerhitcol , ihit1 + 1 ) - status = lctrkaddhit ( trkp, helpp ) - helpp = lccolgetelementat ( trackerhitcol , ihit2 + 1 ) - status = lctrkaddhit ( trkp, helpp ) - helpp = lccolgetelementat ( trackerhitcol , ihit3 + 1 ) - status = lctrkaddhit ( trkp, helpp ) - -*** add tracks that where used to create this track - j = lccolgetnumberofelements ( trackcol ) - if ( j .gt. 1 ) then - status= lctrkaddtrack (trkp, lccolgetelementat(trackcol, j)) - status= lctrkaddtrack (trkp, lccolgetelementat(trackcol, j-1)) - end if - status = lccoladdelement ( trackcol , trkp ) - end do - - colname2 = 'SomeTracks' - status = lcevtaddcollection ( eventi, trackcol, colname2 ) -* - end - -********************************************************************** -* * - subroutine clusters !* -* * -********************************************************************** - - implicit none - -#include "recjob.inc" - -#define COMBINED 3 -#define CHARGED 2 - - PTRTYPE helpp, clusp, pvec, pstrv, pobj, vecp - PTRTYPE simhitsvp, simhitswp, calveccol, cconp - integer calflag, nsimhits, cluflag, nhits, nclus, type, ncluscol - integer relflag, ncalhits - integer ncalhit, ihit1, ihit2, ihit3 - integer i, j - real posv(3), eposv(6), shape(6), energy - double precision dpos(3), dhelp - character*30 colname1, colname2, colname3, relation - character*30 shapeparams(6) - -*** create some clusters and add them to the event - colname1 = 'ECAL007' - simcalcol = lcevtgetcollection( eventi , colname1 ) - cluscol = lccolcreate ( LCIO_CLUSTER ) - calhitcol = lccolcreate ( LCIO_CALORIMETERHIT ) - -*** include relations - screlcol = lccolcreate ( LCIO_LCRELATION ) - relation = LCIO_CALORIMETERHIT - pvec = stringvectorcreate( relation, 1, - & len ( relation ) ) - status = lcsetparameters(LCIO_LCCOLLECTION, screlcol, - & 'setStringValues', 'RelationFromType', pvec ) - relation = LCIO_SIMCALORIMETERHIT - pvec = stringvectorcreate( relation, 1, - & len ( relation ) ) - status = lcsetparameters(LCIO_LCCOLLECTION, screlcol, - & 'setStringValues', 'RelationToType', pvec ) - - -*** in order to be able to point back to hits, we need to create -*** generic CalorimeterHits from the SimCalorimeterHits first -*** here we set the pointer flag bit that is needed to be able to point from -*** the generic Clusters to the 'raw data' CalorimeterHits -*** -> this should be done automatically in a future release -ccc calflag = lccolgetflag ( calhitcol ) -ccc calflag = ibset ( calflag, LCIO_RCHBIT_PTR ) -ccc status = lccolsetflag ( calhitcol, calflag ) - - nsimhits = lccolgetnumberofelements ( simcalcol ) -ccc print *, '# of nsimhits: ',nsimhits - do i = 1, nsimhits - calhitp = lccahcreate () - simcalhitp = lccolgetelementat ( simcalcol, i ) -ccc print '(a,z10)', 'pointer of simcalhit:', simcalhitp - - energy = lcschgetenergy ( simcalhitp ) - status = lccahsetenergy - & ( calhitp, lcschgetenergy ( simcalhitp ) ) - status = lccahsetcellid0 - & ( calhitp, lcschgetcellid0 ( simcalhitp ) ) - status = lcschgetposition ( simcalhitp, posv ) - status = lccahsetposition ( calhitp, posv ) - do j = 1,3 - status = lccoladdelement ( screlcol, - & lcrelcreate( calhitp, simcalhitp, 0.5 ) ) - end do - status = lccoladdelement ( calhitcol, calhitp ) - end do - - colname2 = 'CalorimeterHits' - status = lcevtaddcollection ( eventi, calhitcol, colname2 ) - relflag = 0 - relflag = ibset ( relflag, LCIO_LCREL_WEIGHTED ) - status = lccolsetflag ( screlcol, relflag ) - colname3 = 'CalorimeterHitsSimRel' -ccc status = lcevtaddrelation ( eventi, screlcol, colname3 ) - status = lcevtaddcollection ( eventi, screlcol, colname3 ) - - if (lcevtgeteventnumber ( eventi ) .eq. 0 .and. - & lcevtgetrunnumber ( eventi ) .eq. 0) then - -*** the following is some example code on how to access the relation -*** create a navigation object from a collection using different methods - helpp = lcrnvcreatefromcollection( screlcol ) - colname1 = lcrnvgetfromtype ( helpp ) - colname2 = lcrnvgettotype ( helpp ) - print *, 'Relation example for first event: [' , - & colname1(1:len_trim ( colname1 )), ' - ', - & colname2(1:len_trim ( colname2 )), '] ' - print *, 'Relation are given twice using different methods' - ncalhits = lccolgetnumberofelements( calhitcol ) - do i = 1, ncalhits - calhitp = lccolgetelementat ( calhitcol , i ) - simhitsvp = lcrnvgetrelatedtoobjects ( helpp, calhitp ) - simhitswp = lcrnvgetrelatedtoweights ( helpp, calhitp ) - -*** methods: via lcobv - print '(a,z4,$)', ' relations for object ', lccahid (calhitp) - do j = 1, lcobvgetlength ( simhitsvp ) - print '(a,z8,a,z2,a,f3.1,a,$)', ' [', - & lcobvgetobject ( simhitsvp, j ), - & '] [', - & lcobvgetobjectid ( simhitsvp, j ), - & '] (', - & lcobvgetweight ( simhitswp, j ), - & ') ' - end do - print * - -*** methods: via stl vector and lcsch - print '(a,z4,$)', ' relations for object ', lccahid (calhitp) - do j = 1, pointervectorgetlength ( simhitsvp ) - pobj = pointervectorgetelement ( simhitsvp, j ) - print '(a,z8,a,z2,af3.1,a,$)', ' [', - & pobj, - & '] [', - & lcschid ( pobj ), - & '] (', - & floatvectorgetelement ( simhitswp, j ), - & ') ' - end do - print * - - end do - -*** add some calibration constants as generic user objects - calveccol = lccolcreate ( LCIO_LCGENERICOBJECT ) - do i = 1, ncalhits - calhitp = lccolgetelementat ( calhitcol , i ) - cconp = lcgobcreate() - status = lcgobsetintval( cconp, 1, lccahid ( calhitp ) ) - status = lcgobsetfloatval( cconp, 2, 1.*(i-1) ) - status = lcgobsetfloatval( cconp, 3, 0.01*(i-1) ) - status = lccoladdelement( calveccol, cconp ) - end do - status = lcevtaddcollection ( eventi, calveccol, - & 'Calibration' ) - - end if - -*** if we want to point back to the hits we need to set the flag - cluflag = 0 - cluflag = ibset ( cluflag, LCIO_CLBIT_HITS ) - status = lccolsetflag ( cluscol, cluflag ) - if ( calhitcol .ne. 0 ) then - nhits = lccolgetnumberofelements ( calhitcol ) - nclus = nhits/10 - do i = 1, nclus - clusp = lcclucreate () -*** set type bits to "Cluster::COMBINED << 16 | Cluster::CHARGED" -ccc type = ior (ishft ( COMBINED, 16), CHARGED ) ! obsolete -ccc status = lcclusettype ( clusp, type ) ! obsolete - status = lcclusettypebit ( clusp, 1 , 1 ) - status = lcclusettypebit ( clusp, 7 , 1 ) - status = lcclusettypebit ( clusp, 11, 1 ) - - status = lcclusetenergy ( clusp, i*1.1) - posv(1) = 12. - posv(2) = 123456789. - posv(3) = .0987654321 - status = lcclusetposition ( clusp, posv ) - do j = 1, 6 - eposv(j) = j - end do - status = lcclusetpositionerror ( clusp, eposv ) - status = lcclusetitheta ( clusp, real (i*m_pi/10.) ) - status = lcclusetiphi ( clusp, real (i*m_pi/5. ) ) - do j = 1, 6 - if ( j .lt. 4 ) then - eposv(j) = j - else - eposv(j) = 0 - end if - end do - status = lcclusetdirectionerror ( clusp, eposv ) - do j = 1, 6 - if ( j .lt. 4 ) then - shape(j) = j - else - shape(j) = 7 - j - end if - end do - -*** set the cluster ashape variables - shapeparams(1) = 'Shape_trans' - shapeparams(2) = 'Shape_long' - shapeparams(3) = 'Shape_axis_x' - shapeparams(4) = 'Shape_axis_y' - shapeparams(5) = 'Shape_axis_z' - shapeparams(6) = 'Shape_quality' - vecp = stringvectorcreate( shapeparams, 6, - & len ( shapeparams(1) ) ) - status = lcsetparameters (LCIO_LCCOLLECTION, cluscol, - & 'setStringValues', 'ClusterShapeParameters', vecp ) - vecp = floatvectorcreate( shape, 6 ) - status = lcclusetshape ( clusp, vecp ) -c status = lcclusetshape ( clusp, shape ) -c status = lcclusetemweight ( clusp, .333) -c status = lcclusethadweight ( clusp, .333) -c status = lcclusetmuonweight ( clusp, .333) - - - - -*** add some random hits - ncalhit = lccolgetnumberofelements ( calhitcol ) - - dhelp = dble ( ncalhit ) - ihit1 = dhelp * irand( 0 )/RAND_MAX - ihit2 = dhelp * irand( 0 )/RAND_MAX - ihit3 = dhelp * irand( 0 )/RAND_MAX - helpp = lccolgetelementat ( calhitcol, ihit1 + 1 ) - status = lccluaddhit ( clusp, helpp , 1.) - helpp = lccolgetelementat ( calhitcol, ihit2 + 1 ) - status = lccluaddhit ( clusp, helpp , 2. ) - helpp = lccolgetelementat ( calhitcol, ihit3 + 1 ) - status = lccluaddhit ( clusp, helpp , 3. ) - -*** add clusters that where used to create this cluster - ncluscol = lccolgetnumberofelements ( cluscol ) - if ( ncluscol .gt. 1 ) then - helpp = lccolgetelementat ( cluscol, ncluscol ) - status = lccluaddcluster ( clusp, helpp ) - helpp = lccolgetelementat ( cluscol, ncluscol - 1 ) - status = lccluaddcluster ( clusp, helpp ) - end if - status = lccoladdelement ( cluscol, clusp ) - end do - end if - colname2 = 'SomeClusters' - status = lcevtaddcollection ( eventi, cluscol, colname2 ) -* - end - -********************************************************************** -* * - subroutine vertices !* -* * -********************************************************************** - - implicit none - -#include "recjob.inc" - - PTRTYPE helpp, clusp - integer i, j, k - real cov(6), pos(3) - character*30 colname - - integer nvtx - parameter (nvtx=11) - -*** add some vertices - vtxcol = lccolcreate ( LCIO_VERTEX ) - do i = 1, nvtx - vtx = lcvtxcreate () - if ( i .eq. 1 ) then - status = lcvtxsetprimary ( vtx, .true. ) - end if - - k=MOD(irand( 0 ), 7) - if ( k .eq. 0 ) then - status = lcvtxsetalgorithmtype(vtx, "ZvTop") - else if ( k .eq. 1 ) then - status = lcvtxsetalgorithmtype(vtx, "ZvKin") - else if ( k .eq. 2 ) then - status = lcvtxsetalgorithmtype(vtx, "42") - else if ( k .eq. 3 ) then - status = lcvtxsetalgorithmtype(vtx, "SimAnnealing") - else if ( k .eq. 5 ) then - status = lcvtxsetalgorithmtype(vtx, "_Test") - end if - - status = lcvtxsetchi2 ( vtx, (i-1)*101.101 ) - status = lcvtxsetprobability ( vtx, 0.511*(i-1) ) - do j = 1, 6 - cov(j) = j - end do - status = lcvtxsetcovmatrix ( vtx, cov ) - pos(1) = 10. - pos(2) = 20. - pos(3) = 30. - status = lcvtxsetposition ( vtx, pos ) - do j = 1, 3 - status = lcvtxaddparameter ( vtx, (j-1)*.1 ) - end do - -*** add this vertex to collection - status = lccoladdelement ( vtxcol, vtx ) - - end do - colname = 'Vertices' - status = lcevtaddcollection ( eventi, vtxcol, colname ) -* - end - - -********************************************************************** -* * - subroutine reco_particles !* -* * -********************************************************************** - - implicit none - -#include "recjob.inc" - -#define SINGLE 1 - - PTRTYPE helpp, clusp - integer i, j, k - integer ihit1, ihit2, ihit3, npid, itrk, iclu, imcp - real mom(3), cov(10), refp(3), prob - character*30 colname - double precision dpos(3), dhelp - - integer nreccp - parameter (nreccp=10) - -*** add some reconstructed particles - recopcol = lccolcreate ( LCIO_RECONSTRUCTEDPARTICLE ) - do i = 1, nreccp - recopp = lcrcpcreate () -c status = lcrcpsetprimary ( recopp, .true. ) - status = lcrcpsettype ( recopp, SINGLE ) - mom(1) = 1.1 - mom(2) = 2.2 - mom(3) = 3.3 - status = lcrcpsetmomentum ( recopp, mom ) - status = lcrcpsetenergy ( recopp, (i-1)*101.101 ) - do j = 1, 10 - cov(j) = j - end do - status = lcrcpsetcovmatrix ( recopp, cov ) - status = lcrcpsetmass ( recopp, 0.511*(i-1) ) - status = lcrcpsetcharge ( recopp, -2./3. ) - refp(1) = 10. - refp(2) = 20. - refp(3) = 30. - status = lcrcpsetreferencepoint (recopp, refp ) - -*** associate vertices - vtx = lccolgetelementat ( vtxcol , i ) - status = lcrcpsetstartvertex ( recopp, vtx ) - vtx = lccolgetelementat ( vtxcol , i + 1 ) - status = lcvtxsetassociatedparticle ( vtx , recopp ) - -*** add some particle ids - npid = 5 - do j = 1, npid - pidp = lcpidcreate () - prob = dble ( (j+1)/npid ) - status = lcpidsetlikelihood (pidp, prob ) - status = lcpidsettype ( pidp, j ) - status = lcpidsetpdg ( pidp, -11 ) - - - status = lcpidsetalgorithmtype ( pidp, 1 ) - do k = 1, 3 - status = lcpidaddparameter ( pidp, (k-1)*.1 ) - end do - status = lcrcpaddparticleid ( recopp, pidp ) - end do - status = lcrcpsetgoodnessofpid ( recopp, 0.7 ) - -*** some other particles - if ( i .gt. 2 ) then - recopp1 = lccolgetelementat ( recopcol , i - 1 ) - recopp2 = lccolgetelementat ( recopcol , i - 2 ) - status = lcrcpaddparticle ( recopp, recopp1, 0.1 ) - status = lcrcpaddparticle ( recopp, recopp2, 0.9 ) - end if - - -*** a track - itrk = dble ( lccolgetnumberofelements ( trackcol ) )* - & irand( 0 )/RAND_MAX - trkp = lccolgetelementat ( trackcol, itrk + 1 ) - status = lcrcpaddtrack ( recopp , trkp, 1.0 ) - -*** a cluster - iclu = dble ( lccolgetnumberofelements ( cluscol ) )* - & irand( 0 )/RAND_MAX - clusp = lccolgetelementat ( cluscol, iclu + 1 ) - status = lcrcpaddcluster ( recopp , clusp, 1.0 ) - -*** and finally an MCParticle - mcpcol = lcevtgetcollection( eventi , LCIO_MCPARTICLE ) - imcp = dble ( lccolgetnumberofelements ( mcpcol ) )* - & irand( 0 )/RAND_MAX - mcpp = lccolgetelementat ( mcpcol, imcp + 1 ) -c status = lcrcpaddmcparticle ( recopp , mcpp, 0.5 ) - - -*** add this reconstructed particle to collection - status = lccoladdelement ( recopcol, recopp ) - - end do - colname = 'ReconstructedParticle' - status = lcevtaddcollection ( eventi, recopcol, colname ) -* - end - - -********************************************************************** -* * - subroutine modifyevent ( pevent ) !* -* * -********************************************************************** - - implicit none - -#include "recjob.inc" - - PTRTYPE pevent - integer nmcp, i - -*** here we can modify existing objects that have been read from a stream: - eventi = pevent - mcpcol = lcevtgetcollection( eventi , LCIO_MCPARTICLE ) - nmcp = lccolgetnumberofelements ( mcpcol ) - do i = 1, nmcp - mcpp = lccolgetelementat ( mcpcol, i ) - status = lcmcpsetpdg ( mcpp, 1234 ) - end do - -*** or we could add sth. to existing collections - mcpp = lcmcpcreate () - status = lcmcpsetpdg ( mcpp, 1234 ) - status = lcmcpaddparent ( mcpp, lccolgetelementat ( mcpcol, 1 ) ) - status = lccoladdelement ( mcpcol, mcpp ) - -*** now dump event and write - call output_event - - end - -********************************************************************** -* * - subroutine output_event !* -* * -********************************************************************** -* - implicit none - -#include "recjob.inc" - -*** dump event - status = lcdumpevent ( eventi ) - -*** write event - status = lcwrtwriteevent ( writer, eventi ) -* - end - diff --git a/src/f77/recjob.inc b/src/f77/recjob.inc deleted file mode 100644 index 1f155ab71..000000000 --- a/src/f77/recjob.inc +++ /dev/null @@ -1,34 +0,0 @@ - -* include file for recojob -* ************************ - -#include "lciof77api.inc" -#include "lciof77apiext.inc" - - - PTRTYPE reader, writer - PTRTYPE eventi, evento, header - PTRTYPE mcpcol, mcpp - PTRTYPE tpchitcol, trackerhitcol, trhitp, tpchit, trackcol, trkp - PTRTYPE simcalcol, cluscol, calhitcol, simcalhitp, calhitp - PTRTYPE recopcol, recopp, pidp, recopp1, recopp2 - PTRTYPE vtxcol, vtx - -*** temporary pointers used in several routines - PTRTYPE screlp, screlcol - - common /pointers/ - & reader, writer - &, eventi, evento, header - &, mcpcol, mcpp - &, tpchitcol, trackerhitcol, trhitp, tpchit, trackcol, trkp - &, simcalcol, cluscol, calhitcol, simcalhitp, calhitp - &, recopcol, recopp, pidp, recopp1, recopp2 - &, vtxcol, vtx - &, ievent - - integer status, ievent - - double precision M_PI - parameter (M_PI=3.14159265358979323846) - diff --git a/src/f77/simjob.F b/src/f77/simjob.F deleted file mode 100644 index 426e47c56..000000000 --- a/src/f77/simjob.F +++ /dev/null @@ -1,362 +0,0 @@ -********************************************************************** -* * - PROGRAM SIMJOB !* -* SIMJOB * -* A program to demonstrate the use of the low level * -* fortran interface to LCIO for writing LCIO files. * -* it corresponts to lcio/src/cpp/src/EXAMPLE/simjob.cc * -* * -* H. Vogt 06/15/2004 * -* updated: 21/09/2004 (H.V.) * -* * -********************************************************************** - - call my_simjob - end - - subroutine my_simjob - implicit none - -#include "lciof77api.inc" -#include "lciof77apiext.inc" - -#define RAND_MAX 2147483647 -#define INT_MAX 2147483647 - -c---- variables - PTRTYPE runheader, event, writer, sthcol - PTRTYPE mcpcol, schcol, cahcol, pvec, relnavcol - PTRTYPE mom, hit, mcp, mcpm, mcpd, mcpdd, tpcHit, relnav - PTRTYPE TPCVec, trkVec, extFVec, extIVec, extF, extI - PTRTYPE helpp - logical storeRawData - integer status - integer i, j, k, l, irun, nrun, iev, nev, itim, locf, nmcpart - integer nhits, flag, extiv(2), tpcFlag, rawData(10), size, argc - integer intvec(3) - real p0(3), mcpp(3), schpos(3), cahpos(3), rn, extfv(4) - character*80 key, description - character*30 filename - character*11 detectorname - character*7 ecalName,tpcName - double precision sthpos(3), ep(3) - -C----- some constants - filename = 'f_simjob.slcio' - detectorname = 'D09TileHcal' - ecalName = 'ECAL007' - tpcName = 'TPC4711' - - nrun = 10 ! - nev = 10 ! events - nmcpart = 10 ! mc particles per event - nhits = 50 ! calorimeter hits per event - -* ----- Simple test program to demonstrate writing of data with lcio. - - argc = iargc() - if ( argc .gt. 0 ) call getarg (1, filename) - -c ----- loop over runs - do irun= 0,nrun-1 - -c----- create sio writer - writer = lcwrtcreate() - if (irun .eq. 0) then - status = lcwrtopen( writer, filename , LCIO_WRITE_NEW ) - else - status = lcwrtopen( writer, filename , LCIO_WRITE_APPEND ) - end if - -* **** NB: in order to test writing multiple files we create a new LCWriter -* **** for every run even though we are in fact writing to one file only; -* **** so for a simple job writing one file the -* **** 'createLCWriter/open' and 'close/delete' will be outside the run loop... - - -c----- run header - runheader = lcrhdcreate() - status = lcrhdsetrunnumber( runheader, irun ) - status = lcrhdsetdetectorname( runheader, detectorname ) - write (description,'(a,i1,a)') " run: ", irun, - $ " just for testing lcio - no physics !" ; - status = lcrhdsetdescription - $ ( runheader, description(1:len_trim(description)) ) - - status = lcrhdaddactivesubdetector( runheader, ecalName ) - status = lcrhdaddactivesubdetector( runheader, tpcName ) - -c----- add some parameters to the run header - description = 'simjob.cc' - pvec = stringvectorcreate( description, 1, - & description(1:len_trim(description)) ) - status = lcsetparameters( LCIO_LCRUNHEADER, runheader, - & 'setStringValues', 'SimulationProgram', pvec) - do i = 1,3 - intvec(i) = i - end do - pvec = intvectorcreate(intvec, 3) - status = lcsetparameters( LCIO_LCRUNHEADER, runheader, - & 'setIntValues', 'SomeIndices', pvec) - - status = lcwrtwriterunheader( writer, runheader ) - -c----- event loop - do iev = 0,nev-1 - -c-------- we need to use the implementation classes here - event = lcevtcreate() - status = lcevtsetrunnumber( event, irun ) - status = lcevtseteventnumber( event, iev ) - status = lcevtsetdetectorname( event, detectorname ) - -c-------- create and add some mc particles - mcpcol = lccolcreate( LCIO_MCPARTICLE ) - -c-------- debug only - don't write MCParticles to LCIO file -c----- status = lccolsettransient( mcpcol , 1 ) - -c-------- debug only - add the same particle to more than one collection -c-------- LCCollectionVec* mcVec2 = new LCCollectionVec( LCIO::MCPARTICLE ) ; - - mom = lcmcpcreate() - status = lcmcpsetpdg( mom, 1 ) - p0(1) = 0. - p0(2) = 0. - p0(3) = 1000. - status = lcmcpsetmomentum( mom, p0 ) - status = lcmcpsetmass( mom, 3.01 ) - - do j = 1,nmcpart - mcp = lcmcpcreate() - status = lcmcpsetpdg( mcp , 1000*j ) - mcpp(1) = (j-1)*1. - mcpp(2) = 4./1024. - mcpp(3) = 8./1024. - status = lcmcpsetmomentum( mcp, mcpp ) - status = lcmcpsetmass( mcp, .135 ) - -c-------- create and add some daughters - do k = 1,3 - mcpd = lcmcpcreate() - status = lcmcpsetpdg( mcpd, 1000*j + 100*k ) - mcpp(1) = (k-1)*1. - mcpp(2) = 4.1 - mcpp(3) = 8.1 - status = lcmcpsetmomentum( mcpd, mcpp ) - status = lcmcpsetmass( mcpd, .135 ) - do l = 1,2 - mcpdd = lcmcpcreate() - status = lcmcpsetpdg( mcpdd, - & 1000*j + 100*k + 10*l ) - mcpp(1) = (l-1)*1. - mcpp(2) = 0.41 - mcpp(3) = 4.1 - status = lcmcpsetmomentum( mcpdd, mcpp ) - status = lcmcpsetmass( mcpdd, .135 ) - ep(1) = 1.111111 - ep(2) = 2.2222222 - ep(3) = 3.3333333 - status = lcmcpsetendpoint( mcpdd, ep ) - - flag = 0 - flag = ibset( flag, BITCreatedInSimulation ) - flag = ibset( flag, BITBackscatter ) - flag = ibset( flag, BITDecayedInTracker ) - flag = ibclr( flag, BITDecayedInCalorimeter ) - flag = ibclr( flag, BITLeftDetector ) - flag = ibset( flag, BITStopped ) - - status = lcmcpsetsimulatorstatus( mcpdd, flag ) - status = lcmcpaddparent( mcpdd , mcpd ) - status = lccoladdelement( mcpcol, mcpdd ) - -c-------- debug only - add the same particle to more than one collection -c-------- mcVec2->push_back( d2 ) - end do - status = lcmcpaddparent( mcpd, mcp) - status = lccoladdelement( mcpcol, mcpd ) - end do - status = lcmcpaddparent( mcp, mom ) - status = lccoladdelement( mcpcol, mcp ) - end do - status = lccoladdelement( mcpcol, mom ) - -c------ now add some calorimeter hits - schcol = lccolcreate( LCIO_SIMCALORIMETERHIT ) - -c-------- set flag for long format (including position ) -c-------- and PDG and cellid1 - flag = 0 - flag = ibset( flag, LCIO_CHBIT_LONG ) - flag = ibset( flag, LCIO_CHBIT_PDG ) - flag = ibset( flag, LCIO_CHBIT_ID1 ) - status = lccolsetflag( schcol, flag ) - - do j = 1,nhits - - hit = lcschcreate() - status = lcschsetenergy - & ( hit, 3.1415*irand( 0 )/RAND_MAX) - schpos(1) = 1.1*irand( 0 )/RAND_MAX - schpos(2) = 2.2*irand( 0 )/RAND_MAX - schpos(3) = 3.3*irand( 0 )/RAND_MAX - status = lcschsetposition( hit, schpos ) - - status = lcschsetcellid0( hit, j -1 + 65335 ) - status = lcschsetcellid1( hit, 65535 ) - - status = lccoladdelement( schcol, hit ) - -c-------- assign the hits randomly to MC particles - rn = .99999*irand( 0 )/RAND_MAX - rn = rn*nmcpart - mcp = lccolgetelementat( mcpcol, int( rn) + 1 ) - status = lcschaddmcparticlecontribution - $ ( hit, mcp, 0.314159, 0.1155 , 0 ) ! no pdg - end do - -c-------- data can be modified as long as is not not made persistent - do j = 1,nhits - hit = lccolgetelementat( schcol, j ) - mcp = lccolgetelementat( mcpcol, 1 ) - status = lcschaddmcparticlecontribution - $ ( hit, mcp, 0.1, 0., 0 ) - end do - -c-------- and finally some tracker hits -c-------- with some user extensions (4 floats and 2 ints) per track: -c-------- we just need to create parallel collections of float and int vectors - trkVec = lccolcreate( LCIO_SIMTRACKERHIT ) - extFVec = lccolcreate( LCIO_LCFLOATVEC ) - extIVec = lccolcreate( LCIO_LCINTVEC ) - - - flag = 0 - flag = ibset( flag, LCIO_THBIT_MOMENTUM ) - status = lccolsetflag( trkVec, flag ) - - do j = 1,nhits - hit = lcsthcreate() - status = lcsthsetdedx( hit, 30.e-9 ) - sthpos(1) = 1.1*irand( 0 )/RAND_MAX - sthpos(2) = 2.2*irand( 0 )/RAND_MAX - sthpos(3) = 3.3*irand( 0 )/RAND_MAX - status = lcsthsetposition( hit, sthpos ) - status = lcsthsetmomentumxyz( hit, 1., 2., 3. ) - status = lcsthsetpathlength( hit, .042 ) - -c-------- assign the hits randomly to MC particles - rn = .99999*irand( 0 )/RAND_MAX - rn = rn*nmcpart - mcp = lccolgetelementat( mcpcol, int( rn) + 1 ) - status = lcsthsetmcparticle ( hit, mcp ) - -c-------- fill the extension vectors (4 floats, 2 ints) - extfv(1) = 3.14159 - do k = 1,3 - extfv(k+1) = sthpos(k)*0.1 - end do - extiv(1) = 123456789 - extiv(2) = int( rn ) - extF = lcfloatvectorcreate( extfv, 4 ) - extI = lcintvectorcreate( extiv, 2 ) - -c-------- add the hit and the extensions to their corresponding collections - status = lccoladdelement( trkVec, hit ) - status = lccoladdelement( extFVec, extF ) - status = lccoladdelement( extIVec, extI ) - end do - - -c-------- add all collections to the event - status = lcevtaddcollection( event, mcpcol, 'MCParticle' ) - - status = lcevtaddcollection( event, schcol, ecalName ) - status = lcevtaddcollection( event, trkVec, tpcName ) - status = lcevtaddcollection( - & event, extFVec, tpcName//'UserFloatExtension' ) - - status = lcevtaddcollection( - & event, extIVec, tpcName//'UserIntExtension' ) - -c-------- test: add a collection for one event only: - if (irun .eq. 1 .and. iev .eq. 0) then ! first event of last run - extFVec = lccolcreate( LCIO_LCFLOATVEC ) - do l = 1,4 - extfv(l) = l - end do - extF = lcfloatvectorcreate( extfv, 4 ) - status = lccoladdelement( extFVec, extF ) - status = lcevtaddcollection( - & event, extFVec, 'AdditionalExtension' ) - end if - -c-------- even though this is a simjob we can store 'real data' objects : -c-------- --- for example we can store TPC hits ------------ - - TPCVec = lccolcreate( LCIO_TPCHIT ) - -c-------- test new relation navigator object - relNav = lcrnvcreate( LCIO_TPCHIT, LCIO_SIMTRACKERHIT ) - - storeRawData = .true. - flag = 0 - if (storeRawData) flag = ibset( flag, LCIO_TPCBIT_RAW ) - status = lccolsetflag ( TPCVec, flag ) - do j = 1,nhits - tpcHit = lctphcreate() - -c-------- test new relation navigator object - helpp = lccolgetelementat ( trkVec, j ) - status = lcrnvgaddrelation( relNav, tpcHit, helpp, 0.95 ) - - status = lctphsetcellid( tpcHit, j-1 ) - status = lctphsettime( tpcHit, 0.1234567 ) - status = lctphsetcharge( tpcHit, 3.14159 ) - status = lctphsetquality( tpcHit, int(z'bad') ) - if (storeRawData) then - size = ( dble(irand( 0 ) )/RAND_MAX )*10 - do k = 1,size - rawData(k) = - & int ( ( dble(irand( 0 ) )/RAND_MAX )*INT_MAX ) - end do - status = lctphsetrawdata( tpcHit, rawData, size ) - end if - status = lccoladdelement( TPCVec, tpcHit ) - end do - status = lcevtaddcollection( - & event, TPCVec, 'TPCRawFADC' ) - relNavCol = lcrnvcreatecollection ( relNav ) - status = lcevtaddcollection( - & event, relNavCol, 'TPCRawFADCMCTruth' ) - -c-------- -------------- all for TPC -------------------- - -c-------- write the event to the file - status = lcwrtwriteevent( writer , event ) -c-------- dump the event - status = lcdumpevent( event ) - -c-------- we created the event so we need to delete it ... - status = lcevtdelete( event ) - -c---- event loop end - end do - - status = lcrhddelete( runheader ) - - status = lcwrtclose( writer ) - status = lcwrtdelete( writer ) - -c---- run loop end - end do - - print * - print *, 'created ', nrun, ' runs with ', nrun*nev, ' events' - print * - stop - -C - end - diff --git a/src/f77/simjob_chain.F b/src/f77/simjob_chain.F deleted file mode 100644 index 81cb3df76..000000000 --- a/src/f77/simjob_chain.F +++ /dev/null @@ -1,410 +0,0 @@ -********************************************************************** -* * - PROGRAM SIMJOB_CHAIN !* -* * -* A program to demonstrate the use of the * -* low level and the extended level * -* fortran interface to LCIO for writing LCIO files. * -* * -* F.Gaede 09/10/2003 * -* H.Vogt 14/06/2004 (modified) * -********************************************************************** - implicit none - -#include "lciof77api.inc" -#include "lciof77apiext.inc" - - PTRTYPE reader, writer - - integer ifile, nfiles, status, jj - parameter (nfiles=4) - character*8 filename - character*16 filenamei(nfiles) - character*1 chnum - -c------ write several slcio output files - filename = "f_simjob" - do ifile = 1,nfiles - write (chnum,'(i1)') ifile - filenamei(ifile) = filename//chnum//'.slcio' - call simjob( ifile, filenamei(ifile) ) - end do - -c------ read a chain of slcio files and analyze then (1 pass only) - reader = lcrdrcreate() -c write(*,*) " created reader at " , reader - - status = lcrdropenchain( reader, filenamei(1), nfiles, - & len(filenamei(1)) ) - - if( status.eq.LCIO_ERROR) then - write(*,*) " could not open file chain:" - write(*,*) (filenamei(jj),jj=1,nfiles) - goto 99 - else - write(*,*) " opened file chain is:" - write(*,*) (filenamei(jj),jj=1,nfiles) - endif - - call anajob ( reader ) - - status = lcrdrclose( reader ) - write(*,*) " closed file simjob.sio - status : " , status -* - 99 continue - stop -* - end - -********************************************************************** -* * - subroutine simjob ( ipass, filename ) !* -* * -* A program to demonstrate the use of the low level * -* fortran interface to LCIO for writing LCIO files. * -* * -* F.Gaede 09/10/2003 * -********************************************************************** - implicit none - -#include "lciof77api.inc" -#include "lciof77apiext.inc" - -c---- variables - PTRTYPE runheader, event, writer, sthcol, mcpcol, schcol, cahcol - PTRTYPE stringvcol, floatvcol, intvcol, pstringv, pfloatv, pintv - PTRTYPE hit, mcp, mcpm, mcpd, mcpdd - PTRTYPE mcpv(50), pointerv(50), ppointerv - integer npointers - integer status - integer i, j, k, irun, nrun, iev, nev, itimv(8), itim, locf - integer nhit, flag - character*10 dum1, dum2, dum3 - - integer ipass - character*16 filename - character*10 detectorname - real mcpp(3), schpos(3), cahpos(3) - double precision sthpos(3) - character*4 strvnames(10) - integer intvvals(10) - real realvvals(10) - - data strvnames /'ABCD', 'BCDE', 'CDEF', 'DEFG', 'EFGH', - & 'abcd', 'bcde', 'cdef', 'defg', 'efgh' / - data intvvals / 1234, 2345, 3456, 4567, 5678, 0, 0, 0, 0, 0 / - data realvvals / 123.4, 234.5, 345.6, 456.7, 567.8, - & 0., 0., 0., 0., 0. / - -C----- some constants - detectorname = 'TeslaPPT' - nev = 10 - nrun = 5 - nhit = 100 - - print *, 'filename is: ', filename - - writer = lcwrtcreate() - status = lcwrtopen( writer, filename , LCIO_WRITE_NEW ) - -c ----- create a few runs - do irun=1,nrun - -c----- write a run header first (run number is: ipass*10 +irun) - runheader = lcrhdcreate() - status = lcrhdsetrunnumber( runheader, irun + ipass*10 ) - status = lcrhdsetdetectorname( runheader, detectorname ) - status = lcrhdsetdescription( runheader, - $ ' simple test file for f77 interface - no physiscs' ) - - status = lcrhdaddactivesubdetector( runheader, 'VXD') - status = lcrhdaddactivesubdetector( runheader, 'TPC') - status = lcrhdaddactivesubdetector( runheader, 'HCal') - status = lcrhdaddactivesubdetector( runheader, 'HCalPPT') - - status = lcwrtwriterunheader( writer, runheader ) - -c----- event loop - do iev = 1,nev - - event = lcevtcreate() - status = lcevtsetdetectorname( event, detectorname ) - status = lcevtsetrunnumber( event, irun ) - status = lcevtseteventnumber( event, iev ) - -c get a time stamp - call date_and_time (dum1, dum2, dum3, itimv) - itim = (itimv(5)*100+itimv(6))*100+itimv(7) - status = lcevtsettimestamp( event, itim ) - - mcpcol = lccolcreate( LCIO_MCPARTICLE ) - sthcol = lccolcreate( LCIO_SIMTRACKERHIT ) - schcol = lccolcreate( LCIO_SIMCALORIMETERHIT ) - cahcol = lccolcreate( LCIO_CALORIMETERHIT ) - - pstringv = lcstringvectorcreate ( strvnames, 10, 4 ) - pfloatv = lcfloatvectorcreate ( realvvals, 10 ) - pintv = lcintvectorcreate ( intvvals, 10 ) - -c-------- create some monte carlo particles - - do i = 1,nhit/2 - mcp = lcmcpcreate() - mcpv(i) = mcp - status = lcmcpsetpdg( mcp, 123 ) - mcpp(1) = i*1. - mcpp(2) = i*2. - mcpp(3) = i*3. - status = lcmcpsetmomentum( mcp, mcpp ) - - status = lccoladdelement( mcpcol, mcp ) - - do j=1,2 - mcpd = lcmcpcreate() - status = lcmcpsetpdg( mcpd , 12345 ) - mcpp(1) = j*1. - mcpp(2) = j*2. - mcpp(3) = j*3. - status = lcmcpsetmomentum( mcpd, mcpp ) - - status = lcmcpaddparent( mcpd , mcp ) - - - status = lccoladdelement( mcpcol, mcpd ) - - do k=1,3 - mcpdd = lcmcpcreate() - status = lcmcpsetpdg( mcpdd , 1234567 ) - mcpp(1) = k*1. - mcpp(2) = k*2. - mcpp(3) = k*3. - status = lcmcpsetmomentum( mcpdd, mcpp ) - - status = lcmcpaddparent( mcpdd , mcpd ) - - status = lccoladdelement( mcpcol, mcpdd ) - enddo - enddo - enddo - -c------ simulated tracker hits - -c-------- set the flag bits to store position and pdg for simulated calorimeter hits - flag = (-2)**31 + 2**28 - status = lccolsetflag( schcol, flag ) - - do k=1,nhit - - hit = lcsthcreate() - status = lcsthsetcellid0( hit, 314159 ) - sthpos(1) = 1. - sthpos(2) = 2. - sthpos(3) = 3. - status = lcsthsetposition( hit, sthpos ) - -c --- assign a MCParticle to each hit - mcp = lccolgetelementat( mcpcol, k ) - status = lcsthsetmcparticle( hit, mcp ) - - status = lccoladdelement( sthcol, hit ) - - enddo - - -c---- simulated calorimeter hits - do k=1,nhit - - hit = lcschcreate() - status = lcschsetcellid0( hit, 314159 ) - status = lcschsetcellid1( hit, 314159*2 ) - schpos(1) = 1. - schpos(2) = 2. - schpos(3) = 3. - status = lcschsetposition( hit, schpos ) - -c --- add energy from 2 MCParticles to each hit - - mcp = lccolgetelementat( mcpcol, k ) - status = lcschaddmcparticlecontribution - $ ( hit, mcp, 0.001, 0. , 1234 ) - - mcp = lccolgetelementat( mcpcol, k+1 ) - status = lcschaddmcparticlecontribution - $ ( hit, mcp, 0.007, 0. , 4711 ) - - status = lccoladdelement( schcol, hit ) - enddo - - -c---- real data calorimeter hits - -c ---- set the flag bits to store position for calorimeter hits - flag = (-2)**31 - status = lccolsetflag( cahcol, flag ) - - do k=1,nhit - hit = lccahcreate() - status = lccahsetcellid0( hit, 314159 ) - status = lccahsetcellid1( hit, 314159*2 ) - cahpos(1) = 11. - cahpos(2) = 22. - cahpos(3) = 33. - status = lccahsetposition( hit, cahpos ) - status = lccahsetenergy( hit, 2.*k ) - - status = lccoladdelement( cahcol, hit ) - enddo - -c----- now we will check the stl pointer vector - if (irun .eq. 1 .and. iev .eq. 1) then - print *, 'pointers going into the pointer vector' -#if defined(__ia64__) - print '(5z20)', (mcpv(i), i=1,nhit/2) -#else - print '(10z10)', (mcpv(i), i=1,nhit/2) -#endif - ppointerv = pointervectorcreate( mcpv, nhit/2 ) - npointers = pointervectorgetlength( ppointerv ) - status = getpointervector( ppointerv, pointerv, npointers) - print *, 'pointers got from the pointer vector' -#if defined(__ia64__) - print '(5z20)', (pointerv(i), i=1,npointers) -#else - print '(10z10)', (pointerv(i), i=1,npointers) -#endif - status = pointervectordelete( ppointerv ) - end if - - -c----- now add everything to the event - status = lcevtaddcollection(event,mcpcol ,'MCParticle') - status = lcevtaddcollection(event,sthcol ,'MyTrackerHits') - status = lcevtaddcollection(event,schcol ,'MyCalHits') - status = lcevtaddcollection(event,cahcol ,'MyRealCalHits') - - stringvcol = lccolcreate( LCIO_LCSTRVEC ) - floatvcol = lccolcreate( LCIO_LCFLOATVEC ) - intvcol = lccolcreate( LCIO_LCINTVEC ) - - status = lccoladdelement( stringvcol, pstringv ) - status = lccoladdelement( floatvcol, pfloatv ) - status = lccoladdelement( intvcol, pintv ) - - status = lcevtaddcollection(event,stringvcol,'MyStringVec') - status = lcevtaddcollection(event,floatvcol,'MyFloatVec') - status = lcevtaddcollection(event,intvcol,'MyIntVec') - - status = lcwrtwriteevent( writer , event ) - - if (status .eq. LCIO_ERROR ) then - print *, 'SIMJOB: error - can not write event', iev - stop - end if - -c------- need to delete the event as we created it - status = lcevtdelete( event ) - - enddo - enddo - status = lcwrtclose( writer ) - status = lcwrtdelete ( writer) - write(*,*) - write(*,*) "----------------------------------------------------" - write(*,*) "simjob is finished" - write(*,*) "----------------------------------------------------" - write(*,*) - -C - end - -*********************************************************** -* - subroutine anajob ( reader ) -* -* A program to demonstrate the use of the -* fortran interface to LCIO for reading LCIO files. -* -* H. Vogt 30/09/2003 -* modified by F. Gaede 10/30/2003 -*********************************************************** - implicit none - -#include "lciof77api.inc" -#include "lciof77apiext.inc" - - PTRTYPE reader, event, runhdr, detnames - PTRTYPE pcol1, pcol2, pcol3, pobject1, pobject2, pobject3 - - character*16 filename - integer status, irun, ievent - integer i, nactdet, ii - character*80 detname - - character*40 colname1, colname2, colname3 - integer nfloatv, nintv, nstrv - integer intv(20) - real floatv(20) - character*10 strv(20) - - write(*,*) - write(*,*) "----------------------------------------------------" - write(*,*) "anajob is started" - write(*,*) "----------------------------------------------------" - write(*,*) - - - - - do - -c---- look for the run header and print information - runhdr = lcrdrreadnextrunheader( reader, LCIO_READ_ONLY ) - if( runhdr.eq.0 ) goto 99 - - write(*,*) " Run : ",lcrhdgetrunnumber( runHdr ) - $ ,lcrhdgetdetectorname( runHdr ) - $ ,lcrhdgetdescription( runHdr ) - - write(*,*) " active subdetectors : " - detnames = lcrhdgetactivesubdetectors( runHdr ) - nactdet = lcsvcgetlength( detnames ) - do i=1,nactdet - write(*,*) lcsvcgetstringat( detnames, i ) - enddo - -c---- read first event of this run and print floatvec and intvec collection - event = lcrdrreadnextevent( reader, LCIO_READ_ONLY ) - colname1 = 'MyFloatVec' - colname2 = 'MyIntVec' - colname3 = 'MyStringVec' - pcol1 = lcevtgetcollection( event , colname1 ) - pcol2 = lcevtgetcollection( event , colname2 ) - pcol3 = lcevtgetcollection( event , colname3 ) - pobject1 = lccolgetelementat( pcol1, 1 ) - pobject2 = lccolgetelementat( pcol2, 1 ) - pobject3 = lccolgetelementat( pcol3, 1 ) - - nfloatv = 20 - status = lcgetfloatvector( pobject1, floatv, nfloatv ) - print '(a,i3,a,i3,a,10f10.5)', - & 'floatv ', i, ' has ', nfloatv, ' elements: ', - & (floatv(ii),ii=1,nfloatv) - nintv = 20 - status = lcgetintvector( pobject2, intv, nintv ) - print '(a,i3,a,i3,a,10i10)', - & 'intv ', i, ' has ', nintv, ' elements: ', - & (intv(ii),ii=1,nintv) - nstrv = 20 - status = lcgetstringvector - & ( pobject3, strv, nstrv, len( strv(1) ) ) - print '(a,i3,a,i3,a,10a10)', - & 'strv ', i, ' has ', nstrv, ' elements: ', - & (strv(ii),ii=1,nstrv) - - end do - -c ---- end loop ------ - - 99 continue - end - diff --git a/src/java/hep/lcio/implementation/sio/SIOTrack.java b/src/java/hep/lcio/implementation/sio/SIOTrack.java index e889e0959..5ce01f0a9 100644 --- a/src/java/hep/lcio/implementation/sio/SIOTrack.java +++ b/src/java/hep/lcio/implementation/sio/SIOTrack.java @@ -78,7 +78,9 @@ class SIOTrack extends ITrack ndf = in.readInt() ; dEdx = in.readFloat(); dEdxError = in.readFloat(); - nholes = in.readInt() ; + if (SIOVersion.encode(major,minor) > SIOVersion.encode(2,21) { + nholes = in.readInt() ; + } radiusOfInnermostHit = in.readFloat() ; int nHitNumbers = in.readInt() ; int[] hitNumbers = new int[nHitNumbers] ; @@ -87,13 +89,15 @@ class SIOTrack extends ITrack hitNumbers[i] = in.readInt() ; } setSubdetectorHitNumbers(hitNumbers) ; - int nHoleNumbers = in.readInt() ; - int[] holeNumbers = new int[nHoleNumbers] ; - for (int i = 0; i < nHoleNumbers; i++) - { - holeNumbers[i] = in.readInt() ; + if (SIOVersion.encode(major,minor) > SIOVersion.encode(2,21) { + int nHoleNumbers = in.readInt() ; + int[] holeNumbers = new int[nHoleNumbers] ; + for (int i = 0; i < nHoleNumbers; i++) + { + holeNumbers[i] = in.readInt() ; + } + setSubdetectorHoleNumbers(holeNumbers) ; } - setSubdetectorHoleNumbers(holeNumbers) ; int nTracks = in.readInt(); tempTracks = new ArrayList(nTracks); tracks = null; diff --git a/src/latex/manual/f77api.tex b/src/latex/manual/f77api.tex deleted file mode 100644 index 6fb8683af..000000000 --- a/src/latex/manual/f77api.tex +++ /dev/null @@ -1,324 +0,0 @@ -%----------------------------------------- -% LCIO fotran wrapper manual -% -% $Id: f77api.tex,v 1.17 2004-09-24 16:14:46 hvogt Exp $ $Name: not supported by cvs2svn $ -% -%----------------------------------------- -\subsection{The Fortran Interface} \label{f77api} - -The Fortran API of LCIO is based on a set of wrapper functions to the -C++ implementation using "cfrotran.h" to create the correct Fortran name. - -The main idea is that we use integers in Fortran to represent pointers to -objects on the C++ side. There will be one wrapper function for every class method -of the implementation classes (namespaces IMPL and IO) plus two additional methods -to create and delete the object respectively. All functions that operate on objects, i.e. -all functions except for the creation functions (constructors) need as a first argument -the integer pointer to the particluar object. - -By using a unique naming convention the documentation of the C++ version of the API -can be utilized for the Fortran API as well. - -Moreover example code written in C++ can be translated into Fortran basically line by -line as far as LCIO is concerned -- of course language specific control structures -will have to be different. So even if you are only intereseted in using LCIO from Fortran -it is probably a good idea to read the above sections on Java and C++ as well to get some -insight into the general structure of LCIO. - - -\subsubsection{ Note} \label{f77note} -{\em The handling of pointers in Fortran {\bf\em must} be done carefully. -One has to ensure that pointers are always used in the right context. -Pointers of objects given back to C++ can not be checked by the language to be applicable. -In most cases of wrong pointer usage the execution of the executable will result in a -{\bf\em{ segmentation violation}}. -} - - -\subsubsection{Naming convention} -The following naming convention is used for the fortran wrapper functions to the -C++ implementation of LCIO: -\begin{itemize} - -\item{all function names start with {\bf lc}} - -\item{{\bf lc} is followed by a three letter acronym that uniquley identifies the -corresponding C++ class, e.g. {\bf evt} for LCEvent.} See table \ref{tab_f77} for a complete listing -(for the classes 'LCVec, STL vector' see in the {\bf first part of Appendix~\ref{ftn_summary} under utility}) - -\item{the function name ends on the full lowercased name of the class method, e.g. \\ - \verb$LCEventImpl::getRunNumber()$ becomes {\bf lcevtgetrunnumber() } } - -\item{the constructor and destructor of the class end on {\bf create} and {\bf delete} -respectively, eg. {\bf lcevtdelete()} } - -\item{All constants defined in \verb$Event::LCIO$ are defined as constants in Fortran with the -same name prepended by {\bf 'LCIO\_'}, e.g. the type name for MCParticles defined in C++ in -\verb$LCIO::MCPARTICLE$ is defined in a character constant in Fortran named -{\bf LCIO\_MCPARTICLE} (see the Fortran include file {\bf lciof77apiext.inc}).} - -\end{itemize} - -\begin{table} -\begin{center} -\begin{tabular}{|c|c|} -\hline -\rule[-5mm]{0mm}{10mm} C++ class & f77 acronym \\ \hline \hline - - CalorimeterHitImpl & cah \\ \hline - ClusterImpl & clu \\ \hline - LCCollectionVec & col \\ \hline - LCEventImpl & evt \\ \hline - LCGenericObjectImpl & gob \\ \hline - MCParticleImpl & mcp \\ \hline - LCObject (Vector) & obv \\ \hline - ParticleIDImpl & pid \\ \hline - ReconstructedParticleImpl & rcp \\ \hline - LCReader & rdr \\ \hline - LCRelationImpl & rel \\ \hline - LCRunHeaderImpl & rhd \\ \hline - LCRelationNavigator & rnv \\ \hline - SimCalorimeterHitImpl & sch \\ \hline - SimTrackerHitImpl & sth \\ \hline - TPCHitImpl & tph \\ \hline - TrackerHitImpl & trh \\ \hline - TrackImpl & trk \\ \hline - LCWriter & wrt \\ \hline \hline - - LCVec, STL vector & ??? \\ \hline - -\end{tabular} -\end{center} -\caption{Three letter acronyms for f77 wrapper functions.} -\label{tab_f77} -\end{table} - -Additional methods to handle string, int and float vectors from Fortran are provided\\ -for the user extension classes (LCIntVec, LCFloatVec, LCStringVec):\\ -{\bf lcivcgetlength()}, {\bf lcivcgetintat()} \\ -{\bf lcfvcgetlength()}, {\bf lcfvcgetfloatat()} \\ -{\bf lcsvcgetlength()}, {\bf lcsvcgetstringat()} \\ - -and for the stl vector class:\\ -{\bf intvectorgetlength()}, {\bf intvectorgetelement()} \\ -{\bf floatvectorgetlength()}, {\bf floatvectorgetelement()} \\ -{\bf stringvectorgetlength()}, {\bf stringvectorgetelement()} . \\ - -For strings the Fortran CHARACTER* declaration has to be large enough, otherwise the original -string is truncated.\\ -A Summary of all functions in the basic Fortran API is given in the first part of {\bf Appendix~\ref{ftn_summary} }. - - -\subsubsection{Extension of the Base Fortran API} \label{f77ext} - -An additional set of Fortran functions is provided for user convenience. These are higher level functions -that usually allow to access several attributes of data objects with one function call. -These functions are declared in \verb#$LCIO/src/f77/lciof77apiext.inc#, -%$ -and are summarized in the second part of {\bf Appendix~\ref{ftn_summary} }. - -Most Fortran programs for simulation use the \verb$hepevt$ common block. -Conversion functions from the LCIO MCParticle collection to the \verb$hepevt$ common block and vice versa -are also provided in the extended interface. See the example in \ref{rwpythia}. - -The wrapper functions for the {\bf LCParametersImpl} class are provided in the extension of the base Fortran API. -This class is related to the classes\\ -{\bf LCRunHeaderImpl, LCEventImpl, and LCCollectionVec}\\ - and has the methods\\ -{\bf setIntValues, setFloatValues, setStringValues, getIntKeys, getFloatKeys, getStringtKeys, -getIntValues, getFloatValues, and getStringValues} .\\ - -The set/get methods are performed by the wrapper fuctions: -\begin{verbatim} -lcsetparameters (class_name, class_pointer, method_name, key_name, vector_pointer) -lcgetparameters (class_name, class_pointer, method_name, key_name, vector_pointer) -\end{verbatim} -. \\ -The vector\_pointer is given to lcsetparameters and obtained from lcgetparameters and the vector content -may be set or obtained by the stl vector wrapper fuctions. - -Methods of the extended Fortran API can be used\\ - -to create the vectors for the user extension classes (LCIntVec, LCFloatVec, LCStringVec)\\ - {\bf lcintvectorcreate(...)} \\ - {\bf lcfloatvectorcreate(...)} \\ - {\bf lcstringvectorcreate(...)} \\ - -and to fetch the content of a vector\\ - {\bf lcgetintvector(...)} \\ - {\bf lcgetfloatvector(...)} \\ - {\bf lcgetstringvector(...)} \\ - -to create/delete the stl vectors having int, float, string, and pointer datamembers -(e.g needed for the setShape method in the ClusterImpl Class)\\ - {\bf intvectorcreate(...)} \\ - {\bf intvectordelete(...)} \\ - {\bf floatvectorcreate(...)} \\ - {\bf floatvectordelete(...)} \\ - {\bf stringvectorcreate(...)} \\ - {\bf stringvectordelete(...)} \\ - {\bf pointervectorcreate(...)} \\ - {\bf pointervectordelete(...)} \\ - -and to fetch the content of a vector\\ - {\bf getintvector(...)} \\ - {\bf getfloatvector(...)} \\ - {\bf getstringvector(...)} \\ - {\bf getpointervector(...)} \\ - -The parameters of the functions above are explained in -the the second part of {\bf Appendix~\ref{ftn_summary} } -(The extended Fortran API to LCIO). - -\subsubsection{Reading and writing LCIO files} - -Examples for reading and writing LCIO files can be found in: -\begin{verbatim} - src/f77 - simjob.F - recjob.F - anajob.F -\end{verbatim} -To build these examples, do: -\begin{verbatim} - gmake -C src/f77 -\end{verbatim} - -These examples correspond to that provided in \verb#$LCIO/src/cpp/src/EXAMPLE# for C++. \\ - -The complete interface is declared in the include file \verb#$LCIO/src/f77/lciof77api.inc#. -%$ -A simple example for reading an LCIO file with Fortran is: - -\begin{verbatim} - ... -#include "lciof77api.inc" -#include "lciof77apiext.inc" - - PTRTYPE reader, event, runhdr - integer status, irun, ievent - - reader = lcrdrcreate() - status = lcrdropen( reader, 'simjob.slcio' ) - - if( status.eq.LCIO_ERROR) then - goto 99 - endif - - do - event = lcrdrreadnextevent( reader ) - if( event.eq.0 ) goto 11 - - status = lcdumpevent( event ) - enddo - 11 continue - ... -\end{verbatim} -The function \verb$lcdumpevent(event)$ is part of the extended interface described in \ref{f77ext}. -Note that all functions that operate on existing objects have as a first argument the integer pointer -to this particluar object. -All functions that do not return a pointer to an object do return a status word instead that can be -compared to \verb$LCIO_ERROR$ (\verb$LCIO_SUCCESS$). - -An example how to write a LCIO file from Fortran is: - -\begin{verbatim} - ... - writer = lcwrtcreate() - status = lcwrtopen( writer, filename , LCIO_WRITE_NEW ) - - ... - do iev = 1,nev - - event = lcevtcreate() - - status = lcevtsetrunnumber( event, irun ) - status = lcevtseteventnumber( event, iev ) - - schcol = lccolcreate( LCIO_SIMCALORIMETERHIT ) - - do k=1,nhit - - hit = lcschcreate() - status = lcschsetcellid0( hit, 1234 ) - status = lcschsetenergy( hit, energy ) - - status = lccoladdelement( schcol, hit ) - enddo - - status = lcwrtwriteevent( writer , event ) - -c------- need to delete the event as we created it - status = lcevtdelete( event ) - - enddo - - status = lcevtaddcollection(event,schcol ,'MyCalHits') - - status = lcwrtclose( writer ) - ... -\end{verbatim} - -Note that as in the C++ case we have to delete the event if we created it as described in \ref{cppmem}. \\ - -\subsubsection{Using a C++ RunEventProcessor class for LCIO files processing in Fortran} - -A RunEventProcessor class is added to the Fortran API. To use it a wrapper function {\bf lcrdreventprocessor} -is provided which has to be called as: -\begin{verbatim} -... -#include "lciof77api.inc" - integer lcrdreventprocessor, status - character*30 filenamesin(3) - character*30 filenameout - PTRTYPE writer, pv - common /outinfo/ writer -... - filenamesin(1) = 'simjob_f1.slcio' - filenamesin(2) = 'simjob_f2.slcio' - filenamesin(3) = 'simjob_f3.slcio' - filenameout = 'recjob_f.slcio' -*** create writer, open output file - writer = lcwrtcreate() - status = lcwrtopen( writer, filenameout , LCIO_WRITE_NEW ) -*** create a stringvector of input file names - pv = lcstringvectorcreate( filenamesin, 3, len (filenamesin(1)) -*** create reader, open input file chain, start event loop - status = lcrdreventprocessor( pv ) -... - subroutine processrunheader ( pheader ) - PTRTYPE pheader -*** some code if wanted, e.g. - status = lcdumprunheader ( pheader ) - end - - subroutine modifyrunheader ( pheader ) - PTRTYPE pheader -*** some code if wanted - end - - subroutine processevent ( pevent ) - PTRTYPE pevent -*** some code if wanted - end - - subroutine modifyevent ( pevent ) -#include "lciof77api.inc" - PTRTYPE pevent - PTRTYPE writer - common /outinfo/ writer -... -*** some code if wanted -* -*** write event - status = lcwrtwriteevent ( writer, pevent ) -... - - end -\end{verbatim} - -The 4 subroutines {\bf processrunheader, modifyrunheader, processevent, and modifyevent} must be provided if -the wrapper function {\bf lcrdreventprocessor} is used. They are called via the LCRunListener, LCEventListener classes. -As an expample the code in \verb#$LCIO/src/f77/recjob.F# may be looked at. -The function \verb$lcdumprunheader(pheader)$ is part of the extended interface described in \ref{f77ext}. - diff --git a/src/latex/manual/f77summary.tex b/src/latex/manual/f77summary.tex deleted file mode 100644 index e7bd75935..000000000 --- a/src/latex/manual/f77summary.tex +++ /dev/null @@ -1,550 +0,0 @@ - -{\large\bf The basic Fortran API to LCIO} \\ - -\begin{scriptsize} - -{\bf Remarks:} \\ - -The return value of the functions and the meaning of arguments are either: \\ -$*$ pointers denoted by a name beginning with the {\bf letter p} \\ -$*$ character strings denoted by {\bf ...name} or {\bf string} \\ -$*$ logicals denoted by {\bf bool} \\ -$*$ integers denoted by {\bf status} or a variable name starting with {\bf i} or {\bf n}\\ -$*$ long integers (INTEGER*8) denoted by {\bf ilong}\\ -$*$ double precision variables name starting with {\bf d} \\ -$*$ reals {\bf else} -$*$ arrays are denoted by a name ending with {\bf v} \\ - - -\begin{verbatim} - -class LCReader: - -create -> preader = lcrdrcreate() -delete -> status = lcrdrdelete( preader ) -open -> status = lcrdropen( preader, filename ) -close -> status = lcrdrclose( preader ) -readStream -> status = lcrdrreadstream( preader, nmax ) -readNextRunHeader -> pheader = lcreadnextrunheader( preader, iaccessmode ) -readNextEvent -> pevent = lcrdrreadnextevent( preader, iaccessmode ) -readEvent -> pevent = lcrdrreadevent( preader, irun, ievt ) - -RunEventProcessor (includes registerLCEventListener, registerLCRunListener) - -> status = lcrdreventprocessor( filename ) - -class LCWriter: - -create -> pwriter = lcwrtcreate() -delete -> status = lcwrtdelete( pwriter ) -open -> status = lcwrtopen( pwriter, filename, imode ) -close -> status = lcwrtclose( pwriter ) -writeRunHeader -> status = lcwrtwriterunheader( pwriter, pheader ) -writeEvent -> status = lcwrtwriteevent( pwriter, pevent ) - - -class LCRunHeader: - -create -> pheader = lcrhdcreate() -delete -> status = lcrhddelete( pheader ) -setRunNumber -> status = lcrhdsetrunnumber( pheader ) -setDetectorName -> status = lcrhdsetdetectorname( pheader , detname) -setDescription -> status = lcrhdsetdescription( pheader , descrstring ) -addActiveSubdetector -> status = lcrhdaddactivesubdetector( pheader , sdname ) - -getRunNumber -> irun = lcrhgetrunnumber( pheader ) -getDetectorName -> detname = lcrhdgetdetectorname( pheader ) -getDescription -> string = lcrhdgetdescription( pheader ) - -getActiveSubdetectors by: -getActiveSubdetectors -> psdvec = lcrhdgetactivesubdetectors( pheader ) -getNumberOfElements -> nelem = lcsvcgetlength( psdvec ) (stl vector Interface) -getElementAt -> sdname = lcsvcgetstringat( psdvec , i ) (i=1,...,nelem) (stl vector Interface) - - -class LCEvent: - -create -> pevent = lcevtcreate() -delete -> status = lcevtdelete( pevent ) -setRunNumber -> status = lcevtsetrunnumber( pevent , irun) -setEventNumber -> status = lcevtseteventnumber( pevent , ievt) -setDetectorName -> status = lcevtsetdetectorname( pevent , detname) -setTimeStamp -> status = lcevtsettimestamp( pevent , ilong) -addCollection -> status = lcevtaddcollection( pevent , pcol , colname) -removeCollection -> status = lcevtremovecollection( pevent , colname) - -getRunNumber -> irun = lcevtgetrunnumber( pevent ) -getEventNumber -> ievt = lcevtgeteventnumber( pevent ) -getDetectorName -> detname = lcevtgetdetectorname( pevent ) -getTimeStamp -> ilong = lcevtgettimestamp( pevent ) -getCollection -> pcol = lcevtgetcollection( pevent , colname) - -getCollectionNames by: -getCollectionNames -> pstv = lcevtgetcollectionnames( pevent ) -getNumberOfElements -> nelem = lcsvcgetlength( pstv ) (stl vector Interface) -getElementAt -> colname = lcsvcgetstringat( pstv , i ) (i=1,...,nelem) (stl vector Interface) - - -class LCCollection: - -create -> pcol = lccolcreate( colname ) -delete -> status = lccoldelete( pcol ) -addElement -> status = lccoladdelement( pcol , pobject) -removeElementAt -> status = lccolremoveelementat ( pcol , i ) -setFlag -> status = lccolsetflag( pcol , iflag ) -setTransient -> status = lccolsettransient( pcol , bool ) (bool=true,false) - -getTypeName -> name = lccolgettypename( pcol ) -getNumberOfElements -> number = lccolgetnumberofelements( pcol ) -getElementAt -> pobject = lccolgetelementat( pcol , i ) (i=1,...,number) -getFlag -> iflag = lccolgetflag( pcol ) -isTransient -> bool = lccolistransient( pcol ) - - -class LCRelation, LCObject: - -create (defaults) -> prel = lcrelcreate0() -create -> prel = lcrelcreate( pobjectfrom , pobjectto, weight ) -delete -> status = lcreldelete( prel ) -setFrom -> status = lcrelsetfrom( prel, pobjectfrom ) -setTo -> status = lcrelsetto( prel, pobjectto ) -setWeight -> status = lcrelsetweight( prel, weight ) - -id -> id = lcrelid( prel ) -getFrom -> pfrom = lcrelgetfrom( prel ) -getTo -> pto = lcrelgetto( prel ) -getWeight -> weight = lcrelgetweight( prel ) - -getLength -> nelem = lcobvgetlength( pobjv ) (pobjv = pfrom, pto) -getObject -> id = lcobvgetobject( pobjv , i ) (i=1,...,nelem) -getObjectID -> id = lcobvgetobjectid( pobjv , i ) (i=1,...,nelem) -getWeight -> weight = lcobvgetweight( pobjv , i ) (i=1,...,nelem) - - -class LCRelationNavigator: - -create -> prnv = lcrnvcreate( fromname, toname ) -create (from col) -> prnv = lcrnvcreatefromcollection( pcol ) -delete -> status = lcrnvdelete() -addRelation -> status = lcrnvgaddrelation( prel, pobjectfrom , pobjectto, weight ) -removeRelation -> status = lcrnvgremoverelation( prel, pobjectfrom , pobjectto ) -createLCCollection -> pcol = lcrnvcreatecollection( prel ) - -getFromType -> namefr = lcrnvgetfromtype( prnv ) -getToType -> nameto = lcrnvgettotype( prnv ) -getRelatedToObjects -> pobjvto = lcrnvgetrelatedtoobjects( prnv, pobj ) -getRelatedFromObjects -> pobjvfr = lcrnvgetrelatedfromobjects( prnv, pobj ) -getRelatedToWeights -> pweightv= lcrnvgetrelatedtoweights( prnv, pobj ) -getRelatedFromWeights -> pweightv= lcrnvgetrelatedfromweights( prnv, pobj ) - - - -class LCGenericObject: - -create -> pgob = lcgobcreate() -create (dimensions) -> pgob = lcgobcreatefixed( nint, nfloat, ndouble ) -delete -> status = lcgobdelete( pgob ) -setIntVal -> status = lcgobsetintval( pgob, i, ival ) -setFloatVal -> status = lcgobsetfloatval( pgob, i, fval ) -setDoubleVal -> status = lcgobsetdoubleval( pgob, i, dval ) - -id -> id = lcgobid( pgob ) -getNInt -> nint = lcgobgetnint( pgob ) -getNFloat -> nfloat = lcgobgetnfloat( pgob ) -getNDouble -> ndouble = lcgobgetdoubleval( pgob ) -getIntVal -> ival = lcgobgetintval( pgob , i ) (i=1,...,nint) -getFloatVal -> fval = lcgobgetfloatval( pgob , i ) (i=1,...,nfloat) -getDoubleVal -> dval = lcgobsetdoubleval( pgob , i ) (i=1,...,ndouble) -isFixedSize -> bool = lcgobisfixedsize( pgob ) -getTypeName -> name = lcgobgettypename( pgob ) -getDataDescription -> string = lcgobgetdatadescription( pgob ) - - -class SimTrackerHit: - -create -> pthit = lcsthcreate() -delete -> status = lcsthdelete( pthit ) -setCellID -> status = lcsthsetcellid( pthit , icellid ) -setPosition -> status = lcsthsetposition( pthit , dposv ) -setdEdx -> status = lcsthsetdedx( pthit , fdedx ) -setEDep -> status = lcsthsetedep( pthit , fedep ) -setTime -> status = lcsthsettime( pthit , ftime ) -setMCParticle -> status = lcsthsetmcparticle( pthit , pmcp ) -setMomentum -> status = lcsthsetmomentum( pthit , fpv ) -setMomentumXYZ -> status = lcsthsetmomentumxyz( pthit , px, py, pz ) -setPathLength -> status = lcsthsetpathlength( pthit , pathl ) - -getCellID -> icellid = lcsthgetcellid( pthit ) -getPosition -> dposv(i)= lcsthgetposition( pthit , i ) (i=1,2,3) -getMomentum -> fpv(i) = lcsthgetmomentum( pthit , i ) (i=1,2,3) -getPathLength -> pathl = lcsthgetpathlength ( pthit ) -getdEdx -> fdedx = lcsthgetdedx( pthit ) -getEDep -> fedep = lcsthgetedep( pthit ) -getTime -> ftime = lcsthgettime( pthit ) -getMCParticle -> pmcp = lcsthgetmcparticle( pthit ) - - -class SimCalorimeterHit: - -create -> pschit = lcschcreate() -delete -> status = lcschdelete( pschit ) -setCellID0 -> status = lcschsetcellid0( pschit , icellid0 ) -setCellID1 -> status = lcschsetcellid1( pschit , icellid1 ) -setEnergy -> status = lcschsetenergy( pschit , energy ) -setPosition -> status = lcschsetposition( pschit , posv ) -addMCParticleContr.. -> status = lcschaddmcparticlecontribution( pschit , pmcp , energy , time , ipdg ) - -id -> id = lccahid( pschit ) -getCellID0 -> icellid0= lcschgetcellid0( pschit ) -getCellID1 -> icellid1= lcschgetcellid1( pschit ) -getEnergy -> energy = lcschgetenergy( pschit ) -getPosition -> status = lcschgetposition( pschit , posv ) -getNMCParticles -> number = lcschgetnmcparticles( pschit ) -getParticleCont -> pmcp = lcschgetparticlecont( pschit , i ) (i=1,...,number) -getEnergyCont -> energy = lcschgetenergycont( pschit , i ) (i=1,...,number) -getTimeCont -> time = lcschgettimecont( pschit , i ) (i=1,...,number) -getPDGCont -> ipdg = lcschgetpdgcont( pschit , i ) (i=1,...,number) - - -class CalorimeterHit: - -create -> pchit = lccahcreate() -delete -> status = lccahdelete( pchit ) -setCellID0 -> status = lccahsetcellid0( pchit , icellid0 ) -setCellID1 -> status = lccahsetcellid1( pchit , icellid1 ) -setEnergy -> status = lccahsetenergy( pchit , energy ) -setPosition -> status = lccahsetposition( pchit , posv ) -setTime -> status = lccahsettime( pchit , time ) -setType -> status = lccahsettype( pchit , itype ) -setRawHit -> status = lccahsetrawhit( pchit , praw ) - -id -> id = lccahid( pchit ) -getCellID0 -> icellid0= lccahgetcellid0( pchit ) -getCellID1 -> icellid1= lccahgetcellid1( pchit ) -getEnergy -> energy = lccahgetenergy( pchit ) -getPosition -> status = lccahgetposition( pchit , posv ) -getTime -> time = lccahgettime( pchit ) -getType -> itype = lccahgettype( pchit ) -getRawHit -> prawhit = lccahsetrawhit( pchit ) - - -class TPCHit: - -create -> pthit = lctphcreate() -delete -> status = lctphdelete( pthit ) -setCellID -> status = lctphsetcellid( pthit , icellid ) -setTime -> status = lctphsettime( pthit , time ) -setCharge -> status = lctphsetcharge( pthit , charge ) -setQuality -> status = lctphsetquality( pthit , iquality ) -setRawData -> status = lctphsetrawdata( pthit , irawv, nraw ) - -id -> id = lctphid( pthit ) -getCellID -> icellid = lctphgetcellid( pthit ) -getTime -> time = lctphgettime( pthit ) -getCharge -> charge = lctphgcharge( pthit ) -getQuality -> iquality= lctphgetquality( pthit ) -getNRawDataWords -> nraw = lctphgetnrawdatawords( pthit ) -getRawDataWord -> iword = lctphgetrawdataword( pthit, i ) (i=1,...,nraw) - - -class TrackerHit: - -create -> ptrhit = lctrhcreate() -delete -> status = lctrhdelete( ptrhit ) -setPosition -> status = lctrhsetposition( ptrhit, dposv ) -setCovMatrix -> status = lctrhsetcovmatrix( ptrhit, covmxv ) -setdEdx -> status = lctrhsetdedx( ptrhit , dedx ) -setEDep -> status = lctrhsetedep( ptrhit , edep ) -setEDepError -> status = lctrhsetedeperr( ptrhit , error ) -setTime -> status = lctrhsettime( ptrhit, time ) -setType -> status = lctrhsettype( ptrhit, itype ) -setQuality -> status = lctrhsetquality( ptrhit , iquality ) -addRawHit -> status = lctrhaddrawhit( ptrhit, prawh ) - -id -> id = lctrhid( ptrhit ) -getPosition -> status = lctrhgetposition( ptrhit, dposv ) -getCovMatrix -> status = lctrhsetcovmatrix( ptrhit, covmxv ) -getdEdx -> dedx = lctrhgetdedx( ptrhit ) -getEDep -> edep = lctrhgetedep( ptrhit ) -getEDepError -> edeperr = lctrhgetedeperr( ptrhit ) -getTime -> time = lctrhgettime( ptrhit ) -getType -> itype = lctrhgettype( ptrhit ) -getQuality -> iquality= lctrhgetquality( ptrhit ) -getRawHits -> prawhv = lctrhgetrawhits( ptrhit ) - - -class Track: - -create -> ptrk = lctrkcreate() -delete -> status = lctrkdelete( ptrk ) -setTypeBit -> status = lctrksettypebit( ptrk, ibit, ival) -setOmega -> status = lctrksetomega ( ptrk, omega ) -setTanLambda -> status = lctrksettanlambda( ptrk, tanlambda ) -setPhi -> status = lctrksetphi( ptrk, phi ) -setD0 -> status = lctrksetd0( ptrk, d0 ) -setZ0 -> status = lctrksetz0( ptrk, z0 ) -setCovMatrix -> status = lctrksetcovmatrix( ptrk, covmxv ) -setReferencePoint -> status = lctrksetreferencepoint( ptrk, refpointv ) -setChi2 -> status = lctrksetchi2( ptrk, chi2 ) -setNdf -> status = lctrksetndf( ptrk, ndf ) -setdEdx -> status = lctrksetdedx( ptrk, dedx ) -setdEdxError -> status = lctrksetdedxerror( ptrk, dedxerr ) -setNholes -> status = lctrksetnholes( ptrk, nholes ) -setRadiusOfInnermostHit-> status = lctrksetradiusofinnermosthit( ptrk, radius) -addTrack -> status = lctrkaddtrack( ptrk, ptrack ) -addHit -> status = lctrkaddhit( ptrk, phit ) -subdetectorHitNumbers -> status = lctrksetsubdetectorhitnumbers( ptrk, intv, nintv) (not in C++ API) -subdetectorHoleNumbers -> status = lctrksetsubdetectorholenumbers( ptrk, intv, nintv) (not in C++ API) - -id -> id = lctrkid( ptrk ) -getType -> itype = lctrkgettype( ptrk ) -getOmega -> omega = lctrkgetomega( ptrk ) -getTanLambda -> tanlam = lctrkgettanlambda( ptrk ) -getPhi -> phi = lctrkgetphi( ptrk ) -getD0 -> d0 = lctrkgetd0( ptrk ) -getZ0 -> z0 = lctrkgetz0( ptrk ) -getCovMatrix -> status = lctrkgetcovmatrix( ptrk, covmxv ) -getReferencePoint -> status = lctrkgetreferencepoint( ptrk, refpointv ) -getChi2 -> chi2 = lctrkgetchi2( ptrk ) -getNdf -> ndf = lctrkgetndf( ptrk ) -getdEdx -> dedx = lctrkgetdedx( ptrk ) -getdEdxError -> dedxerr = lctrkgetdedxerror( ptrk ) -getNholes -> nholes = lctrkgetnholes( ptrk ) -getRadiusOfInnermostHit-> radius = lctrkgetradiusofinnermosthit( ptrk ) -subdetectorHitNumbers -> status = lctrkgetsubdetectorhitnumbers( ptrk, intv, nintv) -subdetectorHoleNumbers -> status = lctrkgetsubdetectorholenumbers( ptrk, intv, nintv) -getTracks -> ptrackv = lctrkgettracks( ptrk ) -getTrackerHits -> ptrhitv = lctrkgettrackerhits( ptrk ) - - -class Cluster: - -create -> pclu = lcclucreate() -delete -> status = lccludelete( pclu ) -setTypeBit -> status = lcclusettypebit( pclu, ibit, ival) -setEnergy -> status = lcclusetenergy( pclu, energy ) -setPosition -> status = lcclusetposition( pclu, posv ) -setPositionError -> status = lcclusetpositionerror( pclu, poserrv ) -setITheta -> status = lcclusetitheta( pclu, theta ) -setIPhi -> status = lcclusetiphi( pclu, phi ) -setDirectionError -> status = lcclusetdirectionerror( pclu, direrrv ) -setShape -> status = lcclusetshape( pclu, pshapev ) -addParticleID -> status = lccluaddparticleid( pclu, ppid ) -addCluster -> status = lccluaddcluster( pclu, pcluadd ) -addHit -> status = lccluaddhit( pclu, pcalhit, weight ) -setsubdetectorEnergies -> status = lcclusetsubdetectorenergies( pclu, energiesv, nenergies) (not in C++ API) - -id -> id = lccluid( pclu ) -getType -> itype = lcclugettype( pclu ) -getEnergy -> energy = lcclugetenergy( pclu ) -getPosition -> status = lcclugetposition( pclu, posv ) -getPositionError -> status = lcclugetpositionerror( pclu, poserrv ) -getITheta -> theta = lcclugetitheta( pclu, theta ) -getIPhi -> phi = lcclugetiphi( pclu, phi ) -getDirectionError -> status = lcclugetdirectionerror( pclu, direrr ) -getShape -> pshapev = lcclugetshape( pclu ) -getParticleIDs -> ppidvec = lcclugetparticleids( pclu ) -getClusters -> pcluget = lcclugetclusters( pclu ) -getCalorimeterHits -> pcalhv = lcclugetcalorimeterhits( pclu ) -getSubdetectorEnergies -> pfloatv = lcclugetsubdetectorenergies( pclu ) -getHitContributions -> status = lcclugethitcontributions( pclu, energiesv, nenergies) (not in C++ API) - - - -class ReconstructedParticle: - -create -> prcp = lcrcpcreate() -delete -> status = lcrcpdelete( prcp ) -setType -> status = lcrcpsettype( prcp, itype ) -setMomentum -> status = lcrcpsetmomentum( prcp, xmomv ) -setEnergy -> status = lcrcpsetenergy( prcp, energy ) -setCovMatrix -> status = lcrcpsetcovmatrix( prcp, covmxv ) -setMass -> status = lcrcpsetmass( prcp, xmass ) -setCharge -> status = lcrcpsetcharge( prcp, charge ) ; -setReferencePoint -> status = lcrcpsetreferencepoint( prcp, refpointv ) ; -setGoodnessOfPID -> status lcrcpsetgoodnessofpid( prcp, goodns ) ; -addParticleID -> status = lcrcpaddparticleid( prcp, pid ) ; -addParticle -> status = lcrcpaddparticle( prcp, pparticle, weigth ) ; -addCluster -> status = lcrcpaddcluster( prcp, pclus, weigth ) ; -addTrack -> status = lcrcpaddtrack( prcp, ptrack, weigth ) ; - -id -> id = lcrcpid( prcp ) -getType -> itype = lcrcpgettype( prcp ) -isPrimary -> lprim = lcrcpisprimary( prcp ) (lprim = type logical) -getMomentum -> status = lcrcpgetmomentum( prcp, xmomv ) -getEnergy -> energy = lcrcpgetenergy( prcp ) -getCovMatrix -> status = lctrkgetcovmatrix( prcp, covmxv ) -getMass -> xmass = lcrcpgetmass( prcp ) -getCharge -> charge = lcrcpgetcharge( prcp ) -getReferencePoint -> status = lcrcpgetreferencepoint( prcp, refpointv ) -getGoodnessOfPID -> goodns = lcrcpgetgoodnessofpid( prcp ) -getParticleIDs -> pids = lcrcpgetparticleids( prcp ) -getParticles -> ppartv = lcrcpgetparticles( prcp ) -getClusters -> pclusv = lcrcpgetclusters( prcp ) -getTracks -> ptrkv = lcrcpgettracks( prcp ) - - -class ParticleID: - -create -> ppid = lcpidcreate() -delete -> status = lcpiddelete( ppid ) -setType -> status = lcpidsettype( ppid, idtype ) -setPDG -> status = lcpidsetpdg( ppid, ipdg ) -setLikelihood -> status = lcpidsetlikelihood( ppid, xlogl ) -setAlgorithmType -> status = lcpidsetalgorithmtype( ppid, itype ) -addParameter -> status = lcpidaddparameter( ppid, param ) - -id -> id = lcpidid( ppid ) -getType -> idtype = lcpidgettype( ppid ) -getPDG -> ipdg = lcpidgetpdg( ppid ) -getLikelihood -> xlogl = lcpidgetlikelihood( ppid ) -getAlgorithmType -> itype = lcpidgetalgorithmtype( ppid ) -getParameters -> status = lcpidgetparameters( ppid, paramv, nparam) - - -class MCParticle: - -create -> pmcp = lcmcpcreate() -delete -> status = lcmcpdelete( pmcp ) -addParent -> status = lcmcpaddparent( pmcp , pmcpp ) -setPDG -> status = lcmcpsetpdg( pmcp , ipdg ) -setGeneratorStatus -> status = lcmcpsetgeneratorstatus( pmcp , istatus ) -setSimulatorStatus -> status = lcmcpsetsimulatorstatus( pmcp , istatus ) -setVertex -> status = lcmcpsetvertex( pmcp , dvtxv ) -setEndpoint -> status = lcmcpsetendpoint( pmcp , dvtxv ) -setMomentum -> status = lcmcpsetmomentum( pmcp , momv ) -setMass -> status = lcmcpsetmass( pmcp , mass ) -setCharge -> status = lcmcpsetcharge( pmcp , charge ) - -getNumberOfParents -> number = lcmcpgetnumberofparents( pmcp ) -getParent -> pmcpp = lcmcpgetparent( pmcp , i ) -getNumberOfDaughters -> number = lcmcpgetnumberofdaughters( pmcp ) -getDaughter -> pmcpd = lcmcpgetdaughter( pmcp , i ) (i=1,...,number) -getPDG -> ipdg = lcmcpgetpdg( pmcp ) -getGeneratorStatus -> istatg = lcmcpgetgeneratorstatus( pmcp ) -getSimulatorStatus -> istats = lcmcpgetsimulatorstatus( pmcp ) -getVertex -> status = lcmcpgetvertex( pmcp , dvtxv ) -getEndpoint -> status = lcmcpgetendpoint( pmcp , dvtxv ) -getMomentum -> status = lcmcpgetmomentum( pmcp , dmomv ) -getEnergy -> denergy = lcmcpgetenergy( pmcp ) -getMass -> dmass = lcmcpgetmass( pmcp ) -getCharge -> charge = lcmcpgetcharge( pmcp ) - - - -utility: - -LCIntVec, LCFloatVec, LCStrVec classes: - -getLengthofIntVector -> nelem = lcivcgetlength( pintvec ) -getIntAt -> int = lcivcgetintat( pintvec , i ) (i=1,...,nelem) -getLengthofFloatVector -> nelem = lcfvcgetlength( pfloatvec ) -getFloatAt -> float = lcfvcgetfloatat( pfloatvec , i ) (i=1,...,nelem) -getLengthofStringVector-> nelem = lcsvcgetlength( pstrvec ) -getStringAt -> string = lcsvcgetstringat( pstrvec , i ) (i=1,...,nelem) - -stl vector class (int, float, string, pointer): - -IntVectorGetLength -> nelem = intvectorgetlength( pintvec ) -IntVectorGetElement -> int = intvectorgetelement( pintvec , i ) (i=1,...,nelem) -FloatVectorGetLength -> nelem = floatvectorgetlength( pfloatvec ) -FloatVectorGetElement -> float = floatvectorgetelement( pfloatvec , i ) (i=1,...,nelem) -StringVectorGetLength -> nelem = stringvectorgetlength( pstrvec ) -StringVectorGetElement -> string = stringvectorgetelement( pstrvec , i ) (i=1,...,nelem) -PointerVectorGetLength -> nelem = pointervectorgetlength( ppointervec ) -PointerVectorGetElement-> pointer = pointervectorgetelement( ppointervec , i ) (i=1,...,nelem) - -\end{verbatim} - -\end{scriptsize} - - - -\newpage -{\large\bf The extended Fortran API to LCIO} \\ - -\begin{scriptsize} - -{\bf Remarks:} \\ - -The return value of the functions and the meaning of arguments are either: \\ -$*$ pointers denoted by a name beginning with the {\bf letter p} \\ -$*$ character strings denoted by {\bf ...name} or {\bf string} \\ -$*$ integers denoted by {\bf status} or a variable name starting with {\bf i} or {\bf n} \\ -$*$ double precision variables denoted by a name starting with {\bf d} \\ -$*$ arrays denoted by a name ending with {\bf v} \\ -$*$ reals {\bf else} \\ -If arguments of the type {\bf array of character strings} are used the last -argument has to be the length of a character string in the array. \\ -Integers starting with n are also used to give the length of an array -(input/output argument for get... functions, input: dimension of the array, output: number of values stored). - - -\begin{verbatim} - -for class LCReader: - -lcrdropenchain -> status = lcrdropenchain(preader, filenamesv, nfiles, len(filenamesv(1))) - -for class LCRunHeader: - -writeRunHeader -> status = lcwriterunheader( pwriter, irun, detname, descrname, sdnamev, nsdn, len(sdnamev(1)) ) -readNextRunHeader -> pheader = lcreadnextrunheader( preader, irun, detname, descrname, sdnamev, nsdn, len(sdnamev(1)) ) - -for class LCEvent: - -setEventHeader -> status = lcseteventheader ( pevent, irun, ievt, itim, detname ) -getEventHeader -> status = lcgeteventheader ( pevent, irun, ievt, itim, detname ) -dumpEvent -> status = lcdumpevent ( pevent ) -dumpEventDetailed -> status = lcdumpeventdetailed ( pevent ) - -for class SimTrackerHit: - -addSimTrackerHit -> status = lcaddsimtrackerhit( pcolhitt, icellid, dposv, fdedx, ftime, pmcp ) -getSimTrackerHit -> status = lcgetsimtrackerhit( pcolhitt, i, icellid, dposv, fdedx, ftime, pmcp ) - -for class SimCalorimeterHit: - -addSimCaloHit -> phit = lcaddsimcalohit( pcolhitc, icellid0, icellid1, energy, posv ) -addSimCaloHitMCont -> status = lcschaddmcparticlecontribution( phit, pmcp, energy, time, ipdg ) (from basic f77 API) -getSimCaloHit -> phit = lcgetsimcalohit( pcolhitc, i, icellid0, icellid1, energy, posv ) -getSimCaloHitMCont -> status = lcgetsimcalohitmccont( phit, i, pmcp, energy, time, ipdg ) - -for class MCParticle: - -getMCParticleData -> status = lcgetmcparticledata ( pmcp, ipdg, igstat, isstat, dvtxv, momv, mass, charge, ndaughters ) - -for class HEPEVT (Fortran interface to COMMON /HEPEVT/ ): - -toHepEvt -> status = lcio2hepevt( pevent ) -fromHepEvt -> status = hepevt2lcio( pevent ) - -for the user extension classes (LCIntVec, LCFloatVec, LCStringVec): - -createIntVector -> pvec = lcintvectorcreate( intv, nint ) -createFloatVector -> pvec = lcfloatvectorcreate( floatv, nfloat ) -createStringVector -> pvec = lcstringvectorcreate( stringsv, nstrings, len(stringsv(1)) ) - -getIntVector -> status = lcgetintvector( pvec , intv, nintv ) -getFloatVector -> status = lcgetfloatvector( pvec , floatv , nfloatv ) -getStringVector -> status = lcgetstringvector( pvec , stringv , nstringv, len(stringv(1)) ) - -for the stl vector class (int, float ,string, pointer): - -IntVectorCreate -> pveci = intvectorcreate( intv, nintv ) -IntVectorDelete -> status = intvectordelete( pveci ) -FloatVectorCreate -> pvecf = floatvectorcreate( floatv , nfloatv ) -FloatVectorDelete -> status = floatvectordelete( pvecf ) -StringVectorCreate -> pvecs = stringvectorcreate( stringsv, nstrings, len(stringsv(1)) ) -StringVectorDelete -> status = stringvectordelete( pvecs ) -PointerVectorCreate -> pvecp = pointervectorcreate( pointerv, npointerv ) -PointerVectorDelete -> status = pointervectordelete( pvecp ) - -getIntVector -> status = getintvector( pveci , intv, nintv ) -getFloatVector -> status = getfloatvector( pvecf , floatv , nfloatv ) -getStringVector -> status = getstringvector( pvecs , stringv , nstringv, len(stringv(1)) ) -get PointerVector -> status = getpointervector( pvecp , pointerv, npointerv ) -\end{verbatim} - -\end{scriptsize} - - diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 064da0185..d915849f0 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -35,9 +35,9 @@ ADD_TEST( t_c_ana_c_rec "${EXECUTABLE_OUTPUT_PATH}/anajob" c_rec.slcio ) ADD_TEST( t_c_ana_no_ra "${EXECUTABLE_OUTPUT_PATH}/anajob" ${CMAKE_CURRENT_SOURCE_DIR}/data/test_no_random_access.slcio ) SET_TESTS_PROPERTIES( t_c_sim PROPERTIES PASS_REGULAR_EXPRESSION "created[ ]+10[ ]+runs with[ ]+100[ ]+events" ) -SET_TESTS_PROPERTIES( t_c_ana_c_sim PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) -SET_TESTS_PROPERTIES( t_c_rec_c_sim PROPERTIES PASS_REGULAR_EXPRESSION "'SomeClusters' and 'SomeTracks'.*to[ ]+100[ ]+events" ) -SET_TESTS_PROPERTIES( t_c_ana_c_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) +SET_TESTS_PROPERTIES( t_c_ana_c_sim PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" DEPENDS t_c_sim) +SET_TESTS_PROPERTIES( t_c_rec_c_sim PROPERTIES PASS_REGULAR_EXPRESSION "'SomeClusters' and 'SomeTracks'.*to[ ]+100[ ]+events" DEPENDS t_c_sim) +SET_TESTS_PROPERTIES( t_c_ana_c_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" DEPENDS t_c_rec_c_sim) SET_TESTS_PROPERTIES( t_c_ana_no_ra PROPERTIES PASS_REGULAR_EXPRESSION "10[ ]+events read from files" ) # ---------------------------------------------------------------------------- @@ -53,9 +53,9 @@ if( INSTALL_JAR ) ADD_TEST( t_j_ana_j_rec ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runAnalysisJob.sh j_rec.slcio ) SET_TESTS_PROPERTIES( t_j_sim PROPERTIES PASS_REGULAR_EXPRESSION "created[ ]+10[ ]+runs with[ ]+100[ ]+events" ) - SET_TESTS_PROPERTIES( t_j_ana_j_sim PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) - SET_TESTS_PROPERTIES( t_j_rec_j_sim PROPERTIES PASS_REGULAR_EXPRESSION "Analyzed[ ]+100[ ]+events" ) - SET_TESTS_PROPERTIES( t_j_ana_j_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) + SET_TESTS_PROPERTIES( t_j_ana_j_sim PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" DEPENDS t_j_sim) + SET_TESTS_PROPERTIES( t_j_rec_j_sim PROPERTIES PASS_REGULAR_EXPRESSION "Analyzed[ ]+100[ ]+events" DEPENDS t_j_sim) + SET_TESTS_PROPERTIES( t_j_ana_j_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" DEPENDS t_j_rec_j_sim) # ---------------------------------------------------------------------------- # ------ c++/java ana/sim mixed tests ---------------------------------------- @@ -64,10 +64,10 @@ if( INSTALL_JAR ) ADD_TEST( t_j_ana_c_sim ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runAnalysisJob.sh c_sim.slcio ) ADD_TEST( t_j_ana_c_rec ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runAnalysisJob.sh c_rec.slcio ) - SET_TESTS_PROPERTIES( t_c_ana_j_sim PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) - SET_TESTS_PROPERTIES( t_c_ana_j_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) - SET_TESTS_PROPERTIES( t_j_ana_c_sim PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) - SET_TESTS_PROPERTIES( t_j_ana_c_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) + SET_TESTS_PROPERTIES( t_c_ana_j_sim PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" DEPENDS t_j_sim) + SET_TESTS_PROPERTIES( t_c_ana_j_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" DEPENDS t_j_sim) + SET_TESTS_PROPERTIES( t_j_ana_c_sim PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" DEPENDS t_c_sim) + SET_TESTS_PROPERTIES( t_j_ana_c_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" DEPENDS t_c_rec_c_sim) # ---------------------------------------------------------------------------- # ------ c++/java sim/rec mixed tests ---------------------------------------- @@ -76,10 +76,10 @@ if( INSTALL_JAR ) ADD_TEST( t_c_ana_j2c_rec "${EXECUTABLE_OUTPUT_PATH}/anajob" j2c_rec.slcio ) ADD_TEST( t_c_ana_c2j_rec "${EXECUTABLE_OUTPUT_PATH}/anajob" c2j_rec.slcio ) - SET_TESTS_PROPERTIES( t_c_rec_j_sim PROPERTIES PASS_REGULAR_EXPRESSION "'SomeClusters' and 'SomeTracks'.*to[ ]+100[ ]+events" ) - SET_TESTS_PROPERTIES( t_j_rec_c_sim PROPERTIES PASS_REGULAR_EXPRESSION "Analyzed 100 events" ) - SET_TESTS_PROPERTIES( t_c_ana_j2c_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) - SET_TESTS_PROPERTIES( t_c_ana_c2j_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) + SET_TESTS_PROPERTIES( t_c_rec_j_sim PROPERTIES PASS_REGULAR_EXPRESSION "'SomeClusters' and 'SomeTracks'.*to[ ]+100[ ]+events" DEPENDS t_c_ana_j_sim) + SET_TESTS_PROPERTIES( t_j_rec_c_sim PROPERTIES PASS_REGULAR_EXPRESSION "Analyzed 100 events" DEPENDS t_c_sim) + SET_TESTS_PROPERTIES( t_c_ana_j2c_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" DEPENDS t_c_rec_j_sim) + SET_TESTS_PROPERTIES( t_c_ana_c2j_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" DEPENDS t_j_rec_c_sim) # ---------------------------------------------------------------------------- @@ -90,80 +90,35 @@ if( INSTALL_JAR ) ADD_TEST( t_j_sio_j_rec ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runSIODump.sh ${PROJECT_SOURCE_DIR}/doc/lcio.xml j_rec.slcio ) ADD_TEST( t_j_sio_j2c_rec ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runSIODump.sh ${PROJECT_SOURCE_DIR}/doc/lcio.xml j2c_rec.slcio ) ADD_TEST( t_j_sio_c2j_rec ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runSIODump.sh ${PROJECT_SOURCE_DIR}/doc/lcio.xml c2j_rec.slcio ) - SET_TESTS_PROPERTIES( t_j_sio_c_sim PROPERTIES PASS_REGULAR_EXPRESSION "Read 231 records with 0 warnings" ) - SET_TESTS_PROPERTIES( t_j_sio_c_rec PROPERTIES PASS_REGULAR_EXPRESSION "Read 213 records with 0 warnings" ) - SET_TESTS_PROPERTIES( t_j_sio_j_sim PROPERTIES PASS_REGULAR_EXPRESSION "Read 213 records with 0 warnings" ) - SET_TESTS_PROPERTIES( t_j_sio_j_rec PROPERTIES PASS_REGULAR_EXPRESSION "Read 213 records with 0 warnings" ) - SET_TESTS_PROPERTIES( t_j_sio_j2c_rec PROPERTIES PASS_REGULAR_EXPRESSION "Read 213 records with 0 warnings" ) - SET_TESTS_PROPERTIES( t_j_sio_c2j_rec PROPERTIES PASS_REGULAR_EXPRESSION "Read 213 records with 0 warnings" ) + SET_TESTS_PROPERTIES( t_j_sio_c_sim PROPERTIES PASS_REGULAR_EXPRESSION "Read 231 records with 0 warnings" DEPENDS t_c_sim ) + SET_TESTS_PROPERTIES( t_j_sio_c_rec PROPERTIES PASS_REGULAR_EXPRESSION "Read 213 records with 0 warnings" DEPENDS t_c_rec_c_sim ) + SET_TESTS_PROPERTIES( t_j_sio_j_sim PROPERTIES PASS_REGULAR_EXPRESSION "Read 213 records with 0 warnings" DEPENDS t_c_ana_j_sim ) + SET_TESTS_PROPERTIES( t_j_sio_j_rec PROPERTIES PASS_REGULAR_EXPRESSION "Read 213 records with 0 warnings" DEPENDS t_c_ana_j_rec ) + SET_TESTS_PROPERTIES( t_j_sio_j2c_rec PROPERTIES PASS_REGULAR_EXPRESSION "Read 213 records with 0 warnings" DEPENDS t_c_rec_j_sim ) + SET_TESTS_PROPERTIES( t_j_sio_c2j_rec PROPERTIES PASS_REGULAR_EXPRESSION "Read 213 records with 0 warnings" DEPENDS t_j_rec_c_sim ) # ---------------------------------------------------------------------------- endif() -IF( BUILD_F77_TESTJOBS ) - - ADD_DEPENDENCIES( tests f77 ) - - # ------ fortran tests --------------------------------------------------- - ADD_TEST( t_f_sim "${EXECUTABLE_OUTPUT_PATH}/simjob_F" f_sim.slcio ) - ADD_TEST( t_f_ana_f_sim "${EXECUTABLE_OUTPUT_PATH}/anajob_F" f_sim.slcio ) - ADD_TEST( t_f_rec_f_sim "${EXECUTABLE_OUTPUT_PATH}/recjob_F" f_sim.slcio f_rec.slcio ) - ADD_TEST( t_f_ana_f_rec "${EXECUTABLE_OUTPUT_PATH}/anajob_F" f_rec.slcio ) - - SET_TESTS_PROPERTIES( t_f_sim PROPERTIES PASS_REGULAR_EXPRESSION "created[ ]+10[ ]+runs with[ ]+100[ ]+events" ) - SET_TESTS_PROPERTIES( t_f_ana_f_sim PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) - SET_TESTS_PROPERTIES( t_f_rec_f_sim PROPERTIES PASS_REGULAR_EXPRESSION "'SomeClusters' and 'SomeTracks'.*to[ ]+100[ ]+events" ) - SET_TESTS_PROPERTIES( t_f_ana_f_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) - # ------------------------------------------------------------------------ - - - # ------ c++/fortran ana/sim mixed tests --------------------------------- - ADD_TEST( t_c_ana_f_sim "${EXECUTABLE_OUTPUT_PATH}/anajob" f_sim.slcio ) - ADD_TEST( t_c_ana_f_rec "${EXECUTABLE_OUTPUT_PATH}/anajob" f_rec.slcio ) - ADD_TEST( t_f_ana_c_sim "${EXECUTABLE_OUTPUT_PATH}/anajob_F" c_sim.slcio ) - ADD_TEST( t_f_ana_c_rec "${EXECUTABLE_OUTPUT_PATH}/anajob_F" c_rec.slcio ) - - SET_TESTS_PROPERTIES( t_c_ana_f_sim PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) - SET_TESTS_PROPERTIES( t_c_ana_f_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) - SET_TESTS_PROPERTIES( t_f_ana_c_sim PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) - SET_TESTS_PROPERTIES( t_f_ana_c_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) - # ------------------------------------------------------------------------ - - if( INSTALL_JAR ) - # ------ java/fortran ana/sim mixed tests -------------------------------- - ADD_TEST( t_j_ana_f_sim ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runAnalysisJob.sh f_sim.slcio ) - ADD_TEST( t_j_ana_f_rec ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runAnalysisJob.sh f_rec.slcio ) - ADD_TEST( t_f_ana_j_sim "${EXECUTABLE_OUTPUT_PATH}/anajob_F" j_sim.slcio ) - ADD_TEST( t_f_ana_j_rec "${EXECUTABLE_OUTPUT_PATH}/anajob_F" j_rec.slcio ) - - SET_TESTS_PROPERTIES( t_j_ana_f_sim PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) - SET_TESTS_PROPERTIES( t_j_ana_f_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) - SET_TESTS_PROPERTIES( t_f_ana_j_sim PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) - SET_TESTS_PROPERTIES( t_f_ana_j_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) - # ------------------------------------------------------------------------ - - ADD_TEST( t_j_sio_f_sim ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runSIODump.sh ${PROJECT_SOURCE_DIR}/doc/lcio.xml f_sim.slcio ) - ADD_TEST( t_j_sio_f_rec ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runSIODump.sh ${PROJECT_SOURCE_DIR}/doc/lcio.xml f_rec.slcio ) - SET_TESTS_PROPERTIES( t_j_sio_f_sim PROPERTIES PASS_REGULAR_EXPRESSION "Read 231 records with 0 warnings" ) - SET_TESTS_PROPERTIES( t_j_sio_f_rec PROPERTIES PASS_REGULAR_EXPRESSION "Read 213 records with 0 warnings" ) - - endif() - - - # ------ c++/fortran sim/rec mixed tests --------------------------------- - #ADD_TEST( t_c_rec_f_sim "${EXECUTABLE_OUTPUT_PATH}/recjob" f_sim.slcio f2c_rec.slcio ) - #ADD_TEST( t_f_rec_c_sim "${EXECUTABLE_OUTPUT_PATH}/recjob_F" c_sim.slcio c2f_rec.slcio ) - #ADD_TEST( t_c_ana_f2c_rec "${EXECUTABLE_OUTPUT_PATH}/anajob" f2c_rec.slcio ) - #ADD_TEST( t_c_ana_c2f_rec "${EXECUTABLE_OUTPUT_PATH}/anajob" c2f_rec.slcio ) - - #SET_TESTS_PROPERTIES( t_c_rec_f_sim PROPERTIES PASS_REGULAR_EXPRESSION "'SomeClusters' and 'SomeTracks'.*to[ ]+100[ ]+events" ) - #SET_TESTS_PROPERTIES( t_f_rec_c_sim PROPERTIES PASS_REGULAR_EXPRESSION "Analyzed 100 events" ) - #SET_TESTS_PROPERTIES( t_c_ana_f2c_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) - #SET_TESTS_PROPERTIES( t_c_ana_c2f_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) - # ------------------------------------------------------------------------ - +if( INSTALL_JAR ) + # ------ java/fortran ana/sim mixed tests -------------------------------- + ADD_TEST( t_j_ana_f_sim ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runAnalysisJob.sh f_sim.slcio ) + ADD_TEST( t_j_ana_f_rec ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runAnalysisJob.sh f_rec.slcio ) + ADD_TEST( t_f_ana_j_sim "${EXECUTABLE_OUTPUT_PATH}/anajob_F" j_sim.slcio ) + ADD_TEST( t_f_ana_j_rec "${EXECUTABLE_OUTPUT_PATH}/anajob_F" j_rec.slcio ) + + SET_TESTS_PROPERTIES( t_j_ana_f_sim PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) + SET_TESTS_PROPERTIES( t_j_ana_f_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) + SET_TESTS_PROPERTIES( t_f_ana_j_sim PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) + SET_TESTS_PROPERTIES( t_f_ana_j_rec PROPERTIES PASS_REGULAR_EXPRESSION "100[ ]+events read from files" ) + # ------------------------------------------------------------------------ + + ADD_TEST( t_j_sio_f_sim ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runSIODump.sh ${PROJECT_SOURCE_DIR}/doc/lcio.xml f_sim.slcio ) + ADD_TEST( t_j_sio_f_rec ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runSIODump.sh ${PROJECT_SOURCE_DIR}/doc/lcio.xml f_rec.slcio ) + SET_TESTS_PROPERTIES( t_j_sio_f_sim PROPERTIES PASS_REGULAR_EXPRESSION "Read 231 records with 0 warnings" ) + SET_TESTS_PROPERTIES( t_j_sio_f_rec PROPERTIES PASS_REGULAR_EXPRESSION "Read 213 records with 0 warnings" ) -ENDIF() +endif() IF( BUILD_ROOTDICT ) @@ -214,7 +169,11 @@ IF( BUILD_ROOTDICT ) SET_TESTS_PROPERTIES( t_root_anajob PROPERTIES PASS_REGULAR_EXPRESSION "50 events read from file" ) SET_TESTS_PROPERTIES( t_root_writeTree PROPERTIES PASS_REGULAR_EXPRESSION "50 events read from file" ) SET_TESTS_PROPERTIES( t_root_writeEventTree PROPERTIES PASS_REGULAR_EXPRESSION "50 events read from file" ) - SET_TESTS_PROPERTIES( t_root_readEventTree PROPERTIES PASS_REGULAR_EXPRESSION "50 events read from file" ) + SET_TESTS_PROPERTIES( t_root_readEventTree + PROPERTIES + PASS_REGULAR_EXPRESSION "50 events read from file" + DEPENDS t_root_writeEventTree + ) ENDIF() @@ -242,7 +201,7 @@ MACRO( ADD_LCIO_TEST file ) ADD_EXECUTABLE( ${file} EXCLUDE_FROM_ALL ../src/cpp/src/TESTS/${file}.cc ) ENDIF() ADD_DEPENDENCIES( tests ${file} ) - TARGET_LINK_LIBRARIES( ${file} lcio ) + TARGET_LINK_LIBRARIES( ${file} LCIO::lcio SIO::sio) ADD_TEST( t_${file} "${EXECUTABLE_OUTPUT_PATH}/${file}" ) SET_TESTS_PROPERTIES( t_${file} PROPERTIES PASS_REGULAR_EXPRESSION "TEST_PASSED" ) ENDMACRO() @@ -269,33 +228,34 @@ ADD_LCIO_TEST( test_lctrackercellid ) ADD_LCIO_TEST( test_lazy ) SET_TESTS_PROPERTIES( t_test_lazy PROPERTIES DEPENDS t_c_sim ) +SET_PROPERTY( TEST t_test_randomaccess APPEND PROPERTY DEPENDS t_c_sim ) if( INSTALL_JAR ) ADD_TEST( t_j_sio_calohit ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runSIODump.sh ${PROJECT_SOURCE_DIR}/doc/lcio.xml calohit.slcio ) - SET_TESTS_PROPERTIES( t_j_sio_calohit PROPERTIES PASS_REGULAR_EXPRESSION "Read 23 records with 0 warnings" ) + SET_TESTS_PROPERTIES( t_j_sio_calohit PROPERTIES PASS_REGULAR_EXPRESSION "Read 23 records with 0 warnings" DEPENDS t_test_calohit ) ADD_TEST( t_j_sio_cluster ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runSIODump.sh ${PROJECT_SOURCE_DIR}/doc/lcio.xml cluster.slcio ) - SET_TESTS_PROPERTIES( t_j_sio_cluster PROPERTIES PASS_REGULAR_EXPRESSION "Read 9 records with 0 warnings" ) + SET_TESTS_PROPERTIES( t_j_sio_cluster PROPERTIES PASS_REGULAR_EXPRESSION "Read 9 records with 0 warnings" DEPENDS t_test_cluster ) ADD_TEST( t_j_sio_tracks ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runSIODump.sh ${PROJECT_SOURCE_DIR}/doc/lcio.xml tracks.slcio ) - SET_TESTS_PROPERTIES( t_j_sio_tracks PROPERTIES PASS_REGULAR_EXPRESSION "Read 9 records with 0 warnings" ) + SET_TESTS_PROPERTIES( t_j_sio_tracks PROPERTIES PASS_REGULAR_EXPRESSION "Read 9 records with 0 warnings" DEPENDS t_test_tracks ) ADD_TEST( t_j_sio_trackerhits ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runSIODump.sh ${PROJECT_SOURCE_DIR}/doc/lcio.xml trackerhits.slcio ) - SET_TESTS_PROPERTIES( t_j_sio_trackerhits PROPERTIES PASS_REGULAR_EXPRESSION "Read 23 records with 0 warnings" ) + SET_TESTS_PROPERTIES( t_j_sio_trackerhits PROPERTIES PASS_REGULAR_EXPRESSION "Read 23 records with 0 warnings" DEPENDS t_test_trackerhit ) ADD_TEST( t_j_sio_trackerpulses ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runSIODump.sh ${PROJECT_SOURCE_DIR}/doc/lcio.xml trackerpulses.slcio ) - SET_TESTS_PROPERTIES( t_j_sio_trackerpulses PROPERTIES PASS_REGULAR_EXPRESSION "Read 23 records with 0 warnings" ) + SET_TESTS_PROPERTIES( t_j_sio_trackerpulses PROPERTIES PASS_REGULAR_EXPRESSION "Read 23 records with 0 warnings" DEPENDS t_test_trackerpulse ) ADD_TEST( t_j_sio_trackerhitplane ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runSIODump.sh ${PROJECT_SOURCE_DIR}/doc/lcio.xml trackerhitplane.slcio ) - SET_TESTS_PROPERTIES( t_j_sio_trackerhitplane PROPERTIES PASS_REGULAR_EXPRESSION "Read 9 records with 0 warnings" ) + SET_TESTS_PROPERTIES( t_j_sio_trackerhitplane PROPERTIES PASS_REGULAR_EXPRESSION "Read 9 records with 0 warnings" DEPENDS t_test_trackerhitplane ) ADD_TEST( t_j_sio_trackerhitzcylinder ${SH} "${LCIO_ENV_INIT}" ${PROJECT_SOURCE_DIR}/bin/runSIODump.sh ${PROJECT_SOURCE_DIR}/doc/lcio.xml trackerhitzcylinder.slcio ) - SET_TESTS_PROPERTIES( t_j_sio_trackerhitzcylinder PROPERTIES PASS_REGULAR_EXPRESSION "Read 9 records with 0 warnings" ) + SET_TESTS_PROPERTIES( t_j_sio_trackerhitzcylinder PROPERTIES PASS_REGULAR_EXPRESSION "Read 9 records with 0 warnings" DEPENDS t_test_trackerhitcylinder ) endif() FIND_PACKAGE( CLHEP QUIET ) IF( CLHEP_FOUND ) - INCLUDE_DIRECTORIES( ${CLHEP_INCLUDE_DIRS} ) + INCLUDE_DIRECTORIES( SYSTEM ${CLHEP_INCLUDE_DIRS} ) ADD_LCIO_TEST( test_fourvector) ELSE() MESSAGE( STATUS "cannot build test_fourvector: clhep not found" ) @@ -311,21 +271,21 @@ ENDIF( CLHEP_FOUND ) # ==== lcio_merge_files tests ======== ADD_TEST( t_lcio_merge_files "${EXECUTABLE_OUTPUT_PATH}/lcio_merge_files" merged.slcio splitting.000.slcio splitting.001.slcio splitting.002.slcio splitting.003.slcio splitting.004.slcio ) -SET_TESTS_PROPERTIES( t_lcio_merge_files PROPERTIES PASS_REGULAR_EXPRESSION "merged 40 events from 5 input files." ) +SET_TESTS_PROPERTIES( t_lcio_merge_files PROPERTIES PASS_REGULAR_EXPRESSION "merged 40 events from 5 input files." DEPENDS t_test_splitting ) # ==== lcio_event_counter tests ======== ADD_TEST( t_lcio_event_counter "${EXECUTABLE_OUTPUT_PATH}/lcio_event_counter" tracks.slcio ) -SET_TESTS_PROPERTIES( t_lcio_event_counter PROPERTIES PASS_REGULAR_EXPRESSION "3" ) +SET_TESTS_PROPERTIES( t_lcio_event_counter PROPERTIES PASS_REGULAR_EXPRESSION "3" DEPENDS t_test_tracks ) ADD_TEST( t_lcio_event_counter_splitting "${EXECUTABLE_OUTPUT_PATH}/lcio_event_counter" splitting.000.slcio splitting.001.slcio splitting.002.slcio splitting.003.slcio splitting.004.slcio ) -SET_TESTS_PROPERTIES( t_lcio_event_counter_splitting PROPERTIES PASS_REGULAR_EXPRESSION "40" ) +SET_TESTS_PROPERTIES( t_lcio_event_counter_splitting PROPERTIES PASS_REGULAR_EXPRESSION "40" DEPENDS t_test_splitting ) ADD_TEST( t_lcio_split_file_read "${EXECUTABLE_OUTPUT_PATH}/anajob" splitting.000.slcio splitting.001.slcio splitting.002.slcio splitting.003.slcio splitting.004.slcio ) -SET_TESTS_PROPERTIES( t_lcio_split_file_read PROPERTIES PASS_REGULAR_EXPRESSION "40[ ]+events read from files" ) +SET_TESTS_PROPERTIES( t_lcio_split_file_read PROPERTIES PASS_REGULAR_EXPRESSION "40[ ]+events read from files" DEPENDS t_test_splitting ) ADD_TEST( t_lcio_event_counter_merged "${EXECUTABLE_OUTPUT_PATH}/lcio_event_counter" merged.slcio ) -SET_TESTS_PROPERTIES( t_lcio_event_counter_merged PROPERTIES PASS_REGULAR_EXPRESSION "40" ) +SET_TESTS_PROPERTIES( t_lcio_event_counter_merged PROPERTIES PASS_REGULAR_EXPRESSION "40" DEPENDS t_lcio_merge_files ) @@ -336,50 +296,60 @@ ADD_TEST( t_check_col_elements_args2 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_e SET_TESTS_PROPERTIES( t_check_col_elements_args2 PROPERTIES PASS_REGULAR_EXPRESSION "error: wrong number of arguments" ) ADD_TEST( t_check_col_elements_nocol "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" NonExistingCollection tracks.slcio ) -SET_TESTS_PROPERTIES( t_check_col_elements_nocol PROPERTIES WILL_FAIL TRUE ) +SET_TESTS_PROPERTIES( t_check_col_elements_nocol PROPERTIES WILL_FAIL TRUE DEPENDS t_test_tracks ) ADD_TEST( t_check_col_elements_noopts "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" Tracks tracks.slcio ) -SET_TESTS_PROPERTIES( t_check_col_elements_noopts PROPERTIES PASS_REGULAR_EXPRESSION "found 30 Tracks element\\(s\\) in 3 event\\(s\\)" ) +SET_TESTS_PROPERTIES( t_check_col_elements_noopts PROPERTIES PASS_REGULAR_EXPRESSION "found 30 Tracks element\\(s\\) in 3 event\\(s\\)" DEPENDS t_test_tracks ) # one option at a time ADD_TEST( t_check_col_elements_minelements1 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" --minelements 10 Tracks tracks.slcio ) +SET_TESTS_PROPERTIES( t_check_col_elements_minelements1 PROPERTIES DEPENDS t_test_tracks ) ADD_TEST( t_check_col_elements_minelements2 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" --minelements 11 Tracks tracks.slcio ) -SET_TESTS_PROPERTIES( t_check_col_elements_minelements2 PROPERTIES WILL_FAIL TRUE ) +SET_TESTS_PROPERTIES( t_check_col_elements_minelements2 PROPERTIES WILL_FAIL TRUE DEPENDS t_test_tracks ) ADD_TEST( t_check_col_elements_maxelements1 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" --maxelements 10 Tracks tracks.slcio ) +SET_TESTS_PROPERTIES( t_check_col_elements_maxelements1 PROPERTIES DEPENDS t_test_tracks ) ADD_TEST( t_check_col_elements_maxelements2 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" --maxelements 09 Tracks tracks.slcio ) -SET_TESTS_PROPERTIES( t_check_col_elements_maxelements2 PROPERTIES WILL_FAIL TRUE ) +SET_TESTS_PROPERTIES( t_check_col_elements_maxelements2 PROPERTIES WILL_FAIL TRUE DEPENDS t_test_tracks ) ADD_TEST( t_check_col_elements_expelements1 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" --expelements 10 Tracks tracks.slcio ) ADD_TEST( t_check_col_elements_expelements2 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" --expelements 10 Tracks tracks.slcio cluster.slcio ) ADD_TEST( t_check_col_elements_expelements3 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" --expelements 11 Tracks tracks.slcio ) ADD_TEST( t_check_col_elements_expelements4 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" --expelements 09 Tracks tracks.slcio ) -SET_TESTS_PROPERTIES( t_check_col_elements_expelements3 PROPERTIES WILL_FAIL TRUE ) -SET_TESTS_PROPERTIES( t_check_col_elements_expelements4 PROPERTIES WILL_FAIL TRUE ) +SET_TESTS_PROPERTIES( t_check_col_elements_expelements1 PROPERTIES DEPENDS t_test_tracks ) +SET_TESTS_PROPERTIES( t_check_col_elements_expelements2 PROPERTIES DEPENDS t_test_tracks DEPENDS t_test_cluster ) +SET_TESTS_PROPERTIES( t_check_col_elements_expelements3 PROPERTIES WILL_FAIL TRUE DEPENDS t_test_tracks ) +SET_TESTS_PROPERTIES( t_check_col_elements_expelements4 PROPERTIES WILL_FAIL TRUE DEPENDS t_test_tracks ) # more options at once ADD_TEST( t_check_col_elements_abselementerror1 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" -n 4 -p -a -x 8 --abselementerror 1 Tracks tracks.slcio cluster.slcio ) ADD_TEST( t_check_col_elements_abselementerror2 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" -n 4 -p -a -x 9 --abselementerror 2 Tracks tracks.slcio cluster.slcio ) ADD_TEST( t_check_col_elements_abselementerror3 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" -n 4 -p -a -x 5 --abselementerror 2 Tracks tracks.slcio cluster.slcio ) -SET_TESTS_PROPERTIES( t_check_col_elements_abselementerror3 PROPERTIES WILL_FAIL TRUE ) +SET_TESTS_PROPERTIES( t_check_col_elements_abselementerror1 PROPERTIES DEPENDS t_test_tracks DEPENDS t_test_cluster ) +SET_TESTS_PROPERTIES( t_check_col_elements_abselementerror2 PROPERTIES DEPENDS t_test_tracks DEPENDS t_test_cluster ) +SET_TESTS_PROPERTIES( t_check_col_elements_abselementerror3 PROPERTIES WILL_FAIL TRUE DEPENDS t_test_tracks DEPENDS t_test_cluster ) ADD_TEST( t_check_col_elements_relelementerror1 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" -n 4 -p -a -x 7 --relelementerror .01 Tracks tracks.slcio cluster.slcio ) ADD_TEST( t_check_col_elements_relelementerror2 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" -n 4 -p -a -x 6 --relelementerror .3 Tracks tracks.slcio cluster.slcio ) ADD_TEST( t_check_col_elements_relelementerror3 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" -n 4 -p -a -x 5 --relelementerror .3 Tracks tracks.slcio cluster.slcio ) -SET_TESTS_PROPERTIES( t_check_col_elements_relelementerror3 PROPERTIES WILL_FAIL TRUE ) +SET_TESTS_PROPERTIES( t_check_col_elements_relelementerror1 PROPERTIES DEPENDS t_test_tracks DEPENDS t_test_cluster ) +SET_TESTS_PROPERTIES( t_check_col_elements_relelementerror2 PROPERTIES DEPENDS t_test_tracks DEPENDS t_test_cluster ) +SET_TESTS_PROPERTIES( t_check_col_elements_relelementerror3 PROPERTIES WILL_FAIL TRUE DEPENDS t_test_tracks DEPENDS t_test_cluster ) ADD_TEST( t_check_col_elements_abseventerror1 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" -p -x 10 --abseventerror 3 Tracks tracks.slcio cluster.slcio ) ADD_TEST( t_check_col_elements_abseventerror2 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" -p -x 10 --abseventerror 2 Tracks tracks.slcio cluster.slcio ) -SET_TESTS_PROPERTIES( t_check_col_elements_abseventerror2 PROPERTIES WILL_FAIL TRUE ) +SET_TESTS_PROPERTIES( t_check_col_elements_abseventerror1 PROPERTIES DEPENDS t_test_tracks DEPENDS t_test_cluster ) +SET_TESTS_PROPERTIES( t_check_col_elements_abseventerror2 PROPERTIES WILL_FAIL TRUE DEPENDS t_test_tracks DEPENDS t_test_cluster ) ADD_TEST( t_check_col_elements_releventerror1 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" -p -x 10 --releventerror .5 Tracks tracks.slcio cluster.slcio ) ADD_TEST( t_check_col_elements_releventerror2 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" -p -x 10 --releventerror .4 Tracks tracks.slcio cluster.slcio ) -SET_TESTS_PROPERTIES( t_check_col_elements_releventerror2 PROPERTIES WILL_FAIL TRUE ) +SET_TESTS_PROPERTIES( t_check_col_elements_releventerror1 PROPERTIES DEPENDS t_test_tracks DEPENDS t_test_cluster ) +SET_TESTS_PROPERTIES( t_check_col_elements_releventerror2 PROPERTIES WILL_FAIL TRUE DEPENDS t_test_tracks DEPENDS t_test_cluster ) ADD_TEST( t_check_col_elements_maxevents1 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" --maxevents 4 Tracks tracks.slcio cluster.slcio ) ADD_TEST( t_check_col_elements_maxevents2 "${EXECUTABLE_OUTPUT_PATH}/lcio_check_col_elements" --startevent 2 --maxevents 2 Tracks tracks.slcio cluster.slcio ) -SET_TESTS_PROPERTIES( t_check_col_elements_maxevents1 PROPERTIES PASS_REGULAR_EXPRESSION "found 30 Tracks element\\(s\\) in 4 event\\(s\\)" ) -SET_TESTS_PROPERTIES( t_check_col_elements_maxevents2 PROPERTIES PASS_REGULAR_EXPRESSION "found 10 Tracks element\\(s\\) in 2 event\\(s\\)" ) +SET_TESTS_PROPERTIES( t_check_col_elements_maxevents1 PROPERTIES PASS_REGULAR_EXPRESSION "found 30 Tracks element\\(s\\) in 4 event\\(s\\)" DEPENDS t_test_tracks DEPENDS t_test_cluster ) +SET_TESTS_PROPERTIES( t_check_col_elements_maxevents2 PROPERTIES PASS_REGULAR_EXPRESSION "found 10 Tracks element\\(s\\) in 2 event\\(s\\)" DEPENDS t_test_tracks DEPENDS t_test_cluster ) # ============================================================================ diff --git a/tests/downstream-project-cmake-test/CMakeLists.txt b/tests/downstream-project-cmake-test/CMakeLists.txt new file mode 100644 index 000000000..77f70f5c2 --- /dev/null +++ b/tests/downstream-project-cmake-test/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.14) + +project(DownstreamProjectUsingLCIO) + +find_package(LCIO REQUIRED) + +# Make sure that the LCIO version is set and usableas a version +if (${LCIO_VERSION} VERSION_GREATER "0.0.0") + message(STATUS "Found LCIO version " ${LCIO_VERSION}) +else() + message(FATAL_ERROR "Cannot determine LCIO_VERSION") +endif() + +add_executable(lcio_test_program lcio_test_program.cpp) +target_link_libraries(lcio_test_program PRIVATE LCIO::lcio) diff --git a/tests/downstream-project-cmake-test/lcio_test_program.cpp b/tests/downstream-project-cmake-test/lcio_test_program.cpp new file mode 100644 index 000000000..a53be69fa --- /dev/null +++ b/tests/downstream-project-cmake-test/lcio_test_program.cpp @@ -0,0 +1,22 @@ +#include "EVENT/LCEvent.h" +#include "IMPL/LCCollectionVec.h" +#include "IMPL/LCEventImpl.h" +#include "IMPL/MCParticleImpl.h" +#include "MT/LCWriter.h" + +int main() { + auto mcp = new IMPL::MCParticleImpl(); + mcp->setPDG(11); + + auto coll = new IMPL::LCCollectionVec(EVENT::LCIO::MCPARTICLE); + coll->addElement(mcp); + + auto event = new IMPL::LCEventImpl(); + event->addCollection(coll, "mcps"); + + auto writer = MT::LCWriter(); + writer.open("test.slcio"); + writer.writeEvent(event); + + return 0; +}