Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cmake files in the examples related to HepMC and event generators #45

Draft
wants to merge 63 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
eebf54c
Add LHAPDF.cmake
Apr 9, 2022
e5eda43
OK
Apr 9, 2022
12d2955
OK
Apr 9, 2022
5b99dcf
OK
Apr 9, 2022
c8763a7
OK
Apr 9, 2022
1316811
OK
Apr 9, 2022
4ad10f0
OK
Apr 9, 2022
2a191ae
OK
Apr 9, 2022
924e0bc
OK
Apr 9, 2022
e0c921e
OK
Apr 9, 2022
d434f04
Substr
Apr 10, 2022
bb5678d
More examples
Apr 10, 2022
83ab3e2
More examples
Apr 10, 2022
d8d49f9
More examples
Apr 10, 2022
5e45145
More examples
Apr 10, 2022
18f71b3
More examples
Apr 10, 2022
3944613
More examples
Apr 10, 2022
52cfeb5
More examples
Apr 10, 2022
0386efc
Added tests explicitly
Apr 30, 2022
c47cbc6
First try
May 3, 2022
a05c2bb
Try 2
May 3, 2022
b104575
Try 3
May 3, 2022
e5d4e51
Try 3
May 3, 2022
71f7d75
Try 5
May 3, 2022
0dbe950
Try 6
May 3, 2022
f448eab
Try 6
May 3, 2022
5a76a8e
Try 7
May 3, 2022
cc334f0
OK
May 3, 2022
6d72c6c
OK
May 3, 2022
4109a5a
Try 9
May 3, 2022
413beff
Try 10
May 3, 2022
79b574d
Try 10
May 3, 2022
a897d6a
Try 11
May 3, 2022
c14c462
Try 12
May 3, 2022
05b9553
Try 13
May 3, 2022
b677165
Try 14
May 3, 2022
60e1126
Download pythia6
May 4, 2022
9ca115f
Update CMakeLists.txt.pythia6
andriish May 4, 2022
728a5b0
Conditions
May 4, 2022
64b5f3a
Conditions
May 4, 2022
071fc14
OK
May 4, 2022
6435d30
OK
May 4, 2022
5dc3800
OK
May 4, 2022
2699cf2
OK
May 4, 2022
a902012
OK
May 4, 2022
3a59798
Add
May 4, 2022
52358e1
Assure HepMC2
May 4, 2022
118de28
OK
May 4, 2022
87246d0
OK
May 6, 2022
f04ba43
Added LHAPDF
May 6, 2022
9c98a84
OK
May 6, 2022
7ff0f17
OK
May 6, 2022
a328a71
Added modified pythia6
May 6, 2022
c9fa1ee
OK
May 6, 2022
769d7a3
Merge remote-tracking branch 'origin/pythiabuildin' into LHAPDF
May 6, 2022
ad7e6c3
Simplify
May 6, 2022
9764f7d
Merge branch 'master' into LHAPDF
Jun 10, 2022
2447ebe
Merge branch 'Geant4:master' into LHAPDF
andriish Nov 29, 2023
536bf46
Update HepMCG4PythiaInterface.cc
andriish Nov 29, 2023
1f51f59
Update HepMCG4PythiaInterface.cc
andriish Nov 29, 2023
bba07c8
Merge remote-tracking branch 'origin/master' into LHAPDF
Jan 17, 2024
9a78d2a
Remove CI as there is a separate MR
Mar 13, 2024
193aa05
Fix a typo in FindPythia6
Mar 13, 2024
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
56 changes: 56 additions & 0 deletions cmake/Modules/FindLHAPDF.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# - Try to find LHAPDF
# Defines:
#
# LHAPDF_FOUND
# LHAPDF_INCLUDE_DIR
# LHAPDF_INCLUDE_DIRS (not cached)
# LHAPDF_LIBRARY
# LHAPDF_LIBRARIES (not cached)
# LHAPDF_LIBRARY_DIRS (not cached)

