Skip to content
This repository has been archived by the owner on Oct 17, 2023. It is now read-only.

Commit

Permalink
WIP: rename from K4 to k4 (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirguest authored Nov 26, 2020
1 parent c27fbd6 commit c607b37
Show file tree
Hide file tree
Showing 13 changed files with 124 additions and 124 deletions.
30 changes: 15 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.8)

project(K4LCIOReader VERSION 0.0.1)
project(k4LCIOReader VERSION 0.0.1)

find_package(LCIO REQUIRED)
find_package(podio REQUIRED)
Expand All @@ -20,35 +20,35 @@ message (STATUS "C++ standard: ${CMAKE_CXX_STANDARD}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -DDROP_CGAL ${CPP_STANDARD_FLAGS} -Wall -Wextra -Wpedantic -Wno-unused-variable -Wno-unused-parameter")

#--- add version files ---------------------------------------------------------
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/K4LCIOReaderVersion.h
${CMAKE_CURRENT_BINARY_DIR}/K4LCIOReaderVersion.h )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/K4LCIOReaderVersion.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/K4LCIOReader )
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/k4LCIOReaderVersion.h
${CMAKE_CURRENT_BINARY_DIR}/k4LCIOReaderVersion.h )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/k4LCIOReaderVersion.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/k4LCIOReader )

#--- add CMake infrastructure --------------------------------------------------
include(cmake/K4LCIOReaderCreateConfig.cmake)
include(cmake/k4LCIOReaderCreateConfig.cmake)

