STARTLIGHT
authoragrigora <alina.grigoras@cern.ch>
Thu, 6 Nov 2014 15:47:05 +0000 (16:47 +0100)
committeragrigora <alina.grigoras@cern.ch>
Mon, 15 Dec 2014 12:51:53 +0000 (13:51 +0100)
CMakeLists.txt
STARLIGHT/AliStarLight/AliGenStarLight.cxx [moved from STARLIGHT/AliGenStarLight.cxx with 100% similarity]
STARLIGHT/AliStarLight/AliGenStarLight.h [moved from STARLIGHT/AliGenStarLight.h with 100% similarity]
STARLIGHT/AliStarLight/AliStarLightLinkDef.h [moved from STARLIGHT/AliStarLightLinkDef.h with 100% similarity]
STARLIGHT/AliStarLight/CMakeLists.txt [new file with mode: 0644]
STARLIGHT/CMakeLists.txt
STARLIGHT/CMakelibAliStarLight.pkg [deleted file]
STARLIGHT/CMakelibStarLight.pkg [deleted file]
STARLIGHT/starlight/CMakeLists.txt
STARLIGHT/starlight/CMakeLists.txt.old [new file with mode: 0644]

index 5d112fa..449b4dd 100644 (file)
@@ -123,3 +123,4 @@ add_subdirectory(THydjet)
 include(Vc/Vc.cmake)
 add_subdirectory(Vc)
 add_subdirectory(HLT)
+add_subdirectory(STARLIGHT)
\ No newline at end of file
diff --git a/STARLIGHT/AliStarLight/CMakeLists.txt b/STARLIGHT/AliStarLight/CMakeLists.txt
new file mode 100644 (file)
index 0000000..7ade12e
--- /dev/null
@@ -0,0 +1,66 @@
+# **************************************************************************
+# * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+# *                                                                        *
+# * Author: The ALICE Off-line Project.                                    *
+# * Contributors are mentioned in the code where appropriate.              *
+# *                                                                        *
+# * Permission to use, copy, modify and distribute this software and its   *
+# * documentation strictly for non-commercial purposes is hereby granted   *
+# * without fee, provided that the above copyright notice appears in all   *
+# * copies and that both the copyright notice and this permission notice   *
+# * appear in the supporting documentation. The authors make no claims     *
+# * about the suitability of this software for any purpose. It is          *
+# * provided "as is" without express or implied warranty.                  *
+# **************************************************************************
+
+# Module
+set(MODULE AliStarLight)
+
+# Module include folder
+include_directories(${AliRoot_SOURCE_DIR}/STARLIGHT/${MODULE})
+
+# Additional include folders in alphabetical order
+include_directories(
+                    ${AliRoot_SOURCE_DIR}/EVGEN
+                    ${AliRoot_SOURCE_DIR}/STARLIGHT/starlight/include
+                    ${AliRoot_SOURCE_DIR}/STARLIGHT/starlight/TStarLight
+                    ${AliRoot_SOURCE_DIR}/STEER/STEER
+                    ${AliRoot_SOURCE_DIR}/STEER/STEERBase
+                   )
+
+# Sources in alphabetical order
+set(SRCS
+    ${AliRoot_SOURCE_DIR}/STARLIGHT/starlight/TStarLight/TStarLight.cxx
+    AliGenStarLight.cxx
+   )
+
+# Headers from sources
+string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
+
+# Generate the dictionary
+# It will create G_ARG1.cxx and G_ARG1.h / ARG1 = function first argument
+get_directory_property(incdirs INCLUDE_DIRECTORIES)
+generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
+
+# Generate the ROOT map
+# Dependecies
+set(LIBDEPS STEERBase STEER StarLight EVGEN)
+generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
+
+# Add a library to the project using the specified source files
+add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
+
+# Additional compilation flags
+set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
+
+# System dependent: Modify the way the library is build
+if(${CMAKE_SYSTEM} MATCHES Darwin)
+    set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
+endif(${CMAKE_SYSTEM} MATCHES Darwin)
+
+# Installation
+install(TARGETS ${MODULE}
+        ARCHIVE DESTINATION lib
+        LIBRARY DESTINATION lib)
+
+install(FILES ${HDRS} DESTINATION include)
\ No newline at end of file
index d3fc797..5d72de7 100644 (file)
@@ -1,10 +1,19 @@
-# AliRoot Build System CMakeLists for PYTHIA8
-#
-# Author: Johny Jose m(johny.jose@cern.ch)
-#         Port of previous Makefile build to cmake
+# **************************************************************************
+# * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+# *                                                                        *
+# * Author: The ALICE Off-line Project.                                    *
+# * Contributors are mentioned in the code where appropriate.              *
+# *                                                                        *
+# * Permission to use, copy, modify and distribute this software and its   *
+# * documentation strictly for non-commercial purposes is hereby granted   *
+# * without fee, provided that the above copyright notice appears in all   *
+# * copies and that both the copyright notice and this permission notice   *
+# * appear in the supporting documentation. The authors make no claims     *
+# * about the suitability of this software for any purpose. It is          *
+# * provided "as is" without express or implied warranty.                  *
+# **************************************************************************
 
-cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
+add_subdirectory(starlight)
+add_subdirectory(AliStarLight)
 
