Page MenuHomeHEPForge

No OneTemporary

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5d4e006..7619ea2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,95 +1,81 @@
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(CepGen)
set(PROJECT_VERSION 1)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic -std=c++11 -g")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-long-long -pedantic -std=c++14 -g")
set(CEPGEN_SOURCE_DIR ${PROJECT_SOURCE_DIR}/CepGen)
+set(CEPGEN_LIBRARIES CepGenCore CepGenExternalHadronisers CepGenPhysics CepGenProcesses)
#----- define all individual modules to be built beforehand
set(MODULES Core Processes Hadronisers Physics Export)
#----- enable fortran (for Pythia/Herwig/...)
enable_language(Fortran OPTIONAL)
#----- include external hadronisers/...
add_subdirectory(external)
if(EXISTS $ENV{has_pythia6})
add_definitions(-DPYTHIA6)
endif()
if(EXISTS $ENV{has_herwig})
add_definitions(-DHERWIG)
endif()
if(EXISTS $ENV{has_jetset})
add_definitions(-DJETSET)
endif()
if(EXISTS $ENV{has_grv})
add_definitions(-DGRVPDF)
endif()
#----- build all the intermediate objects
include_directories(${PROJECT_SOURCE_DIR})
foreach(_module ${MODULES})
include_directories(${CEPGEN_SOURCE_DIR}/${_module})
add_subdirectory(${CEPGEN_SOURCE_DIR}/${_module})
endforeach()
#----- link everything into the executables
-add_executable(cepgen main.cpp)
-target_link_libraries(cepgen CepGenCore CepGenExternalHadronisers CepGenPhysics CepGenProcesses)
-
-
if($ENV{HOSTNAME} MATCHES "^lxplus[0-9]+.cern.ch")
set(BASE_DIR "/cvmfs/sft.cern.ch/lcg/external")
set(GSL_DIR "${BASE_DIR}/GSL/1.14/x86_64-slc5-gcc44-opt")
set(HEPMC_DIR "${BASE_DIR}/HepMC/2.06.08/x86_64-slc6-gcc48-opt")
message(STATUS "Compiling on LXPLUS. Do not forget to source the environment variables!")
find_library(GSL_LIB gsl HINTS "${GSL_DIR}/lib")
find_library(GSL_CBLAS_LIB gslcblas HINTS "${GSL_DIR}/lib")
#--- searching for HepMC
find_library(HEPMC_LIB HepMC HINTS "${HEPMC_DIR}/lib")
find_library(HEPMC_FIO_LIB HepMCfio HINTS "${HEPMC_DIR}/lib")
find_path(HEPMC_INCLUDE HepMC HINTS "${HEPMC_DIR}/include")
else()
find_library(GSL_LIB gsl)
find_library(GSL_CBLAS_LIB gslcblas)
find_library(HEPMC_LIB HepMC)
find_path(HEPMC_INCLUDE HepMC)
endif()
if(HEPMC_LIB)
message(STATUS "HepMC found in " ${HEPMC_INCLUDE})
- find_package(ROOT)
include_directories(${HEPMC_INCLUDE})
- add_executable(cepgen-lhe cepgen-lhe.cpp)
- if(ROOT_LIBRARIES)
- target_link_libraries(cepgen-lhe ${HEPMC_LIB} ${ROOT_LIBRARIES} CepGenCore CepGenExternalHadronisers CepGenPhysics CepGenProcesses CepGenExporter)
- else()
- target_link_libraries(cepgen-lhe ${HEPMC_LIB} CepGenCore CepGenExternalHadronisers CepGenPhysics CepGenProcesses CepGenExporter)
- endif()
+ list(APPEND CEPGEN_LIBRARIES CepGenExporter)
endif()
#----- copy the input cards and other files
file(GLOB input_cards RELATIVE ${PROJECT_SOURCE_DIR} cards/*)
foreach(_files ${input_cards})
- configure_file(
- ${_files}
- ${_files}
- COPYONLY
-)
+ configure_file(${_files} ${_files} COPYONLY)
endforeach()
-
configure_file(${CEPGEN_SOURCE_DIR}/README README COPYONLY)
#----- set the tests directory
add_subdirectory(test)
add_subdirectory(utils)
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index e87b48d..cea8346 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,33 +1,33 @@
#----- list all test executables
file(GLOB executables_noroot RELATIVE ${PROJECT_SOURCE_DIR}/test *.cpp)
file(GLOB executables_root RELATIVE ${PROJECT_SOURCE_DIR}/test *.cxx)
#----- build all tests and link them to the core library
foreach(exec_src ${executables_noroot})
string(REPLACE ".cpp" "" exec_bin ${exec_src})
add_executable(${exec_bin} ${exec_src})
set_target_properties(${exec_bin} PROPERTIES EXCLUDE_FROM_ALL true)
- target_link_libraries(${exec_bin} CepGenCore CepGenPhysics CepGenProcesses)
+ target_link_libraries(${exec_bin} ${GSL_LIB} ${CEPGEN_LIBRARIES})
add_test(${exec_bin} ${exec_bin})
set_tests_properties(${exec_bin} PROPERTIES PASS_REGULAR_EXPRESSION "Passed")
endforeach()
#----- specify the tests requiring ROOT
find_package(ROOT QUIET)
if(${ROOT_FOUND})
message(STATUS "ROOT found in ${ROOT_INCLUDE_DIRS}")
include_directories(${ROOT_INCLUDE_DIRS})
link_directories(${ROOT_LIBRARY_DIR})
foreach(exec_src ${executables_root})
string(REPLACE ".cxx" "" exec_bin ${exec_src})
add_executable(${exec_bin} ${exec_src})
set_target_properties(${exec_bin} PROPERTIES EXCLUDE_FROM_ALL true)
- target_link_libraries(${exec_bin} CepGenCore CepGenPhysics CepGenProcesses CepGenExternalHadronisers ${ROOT_LIBRARIES})
+ target_link_libraries(${exec_bin} ${GSL_LIB} ${CEPGEN_LIBRARIES} ${ROOT_LIBRARIES})
endforeach()
else()
message(STATUS "ROOT not found! skipping these tests!")
endif()
diff --git a/cepgen-lhe.cpp b/test/cepgen-lhe.cpp
similarity index 100%
rename from cepgen-lhe.cpp
rename to test/cepgen-lhe.cpp
diff --git a/main.cpp b/test/cepgen.cpp
similarity index 100%
rename from main.cpp
rename to test/cepgen.cpp
diff --git a/utils/form_factors.cxx b/utils/form_factors.cxx
index 480590a..34b3a49 100644
--- a/utils/form_factors.cxx
+++ b/utils/form_factors.cxx
@@ -1,87 +1,87 @@
-#include "physics/FormFactors.h"
-#include "physics/Particle.h"
+#include "CepGen/Physics/FormFactors.h"
+#include "CepGen/Physics/Particle.h"
#include "Canvas.h"
#include "TGraph.h"
#include "TMultiGraph.h"
#include <iostream>
using namespace std;
int
main( int argc, char* argv[] )
{
const float min_q2 = 1., max_q2 = 1.e5, mx2 = 1.e4;
const unsigned int npoints = 1000;
TGraph g_sy_fe_100, g_sy_fm_100;
TGraph g_fb_fe_100, g_fb_fm_100;
TGraph g_su_fe_100, g_su_fm_100;
const float mp2 = pow( Particle::GetMassFromPDGId( Particle::Proton ), 2 );
for ( unsigned int i=0; i<npoints; i++ ) {
const float q2 = min_q2 + i*( max_q2-min_q2 )/(npoints-1);
FormFactors ff_sy = SuriYennieFormFactors( q2, mp2, mx2 );
g_sy_fe_100.SetPoint( i, q2, ff_sy.FE );
g_sy_fm_100.SetPoint( i, q2, ff_sy.FM );
FormFactors ff_fb = FioreBrasseFormFactors( q2, mp2, mx2 );
g_fb_fe_100.SetPoint( i, q2, ff_fb.FE );
g_fb_fm_100.SetPoint( i, q2, ff_fb.FM );
FormFactors ff_su = SzczurekUleschenkoFormFactors( q2, mp2, mx2 );
g_su_fe_100.SetPoint( i, q2, ff_su.FE );
g_su_fm_100.SetPoint( i, q2, ff_su.FM );
}
Canvas c( "test" );
c.SetLegendX1( 0.4 );
TMultiGraph mg;
g_sy_fe_100.SetLineWidth( 3 );
mg.Add( &g_sy_fe_100, "l" );
c.AddLegendEntry( &g_sy_fe_100, "Suri-Yennie, F_{E}", "l" );
g_sy_fm_100.SetLineStyle( 2 );
g_sy_fm_100.SetLineWidth( 3 );
mg.Add( &g_sy_fm_100, "l" );
c.AddLegendEntry( &g_sy_fm_100, "Suri-Yennie, F_{M}", "l" );
g_fb_fe_100.SetLineColor( kRed+1 );
g_fb_fe_100.SetLineWidth( 3 );
mg.Add( &g_fb_fe_100, "l" );
c.AddLegendEntry( &g_fb_fe_100, "Fiore-Brasse, F_{E}", "l" );
g_fb_fm_100.SetLineStyle( 2 );
g_fb_fm_100.SetLineColor( kRed+1 );
g_fb_fm_100.SetLineWidth( 3 );
mg.Add( &g_fb_fm_100, "l" );
c.AddLegendEntry( &g_fb_fm_100, "Fiore-Brasse, F_{M}", "l" );
g_su_fe_100.SetLineColor( kGreen-1 );
g_su_fe_100.SetLineWidth( 3 );
mg.Add( &g_su_fe_100, "l" );
c.AddLegendEntry( &g_su_fe_100, "Szczurek-Uleschenko, F_{E}", "l" );
g_su_fm_100.SetLineStyle( 2 );
g_su_fm_100.SetLineColor( kGreen-1 );
g_su_fm_100.SetLineWidth( 3 );
mg.Add( &g_su_fm_100, "l" );
c.AddLegendEntry( &g_su_fm_100, "Szczurek-Uleschenko, F_{M}", "l" );
mg.Draw( "alpr" );
mg.SetTitle( "Q^{2}\\Proton form factor" );
c.Prettify( mg.GetHistogram() );
mg.GetYaxis()->SetRangeUser( 1.e-10, 10. );
mg.GetXaxis()->SetLimits( min_q2, max_q2 );
c.SetLogy();
c.Save( "pdf" );
return 0;
}

File Metadata

Mime Type
text/x-diff
Expires
Tue, Nov 19, 4:43 PM (1 d, 12 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3805217
Default Alt Text
(7 KB)

Event Timeline