Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@
build
athena
sim/macro/tmp*.mac

# macOs
.DS_STORE
109 changes: 64 additions & 45 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)

project(IRT
VERSION 1.0.2
VERSION 2.0.0
LANGUAGES CXX
)

cmake_policy(SET CMP0079 NEW) # allow `target_link_libraries` from any dir

#----------------------------------------------------------------------------
# options
option(EVALUATION "Build evaluation programs" OFF)
option(DELPHES "Delphes card production" ON)
option(EVALUATION "Build evaluation programs" OFF)
option(DELPHES "Delphes card production" ON)
option(IRT_ROOT_IO "Generate dictionary for ROOT I/O of libIRT objects" ON)

#----------------------------------------------------------------------------
# dependencies

find_package(ROOT 6.0.00 REQUIRED COMPONENTS RIO Hist Tree ROOTDataFrame)
list(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS})
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(ROOT 6 REQUIRED COMPONENTS Core RIO Hist Tree)
include(${ROOT_USE_FILE})

#----------------------------------------------------------------------------
# flags

include(GNUInstallDirs) # standard GNU installation
include(CheckCXXCompilerFlag)

set(CMAKE_CXX_FLAGS "-std=c++0x")
Expand All @@ -40,18 +44,15 @@ endif()
#----------------------------------------------------------------------------
# IRT library

set(IRT_LIB IRT)

