Skip to content

Commit

Permalink
major refurbishment of podio; new interfaces in doc/doc.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hegner committed Oct 13, 2015
1 parent fef240c commit ec982b8
Show file tree
Hide file tree
Showing 85 changed files with 1,337 additions and 168 deletions.
54 changes: 38 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,50 @@
cmake_minimum_required(VERSION 2.8)

project(podio)
set( podio_VERSION_MAJOR 0 )
set( podio_VERSION_MINOR 1 )
set( podio_VERSION_PATCH 0 )
set( podio_VERSION "${podio_VERSION_MAJOR}.${podio_VERSION_MINOR}" )

set(CMAKE_BUILD_TYPE Release)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

# Declare ROOT dependency

#--- Declare ROOT dependency ---------------------------------------------------
list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
find_package(ROOT REQUIRED COMPONENTS RIO Tree)
include(${ROOT_USE_FILE})

add_definitions(-Wno-unused-variable -Wno-unused-parameter)
add_definitions(-Wno-unused-variable -Wno-unused-parameter -pthread)
#add_definitions(-Wpadded)

#--temporary fix of inconsistency in ROOT CMake macros
set(ROOT_genreflex_cmd ${ROOT_genreflex_CMD})

add_definitions(-Wno-unused-variable -Wno-unused-parameter)

#--- enable unit testing capabilities ------------------------------------------
include(CTest)

#--- enable CPack --------------------------------------------------------------
include(cmake/podioCPack.cmake)

#--- target for Doxygen documentation ------------------------------------------
include(cmake/podioDoxygen.cmake)

#--- add version files ---------------------------------------------------------
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/podioVersion.h
${CMAKE_CURRENT_BINARY_DIR}/podioVersion.h )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/podioVersion.h
DESTINATION ${CMAKE_INSTALL_PREFIX}/include/podio )

#--- add CMake infrastructure --------------------------------------------------
include(cmake/podioCreateConfig.cmake)

#--- add license files ---------------------------------------------------------
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE
${CMAKE_CURRENT_SOURCE_DIR}/NOTICE
DESTINATION ${CMAKE_INSTALL_PREFIX})

#--- project specific subdirectories -------------------------------------------
add_subdirectory(src)
add_subdirectory(examples)

#--- target for Doxygen documentation-------------------

find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/documentation/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif(DOXYGEN_FOUND)
add_subdirectory(tests)
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(c) Copyright 2015 Benedikt Hegner

This software is distributed under the terms of the GNU General Public
Licence version 3 (GPL Version 3), copied verbatim in the file "LICENCE".
18 changes: 18 additions & 0 deletions PodioConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# - Config file for the FooBar package
# It defines the following variables
# FOOBAR_INCLUDE_DIRS - include directories for FooBar
# FOOBAR_LIBRARIES - libraries to link against
# FOOBAR_EXECUTABLE - the bar executable

# Compute paths
get_filename_component(FOOBAR_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(FOOBAR_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")

# Our library dependencies (contains definitions for IMPORTED targets)
if(NOT TARGET foo AND NOT FooBar_BINARY_DIR)
include("${FOOBAR_CMAKE_DIR}/FooBarTargets.cmake")
endif()

# These are IMPORTED targets created by FooBarTargets.cmake
set(FOOBAR_LIBRARIES foo)
set(FOOBAR_EXECUTABLE bar)
11 changes: 11 additions & 0 deletions PodioConfigVersion.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
set(PACKAGE_VERSION "@FOOBAR_VERSION@")

# Check whether the requested PACKAGE_FIND_VERSION is compatible
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()
44 changes: 44 additions & 0 deletions cmake/podioCPack.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
set(CPACK_PACKAGE_DESCRIPTION "podio Project")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "podio Project")
set(CPACK_PACKAGE_VENDOR "HEP Software Foundation")
set(CPACK_PACKAGE_VERSION ${podio_VERSION})
set(CPACK_PACKAGE_VERSION_MAJOR ${podio_MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR ${podio_MINOR_VERSION})
set(CPACK_PACKAGE_VERSION_PATCH ${podio_PATCH_VERSION})

set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md")

#--- source package settings ---------------------------------------------------
set(CPACK_SOURCE_IGNORE_FILES
${PROJECT_BINARY_DIR}
"~$"
"/.git/"
"/\\\\\\\\.git/"
"/#"
)
set(CPACK_SOURCE_STRIP_FILES "")

#--- translate buildtype -------------------------------------------------------
string( TOLOWER "${CMAKE_BUILD_TYPE}" buildtype_lower )
if(buildtype_lower STREQUAL "release")
set(HSF_BUILDTYPE "opt")
elseif(buildtype_lower STREQUAL "debug")
set(HSF_BUILDTYPE "dbg")
elseif(buildtype_lower STREQUAL "relwithbebinfo")
set(HSF_BUILDTYPE "owd")
endif()


#--- use HSF platform name -----------------------------------------------------
execute_process(
COMMAND hsf_get_platform.py --buildtype ${HSF_BUILDTYPE}
OUTPUT_VARIABLE HSF_PLATFORM OUTPUT_STRIP_TRAILING_WHITESPACE)


set(CPACK_PACKAGE_RELOCATABLE True)
set(CPACK_PACKAGE_INSTALL_DIRECTORY "podio_${podio_VERSION}")
set(CPACK_PACKAGE_FILE_NAME "podio_${podio_VERSION}_${HSF_PLATFORM}")

include(CPack)
15 changes: 15 additions & 0 deletions cmake/podioConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# - Config file for the podio package
# It defines the following variables
# podio_INCLUDE_DIRS - include directories
# podio_LIBRARIES - libraries to link against
# podio_LIBRARY_DIR - podio library dir
# podio_BINARY_DIR - binary directory

# Compute paths
get_filename_component(podio_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)

get_filename_component(podio_INCLUDE_DIRS "${podio_CMAKE_DIR}/../include" ABSOLUTE)
get_filename_component(podio_BINARY_DIR "${podio_CMAKE_DIR}/../bin" ABSOLUTE)
get_filename_component(podio_LIBRARY_DIR "${podio_CMAKE_DIR}/../lib" ABSOLUTE)

ADD_LIBRARY(examplelibrary SHARED IMPORTED)
9 changes: 9 additions & 0 deletions cmake/podioCreateConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
include(CMakePackageConfigHelpers)
configure_file(cmake/podioConfig.cmake.in "${PROJECT_BINARY_DIR}/podioConfig.cmake" @ONLY)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/podioConfigVersion.cmake
VERSION ${podio_VERSION}
COMPATIBILITY SameMajorVersion )

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/podioConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/podioConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_PREFIX}/cmake )
11 changes: 11 additions & 0 deletions cmake/podioDoxygen.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM)

install( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doxygen DESTINATION doxygen OPTIONAL)
endif(DOXYGEN_FOUND)
File renamed without changes.
4 changes: 4 additions & 0 deletions documentation/doc.md → doc/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ Using this definition, four classes will be created: `EventInfo`, `EventInfoData
...
}

### Defining members and transient members

The library supports both the usage of (persistent) members and transient members via the following syntax:

### Definition of references between objects:
to be written

Expand Down
2 changes: 1 addition & 1 deletion include/podio/IReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
This class has the function to read available data from disk
and to prepare collections and buffers.
*/
*/

namespace podio {

Expand Down
5 changes: 4 additions & 1 deletion include/podio/ROOTReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
#define ROOTREADER_H

#include <algorithm>
#include <map>
#include <string>
#include <vector>

// forward declarations
class TClass;
class TFile;
class TTree;

Expand All @@ -18,7 +20,7 @@ class TTree;
This class has the function to read available data from disk
and to prepare collections and buffers.
*/
*/


namespace podio {
Expand Down Expand Up @@ -65,6 +67,7 @@ class ROOTReader : public IReader {
private:
typedef std::pair<CollectionBase*, std::string> Input;
std::vector<Input> m_inputs;
std::map<std::string, std::pair<TClass*,TClass*> > m_storedClasses;
CollectionIDTable* m_table;
TFile* m_file;
TTree* m_eventTree;
Expand Down
6 changes: 3 additions & 3 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ export PATH=/afs/cern.ch/sw/lcg/contrib/CMake/2.8.9/Linux-i386/bin:${PATH}
source /afs/cern.ch/sw/lcg/contrib/gcc/4.8.1/x86_64-slc6/setup.sh
source /afs/cern.ch/sw/lcg/app/releases/ROOT/6.02.08/x86_64-slc6-gcc48-opt/root/bin/thisroot.sh

export ALBERS=$PWD/install
export LD_LIBRARY_PATH=$ALBERS/examples:$ALBERS/lib:$LD_LIBRARY_PATH
export PYTHONPATH=$ALBERS/examples:$PYTHONPATH
export PODIOHOME=$PWD/install
export LD_LIBRARY_PATH=$PODIO/examples:$PODIOHOME/lib:$LD_LIBRARY_PATH
export PYTHONPATH=$PODIOHOME/examples:$PYTHONPATH
6 changes: 3 additions & 3 deletions init_macos.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export ALBERS=$PWD/install
export DYLD_LIBRARY_PATH=$ALBERS/examples:$ALBERS/lib:$DYLD_LIBRARY_PATH
export PYTHONPATH=$ALBERS/examples:$PYTHONPATH
export PODIO=$PWD/install
export DYLD_LIBRARY_PATH=$PODIO/examples:$PODIO/lib:$DYLD_LIBRARY_PATH
export PYTHONPATH=$PODIO/examples:$PYTHONPATH
2 changes: 1 addition & 1 deletion lcio/datalayout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ datatypes :
OneToOneRelations:
- TrackerData corrData // ...

# LCIO TrackerRawData
# LCIO TrackerRawData
TrackerData:
description: "LCIO tracker raw data"
author : "F.Gaede, B. Hegner"
Expand Down
4 changes: 4 additions & 0 deletions podioVersion.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#ifndef podioVersion_h
#define podioVersion_h
#define podio_VERSION @podio_VERSION@
#endif
Loading

0 comments on commit ec982b8

Please sign in to comment.