Page MenuHomeHEPForge

D117.id482.diff
No OneTemporary

D117.id482.diff

diff --git a/History.md b/History.md
--- a/History.md
+++ b/History.md
@@ -11,6 +11,10 @@
===
## R02-0X-00
+
+23 Apr 2024 Thomas Latham
+* Drop redundant EVTGEN\_CPP11 preprocessor switch
+
22 Apr 2024 Fernando Abudinen
* D116: Replaced PHOTOS with FSR flags in examples and tests.
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -35,7 +35,6 @@
# build both the shared and static libs
add_library(objlib OBJECT ${EVTGEN_SOURCES})
set_target_properties(objlib PROPERTIES POSITION_INDEPENDENT_CODE 1)
-target_compile_definitions(objlib PRIVATE EVTGEN_CPP11)
target_include_directories(objlib PRIVATE ${CMAKE_SOURCE_DIR})
if(EVTGEN_HEPMC3)
target_compile_definitions(objlib PRIVATE EVTGEN_HEPMC3)
@@ -57,7 +56,6 @@
set_target_properties(EvtGen PROPERTIES OUTPUT_NAME EvtGen)
set_target_properties(EvtGen PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR} )
set_target_properties(EvtGen PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
-target_compile_definitions(EvtGen PUBLIC EVTGEN_CPP11)
target_include_directories(EvtGen PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
if(EVTGEN_HEPMC3)
target_compile_definitions(EvtGen PUBLIC EVTGEN_HEPMC3)
@@ -72,7 +70,6 @@
add_library(EvtGenStatic STATIC $<TARGET_OBJECTS:objlib>)
set_target_properties(EvtGenStatic PROPERTIES OUTPUT_NAME EvtGen)
set_target_properties(EvtGenStatic PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
-target_compile_definitions(EvtGenStatic PUBLIC EVTGEN_CPP11)
target_include_directories(EvtGenStatic PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
if(EVTGEN_HEPMC3)
target_compile_definitions(EvtGenStatic PUBLIC EVTGEN_HEPMC3)
@@ -91,7 +88,6 @@
# used to build both the shared and static libs
add_library(objlib_ext OBJECT ${EVTGEN_EXTERNAL_SOURCES})
set_target_properties(objlib_ext PROPERTIES POSITION_INDEPENDENT_CODE 1)
- target_compile_definitions(objlib_ext PRIVATE EVTGEN_CPP11)
target_include_directories(objlib_ext PRIVATE ${CMAKE_SOURCE_DIR})
if(EVTGEN_HEPMC3)
target_compile_definitions(objlib_ext PRIVATE EVTGEN_HEPMC3)
@@ -140,7 +136,6 @@
set_target_properties(EvtGenExternal PROPERTIES OUTPUT_NAME EvtGenExternal)
set_target_properties(EvtGenExternal PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR} )
set_target_properties(EvtGenExternal PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
- target_compile_definitions(EvtGenExternal PUBLIC EVTGEN_CPP11)
target_include_directories(EvtGenExternal PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
if(EVTGEN_PYTHIA)
target_compile_definitions(EvtGenExternal PUBLIC EVTGEN_PYTHIA)
@@ -198,7 +193,6 @@
add_library(EvtGenExternalStatic STATIC $<TARGET_OBJECTS:objlib_ext>)
set_target_properties(EvtGenExternalStatic PROPERTIES OUTPUT_NAME EvtGenExternal)
set_target_properties(EvtGenExternalStatic PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
- target_compile_definitions(EvtGenExternalStatic PUBLIC EVTGEN_CPP11)
target_include_directories(EvtGenExternalStatic PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}> $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
if(EVTGEN_PYTHIA)
target_compile_definitions(EvtGenExternalStatic PUBLIC EVTGEN_PYTHIA)
diff --git a/test/evt_dalitz.cc b/test/evt_dalitz.cc
--- a/test/evt_dalitz.cc
+++ b/test/evt_dalitz.cc
@@ -89,14 +89,8 @@
// Initialize EvtGen
// Define the random number generator
- EvtRandomEngine* eng = nullptr;
-
-#ifdef EVTGEN_CPP11
- // Use the Mersenne-Twister generator (C++11 only)
- eng = new EvtMTRandomEngine();
-#else
- eng = new EvtSimpleRandomEngine();
-#endif
+ // Use the Mersenne-Twister generator
+ EvtRandomEngine* eng = new EvtMTRandomEngine();
EvtRandom::setRandomEngine( eng );
diff --git a/test/evtgenlhc_test1.cc b/test/evtgenlhc_test1.cc
--- a/test/evtgenlhc_test1.cc
+++ b/test/evtgenlhc_test1.cc
@@ -161,14 +161,8 @@
int main( int argc, char* argv[] )
{
// Define the random number generator
- EvtRandomEngine* myRandomEngine = nullptr;
-
-#ifdef EVTGEN_CPP11
- // Use the Mersenne-Twister generator (C++11 only)
- myRandomEngine = new EvtMTRandomEngine();
-#else
- myRandomEngine = new EvtSimpleRandomEngine();
-#endif
+ // Use the Mersenne-Twister generator
+ EvtRandomEngine* myRandomEngine = new EvtMTRandomEngine();
if ( !TROOT::Initialized() ) {
static TROOT root( "RooTuple", "RooTuple ROOT in EvtGen" );
diff --git a/test/example1.cc b/test/example1.cc
--- a/test/example1.cc
+++ b/test/example1.cc
@@ -49,14 +49,8 @@
EvtParticle* parent( nullptr );
// Define the random number generator
- EvtRandomEngine* eng = nullptr;
-
-#ifdef EVTGEN_CPP11
- // Use the Mersenne-Twister generator (C++11 only)
- eng = new EvtMTRandomEngine();
-#else
- eng = new EvtSimpleRandomEngine();
-#endif
+ // Use the Mersenne-Twister generator
+ EvtRandomEngine* eng = new EvtMTRandomEngine();
EvtRandom::setRandomEngine( eng );
diff --git a/test/exampleWriteHepMC.cc b/test/exampleWriteHepMC.cc
--- a/test/exampleWriteHepMC.cc
+++ b/test/exampleWriteHepMC.cc
@@ -88,14 +88,8 @@
EvtParticle* parent( nullptr );
// Define the random number generator
- EvtRandomEngine* eng = nullptr;
-
-#ifdef EVTGEN_CPP11
- // Use the Mersenne-Twister generator (C++11 only)
- eng = new EvtMTRandomEngine();
-#else
- eng = new EvtSimpleRandomEngine();
-#endif
+ // Use the Mersenne-Twister generator
+ EvtRandomEngine* eng = new EvtMTRandomEngine();
EvtRandom::setRandomEngine( eng );
diff --git a/validation/genExampleRootFiles.cc b/validation/genExampleRootFiles.cc
--- a/validation/genExampleRootFiles.cc
+++ b/validation/genExampleRootFiles.cc
@@ -132,14 +132,8 @@
EvtParticle* theParent( nullptr );
// Define the random number generator
- EvtRandomEngine* myRandomEngine = nullptr;
-
-#ifdef EVTGEN_CPP11
- // Use the Mersenne-Twister generator (C++11 only)
- myRandomEngine = new EvtMTRandomEngine();
-#else
- myRandomEngine = new EvtSimpleRandomEngine();
-#endif
+ // Use the Mersenne-Twister generator
+ EvtRandomEngine* myRandomEngine = new EvtMTRandomEngine();
// Initialize the generator - read in the decay table and particle properties.
// For our validation purposes, we just want to read in one decay file and create
diff --git a/validation/genRootDecayChain.cc b/validation/genRootDecayChain.cc
--- a/validation/genRootDecayChain.cc
+++ b/validation/genRootDecayChain.cc
@@ -178,17 +178,12 @@
void genRootDecayChain::generateEvents()
{
- EvtRandomEngine* randomEngine = nullptr;
EvtAbsRadCorr* radCorrEngine = nullptr;
std::list<EvtDecayBase*> extraModels;
// Define the random number generator
-#ifdef EVTGEN_CPP11
- // Use the Mersenne-Twister generator (C++11 only)
- randomEngine = new EvtMTRandomEngine();
-#else
- randomEngine = new EvtSimpleRandomEngine();
-#endif
+ // Use the Mersenne-Twister generator
+ EvtRandomEngine* randomEngine = new EvtMTRandomEngine();
// Initialize the generator - read in the decay table and particle properties.
// For our validation purposes, we just want to read in one decay file
diff --git a/validation/testCPVDecays.cc b/validation/testCPVDecays.cc
--- a/validation/testCPVDecays.cc
+++ b/validation/testCPVDecays.cc
@@ -110,15 +110,8 @@
<< " (used to draw oscillation maxima lines)" << endl;
// Define the random number generator
-
- EvtRandomEngine* myRandomEngine = nullptr;
-
-#ifdef EVTGEN_CPP11
- // Use the Mersenne-Twister generator (C++11 only)
- myRandomEngine = new EvtMTRandomEngine();
-#else
- myRandomEngine = new EvtSimpleRandomEngine();
-#endif
+ // Use the Mersenne-Twister generator
+ EvtRandomEngine* myRandomEngine = new EvtMTRandomEngine();
EvtAbsRadCorr* radCorrEngine = nullptr;
std::list<EvtDecayBase*> extraModels;

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 3:55 PM (21 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3802346
Default Alt Text
D117.id482.diff (8 KB)

Event Timeline