include_directories(
# headers
include_directories(
${PROJECT_SOURCE_DIR}/include
${ROOT_INCLUDE_DIRS}

# For now assume that newly installed edm4eic::(CherenkovPID, ...) event structures are available
# in the same place where IRT is supposed to be installed;
${CMAKE_INSTALL_PREFIX}/include
)
file(GLOB HEADERS ${PROJECT_SOURCE_DIR}/include/*.h )
file(GLOB HEADERS ${PROJECT_SOURCE_DIR}/include/*.h)
list(FILTER HEADERS EXCLUDE REGEX "LinkDef\\.h$")

# sources
set(IRT_SRC
${PROJECT_SOURCE_DIR}/source/ParametricSurface.cc
${PROJECT_SOURCE_DIR}/source/SphericalSurface.cc
Expand All @@ -61,28 +62,43 @@ set(IRT_SRC
${PROJECT_SOURCE_DIR}/source/FlatSurface.cc
${PROJECT_SOURCE_DIR}/source/IRT.cc
${PROJECT_SOURCE_DIR}/source/ChargedParticle.cc

${PROJECT_SOURCE_DIR}/source/DigitizedHit.cc
${PROJECT_SOURCE_DIR}/source/GeantImport.cc
${PROJECT_SOURCE_DIR}/source/Configuration.cc
${PROJECT_SOURCE_DIR}/source/Calibration.cc
${PROJECT_SOURCE_DIR}/source/Digitization.cc
${PROJECT_SOURCE_DIR}/source/ReconstructionFactory.cc

G__IRT.cxx
)
if(IRT_ROOT_IO)
set(IRT_DICT G__${CMAKE_PROJECT_NAME})
list(APPEND IRT_SRC ${IRT_DICT}.cxx)
endif()

set(IRT_ROOTMAP ${CMAKE_CURRENT_BINARY_DIR}/lib${IRT_LIB}_rdict.pcm ${CMAKE_CURRENT_BINARY_DIR}/lib${IRT_LIB}.rootmap )
root_generate_dictionary(G__IRT ${HEADERS} LINKDEF irtLinkDef.h)

add_library(${IRT_LIB} SHARED ${IRT_SRC} )
target_link_libraries(${IRT_LIB} ${ROOT_LIBRARIES} EG )
target_compile_options(${IRT_LIB} PRIVATE -Wall -Wno-misleading-indentation)
target_include_directories(${IRT_LIB} PUBLIC
# library target
add_library(${CMAKE_PROJECT_NAME} SHARED ${IRT_SRC} )
target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -Wall -Wno-misleading-indentation)
if(NOT IRT_ROOT_IO)
# disable calling of `ClassDef` etc. if not generating ROOT dictionary
message(STATUS "NOTE: disabling ROOT dictionary generation")
target_compile_definitions(${CMAKE_PROJECT_NAME} PUBLIC DISABLE_ROOT_IO)
endif()
target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<INSTALL_INTERFACE:include>
)

# ROOT I/O dictionary generation
if(IRT_ROOT_IO)
set(IRT_ROOTMAP
${CMAKE_CURRENT_BINARY_DIR}/lib${CMAKE_PROJECT_NAME}_rdict.pcm
${CMAKE_CURRENT_BINARY_DIR}/lib${CMAKE_PROJECT_NAME}.rootmap
)
root_generate_dictionary(${IRT_DICT} ${HEADERS} LINKDEF include/irtLinkDef.h)
endif()

# linking
target_link_libraries(${CMAKE_PROJECT_NAME} ROOT::Core ROOT::RIO ROOT::Rint ROOT::Tree ROOT::EG)

#----------------------------------------------------------------------------
# optional targets

Expand All @@ -99,47 +115,50 @@ endif()

install(FILES
${HEADERS}
DESTINATION include/IRT
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}
)
install(TARGETS ${IRT_LIB}
EXPORT ${PROJECT_NAME}Targets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include/IRT
)
install(FILES
${IRT_ROOTMAP}
DESTINATION lib
install(TARGETS ${CMAKE_PROJECT_NAME}
EXPORT ${CMAKE_PROJECT_NAME}Targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_PROJECT_NAME}
)
if(IRT_ROOT_IO)
install(FILES
${IRT_ROOTMAP}
DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
endif()

#----------------------------------------------------------------------------
# package config

include(CMakePackageConfigHelpers)
install(EXPORT ${PROJECT_NAME}Targets
FILE ${PROJECT_NAME}Targets.cmake
DESTINATION lib/IRT

install(EXPORT ${CMAKE_PROJECT_NAME}Targets
FILE ${CMAKE_PROJECT_NAME}Targets.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME}
)

set(TARGETS_INSTALL_PATH lib/IRT/IRTTargets.cmake)
set(TARGETS_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME}/${CMAKE_PROJECT_NAME}Targets.cmake)

configure_package_config_file(
cmake/IRTConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/IRTConfig.cmake
INSTALL_DESTINATION lib/IRT
PATH_VARS TARGETS_INSTALL_PATH
cmake/${CMAKE_PROJECT_NAME}Config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}Config.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME}
PATH_VARS CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR TARGETS_INSTALL_PATH
)

write_basic_package_version_file(
"IRTConfigVersion.cmake"
"${CMAKE_PROJECT_NAME}ConfigVersion.cmake"
VERSION ${VERSION}
COMPATIBILITY SameMajorVersion
)

install(FILES
${CMAKE_CURRENT_BINARY_DIR}/IRTConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/IRTConfigVersion.cmake
DESTINATION lib/IRT
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}Config.cmake
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}ConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${CMAKE_PROJECT_NAME}
)

2 changes: 2 additions & 0 deletions cmake/IRTConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@PACKAGE_INIT@
include("@PACKAGE_TARGETS_INSTALL_PATH@")
set_and_check(IRT_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
set_and_check(IRT_LIBRARY_DIR "@PACKAGE_CMAKE_INSTALL_LIBDIR@")
check_required_components(IRT)
4 changes: 2 additions & 2 deletions delphes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ TARGET_LINK_LIBRARIES(${DELPHES_LIB} ${ROOT_LIBRARIES} EG )

#----------------------------------------------------------------------------

INSTALL(FILES ${DELPHES_ROOTMAP} DESTINATION lib)
install(TARGETS ${DELPHES_LIB} DESTINATION lib)
INSTALL(FILES ${DELPHES_ROOTMAP} DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(TARGETS ${DELPHES_LIB} DESTINATION ${CMAKE_INSTALL_LIBDIR})

8 changes: 8 additions & 0 deletions delphes/include/DelphesConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ class MassHypothesis: public TObject {

double m_Threshold;

#ifndef DISABLE_ROOT_IO
ClassDef(MassHypothesis, 1)
#endif
};

class MomentumRange: public TObject {
Expand Down Expand Up @@ -76,7 +78,9 @@ class MomentumRange: public TObject {
std::vector<double> m_SigmaValues;
MomentumRange::range m_Range;

#ifndef DISABLE_ROOT_IO
ClassDef(MomentumRange, 2)
#endif
};

class EtaRange: public TObject {
Expand Down Expand Up @@ -143,7 +147,9 @@ class EtaRange: public TObject {

double m_Min, m_Max;

#ifndef DISABLE_ROOT_IO
ClassDef(EtaRange, 1)
#endif
};

class DelphesConfig: public TObject {
Expand Down Expand Up @@ -267,7 +273,9 @@ class DelphesConfig: public TObject {
// FIXME: need seed setting method;
TRandom m_rndm; //!

#ifndef DISABLE_ROOT_IO
ClassDef(DelphesConfig, 1)
#endif
};

#endif
4 changes: 3 additions & 1 deletion delphes/include/DelphesConfigDIRC.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef _DELPHES_CONFIG_DIRC_
#define _DELPHES_CONFIG_DIRC_

#include <DelphesConfig.h>
#include "DelphesConfig.h"

class DelphesConfigDIRC: public DelphesConfig {
public:
Expand Down Expand Up @@ -59,7 +59,9 @@ class DelphesConfigDIRC: public DelphesConfig {

std::string m_ParameterizationMap;

#ifndef DISABLE_ROOT_IO
ClassDef(DelphesConfigDIRC, 1)
#endif
};

#endif
4 changes: 3 additions & 1 deletion delphes/include/DelphesConfigRICH.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#ifndef _DELPHES_CONFIG_RICH_
#define _DELPHES_CONFIG_RICH_

#include <DelphesConfig.h>
#include "DelphesConfig.h"

class DelphesConfigRICH: public DelphesConfig {
public:
Expand Down Expand Up @@ -33,7 +33,9 @@ class DelphesConfigRICH: public DelphesConfig {
return GetTrackingSmearing(momentum.Mag(), momentum.Eta());
};

#ifndef DISABLE_ROOT_IO
ClassDef(DelphesConfigRICH, 3)
#endif
};

#endif
4 changes: 3 additions & 1 deletion delphes/include/DelphesConfigTOF.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef _DELPHES_CONFIG_TOF_
#define _DELPHES_CONFIG_TOF_

#include <DelphesConfig.h>
#include "DelphesConfig.h"

class DelphesConfigTOF: public DelphesConfig {
public:
Expand Down Expand Up @@ -73,7 +73,9 @@ class DelphesConfigTOF: public DelphesConfig {

double m_InstallationDistance;

#ifndef DISABLE_ROOT_IO
ClassDef(DelphesConfigTOF, 2)
#endif
};

#endif
10 changes: 5 additions & 5 deletions delphes/include/DrcPidFast.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
#ifndef DrcPidFast_h
#define DrcPidFast_h 1

#include "TFile.h"
#include "TH2F.h"
#include "TVector3.h"
#include "TRandom.h"
#include "TF1.h"
#include <TFile.h>
#include <TH2F.h>
#include <TVector3.h>
#include <TRandom.h>
#include <TF1.h>

#include <iostream>

Expand Down
2 changes: 1 addition & 1 deletion delphes/source/DelphesConfig.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

#include <TDatabasePDG.h>

#include <DelphesConfig.h>
#include "DelphesConfig.h"

#define _ERROR_(message) { printf("\n\n %s\n", message); exit(1); }

Expand Down
4 changes: 2 additions & 2 deletions delphes/source/DelphesConfigDIRC.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#include <DelphesConfigDIRC.h>
#include <DrcPidFast.h>
#include "DelphesConfigDIRC.h"
#include "DrcPidFast.h"

// -------------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion delphes/source/DelphesConfigRICH.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


#include <DelphesConfigRICH.h>
#include "DelphesConfigRICH.h"

// -------------------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion delphes/source/DelphesConfigTOF.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#include <DelphesConfigTOF.h>
#include "DelphesConfigTOF.h"

// Speed of light; [mm/ps];
#define _SoL_ ( 0.29979)
Expand Down
35 changes: 0 additions & 35 deletions detectors/CMakeLists.txt

This file was deleted.

Loading