Print

Print


Commit in slic on MAIN
GNUmakefile+1-71.38 -> 1.39
GNUmakefile.local.in+1-71.11 -> 1.12
aclocal.m4+2-21.27 -> 1.28
configure+11.96 -> 1.97
configure.ac+2-11.85 -> 1.86
include/Geant4VersionInfo.hh.in+39added 1.1
       /LCOpticalPhysics.hh+23-231.1 -> 1.2
       /SlicApplication.hh+186-1861.34 -> 1.35
src/LCOpticalPhysics.cc+54-551.4 -> 1.5
+309-281
1 added + 8 modified, total 9 files
JM: refactor access to G4 version info

slic
GNUmakefile 1.38 -> 1.39
diff -u -r1.38 -r1.39
--- GNUmakefile	15 Dec 2007 01:39:55 -0000	1.38
+++ GNUmakefile	17 Dec 2007 21:11:58 -0000	1.39
@@ -1,4 +1,4 @@
-# $Header: /cvs/lcd/slic/GNUmakefile,v 1.38 2007/12/15 01:39:55 jeremy Exp $
+# $Header: /cvs/lcd/slic/GNUmakefile,v 1.39 2007/12/17 21:11:58 jeremy Exp $
 #
 # Makefile for SLIC simulation package based on examples GNUmakefile by G. Cosmo.
 #
@@ -28,12 +28,6 @@
 CPPFLAGS += $(SLIC_CXXFLAGS)
 CPPFLAGS += $(SLIC_DEFS)
 
-# add Geant4 versioning
-# FIXME: DOES NOT BELONG HERE.
-CPPFLAGS += -DGEANT4_MAJOR_VERSION=$(GEANT4_MAJOR_VERSION)
-CPPFLAGS += -DGEANT4_MINOR_VERSION=$(GEANT4_MINOR_VERSION)
-CPPFLAGS += -DGEANT4_PATCH_VERSION=$(GEANT4_PATCH_VERSION)
-
 # SLIC make includes (gmk) dir
 MAKEINCLUDES := $(SLIC_BASE)/config/make
 

slic
GNUmakefile.local.in 1.11 -> 1.12
diff -u -r1.11 -r1.12
--- GNUmakefile.local.in	15 Dec 2007 01:31:59 -0000	1.11
+++ GNUmakefile.local.in	17 Dec 2007 21:11:58 -0000	1.12
@@ -1,4 +1,4 @@
-# $Header: /cvs/lcd/slic/GNUmakefile.local.in,v 1.11 2007/12/15 01:31:59 jeremy Exp $
+# $Header: /cvs/lcd/slic/GNUmakefile.local.in,v 1.12 2007/12/17 21:11:58 jeremy Exp $
 #
 # Local build settings generated by configure
 #
@@ -54,9 +54,3 @@
 # Flag that CLHEP 2.x is being used.
 CLHEP_MAJOR_VERSION=@CLHEP_MAJOR_VERSION@
 
-# Geant4 version
-GEANT4_FULL_VERSION=@GEANT4_FULL_VERSION@
-GEANT4_MAJOR_VERSION=@GEANT4_MAJOR_VERSION@
-GEANT4_MINOR_VERSION=@GEANT4_MINOR_VERSION@
-GEANT4_PATCH_VERSION=@GEANT4_PATCH_VERSION@
-

slic
aclocal.m4 1.27 -> 1.28
diff -u -r1.27 -r1.28
--- aclocal.m4	15 Dec 2007 01:31:59 -0000	1.27
+++ aclocal.m4	17 Dec 2007 21:11:58 -0000	1.28
@@ -1,4 +1,4 @@
-dnl $Header: /cvs/lcd/slic/aclocal.m4,v 1.27 2007/12/15 01:31:59 jeremy Exp $
+dnl $Header: /cvs/lcd/slic/aclocal.m4,v 1.28 2007/12/17 21:11:58 jeremy Exp $
 
 dnl /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
 dnl Autoconf macros for SLIC and its dependencies friends.
@@ -435,7 +435,7 @@
 
 AC_MSG_CHECKING(for LCDD installation)
 