if (LHAPDF_ROOT_DIR OR LHAPDF_DIR OR (DEFINED ENV{LHAPDF_ROOT_DIR}) OR (DEFINED ENV{LHAPDF_DIR}) )
set(LHAPDF_SEARCH_DIRS "" CACHE STRING "" FORCE)
if (LHAPDF_ROOT_DIR)
list (APPEND LHAPDF_SEARCH_DIRS "${LHAPDF_ROOT_DIR}" )
endif()
if (LHAPDF_DIR)
list (APPEND LHAPDF_SEARCH_DIRS "${LHAPDF_DIR}" )
endif()
if (DEFINED EVN{LHAPDF_ROOT_DIR})
list (APPEND LHAPDF_SEARCH_DIRS "$ENV{LHAPDF_ROOT_DIR}" )
endif()
if (DEFINED ENV{LHAPDF_DIR})
list (APPEND LHAPDF_SEARCH_DIRS "ENV{LHAPDF_DIR}" )
endif()
endif()
if (LHAPDF_SEARCH_DIRS)
find_path(LHAPDF_INCLUDE_DIR LHAPDF/LHAPDF.h PATHS ${LHAPDF_SEARCH_DIRS} PATH_SUFFIXES include NO_DEFAULT_PATH)
find_library(LHAPDF_LIBRARY NAMES LHAPDF PATHS ${LHAPDF_SEARCH_DIRS} PATH_SUFFIXES lib lib64 NO_DEFAULT_PATH)
else()
find_path(LHAPDF_INCLUDE_DIR LHAPDF/LHAPDF.h PATH_SUFFIXES include)
find_library(LHAPDF_LIBRARY NAMES LHAPDF PATHS_SUFFIXES lib lib64)
endif()
set(LHAPDF_VERSION 0.0.0)
if (LHAPDF_INCLUDE_DIR)
if (EXISTS ${LHAPDF_INCLUDE_DIR}/LHAPDF/Version.h)
file(STRINGS ${LHAPDF_INCLUDE_DIR}/LHAPDF/Version.h LHAPDF_VERSION_STRING_CONTENT REGEX "^#define[ ]+LHAPDF_VERSION[ ]+\"" )
if (LHAPDF_VERSION_STRING_CONTENT)
string(REGEX MATCH "[1234567890\.]+[a-zA-Z]*" LHAPDF_VERSION ${LHAPDF_VERSION_STRING_CONTENT})
endif()
endif()
endif()


mark_as_advanced(LHAPDF_INCLUDE_DIR LHAPDF_LIBRARY)

# handle the QUIETLY and REQUIRED arguments and set LHAPDF_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LHAPDF DEFAULT_MSG LHAPDF_INCLUDE_DIR LHAPDF_LIBRARY)

set(LHAPDF_LIBRARIES ${LHAPDF_LIBRARY})
get_filename_component(LHAPDF_LIBRARY_DIRS ${LHAPDF_LIBRARY} PATH)

set(LHAPDF_INCLUDE_DIRS ${LHAPDF_INCLUDE_DIR})

mark_as_advanced(LHAPDF_FOUND)
12 changes: 10 additions & 2 deletions cmake/Modules/FindPythia6.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@
# Defines:
# PYTHIA6_FOUND
# PYTHIA6_LIBRARIES
set(TEST_PYTHIA6_ROOT_DIR "" ${PYTHIA6_ROOT_DIR})
IF(TEST_PYTHIA6_ROOT_DIR STREQUAL "")
IF(DEFINED ENV{PYTHIA6_ROOT_DIR})
set(PYTHIA6_ROOT_DIR $ENV{PYTHIA6_ROOT_DIR})
else()
set(PYTHIA6_ROOT_DIR "/usr")
endif()
endif()

find_library(PYTHIA6_LIBRARY NAMES Pythia6 pythia6-$ENV{PYTHIA6_VERSION}
HINTS $ENV{PYTHIA6} $ENV{PYTHIA6}/lib)
find_library(PYTHIA6_LIBRARY NAMES Pythia6 pythia6 pythia6-$ENV{PYTHIA6_VERSION}
HINTS $ENV{PYTHIA6} $ENV{PYTHIA6}/lib $ENV{PYTHIA6}/lib64 ${PYTHIA6_ROOT_DIR}/lib ${PYTHIA6_ROOT_DIR}/lib64)