-file(GLOB PACKAGES CMake*.pkg)
-
-ALICE_BuildModule()
+message(STATUS "STARTLIGHT enabled")
diff --git a/STARLIGHT/CMakelibAliStarLight.pkg b/STARLIGHT/CMakelibAliStarLight.pkg
deleted file mode 100644 (file)
index f6e9ee5..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-# -*- mode: CMake -*-
-#--------------------------------------------------------------------------------#
-# Package File for AliPythia8                                                    #
-# Author : Johny Jose (johny.jose@cern.ch)                                       #
-# Variables Defined :                                                            #
-#                                                                                #
-# SRCS - C++ source files                                                        #
-# HDRS - C++ header files                                                        #
-# DHDR - ROOT Dictionary Linkdef header file                                     #
-# CSRCS - C source files                                                         #
-# CHDRS - C header files                                                         #
-# EINCLUDE - Include directories                                                 #
-# EDEFINE - Compiler definitions                                                 #
-# ELIBS - Extra libraries to link                                                #
-# ELIBSDIR - Extra library directories                                           #
-# PACKFFLAGS - Fortran compiler flags for package                                #
-# PACKCXXFLAGS - C++ compiler flags for package                                  #
-# PACKCFLAGS - C compiler flags for package                                      #
-# PACKSOFLAGS - Shared library linking flags                                     #
-# PACKLDFLAGS - Module linker flags                                              #
-# PACKBLIBS - Libraries to link (Executables only)                               #
-# EXPORT - Header files to be exported                                           #
-# CINTHDRS - Dictionary header files                                             #
-# CINTAUTOLINK - Set automatic dictionary generation                             #
-# ARLIBS - Archive Libraries and objects for linking (Executables only)          #
-# SHLIBS - Shared Libraries and objects for linking (Executables only)           #
-#--------------------------------------------------------------------------------#
-
-set ( SRCS  
-    starlight/TStarLight/TStarLight.cxx
-    AliGenStarLight.cxx
-    )
-
-string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
-
-set ( DHDR  AliStarLightLinkDef.h )
-
-set ( EINCLUDE STARLIGHT/starlight/include STARLIGHT/starlight/TStarLight STEER/STEER STEER/STEERBase EVGEN)
diff --git a/STARLIGHT/CMakelibStarLight.pkg b/STARLIGHT/CMakelibStarLight.pkg
deleted file mode 100644 (file)
index 6852a19..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-# -*- mode: CMake -*-
-#--------------------------------------------------------------------------------#
-# Package File for pythia8                                                       #
-# Author : Johny Jose (johny.jose@cern.ch)                                       #
-# Variables Defined :                                                            #
-#                                                                                #
-# SRCS - C++ source files                                                        #
-# HDRS - C++ header files                                                        #
-# DHDR - ROOT Dictionary Linkdef header file                                     #
-# CSRCS - C source files                                                         #
-# CHDRS - C header files                                                         #
-# EINCLUDE - Include directories                                                 #
-# EDEFINE - Compiler definitions                                                 #
-# ELIBS - Extra libraries to link                                                #
-# ELIBSDIR - Extra library directories                                           #
-# PACKFFLAGS - Fortran compiler flags for package                                #
-# PACKCXXFLAGS - C++ compiler flags for package                                  #
-# PACKCFLAGS - C compiler flags for package                                      #
-# PACKSOFLAGS - Shared library linking flags                                     #
-# PACKLDFLAGS - Module linker flags                                              #
-# PACKBLIBS - Libraries to link (Executables only)                               #
-# EXPORT - Header files to be exported                                           #
-# CINTHDRS - Dictionary header files                                             #
-# CINTAUTOLINK - Set automatic dictionary generation                             #
-# ARLIBS - Archive Libraries and objects for linking (Executables only)          #
-# SHLIBS - Shared Libraries and objects for linking (Executables only)           #
-#--------------------------------------------------------------------------------#
-
-set ( SRCS  
-  starlight/src/bessel.cpp
-  starlight/src/beam.cpp
-  starlight/src/inputParameters.cpp
-  starlight/src/beambeamsystem.cpp
-  starlight/src/starlightparticle.cpp
-  starlight/src/gammaaluminosity.cpp
-  starlight/src/randomgenerator.cpp
-  starlight/src/nucleus.cpp
-  starlight/src/eventchannel.cpp
-  starlight/src/gammaavm.cpp
-  starlight/src/psifamily.cpp
-  starlight/src/gammagammasingle.cpp
-  starlight/src/photonNucleusCrossSection.cpp
-  starlight/src/wideResonanceCrossSection.cpp
-  starlight/src/narrowResonanceCrossSection.cpp
-  starlight/src/readinluminosity.cpp
-  starlight/src/twophotonluminosity.cpp
-  starlight/src/gammagammaleptonpair.cpp
-  starlight/src/starlight.cpp
-  starlight/src/upcevent.cpp
-  starlight/src/vector3.cpp
-  starlight/src/lorentzvector.cpp
-  starlight/src/filewriter.cpp
-  starlight/src/eventfilewriter.cpp
-  starlight/src/starlightparticlecodes.cpp
-  starlight/src/starlightStandalone.cpp
-  starlight/src/nBodyPhaseSpaceGen.cpp
-  starlight/src/inputParser.cpp
-  starlight/src/incoherentPhotonNucleusLuminosity.cpp
-  starlight/src/incoherentVMCrossSection.cpp
-    )
-
-set (EINCLUDE STARLIGHT/starlight/include)
-
-set (Starlight_VERSION_MAJOR 9999) 
-set (Starlight_VERSION_MINOR 1)
-set (Starlight_VERSION_MINOR_MINOR 0)
-
-configure_file (
-  "${PROJECT_SOURCE_DIR}/STARLIGHT/starlight/starlightconfig.h.in"
-  "${PROJECT_SOURCE_DIR}/STARLIGHT/starlight/include/starlightconfig.h"
-  )
-
-
-if( ALICE_TARGET STREQUAL "macosxicc")
-       
-       string (REGEX REPLACE "-O[^ ]*" "" "$(FFLAGS}")
-
-endif( ALICE_TARGET STREQUAL "macosxicc")
-
-string(REPLACE "-Weffc++" "" PACKCXXFLAGS ${CXXFLAGS})
-
-string(REPLACE "-Weffc++" "" PACKDCXXFLAGS ${CXXFLAGSNO})
-
-string(REPLACE "-Wshadow" "-Wno-shadow" PACKCXXFLAGS ${PACKCXXFLAGS})
-string(REPLACE "-Wshadow" "-Wno-shadow" PACKDCXXFLAGS ${PACKDCXXFLAGS})
index c9e3788..e37dbe6 100644 (file)
-###########################################################################
-#
-#    Copyright 2010
-#
-#    This file is part of Starlight.
-#
-#    Starlight is free software: you can redistribute it and/or modify
-#    it under the terms of the GNU General Public License as published by
-#    the Free Software Foundation, either version 3 of the License, or
-#    (at your option) any later version.
-#        
-#    Starlight is distributed in the hope that it will be useful,
-#    but WITHOUT ANY WARRANTY; without even the implied warranty of
-#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-#    GNU General Public License for more details.
-#        
-#    You should have received a copy of the GNU General Public License
-#    along with Starlight. If not, see <http://www.gnu.org/licenses/>.
-#
-###########################################################################
-#
-# File and Version Information:
-# $Rev:: 186                         $: revision of last commit
-# $Author:: jnystrand                $: author of last commit
-# $Date:: 2014-09-12 02:39:02 +0200 #$: date of last commit
-#
-# Description:
-#      Starlight build file
-#
-#
-###########################################################################
-
-
-# check if cmake has the required version
-cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
-
-
-# set verbosity
-set(CMAKE_VERBOSE_MAKEFILE 0)  # if set to 1 compile and link commands are displayed during build
-# the same effect can be achieved by calling 'make VERBOSE=1'
-
-
-# The version number. 9999 indicates trunk
-set (Starlight_VERSION_MAJOR 9999) 
-set (Starlight_VERSION_MINOR 1)
-set (Starlight_VERSION_MINOR_MINOR 0)
-
-# define project
-project(starlight)
-find_package (Threads)
-
-# load some common cmake macros
-# set path, where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
-set(CMAKE_MODULE_PATH "${AliRoot_SOURCE_DIR}/cmake_modules")
-message(STATUS "Using cmake module path '${CMAKE_MODULE_PATH}'")
-include(CommonMacros)
-
-
-# force out-of-source builds.
-enforce_out_of_source_build()
-
-
-# warn user if system is not UNIX
-if(NOT UNIX)
-  message(FATAL_ERROR "This is an unsupported system.")
-endif()
-message(STATUS "Detected host system '${CMAKE_HOST_SYSTEM_NAME}' version '${CMAKE_HOST_SYSTEM_VERSION}' architecture '${CMAKE_HOST_SYSTEM_PROCESSOR}'")
-message(STATUS "Compiling for system '${CMAKE_SYSTEM_NAME}' version '${CMAKE_SYSTEM_VERSION}' architecture '${CMAKE_SYSTEM_PROCESSOR}'")
-
-option (CPP11 "Enable compilation with C++11 features" OFF) 
-
-# define build types
-# set a default build type for single-configuration CMake generators, if no build type is set.
-set(CMAKE_BUILD_TYPE Debug)
-if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
-  message(STATUS "No build type was specified. Setting build type to 'Release'.")
-  set(CMAKE_BUILD_TYPE Release)
-endif()
-# common compiler flags
-if (CMAKE_COMPILER_IS_GNUCC)
-  execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
-  message(STATUS "GCC_VERSTION")
-  message(STATUS  ${GCC_VERSION})
-  if (GCC_VERSION VERSION_GREATER 4.6 OR GCC_VERSION VERSION_EQUAL 4.6)
-    message(STATUS "GCC_VERSION>=4.6")
-    if(CPP11)
-      set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -Wno-error=unused-but-set-variable -Wno-error=unused-but-set-parameter -std=c++11")
-      message(STATUS "Enabling usage of C++11 features")
-    else()
-      set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -Wno-error=unused-but-set-variable -Wno-error=unused-but-set-parameter")
-    endif()
-  else()
-    message(STATUS "GCC_VERSION<4.6")
-    set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror")
-    if(CPP11)
-      message(WARNING "C++11 feautures not supported for your compiler")
-    endif()
-  endif()
-else()
-  message(STATUS "Not GCC")
-  set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror")
-  if(CPP11)
-    message(WARNING "C++11 feautures not supported for your compiler")
-  endif()
-endif()
-# flags for specific build types
-set(CMAKE_CXX_FLAGS_DEBUG "-g")
-set(CMAKE_CXX_FLAGS_RELEASE "-O3")
-set(CMAKE_CXX_LDFLAGS_DEBUG "-g")
-# report global build settings
-message(STATUS "Using CXX compiler '${CMAKE_CXX_COMPILER}'")
-message(STATUS "Using CXX general compiler flags '${CMAKE_CXX_FLAGS}'")
-foreach(_BUILD_TYPE "DEBUG" "MINSIZEREL" "RELEASE" "RELWITHDEBINFO")
-  message(STATUS "Using CXX compiler flags '${CMAKE_CXX_FLAGS_${_BUILD_TYPE}}' for build type ${_BUILD_TYPE}")
-endforeach()
-message(STATUS "Build type is '${CMAKE_BUILD_TYPE}'")
-
-
-# redirect output files
-#set(LIBRARY_OUTPUT_PATH "${AliRoot_SOURCE_DIR}/lib")
-message(STATUS "Using library output path '${LIBRARY_OUTPUT_PATH}'")
-#set(EXECUTABLE_OUTPUT_PATH "${AliRoot_SOURCE_DIR}/bin")
-message(STATUS "Using executable output path '${EXECUTABLE_OUTPUT_PATH}'")
-
-
-# make AliRoot_SOURCE_DIR accessible in source code via predefined macro AliRoot_SOURCE_DIR
-if(AliRoot_SOURCE_DIR)
-  add_definitions(-D'AliRoot_SOURCE_DIR=\"${AliRoot_SOURCE_DIR}\"')
-else()
-  add_definitions(-D'AliRoot_SOURCE_DIR=\"\"')
-endif()
-
-
-# make SVN version string accessible in source code via predefined macro SVN_VERSION
-find_package(Subversion)
-if(Subversion_FOUND)
-  # unfortunately CMAKE only parses 'svn info'
-  find_program(SVNVERSION_EXECUTABLE
-    svnversion
-               )
-  if(NOT SVNVERSION_EXECUTABLE)
-    message(STATUS "Could not find subversion command 'svnversion'. Repository version unknown.")
-  else()
-    execute_process(
-      COMMAND ${SVNVERSION_EXECUTABLE} "${AliRoot_SOURCE_DIR}"
-      OUTPUT_VARIABLE SVN_VERSION
-      RESULT_VARIABLE _SVNVERSION_RETURN
-      OUTPUT_STRIP_TRAILING_WHITESPACE)
-    if(NOT ${_SVNVERSION_RETURN})
-      message(STATUS "Subversion repository revision is '${SVN_VERSION}'")
-    else()
-      message(STATUS "Error running 'svnversion'. Repository version unknown.")
-      set(SVN_VERSION "")
-    endif()
-  endif()
-else()
-  message(STATUS "Could not find subversion installation. Repository version unknown.")
-endif()
-if(SVN_VERSION)
-  add_definitions(-D'SVN_VERSION=\"${SVN_VERSION}\"')
-else()
-  add_definitions(-D'SVN_VERSION=\"\"')
-endif()
-
-
-# setup doxygen
-find_package(Doxygen)
-if(NOT DOXYGEN_FOUND)
-  message(WARNING "Cannot find Doxygen. No HTML documentation will be generated.")
-else()
-  set(DOXYGEN_TARGET  "doxygen")
-  set(DOXYGEN_DOC_DIR "${AliRoot_SOURCE_DIR}/doxygen")
-  set(DOXYGEN_CONF    "${AliRoot_SOURCE_DIR}/starlightDoxyfile.conf")
-  message(STATUS "Run 'make ${DOXYGEN_TARGET}' to create Doxygen documentation files in '${DOXYGEN_DOC_DIR}'")
-  add_custom_target(${DOXYGEN_TARGET}
-    COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_CONF}
-    DEPENDS ${DOXYGEN_CONF}
-    WORKING_DIRECTORY ${AliRoot_SOURCE_DIR}
-               )
-endif()
-
-
-# setup Pythia 8
-option (ENABLE_PYTHIA  "Enable compilation against pythia (necessary for certain processes)" OFF) 
-if(ENABLE_PYTHIA)
-  find_package(Pythia8)
-  if(PYTHIA8_FOUND)
-    set(optionalLibs ${optionalLibs} ${PYTHIA8_LIBRARY})
-    find_package(LHAPDF REQUIRED) # implemented for dummy version in Pythia8
-    set(optionalLibs ${optionalLibs} ${LHAPDF_LIBRARIES})
-    option(ENABLE_PYTHIA  "Should we use the Pythia8 library" ON) 
-  else() 
-    option(ENABLE_PYTHIA  "Should we use the Pythia8 library" OFF) 
-  endif()
-endif()
-
-# setup Pythia 6
-option (ENABLE_PYTHIA6  "Enable compilation against pythia 6 (necessary for certain processes)" OFF) 
-if(ENABLE_PYTHIA6)
-   find_package(Pythia6 REQUIRED)
-   if(PYTHIA6_FOUND)
-      set(optionalLibs ${optionalLibs} ${PYTHIA6_LIBRARY})
-      option (ENABLE_PYTHIA6  "Enable compilation against pythia 6 (necessary for certain processes)" ON) 
-      include_directories(pythia6)
-   else(PYTHIA6_FOUND) 
-      option (ENABLE_PYTHIA6  "Enable compilation against pythia 6 (necessary for certain processes)" OFF) 
-   endif(PYTHIA6_FOUND)
-endif()
-
-# setup DPMJET
-option (ENABLE_DPMJET  "Enable compilation against DPMJet" OFF)
-if(ENABLE_DPMJET)
-   find_package(DPMJet REQUIRED)
-   if(DPMJET_FOUND)
-      option (ENABLE_DPMJET  "Enable compilation against DPMJet" ON)       
-   else(DPMJET_FOUND)
-      option (ENABLE_DPMJET  "Enable compilation against DPMJet" OFF)
-   endif(DPMJET_FOUND)
- endif(ENABLE_DPMJET)
-
-
-# set include directories
-set(INCLUDE_DIRECTORIES
-       ${AliRoot_SOURCE_DIR}/include
-       ${PROJECT_BINARY_DIR}
-#      ${PYTHIA8_INCLUDE_DIR}
-       )
-include_directories(${INCLUDE_DIRECTORIES})
-
-# Set our source files, include the generated dictionary
-set(SOURCES
-  src/bessel.cpp
-  src/beam.cpp
-  src/inputParameters.cpp
-  src/beambeamsystem.cpp
-  src/starlightparticle.cpp
-  src/gammaaluminosity.cpp
-  src/randomgenerator.cpp
-  src/nucleus.cpp
-  src/eventchannel.cpp
-  src/gammaavm.cpp
-  src/gammagammasingle.cpp
-  src/photonNucleusCrossSection.cpp
-  src/wideResonanceCrossSection.cpp
-  src/narrowResonanceCrossSection.cpp
-  src/readinluminosity.cpp
-  src/twophotonluminosity.cpp
-  src/gammagammaleptonpair.cpp
-  src/starlight.cpp
-  src/upcevent.cpp
-  src/vector3.cpp
-  src/lorentzvector.cpp
-  src/filewriter.cpp
-  src/eventfilewriter.cpp
-  src/starlightparticlecodes.cpp
-  src/starlightStandalone.cpp
-  src/nBodyPhaseSpaceGen.cpp
-  src/inputParser.cpp
-  src/incoherentPhotonNucleusLuminosity.cpp
-  src/incoherentVMCrossSection.cpp
-  )
-if(ENABLE_PYTHIA) 
-  set (SOURCES
-               ${SOURCES}
-               #src/PythiaStarlight.cpp
-                src/pythiadecayer.cpp
-               )
-  include_directories(${PYTHIA8_INCLUDE_DIR})
-endif()
-if(ENABLE_PYTHIA6)
-  set (SOURCES 
-               ${SOURCES}
-               src/starlightpythia.cpp
-               src/spectrum.cpp
-               src/spectrumprotonnucleus.cpp
-               )
-endif()
-if(ENABLE_DPMJET)
-  set (SOURCES 
-               ${SOURCES}
-               src/starlightdpmjet.cpp
-               src/spectrum.cpp
-               src/spectrumprotonnucleus.cpp
-               )
-endif()
-
-# add Starlight library to the build system
-set(THIS_LIB "Starlib")
-add_library(${THIS_LIB} STATIC ${SOURCES})
-#make_shared_library("${THIS_LIB}" "${SOURCES}"
-#      "${PYTHIA8_LIBRARY}"
-#      "${LHAPDF_LIBRARIES}"
-#)
-
-if(ENABLE_DPMJET)
-  enable_language(Fortran)
-  set(DPMJET_LIB "DpmJetLib")
-  message(STATUS "DPMJet objects: ${DPMJET_OBJECTS}")
-  add_library(${DPMJET_LIB} STATIC dpmjet/dpmjetint.f ${DPMJET_OBJECTS})
-  set(optionalLibs ${optionalLibs} ${DPMJET_LIB})
-
-endif()
-
-if(ENABLE_PYTHIA6)
-  enable_language(Fortran)
-endif()
-
-# add starlight executable to the build system
-add_executable(starlight src/main.cpp)
-#target_link_libraries(starlight Starlib ${PYTHIA8_LIBRARY} ${LHAPDF_LIBRARIES} ${PYTHIA6_LIBRARY} ${DPMJET_LIB} )
-target_link_libraries(starlight Starlib ${optionalLibs} ${CMAKE_THREAD_LIBS_INIT}) 
-
-#make_executable(starlight src/main.cpp ${THIS_LIB})
-
-configure_file (
-  "${PROJECT_SOURCE_DIR}/starlightconfig.h.in"
-  "${PROJECT_BINARY_DIR}/starlightconfig.h"
-  )
-# Erase xsec values in case changes in code affects the xsec, executed during make process
-add_custom_command (TARGET Starlib POST_BUILD COMMAND touch ARGS slight.txt)
-add_custom_command (TARGET Starlib POST_BUILD COMMAND cp ARGS slight.txt slight.txt.bak)
-add_custom_command (TARGET Starlib POST_BUILD COMMAND echo ARGS '' > slight.txt )
-
-
-message(STATUS "Cmake did not find any errors. run 'make' to build the project.")
-message(STATUS "On multi-core machines 'make -j#', where # is the number of parallel jobs, can speedup compilation considerably.")
+# **************************************************************************
+# * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+# *                                                                        *
+# * Author: The ALICE Off-line Project.                                    *
+# * Contributors are mentioned in the code where appropriate.              *
+# *                                                                        *
+# * Permission to use, copy, modify and distribute this software and its   *
+# * documentation strictly for non-commercial purposes is hereby granted   *
+# * without fee, provided that the above copyright notice appears in all   *
+# * copies and that both the copyright notice and this permission notice   *
+# * appear in the supporting documentation. The authors make no claims     *
+# * about the suitability of this software for any purpose. It is          *
+# * provided "as is" without express or implied warranty.                  *
+# **************************************************************************
+
+# Module
+set(MODULE StarLight)
+
+# Module include folder
+include_directories(${AliRoot_SOURCE_DIR}/STARLIGHT/starlight/include
+                    ${CMAKE_CURRENT_BINARY_DIR}
+)
+
+# Additional include folders in alphabetical order
+include_directories(
+                   )
+
+# Sources in alphabetical order
+set(SRCS
+    src/beambeamsystem.cpp
+    src/beam.cpp
+    src/bessel.cpp
+    src/eventchannel.cpp
+    src/eventfilewriter.cpp
+    src/filewriter.cpp
+    src/gammaaluminosity.cpp
+    src/gammaavm.cpp
+    src/gammagammaleptonpair.cpp
+    src/gammagammasingle.cpp
+    src/incoherentPhotonNucleusLuminosity.cpp
+    src/incoherentVMCrossSection.cpp
+    src/inputParameters.cpp
+    src/inputParser.cpp
+    src/lorentzvector.cpp
+    src/narrowResonanceCrossSection.cpp
+    src/nBodyPhaseSpaceGen.cpp
+    src/nucleus.cpp
+    src/photonNucleusCrossSection.cpp
+    src/psifamily.cpp
+    src/randomgenerator.cpp
+    src/readinluminosity.cpp
+    src/starlight.cpp
+    src/starlightparticlecodes.cpp
+    src/starlightparticle.cpp
+    src/starlightStandalone.cpp
+    src/twophotonluminosity.cpp
+    src/upcevent.cpp
+    src/vector3.cpp
+    src/wideResonanceCrossSection.cpp
+   )
+
+set(Starlight_VERSION_MAJOR 9999)
+set(Starlight_VERSION_MINOR 1)
+set(Starlight_VERSION_MINOR_MINOR 0)
+
+configure_file(${AliRoot_SOURCE_DIR}/STARLIGHT/starlight/starlightconfig.h.in
+               starlightconfig.h
+              )
+
+# Add a library to the project using the specified source files
+add_library(${MODULE} SHARED ${SRCS})
+
+# Additional compilation flags
+set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
+
+# System dependent: Modify the way the library is build
+if(${CMAKE_SYSTEM} MATCHES Darwin)
+    set_target_properties(${MODULE} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
+endif(${CMAKE_SYSTEM} MATCHES Darwin)
+
+# Installation
+install(TARGETS ${MODULE}
+        ARCHIVE DESTINATION lib
+        LIBRARY DESTINATION lib)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/starlightconfig.h DESTINATION include)
\ No newline at end of file
diff --git a/STARLIGHT/starlight/CMakeLists.txt.old b/STARLIGHT/starlight/CMakeLists.txt.old
new file mode 100644 (file)
index 0000000..62f4848
--- /dev/null
@@ -0,0 +1,326 @@
+###########################################################################
+#
+#    Copyright 2010
+#
+#    This file is part of Starlight.
+#
+#    Starlight is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#        
+#    Starlight is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#    GNU General Public License for more details.
+#        
+#    You should have received a copy of the GNU General Public License
+#    along with Starlight. If not, see <http://www.gnu.org/licenses/>.
+#
+###########################################################################
+#
+# File and Version Information:
+# $Rev:: 186                         $: revision of last commit
+# $Author:: jnystrand                $: author of last commit
+# $Date:: 2014-09-12 02:39:02 +0200 #$: date of last commit
+#
+# Description:
+#      Starlight build file
+#
+#
+###########################################################################
+
+
+# check if cmake has the required version
+cmake_minimum_required(VERSION 2.6.0 FATAL_ERROR)
+
+
+# set verbosity
+set(CMAKE_VERBOSE_MAKEFILE 0)  # if set to 1 compile and link commands are displayed during build
+# the same effect can be achieved by calling 'make VERBOSE=1'
+
+
+# The version number. 9999 indicates trunk
+set (Starlight_VERSION_MAJOR 9999) 
+set (Starlight_VERSION_MINOR 1)
+set (Starlight_VERSION_MINOR_MINOR 0)
+
+# define project
+project(starlight)
+find_package (Threads)
+
+# load some common cmake macros
+# set path, where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules")
+message(STATUS "Using cmake module path '${CMAKE_MODULE_PATH}'")
+include(CommonMacros)
+
+
+# force out-of-source builds.
+enforce_out_of_source_build()
+
+
+# warn user if system is not UNIX
+if(NOT UNIX)
+  message(FATAL_ERROR "This is an unsupported system.")
+endif()
+message(STATUS "Detected host system '${CMAKE_HOST_SYSTEM_NAME}' version '${CMAKE_HOST_SYSTEM_VERSION}' architecture '${CMAKE_HOST_SYSTEM_PROCESSOR}'")
+message(STATUS "Compiling for system '${CMAKE_SYSTEM_NAME}' version '${CMAKE_SYSTEM_VERSION}' architecture '${CMAKE_SYSTEM_PROCESSOR}'")
+
+option (CPP11 "Enable compilation with C++11 features" OFF) 
+
+# define build types
+# set a default build type for single-configuration CMake generators, if no build type is set.
+set(CMAKE_BUILD_TYPE Debug)
+if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
+  message(STATUS "No build type was specified. Setting build type to 'Release'.")
+  set(CMAKE_BUILD_TYPE Release)
+endif()
+# common compiler flags
+if (CMAKE_COMPILER_IS_GNUCC)
+  execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
+  message(STATUS "GCC_VERSTION")
+  message(STATUS  ${GCC_VERSION})
+  if (GCC_VERSION VERSION_GREATER 4.6 OR GCC_VERSION VERSION_EQUAL 4.6)
+    message(STATUS "GCC_VERSION>=4.6")
+    if(CPP11)
+      set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -Wno-error=unused-but-set-variable -Wno-error=unused-but-set-parameter -std=c++11")
+      message(STATUS "Enabling usage of C++11 features")
+    else()
+      set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -Wno-error=unused-but-set-variable -Wno-error=unused-but-set-parameter")
+    endif()
+  else()
+    message(STATUS "GCC_VERSION<4.6")
+    set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror")
+    if(CPP11)
+      message(WARNING "C++11 feautures not supported for your compiler")
+    endif()
+  endif()
+else()
+  message(STATUS "Not GCC")
+  set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror")
+  if(CPP11)
+    message(WARNING "C++11 feautures not supported for your compiler")
+  endif()
+endif()
+# flags for specific build types
+set(CMAKE_CXX_FLAGS_DEBUG "-g")
+set(CMAKE_CXX_FLAGS_RELEASE "-O3")
+set(CMAKE_CXX_LDFLAGS_DEBUG "-g")
+# report global build settings
+message(STATUS "Using CXX compiler '${CMAKE_CXX_COMPILER}'")
+message(STATUS "Using CXX general compiler flags '${CMAKE_CXX_FLAGS}'")
+foreach(_BUILD_TYPE "DEBUG" "MINSIZEREL" "RELEASE" "RELWITHDEBINFO")
+  message(STATUS "Using CXX compiler flags '${CMAKE_CXX_FLAGS_${_BUILD_TYPE}}' for build type ${_BUILD_TYPE}")
+endforeach()
+message(STATUS "Build type is '${CMAKE_BUILD_TYPE}'")
+
+
+# redirect output files
+#set(LIBRARY_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/lib")
+message(STATUS "Using library output path '${LIBRARY_OUTPUT_PATH}'")
+#set(EXECUTABLE_OUTPUT_PATH "${CMAKE_SOURCE_DIR}/bin")
+message(STATUS "Using executable output path '${EXECUTABLE_OUTPUT_PATH}'")
+
+
+# make CMAKE_SOURCE_DIR accessible in source code via predefined macro CMAKE_SOURCE_DIR
+if(CMAKE_SOURCE_DIR)
+  add_definitions(-D'CMAKE_SOURCE_DIR=\"${CMAKE_SOURCE_DIR}\"')
+else()
+  add_definitions(-D'CMAKE_SOURCE_DIR=\"\"')
+endif()
+
+
+# make SVN version string accessible in source code via predefined macro SVN_VERSION
+find_package(Subversion)
+if(Subversion_FOUND)
+  # unfortunately CMAKE only parses 'svn info'
+  find_program(SVNVERSION_EXECUTABLE
+    svnversion
+               )
+  if(NOT SVNVERSION_EXECUTABLE)
+    message(STATUS "Could not find subversion command 'svnversion'. Repository version unknown.")
+  else()
+    execute_process(
+      COMMAND ${SVNVERSION_EXECUTABLE} "${CMAKE_SOURCE_DIR}"
+      OUTPUT_VARIABLE SVN_VERSION
+      RESULT_VARIABLE _SVNVERSION_RETURN
+      OUTPUT_STRIP_TRAILING_WHITESPACE)
+    if(NOT ${_SVNVERSION_RETURN})
+      message(STATUS "Subversion repository revision is '${SVN_VERSION}'")
+    else()
+      message(STATUS "Error running 'svnversion'. Repository version unknown.")
+      set(SVN_VERSION "")
+    endif()
+  endif()
+else()
+  message(STATUS "Could not find subversion installation. Repository version unknown.")
+endif()
+if(SVN_VERSION)
+  add_definitions(-D'SVN_VERSION=\"${SVN_VERSION}\"')
+else()
+  add_definitions(-D'SVN_VERSION=\"\"')
+endif()
+
+
+# setup doxygen
+find_package(Doxygen)
+if(NOT DOXYGEN_FOUND)
+  message(WARNING "Cannot find Doxygen. No HTML documentation will be generated.")
+else()
+  set(DOXYGEN_TARGET  "doxygen")
+  set(DOXYGEN_DOC_DIR "${CMAKE_SOURCE_DIR}/doxygen")
+  set(DOXYGEN_CONF    "${CMAKE_SOURCE_DIR}/starlightDoxyfile.conf")
+  message(STATUS "Run 'make ${DOXYGEN_TARGET}' to create Doxygen documentation files in '${DOXYGEN_DOC_DIR}'")
+  add_custom_target(${DOXYGEN_TARGET}
+    COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_CONF}
+    DEPENDS ${DOXYGEN_CONF}
+    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+               )
+endif()
+
+
+# setup Pythia 8
+option (ENABLE_PYTHIA  "Enable compilation against pythia (necessary for certain processes)" OFF) 
+if(ENABLE_PYTHIA)
+  find_package(Pythia8)
+  if(PYTHIA8_FOUND)
+    set(optionalLibs ${optionalLibs} ${PYTHIA8_LIBRARY})
+    find_package(LHAPDF REQUIRED) # implemented for dummy version in Pythia8
+    set(optionalLibs ${optionalLibs} ${LHAPDF_LIBRARIES})
+    option(ENABLE_PYTHIA  "Should we use the Pythia8 library" ON) 
+  else() 
+    option(ENABLE_PYTHIA  "Should we use the Pythia8 library" OFF) 
+  endif()
+endif()
+
+# setup Pythia 6
+option (ENABLE_PYTHIA6  "Enable compilation against pythia 6 (necessary for certain processes)" OFF) 
+if(ENABLE_PYTHIA6)
+   find_package(Pythia6 REQUIRED)
+   if(PYTHIA6_FOUND)
+      set(optionalLibs ${optionalLibs} ${PYTHIA6_LIBRARY})
+      option (ENABLE_PYTHIA6  "Enable compilation against pythia 6 (necessary for certain processes)" ON) 
+      include_directories(pythia6)
+   else(PYTHIA6_FOUND) 
+      option (ENABLE_PYTHIA6  "Enable compilation against pythia 6 (necessary for certain processes)" OFF) 
+   endif(PYTHIA6_FOUND)
+endif()
+
+# setup DPMJET
+option (ENABLE_DPMJET  "Enable compilation against DPMJet" OFF)
+if(ENABLE_DPMJET)
+   find_package(DPMJet REQUIRED)
+   if(DPMJET_FOUND)
+      option (ENABLE_DPMJET  "Enable compilation against DPMJet" ON)       
+   else(DPMJET_FOUND)
+      option (ENABLE_DPMJET  "Enable compilation against DPMJet" OFF)
+   endif(DPMJET_FOUND)
+ endif(ENABLE_DPMJET)
+
+
+# set include directories
+set(INCLUDE_DIRECTORIES
+       ${CMAKE_SOURCE_DIR}/include
+       ${PROJECT_BINARY_DIR}
+#      ${PYTHIA8_INCLUDE_DIR}
+       )
+include_directories(${INCLUDE_DIRECTORIES})
+
+# Set our source files, include the generated dictionary
+set(SOURCES
+  src/bessel.cpp
+  src/beam.cpp
+  src/inputParameters.cpp
+  src/beambeamsystem.cpp
+  src/starlightparticle.cpp
+  src/gammaaluminosity.cpp
+  src/randomgenerator.cpp
+  src/nucleus.cpp
+  src/eventchannel.cpp
+  src/gammaavm.cpp
+  src/gammagammasingle.cpp
+  src/photonNucleusCrossSection.cpp
+  src/wideResonanceCrossSection.cpp
+  src/narrowResonanceCrossSection.cpp
+  src/readinluminosity.cpp
+  src/twophotonluminosity.cpp
+  src/gammagammaleptonpair.cpp
+  src/starlight.cpp
+  src/upcevent.cpp
+  src/vector3.cpp
+  src/lorentzvector.cpp
+  src/filewriter.cpp
+  src/eventfilewriter.cpp
+  src/starlightparticlecodes.cpp
+  src/starlightStandalone.cpp
+  src/nBodyPhaseSpaceGen.cpp
+  src/inputParser.cpp
+  src/incoherentPhotonNucleusLuminosity.cpp
+  src/incoherentVMCrossSection.cpp
+  )
+if(ENABLE_PYTHIA) 
+  set (SOURCES
+               ${SOURCES}
+               #src/PythiaStarlight.cpp
+                src/pythiadecayer.cpp
+               )
+  include_directories(${PYTHIA8_INCLUDE_DIR})
+endif()
+if(ENABLE_PYTHIA6)
+  set (SOURCES 
+               ${SOURCES}
+               src/starlightpythia.cpp
+               src/spectrum.cpp
+               src/spectrumprotonnucleus.cpp
+               )
+endif()
+if(ENABLE_DPMJET)
+  set (SOURCES 
+               ${SOURCES}
+               src/starlightdpmjet.cpp
+               src/spectrum.cpp
+               src/spectrumprotonnucleus.cpp
+               )
+endif()
+
+# add Starlight library to the build system
+set(THIS_LIB "Starlib")
+add_library(${THIS_LIB} STATIC ${SOURCES})
+#make_shared_library("${THIS_LIB}" "${SOURCES}"
+#      "${PYTHIA8_LIBRARY}"
+#      "${LHAPDF_LIBRARIES}"
+#)
+
+if(ENABLE_DPMJET)
+  enable_language(Fortran)
+  set(DPMJET_LIB "DpmJetLib")
+  message(STATUS "DPMJet objects: ${DPMJET_OBJECTS}")
+  add_library(${DPMJET_LIB} STATIC dpmjet/dpmjetint.f ${DPMJET_OBJECTS})
+  set(optionalLibs ${optionalLibs} ${DPMJET_LIB})
+
+endif()
+
+if(ENABLE_PYTHIA6)
+  enable_language(Fortran)
+endif()
+
+# add starlight executable to the build system
+add_executable(starlight src/main.cpp)
+#target_link_libraries(starlight Starlib ${PYTHIA8_LIBRARY} ${LHAPDF_LIBRARIES} ${PYTHIA6_LIBRARY} ${DPMJET_LIB} )
+target_link_libraries(starlight Starlib ${optionalLibs} ${CMAKE_THREAD_LIBS_INIT}) 
+
+#make_executable(starlight src/main.cpp ${THIS_LIB})
+
+configure_file (
+  "${PROJECT_SOURCE_DIR}/starlightconfig.h.in"
+  "${PROJECT_BINARY_DIR}/starlightconfig.h"
+  )
+# Erase xsec values in case changes in code affects the xsec, executed during make process
+add_custom_command (TARGET Starlib POST_BUILD COMMAND touch ARGS slight.txt)
+add_custom_command (TARGET Starlib POST_BUILD COMMAND cp ARGS slight.txt slight.txt.bak)
+add_custom_command (TARGET Starlib POST_BUILD COMMAND echo ARGS '' > slight.txt )
+
+
+message(STATUS "Cmake did not find any errors. run 'make' to build the project.")
+message(STATUS "On multi-core machines 'make -j#', where # is the number of parallel jobs, can speedup compilation considerably.")