-AC_ARG_WITH(lcdd,
+AC_ARG_WITH(lcdd, 
 	AC_HELP_STRING([--with-lcdd=<path>],[LCDD installation base [[LCDD_BASE]] ]),
 	[LCDD_PREFIX=$with_lcdd])
 

slic
configure 1.96 -> 1.97
diff -u -r1.96 -r1.97
--- configure	15 Dec 2007 01:31:59 -0000	1.96
+++ configure	17 Dec 2007 21:11:58 -0000	1.97
@@ -4082,6 +4082,7 @@
 	GNUmakefile.local
     ./config/doxygen/slic_doxygen.cfg
     ./config/setup/setup.sh
+    ./include/Geant4VersionInfo.hh
 	"
 
 if test -n "${SLIC_ENABLE_PACKAGE_INFO}"; then

slic
configure.ac 1.85 -> 1.86
diff -u -r1.85 -r1.86
--- configure.ac	12 Dec 2007 03:36:41 -0000	1.85
+++ configure.ac	17 Dec 2007 21:11:58 -0000	1.86
@@ -1,4 +1,4 @@
-# $Header: /cvs/lcd/slic/configure.ac,v 1.85 2007/12/12 03:36:41 jeremy Exp $
+# $Header: /cvs/lcd/slic/configure.ac,v 1.86 2007/12/17 21:11:58 jeremy Exp $
 #
 # Process this file with autoconf to produce a configure script for SLIC.
 #
@@ -101,6 +101,7 @@
 	GNUmakefile.local
     ./config/doxygen/slic_doxygen.cfg
     ./config/setup/setup.sh
+    ./include/Geant4VersionInfo.hh
 	"
 
 if test -n "${SLIC_ENABLE_PACKAGE_INFO}"; then

slic/include
Geant4VersionInfo.hh.in added at 1.1
diff -N Geant4VersionInfo.hh.in
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ Geant4VersionInfo.hh.in	17 Dec 2007 21:11:59 -0000	1.1
@@ -0,0 +1,39 @@
+#ifndef Geant4VersionInfo_hh
+#define Geant4VersionInfo_hh 1
+
+#include <string>
+
+/**
+  * Statically accessible Geant4 version information,
+  * including major, minor, and patch numbers and the
+  * full version string.
+  */
+class Geant4VersionInfo
+{
+    private:
+        Geant4VersionInfo() {;}
+
+    public:
+
+        static int getMajorVersion()
+        {
+            return @GEANT4_MAJOR_VERSION@;
+        }
+
+        static int getMinorVersion()
+        {
+            return @GEANT4_MINOR_VERSION@;
+        }
+
+        static int getPatchVersion()
+        {
+            return @GEANT4_PATCH_VERSION@;
+        }
+
+        static std::string getFullVersion()
+        {
+            return "@GEANT4_FULL_VERSION@";
+        }
+};
+
+#endif

slic/include
LCOpticalPhysics.hh 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- LCOpticalPhysics.hh	3 Jul 2007 18:01:30 -0000	1.1
+++ LCOpticalPhysics.hh	17 Dec 2007 21:11:59 -0000	1.2
@@ -21,29 +21,29 @@
 
 class LCOpticalPhysics : public G4VPhysicsConstructor
 {
-  public: 
-    LCOpticalPhysics(const G4String& name = "optical");
-    virtual ~LCOpticalPhysics();
-
-    // This method will be invoked in the Construct() method.
-    // each particle type will be instantiated
-    virtual void ConstructParticle();
-    // This method will be invoked in the Construct() method.
-    // each physics process will be instantiated and
-    // registered to the process manager of each particle type 
-    virtual void ConstructProcess();
-     //these methods Construct physics processes and register them
-    void                    ConstructOp();
-    //for the Messenger (not using it in slic) 
-    //void                    SetVerbose(G4int); 
-    //void                    SetNbOfPhotonsCerenkov(G4int);
-
-  protected:
-    G4Cerenkov*             theCerenkovProcess;	      
-    G4Scintillation*        theScintillationProcess;     
-    G4OpAbsorption*         theAbsorptionProcess;	      
-    G4OpRayleigh*           theRayleighScatteringProcess;
-    G4OpBoundaryProcess*    theBoundaryProcess;
+    public: 
+
+        LCOpticalPhysics(const G4String& name = "optical");
+
+        virtual ~LCOpticalPhysics();
+
+        // This method will be invoked in the Construct() method.
+        // each particle type will be instantiated
+        virtual void ConstructParticle();
+
+        // This method will be invoked in the Construct() method.
+        // each physics process will be instantiated and
+        // registered to the process manager of each particle type 
+        virtual void ConstructProcess();
+        //these methods Construct physics processes and register them
+        void                    ConstructOp();
+
+    protected:
+        G4Cerenkov*             theCerenkovProcess;	      
+        G4Scintillation*        theScintillationProcess;     
+        G4OpAbsorption*         theAbsorptionProcess;	      
+        G4OpRayleigh*           theRayleighScatteringProcess;
+        G4OpBoundaryProcess*    theBoundaryProcess;
 };
 
 

slic/include
SlicApplication.hh 1.34 -> 1.35
diff -u -r1.34 -r1.35
--- SlicApplication.hh	24 Sep 2007 21:00:02 -0000	1.34
+++ SlicApplication.hh	17 Dec 2007 21:11:59 -0000	1.35
@@ -1,4 +1,4 @@
-// $Header: /cvs/lcd/slic/include/SlicApplication.hh,v 1.34 2007/09/24 21:00:02 jeremy Exp $
+// $Header: /cvs/lcd/slic/include/SlicApplication.hh,v 1.35 2007/12/17 21:11:59 jeremy Exp $
 
 #ifndef SLIC_SLICAPPLICATION_HH
 #define SLIC_SLICAPPLICATION_HH 1
@@ -22,207 +22,207 @@
 
 namespace slic
 {
-  // slic
-  class FieldMessenger;
-  class SlicApplicationMessenger;
-  class RunManager;
-
-  /**
-   * @class SlicApplication
-   * @brief Singleton class for a Geant4 application.
-   * @note  Instantiates manager and messenger classes, including
-   *        user actions, G4RunManager, GeneratorManager, and PhysicsListManager.
-   */
-  class SlicApplication : public Singleton<SlicApplication>, public Module
-  {
-
-  public:
-
-    /** 
-     * Indicates the run mode: batch or interactive. 
-     */
-    enum ERunMode { eBatch=1, eInteractive=2 };
-
-  public:
-
-    /**
-     * The constructor.
-     */
-    SlicApplication();
-
-    /**
-     * The destructor.
-     */
-    virtual ~SlicApplication();
-
-  public:
-
-    /** 
-     * Return SLIC's RunManager instance.
-     */
-    RunManager* getRunManager();
-
-    /** 
-     * Initialize the application.
-     */
-    void initialize();
-
-    /**
-     * Run the application.
-     */
-    void run();
-
-    /**
-     * Print the usage by calling the CommandLineProcessor.
-     */
-    void printUsage();
-
-    /**
-     * Print the version string.
-     */
-    void printVersion();
-
-    /** 
-     * Print SLIC's splash screen. 
-     */
-    void printSplashScreen();
-
-    /** 
-     * Print the start time.
-     */
-    void printStartTime();
-
-    /** 
-     * Print the end time.
-     */
-    void printEndTime();
-
-    /** 
-     * Get the return code.
-     */
-    int getReturnCode() const;
-
-    /** 
-     * Get the run mode, interactive or batch.
-     */
-    ERunMode getMode() const;
-
-    /** 
-     * Set abort state.
-     */
-    void setAborting(bool a = true);
-
-    /** 
-     * Check abort state.
-     */
-    bool isAborting() const;
-
-    /** 
-     * Set the run mode.
-     */
-    void setMode(ERunMode rmode);
-
-    /** 
-     * Get the name of the binary as it was invoked.
-     */
-    const std::string& getBinaryName() const;
-
-    /** 
-     * Get the base name of the binary (file name only).
-     */
-    const std::string& getBinaryBasename() const;
-
-    /** 
-     * Setup SLIC from command line arguments using the CommandLineProcessor.
-     */
-    void initialize(int, char**);
-
-    /** 
-     * Set the return code.
-     */
-    void setReturnCode(int rc);
-
-    /**
-     * Get the Geant4 version string.
-     */
-    std::string getGeant4VersionString();
-
-  private:
-
-    /** 
-     * Set the binary base name from the full name.
-     */
-    void setBinaryBasename();
-
-    /** 
-     * Register the Geant4 user action classes with the G4RunManager.
-     */
-    void initializeUserActions();
-
-    /**
-     * Register the LCDDDetectorConstruction.
-     */
-    void initializeLCDD();
-
-    /**
-     * Setup the NistWriter.
-     */
-    void initializeNistWriter();
-
-    /**
-     * Register the PrimaryGeneratorAction.
-     */
-    void initializePrimaryGeneratorAction();
-
-    /** 
-     * Initialize the Geant4 user interface.
-     */
-    void initializeUI();
-
-    /**
-     * Initialize the Geant4 visualization subsystem.
-     */
+    // slic
+    class FieldMessenger;
+    class SlicApplicationMessenger;
+    class RunManager;
+
+    /**
+     * @class SlicApplication
+     * @brief Singleton class for a Geant4 application.
+     * @note  Instantiates manager and messenger classes, including
+     *        user actions, G4RunManager, GeneratorManager, and PhysicsListManager.
+     */
+    class SlicApplication : public Singleton<SlicApplication>, public Module
+    {
+
+        public:
+
+            /** 
+             * Indicates the run mode: batch or interactive. 
+             */
+            enum ERunMode { eBatch=1, eInteractive=2 };
+
+        public:
+
+            /**
+             * The constructor.
+             */
+            SlicApplication();
+
+            /**
+             * The destructor.
+             */
+            virtual ~SlicApplication();
+
+        public:
+
+            /** 
+             * Return SLIC's RunManager instance.
+             */
+            RunManager* getRunManager();
+
+            /** 
+             * Initialize the application.
+             */
+            void initialize();
+
+            /**
+             * Run the application.
+             */
+            void run();
+
+            /**
+             * Print the usage by calling the CommandLineProcessor.
+             */
+            void printUsage();
+
+            /**
+             * Print the version string.
+             */
+            void printVersion();
+
+            /** 
+             * Print SLIC's splash screen. 
+             */
+            void printSplashScreen();
+
+            /** 
+             * Print the start time.
+             */
+            void printStartTime();
+
+            /** 
+             * Print the end time.
+             */
+            void printEndTime();
+
+            /** 
+             * Get the return code.
+             */
+            int getReturnCode() const;
+
+            /** 
+             * Get the run mode, interactive or batch.
+             */
+            ERunMode getMode() const;
+
+            /** 
+             * Set abort state.
+             */
+            void setAborting(bool a = true);
+
+            /** 
+             * Check abort state.
+             */
+            bool isAborting() const;
+
+            /** 
+             * Set the run mode.
+             */
+            void setMode(ERunMode rmode);
+
+            /** 
+             * Get the name of the binary as it was invoked.
+             */
+            const std::string& getBinaryName() const;
+
+            /** 
+             * Get the base name of the binary (file name only).
+             */
+            const std::string& getBinaryBasename() const;
+
+            /** 
+             * Setup SLIC from command line arguments using the CommandLineProcessor.
+             */
+            void initialize(int, char**);
+
+            /** 
+             * Set the return code.
+             */
+            void setReturnCode(int rc);
+
+            /**
+             * Get the Geant4 version string.
+             */
+            std::string getGeant4VersionString();
+
+        private:
+
+            /** 
+             * Set the binary base name from the full name.
+             */
+            void setBinaryBasename();
+
+            /** 
+             * Register the Geant4 user action classes with the G4RunManager.
+             */
+            void initializeUserActions();
+
+            /**
+             * Register the LCDDDetectorConstruction.
+             */
+            void initializeLCDD();
+
+            /**
+             * Setup the NistWriter.
+             */
+            void initializeNistWriter();
+
+            /**
+             * Register the PrimaryGeneratorAction.
+             */
+            void initializePrimaryGeneratorAction();
+
+            /** 
+             * Initialize the Geant4 user interface.
+             */
+            void initializeUI();
+
+            /**
+             * Initialize the Geant4 visualization subsystem.
+             */
 #ifdef G4VIS_USE
-    void initializeVis();
+            void initializeVis();
 #endif
 
-  protected:
+        protected:
 
-    // UI session
-    G4UIsession* m_session;
+            // UI session
+            G4UIsession* m_session;
 
-    // vis manager
+            // vis manager
 #ifdef G4VIS_USE
-    VisManager* m_visManager;
+            VisManager* m_visManager;
 #endif
 
-    // app messenger
-    SlicApplicationMessenger* m_appMessenger;
+            // app messenger
+            SlicApplicationMessenger* m_appMessenger;
 
-    // field messenger
-    FieldMessenger* m_fieldMessenger;
+            // field messenger
+            FieldMessenger* m_fieldMessenger;
 
-    RunManager* m_runManager;
+            RunManager* m_runManager;
 
-    // application run mode: batch or interactive
-    ERunMode m_mode;
+            // application run mode: batch or interactive
+            ERunMode m_mode;
 
-    // return code
-    int m_returnCode;
+            // return code
+            int m_returnCode;
 
-    // hack to make aborting G4 work (doesn't seem to function properly)
-    bool m_setRunAbort;
+            // hack to make aborting G4 work (doesn't seem to function properly)
+            bool m_setRunAbort;
 
-    // Has the initialize() function been called?
-    bool m_isInitialized;
+            // Has the initialize() function been called?
+            bool m_isInitialized;
 
-    // What was the name of the SLIC binary from CL? (used by LcioFileNamer)
-    std::string m_binaryname;
-    std::string m_binarybasename;
+            // 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;
-  };
+            // Version string of Geant4.
+            std::string* m_geant4VersionString;
+    };
 }
 
 #endif

slic/src
LCOpticalPhysics.cc 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- LCOpticalPhysics.cc	17 Dec 2007 20:32:36 -0000	1.4
+++ LCOpticalPhysics.cc	17 Dec 2007 21:11:59 -0000	1.5
@@ -10,43 +10,35 @@
 
 #include "LCOpticalPhysics.hh"
 
-// #include "globals.hh"
-// #include "G4ios.hh"
-// #include <iomanip>   
+// slic
+#include "Geant4VersionInfo.hh"
 
 LCOpticalPhysics::LCOpticalPhysics(const G4String& name)
-                     :  G4VPhysicsConstructor(name)
-{
-}
+    :  G4VPhysicsConstructor(name)
+{}
 
 LCOpticalPhysics::~LCOpticalPhysics()
-{
-}
-
-
+{}
 
 void LCOpticalPhysics::ConstructParticle()
 {
-
-//  G4cout << "Inside LCOpticalPhysics::ConstructParticle()" << G4endl;
-
-  // optical photon
-  G4OpticalPhoton::OpticalPhotonDefinition();
+    // optical photon
+    G4OpticalPhoton::OpticalPhotonDefinition();
 }
 
 void LCOpticalPhysics::ConstructProcess()
 {
-  ConstructOp();
+    ConstructOp();
 
 }
 
 void LCOpticalPhysics::ConstructOp()
 {
-  theCerenkovProcess           = new G4Cerenkov("Cerenkov");
-  theScintillationProcess      = new G4Scintillation("Scintillation");
-  theAbsorptionProcess         = new G4OpAbsorption();
-  theRayleighScatteringProcess = new G4OpRayleigh();
-  theBoundaryProcess           = new G4OpBoundaryProcess();
+    theCerenkovProcess           = new G4Cerenkov("Cerenkov");
+    theScintillationProcess      = new G4Scintillation("Scintillation");
+    theAbsorptionProcess         = new G4OpAbsorption();
+    theRayleighScatteringProcess = new G4OpRayleigh();
+    theBoundaryProcess           = new G4OpBoundaryProcess();
 
 //  theCerenkovProcess->DumpPhysicsTable();
 //  theScintillationProcess->DumpPhysicsTable();
@@ -58,44 +50,51 @@
 //#ifdef debug  
 //  G4cout << "VERBOSE = " << theCerenkovProcess->GetVerboseLevel() << G4endl;
 //  G4cout << "Inside LCOpticalPhysics::ConstructOp()" << G4endl;
-  //#endif
+    //#endif
   
   
-  theCerenkovProcess->SetMaxNumPhotonsPerStep(300);
-  theCerenkovProcess->SetTrackSecondariesFirst(true);
+    theCerenkovProcess->SetMaxNumPhotonsPerStep(300);
+    theCerenkovProcess->SetTrackSecondariesFirst(true);
   
-  theScintillationProcess->SetScintillationYieldFactor(1.);
-  theScintillationProcess->SetTrackSecondariesFirst(true);
-
-  G4OpticalSurfaceModel themodel = unified;
-  theBoundaryProcess->SetModel(themodel);
+    theScintillationProcess->SetScintillationYieldFactor(1.);
+    theScintillationProcess->SetTrackSecondariesFirst(true);
 
-  theParticleIterator->reset();
-  while( (*theParticleIterator)() ){
+    G4OpticalSurfaceModel themodel = unified;
+    theBoundaryProcess->SetModel(themodel);
 
-    G4ParticleDefinition* particle = theParticleIterator->value();
-    G4ProcessManager* pmanager     = particle->GetProcessManager();
-    G4String particleName          = particle->GetParticleName();
-
-    if (theCerenkovProcess->IsApplicable(*particle)) 
-    {        
-#if (GEANT4_MAJOR_VERSION >= 9) && (GEANT4_MINOR_VERSION >= 1)
-        // Changed to a post-step process in the Geant4 9.1 release.
-        pmanager->AddProcess(theCerenkovProcess);
-        pmanager->SetProcessOrderingToLast(theCerenkovProcess, idxPostStep);
-#else
-        pmanager->AddContinuousProcess(theCerenkovProcess);
-#endif             
-    }
-    if (theScintillationProcess->IsApplicable(*particle)) {
-      pmanager->AddProcess(theScintillationProcess);
-      pmanager->SetProcessOrderingToLast(theScintillationProcess, idxAtRest);
-      pmanager->SetProcessOrderingToLast(theScintillationProcess, idxPostStep);
-    }
-    if (particleName == "opticalphoton") {
-      pmanager->AddDiscreteProcess(theAbsorptionProcess);
-      pmanager->AddDiscreteProcess(theRayleighScatteringProcess);
-      pmanager->AddDiscreteProcess(theBoundaryProcess);
+    theParticleIterator->reset();
+    
+    while( (*theParticleIterator)() )
+    {
+
+        G4ParticleDefinition* particle = theParticleIterator->value();
+        G4ProcessManager* pmanager     = particle->GetProcessManager();
+        G4String particleName          = particle->GetParticleName();
+
+        if (theCerenkovProcess->IsApplicable(*particle)) 
+        {        
+            if (Geant4VersionInfo::getMajorVersion() >= 9 && Geant4VersionInfo::getMinorVersion() >= 1)
+            {
+                // Geant4 9.1 changes Cerenkov to be a post-step process.
+                pmanager->AddProcess(theCerenkovProcess);
+                pmanager->SetProcessOrderingToLast(theCerenkovProcess, idxPostStep);
+            }
+            else
+            {
+                pmanager->AddContinuousProcess(theCerenkovProcess);
+            }
+        }
+        if (theScintillationProcess->IsApplicable(*particle)) 
+        {
+            pmanager->AddProcess(theScintillationProcess);
+            pmanager->SetProcessOrderingToLast(theScintillationProcess, idxAtRest);
+            pmanager->SetProcessOrderingToLast(theScintillationProcess, idxPostStep);
+        }
+        if (particleName == "opticalphoton") 
+        {
+            pmanager->AddDiscreteProcess(theAbsorptionProcess);
+            pmanager->AddDiscreteProcess(theRayleighScatteringProcess);
+            pmanager->AddDiscreteProcess(theBoundaryProcess);
+        }
     }
-  }
 }
CVSspam 0.2.8