Import Geant4 0.1.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 2.2 1998/12/05 09:45:13 kurasige Exp $
|
||||
# $Id: GNUmakefile,v 1.1 1999/01/07 16:14:14 gunter Exp $
|
||||
# ----------------------------------------------------------
|
||||
# GNUmakefile for run library. Gabriele Cosmo, 3/4/1997.
|
||||
# ----------------------------------------------------------
|
||||
|
||||
+24
-1
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 2.17 1998/12/09 11:41:38 kurasige Exp $
|
||||
$Id: History,v 1.8 1999/05/21 04:29:04 kurasige Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -16,6 +16,29 @@ committal in the CVS repository !
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
May 21, 99 H.Kurashige (run-01-00-05)
|
||||
- Fixed bug in G4VUserPhysicsList::InitializeProcessManager()
|
||||
|
||||
May 17, 99 J.Allison
|
||||
- In G4RunManager.cc, moved G4Timer.hh to prevent conflict with ObjectSpace
|
||||
on Sun when using the STL Interface.
|
||||
|
||||
Apr 22, 99 M.Asai (tag run-01-00-04)
|
||||
- Now run ID is set by G4RunManager.
|
||||
|
||||
Apr 16, 99 H.Kurashige (tag run-01-00-03)
|
||||
- Remove G4VUserPhysicsList::ConstructAllParticles and related
|
||||
- Change argument of SetCuts method
|
||||
|
||||
Apr 14, 99 H.Kurashige (tag run-01-00-02)
|
||||
- "buildPhysicsTable" command is added in G4UserPhysicsListMessenger
|
||||
|
||||
Apr 09, 99 M.Asai (tag run-01-00-01)
|
||||
- Argument of G4UserRunAction methods bcomes to const.
|
||||
|
||||
Feb. 9 99 H.Kurashige
|
||||
- G4VUserPhysicsList::RemoveProcessManager is added
|
||||
|
||||
Dec. 9 98 H.Kurashige (tag run-00-04-01)
|
||||
- G4VUserPhysicsList is updated to use G4GenericIon (Hisaya)
|
||||
- G4VUserPhysicsList::ConstructAllParticles method is added (Hisaya)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// $Id: README.TXT,v 2.0 1998/07/02 17:27:45 gunter Exp $
|
||||
// $Id: README.TXT,v 1.1 1999/01/07 16:14:15 gunter Exp $
|
||||
|
||||
GEANT4
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Run.hh,v 2.1 1998/07/12 03:08:30 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4Run.hh,v 1.1 1999/01/07 16:14:15 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
|
||||
#ifndef G4Run_h
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4RunManager.hh,v 2.3 1998/10/01 17:01:38 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4RunManager.hh,v 1.2 1999/04/22 21:51:11 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -118,6 +118,7 @@ class G4RunManager
|
||||
G4bool pauseAtBeginOfEvent;
|
||||
G4bool pauseAtEndOfEvent;
|
||||
|
||||
G4int runIDCounter;
|
||||
G4int verboseLevel;
|
||||
G4Timer * timer;
|
||||
G4DCtable* DCtable;
|
||||
@@ -184,6 +185,8 @@ class G4RunManager
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inline void SetRunIDCounter(G4int i)
|
||||
{ runIDCounter = i; }
|
||||
inline void SetDCtable(G4DCtable* DCtbl)
|
||||
{ DCtable = DCtbl; }
|
||||
};
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4RunMessenger.hh,v 2.4 1998/10/01 17:01:38 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4RunMessenger.hh,v 1.1 1999/01/07 16:14:16 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
// GEANT 4 class header file
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UserPhysicsListMessenger.hh,v 2.3 1998/07/12 16:03:36 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4UserPhysicsListMessenger.hh,v 1.3 1999/04/15 04:13:41 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -26,10 +26,13 @@
|
||||
// DumpList * Dump List of particles in G4VUserPhysicsList.
|
||||
// dumpCutValue * Dump cut value information
|
||||
// Verbose * Set the Verbose level of G4VUserPhysicsList.
|
||||
// addProcessManager * add process manager
|
||||
// buildPhysicsTable * build physics table
|
||||
// ------------------------------------------------------------
|
||||
// History
|
||||
// first version 09 Jan. 1998 by H.Kurashige
|
||||
// second version 24 Jan. 1998 by H.Kurashige
|
||||
// add buildPhysicsTable command 13 Apr. 1999 by H.Kurashige
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#ifndef G4UserPhysicsListMessenger_h
|
||||
@@ -49,16 +52,20 @@ class G4UIcmdWithAString;
|
||||
|
||||
class G4UserPhysicsListMessenger: public G4UImessenger
|
||||
{
|
||||
private:
|
||||
// hide default constructor
|
||||
G4UserPhysicsListMessenger(){}
|
||||
|
||||
public:
|
||||
G4UserPhysicsListMessenger(G4VUserPhysicsList* pParticleList);
|
||||
virtual ~G4UserPhysicsListMessenger();
|
||||
|
||||
public:
|
||||
void SetNewValue(G4UIcommand * command,G4String newValues);
|
||||
G4String GetCurrentValue(G4UIcommand * command);
|
||||
virtual void SetNewValue(G4UIcommand * command,G4String newValues);
|
||||
virtual G4String GetCurrentValue(G4UIcommand * command);
|
||||
|
||||
protected:
|
||||
G4VUserPhysicsList* theParticleList;
|
||||
G4VUserPhysicsList* thePhysicsList;
|
||||
|
||||
private: //commands
|
||||
G4UIdirectory * theDirectory;
|
||||
@@ -67,6 +74,7 @@ class G4UserPhysicsListMessenger: public G4UImessenger
|
||||
G4UIcmdWithoutParameter * dumpListCmd;
|
||||
G4UIcmdWithAString * dumpCutValuesCmd;
|
||||
G4UIcmdWithAString * addProcManCmd;
|
||||
G4UIcmdWithAString * buildPTCmd;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UserRunAction.hh,v 2.1 1998/07/12 03:08:32 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4UserRunAction.hh,v 1.2 1999/04/09 02:28:00 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
|
||||
#ifndef G4UserRunAction_h
|
||||
@@ -21,8 +21,8 @@ class G4UserRunAction
|
||||
virtual ~G4UserRunAction();
|
||||
|
||||
public:
|
||||
virtual void BeginOfRunAction(G4Run* aRun);
|
||||
virtual void EndOfRunAction(G4Run* aRun);
|
||||
virtual void BeginOfRunAction(const G4Run* aRun);
|
||||
virtual void EndOfRunAction(const G4Run* aRun);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VPersistencyManager.hh,v 2.1 1998/07/12 03:08:33 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4VPersistencyManager.hh,v 1.1 1999/01/07 16:14:17 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
|
||||
#ifndef G4VPersistencyManager_h
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VUserDetectorConstruction.hh,v 2.1 1998/07/12 03:08:33 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4VUserDetectorConstruction.hh,v 1.1 1999/01/07 16:14:17 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
|
||||
#ifndef G4VUserDetectorConstruction_h
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VUserPhysicsList.hh,v 2.3 1998/12/05 09:45:15 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4VUserPhysicsList.hh,v 1.4 1999/04/16 09:32:05 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -20,9 +20,9 @@
|
||||
// Construct particles
|
||||
// G4VUserPhysicsList::constructPhysics()
|
||||
// Construct procesess and register them to particles
|
||||
// G4VUserPhysicsList::SetCuts(G4double aValue)
|
||||
// set a cut value in range to all particles
|
||||
// (and rebuilding physics table will be invoked)
|
||||
// G4VUserPhysicsList::SetCuts()
|
||||
// set cut values in range to all particles
|
||||
// (and rebuilding physics table will be invoked )
|
||||
//
|
||||
// History
|
||||
// first version 09 Jan. 1998 by H.Kurashige
|
||||
@@ -37,6 +37,10 @@
|
||||
// add AddProcessManager
|
||||
// modified 05 Dec. 1998 by H.Kurashige
|
||||
// add ConstructAllParticles()
|
||||
// modified 14, Apr 1999 by H.Kurashige
|
||||
// change BuildPhysicsTable as public
|
||||
// removed ConstructAllParticles() and related methods
|
||||
// changed SetCuts method argument
|
||||
// ------------------------------------------------------------
|
||||
#ifndef G4VUserPhysicsList_h
|
||||
#define G4VUserPhysicsList_h 1
|
||||
@@ -59,7 +63,8 @@ class G4VUserPhysicsList
|
||||
// particles and processes are created
|
||||
void Construct();
|
||||
|
||||
protected:
|
||||
|
||||
protected:
|
||||
// These two methods of ConstructParticle() and ConstructProcess()
|
||||
// will be invoked in the Construct() method.
|
||||
|
||||
@@ -76,26 +81,18 @@ class G4VUserPhysicsList
|
||||
// !! Caution: this class must not be overriden !!
|
||||
void AddTransportation();
|
||||
|
||||
// Construct All particles
|
||||
virtual void ConstructAllParticles();
|
||||
// these methods Construct all particles in each category
|
||||
virtual void ConstructAllBosons();
|
||||
virtual void ConstructAllLeptons();
|
||||
virtual void ConstructAllMesons();
|
||||
virtual void ConstructAllBarions();
|
||||
virtual void ConstructAllIons();
|
||||
virtual void ConstructAllShortLiveds();
|
||||
|
||||
/////////////////////////////////////
|
||||
public:
|
||||
// "SetCuts" method sets a cut value for all particle types
|
||||
// in the particle table
|
||||
virtual void SetCuts(G4double aCut) = 0;
|
||||
|
||||
// "SetCutsWithDefault" method sets a cut value with the default
|
||||
// cut values for all particle types in the particle table
|
||||
void SetCutsWithDefault();
|
||||
virtual void SetCuts() = 0;
|
||||
|
||||
protected:
|
||||
// "SetCutsWithDefault" method sets a cut value with the default
|
||||
// cut values for all particle types in the particle table
|
||||
void SetCutsWithDefault();
|
||||
|
||||
public:
|
||||
//
|
||||
void BuildPhysicsTable(G4ParticleDefinition* );
|
||||
|
||||
@@ -145,6 +142,7 @@ class G4VUserPhysicsList
|
||||
// this is the default cut value for all particles
|
||||
G4double defaultCutValue;
|
||||
|
||||
/////////////////////////////////////
|
||||
public:
|
||||
// Print out the List of registered particles types
|
||||
void DumpList() const;
|
||||
@@ -160,6 +158,11 @@ class G4VUserPhysicsList
|
||||
// this routine is used in Construct()
|
||||
void InitializeProcessManager();
|
||||
|
||||
public:
|
||||
// remove and delete ProcessManagers for all particles in tha Particle Table
|
||||
// this routine is invoked from RunManager
|
||||
void RemoveProcessManager();
|
||||
|
||||
public:
|
||||
// add process manager for particles created on-the-fly
|
||||
void AddProcessManager(G4ParticleDefinition* newParticle,
|
||||
@@ -187,10 +190,6 @@ class G4VUserPhysicsList
|
||||
|
||||
};
|
||||
|
||||
inline void G4VUserPhysicsList::SetCutsWithDefault()
|
||||
{
|
||||
SetCuts(defaultCutValue);
|
||||
}
|
||||
|
||||
inline void G4VUserPhysicsList::Construct()
|
||||
{
|
||||
@@ -214,8 +213,8 @@ inline void G4VUserPhysicsList::SetVerboseLevel(G4int value)
|
||||
{
|
||||
verboseLevel = value;
|
||||
if (verboseLevel >1){
|
||||
G4cerr << "G4VUserPhysicsList::SetVerboseLevel :";
|
||||
G4cerr << " Verbose level is set to " << verboseLevel << endl;
|
||||
G4cout << "G4VUserPhysicsList::SetVerboseLevel :";
|
||||
G4cout << " Verbose level is set to " << verboseLevel << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VUserPrimaryGeneratorAction.hh,v 2.1 1998/07/12 03:08:35 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4VUserPrimaryGeneratorAction.hh,v 1.1 1999/01/07 16:14:17 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
|
||||
#ifndef G4VUserPrimaryGeneratorAction_h
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Run.cc,v 2.0 1998/07/02 17:28:15 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4Run.cc,v 1.1 1999/01/07 16:14:17 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
|
||||
#include "G4Run.hh"
|
||||
|
||||
@@ -5,11 +5,15 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4RunManager.cc,v 2.10 1998/10/01 17:01:42 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4RunManager.cc,v 1.5 1999/05/17 16:17:44 stesting Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
|
||||
// On Sun, to prevent conflict with ObjectSpace, G4Timer.hh has to be
|
||||
// loaded *before* globals.hh...
|
||||
#include "G4Timer.hh"
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
|
||||
#include "G4Run.hh"
|
||||
@@ -28,7 +32,6 @@
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ProcessTable.hh"
|
||||
#include "G4Timer.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
|
||||
@@ -46,7 +49,7 @@ G4RunManager::G4RunManager()
|
||||
geometryInitialized(false),physicsInitialized(false),cutoffInitialized(false),
|
||||
geometryNeedsToBeClosed(true),initializedAtLeastOnce(false),
|
||||
runAborted(false),pauseAtBeginOfEvent(false),pauseAtEndOfEvent(false),
|
||||
geometryToBeOptimized(true),verboseLevel(0),DCtable(NULL)
|
||||
geometryToBeOptimized(true),verboseLevel(0),DCtable(NULL),runIDCounter(0)
|
||||
{
|
||||
if(fRunManager)
|
||||
{ G4Exception("G4RunManager constructed twice."); }
|
||||
@@ -69,6 +72,7 @@ G4RunManager::~G4RunManager()
|
||||
if(verboseLevel>1) G4cout << "Deletion of G4 kernel class start." << endl;
|
||||
delete timer;
|
||||
delete runMessenger;
|
||||
physicsList->RemoveProcessManager();
|
||||
G4ParticleTable::GetParticleTable()->DeleteMessenger();
|
||||
G4ProcessTable::GetProcessTable()->DeleteMessenger();
|
||||
delete previousEvents;
|
||||
@@ -161,6 +165,7 @@ G4bool G4RunManager::ConfirmBeamOnCondition()
|
||||
void G4RunManager::RunInitialization()
|
||||
{
|
||||
currentRun = new G4Run();
|
||||
currentRun->SetRunID(runIDCounter);
|
||||
currentRun->SetDCtable(DCtable);
|
||||
G4SDManager* fSDM = G4SDManager::GetSDMpointerIfExist();
|
||||
if(fSDM)
|
||||
@@ -267,6 +272,7 @@ void G4RunManager::RunTermination()
|
||||
if(fPersM) fPersM->Store(currentRun);
|
||||
delete currentRun;
|
||||
currentRun = NULL;
|
||||
runIDCounter++;
|
||||
|
||||
stateManager->SetNewState(Idle);
|
||||
}
|
||||
@@ -335,7 +341,7 @@ void G4RunManager::InitializeCutOff()
|
||||
if(physicsList)
|
||||
{
|
||||
if(verboseLevel>1) G4cout << "physicsList->setCut() start." << endl;
|
||||
physicsList->SetCutsWithDefault();
|
||||
physicsList->SetCuts();
|
||||
}
|
||||
cutoffInitialized = true;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4RunMessenger.cc,v 2.6 1998/10/01 17:01:43 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4RunMessenger.cc,v 1.1 1999/01/07 16:14:18 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
|
||||
#include "G4RunMessenger.hh"
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UserPhysicsListMessenger.cc,v 2.5 1998/07/17 06:12:52 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4UserPhysicsListMessenger.cc,v 1.2 1999/04/14 10:45:58 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -15,6 +15,7 @@
|
||||
// ------------------------------------------------------------
|
||||
// History
|
||||
// first version 09 Jan. 1998 by H.Kurashige
|
||||
// add buildPhysicsTable command 13 Apr. 1999 by H.Kurashige
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#include "G4UserPhysicsListMessenger.hh"
|
||||
@@ -27,7 +28,7 @@
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(G4VUserPhysicsList* pParticleList):theParticleList(pParticleList)
|
||||
G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(G4VUserPhysicsList* pParticleList):thePhysicsList(pParticleList)
|
||||
{
|
||||
// /run/particle directory
|
||||
theDirectory = new G4UIdirectory("/run/particle/");
|
||||
@@ -69,10 +70,17 @@ G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(G4VUserPhysicsList* pPart
|
||||
|
||||
// /run/particle/addProcManager command
|
||||
addProcManCmd = new G4UIcmdWithAString("/run/particle/addProcManager", this);
|
||||
addProcManCmd->SetGuidance("add process manager");
|
||||
addProcManCmd->SetGuidance("add process manager to specified particle type");
|
||||
addProcManCmd->SetParameterName("particleType", true);
|
||||
addProcManCmd->SetDefaultValue("");
|
||||
addProcManCmd->AvailableForStates(Init,Idle,GeomClosed,EventProc);
|
||||
|
||||
// /run/particle/buildPhysicsTable command
|
||||
buildPTCmd = new G4UIcmdWithAString("/run/particle/buildPhysicsTable", this);
|
||||
buildPTCmd->SetGuidance("build physics table of specified particle type");
|
||||
buildPTCmd->SetParameterName("particleType", true);
|
||||
buildPTCmd->SetDefaultValue("");
|
||||
buildPTCmd->AvailableForStates(Init,Idle,GeomClosed,EventProc);
|
||||
}
|
||||
|
||||
G4UserPhysicsListMessenger::~G4UserPhysicsListMessenger()
|
||||
@@ -82,6 +90,7 @@ G4UserPhysicsListMessenger::~G4UserPhysicsListMessenger()
|
||||
delete dumpListCmd;
|
||||
delete dumpCutValuesCmd;
|
||||
delete addProcManCmd;
|
||||
delete buildPTCmd;
|
||||
delete theDirectory;
|
||||
}
|
||||
|
||||
@@ -89,40 +98,58 @@ void G4UserPhysicsListMessenger::SetNewValue(G4UIcommand * command,G4String newV
|
||||
{
|
||||
if( command==setCutCmd ){
|
||||
G4double newCut = setCutCmd->GetNewDoubleValue(newValue);
|
||||
theParticleList->SetDefaultCutValue(newCut);
|
||||
thePhysicsList->SetDefaultCutValue(newCut);
|
||||
|
||||
} else if( command==verboseCmd ) {
|
||||
theParticleList->SetVerboseLevel(verboseCmd->GetNewIntValue(newValue));
|
||||
thePhysicsList->SetVerboseLevel(verboseCmd->GetNewIntValue(newValue));
|
||||
|
||||
} else if( command==dumpListCmd ){
|
||||
theParticleList->DumpList();
|
||||
thePhysicsList->DumpList();
|
||||
|
||||
} else if( command==dumpCutValuesCmd ){
|
||||
if (newValue == "table") {
|
||||
theParticleList->DumpCutValuesTable();
|
||||
thePhysicsList->DumpCutValuesTable();
|
||||
} else {
|
||||
theParticleList->DumpCutValues(newValue);
|
||||
thePhysicsList->DumpCutValues(newValue);
|
||||
}
|
||||
|
||||
} else if( command == addProcManCmd ){
|
||||
G4ParticleDefinition* particle = (G4ParticleTable::GetParticleTable())->FindParticle(newValue);
|
||||
if (particle == NULL) return;
|
||||
if (particle->GetProcessManager() != NULL) return;
|
||||
theParticleList->AddProcessManager(particle);
|
||||
thePhysicsList->AddProcessManager(particle);
|
||||
|
||||
} else if( command == buildPTCmd ){
|
||||
G4ParticleDefinition* particle = (G4ParticleTable::GetParticleTable())->FindParticle(newValue);
|
||||
if (particle == NULL) return;
|
||||
thePhysicsList->BuildPhysicsTable(particle);
|
||||
}
|
||||
}
|
||||
|
||||
G4String G4UserPhysicsListMessenger::GetCurrentValue(G4UIcommand * command)
|
||||
{
|
||||
G4String cv;
|
||||
G4String candidates("none");
|
||||
G4ParticleTable::G4PTblDicIterator *piter = (G4ParticleTable::GetParticleTable())->GetIterator();
|
||||
|
||||
if( command==setCutCmd ){
|
||||
cv = setCutCmd->ConvertToString( theParticleList->GetDefaultCutValue(), "mm" );
|
||||
cv = setCutCmd->ConvertToString( thePhysicsList->GetDefaultCutValue(), "mm" );
|
||||
|
||||
} else if( command==verboseCmd ){
|
||||
cv = verboseCmd->ConvertToString(theParticleList->GetVerboseLevel());
|
||||
cv = verboseCmd->ConvertToString(thePhysicsList->GetVerboseLevel());
|
||||
|
||||
} else if( command== addProcManCmd ){
|
||||
// set candidate list
|
||||
G4String candidates("none");
|
||||
G4ParticleTable::G4PTblDicIterator *piter = (G4ParticleTable::GetParticleTable())->GetIterator();
|
||||
piter -> reset();
|
||||
while( (*piter)() ){
|
||||
G4ParticleDefinition *particle = piter->value();
|
||||
candidates += " " + particle->GetParticleName();
|
||||
}
|
||||
addProcManCmd->SetCandidates(candidates);
|
||||
cv = "";
|
||||
|
||||
} else if( command== buildPTCmd ){
|
||||
// set candidate list
|
||||
piter -> reset();
|
||||
while( (*piter)() ){
|
||||
G4ParticleDefinition *particle = piter->value();
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4UserRunAction.cc,v 2.1 1998/07/12 03:08:39 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4UserRunAction.cc,v 1.2 1999/04/09 02:28:10 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
|
||||
#include "G4UserRunAction.hh"
|
||||
@@ -17,9 +17,9 @@ G4UserRunAction::G4UserRunAction()
|
||||
G4UserRunAction::~G4UserRunAction()
|
||||
{;}
|
||||
|
||||
void G4UserRunAction::BeginOfRunAction(G4Run* aRun)
|
||||
void G4UserRunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
{;}
|
||||
|
||||
void G4UserRunAction::EndOfRunAction(G4Run* aRun)
|
||||
void G4UserRunAction::EndOfRunAction(const G4Run* aRun)
|
||||
{;}
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VPersistencyManager.cc,v 2.1 1998/07/12 03:08:40 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4VPersistencyManager.cc,v 1.1 1999/01/07 16:14:19 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
|
||||
#include "G4VPersistencyManager.hh"
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VUserDetectorConstruction.cc,v 2.0 1998/07/02 17:28:07 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4VUserDetectorConstruction.cc,v 1.1 1999/01/07 16:14:19 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VUserPhysicsList.cc,v 2.16 1998/12/07 01:16:55 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4VUserPhysicsList.cc,v 1.7 1999/05/21 04:25:47 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -21,21 +21,17 @@
|
||||
// 18 June 1998 by H.Kurashige
|
||||
// modifeid for short lived particles 27 June 1998 by H.Kurashige
|
||||
// G4BestUnit on output 12 nov. 1998 mma
|
||||
// Added RemoveProcessManager 9 Feb. 1999 by H.Kurashige
|
||||
// Fixed RemoveProcessManager 15 Apr. 1999 by H.Kurashige
|
||||
// Removed ConstructAllParticles() 15 Apr. 1999 by H.Kurashige
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VUserPhysicsList.hh"
|
||||
#include "G4ParticleWithCuts.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleWithCuts.hh"
|
||||
#include "G4BosonConstructor.hh"
|
||||
#include "G4LeptonConstructor.hh"
|
||||
#include "G4MesonConstructor.hh"
|
||||
#include "G4BarionConstructor.hh"
|
||||
#include "G4IonConstructor.hh"
|
||||
#include "G4ShortLivedConstructor.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4UserPhysicsListMessenger.hh"
|
||||
#include "G4UImanager.hh"
|
||||
@@ -63,47 +59,69 @@ G4VUserPhysicsList::G4VUserPhysicsList()
|
||||
|
||||
G4VUserPhysicsList::~G4VUserPhysicsList()
|
||||
{
|
||||
if (theMessenger != NULL) {
|
||||
if (theMessenger != 0) {
|
||||
delete theMessenger;
|
||||
theMessenger = NULL;
|
||||
theMessenger = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void G4VUserPhysicsList::AddProcessManager(G4ParticleDefinition* newParticle,
|
||||
G4ProcessManager* newManager)
|
||||
{
|
||||
if (newParticle == NULL) return;
|
||||
if (newManager == NULL){
|
||||
newManager = new G4ProcessManager(newParticle);
|
||||
if (newParticle == 0) return;
|
||||
if (newParticle->GetProcessManager() != 0) {
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel >1){
|
||||
G4cout << "G4VUserPhysicsList::AddProcessManager: ";
|
||||
G4cout << newParticle->GetParticleName();
|
||||
G4cout << " already has ProcessManager " << endl;
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
// create new process manager if newManager == 0
|
||||
if (newManager == 0){
|
||||
// Add ProcessManager
|
||||
if (newParticle->GetParticleType() == "nucleus") {
|
||||
// Create a copy of the process manager of "GenericIon" in case of "nucleus"
|
||||
G4ParticleDefinition* genericIon =
|
||||
(G4ParticleTable::GetParticleTable())->FindParticle("GenericIon");
|
||||
if (genericIon != NULL) {
|
||||
|
||||
if (genericIon != 0) {
|
||||
G4ProcessManager* ionMan = genericIon->GetProcessManager();
|
||||
if (ionMan != NULL) {
|
||||
delete newManager;
|
||||
if (ionMan != 0) {
|
||||
newManager = new G4ProcessManager(*ionMan);
|
||||
} else {
|
||||
// no process manager has been registered yet
|
||||
newManager = new G4ProcessManager(newParticle);
|
||||
}
|
||||
} else {
|
||||
// "GenericIon" does not exist
|
||||
newManager = new G4ProcessManager(newParticle);
|
||||
}
|
||||
|
||||
} else {
|
||||
// create process manager for particles other than "nucleus"
|
||||
newManager = new G4ProcessManager(newParticle);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// set particle type
|
||||
newManager->SetParticleType(newParticle);
|
||||
|
||||
// add the process manager
|
||||
newParticle->SetProcessManager(newManager);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel >2){
|
||||
G4cerr << "G4VUserPhysicsList::AddProcessManager: ";
|
||||
G4cerr << "adds ProcessManager to ";
|
||||
G4cerr << newParticle->GetParticleName() << endl;
|
||||
G4cout << "G4VUserPhysicsList::AddProcessManager: ";
|
||||
G4cout << "adds ProcessManager to ";
|
||||
G4cout << newParticle->GetParticleName() << endl;
|
||||
newManager->DumpInfo();
|
||||
}
|
||||
newManager->SetParticleType(newParticle);
|
||||
if (newParticle->GetProcessManager() == NULL) {
|
||||
newParticle->SetProcessManager(newManager);
|
||||
} else {
|
||||
if (verboseLevel >0){
|
||||
G4cerr << "G4VUserPhysicsList::AddProcessManager: ";
|
||||
G4cerr << newParticle->GetParticleName();
|
||||
G4cerr << " already has ProcessManager " << endl;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -114,13 +132,34 @@ void G4VUserPhysicsList::InitializeProcessManager()
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
if (pmanager==NULL) {
|
||||
if (pmanager==0) {
|
||||
// create process manager if the particle has no its one
|
||||
pmanager = new G4ProcessManager(particle);
|
||||
particle->SetProcessManager(pmanager);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void G4VUserPhysicsList::RemoveProcessManager()
|
||||
{
|
||||
// loop over all particles in G4ParticleTable
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
if (pmanager!=0) delete pmanager;
|
||||
particle->SetProcessManager(0);
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel >2){
|
||||
G4cout << "G4VUserPhysicsList::RemoveProcessManager: ";
|
||||
G4cout << "remove ProcessManager from ";
|
||||
G4cout << particle->GetParticleName() << endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#include "G4Transportation.hh"
|
||||
void G4VUserPhysicsList::AddTransportation()
|
||||
{
|
||||
@@ -132,9 +171,18 @@ void G4VUserPhysicsList::AddTransportation()
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
if (!particle->IsShortLived()) {
|
||||
pmanager ->AddProcess(theTransportationProcess);
|
||||
pmanager ->SetProcessOrderingToFirst(theTransportationProcess, idxAlongStep);
|
||||
pmanager ->SetProcessOrderingToFirst(theTransportationProcess, idxPostStep);
|
||||
// Add transportation process for all particles other than "shortlived"
|
||||
if ( pmanager == 0) {
|
||||
// Error !! no process manager
|
||||
G4Exception("G4VUserPhysicsList::AddTransportation : no process manager!");
|
||||
} else {
|
||||
// add transportation with ordering = ( -1, "first", "first" )
|
||||
pmanager ->AddProcess(theTransportationProcess);
|
||||
pmanager ->SetProcessOrderingToFirst(theTransportationProcess, idxAlongStep);
|
||||
pmanager ->SetProcessOrderingToFirst(theTransportationProcess, idxPostStep);
|
||||
}
|
||||
} else {
|
||||
// shortlived particle case
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -143,16 +191,20 @@ void G4VUserPhysicsList::AddTransportation()
|
||||
void G4VUserPhysicsList::SetDefaultCutValue(G4double value)
|
||||
{
|
||||
if (value<=0.0) {
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel >0){
|
||||
G4cerr << "G4VUserPhysicsList::SetDefaultCutValue: negative cut values";
|
||||
G4cerr << " :" << value/mm << "[mm]" << endl;
|
||||
G4cout << "G4VUserPhysicsList::SetDefaultCutValue: negative cut values";
|
||||
G4cout << " :" << value/mm << "[mm]" << endl;
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel >1){
|
||||
G4cout << "G4VUserPhysicsList::SetDefaultCutValue:";
|
||||
G4cout << "default cut value is changed to :" ;
|
||||
G4cout << value/mm << "[mm]" << endl;
|
||||
}
|
||||
#endif
|
||||
defaultCutValue = value;
|
||||
ResetCuts();
|
||||
}
|
||||
@@ -160,10 +212,12 @@ void G4VUserPhysicsList::SetDefaultCutValue(G4double value)
|
||||
|
||||
void G4VUserPhysicsList::ResetCuts()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel >1) {
|
||||
G4cout << "G4VUserPhysicsList::ResetCuts()" << endl;
|
||||
G4cout << " cut values in energy will be calculated later" << endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Reset cut values for other particles
|
||||
// loop over all particles in G4ParticleTable
|
||||
@@ -176,7 +230,14 @@ void G4VUserPhysicsList::ResetCuts()
|
||||
// inform that cut values are modified to the run manager
|
||||
// i.e state will be changed and SetCuts will be invoked
|
||||
// just before event loop
|
||||
|
||||
// set /control/verbose 0
|
||||
G4int tempVerboseLevel = G4UImanager::GetUIpointer()->GetVerboseLevel();
|
||||
G4UImanager::GetUIpointer()->SetVerboseLevel(0);
|
||||
// issue /run/cutoffModified
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/run/cutoffModified");
|
||||
// retreive /control/verbose
|
||||
G4UImanager::GetUIpointer()->SetVerboseLevel(tempVerboseLevel);
|
||||
}
|
||||
|
||||
void G4VUserPhysicsList::SetCutValueForOtherThan(G4double cutValue,
|
||||
@@ -193,16 +254,20 @@ void G4VUserPhysicsList::SetCutValueForOtherThan(G4double cutValue,
|
||||
{
|
||||
// check cut value is positive
|
||||
if (cutValue <= 0.0) {
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel >0){
|
||||
G4cerr << "G4VUserPhysicsList::SetCutValueForOtherThan: negative cut values";
|
||||
G4cerr << " :" << cutValue/mm << "[mm]" << endl;
|
||||
G4cout << "G4VUserPhysicsList::SetCutValueForOtherThan: negative cut values";
|
||||
G4cout << " :" << cutValue/mm << "[mm]" << endl;
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
} else {
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel >1) {
|
||||
G4cout << "G4VUserPhysicsList::SetCutValueForOtherThan ";
|
||||
G4cout << " :" << cutValue/mm << "[mm]" << endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// check specified particle types in arguments
|
||||
@@ -258,97 +323,162 @@ void G4VUserPhysicsList::SetCutValueForOtherThan(G4double cutValue,
|
||||
for (G4int index = 0; index <numberOfSpecifiedParticles; index++) {
|
||||
isSpecified = isSpecified || (particle == specifiedParticles[index]);
|
||||
}
|
||||
if (!isSpecified) {
|
||||
if (!particle->IsShortLived()) {
|
||||
particle->SetCuts(cutValue);
|
||||
if (verboseLevel >1)
|
||||
G4cout << "Set cuts for " << particle->GetParticleName() << endl;
|
||||
BuildPhysicsTable(particle);
|
||||
}
|
||||
if ( (!isSpecified) && (!particle->IsShortLived()) ){
|
||||
// set cut value
|
||||
particle->SetCuts(cutValue);
|
||||
// build physics table
|
||||
BuildPhysicsTable(particle);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel >1) G4cout << "Set cuts for " << particle->GetParticleName() << endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void G4VUserPhysicsList::SetCutValue(G4double aCut, const G4String& name)
|
||||
{
|
||||
G4ParticleDefinition* particle;
|
||||
if (particle = theParticleTable->FindParticle(name)){
|
||||
if (!particle->IsShortLived()) {
|
||||
particle->SetCuts( aCut );
|
||||
if (verboseLevel >1) G4cout << "Set cuts for " << name << endl;
|
||||
BuildPhysicsTable(particle);
|
||||
}
|
||||
G4ParticleDefinition* particle = theParticleTable->FindParticle(name);
|
||||
if (particle != 0){
|
||||
if (!particle->IsShortLived()) {
|
||||
//set cut value
|
||||
particle->SetCuts( aCut );
|
||||
// build physics table
|
||||
BuildPhysicsTable(particle);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (particle != 0){
|
||||
if (verboseLevel >1) G4cout << "Set cuts for " << name << endl;
|
||||
} else {
|
||||
if (verboseLevel >0)
|
||||
G4cout << name << " is not found in ParticleTable" << endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void G4VUserPhysicsList::SetCutsWithDefault()
|
||||
{
|
||||
// default cut value
|
||||
G4double cut = defaultCutValue;
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel >1){
|
||||
G4cout << "G4VUserPhysicsList::SetCutsWithDefault:";
|
||||
G4cout << "CutLength : " << cut/mm << " (mm)" << endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
// set cut values for gamma at first and for e- second and next for e+,
|
||||
// because some processes for e+/e- need cut values for gamma
|
||||
SetCutValue(cut, "gamma");
|
||||
SetCutValue(cut, "e-");
|
||||
SetCutValue(cut, "e+");
|
||||
|
||||
// set cut values for proton and anti_proton before all other hadrons
|
||||
// because some processes for hadrons need cut values for proton/anti_proton
|
||||
SetCutValue(cut, "proton");
|
||||
SetCutValue(cut, "anti_proton");
|
||||
|
||||
SetCutValueForOthers(cut);
|
||||
|
||||
if (verboseLevel>1) {
|
||||
DumpCutValuesTable();
|
||||
}
|
||||
}
|
||||
|
||||
void G4VUserPhysicsList::SetCutValueForOthers(G4double cutValue)
|
||||
{
|
||||
// check cut value is positive
|
||||
if (cutValue <= 0.0) {
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel >0){
|
||||
G4cerr << "G4VUserPhysicsList::SetCutValueForOthers: negative cut values";
|
||||
G4cerr << " :" << cutValue/mm << "[mm]" << endl;
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
if (verboseLevel >1) {
|
||||
G4cout << "G4VUserPhysicsList::SetCutValueForOthers ";
|
||||
G4cout << "G4VUserPhysicsList::SetCutValueForOthers: negative cut values";
|
||||
G4cout << " :" << cutValue/mm << "[mm]" << endl;
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel >1) {
|
||||
G4cout << "G4VUserPhysicsList::SetCutValueForOthers ";
|
||||
G4cout << " :" << cutValue/mm << "[mm]" << endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Sets a cut value to particle types which have not be called SetCuts()
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
|
||||
if (!particle->IsShortLived()) {
|
||||
if ((particle->GetLengthCuts()<0.0) ||(particle->GetEnergyCuts()==NULL)) {
|
||||
// check if the cut value has already been set
|
||||
if ((particle->GetLengthCuts()<0.0) ||(particle->GetEnergyCuts()==0)) {
|
||||
// set cut value
|
||||
particle->SetCuts(cutValue);
|
||||
// build physics table
|
||||
BuildPhysicsTable(particle);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel >1)
|
||||
G4cout << "Set cuts for " << particle->GetParticleName() << endl;
|
||||
BuildPhysicsTable(particle);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void G4VUserPhysicsList::ReCalcCutValue(const G4String& name)
|
||||
{
|
||||
G4ParticleDefinition* particle;
|
||||
if (particle = theParticleTable->FindParticle(name)){
|
||||
G4ParticleDefinition* particle = theParticleTable->FindParticle(name);
|
||||
if (particle != 0 ){
|
||||
if (!particle->IsShortLived()) {
|
||||
particle->ReCalcCuts();
|
||||
if (verboseLevel >1) G4cout << "Recalc cuts for " << name << endl;
|
||||
BuildPhysicsTable(particle);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel >1) G4cout << "Recalc cuts for " << name << endl;
|
||||
#endif
|
||||
}
|
||||
} else {
|
||||
if (verboseLevel >0)
|
||||
G4cout << name << " is not found in ParticleTable" << endl;
|
||||
}
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (( particle ==0 ) && (verboseLevel >0)) {
|
||||
G4cout << name << " is not found in ParticleTable" << endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void G4VUserPhysicsList::ReCalcCutValueForOthers()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel >1) {
|
||||
G4cout << "G4VUserPhysicsList::ReCalcCutValueForOthers ";
|
||||
}
|
||||
#endif
|
||||
|
||||
// Sets a cut value to particle types which have not be called SetCuts()
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
|
||||
if (!particle->IsShortLived()) {
|
||||
if (particle->GetEnergyCuts()==NULL) {
|
||||
if (verboseLevel >1)
|
||||
G4cout << "ReCalc cuts for " << particle->GetParticleName() << endl;
|
||||
if (particle->GetEnergyCuts()==0) {
|
||||
particle->ReCalcCuts();
|
||||
BuildPhysicsTable(particle);
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel >1)
|
||||
G4cout << "ReCalc cuts for " << particle->GetParticleName() << endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -358,10 +488,11 @@ void G4VUserPhysicsList::BuildPhysicsTable(G4ParticleDefinition* particle)
|
||||
|
||||
// Rebuild the physics tables for every process for this particle type
|
||||
G4ProcessVector* pVector = (particle->GetProcessManager())->GetProcessList();
|
||||
for ( j=0; j < pVector->length(); ++j) {
|
||||
for ( j=0; j < pVector->entries(); ++j) {
|
||||
(*pVector)[j]->BuildPhysicsTable(*particle);
|
||||
}
|
||||
for ( j=0; j < pVector->length(); ++j) {
|
||||
|
||||
for ( j=0; j < pVector->entries(); ++j) {
|
||||
|
||||
//*********************************************************************
|
||||
// temporary addition to make the integral schema of electromagnetic
|
||||
@@ -403,60 +534,6 @@ void G4VUserPhysicsList::BuildPhysicsTable(G4ParticleDefinition* particle)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void G4VUserPhysicsList::ConstructAllParticles()
|
||||
{
|
||||
ConstructAllBosons();
|
||||
ConstructAllLeptons();
|
||||
ConstructAllMesons();
|
||||
ConstructAllBarions();
|
||||
ConstructAllIons();
|
||||
ConstructAllShortLiveds();
|
||||
}
|
||||
|
||||
void G4VUserPhysicsList::ConstructAllBosons()
|
||||
{
|
||||
// Construct all bosons
|
||||
G4BosonConstructor pConstructor;
|
||||
pConstructor.ConstructParticle();
|
||||
}
|
||||
|
||||
void G4VUserPhysicsList::ConstructAllLeptons()
|
||||
{
|
||||
// Construct all leptons
|
||||
G4LeptonConstructor pConstructor;
|
||||
pConstructor.ConstructParticle();
|
||||
}
|
||||
|
||||
void G4VUserPhysicsList::ConstructAllMesons()
|
||||
{
|
||||
// Construct all mesons
|
||||
G4MesonConstructor pConstructor;
|
||||
pConstructor.ConstructParticle();
|
||||
}
|
||||
|
||||
void G4VUserPhysicsList::ConstructAllBarions()
|
||||
{
|
||||
// Construct all barions
|
||||
G4BarionConstructor pConstructor;
|
||||
pConstructor.ConstructParticle();
|
||||
}
|
||||
|
||||
void G4VUserPhysicsList::ConstructAllIons()
|
||||
{
|
||||
// Construct light ions
|
||||
G4IonConstructor pConstructor;
|
||||
pConstructor.ConstructParticle();
|
||||
}
|
||||
|
||||
void G4VUserPhysicsList::ConstructAllShortLiveds()
|
||||
{
|
||||
// Construct resonaces and quarks
|
||||
G4ShortLivedConstructor pConstructor;
|
||||
pConstructor.ConstructParticle();
|
||||
}
|
||||
|
||||
|
||||
void G4VUserPhysicsList::DumpList() const
|
||||
{
|
||||
theParticleIterator->reset();
|
||||
@@ -484,35 +561,43 @@ void G4VUserPhysicsList::DumpCutValues(const G4String &particle_name) const
|
||||
}
|
||||
} else {
|
||||
particle = theParticleTable->FindParticle(particle_name);
|
||||
if (particle != NULL) DumpCutValues(particle);
|
||||
if (particle != 0) DumpCutValues(particle);
|
||||
}
|
||||
}
|
||||
|
||||
void G4VUserPhysicsList::DumpCutValues( G4ParticleDefinition* particle) const
|
||||
{
|
||||
if (particle == NULL) return;
|
||||
if (particle == 0) return;
|
||||
|
||||
G4int prec = G4cout.precision(3);
|
||||
|
||||
if (particle->IsShortLived()) {
|
||||
// name field
|
||||
G4cout << " --- " << particle->GetParticleName() << " is a short lived particle ------ " << endl;
|
||||
} else {
|
||||
// name field
|
||||
G4cout << " --- " << particle->GetParticleName() << " ------ " << endl;
|
||||
|
||||
// cut value in range field
|
||||
G4cout << " - Cut in range = " << G4BestUnit(particle->GetLengthCuts(),"Length") << endl;
|
||||
|
||||
// material and energy cut value for the material
|
||||
G4double* theKineticEnergyCuts = particle->GetEnergyCuts();
|
||||
|
||||
if (theKineticEnergyCuts != NULL) {
|
||||
if (theKineticEnergyCuts != 0) {
|
||||
const G4MaterialTable* materialTable = G4Material::GetMaterialTable();
|
||||
G4cout << " - Material ---------------- Energy Cut ---" << endl;
|
||||
for (G4int idx=0; idx<materialTable->length(); idx++){
|
||||
for (G4int idx=0; idx<materialTable->entries(); idx++){
|
||||
G4cout << " " << setw(19) << (*materialTable)[idx]->GetName();
|
||||
G4cout << " : " << setw(10) << G4BestUnit(theKineticEnergyCuts[idx],"Energy");
|
||||
G4cout << endl;
|
||||
}
|
||||
|
||||
} else {
|
||||
G4cout << " - Cuts in energy are not calculated yet --" << endl;
|
||||
G4cout << " Enter /run/initialize command to calculate cuts " << endl;
|
||||
}
|
||||
|
||||
}
|
||||
G4cout.precision(prec);
|
||||
}
|
||||
@@ -548,7 +633,7 @@ void G4VUserPhysicsList::DumpCutValuesTable() const
|
||||
// line 4
|
||||
G4cout << "Cut in range ";
|
||||
for (idx=0; idx <size; idx++) {
|
||||
if (particle[idx] == NULL) {
|
||||
if (particle[idx] == 0) {
|
||||
G4cout << " ";
|
||||
} else {
|
||||
G4cout << " " << setw(11) << G4BestUnit(particle[idx]->GetLengthCuts(),"Length");
|
||||
@@ -562,13 +647,13 @@ void G4VUserPhysicsList::DumpCutValuesTable() const
|
||||
|
||||
// line 6 ..
|
||||
const G4MaterialTable* materialTable = G4Material::GetMaterialTable();
|
||||
for (G4int J=0; J<materialTable->length(); J++) {
|
||||
for (G4int J=0; J<materialTable->entries(); J++) {
|
||||
G4cout << " " << setw(18) << ((*materialTable)[J])->GetName();
|
||||
for (idx=0; idx <size; idx++) {
|
||||
if (particle[idx] == NULL) {
|
||||
if (particle[idx] == 0) {
|
||||
G4cout << " ";
|
||||
} else {
|
||||
if (particle[idx]->GetEnergyCuts() == NULL) {
|
||||
if (particle[idx]->GetEnergyCuts() == 0) {
|
||||
G4cout << " ---------- ";
|
||||
IsOK = false;
|
||||
} else {
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4VUserPrimaryGeneratorAction.cc,v 2.0 1998/07/02 17:28:11 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4VUserPrimaryGeneratorAction.cc,v 1.1 1999/01/07 16:14:19 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
|
||||
Reference in New Issue
Block a user