set(PYTHIA6_LIBRARIES ${PYTHIA6_LIBRARY})
#message(STATUS PYTHIA6_LIBRARIES ${PYTHIA6_LIBRARIES} )
Expand Down
59 changes: 43 additions & 16 deletions cmake/Modules/FindPythia8.cmake
Original file line number Diff line number Diff line change
@@ -1,24 +1,51 @@
# Locate Pythia8 library
# in a directory defined via PYTHIA8 environment variable
#
# - Locate pythia8 library
# Defines:
# PYTHIA8_FOUND
# PYTHIA8_LIBRARIES
# PYTHIA8_INCLUDES
#
# Pythia_FOUND
# PYTHIA8_VERSION
# PYTHIA8_INCLUDE_DIR
# PYTHIA8_XMLDOC_DIR
# PYTHIA8_INCLUDE_DIRS (not cached)
# PYTHIA8_LIBRARY
# PYTHIA8_hepmcinterface_LIBRARY
# PYTHIA8_lhapdfdummy_LIBRARY
# PYTHIA8_LIBRARIES (not cached) : includes 3 libraries above; not to be used if lhapdf is used
set(TEST_PYTHIA8_ROOT_DIR "" ${PYTHIA8_ROOT_DIR})
IF(TEST_PYTHIA8_ROOT_DIR STREQUAL "")
IF(DEFINED ENV{PYTHIA8_ROOT_DIR})
set(PYTHIA8_ROOT_DIR $ENV{PYTHIA8_ROOT_DIR})
else()
set(PYTHIA8_ROOT_DIR "/usr")
endif()
endif()

find_library(PYTHIA8_LIBRARY NAMES pythia8
HINTS $ENV{PYTHIA8} $ENV{PYTHIA8}/lib)
find_path(PYTHIA8_INCLUDE_DIR Pythia.h Pythia8/Pythia.h HINTS ${PYTHIA8_ROOT_DIR}/include)

set(PYTHIA8_LIBRARIES ${PYTHIA8_LIBRARY})
#message(STATUS PYTHIA8_LIBRARIES ${PYTHIA8_LIBRARIES} )
find_path(PYTHIA8_XMLDOC_DIR Version.xml HINTS ${PYTHIA8_ROOT_DIR}/xmldoc ${PYTHIA8_ROOT_DIR}/share/Pythia8/xmldoc ${PYTHIA8_ROOT_DIR}/share/pythia8-data/xmldoc ${PYTHIA8_ROOT_DIR}/share/doc/packages/pythia/xmldoc )

find_path( PYTHIA8_INCLUDES Pythia8/Pythia.h
HINTS $ENV{PYTHIA8} $ENV{PYTHIA8}/include $ENV{PYTHIA8}/include/Pythia8 )
set(PYTHIA8_INCLUDES ${PYTHIA8_INCLUDES})
if(PYTHIA8_INCLUDE_DIR AND PYTHIA8_XMLDOC_DIR)
file(READ ${PYTHIA8_XMLDOC_DIR}/Version.xml versionstr)
string(REGEX REPLACE ".*Pythia:versionNumber.*default.*[0-9][.]([0-9]+).*" "\\1" PYTHIA8_VERSION "${versionstr}")
set(PYTHIA8_VERSION "8.${PYTHIA8_VERSION}")
find_library(PYTHIA8_LIBRARY NAMES pythia8 Pythia8 HINTS ${PYTHIA8_ROOT_DIR}/lib ${PYTHIA8_ROOT_DIR}/lib64)
find_library(PYTHIA8_lhapdfdummy_LIBRARY NAMES lhapdfdummy HINTS ${PYTHIA8_ROOT_DIR}/lib ${PYTHIA8_ROOT_DIR}/lib64)
set(PYTHIA8_INCLUDE_DIRS ${PYTHIA8_INCLUDE_DIR} ${PYTHIA8_INCLUDE_DIR}/Pythia8 ${PYTHIA8_INCLUDE_DIR}/Pythia8Plugins )
set(PYTHIA8_LIBRARIES ${PYTHIA8_LIBRARY})
if(PYTHIA8_VERSION VERSION_LESS 8.200)
#Is this library needed?
set(PYTHIA8_LIBRARIES ${PYTHIA8_LIBRARY} ${PYTHIA8_lhapdfdummy_LIBRARY})
endif()
find_file(resHEPMC3 HepMC3.h PATHS ${PYTHIA8_INCLUDE_DIRS} NO_DEFAULT_PATH)
if (resHEPMC3)
set(Pythia8_HEPMC3_FOUND TRUE)
endif()
endif()

