Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
forthommel committed May 12, 2022
2 parents 3199bf0 + 9be625a commit f816faa
Show file tree
Hide file tree
Showing 375 changed files with 31,384 additions and 9,775 deletions.
3 changes: 0 additions & 3 deletions .arcconfig

This file was deleted.

4 changes: 2 additions & 2 deletions .clang-format
Expand Up @@ -4,7 +4,7 @@ BasedOnStyle: Google
ColumnLimit: 120
#didn't we want to change this?
NamespaceIndentation: All
SortIncludes: false
SortIncludes: true
IndentWidth: 2
AccessModifierOffset: -2
PenaltyBreakComment: 30
Expand All @@ -13,7 +13,7 @@ AlignAfterOpenBracket: Align
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
BinPackParameters: false
AlwaysBreakTemplateDeclarations: Yes
AlwaysBreakTemplateDeclarations: true
ReflowComments: false
BinPackArguments: false
BinPackParameters: false
52 changes: 33 additions & 19 deletions CMakeLists.txt
@@ -1,5 +1,15 @@
#--- first check if we are at CERN
set(LXPLUS_ENV "${CMAKE_SOURCE_DIR}/source-lxplus.sh")
if($ENV{HOSTNAME} MATCHES "^lxplus[0-9]+.cern.ch")
if(NOT DEFINED ENV{CEPGEN_LXPLUS_ENV})
message(FATAL_ERROR "LXPLUS environment variables not set!\nPlease source ${LXPLUS_ENV}\nand clean up this build environment, i.e.\nrm -rf CMake*\nand try again...")
endif()
message(STATUS "Compiling on LXPLUS.")
set(IS_LXPLUS "yes")
endif()

set(CPACK_RPM_COMPONENT_INSTALL ON)
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project(CepGen)
set(PROJECT_VERSION 1)
set(VERSION 1.0.alpha2)
Expand All @@ -11,6 +21,7 @@ option(CMAKE_BUILD_SCAN "Build cross-section scan utilitary" OFF)
option(CMAKE_BUILD_CARD_CONV "Build steering cards converter utilitary" OFF)
option(CMAKE_BUILD_TESTS "Build tests" OFF)
option(CMAKE_BUILD_FOAM "Build FOAM integrator" OFF)
option(CMAKE_BUILD_UTILS "Build miscellaneous utilities" ON)
option(CMAKE_COVERAGE "Generate code coverage" OFF)
#----- release build by default

