Import Geant4 9.4.0 source tree
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
#------------------------------------------------------------------------------
|
||||
# CMakeLists.txt
|
||||
# Module : G4run
|
||||
# Package: Geant4.src.G4run
|
||||
#
|
||||
# CMakeLists.txt for single level library that may be build global or granular
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: CMakeLists.txt,v 1.1 2010/09/29 19:10:34 bmorgan Exp $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
include(Geant4MacroLibraryTargets)
|
||||
if(GEANT4_BUILD_GRANULAR_LIBS)
|
||||
GEANT4_GRANULAR_LIBRARY_TARGET(COMPONENT sources.cmake)
|
||||
else()
|
||||
GEANT4_GLOBAL_LIBRARY_TARGET(COMPONENTS sources.cmake)
|
||||
endif()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.16 2007/07/13 05:56:42 asaim Exp $
|
||||
# $Id: GNUmakefile,v 1.18 2010/10/27 07:50:15 gcosmo Exp $
|
||||
# ----------------------------------------------------------
|
||||
# GNUmakefile for run library. Gabriele Cosmo, 3/4/1997.
|
||||
# ----------------------------------------------------------
|
||||
|
||||
+50
-1
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.191 2009/11/18 18:02:06 gcosmo Exp $
|
||||
$Id: History,v 1.203 2010/12/05 12:13:04 allison Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -17,6 +17,55 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
December 5th, 2010, J.Allison (run-V09-03-09)
|
||||
- G4RunManagerKernel::RunInitialization: Notify Vis Manager when
|
||||
geometry needs to be closed.
|
||||
|
||||
November 24th, 2010, M.Asai (run-V09-03-08)
|
||||
- Adding Score Splitter process if the geometry has a regular
|
||||
parameterized volume.
|
||||
- Adding protection against particle without process manager.
|
||||
|
||||
November 15th, 2010, M.Asai (run-V09-03-07)
|
||||
- Change methods name to remove ambiguity.
|
||||
G4RunManager::ReOptimizeMotherOf() and ReOptimizeForDaughtersOf().
|
||||
|
||||
November 5th, 2010, M.Asai (run-V09-03-06)
|
||||
- Introducing two new methods in G4RunManager class
|
||||
G4RunManager::ReOptimizeMother() and ReOptimizeLogicalVolume()
|
||||
These methods cause re-optimization (re-voxelization) of one particular
|
||||
logical volume without forcing re-optimization of the entire geometrical
|
||||
hierarchy.
|
||||
|
||||
October 27th, 2010, G.Cosmo (run-V09-03-05)
|
||||
- Restored DLL setup as originally. Withdrawn changes in last tag.
|
||||
|
||||
October 19th, 2010, G.Cosmo (run-V09-03-04)
|
||||
- Replaced G4RUN_ALLOC_EXPORT flag with G4ALLOC_EXPORT for DLL exported
|
||||
symbols.
|
||||
|
||||
September 3rd, 2010 G.Cosmo (run-V09-03-03)
|
||||
- Added missing inclusion of <sstream> header in G4AdjointSimMessenger.cc.
|
||||
|
||||
July 21st, 2010 G.Cosmo (run-V09-03-02)
|
||||
- Added dummy initialisation of data members in constructors for classes:
|
||||
G4AdjointPrimaryGeneratorAction,
|
||||
- Use canonical form for exceptions in G4RunManager and added dummy return
|
||||
statements; same in G4VUserPhysicsList.
|
||||
|
||||
June 10th, 2010 G.Cosmo (run-V09-03-01)
|
||||
- Fixed definition of path for Windows in G4RunManager for random seeds
|
||||
directory: use '\' instead of '/' and suitable system command.
|
||||
- Use "const G4String&" as arguments and return value wherever applicable
|
||||
in G4RunManager and G4RunManagerKernel.
|
||||
- Avoid case of dereferencing null pointer in G4RunManagerKernel.
|
||||
|
||||
May 30th, 2010 M.Asai (run-V09-03-00)
|
||||
- Tag for v9.4-beta release
|
||||
|
||||
May 11th, 2010 J.Allison
|
||||
- Correct printing of number of events processed on run abortion.
|
||||
|
||||
November 18th, 2009 G.Cosmo (run-V09-02-09)
|
||||
- Fixes to "Adjoint" classes to allow build of DLLs on Windows: renamed all
|
||||
methods and data holding "External" as keyword to "Ext".
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4AdjointPrimaryGeneratorAction.hh,v 1.2 2009/11/18 18:02:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
// $Id: G4AdjointPrimaryGeneratorAction.hh,v 1.3 2010/07/21 14:21:19 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04 $
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
// Class Name: G4AdjointPosOnPhysVolGenerator
|
||||
// Class Name: G4AdjointPrimaryGeneratorAction
|
||||
// Author: L. Desorgher
|
||||
// Organisation: SpaceIT GmbH
|
||||
// Contract: ESA contract 21435/08/NL/AT
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunManager.hh,v 1.52 2009/11/13 23:14:46 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
// $Id: G4RunManager.hh,v 1.55 2010/11/15 09:49:32 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -79,6 +79,7 @@ class G4UserTrackingAction;
|
||||
class G4UserSteppingAction;
|
||||
|
||||
class G4VPhysicalVolume;
|
||||
class G4LogicalVolume;
|
||||
class G4Region;
|
||||
class G4Timer;
|
||||
class G4RunMessenger;
|
||||
@@ -91,7 +92,7 @@ class G4PrimaryTransformer;
|
||||
#include "G4EventManager.hh"
|
||||
#include "globals.hh"
|
||||
#include <vector>
|
||||
#include <stdlib.h>
|
||||
#include <algorithm>
|
||||
|
||||
class G4RunManager
|
||||
{
|
||||
@@ -201,7 +202,7 @@ class G4RunManager
|
||||
// At RunInitialization(), this method is automatically invoked, and thus
|
||||
// the user needs not invoke.
|
||||
|
||||
void DumpRegion(G4String rname) const;
|
||||
void DumpRegion(const G4String& rname) const;
|
||||
// Dump information of a region.
|
||||
|
||||
void DumpRegion(G4Region* region=0) const;
|
||||
@@ -259,7 +260,7 @@ class G4RunManager
|
||||
public:
|
||||
virtual void rndmSaveThisRun();
|
||||
virtual void rndmSaveThisEvent();
|
||||
virtual void RestoreRandomNumberStatus(G4String fileN);
|
||||
virtual void RestoreRandomNumberStatus(const G4String& fileN);
|
||||
|
||||
public: // with description
|
||||
inline void SetUserInitialization(G4VUserDetectorConstruction* userInit)
|
||||
@@ -319,7 +320,7 @@ class G4RunManager
|
||||
// Once the user set the number of additional waiting stacks,
|
||||
// he/she can use the corresponding ENUM in G4ClassificationOfNewTrack.
|
||||
|
||||
inline G4String GetVersionString() const
|
||||
inline const G4String& GetVersionString() const
|
||||
{ return kernel->GetVersionString(); }
|
||||
|
||||
inline void SetPrimaryTransformer(G4PrimaryTransformer* pt)
|
||||
@@ -342,16 +343,21 @@ class G4RunManager
|
||||
{ storeRandomNumberStatus = flag; }
|
||||
inline G4bool GetRandomNumberStore() const
|
||||
{ return storeRandomNumberStatus; }
|
||||
inline void SetRandomNumberStoreDir(G4String dir)
|
||||
inline void SetRandomNumberStoreDir(const G4String& dir)
|
||||
{
|
||||
G4String dirStr = dir;
|
||||
if( dirStr(dirStr.length()-1) != '/' ) dirStr += "/";
|
||||
randomNumberStatusDir = dirStr;
|
||||
#ifndef WIN32
|
||||
G4String shellCmd = "mkdir -p ";
|
||||
#else
|
||||
std::replace(dirStr.begin(), dirStr.end(),'/','\\');
|
||||
G4String shellCmd = "mkdir ";
|
||||
#endif
|
||||
shellCmd += dirStr;
|
||||
randomNumberStatusDir = dirStr;
|
||||
system(shellCmd);
|
||||
}
|
||||
inline G4String GetRandomNumberStoreDir() const
|
||||
inline const G4String& GetRandomNumberStoreDir() const
|
||||
{ return randomNumberStatusDir; }
|
||||
inline const G4String& GetRandomNumberStatusForThisRun() const
|
||||
{ return randomNumberStatusForThisRun; }
|
||||
@@ -384,6 +390,17 @@ class G4RunManager
|
||||
G4cerr << "It is safe to remove invoking this method." << G4endl;
|
||||
}
|
||||
|
||||
public: // with description
|
||||
void ReOptimizeMotherOf(G4VPhysicalVolume*);
|
||||
// This method may be used if the orientation and/or size of this
|
||||
// particular physical volume has been modified while rest of the
|
||||
// geometries in the world has not been changed. This avoids the
|
||||
// full re-optimization of the entire geometry tree which is forced
|
||||
// if GeometryHasBeenModified() method is invoked.
|
||||
|
||||
void ReOptimize(G4LogicalVolume*);
|
||||
// Same as above, but the mother logical volume is specified.
|
||||
|
||||
public:
|
||||
inline void SetVerboseLevel(G4int vl)
|
||||
{ verboseLevel = vl;
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunManagerKernel.hh,v 1.9 2007/05/30 00:42:09 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4RunManagerKernel.hh,v 1.11 2010/11/18 13:46:06 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -85,7 +85,7 @@ class G4RunManagerKernel
|
||||
|
||||
public: // with description
|
||||
void DefineWorldVolume(G4VPhysicalVolume * worldVol,
|
||||
G4bool topologyIsChanged=true);
|
||||
G4bool topologyIsChanged=true);
|
||||
// This method must be invoked if the geometry setup has been changed between
|
||||
// runs. The flag 'topologyIsChanged' will specify if the geometry topology is
|
||||
// different from the original one used in the previous run; if not, it must be
|
||||
@@ -120,7 +120,7 @@ class G4RunManagerKernel
|
||||
// At RunInitialization(), this method is automatically invoked, and thus
|
||||
// the user needs not invoke.
|
||||
|
||||
void DumpRegion(G4String rname) const;
|
||||
void DumpRegion(const G4String& rname) const;
|
||||
// Dump information of a region.
|
||||
|
||||
void DumpRegion(G4Region* region=0) const;
|
||||
@@ -169,7 +169,7 @@ class G4RunManagerKernel
|
||||
inline G4PrimaryTransformer* GetPrimaryTransformer() const
|
||||
{ return eventManager->GetPrimaryTransformer(); }
|
||||
|
||||
inline G4String GetVersionString() const
|
||||
inline const G4String& GetVersionString() const
|
||||
{ return versionString; }
|
||||
|
||||
inline void SetVerboseLevel(G4int vl)
|
||||
@@ -190,7 +190,9 @@ class G4RunManagerKernel
|
||||
{ numberOfParallelWorld = i; }
|
||||
|
||||
private:
|
||||
void CheckRegularGeometry();
|
||||
G4bool ConfirmCoupledTransportation();
|
||||
void SetScoreSplitter();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
#------------------------------------------------------------------------------
|
||||
# sources.cmake
|
||||
# Module : G4run
|
||||
# Package: Geant4.src.G4run
|
||||
#
|
||||
# Sources description for a library.
|
||||
# Lists the sources and headers of the code explicitely.
|
||||
# Lists include paths needed.
|
||||
# Lists the internal granular and global dependencies of the library.
|
||||
# Source specific properties should be added at the end.
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: sources.cmake,v 1.1 2010/09/29 19:10:42 bmorgan Exp $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
# List external includes needed.
|
||||
include_directories(${CLHEP_INCLUDE_DIRS})
|
||||
|
||||
# List internal includes needed.
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/digits_hits/detector/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/digits_hits/digits/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/digits_hits/hits/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/digits_hits/utils/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/event/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/biasing/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/magneticfield/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/management/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/navigation/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/geometry/volumes/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/global/HEPGeometry/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/global/HEPRandom/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/global/management/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/graphics_reps/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/intercoms/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/materials/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/particles/management/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/cuts/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/decay/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/electromagnetic/utils/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/management/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/management/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/scoring/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/transportation/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/track/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/tracking/include)
|
||||
|
||||
#
|
||||
# Define the Geant4 Module.
|
||||
#
|
||||
include(Geant4MacroDefineModule)
|
||||
GEANT4_DEFINE_MODULE(NAME G4run
|
||||
HEADERS
|
||||
G4AdjointPrimaryGeneratorAction.hh
|
||||
G4AdjointSimManager.hh
|
||||
G4AdjointSimMessenger.hh
|
||||
G4ExceptionHandler.hh
|
||||
G4MSSteppingAction.hh
|
||||
G4MatScanMessenger.hh
|
||||
G4MaterialScanner.hh
|
||||
G4Run.hh
|
||||
G4RunManager.hh
|
||||
G4RunManagerKernel.hh
|
||||
G4RunMessenger.hh
|
||||
G4UserPhysicsListMessenger.hh
|
||||
G4UserRunAction.hh
|
||||
G4VModularPhysicsList.hh
|
||||
G4VPersistencyManager.hh
|
||||
G4VPhysicsConstructor.hh
|
||||
G4VUserDetectorConstruction.hh
|
||||
G4VUserParallelWorld.hh
|
||||
G4VUserPhysicsList.hh
|
||||
G4VUserPrimaryGeneratorAction.hh
|
||||
SOURCES
|
||||
G4AdjointPrimaryGeneratorAction.cc
|
||||
G4AdjointSimManager.cc
|
||||
G4AdjointSimMessenger.cc
|
||||
G4ExceptionHandler.cc
|
||||
G4MSSteppingAction.cc
|
||||
G4MatScanMessenger.cc
|
||||
G4MaterialScanner.cc
|
||||
G4Run.cc
|
||||
G4RunManager.cc
|
||||
G4RunManagerKernel.cc
|
||||
G4RunMessenger.cc
|
||||
G4UserPhysicsListMessenger.cc
|
||||
G4UserRunAction.cc
|
||||
G4VModularPhysicsList.cc
|
||||
G4VPersistencyManager.cc
|
||||
G4VUserDetectorConstruction.cc
|
||||
G4VUserParallelWorld.cc
|
||||
G4VUserPhysicsList.cc
|
||||
G4VUserPrimaryGeneratorAction.cc
|
||||
GRANULAR_DEPENDENCIES
|
||||
G4cuts
|
||||
G4decay
|
||||
G4detector
|
||||
G4detutils
|
||||
G4digits
|
||||
G4emutils
|
||||
G4event
|
||||
G4geombias
|
||||
G4geometrymng
|
||||
G4globman
|
||||
G4graphics_reps
|
||||
G4hits
|
||||
G4intercoms
|
||||
G4magneticfield
|
||||
G4materials
|
||||
G4navigation
|
||||
G4partman
|
||||
G4procman
|
||||
G4scoring
|
||||
G4track
|
||||
G4tracking
|
||||
G4transportation
|
||||
G4volumes
|
||||
GLOBAL_DEPENDENCIES
|
||||
G4digits_hits
|
||||
G4event
|
||||
G4geometry
|
||||
G4global
|
||||
G4graphics_reps
|
||||
G4intercoms
|
||||
G4materials
|
||||
G4particles
|
||||
G4processes
|
||||
G4track
|
||||
G4tracking
|
||||
LINK_LIBRARIES
|
||||
)
|
||||
|
||||
# List any source specific properties here
|
||||
|
||||
@@ -23,11 +23,11 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4AdjointPrimaryGeneratorAction.cc,v 1.2 2009/11/18 18:02:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
// $Id: G4AdjointPrimaryGeneratorAction.cc,v 1.3 2010/07/21 14:21:19 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04 $
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Class Name: G4AdjointCrossSurfChecker
|
||||
// Class Name: G4AdjointPrimaryGeneratorAction
|
||||
// Author: L. Desorgher
|
||||
// Organisation: SpaceIT GmbH
|
||||
// Contract: ESA contract 21435/08/NL/AT
|
||||
@@ -44,6 +44,10 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
G4AdjointPrimaryGeneratorAction::G4AdjointPrimaryGeneratorAction()
|
||||
: Emin(0.), Emax(0.), EminIon(0.), EmaxIon(0.), NbOfAdjointPrimaryTypes(0),
|
||||
index_particle(100000), last_generated_part_was_adjoint(false),
|
||||
radius_spherical_source(0.), fwd_ion(0), adj_ion(0),
|
||||
ion_name("not_defined")
|
||||
{
|
||||
theAdjointPrimaryGenerator= new G4AdjointPrimaryGenerator();
|
||||
|
||||
@@ -54,13 +58,6 @@ G4AdjointPrimaryGeneratorAction::G4AdjointPrimaryGeneratorAction()
|
||||
|
||||
ListOfPrimaryFwdParticles.clear();
|
||||
ListOfPrimaryAdjParticles.clear();
|
||||
|
||||
last_generated_part_was_adjoint=false;
|
||||
index_particle=100000;
|
||||
|
||||
ion_name="not_defined";
|
||||
fwd_ion = 0;
|
||||
adj_ion = 0;
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4AdjointSimMessenger.cc,v 1.2 2009/11/18 18:02:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
// $Id: G4AdjointSimMessenger.cc,v 1.3 2010/09/03 15:24:03 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04 $
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Class Name: G4AdjointCrossSurfChecker
|
||||
@@ -34,6 +34,8 @@
|
||||
// Customer: ESA/ESTEC
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include "G4AdjointSimMessenger.hh"
|
||||
#include "G4AdjointSimManager.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunManager.cc,v 1.108 2007/11/09 13:57:39 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4RunManager.cc,v 1.114 2010/11/24 19:39:15 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -76,7 +76,10 @@ G4RunManager::G4RunManager()
|
||||
currentWorld(0),nParallelWorlds(0)
|
||||
{
|
||||
if(fRunManager)
|
||||
{ G4Exception("G4RunManager constructed twice."); }
|
||||
{
|
||||
G4Exception("G4RunManager::G4RunManager()", "Run0001",
|
||||
FatalException, "G4RunManager constructed twice.");
|
||||
}
|
||||
fRunManager = this;
|
||||
|
||||
kernel = new G4RunManagerKernel();
|
||||
@@ -247,7 +250,7 @@ void G4RunManager::DoEventLoop(G4int n_event,const char* macroFile,G4int n_selec
|
||||
G4cout << "Run terminated." << G4endl;
|
||||
G4cout << "Run Summary" << G4endl;
|
||||
if(runAborted)
|
||||
{ G4cout << " Run Aborted after " << i_event << " events processed." << G4endl; }
|
||||
{ G4cout << " Run Aborted after " << i_event + 1 << " events processed." << G4endl; }
|
||||
else
|
||||
{ G4cout << " Number of events processed : " << n_event << G4endl; }
|
||||
G4cout << " " << *timer << G4endl;
|
||||
@@ -258,8 +261,9 @@ G4Event* G4RunManager::GenerateEvent(G4int i_event)
|
||||
{
|
||||
if(!userPrimaryGeneratorAction)
|
||||
{
|
||||
G4Exception
|
||||
("G4RunManager::BeamOn - G4VUserPrimaryGeneratorAction is not defined.");
|
||||
G4Exception("G4RunManager::GenerateEvent()", "Run0002", FatalException,
|
||||
"G4VUserPrimaryGeneratorAction is not defined!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
G4Event* anEvent = new G4Event(i_event);
|
||||
@@ -330,7 +334,7 @@ void G4RunManager::Initialize()
|
||||
if(currentState!=G4State_PreInit && currentState!=G4State_Idle)
|
||||
{
|
||||
G4cerr << "Illegal application state - "
|
||||
<< "G4RunManager::Initialize() ignored." << G4endl;
|
||||
<< "G4RunManager::Initialize() ignored." << G4endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -343,8 +347,9 @@ void G4RunManager::InitializeGeometry()
|
||||
{
|
||||
if(!userDetector)
|
||||
{
|
||||
G4Exception
|
||||
("G4RunManager::InitializeGeometry - G4VUserDetectorConstruction is not defined.");
|
||||
G4Exception("G4RunManager::InitializeGeometry", "Run0003",
|
||||
FatalException, "G4VUserDetectorConstruction is not defined!");
|
||||
return;
|
||||
}
|
||||
|
||||
if(verboseLevel>1) G4cout << "userDetector->Construct() start." << G4endl;
|
||||
@@ -363,7 +368,8 @@ void G4RunManager::InitializePhysics()
|
||||
}
|
||||
else
|
||||
{
|
||||
G4Exception("G4VUserPhysicsList is not defined");
|
||||
G4Exception("G4RunManager::InitializePhysics()", "Run0004",
|
||||
FatalException, "G4VUserPhysicsList is not defined!");
|
||||
}
|
||||
physicsInitialized = true;
|
||||
}
|
||||
@@ -453,7 +459,7 @@ void G4RunManager::rndmSaveThisEvent()
|
||||
if(verboseLevel>0) G4cout << "currentEvent.rndm is copied to file: " << fileOut << G4endl;
|
||||
}
|
||||
|
||||
void G4RunManager::RestoreRandomNumberStatus(G4String fileN)
|
||||
void G4RunManager::RestoreRandomNumberStatus(const G4String& fileN)
|
||||
{
|
||||
G4String fileNameWithDirectory;
|
||||
if(fileN.index("/")==std::string::npos)
|
||||
@@ -467,7 +473,7 @@ void G4RunManager::RestoreRandomNumberStatus(G4String fileN)
|
||||
HepRandom::showEngineStatus();
|
||||
}
|
||||
|
||||
void G4RunManager::DumpRegion(G4String rname) const
|
||||
void G4RunManager::DumpRegion(const G4String& rname) const
|
||||
{
|
||||
kernel->UpdateRegion();
|
||||
kernel->DumpRegion(rname);
|
||||
@@ -518,10 +524,13 @@ void G4RunManager::ConstructScoringWorlds()
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
pmanager->AddProcess(theParallelWorldScoringProcess);
|
||||
pmanager->SetProcessOrderingToLast(theParallelWorldScoringProcess, idxAtRest);
|
||||
pmanager->SetProcessOrderingToSecond(theParallelWorldScoringProcess, idxAlongStep);
|
||||
pmanager->SetProcessOrderingToLast(theParallelWorldScoringProcess, idxPostStep);
|
||||
if(pmanager)
|
||||
{
|
||||
pmanager->AddProcess(theParallelWorldScoringProcess);
|
||||
pmanager->SetProcessOrderingToLast(theParallelWorldScoringProcess, idxAtRest);
|
||||
pmanager->SetProcessOrderingToSecond(theParallelWorldScoringProcess, idxAlongStep);
|
||||
pmanager->SetProcessOrderingToLast(theParallelWorldScoringProcess, idxPostStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
mesh->Construct(pWorld);
|
||||
@@ -546,4 +555,21 @@ void G4RunManager::UpdateScoring()
|
||||
}
|
||||
}
|
||||
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4SmartVoxelHeader.hh"
|
||||
|
||||
void G4RunManager::ReOptimizeMotherOf(G4VPhysicalVolume* pPhys)
|
||||
{
|
||||
G4LogicalVolume* pMotherL = pPhys->GetMotherLogical();
|
||||
if(pMotherL) ReOptimize(pMotherL);
|
||||
}
|
||||
|
||||
void G4RunManager::ReOptimize(G4LogicalVolume* pLog)
|
||||
{
|
||||
G4SmartVoxelHeader* header = pLog->GetVoxelHeader();
|
||||
delete header;
|
||||
header = new G4SmartVoxelHeader(pLog);
|
||||
pLog->SetVoxelHeader(header);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunManagerKernel.cc,v 1.47 2009/11/13 23:13:40 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
// $Id: G4RunManagerKernel.cc,v 1.54 2010/12/05 12:12:43 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -257,8 +257,7 @@ void G4RunManagerKernel::InitializePhysics()
|
||||
if(!(currentState==G4State_Idle||currentState==G4State_PreInit))
|
||||
{
|
||||
G4Exception("G4RunManagerKernel::InitializePhysics",
|
||||
"InitializePhysicsAtIncorrectState",
|
||||
JustWarning,
|
||||
"InitializePhysicsAtIncorrectState", JustWarning,
|
||||
"Geant4 kernel is not PreInit or Idle state : Method ignored.");
|
||||
return;
|
||||
}
|
||||
@@ -266,14 +265,11 @@ void G4RunManagerKernel::InitializePhysics()
|
||||
if(!physicsList)
|
||||
{
|
||||
G4Exception("G4RunManagerKernel::InitializePhysics",
|
||||
"PhysicsListIsNotDefined",
|
||||
FatalException,
|
||||
"PhysicsListIsNotDefined", FatalException,
|
||||
"G4VUserPhysicsList is not defined");
|
||||
return;
|
||||
}
|
||||
|
||||
//if(verboseLevel>1) G4cout << "physicsList->ConstructParticle() start." << G4endl;
|
||||
//physicsList->ConstructParticle();
|
||||
|
||||
if(verboseLevel>1) G4cout << "physicsList->Construct() start." << G4endl;
|
||||
if(numberOfParallelWorld>0) physicsList->UseCoupledTransportation();
|
||||
physicsList->Construct();
|
||||
@@ -329,7 +325,14 @@ G4bool G4RunManagerKernel::RunInitialization()
|
||||
UpdateRegion();
|
||||
BuildPhysicsTables();
|
||||
|
||||
if(geometryNeedsToBeClosed) ResetNavigator();
|
||||
if(geometryNeedsToBeClosed)
|
||||
{
|
||||
ResetNavigator();
|
||||
CheckRegularGeometry();
|
||||
// Notify the VisManager as well
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
if(pVVisManager) pVVisManager->GeometryHasChanged();
|
||||
}
|
||||
|
||||
GetPrimaryTransformer()->CheckUnknown();
|
||||
|
||||
@@ -430,7 +433,7 @@ void G4RunManagerKernel::CheckRegions()
|
||||
}
|
||||
}
|
||||
|
||||
void G4RunManagerKernel::DumpRegion(G4String rname) const
|
||||
void G4RunManagerKernel::DumpRegion(const G4String& rname) const
|
||||
{
|
||||
G4Region* region = G4RegionStore::GetInstance()->GetRegion(rname);
|
||||
if(region) DumpRegion(region);
|
||||
@@ -491,15 +494,39 @@ void G4RunManagerKernel::DumpRegion(G4Region* region) const
|
||||
region->SetProductionCuts(
|
||||
G4ProductionCutsTable::GetProductionCutsTable()->GetDefaultProductionCuts());
|
||||
}
|
||||
G4cout << " Production cuts : "
|
||||
<< " gamma " << G4BestUnit(cuts->GetProductionCut("gamma"),"Length")
|
||||
<< " e- " << G4BestUnit(cuts->GetProductionCut("e-"),"Length")
|
||||
<< " e+ " << G4BestUnit(cuts->GetProductionCut("e+"),"Length")
|
||||
<< " proton " << G4BestUnit(cuts->GetProductionCut("proton"),"Length")
|
||||
<< G4endl;
|
||||
else
|
||||
{
|
||||
G4cout << " Production cuts : "
|
||||
<< " gamma "
|
||||
<< G4BestUnit(cuts->GetProductionCut("gamma"),"Length")
|
||||
<< " e- "
|
||||
<< G4BestUnit(cuts->GetProductionCut("e-"),"Length")
|
||||
<< " e+ "
|
||||
<< G4BestUnit(cuts->GetProductionCut("e+"),"Length")
|
||||
<< " proton "
|
||||
<< G4BestUnit(cuts->GetProductionCut("proton"),"Length")
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "G4LogicalVolumeStore.hh"
|
||||
void G4RunManagerKernel::CheckRegularGeometry()
|
||||
{
|
||||
G4LogicalVolumeStore* store = G4LogicalVolumeStore::GetInstance();
|
||||
for(G4LogicalVolumeStore::iterator pos=store->begin(); pos!=store->end(); pos++)
|
||||
{
|
||||
if((*pos)&&((*pos)->GetNoDaughters()==1))
|
||||
{
|
||||
if((*pos)->GetDaughter(0)->IsRegularStructure())
|
||||
{
|
||||
SetScoreSplitter();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
@@ -510,14 +537,38 @@ G4bool G4RunManagerKernel::ConfirmCoupledTransportation()
|
||||
G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
|
||||
G4ParticleTable::G4PTblDicIterator* theParticleIterator = theParticleTable->GetIterator();
|
||||
theParticleIterator->reset();
|
||||
if((*theParticleIterator)())
|
||||
while((*theParticleIterator)())
|
||||
{
|
||||
G4ParticleDefinition* pd = theParticleIterator->value();
|
||||
G4ProcessManager* pm = pd->GetProcessManager();
|
||||
G4ProcessVector* pv = pm->GetAlongStepProcessVector(typeDoIt);
|
||||
G4VProcess* p = (*pv)[0];
|
||||
return ( (p->GetProcessName()) == "CoupledTransportation" );
|
||||
if(pm)
|
||||
{
|
||||
G4ProcessVector* pv = pm->GetAlongStepProcessVector(typeDoIt);
|
||||
G4VProcess* p = (*pv)[0];
|
||||
return ( (p->GetProcessName()) == "CoupledTransportation" );
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#include "G4ScoreSplittingProcess.hh"
|
||||
void G4RunManagerKernel::SetScoreSplitter()
|
||||
{
|
||||
G4ScoreSplittingProcess* pSplitter = new G4ScoreSplittingProcess();
|
||||
G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
|
||||
G4ParticleTable::G4PTblDicIterator* theParticleIterator = theParticleTable->GetIterator();
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() )
|
||||
{
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
if(pmanager)
|
||||
{ pmanager->AddDiscreteProcess(pSplitter); }
|
||||
}
|
||||
|
||||
if(verboseLevel>0)
|
||||
{
|
||||
G4cout << "G4RunManagerKernel -- G4ScoreSplittingProcess is appended to all particles." << G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserPhysicsList.cc,v 1.71 2009/08/09 14:31:46 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-09-03 $
|
||||
// $Id: G4VUserPhysicsList.cc,v 1.72 2010/07/21 14:21:19 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -343,7 +343,8 @@ void G4VUserPhysicsList::RemoveProcessManager()
|
||||
void G4VUserPhysicsList::AddTransportation()
|
||||
{
|
||||
G4int verboseLevelTransport = 0;
|
||||
G4VProcess* theTransportationProcess = 0;
|
||||
G4VProcess* theTransportationProcess = 0; // Pointer ownership handled to
|
||||
// G4ProcessManager !
|
||||
G4int nParaWorld = G4RunManagerKernel::GetRunManagerKernel()->GetNumberOfParallelWorld();
|
||||
|
||||
if(nParaWorld || useCoupledTransportation || G4ScoringManager::GetScoringManagerIfExist())
|
||||
@@ -354,7 +355,9 @@ void G4VUserPhysicsList::AddTransportation()
|
||||
<< "#############################################################################" << G4endl;
|
||||
}
|
||||
else
|
||||
{ theTransportationProcess = new G4Transportation(verboseLevelTransport); }
|
||||
{
|
||||
theTransportationProcess = new G4Transportation(verboseLevelTransport);
|
||||
}
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel >2){
|
||||
@@ -610,6 +613,7 @@ void G4VUserPhysicsList::BuildPhysicsTable(G4ParticleDefinition* particle)
|
||||
G4cerr << particle->GetParticleName() << " should be created in your PhysicsList" <<G4endl;
|
||||
G4Exception("G4VUserPhysicsList::BuildPhysicsTable","No process manager",
|
||||
FatalException, particle->GetParticleName() );
|
||||
return;
|
||||
}
|
||||
G4ProcessVector* pVector = pManager->GetProcessList();
|
||||
if (!pVector) {
|
||||
@@ -618,6 +622,7 @@ void G4VUserPhysicsList::BuildPhysicsTable(G4ParticleDefinition* particle)
|
||||
G4cerr << particle->GetParticleName() << " should be created in your PhysicsList" <<G4endl;
|
||||
G4Exception("G4VUserPhysicsList::BuildPhysicsTable","No process Vector",
|
||||
FatalException, particle->GetParticleName() );
|
||||
return;
|
||||
}
|
||||
for (G4int j=0; j < pVector->size(); ++j) {
|
||||
(*pVector)[j]->BuildPhysicsTable(*particle);
|
||||
@@ -638,6 +643,7 @@ void G4VUserPhysicsList::PreparePhysicsTable(G4ParticleDefinition* particle)
|
||||
G4cerr << particle->GetParticleName() << " should be created in your PhysicsList" <<G4endl;
|
||||
G4Exception("G4VUserPhysicsList::PreparePhysicsTable","No process manager",
|
||||
FatalException, particle->GetParticleName() );
|
||||
return;
|
||||
}
|
||||
|
||||
G4ProcessVector* pVector = pManager->GetProcessList();
|
||||
@@ -647,6 +653,7 @@ void G4VUserPhysicsList::PreparePhysicsTable(G4ParticleDefinition* particle)
|
||||
G4cerr << particle->GetParticleName() << " should be created in your PhysicsList" <<G4endl;
|
||||
G4Exception("G4VUserPhysicsList::PreparePhysicsTable","No process Vector",
|
||||
FatalException, particle->GetParticleName() );
|
||||
return;
|
||||
}
|
||||
for (G4int j=0; j < pVector->size(); ++j) {
|
||||
(*pVector)[j]->PreparePhysicsTable(*particle);
|
||||
|
||||
Reference in New Issue
Block a user