10 modified files
slic
diff -u -r1.24 -r1.25
--- aclocal.m4 12 Jul 2007 18:11:36 -0000 1.24
+++ aclocal.m4 24 Sep 2007 21:00:01 -0000 1.25
@@ -1,4 +1,4 @@
-dnl $Header: /cvs/lcd/slic/aclocal.m4,v 1.24 2007/07/12 18:11:36 jeremy Exp $
+dnl $Header: /cvs/lcd/slic/aclocal.m4,v 1.25 2007/09/24 21:00:01 jeremy Exp $
dnl /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
dnl Autoconf macros for SLIC and its dependencies friends.
@@ -165,6 +165,54 @@
])
+dnl Macro to check whether to enable NIST.
+AC_DEFUN(AC_USE_G4NIST, [
+
+AC_MSG_CHECKING(whether to enable NIST)
+
+AC_ARG_ENABLE([nist],
+ AC_HELP_STRING([--enable-nist=<yes|no>], [Enable NIST material lookup in Geant4.]),
+ ,
+ )
+
+if test "${enable_nist}" = "yes" && test -n "${HAVE_NIST}"; then
+ AC_DEFINE(USE_G4NIST)
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
+])
+
+
+dnl
+AC_DEFUN(AC_HAVE_G4VERSION, [
+
+AC_MSG_CHECKING(for G4Version.hh)
+
+if test -e $G4INSTALL/source/global/management/include/G4Version.hh; then
+ AC_DEFINE(HAVE_G4VERSION)
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
+])
+
+dnl
+AC_DEFUN(AC_HAVE_G4PHYSICSLISTS, [
+
+AC_MSG_CHECKING(for Geant4 physics lists in main source tree)
+
+if test -e $G4INSTALL/source/physics_lists/lists/include/LHEP.hh; then
+ AC_DEFINE(HAVE_G4PHYSICSLISTS)
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
+])
+
dnl /\/\/\ Geant4 /\/\/\
AC_DEFUN(SIM_SETUP_G4, [
slic
diff -u -r1.85 -r1.86
--- configure 14 Sep 2007 21:50:33 -0000 1.85
+++ configure 24 Sep 2007 21:00:01 -0000 1.86
@@ -853,6 +853,7 @@
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-package-info Rewrite include/PackageInfo.hh
+ --enable-nist=<yes|no> Enable NIST material lookup in Geant4.
--enable-lcphys=<yes|no>
enable LCPhys library
--enable-debug turn on debug code by defining SLIC_DEBUG; default =
@@ -3277,6 +3278,24 @@
+echo "$as_me:$LINENO: checking for G4Version.hh" >&5
+echo $ECHO_N "checking for G4Version.hh... $ECHO_C" >&6
+
+if test -e $G4INSTALL/source/global/management/include/G4Version.hh; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_G4VERSION 1
+_ACEOF
+
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+
+
echo "$as_me:$LINENO: checking for G4NistManager.hh" >&5
echo $ECHO_N "checking for G4NistManager.hh... $ECHO_C" >&6
@@ -3294,6 +3313,48 @@
+
+echo "$as_me:$LINENO: checking whether to enable NIST" >&5
+echo $ECHO_N "checking whether to enable NIST... $ECHO_C" >&6
+
+# Check whether --enable-nist or --disable-nist was given.
+if test "${enable_nist+set}" = set; then
+ enableval="$enable_nist"
+
+fi;
+
+if test "${enable_nist}" = "yes" && test -n "${HAVE_NIST}"; then
+ cat >>confdefs.h <<\_ACEOF
+#define USE_G4NIST 1
+_ACEOF
+
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+
+
+echo "$as_me:$LINENO: checking for Geant4 physics lists in main source tree" >&5
+echo $ECHO_N "checking for Geant4 physics lists in main source tree... $ECHO_C" >&6
+
+if test -e $G4INSTALL/source/physics_lists/lists/include/LHEP.hh; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_G4PHYSICSLISTS 1
+_ACEOF
+
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+
# CLHEP
slic
diff -u -r1.75 -r1.76
--- configure.ac 14 Sep 2007 21:50:33 -0000 1.75
+++ configure.ac 24 Sep 2007 21:00:01 -0000 1.76
@@ -1,4 +1,4 @@
-# $Header: /cvs/lcd/slic/configure.ac,v 1.75 2007/09/14 21:50:33 jeremy Exp $
+# $Header: /cvs/lcd/slic/configure.ac,v 1.76 2007/09/24 21:00:01 jeremy Exp $
#
# Process this file with autoconf to produce a configure script for SLIC.
#
@@ -48,7 +48,10 @@
# G4
SIM_SETUP_G4
+AC_HAVE_G4VERSION
AC_HAVE_G4NIST
+AC_USE_G4NIST
+AC_HAVE_G4PHYSICSLISTS
# CLHEP
SIM_SETUP_CLHEP
slic/config/doxygen
diff -u -r1.12 -r1.13
--- slic_doxygen.cfg 12 Jul 2007 18:11:37 -0000 1.12
+++ slic_doxygen.cfg 24 Sep 2007 21:00:02 -0000 1.13
@@ -1,5 +1,5 @@
PROJECT_NAME = "Simulator for the Linear Collider"
-PROJECT_NUMBER = v2r3p1
+PROJECT_NUMBER = v2r3p3
OUTPUT_DIRECTORY = $(SLIC_BASE)/doc
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
slic/include
diff -u -r1.8 -r1.9
--- LcioFileNamer.hh 27 Apr 2007 01:54:32 -0000 1.8
+++ LcioFileNamer.hh 24 Sep 2007 21:00:02 -0000 1.9
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/include/LcioFileNamer.hh,v 1.8 2007/04/27 01:54:32 jeremy Exp $
+// $Header: /cvs/lcd/slic/include/LcioFileNamer.hh,v 1.9 2007/09/24 21:00:02 jeremy Exp $
#ifndef SLIC_LCIOFILENAMER_HH
#define SLIC_LCIOFILENAMER_HH 1
@@ -44,6 +44,8 @@
static std::string makeRunNumberString();
static std::string makeEventNumberString();
+ static std::string getGeant4VersionString();
+
private:
static std::string m_sep;
slic/include
diff -u -r1.33 -r1.34
--- SlicApplication.hh 27 Apr 2007 01:54:32 -0000 1.33
+++ SlicApplication.hh 24 Sep 2007 21:00:02 -0000 1.34
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/include/SlicApplication.hh,v 1.33 2007/04/27 01:54:32 jeremy Exp $
+// $Header: /cvs/lcd/slic/include/SlicApplication.hh,v 1.34 2007/09/24 21:00:02 jeremy Exp $
#ifndef SLIC_SLICAPPLICATION_HH
#define SLIC_SLICAPPLICATION_HH 1
@@ -142,6 +142,11 @@
*/
void setReturnCode(int rc);
+ /**
+ * Get the Geant4 version string.
+ */
+ std::string getGeant4VersionString();
+
private:
/**
@@ -214,6 +219,9 @@
// What was the name of the SLIC binary from CL? (used by LcioFileNamer)
std::string m_binaryname;
std::string m_binarybasename;
+
+ // Version string of Geant4.
+ std::string* m_geant4VersionString;
};
}
slic/src
diff -u -r1.19 -r1.20
--- LcioFileNamer.cc 14 Sep 2007 21:49:59 -0000 1.19
+++ LcioFileNamer.cc 24 Sep 2007 21:00:02 -0000 1.20
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/src/LcioFileNamer.cc,v 1.19 2007/09/14 21:49:59 jeremy Exp $
+// $Header: /cvs/lcd/slic/src/LcioFileNamer.cc,v 1.20 2007/09/24 21:00:02 jeremy Exp $
#include "LcioFileNamer.hh"
// lcdd
@@ -17,7 +17,6 @@
// geant4
#include "G4Run.hh"
#include "G4RunManager.hh"
-#include "G4Version.hh"
// stl
#include <sstream>
@@ -67,10 +66,7 @@
value = PhysicsListManager::instance()->getCurrentListName();
}
else if ( field == "geant4" ) {
- static std::string g4ver = StringUtil::toString(G4VERSION_NUMBER);
- std::stringstream s;
- s << "geant4-" << "v" << g4ver[0] << "r" << g4ver[1] << "p" << g4ver[2];
- value = s.str();
+ value = SlicApplication::instance()->getGeant4VersionString();
}
else {
#ifdef SLIC_LOG
slic/src
diff -u -r1.76 -r1.77
--- LcioManager.cc 27 Apr 2007 01:54:34 -0000 1.76
+++ LcioManager.cc 24 Sep 2007 21:00:02 -0000 1.77
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/src/LcioManager.cc,v 1.76 2007/04/27 01:54:34 jeremy Exp $
+// $Header: /cvs/lcd/slic/src/LcioManager.cc,v 1.77 2007/09/24 21:00:02 jeremy Exp $
#include "LcioManager.hh"
// slic
@@ -32,7 +32,6 @@
#include "G4TrajectoryContainer.hh"
#include "G4VHitsCollection.hh"
#include "G4SDManager.hh"
-#include "G4Version.hh"
// std
#include <ctime>
@@ -262,7 +261,7 @@
m_runHdr->parameters().setValue("APP_STRING", PackageInfo::getFullApplicationString());
// Write Geant4 version into run header.
- m_runHdr->parameters().setValue("GEANT4_VERSION", G4Version);
+ m_runHdr->parameters().setValue("GEANT4_VERSION", SlicApplication::instance()->getGeant4VersionString());
// set run number
m_runHdr->setRunNumber(m_runNumber);
slic/src
diff -u -r1.19 -r1.20
--- PhysicsListFactory.cc 2 Jul 2007 17:27:32 -0000 1.19
+++ PhysicsListFactory.cc 24 Sep 2007 21:00:02 -0000 1.20
@@ -1,7 +1,8 @@
-// $Header: /cvs/lcd/slic/src/PhysicsListFactory.cc,v 1.19 2007/07/02 17:27:32 jeremy Exp $
+// $Header: /cvs/lcd/slic/src/PhysicsListFactory.cc,v 1.20 2007/09/24 21:00:02 jeremy Exp $
#include "PhysicsListFactory.hh"
// geant4 physics lists
+#ifdef HAVE_G4PHYSICSLISTS
#include "FTFC.hh"
#include "FTFP.hh"
#include "FTFP_EMV.hh"
@@ -28,6 +29,7 @@
#include "QGSP_EMX.hh"
#include "QGSP_NQE.hh"
#include "QGSP_QEL.hh"
+#endif
// lcphys
#ifdef SLIC_USE_LCPHYS
@@ -110,6 +112,7 @@
BUILDER_LCPHYS(LCPhysicsList, "LCPhys", "ILC Physics List by Dennis Wright.")
#endif
+#ifdef HAVE_G4PHYSICSLISTS
BUILDER(FTFC, "Fritiof with CHIPS")
BUILDER(FTFP, "Fritiof with precompound")
BUILDER(FTFP_EMV, "FTFP with v 7.1 EM processes")
@@ -136,6 +139,7 @@
BUILDER(QGSP_EMX, "QGSP with v 7.2 EM processes")
BUILDER(QGSP_NQE, "QGSP with quasi-elastic processes removed")
BUILDER(QGSP_QEL, "QGSP with elastic cross sections and model from CHIPS")
+#endif
}
void PhysicsListFactory::addBuilder( VPhysicsListBuilder* builder)
slic/src
diff -u -r1.44 -r1.45
--- SlicApplication.cc 12 Jul 2007 18:11:37 -0000 1.44
+++ SlicApplication.cc 24 Sep 2007 21:00:02 -0000 1.45
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/src/SlicApplication.cc,v 1.44 2007/07/12 18:11:37 jeremy Exp $
+// $Header: /cvs/lcd/slic/src/SlicApplication.cc,v 1.45 2007/09/24 21:00:02 jeremy Exp $
#include "SlicApplication.hh"
@@ -27,7 +27,7 @@
// lcdd
#include "LCDDDetectorConstruction.hh"
-#ifdef HAVE_G4NIST
+#ifdef USE_G4NIST
#include "NistWriterMessenger.hh"
#endif
@@ -50,6 +50,10 @@
#endif
#endif // G4UI_NONE
+#ifdef HAVE_G4VERSION
+#include "G4Version.hh"
+#endif
+
namespace slic
{
@@ -64,7 +68,8 @@
m_mode(SlicApplication::eBatch),
m_returnCode(0),
m_setRunAbort(false),
- m_isInitialized(false)
+ m_isInitialized(false),
+ m_geant4VersionString(0)
{
log() << LOG::okay << LOG::head << "SLIC is starting" << LOG::done;
}
@@ -151,7 +156,7 @@
// Setup the LCDD subsystem.
initializeLCDD();
-#ifdef HAVE_G4NIST
+#ifdef USE_G4NIST
// Setup the NIST Writer.
initializeNistWriter();
#endif
@@ -358,11 +363,39 @@
CommandLineProcessor::instance()->printUsage();
}
-#ifdef HAVE_G4NIST
+#ifdef USE_G4NIST
void SlicApplication::initializeNistWriter()
{
new NistWriterMessenger();
}
#endif
+ std::string SlicApplication::getGeant4VersionString()
+ {
+ if (m_geant4VersionString == 0) {
+ std::string g4ver;
+#ifdef HAVE_G4VERSION
+ g4ver = StringUtil::toString(G4VERSION_NUMBER);
+#else
+ // Massage the string returned by G4RunManager into format
+ // returned by G4Version in recent Geant4 versions.
+ g4ver = G4RunManager::GetRunManager()->GetVersionString();
+ std::string::size_type start = g4ver.find("geant4-",0) + 7;
+ std::string::size_type end = g4ver.find(" ",start);
+ g4ver = g4ver.substr(start, end - start);
+ std::string g4major = g4ver.substr(1,1);
+ std::string g4minor = g4ver.substr(4,1);
+ std::string g4patch = "0";
+ if (g4ver.find("patch") != string::npos) {
+ g4patch = g4ver.substr(13,1);
+ }
+ g4ver = g4major + g4minor + g4patch;
+#endif
+ std::stringstream s;
+ s << "geant4-" << "v" << g4ver[0] << "r" << g4ver[1] << "p" << g4ver[2];
+ m_geant4VersionString = new std::string(s.str());
+ }
+ return *m_geant4VersionString;
+ }
+
} // namespace slic
CVSspam 0.2.8