# - library K4LCIOReader
# - library k4LCIOReader
file(GLOB sources src/*.cc)
add_library(K4LCIOReader SHARED ${sources})
target_include_directories(K4LCIOReader PUBLIC
add_library(k4LCIOReader SHARED ${sources})
target_include_directories(k4LCIOReader PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
${podio_INCLUDE_DIR}
${EDM4HEP_INCLUDE_DIR}
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
target_link_libraries(K4LCIOReader ${LCIO_LIBRARIES} podio::podio ${EDM4HEP_DIR}/../../libedm4hep.so)
target_compile_options(K4LCIOReader PRIVATE -pthread)
target_link_libraries(k4LCIOReader ${LCIO_LIBRARIES} podio::podio ${EDM4HEP_DIR}/../../libedm4hep.so)
target_compile_options(k4LCIOReader PRIVATE -pthread)

# - test
add_executable(read_lcio test/read_lcio.cc)
target_include_directories(read_lcio PUBLIC
${PROJECT_SOURCE_DIR}/include
${podio_INCLUDE_DIR})
target_link_libraries(read_lcio K4LCIOReader)
target_link_libraries(read_lcio k4LCIOReader)
#add_test(NAME read_lcio COMMAND read_lcio)

# - install
install(TARGETS K4LCIOReader
EXPORT K4LCIOReaderTargets
install(TARGETS k4LCIOReader
EXPORT k4LCIOReaderTargets
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/K4LCIOReader DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/k4LCIOReader DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
4 changes: 0 additions & 4 deletions K4LCIOReaderVersion.h

This file was deleted.

12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# K4LCIOReader
# k4LCIOReader

Generate EDM4hep collections from LCIO format data.

`K4LCIOReader` is a subclass that inherits from `podio::IReader`. And it holds an instance of `LCIO::LCReader`.
`k4LCIOReader` is a subclass that inherits from `podio::IReader`. And it holds an instance of `LCIO::LCReader`.

![K4LCIOReader](K4LCIOReader.png)
![k4LCIOReader](k4LCIOReader.png)

Some converters (from LCCollection to EDM4hep collection) are still being in developing.

There is also an algorithm wrapper [LCIOInput](https://github.com/ihep-sft-group/LCIOInput), by which we can read LCIO with key4hep/K4FWCore in Gaudi.
There is also an algorithm wrapper [LCIOInput](https://github.com/ihep-sft-group/LCIOInput), by which we can read LCIO with key4hep/k4FWCore in Gaudi.

## Dependencies

Expand All @@ -21,8 +21,8 @@ There is also an algorithm wrapper [LCIOInput](https://github.com/ihep-sft-group
Suppose environment has been set properly, so that all dependencies can be found by CMake.

```shell
git clone https://github.com/ihep-sft-group/K4LCIOReader.git
cd K4LCIOReader; mkdir build; cd build
git clone https://github.com/key4hep/k4LCIOReader.git
cd k4LCIOReader; mkdir build; cd build
cmake ..
make
```
Expand Down
30 changes: 0 additions & 30 deletions cmake/K4LCIOReaderCreateConfig.cmake

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# - Config file for the K4LCIOReader package
# - Config file for the k4LCIOReader package

# - Define exported version
set(K4LCIOReader_VERSION "@PROJECT_VERSION@")
set(k4LCIOReader_VERSION "@PROJECT_VERSION@")

# - Init CMakePackageConfigHelpers
@PACKAGE_INIT@

# - Create relocatable paths to headers.
# NOTE: Do not strictly need paths as all usage requirements are encoded in
# the imported targets created later.
set_and_check(K4LCIOReader_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
set_and_check(k4LCIOReader_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")

include(CMakeFindDependencyMacro)
find_dependency(LCIO REQUIRED)
Expand All @@ -18,5 +18,5 @@ find_dependency(EDM4HEP REQUIRED)

# - Include the targets file to create the imported targets that a client can
# link to (libraries) or execute (programs)
include("${CMAKE_CURRENT_LIST_DIR}/K4LCIOReaderTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/k4LCIOReaderTargets.cmake")

30 changes: 30 additions & 0 deletions cmake/k4LCIOReaderCreateConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# - Use CMake's module to help generating relocatable config files
include(CMakePackageConfigHelpers)

# - Versioning
write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/k4LCIOReaderConfigVersion.cmake
VERSION ${k4LCIOReader_VERSION}
COMPATIBILITY SameMajorVersion)

# - Install time config and target files
configure_package_config_file(${CMAKE_CURRENT_LIST_DIR}/k4LCIOReaderConfig.cmake.in
"${PROJECT_BINARY_DIR}/k4LCIOReaderConfig.cmake"
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/k4LCIOReader"
PATH_VARS
CMAKE_INSTALL_BINDIR
CMAKE_INSTALL_INCLUDEDIR
CMAKE_INSTALL_LIBDIR
)

# - install and export
install(FILES
"${PROJECT_BINARY_DIR}/k4LCIOReaderConfigVersion.cmake"
"${PROJECT_BINARY_DIR}/k4LCIOReaderConfig.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/k4LCIOReader"
)
install(EXPORT k4LCIOReaderTargets
NAMESPACE k4LCIOReader::
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/k4LCIOReader"
)

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef K4_LCIOREADER_H
#define K4_LCIOREADER_H
#ifndef k4_LCIOREADER_H
#define k4_LCIOREADER_H

#include "podio/IReader.h"
#include "podio/CollectionIDTable.h"
Expand All @@ -18,15 +18,15 @@ class EventStore;
class GenericParameters;
}
// others
class K4LCIOConverter;
class k4LCIOConverter;

class K4LCIOReader : public podio::IReader
class k4LCIOReader : public podio::IReader
{
friend podio::EventStore;

public:
K4LCIOReader();
~K4LCIOReader();
k4LCIOReader();
~k4LCIOReader();

void open(const std::string &filename);
void open(const std::vector<std::string> &filenames);
Expand Down Expand Up @@ -72,14 +72,14 @@ class K4LCIOReader : public podio::IReader
IO::LCReader *m_reader;

//the converter
K4LCIOConverter *m_converter;
k4LCIOConverter *m_converter;

///...
podio::CollectionIDTable *m_table;
};

template <typename T>
T *K4LCIOReader::getCollection(const std::string &name)
T *k4LCIOReader::getCollection(const std::string &name)
{
auto p = dynamic_cast<T *>(readCollection(name));
if (p == nullptr)
Expand Down
File renamed without changes
4 changes: 4 additions & 0 deletions k4LCIOReaderVersion.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#ifndef k4LCIOReaderVersion_h
#define k4LCIOReaderVersion_h
#define k4LCIOReader_VERSION @k4LCIOReader_VERSION@
#endif
Loading

0 comments on commit c607b37

Please sign in to comment.