Expand All @@ -24,16 +35,20 @@ if(NOT CMAKE_BUILD_CORE AND NOT CMAKE_BUILD_PROCESSES AND NOT CMAKE_BUILD_ADDONS
message(FATAL_ERROR "Nothing to be built!")
endif()

if(CMAKE_COVERAGE AND CMAKE_BUILD_TESTS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
set(LINK_FLAGS "${LINK_FLAGS} -fprofile-arcs -ftest-coverage")
add_custom_command(OUTPUT run_coverage
COMMAND ctest
#COMMAND cepgen Cards/lpair_cfg.py -n 1000
COMMAND lcov --capture --directory CepGen --output-file coverage.info
COMMAND genhtml -q coverage.info --output-directory coverage
COMMENT Collecting and creating coverage information)
add_custom_target(coverage DEPENDS run_coverage)
if(CMAKE_BUILD_TESTS)
enable_testing()
include(CTest)
if(CMAKE_COVERAGE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
set(LINK_FLAGS "${LINK_FLAGS} -fprofile-arcs -ftest-coverage")
add_custom_command(OUTPUT run_coverage
COMMAND ctest
#COMMAND cepgen Cards/lpair_cfg.py -n 1000
COMMAND lcov --capture --directory CepGen --output-file coverage.info
COMMAND genhtml -q coverage.info --output-directory coverage
COMMENT Collecting and creating coverage information)
add_custom_target(coverage DEPENDS run_coverage)
endif()
endif()

#set(CMAKE_INSTALL_RPATH "$ORIGIN")
Expand All @@ -46,6 +61,7 @@ set(CMAKE_CXX_FLAGS_DEBUG "-pg") # for gprof
#set(CMAKE_CXX_FLAGS_DEBUG "-fprofile-arcs -ftest-coverage") # for gcov
set(CMAKE_CXX_FLAGS_RELEASE "-Wall -Wextra -O2")
set(CMAKE_C_FLAGS_RELEASE "-O2")
set(ROOT_CXX_STANDARD 17)

#----- include external paths

Expand All @@ -55,7 +71,8 @@ include(UseEnvironment)
set(CEPGEN_LIBRARIES)
set(CEPGEN_LIB_DIR ${PROJECT_SOURCE_DIR}/CepGen)
set(CEPGEN_CORE_EXT ${GSL_LIB} ${GSL_CBLAS_LIB} dl)
set(CEPGEN_HAS_FUNCTIONALS OFF)
set(CEPGEN_HAS_FUNCTIONAL OFF)
set(CEPGEN_ADDONS_FILE "${CMAKE_CURRENT_BINARY_DIR}/CepGenAddOns.txt")

include(BuildUtils)

Expand All @@ -70,13 +87,12 @@ if(CMAKE_BUILD_PROCESSES)
add_subdirectory(CepGenProcesses)
endif()
if(CMAKE_BUILD_ADDONS)
file(REMOVE ${CEPGEN_ADDONS_FILE})
add_subdirectory(CepGenAddOns)
endif()
if(CMAKE_BUILD_CORE)
add_subdirectory(CepGen)
list(APPEND CEPGEN_LIBRARIES CepGenCore)
add_subdirectory(CepGen/Cards)
list(APPEND CEPGEN_LIBRARIES CepGenCards)
list(APPEND CEPGEN_LIBRARIES CepGen)
endif()

#----- copy the input cards and other files
Expand All @@ -85,7 +101,7 @@ file(GLOB_RECURSE input_cards RELATIVE ${PROJECT_SOURCE_DIR} Cards/*)
foreach(_files ${input_cards})
configure_file(${_files} ${_files} COPYONLY)
endforeach()
file(GLOB external_files ${PROJECT_SOURCE_DIR}/External/mstw_sf_scan_nnlo.dat ${PROJECT_SOURCE_DIR}/External/*.mcd)
file(GLOB external_files ${PROJECT_SOURCE_DIR}/External/*.dat ${PROJECT_SOURCE_DIR}/External/*.mcd)
file(COPY ${external_files} DESTINATION ${PROJECT_BINARY_DIR})
file(GLOB readme_file ${PROJECT_SOURCE_DIR}/CepGen/README)
file(COPY ${readme_file} DESTINATION ${PROJECT_BINARY_DIR})
Expand All @@ -97,8 +113,6 @@ if(CMAKE_BUILD_CORE)
add_subdirectory(src)
#--- build the tests
if(CMAKE_BUILD_TESTS)
enable_testing()
include(CTest)
add_subdirectory(test)
endif()
endif()
Expand All @@ -111,7 +125,7 @@ install(DIRECTORY CepGen
install(DIRECTORY Cards
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/CepGen
COMPONENT lib FILES_MATCHING PATTERN "*.py")
install(FILES ${external_files} ${readme_file}
install(FILES ${external_files} ${readme_file} ${CEPGEN_ADDONS_FILE}
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/CepGen
COMPONENT lib)
export(PACKAGE CepGen)
Expand Down
9 changes: 9 additions & 0 deletions Cards/Config/Cuts_cfi.py
@@ -0,0 +1,9 @@
from .containers_cfi import Parameters

vermaserenCuts = Parameters(
pt = (0.5,),
energy = (1.,),
eta = (-3.131, 3.131), # 5 < theta < 175 deg
mx = (1.07, 320.),
q2 = (0., 10000.)
)
4 changes: 4 additions & 0 deletions Cards/Config/Hadronisation/photos_cff.py
@@ -0,0 +1,4 @@
from Config.containers_cfi import Module

photos = Module('photos',
)
2 changes: 1 addition & 1 deletion Cards/Config/Hadronisation/pythia6_cff.py
@@ -1,6 +1,6 @@
from Config.containers_cfi import Module

from .pythia6Tunes_cfi import *
from Config.Hadronisation.pythia6Tunes_cfi import *

pythia6 = Module('pythia6',
seed = 1000,
Expand Down
2 changes: 1 addition & 1 deletion Cards/Config/Hadronisation/pythia8Defaults_cfi.py
@@ -1,7 +1,7 @@
pythia8Defaults = (
'Tune:preferLHAPDF = 2',
#'Beams:setProductionScalesFromLHEF = off',
'SLHA:keepSM = on',
#'SLHA:keepSM = on',
'SLHA:minMassSM = 1000.',
'ParticleDecays:limitTau0 = on',
'ParticleDecays:tau0Max = 10',
Expand Down
4 changes: 2 additions & 2 deletions Cards/Config/Hadronisation/pythia8_cff.py
@@ -1,7 +1,7 @@
from Config.containers_cfi import Module

from pythia8Defaults_cfi import pythia8Defaults
from pythia8Tunes_cfi import pythia8CUEP8M1Settings
from Config.Hadronisation.pythia8Defaults_cfi import pythia8Defaults
from Config.Hadronisation.pythia8Tunes_cfi import pythia8CUEP8M1Settings

pythia8 = Module('pythia8',
seed = 1000,
Expand Down
33 changes: 33 additions & 0 deletions Cards/Config/Hadronisation/tauola_cff.py
@@ -0,0 +1,33 @@
from Config.containers_cfi import Module, Parameters

class DecayMode:
All = 0
ElectronMode = 1
MuonMode = 2
PionMode = 3
RhoMode = 4
A1Mode = 5
KMode = 6
KStarMode = 7
FourPionMode = 8 # 2 pi^pm pi^mp pi^0 nu
FourPionNeutralMode = 9 # 3 pi^0 pi^pm nu
FivePionNeutralMode = 10 # 2 pi^pm pi^mp 2 pi^0 nu
FivePionMode = 11 # 3 pi^pm 2 pi^mp nu
SixPionMode = 12 # 3 pi^pm 2 pi^mp pi^0 nu
SixPionNeutralMode = 13 # 2 pi^pm pi^mp 3 pi^0 nu
TwoKPionMode = 14 # K^pm K^mp pi^pm nu
TwoKPionNeutralMode = 15 # K^0 Kbar^0 pi^pm nu
TwoKNeutralPionMode = 16 # K^pm K^0 pi^0 nu
TwoPionNeutralKMode = 17 # 2 pi^0 K^pm nu
TwoPionKMode = 18 # pi^pm pi^mp K^pm nu
TwoPionKNeutralMode = 19 # pi^pm pi^0 Kbar^0 nu
TwoPionEtaMode = 20 # eta pi^pm pi^0 nu
TwoPionGammaMode = 21 # pi^pm pi^0 gamma nu
TwoKMode = 22 # K^pm K^0 nu

tauola = Module('tauola',
polarisations = Parameters(
full = True,
#GAMMA = False,
),
)
8 changes: 4 additions & 4 deletions Cards/Config/SigmaRatio_cfi.py
Expand Up @@ -3,7 +3,7 @@

class SigmaRatio:
"""R-ratio computation method"""
E143 = Module(1)
R1990 = Module(2)
CLAS = Module(3)
SibirtsevBlunden = Module(4)
E143 = 1
R1990 = 2
CLAS = 3
SibirtsevBlunden = 4
3 changes: 2 additions & 1 deletion Cards/Config/StructureFunctions_cfi.py
Expand Up @@ -14,7 +14,7 @@ class PDFMode:
class StructureFunctions:
"""Types of structure functions supported"""
generic = Module(0,
sigmaRatio = SigmaRatio.E143
sigmaRatio = SigmaRatio.SibirtsevBlunden
)
Electron = generic.clone(1)
ElasticProton = generic.clone(2)
Expand All @@ -37,6 +37,7 @@ class StructureFunctions:
#continuumSF = GD11p,
#resonancesSF = ChristyBosted,
)
KulaginBarinov = generic.clone(303)
Partonic = generic.clone(401,
pdfSet = 'LUXqed17_plus_PDF4LHC15_nnlo_100',
numFlavours = 4,
Expand Down
1 change: 0 additions & 1 deletion Cards/Config/ktProcess_cfi.py
Expand Up @@ -8,7 +8,6 @@

from .containers_cfi import Module, Parameters


class ProtonFlux:
"""Type of parton (from proton) flux modelling"""
PhotonElastic = 0
Expand Down
2 changes: 1 addition & 1 deletion Cards/legacy/pptoll.card
@@ -1,4 +1,4 @@
PROC pptoll
PROC pptoff
MODE 2
#HADR pythia6
DEBG 3
Expand Down
14 changes: 8 additions & 6 deletions Cards/lpair_cfg.py
Expand Up @@ -42,16 +42,18 @@
#eventSequence = cepgen.Sequence(pythia8)

#--- example of an output module(s) procedure
#from Config.OutputModule.ROOTTree_cfi import rootTree # dump everything into a flat tree
text = cepgen.Module('text', # histogramming/ASCII output capability
#... dump everything into a flat ROOT tree (if CepGenRoot was built and loaded)
#from Config.OutputModule.ROOTTree_cfi import rootTree
#... accumulate and dump everything into an ASCII text output
text = cepgen.Module('text',
#variables = ['nev', 'm(4)', 'tgen'],
histVariables={
'm(4)': cepgen.Parameters(low=0., high=250., nbins=20),
'm(ob1)': cepgen.Parameters(low=0., high=250., nbins=10, log=True),
'pt(7):pt(8)': cepgen.Parameters(highX=250., highY=250., log=True)
'm(4)': cepgen.Parameters(xbins=[float(bin) for bin in range(0, 250, 10)]),
'm(ob1)': cepgen.Parameters(xrange=(0., 250.), nbins=10, log=True),
'pt(7):pt(8)': cepgen.Parameters(xrange=(0., 250.), yrange=(0., 250.), log=True)
}
)
#... or standard event formats
#... or write onto one of various event formats handled
#lhef = cepgen.Module('lhef', filename='test.lhe')
#hepmc = cepgen.Module('hepmc', filename='test.hepmc')
dump = cepgen.Module('dump', printEvery = generator.printEvery)
Expand Down
40 changes: 40 additions & 0 deletions Cards/lpair_ee_cfg.py
@@ -0,0 +1,40 @@
import Config.Core as cepgen
from Config.PDG_cfi import PDG
from Config.Timer_cfi import timer # enable timing framework
from Config.Cuts_cfi import vermaserenCuts

process = cepgen.Module('lpair',
processParameters = cepgen.Parameters(
pair = PDG.muon,
),
inKinematics = cepgen.Parameters(
pz = (45., 45.),
pdgIds = (11, -11),
),
outKinematics = vermaserenCuts,
)

# events generation parameters
from Config.generator_cff import generator
generator = generator.clone(
numEvents = 100000,
printEvery = 10000,
)

#from Config.OutputModule.ROOTTree_cfi import rootTree # dump everything into a flat tree
text = cepgen.Module('text', # histogramming/ASCII output capability
histVariables={
'm(4)': cepgen.Parameters(xrange=(0., 50.), nbins=20),
'pt(7):pt(8)': cepgen.Parameters(xrange=(0., 50.), yrange=(0., 50.), log=True)
}
)
#lhef = cepgen.Module('lhef', filename='test.lhe')
#hepmc = cepgen.Module('hepmc', filename='test.hepmc')
dump = cepgen.Module('dump', printEvery = generator.printEvery)
output = cepgen.Sequence(
#rootTree,
text,
#lhef,
#hepmc,
dump,
)
39 changes: 39 additions & 0 deletions Cards/lpair_tauola_cfg.py
@@ -0,0 +1,39 @@
import Config.Core as cepgen
from Config.PDG_cfi import PDG
from Config.generator_cff import generator as _gen
from Config.Hadronisation.tauola_cff import tauola
#from Config.Timer_cfi import timer # enable timing framework

process = cepgen.Module('lpair',
processParameters = cepgen.Parameters(
mode = cepgen.ProcessMode.ElasticElastic,
pair = PDG.tau,
),
inKinematics = cepgen.Parameters(
pz = (6500., 6500.),
structureFunctions = cepgen.StructureFunctions.SuriYennie,
),
outKinematics = cepgen.Parameters(
pt = (25.,),
energy = (0.,),
eta = (-2.5, 2.5),
mx = (1.07, 1000.),
),
)

generator = _gen.clone(
numEvents = 100000,
printEvery = 10000,
)

eventSequence = cepgen.Sequence(tauola)

text = cepgen.Module('text', # histogramming/ASCII output capability
histVariables={
'm(4)': cepgen.Parameters(xbins=[float(bin) for bin in range(0, 250, 10)]),
'm(ob1)': cepgen.Parameters(xrange=(0., 250.), nbins=10, log=True),
'pt(7):pt(8)': cepgen.Parameters(xrange=(0., 250.), yrange=(0., 250.), log=True)
}
)
dump = cepgen.Module('dump', printEvery = generator.printEvery)
output = cepgen.Sequence(text, dump)

0 comments on commit f816faa

Please sign in to comment.