Import Geant4 1.0.0 source tree
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4RunMessenger.cc,v 1.1 1999/01/07 16:14:18 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4RunMessenger.cc,v 1.4.8.1 1999/12/07 20:52:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
#include "G4RunMessenger.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithABool.hh"
|
||||
#include "G4UIcommand.hh"
|
||||
@@ -105,6 +106,36 @@ G4RunMessenger::G4RunMessenger(G4RunManager * runMgr)
|
||||
cutCmd->SetGuidance(" if cutoff value(s) have been modified after the");
|
||||
cutCmd->SetGuidance(" first initialization (or BeamOn).");
|
||||
cutCmd->AvailableForStates(PreInit,Idle);
|
||||
|
||||
storeRandCmd = new G4UIcmdWithAnInteger("/run/storeRandomNumberStatus",this);
|
||||
storeRandCmd->SetGuidance("Store the status of the random number engine to a file.");
|
||||
storeRandCmd->SetGuidance("See CLHEP manual for detail.");
|
||||
storeRandCmd->SetGuidance("Frequency : 0 - not stored");
|
||||
storeRandCmd->SetGuidance(" 1 - begining of each run");
|
||||
storeRandCmd->SetGuidance(" -1 - begining of each run (file overwritten)");
|
||||
storeRandCmd->SetGuidance(" 2 - begining of each event before generating primaries");
|
||||
storeRandCmd->SetGuidance(" -2 - begining of each event before generating primaries (file overwritten)");
|
||||
storeRandCmd->SetGuidance("Stored status can be restored by ");
|
||||
storeRandCmd->SetGuidance(" /run/restoreRandomNumberStatus command.");
|
||||
storeRandCmd->SetGuidance("In case Frequency is negative, a output file (file name RandEngine.stat)");
|
||||
storeRandCmd->SetGuidance(" is overwitten every time.");
|
||||
storeRandCmd->SetGuidance("In case Frequency is 1, file names are RandEngineRxxx.stat,");
|
||||
storeRandCmd->SetGuidance(" where xxx is the run number.");
|
||||
storeRandCmd->SetGuidance("In case Frequency is 2, file names are RandEngineRxxxEyyy.stat,");
|
||||
storeRandCmd->SetGuidance(" where xxx is the run number and yyy is the event number.");
|
||||
storeRandCmd->AvailableForStates(PreInit,Idle);
|
||||
storeRandCmd->SetParameterName("frequency",true);
|
||||
storeRandCmd->SetDefaultValue(1);
|
||||
storeRandCmd->SetRange("frequency >=-2 && frequency <=2");
|
||||
|
||||
restoreRandCmd = new G4UIcmdWithAString("/run/restoreRandomNumberStatus",this);
|
||||
restoreRandCmd->SetGuidance("Restore the status of the random number engine from a file.");
|
||||
restoreRandCmd->SetGuidance("See CLHEP manual for detail.");
|
||||
restoreRandCmd->SetGuidance("The engine status must be stored beforehand.");
|
||||
restoreRandCmd->SetParameterName("fileName",true);
|
||||
restoreRandCmd->SetDefaultValue("RandEngine.stat");
|
||||
restoreRandCmd->AvailableForStates(PreInit,Idle,GeomClosed);
|
||||
|
||||
}
|
||||
|
||||
G4RunMessenger::~G4RunMessenger()
|
||||
@@ -118,6 +149,8 @@ G4RunMessenger::~G4RunMessenger()
|
||||
delete initCmd;
|
||||
delete geomCmd;
|
||||
delete cutCmd;
|
||||
delete storeRandCmd;
|
||||
delete restoreRandCmd;
|
||||
delete runDirectory;
|
||||
}
|
||||
|
||||
@@ -151,6 +184,10 @@ void G4RunMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
{ runManager->GeometryHasBeenModified(); }
|
||||
else if( command==cutCmd )
|
||||
{ runManager->CutOffHasBeenModified(); }
|
||||
else if( command==storeRandCmd )
|
||||
{ runManager->SetRandomNumberStore(storeRandCmd->GetNewIntValue(newValue)); }
|
||||
else if( command==restoreRandCmd )
|
||||
{ runManager->RestoreRandomNumberStatus(newValue); }
|
||||
}
|
||||
|
||||
G4String G4RunMessenger::GetCurrentValue(G4UIcommand * command)
|
||||
@@ -159,6 +196,8 @@ G4String G4RunMessenger::GetCurrentValue(G4UIcommand * command)
|
||||
|
||||
if( command==verboseCmd )
|
||||
{ cv = verboseCmd->ConvertToString(runManager->GetVerboseLevel()); }
|
||||
else if( command==storeRandCmd )
|
||||
{ cv = storeRandCmd->ConvertToString(runManager->GetRandomNumberStore()); }
|
||||
|
||||
return cv;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user