# handle the QUIETLY and REQUIRED arguments and set PYTHIA8_FOUND to TRUE if
# handle the QUIETLY and REQUIRED arguments and set Pythia8_FOUND to TRUE if
# all listed variables are TRUE

INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Pythia8 DEFAULT_MSG PYTHIA8_LIBRARIES)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Pythia8 REQUIRED_VARS PYTHIA8_INCLUDE_DIR PYTHIA8_LIBRARIES PYTHIA8_XMLDOC_DIR VERSION_VAR PYTHIA8_VERSION HANDLE_COMPONENTS)

mark_as_advanced(Pythia8_FOUND PYTHIA8_INCLUDE_DIR PYTHIA8_LIBRARY PYTHIA8_LIBRARIES PYTHIA8_XMLDOC_DIR)

mark_as_advanced(PYTHIA8_FOUND PYTHIA8_LIBRARIES PYTHIA8_INCLUDES)
44 changes: 33 additions & 11 deletions examples/extended/eventgenerator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

cmake_minimum_required(VERSION 3.16...3.27)

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules ${CMAKE_CURRENT_SOURCE_DIR}/../../../cmake/Modules ${CMAKE_MODULE_PATH})
find_package(Geant4)
include(${Geant4_USE_FILE})

Expand All @@ -11,26 +12,47 @@ add_subdirectory(particleGun)
add_subdirectory(exgps)
add_subdirectory(userPrimaryGenerator)

#----------------------------------------------------------------------------
# HepMC examples require HepMC
#
find_package(HepMC QUIET)
if(HEPMC_FOUND)
add_subdirectory(HepMC)
else()
message(STATUS "G4 Examples: HepMC package not found. --> HepMC examples disabled.")
endif()

#----------------------------------------------------------------------------
# decayer6 example requires Pythia6
#
find_package(Pythia6 QUIET)
if(PYTHIA6_FOUND)
option(PYTHIA6_INTERNAL "Download and compile Pythia6" OFF)
if (NOT PYTHIA6_INTERNAL)
find_package(Pythia6)
endif()
if(PYTHIA6_FOUND OR PYTHIA6_INTERNAL)
if (PYTHIA6_INTERNAL)
message(STATUS "Pythia6 will be downloaded and compiled")
include(FetchContent)
FetchContent_Declare(
p6
URL https://pythia.org/download/pythia6/pythia6428-split.tgz
URL_HASH MD5=5391da11b95aa1d90600bc69da4f84cd
)
FetchContent_GetProperties(p6)
if (NOT p6_POPULATED)
FetchContent_Populate(p6)
endif()
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.pythia6 DESTINATION ${p6_SOURCE_DIR})
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/pyinit.f DESTINATION ${p6_SOURCE_DIR})
file(RENAME ${p6_SOURCE_DIR}/CMakeLists.txt.pythia6 ${p6_SOURCE_DIR}/CMakeLists.txt)
add_subdirectory(${p6_SOURCE_DIR} ${p6_BINARY_DIR})
set(PYTHIA6_LIBRARIES G4Pythia6)
endif()
add_subdirectory(pythia/decayer6)
else()
message(STATUS "G4 Examples: Pythia6 package not found. --> decayer6 example disabled.")
endif()

#----------------------------------------------------------------------------
# HepMC examples require HepMC
#
find_package(HepMC QUIET)
if(HEPMC_FOUND)
add_subdirectory(HepMC)
else()
message(STATUS "G4 Examples: HepMC package not found. --> HepMC examples disabled.")
endif()
#----------------------------------------------------------------------------
# py8decayer example requires Pythia8
#
Expand Down
43 changes: 18 additions & 25 deletions examples/extended/eventgenerator/CMakeLists.txt.pythia6
Original file line number Diff line number Diff line change
@@ -1,35 +1,28 @@
# CMake configuration file for building Pythia6 from the source
# downloaded from the PYTHIA6 download site:
# http://www.hepforge.org/downloads/pythia6
#
# To build Pythia6 library:
# % cd mydir
# % mkdir pythia6_source
# % mkdir pythia6_build
# % mkdir pythia6
# % cp CMakeLists.txt.pythia6 pythia6_source/CMakeLists.txt
# % cp pythia6-version.f pythia6_source
# % cd pythia6_build
# % cmake -DCMAKE_INSTALL_PREFIX=../pythia6 ../pythia6_source
# % make
# % make install

