Import Geant4 5.1.0 source tree
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ExceptionHandler.cc,v 1.2 2002/12/04 21:52:40 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Run.cc,v 1.4 2001/07/13 15:57:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4Run.cc,v 1.5 2003/04/23 17:54:31 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
|
||||
#include "G4Run.hh"
|
||||
@@ -30,7 +30,7 @@
|
||||
G4Allocator<G4Run> aRunAllocator;
|
||||
|
||||
G4Run::G4Run()
|
||||
:runID(0),numberOfEvent(0),HCtable(0),DCtable(0)
|
||||
:runID(0),numberOfEvent(0),numberOfEventToBeProcessed(0),HCtable(0),DCtable(0)
|
||||
{;}
|
||||
|
||||
G4Run::~G4Run()
|
||||
|
||||
+121
-20
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunManager.cc,v 1.54 2002/12/12 08:33:51 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4RunManager.cc,v 1.75 2003/04/24 17:42:06 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
|
||||
@@ -43,6 +43,11 @@
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4Region.hh"
|
||||
#include "G4RegionStore.hh"
|
||||
#include "G4ProductionCuts.hh"
|
||||
#include "G4ProductionCutsTable.hh"
|
||||
#include "G4ApplicationState.hh"
|
||||
#include "G4StateManager.hh"
|
||||
#include "G4VPersistencyManager.hh"
|
||||
@@ -51,6 +56,7 @@
|
||||
#include "G4ProcessTable.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4ExceptionHandler.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "g4std/strstream"
|
||||
@@ -83,7 +89,7 @@ G4RunManager::G4RunManager()
|
||||
geometryNeedsToBeClosed(true),runAborted(false),initializedAtLeastOnce(false),
|
||||
geometryToBeOptimized(true),runIDCounter(0),verboseLevel(0),DCtable(0),
|
||||
currentRun(0),currentEvent(0),n_perviousEventsToBeStored(0),
|
||||
storeRandomNumberStatus(false)
|
||||
numberOfEventToBeProcessed(0),storeRandomNumberStatus(false),currentWorld(0)
|
||||
{
|
||||
defaultExceptionHandler = new G4ExceptionHandler();
|
||||
if(fRunManager)
|
||||
@@ -94,10 +100,12 @@ G4RunManager::G4RunManager()
|
||||
timer = new G4Timer();
|
||||
runMessenger = new G4RunMessenger(this);
|
||||
previousEvents = new G4std::vector<G4Event*>;
|
||||
defaultRegion = new G4Region("DefaultRegionForTheWorld");
|
||||
defaultRegion->SetProductionCuts(G4ProductionCutsTable::GetProductionCutsTable()->GetDefaultProductionCuts());
|
||||
G4ParticleTable::GetParticleTable()->CreateMessenger();
|
||||
G4ProcessTable::GetProcessTable()->CreateMessenger();
|
||||
randomNumberStatusDir = "./";
|
||||
versionString = " Geant4 version $Name: geant4-05-00 $\n (13-Dec-2002)";
|
||||
versionString = " Geant4 version $Name: geant4-05-01 $\n (30-Apr-2003)";
|
||||
G4cout
|
||||
<< "**********************************************" << G4endl
|
||||
<< versionString << G4endl
|
||||
@@ -166,8 +174,9 @@ void G4RunManager::BeamOn(G4int n_event,const char* macroFile,G4int n_select)
|
||||
G4bool cond = ConfirmBeamOnCondition();
|
||||
if(cond)
|
||||
{
|
||||
numberOfEventToBeProcessed = n_event;
|
||||
RunInitialization();
|
||||
DoEventLoop(n_event,macroFile,n_select);
|
||||
if(n_event>0) DoEventLoop(n_event,macroFile,n_select);
|
||||
RunTermination();
|
||||
}
|
||||
}
|
||||
@@ -190,26 +199,33 @@ G4bool G4RunManager::ConfirmBeamOnCondition()
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!(geometryInitialized && physicsInitialized && cutoffInitialized))
|
||||
if(!geometryInitialized || !physicsInitialized || !cutoffInitialized)
|
||||
{
|
||||
if(verboseLevel>0)
|
||||
{
|
||||
G4cout << "Start re-initialization because " << G4endl;
|
||||
if(!geometryInitialized) G4cout << " Geometry" << G4endl;
|
||||
if(!physicsInitialized) G4cout << " Physics processes" << G4endl;
|
||||
if(!cutoffInitialized) G4cout << " Cutoff" << G4endl;
|
||||
if(!cutoffInitialized) G4cout << " SetCuts" << G4endl;
|
||||
G4cout << "has been modified since last Run." << G4endl;
|
||||
}
|
||||
Initialize();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void G4RunManager::RunInitialization()
|
||||
{
|
||||
currentRun = new G4Run();
|
||||
currentRun = 0;
|
||||
if(userRunAction) currentRun = userRunAction->GenerateRun();
|
||||
if(!currentRun) currentRun = new G4Run();
|
||||
|
||||
G4StateManager* stateManager = G4StateManager::GetStateManager();
|
||||
stateManager->SetNewState(G4State_GeomClosed);
|
||||
currentRun->SetRunID(runIDCounter);
|
||||
currentRun->SetNumberOfEventToBeProcessed(numberOfEventToBeProcessed);
|
||||
|
||||
BuildPhysicsTables();
|
||||
|
||||
currentRun->SetDCtable(DCtable);
|
||||
G4SDManager* fSDM = G4SDManager::GetSDMpointerIfExist();
|
||||
@@ -225,8 +241,6 @@ void G4RunManager::RunInitialization()
|
||||
geomManager->CloseGeometry(geometryToBeOptimized, verboseLevel>1);
|
||||
geometryNeedsToBeClosed = false;
|
||||
}
|
||||
G4StateManager* stateManager = G4StateManager::GetStateManager();
|
||||
stateManager->SetNewState(G4State_GeomClosed);
|
||||
|
||||
//previousEvents->clearAndDestroy();
|
||||
for(size_t itr=0;itr<previousEvents->size();itr++)
|
||||
@@ -369,7 +383,7 @@ void G4RunManager::Initialize()
|
||||
if(!physicsInitialized) InitializePhysics();
|
||||
if(!cutoffInitialized) InitializeCutOff();
|
||||
stateManager->SetNewState(G4State_Idle);
|
||||
if(!initializedAtLeastOnce) initializedAtLeastOnce = true;
|
||||
initializedAtLeastOnce = true;
|
||||
}
|
||||
|
||||
void G4RunManager::InitializeGeometry()
|
||||
@@ -405,8 +419,34 @@ void G4RunManager::InitializeCutOff()
|
||||
{
|
||||
if(verboseLevel>1) G4cout << "physicsList->setCut() start." << G4endl;
|
||||
physicsList->SetCuts();
|
||||
cutoffInitialized = true;
|
||||
}
|
||||
cutoffInitialized = true;
|
||||
else
|
||||
{
|
||||
G4Exception("G4VUserPhysicsList is not defined");
|
||||
}
|
||||
}
|
||||
|
||||
void G4RunManager::BuildPhysicsTables()
|
||||
{
|
||||
UpdateRegion();
|
||||
|
||||
// Let G4ProductionCutsTable create new couples
|
||||
G4ProductionCutsTable::GetProductionCutsTable()->UpdateCoupleTable();
|
||||
|
||||
if(G4ProductionCutsTable::GetProductionCutsTable()->IsModified())
|
||||
{
|
||||
physicsList->BuildPhysicsTable();
|
||||
G4ProductionCutsTable::GetProductionCutsTable()->PhysicsTableUpdated();
|
||||
}
|
||||
|
||||
physicsList->DumpCutValuesTableIfRequested();
|
||||
}
|
||||
|
||||
void G4RunManager::UpdateRegion()
|
||||
{
|
||||
// Let G4RegionStore scan materials
|
||||
G4RegionStore::GetInstance()->UpdateMaterialList();
|
||||
}
|
||||
|
||||
void G4RunManager::AbortRun(G4bool softAbort)
|
||||
@@ -447,16 +487,45 @@ void G4RunManager::AbortEvent()
|
||||
|
||||
void G4RunManager::DefineWorldVolume(G4VPhysicalVolume* worldVol)
|
||||
{
|
||||
// check if this is different from previous
|
||||
//////if(currentWorld==worldVol) return;
|
||||
// The world volume MUST NOT have a region defined by the user.
|
||||
if(worldVol->GetLogicalVolume()->GetRegion())
|
||||
{
|
||||
if(worldVol->GetLogicalVolume()->GetRegion()!=defaultRegion)
|
||||
{
|
||||
G4cerr << "The world volume has a user-defined region <"
|
||||
<< worldVol->GetLogicalVolume()->GetRegion()->GetName()
|
||||
<< ">." << G4endl;
|
||||
G4Exception("G4RunManager::DefineWorldVolume",
|
||||
"RUN:WorldHasUserDefinedRegion",
|
||||
FatalException,
|
||||
"World would have a default region assigned by RunManager.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// set the default region to the world
|
||||
G4LogicalVolume* worldLog = worldVol->GetLogicalVolume();
|
||||
worldLog->SetRegion(defaultRegion);
|
||||
defaultRegion->AddRootLogicalVolume(worldLog);
|
||||
}
|
||||
|
||||
currentWorld = worldVol;
|
||||
//geometryNeedsToBeClosed = true;
|
||||
GeometryHasBeenModified();
|
||||
|
||||
// set the world volume to the Navigator
|
||||
//ResetNavigator();
|
||||
G4TransportationManager::GetTransportationManager()
|
||||
->GetNavigatorForTracking()
|
||||
->SetWorldVolume(worldVol);
|
||||
//ResetNavigator();
|
||||
|
||||
// Let VisManager know it
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
if(pVVisManager) pVVisManager->GeometryHasChanged();
|
||||
|
||||
geometryNeedsToBeClosed = true;
|
||||
}
|
||||
|
||||
void G4RunManager::ResetNavigator() const
|
||||
@@ -464,12 +533,7 @@ void G4RunManager::ResetNavigator() const
|
||||
G4StateManager* stateManager = G4StateManager::GetStateManager();
|
||||
G4ApplicationState currentState = stateManager->GetCurrentState();
|
||||
|
||||
if(!initializedAtLeastOnce)
|
||||
{
|
||||
G4cerr << " Geant4 kernel should be initialized" << G4endl;
|
||||
G4cerr << " Navigator is not touched..." << G4endl;
|
||||
return;
|
||||
}
|
||||
if(!initializedAtLeastOnce) return;
|
||||
|
||||
if( currentState != G4State_Idle )
|
||||
{
|
||||
@@ -542,3 +606,40 @@ void G4RunManager::RestoreRandomNumberStatus(G4String fileN)
|
||||
<< fileNameWithDirectory << G4endl;
|
||||
HepRandom::showEngineStatus();
|
||||
}
|
||||
|
||||
void G4RunManager::DumpRegion(G4String rname) const
|
||||
{
|
||||
G4Region* region = G4RegionStore::GetInstance()->GetRegion(rname);
|
||||
if(region) DumpRegion(region);
|
||||
}
|
||||
|
||||
void G4RunManager::DumpRegion(G4Region* region) const
|
||||
{
|
||||
if(!region)
|
||||
{
|
||||
for(size_t i=0;i<G4RegionStore::GetInstance()->size();i++)
|
||||
{ DumpRegion((*(G4RegionStore::GetInstance()))[i]); }
|
||||
}
|
||||
else
|
||||
{
|
||||
G4cout << "Region " << region->GetName() << G4endl;
|
||||
G4cout << " Materials : ";
|
||||
G4std::vector<G4Material*>::const_iterator mItr = region->GetMaterialIterator();
|
||||
size_t nMaterial = region->GetNumberOfMaterials();
|
||||
for(size_t iMate=0;iMate<nMaterial;iMate++)
|
||||
{
|
||||
G4cout << (*mItr)->GetName() << " ";
|
||||
mItr++;
|
||||
}
|
||||
G4cout << G4endl;
|
||||
G4ProductionCuts* cuts = region->GetProductionCuts();
|
||||
G4cout << " Production cuts : "
|
||||
<< " gamma " << G4BestUnit(cuts->GetProductionCut("gamma"),"Length")
|
||||
<< " e- " << G4BestUnit(cuts->GetProductionCut("e-"),"Length")
|
||||
<< " e+ " << G4BestUnit(cuts->GetProductionCut("e+"),"Length")
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4RunMessenger.cc,v 1.12 2002/12/04 21:52:40 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4RunMessenger.cc,v 1.17 2003/04/03 18:43:32 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
|
||||
#include "G4RunMessenger.hh"
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "G4UIcommand.hh"
|
||||
#include "G4UIparameter.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4ProductionCutsTable.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "g4std/strstream"
|
||||
|
||||
@@ -64,7 +65,7 @@ G4RunMessenger::G4RunMessenger(G4RunManager * runMgr)
|
||||
beamOnCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
G4UIparameter* p1 = new G4UIparameter("numberOfEvent",'i',true);
|
||||
p1->SetDefaultValue(1);
|
||||
p1->SetParameterRange("numberOfEvent > 0");
|
||||
p1->SetParameterRange("numberOfEvent >= 0");
|
||||
beamOnCmd->SetParameter(p1);
|
||||
G4UIparameter* p2 = new G4UIparameter("macroFile",'s',true);
|
||||
p2->SetDefaultValue("***NULL***");
|
||||
@@ -83,6 +84,19 @@ G4RunMessenger::G4RunMessenger(G4RunManager * runMgr)
|
||||
verboseCmd->SetDefaultValue(0);
|
||||
verboseCmd->SetRange("level >=0 && level <=2");
|
||||
|
||||
dumpRegCmd = new G4UIcmdWithAString("/run/dumpRegion",this);
|
||||
dumpRegCmd->SetGuidance("Dump region information.");
|
||||
dumpRegCmd->SetGuidance("In case name of a region is not given, all regions will be displayed.");
|
||||
dumpRegCmd->SetParameterName("regionName", true);
|
||||
dumpRegCmd->SetDefaultValue("**ALL**");
|
||||
dumpRegCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
dumpCoupleCmd = new G4UIcmdWithoutParameter("/run/dumpCouples",this);
|
||||
dumpCoupleCmd->SetGuidance("Dump material-cuts-couple information.");
|
||||
dumpCoupleCmd->SetGuidance("Note that material-cuts-couple information is updated");
|
||||
dumpCoupleCmd->SetGuidance("after BeamOn has started.");
|
||||
dumpCoupleCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
optCmd = new G4UIcmdWithABool("/run/optimizeGeometry",this);
|
||||
optCmd->SetGuidance("Set the optimization flag for geometry.");
|
||||
optCmd->SetGuidance("If it is set to TRUE, G4GeometryManager will optimize");
|
||||
@@ -196,6 +210,8 @@ G4RunMessenger::~G4RunMessenger()
|
||||
delete beamOnCmd;
|
||||
delete verboseCmd;
|
||||
delete optCmd;
|
||||
delete dumpRegCmd;
|
||||
delete dumpCoupleCmd;
|
||||
delete brkBoECmd;
|
||||
delete brkEoECmd;
|
||||
delete abortCmd;
|
||||
@@ -230,6 +246,18 @@ void G4RunMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
}
|
||||
else if( command==verboseCmd )
|
||||
{ runManager->SetVerboseLevel(verboseCmd->GetNewIntValue(newValue)); }
|
||||
else if( command==dumpRegCmd )
|
||||
{
|
||||
runManager->UpdateRegion();
|
||||
if(newValue=="**ALL**")
|
||||
{ runManager->DumpRegion(); }
|
||||
else
|
||||
{ runManager->DumpRegion(newValue); }
|
||||
}
|
||||
else if( command==dumpCoupleCmd)
|
||||
{
|
||||
G4ProductionCutsTable::GetProductionCutsTable()->DumpCouples();
|
||||
}
|
||||
else if( command==optCmd )
|
||||
{ runManager->SetGeometryToBeOptimized(optCmd->GetNewBoolValue(newValue)); }
|
||||
else if( command==brkBoECmd )
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UserPhysicsListMessenger.cc,v 1.11 2002/12/04 21:52:40 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4UserPhysicsListMessenger.cc,v 1.22 2003/04/28 22:54:37 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -49,6 +49,7 @@
|
||||
|
||||
G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(G4VUserPhysicsList* pParticleList):thePhysicsList(pParticleList)
|
||||
{
|
||||
G4UIparameter* param = 0;
|
||||
// /run/particle directory
|
||||
theDirectory = new G4UIdirectory("/run/particle/");
|
||||
theDirectory->SetGuidance("Commands for G4VUserPhysicsList.");
|
||||
@@ -64,29 +65,43 @@ G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(G4VUserPhysicsList* pPart
|
||||
verboseCmd->SetRange("level >=0 && level <=3");
|
||||
|
||||
// /run/particle/setCut command
|
||||
setCutCmd = new G4UIcmdWithADoubleAndUnit("/run/particle/setCut",this);
|
||||
setPCutCmd = new G4UIcmdWithADoubleAndUnit("/run/particle/setCut",this);
|
||||
setPCutCmd->SetGuidance("Set default cut value ");
|
||||
setPCutCmd->SetGuidance("This command is equivallent to /run/setCut command.");
|
||||
setPCutCmd->SetGuidance("This command is kept for backward compatibility.");
|
||||
setPCutCmd->SetParameterName("cut",false);
|
||||
setPCutCmd->SetDefaultValue(1.0);
|
||||
setPCutCmd->SetRange("cut >0.0");
|
||||
setPCutCmd->SetDefaultUnit("mm");
|
||||
setPCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
// /run/setCut command
|
||||
setCutCmd = new G4UIcmdWithADoubleAndUnit("/run/setCut",this);
|
||||
setCutCmd->SetGuidance("Set default cut value ");
|
||||
setCutCmd->SetParameterName("cut",false);
|
||||
setCutCmd->SetDefaultValue(1.0);
|
||||
setCutCmd->SetRange("cut >0.0");
|
||||
setCutCmd->SetUnitCandidates("m cm mm microm");
|
||||
setCutCmd->SetDefaultUnit("mm");
|
||||
setCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
// /run/setCutForRegion command
|
||||
setCutRCmd = new G4UIcommand("/run/setCutForRegion",this);
|
||||
setCutRCmd->SetGuidance("Set cut value for a region");
|
||||
param = new G4UIparameter("Region",'s',false);
|
||||
setCutRCmd->SetParameter(param);
|
||||
param = new G4UIparameter("cut",'d',false);
|
||||
param->SetParameterRange("cut >0.0");
|
||||
setCutRCmd->SetParameter(param);
|
||||
param = new G4UIparameter("Unit",'s',true);
|
||||
param->SetDefaultValue("mm");
|
||||
param->SetParameterCandidates(setCutRCmd->UnitsList(setCutRCmd->CategoryOf("mm")));
|
||||
setCutRCmd->SetParameter(param);
|
||||
setCutRCmd->AvailableForStates(G4State_Idle);
|
||||
|
||||
// /run/particle/DumpList command
|
||||
dumpListCmd = new G4UIcmdWithoutParameter("/run/particle/dumpList",this);
|
||||
dumpListCmd->SetGuidance("Dump List of particles in G4VUserPhysicsList. ");
|
||||
|
||||
|
||||
// /run/particle/DumpCutValues command
|
||||
dumpCutValuesCmd = new G4UIcmdWithAString("/run/particle/dumpCutValues",this);
|
||||
dumpCutValuesCmd->SetGuidance("Dump cut value information ");
|
||||
dumpCutValuesCmd->SetGuidance("Enter particle name ");
|
||||
dumpCutValuesCmd->SetGuidance(" enter all for all particles");
|
||||
dumpCutValuesCmd->SetParameterName("particle", true);
|
||||
dumpCutValuesCmd->SetDefaultValue("table");
|
||||
dumpCutValuesCmd->AvailableForStates(G4State_Idle,G4State_GeomClosed,G4State_EventProc);
|
||||
|
||||
// /run/particle/addProcManager command
|
||||
addProcManCmd = new G4UIcmdWithAString("/run/particle/addProcManager", this);
|
||||
addProcManCmd->SetGuidance("add process manager to specified particle type");
|
||||
@@ -128,39 +143,80 @@ G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(G4VUserPhysicsList* pPart
|
||||
|
||||
//Commnad /run/particle/applyCuts command
|
||||
applyCutsCmd = new G4UIcommand("/run/particle/applyCuts",this);
|
||||
applyCutsCmd->SetGuidance("Set ApplyCuts flag ");
|
||||
applyCutsCmd->SetGuidance(" applyCuts [value] [particle]");
|
||||
applyCutsCmd->SetGuidance(" value : true(default) or false ");
|
||||
applyCutsCmd->SetGuidance(" particle : all(default) or particle name ");
|
||||
G4UIparameter* param = new G4UIparameter("Flag",'s',true);
|
||||
applyCutsCmd->SetGuidance("Set applyCuts flag for a particle.");
|
||||
applyCutsCmd->SetGuidance(" Some EM processes which do not have infrared divergence");
|
||||
applyCutsCmd->SetGuidance("may generate gamma, e- and/or e+ with kinetic energies");
|
||||
applyCutsCmd->SetGuidance("below the production threshold. By setting this flag,");
|
||||
applyCutsCmd->SetGuidance("such secondaries below threshold are eliminated and");
|
||||
applyCutsCmd->SetGuidance("kinetic energies of such secondaries are accumulated");
|
||||
applyCutsCmd->SetGuidance("to the energy deposition of their mother.");
|
||||
applyCutsCmd->SetGuidance(" Note that 'applyCuts' makes sense only for gamma,");
|
||||
applyCutsCmd->SetGuidance("e- and e+. If this command is issued for other particle,");
|
||||
applyCutsCmd->SetGuidance("a warning message is displayed and the command is");
|
||||
applyCutsCmd->SetGuidance("ignored.");
|
||||
applyCutsCmd->SetGuidance(" If particle name is 'all', this command affects on");
|
||||
applyCutsCmd->SetGuidance("gamma, e- and e+.");
|
||||
param = new G4UIparameter("Flag",'s',true);
|
||||
param->SetDefaultValue("true");
|
||||
applyCutsCmd->SetParameter(param);
|
||||
param = new G4UIparameter("Particle",'s',true);
|
||||
param->SetDefaultValue("all");
|
||||
applyCutsCmd->SetParameter(param);
|
||||
applyCutsCmd->AvailableForStates(G4State_PreInit,G4State_Init,G4State_Idle);
|
||||
|
||||
// /run/particle/dumpCutValues command
|
||||
dumpCutValuesCmd = new G4UIcmdWithAString("/run/particle/dumpCutValues",this);
|
||||
dumpCutValuesCmd->SetGuidance("Dump a list of production threshold values in range and energy");
|
||||
dumpCutValuesCmd->SetGuidance("for all registered material-cuts-couples.");
|
||||
dumpCutValuesCmd->SetGuidance("Dumping a list takes place when you issue 'beamOn' and");
|
||||
dumpCutValuesCmd->SetGuidance("actual conversion tables from range to energy are available.");
|
||||
dumpCutValuesCmd->SetGuidance("If you want a list 'immediately', use '/run/dumpRegion' for threshold");
|
||||
dumpCutValuesCmd->SetGuidance("list given in gange only. Also, '/run/dumpCouples' gives you the");
|
||||
dumpCutValuesCmd->SetGuidance("current list if you have already issued 'run/beamOn' at least once.");
|
||||
dumpCutValuesCmd->SetParameterName("particle",true);
|
||||
dumpCutValuesCmd->SetDefaultValue("all");
|
||||
dumpCutValuesCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
|
||||
|
||||
}
|
||||
|
||||
G4UserPhysicsListMessenger::~G4UserPhysicsListMessenger()
|
||||
{
|
||||
delete setPCutCmd;
|
||||
delete setCutCmd;
|
||||
delete setCutRCmd;
|
||||
delete verboseCmd;
|
||||
delete dumpListCmd;
|
||||
delete dumpCutValuesCmd;
|
||||
delete addProcManCmd;
|
||||
delete buildPTCmd;
|
||||
delete storeCmd;
|
||||
delete retrieveCmd;
|
||||
delete theDirectory;
|
||||
delete asciiCmd;
|
||||
delete applyCutsCmd;
|
||||
delete dumpCutValuesCmd;
|
||||
delete theDirectory;
|
||||
}
|
||||
|
||||
void G4UserPhysicsListMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
{
|
||||
if( command==setCutCmd ){
|
||||
if( command==setCutCmd || command==setPCutCmd ){
|
||||
G4double newCut = setCutCmd->GetNewDoubleValue(newValue);
|
||||
thePhysicsList->SetDefaultCutValue(newCut);
|
||||
thePhysicsList->SetCutsWithDefault();
|
||||
|
||||
} else if( command==setCutRCmd ){
|
||||
//G4Tokenizer next( newValue );
|
||||
//G4String rName = G4String(next());
|
||||
//G4String cValue = G4String(next())+" "+G4String(next());
|
||||
//G4double newCut = setCutCmd->GetNewDoubleValue(cValue);
|
||||
//thePhysicsList->SetCutsForRegion(newCut,rName);
|
||||
G4std::istrstream is(newValue);
|
||||
char regName[50];
|
||||
G4double cVal;
|
||||
char uniName[10];
|
||||
is >> regName >> cVal >> uniName;
|
||||
G4String regN = regName;
|
||||
G4String uniN = uniName;
|
||||
thePhysicsList->SetCutsForRegion(cVal*(setCutRCmd->ValueOf(uniN)),regN);
|
||||
|
||||
} else if( command==verboseCmd ) {
|
||||
thePhysicsList->SetVerboseLevel(verboseCmd->GetNewIntValue(newValue));
|
||||
@@ -168,13 +224,6 @@ void G4UserPhysicsListMessenger::SetNewValue(G4UIcommand * command,G4String newV
|
||||
} else if( command==dumpListCmd ){
|
||||
thePhysicsList->DumpList();
|
||||
|
||||
} else if( command==dumpCutValuesCmd ){
|
||||
if (newValue == "table") {
|
||||
thePhysicsList->DumpCutValuesTable();
|
||||
} else {
|
||||
thePhysicsList->DumpCutValues(newValue);
|
||||
}
|
||||
|
||||
} else if( command == addProcManCmd ){
|
||||
G4ParticleDefinition* particle = (G4ParticleTable::GetParticleTable())->FindParticle(newValue);
|
||||
if (particle == 0) return;
|
||||
@@ -215,6 +264,8 @@ void G4UserPhysicsListMessenger::SetNewValue(G4UIcommand * command,G4String newV
|
||||
|
||||
thePhysicsList->SetApplyCuts(flag, name);
|
||||
|
||||
} else if( command == dumpCutValuesCmd ) {
|
||||
thePhysicsList->DumpCutValuesTable(1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -225,7 +276,7 @@ G4String G4UserPhysicsListMessenger::GetCurrentValue(G4UIcommand * command)
|
||||
G4String candidates("none");
|
||||
G4ParticleTable::G4PTblDicIterator *piter = (G4ParticleTable::GetParticleTable())->GetIterator();
|
||||
|
||||
if( command==setCutCmd ){
|
||||
if( command==setCutCmd || command==setPCutCmd ){
|
||||
cv = setCutCmd->ConvertToString( thePhysicsList->GetDefaultCutValue(), "mm" );
|
||||
|
||||
} else if( command==verboseCmd ){
|
||||
@@ -268,12 +319,12 @@ G4String G4UserPhysicsListMessenger::GetCurrentValue(G4UIcommand * command)
|
||||
cv = "0";
|
||||
}
|
||||
|
||||
} else if( command == applyCutsCmd ) {
|
||||
if (thePhysicsList->GetApplyCuts("proton")){
|
||||
cv = "true";
|
||||
} else {
|
||||
cv = "false";
|
||||
}
|
||||
// } else if( command == applyCutsCmd ) {
|
||||
// if (thePhysicsList->GetApplyCuts("gamma")){
|
||||
// cv = "true";
|
||||
// } else {
|
||||
// cv = "false";
|
||||
// }
|
||||
}
|
||||
|
||||
return cv;
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UserRunAction.cc,v 1.4 2001/07/11 10:08:34 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// $Id: G4UserRunAction.cc,v 1.5 2003/03/10 01:50:21 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
|
||||
#include "G4UserRunAction.hh"
|
||||
@@ -33,6 +33,9 @@ G4UserRunAction::G4UserRunAction()
|
||||
G4UserRunAction::~G4UserRunAction()
|
||||
{;}
|
||||
|
||||
G4Run* G4UserRunAction::GenerateRun()
|
||||
{ return 0; }
|
||||
|
||||
void G4UserRunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
{;}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VModularPhysicsList.cc,v 1.2 2002/05/29 12:11:08 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VPersistencyManager.cc,v 1.4 2001/07/13 15:57:06 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
|
||||
#include "G4VPersistencyManager.hh"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserDetectorConstruction.cc,v 1.3 2001/07/11 10:08:34 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
|
||||
#include "G4VUserDetectorConstruction.hh"
|
||||
|
||||
+159
-1057
File diff suppressed because it is too large
Load Diff
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserPrimaryGeneratorAction.cc,v 1.3 2001/07/11 10:08:34 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-00 $
|
||||
// GEANT4 tag $Name: geant4-05-01 $
|
||||
//
|
||||
|
||||
#include "G4VUserPrimaryGeneratorAction.hh"
|
||||
|
||||
Reference in New Issue
Block a user