#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 3.16...3.27)
project(pythia6 Fortran)

#----------------------------------------------------------------------------
# Locate sources and headers for this project
#
file(GLOB sources ${PROJECT_SOURCE_DIR}/*.f)

# file(GLOB sources ${CMAKE_CURRENT_SOURCE_DIR}/*.f)
#AV The original line from pythia6. We do not use pdfset.f as we link with LHAPDF
#SRCS := $(wildcard py*.f) $(wildcard struct*.f) $(wildcard up*.f) ssmssm.f sugra.f visaje.f $(wildcard fh*.f) pdfset.f
enable_language(Fortran)
file(GLOB py_sources ${CMAKE_CURRENT_SOURCE_DIR}/py*.f)
file(GLOB struct_sources ${CMAKE_CURRENT_SOURCE_DIR}/struct*.f)
file(GLOB up_sources ${CMAKE_CURRENT_SOURCE_DIR}/up*.f)
file(GLOB fh_sources ${CMAKE_CURRENT_SOURCE_DIR}/fh*.f)
#----------------------------------------------------------------------------
# Add library
#
add_library(Pythia6 SHARED ${sources})

add_library(G4Pythia6 SHARED ${py_sources}
${struct_sources}
${up_sources}
${fh_sources}
${CMAKE_CURRENT_SOURCE_DIR}/ssmssm.f
${CMAKE_CURRENT_SOURCE_DIR}/sugra.f
${CMAKE_CURRENT_SOURCE_DIR}/visaje.f
${CMAKE_CURRENT_SOURCE_DIR}/pdfset.f
)
#----------------------------------------------------------------------------
# Install library
#
install(TARGETS Pythia6 DESTINATION lib)
install(TARGETS G4Pythia6 DESTINATION ${CMAKE_INSTALL_LIBDIR})
45 changes: 26 additions & 19 deletions examples/extended/eventgenerator/HepMC/HepMCEx01/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#----------------------------------------------------------------------------
# Setup the project
cmake_minimum_required(VERSION 3.16...3.27)
project(HepMCEx01)
project(HepMCEx01 LANGUAGES C CXX Fortran )

#----------------------------------------------------------------------------
# Find Geant4 package, activating all available UI and Vis drivers by default
Expand All @@ -24,43 +24,50 @@ include(${Geant4_USE_FILE})
# Find HepMC (required package)
#
find_package(HepMC REQUIRED)

#----------------------------------------------------------------------------
# Find LHAPDF (required package)
#
find_package(LHAPDF REQUIRED)
#----------------------------------------------------------------------------
# Find Pythia6 (optional package)
#
find_package(Pythia6 QUIET)
if(PYTHIA6_FOUND)
if (NOT PYTHIA6_INTERNAL)
find_package(Pythia6)
endif()
if(PYTHIA6_FOUND OR PYTHIA6_INTERNAL)
message(STATUS "G4 Examples: Pythia6 found. --> HepMCEx01 example with Pythia6 enabled.")
add_definitions(-DG4LIB_USE_PYTHIA)
add_definitions(-DG4LIB_USE_PYTHIA)
enable_language(Fortran)
set (generator_sources
${PROJECT_SOURCE_DIR}/external/initpydata.f
${PROJECT_SOURCE_DIR}/external/upevnt.F
${PROJECT_SOURCE_DIR}/external/upinit.F
${PROJECT_SOURCE_DIR}/external/upveto.F
)
else()
set(PYTHIA6_LIBRARIES "")
set (generator_sources "")
endif()

#----------------------------------------------------------------------------
# Locate sources and headers for this project
#
include_directories(${PROJECT_SOURCE_DIR}/include
${Geant4_INCLUDE_DIR}
${HEPMC_INCLUDE_DIR})
file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
file(GLOB headers ${PROJECT_SOURCE_DIR}/include/*.hh)

#----------------------------------------------------------------------------
# Add the executable, and link it to the Geant4 libraries
#
add_executable(HepMCEx01 HepMCEx01.cc ${sources} ${headers})
#target_link_libraries(HepMCEx01 ${Geant4_LIBRARIES}
# ${HEPMC_LIBRARIES} ${HEPMC_FIO_LIBRARIES}
# ${PYTHIA6_LIBRARIES} gfortran)
add_executable(HepMCEx01 HepMCEx01.cc ${sources} ${headers} ${generator_sources})
target_link_libraries(HepMCEx01 ${Geant4_LIBRARIES}
${HEPMC_LIBRARIES} ${HEPMC_FIO_LIBRARIES}
${PYTHIA6_LIBRARIES})

# if pythia is compiled with g77, link with -lg2c instead.
#target_link_libraries(HepMCEx01 ${Geant4_LIBRARIES}
# ${HEPMC_LIBRARIES} ${HEPMC_FIO_LIBRARIES}
# ${PYTHIA6_LIBRARIES} g2c)

${PYTHIA6_LIBRARIES} ${LHAPDF_LIBRARIES})
target_include_directories(HepMCEx01 PRIVATE ${PROJECT_SOURCE_DIR}/include
${Geant4_INCLUDE_DIR}
${HEPMC_INCLUDE_DIR})
if(PYTHIA6_FOUND)
set_target_properties(HepMCEx01 PROPERTIES LINKER_LANGUAGE Fortran)
endif()
#----------------------------------------------------------------------------
# Copy all scripts to the build directory, i.e. the directory in which we
# build HepMCEx01. This is so that we can run the executable directly because it
Expand Down
28 changes: 28 additions & 0 deletions examples/extended/eventgenerator/HepMC/HepMCEx01/external/upevnt.F
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

C*********************************************************************

C...UPEVNT
C...Dummy routine, to be replaced by a user implementing external
C...processes. Depending on cross section model chosen, it either has
C...to generate a process of the type IDPRUP requested, or pick a type
C...itself and generate this event. The event is to be stored in the
C...HEPEUP commonblock, including (often) an event weight.

SUBROUTINE UPEVNT

C...Double precision and integer declarations.
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)

C...User process event common block.
INTEGER MAXNUP
PARAMETER (MAXNUP=500)
INTEGER NUP,IDPRUP,IDUP,ISTUP,MOTHUP,ICOLUP
DOUBLE PRECISION XWGTUP,SCALUP,AQEDUP,AQCDUP,PUP,VTIMUP,SPINUP
COMMON/HEPEUP/NUP,IDPRUP,XWGTUP,SCALUP,AQEDUP,AQCDUP,IDUP(MAXNUP),
&ISTUP(MAXNUP),MOTHUP(2,MAXNUP),ICOLUP(2,MAXNUP),PUP(5,MAXNUP),
&VTIMUP(MAXNUP),SPINUP(MAXNUP)
SAVE /HEPEUP/

RETURN
END
26 changes: 26 additions & 0 deletions examples/extended/eventgenerator/HepMC/HepMCEx01/external/upinit.F
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

C*********************************************************************

C...UPINIT
C...Dummy routine, to be replaced by a user implementing external
C...processes. Is supposed to fill the HEPRUP commonblock with info
C...on incoming beams and allowed processes.

SUBROUTINE UPINIT

C...Double precision and integer declarations.
IMPLICIT DOUBLE PRECISION(A-H, O-Z)
IMPLICIT INTEGER(I-N)

C...User process initialization commonblock.
INTEGER MAXPUP
PARAMETER (MAXPUP=100)
INTEGER IDBMUP,PDFGUP,PDFSUP,IDWTUP,NPRUP,LPRUP
DOUBLE PRECISION EBMUP,XSECUP,XERRUP,XMAXUP
COMMON/HEPRUP/IDBMUP(2),EBMUP(2),PDFGUP(2),PDFSUP(2),
&IDWTUP,NPRUP,XSECUP(MAXPUP),XERRUP(MAXPUP),XMAXUP(MAXPUP),
&LPRUP(MAXPUP)
SAVE /HEPRUP/

RETURN
END
Loading