Import Geant4 0.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-01 15:25:35 +02:00
parent 54d6b71f95
commit b97f8d0df7
3237 changed files with 807095 additions and 0 deletions
@@ -0,0 +1,66 @@
// This code implementation is the intellectual property of
// the RD44 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: G4ApplicationState.hh,v 2.1 1998/07/12 02:59:26 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4APPLICATIONSTATE_H
#define G4APPLICATIONSTATE_H 1
// Specifies the state of the G4 application
//
// States:
// PreInit
// At the very begining of the Application. G4StateManager starts
// with this state. G4Initializer changes this state to Init when
// G4Initializer::Initialize() method starts. At the moment of
// the state change of PreInit->Init, no material, geometrical,
// particle or physics process has been initialized.
// Init
// During the G4Initializer::Initialize() method. G4Initializer
// changes this state to Idle when all initialization procedures
// are successfully Done.
// Idle
// Ready to start "BeamOn". G4RunManager changes this state to
// GeomClosed when G4RunManager::BeamOn() method starts and
// G4GeometryManager::CloseGeometry() is Done. At the end of
// BeamOn() method, G4RunManager will reset the application state
// to Idle after G4GeometryManager::OpenGeometry() is Done.
// GeomClosed
// G4 is in this state between G4GeometryManager::CloseGeometry()
// and G4GeometryManager::OpenGeometry(), but no event is in
// progress. At the begining of each event (construction of a
// G4Event object and primary particle generation), G4RunManager
// changes this state to EventProc and resets to GeomClosed state
// when G4EventManager::ProcessOneEvent() is over.
// EventProc
// Processing an event.
// Quit
// G4 is in this state when the destructor of G4RunManager is invoked.
//
//
// PreInit
// |
// v
// Init
// |
// v
// Idle ------> Quit
// |^
// v|
// GeomClosed (at each run)
// |^
// v|
// EventProc (at each event)
//
enum G4ApplicationState
{PreInit, Init, Idle, GeomClosed, EventProc, Quit};
#endif
@@ -0,0 +1,71 @@
// This code implementation is the intellectual property of
// the RD44 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: G4StateManager.hh,v 2.2 1998/09/25 13:09:16 asaim Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// ---------------- G4StateManager ----------------
// by Gabriele Cosmo, November 1996
// Class responsible for handling and updating the running state
// of the Geant4 application during its different phases.
// The class is a singleton, it can be accessed via the public
// method G4StateManager::GetStateManager().
// ------------------------------------------------------------
#ifndef G4StateManager_h
#define G4StateManager_h 1
#include <rw/tpordvec.h>
#include "globals.hh"
#include "G4ApplicationState.hh"
#include "G4VStateDependent.hh"
class G4StateManager {
public:
static G4StateManager* GetStateManager();
protected:
G4StateManager();
public:
~G4StateManager();
public:
G4ApplicationState GetCurrentState();
G4ApplicationState GetPreviousState();
G4bool SetNewState(G4ApplicationState requestedState);
G4bool RegisterDependent(G4VStateDependent* aDependent);
G4bool DeregisterDependent(G4VStateDependent* aDependent);
G4VStateDependent* RemoveDependent(const G4VStateDependent* aDependent);
G4String GetStateString(G4ApplicationState aState);
void Pause();
void Pause(char* msg);
void Pause(G4String msg);
private:
G4StateManager(const G4StateManager &right);
G4StateManager& operator=(const G4StateManager &right);
G4int operator==(const G4StateManager &right) const;
G4int operator!=(const G4StateManager &right) const;
private:
static G4StateManager* theStateManager;
G4ApplicationState theCurrentState;
G4ApplicationState thePreviousState;
RWTPtrOrderedVector<G4VStateDependent> theDependentsList;
};
#endif
+42
View File
@@ -0,0 +1,42 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UIbatch.hh,v 2.1 1998/07/12 02:59:27 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
// $id$
#ifndef G4UIbatch_h
#define G4UIbatch_h 1
#include "globals.hh"
#include "G4UIsession.hh"
#include <fstream.h>
class G4UImanager;
class G4UIbatch : public G4UIsession
{
public:
G4UIbatch(G4String fileName,G4UIsession* prevSession=NULL);
~G4UIbatch();
G4UIsession * SessionStart();
void PauseSessionStart(G4String Prompt);
private:
G4UImanager * UImanager;
G4UIsession * previousSession;
ifstream macroFile;
G4String macroFileName;
G4bool openFailed;
};
#endif
@@ -0,0 +1,32 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UIcmdWith3Vector.hh,v 2.1 1998/07/12 02:59:27 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
#ifndef G4UIcmdWith3Vector_H
#define G4UIcmdWith3Vector_H 1
#include "G4UIcommand.hh"
#include "G4ThreeVector.hh"
class G4UIcmdWith3Vector : public G4UIcommand
{
public:
G4UIcmdWith3Vector
(const char * theCommandPath,G4UImessenger * theMessenger);
G4ThreeVector GetNew3VectorValue(G4String paramString);
G4String ConvertToString(G4ThreeVector vec);
void SetParameterName(const char * theNameX,const char * theNameY,
const char * theNameZ,G4bool omittable,G4bool currentAsDefault=false);
void SetDefaultValue(G4ThreeVector defVal);
};
#endif
@@ -0,0 +1,37 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UIcmdWith3VectorAndUnit.hh,v 2.1 1998/07/12 02:59:28 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
#ifndef G4UIcmdWith3VectorAndUnit_H
#define G4UIcmdWith3VectorAndUnit_H 1
#include "G4UIcommand.hh"
#include "G4ThreeVector.hh"
class G4UIcmdWith3VectorAndUnit : public G4UIcommand
{
public:
G4UIcmdWith3VectorAndUnit
(const char * theCommandPath,G4UImessenger * theMessenger);
G4ThreeVector GetNew3VectorValue(G4String paramString);
G4ThreeVector GetNew3VectorRawValue(G4String paramString);
G4double GetNewUnitValue(G4String paramString);
G4String ConvertToString(G4ThreeVector vec,const char * unitName);
void SetParameterName(const char * theNameX,const char * theNameY,
const char * theNameZ,G4bool omittable,G4bool currentAsDefault=false);
void SetDefaultValue(G4ThreeVector defVal);
void SetUnitCategory(const char * unitCategory);
void SetUnitCandidates(const char * candidateList);
void SetDefaultUnit(const char * defUnit);
};
#endif
@@ -0,0 +1,31 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UIcmdWithABool.hh,v 2.1 1998/07/12 02:59:28 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
#ifndef G4UIcmdWithABool_H
#define G4UIcmdWithABool_H 1
#include "G4UIcommand.hh"
class G4UIcmdWithABool : public G4UIcommand
{
public:
G4UIcmdWithABool
(const char * theCommandPath,G4UImessenger * theMessenger);
G4bool GetNewBoolValue(G4String paramString);
G4String ConvertToString(G4bool intValue);
void SetParameterName(const char * theName,G4bool omittable,
G4bool currentAsDefault=false);
void SetDefaultValue(G4bool defVal);
};
#endif
@@ -0,0 +1,31 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UIcmdWithADouble.hh,v 2.1 1998/07/12 02:59:30 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
#ifndef G4UIcmdWithADouble_H
#define G4UIcmdWithADouble_H 1
#include "G4UIcommand.hh"
class G4UIcmdWithADouble : public G4UIcommand
{
public:
G4UIcmdWithADouble
(const char * theCommandPath,G4UImessenger * theMessenger);
G4double GetNewDoubleValue(G4String paramString);
G4String ConvertToString(G4double dblValue);
void SetParameterName(const char * theName,G4bool omittable,
G4bool currentAsDefault=false);
void SetDefaultValue(G4double defVal);
};
#endif
@@ -0,0 +1,36 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UIcmdWithADoubleAndUnit.hh,v 2.1 1998/07/12 02:59:30 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
#ifndef G4UIcmdWithADoubleAndUnit_H
#define G4UIcmdWithADoubleAndUnit_H 1
#include "G4UIcommand.hh"
class G4UIcmdWithADoubleAndUnit : public G4UIcommand
{
public:
G4UIcmdWithADoubleAndUnit
(const char * theCommandPath,G4UImessenger * theMessenger);
G4double GetNewDoubleValue(G4String paramString);
G4double GetNewDoubleRawValue(G4String paramString);
G4double GetNewUnitValue(G4String paramString);
G4String ConvertToString(G4double dblValue,const char * unitName);
void SetParameterName(const char * theName,G4bool omittable,
G4bool currentAsDefault=false);
void SetDefaultValue(G4double defVal);
void SetUnitCategory(const char * unitCategory);
void SetUnitCandidates(const char * candidateList);
void SetDefaultUnit(const char * defUnit);
};
#endif
@@ -0,0 +1,30 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UIcmdWithAString.hh,v 2.1 1998/07/12 02:59:31 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
#ifndef G4UIcmdWithAString_H
#define G4UIcmdWithAString_H 1
#include "G4UIcommand.hh"
class G4UIcmdWithAString : public G4UIcommand
{
public:
G4UIcmdWithAString
(const char * theCommandPath,G4UImessenger * theMessenger);
void SetParameterName(const char * theName,G4bool omittable,
G4bool currentAsDefault=false);
void SetCandidates(const char * candidateList);
void SetDefaultValue(const char * defVal);
};
#endif
@@ -0,0 +1,31 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UIcmdWithAnInteger.hh,v 2.1 1998/07/12 02:59:31 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
#ifndef G4UIcmdWithAnInteger_H
#define G4UIcmdWithAnInteger_H 1
#include "G4UIcommand.hh"
class G4UIcmdWithAnInteger : public G4UIcommand
{
public:
G4UIcmdWithAnInteger
(const char * theCommandPath,G4UImessenger * theMessenger);
G4int GetNewIntValue(G4String paramString);
G4String ConvertToString(G4int intValue);
void SetParameterName(const char * theName,G4bool omittable,
G4bool currentAsDefault=false);
void SetDefaultValue(G4int defVal);
};
#endif
@@ -0,0 +1,25 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UIcmdWithoutParameter.hh,v 2.0 1998/07/02 17:07:57 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
#ifndef G4UIcmdWithoutParameter_H
#define G4UIcmdWithoutParameter_H 1
#include "G4UIcommand.hh"
class G4UIcmdWithoutParameter : public G4UIcommand
{
public:
G4UIcmdWithoutParameter
(const char * theCommandPath,G4UImessenger * theMessenger);
};
#endif
+139
View File
@@ -0,0 +1,139 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UIcommand.hh,v 2.3 1998/10/20 03:41:30 asaim Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
#ifndef G4UIcommand_h
#define G4UIcommand_h 1
#include "G4UIparameter.hh"
class G4UImessenger;
#include "globals.hh"
#include "G4ApplicationState.hh"
#include <rw/tpordvec.h>
#include <rw/tvordvec.h>
#include "G4UItokenNum.hh"
class G4UIcommand
{
public:
G4UIcommand();
G4UIcommand(const char * theCommandPath, G4UImessenger * theMessenger);
virtual ~G4UIcommand();
int operator==(const G4UIcommand &right) const;
int operator!=(const G4UIcommand &right) const;
G4int DoIt(G4String parameterList);
G4String GetCurrentValue();
void AvailableForStates(G4ApplicationState s1);
void AvailableForStates(G4ApplicationState s1,G4ApplicationState s2);
void AvailableForStates(G4ApplicationState s1,G4ApplicationState s2,
G4ApplicationState s3);
void AvailableForStates(G4ApplicationState s1,G4ApplicationState s2,
G4ApplicationState s3,G4ApplicationState s4);
void AvailableForStates(G4ApplicationState s1,G4ApplicationState s2,
G4ApplicationState s3,G4ApplicationState s4,
G4ApplicationState s5);
G4bool IsAvailable();
virtual void List();
public:
static G4double ValueOf(G4String unitName);
static G4String CategoryOf(G4String unitName);
static G4String UnitsList(G4String unitCategory);
private:
void G4UIcommandCommonConstructorCode (const char * theCommandPath);
G4UImessenger *messenger;
G4String commandPath;
G4String commandName;
G4String rangeString;
RWTPtrOrderedVector<G4UIparameter> parameter;
RWTValOrderedVector<G4String> commandGuidance;
RWTValOrderedVector<G4ApplicationState> availabelStateList;
public:
inline void SetRange(const char* rs)
{ rangeString = rs; }
inline const G4String GetRange() const
{ return rangeString; };
inline G4int GetGuidanceEntries() const
{ return commandGuidance.entries(); }
inline const G4String GetGuidanceLine(int i) const
{ return commandGuidance[i]; }
inline const G4String GetCommandPath() const
{ return commandPath; }
inline const G4String GetCommandName() const
{ return commandName; }
inline G4int GetParameterEntries() const
{ return parameter.entries(); }
inline G4UIparameter * GetParameter(int i) const
{ return parameter[i]; }
inline void SetParameter(G4UIparameter *const newParameter)
{ parameter.insert( newParameter ); }
inline void SetGuidance(const char * aGuidance)
{
G4String * theGuidance = new G4String( aGuidance );
commandGuidance.insert( *theGuidance );
}
inline const G4String GetTitle() const
{
if(commandGuidance.entries() == 0)
{ return G4String("...Title not available..."); }
else
{ return commandGuidance(0); }
}
protected:
int CheckNewValue(G4String newValue);
// --- the following is used by CheckNewValue() --------
private:
int TypeCheck(G4String newValue);
int RangeCheck(G4String newValue);
int IsInt(const char* str, short maxLength);
int IsDouble(const char* str);
int ExpectExponent(const char* str);
// syntax nodes
yystype Expression( void );
yystype LogicalORExpression( void );
yystype LogicalANDExpression( void );
yystype EqualityExpression ( void );
yystype RelationalExpression( void );
yystype AdditiveExpression( void );
yystype MultiplicativeExpression( void );
yystype UnaryExpression( void );
yystype PrimaryExpression( void );
// semantics routines
int Eval2( yystype arg1, int op, yystype arg2 );
int CompareInt( int arg1, int op, int arg2);
int CompareDouble( double arg1, int op, double arg2);
// utility
tokenNum Yylex( void ); // returns next token
unsigned IndexOf( G4String ); // returns the index of the var name
unsigned IsParameter( G4String ); // returns 1 or 0
int G4UIpGetc( void ); // read one char from rangeBuf
int G4UIpUngetc( int c ); // put back
int Backslash( int c );
int Follow( int expect, int ifyes, int ifno );
G4String TokenToStr(int token);
void PrintToken(void); // for debug
// data
G4String rangeBuf;
int bp; // buffer pointer for rangeBuf
tokenNum token;
yystype yylval;
RWTValOrderedVector<yystype> newVal;
int paramERR;
};
#endif
@@ -0,0 +1,25 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UIcommandStatus.hh,v 2.0 1998/07/02 17:08:01 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4UIcommandStatus_h
#define G4UIcommandStatus_h 1
enum G4UIcommandStatus
{
fCommandSucceeded = 0,
fCommandNotFound = 100,
fIllegalApplicationState = 200,
fParameterOutOfRange = 300,
fParameterUnreadable = 400,
fParameterOutOfCandidates = 500
};
#endif
@@ -0,0 +1,77 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UIcommandTree.hh,v 2.1 1998/07/12 02:59:32 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4UIcommandTree_h
#define G4UIcommandTree_h 1
#include "G4UIcommand.hh"
#include "globals.hh"
#include <rw/tpordvec.h>
class G4UIcommandTree
{
public:
G4UIcommandTree();
G4UIcommandTree(G4String thePathName);
G4UIcommandTree(char * thePathName);
~G4UIcommandTree();
int operator==(const G4UIcommandTree &right) const;
int operator!=(const G4UIcommandTree &right) const;
public:
void AddNewCommand(G4UIcommand * newCommand);
void RemoveCommand(G4UIcommand * aCommand);
G4UIcommand * FindPath(G4String commandPath);
void List();
void ListCurrent();
void ListCurrentWithNum();
private:
RWTPtrOrderedVector<G4UIcommand> command;
RWTPtrOrderedVector<G4UIcommandTree> tree;
G4UIcommand *guidance;
G4String pathName;
public:
inline const G4UIcommand * GetGuidance() const
{ return guidance; };
inline const G4String GetPathName() const
{ return pathName; };
inline G4int GetTreeEntry() const
{ return tree.entries(); };
inline G4int GetCommandEntry() const
{ return command.entries(); };
inline G4UIcommandTree * GetTree(int i)
{ return tree[i-1]; };
inline G4UIcommandTree * GetTree(G4String comName)
{
for( int i=0; i < tree.entries(); i++)
{
if( comName == tree[i]->GetPathName() )
{ return tree[i]; }
}
return NULL;
};
inline G4UIcommand * GetCommand(int i)
{ return command[i-1]; };
inline const G4String GetTitle() const
{
if(guidance==NULL)
{ return G4String("...Title not available..."); }
else
{ return guidance->GetTitle(); }
};
};
#endif
@@ -0,0 +1,40 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UIcontrolMessenger.hh,v 2.3 1998/10/01 15:49:53 asaim Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4UIcontrolMessenger_h
#define G4UIcontrolMessenger_h 1
#include "G4UImessenger.hh"
class G4UIdirectory;
class G4UIcmdWithAString;
class G4UIcmdWithAnInteger;
class G4UIcmdWithoutParameter;
class G4UIcontrolMessenger : public G4UImessenger
{
public:
G4UIcontrolMessenger();
~G4UIcontrolMessenger();
void SetNewValue(G4UIcommand * command,G4String newValue);
G4String GetCurrentValue(G4UIcommand * command);
private:
G4UIdirectory * controlDirectory;
G4UIcmdWithAString * ExecuteCommand;
G4UIcmdWithAnInteger * verboseCommand;
G4UIcmdWithAString * historyCommand;
G4UIcmdWithoutParameter * stopStoreHistoryCommand;
G4UIcmdWithAString * ManualCommand;
};
#endif
+25
View File
@@ -0,0 +1,25 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UIdirectory.hh,v 2.0 1998/07/02 17:08:07 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
#ifndef G4UIdirectory_H
#define G4UIdirectory_H 1
#include "G4UIcommand.hh"
class G4UIdirectory : public G4UIcommand
{
public:
G4UIdirectory(char * theCommandPath);
G4UIdirectory(const char * theCommandPath);
};
#endif
+127
View File
@@ -0,0 +1,127 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UImanager.hh,v 2.5 1998/12/02 09:57:48 asaim Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4UImanager_h
#define G4UImanager_h 1
#include "globals.hh"
#include <rw/ctoken.h>
#include <rw/tvordvec.h>
#include <fstream.h>
class G4UIcommandTree;
class G4UIcommand;
class G4UIsession;
class G4UIcontrolMessenger;
class G4UnitsMessenger;
class G4UImanager
{
public:
static G4UImanager * GetUIpointer();
protected:
G4UImanager();
public:
~G4UImanager();
private:
G4UImanager(const G4UImanager &right);
const G4UImanager & operator=(const G4UImanager &right);
int operator==(const G4UImanager &right) const;
int operator!=(const G4UImanager &right) const;
public:
G4String GetCurrentValues(const char * aCommand);
void AddNewCommand(G4UIcommand * newCommand);
void RemoveCommand(G4UIcommand * aCommand);
void ExecuteMacroFile(G4String fileName);
G4int ApplyCommand(char * aCommand);
G4int ApplyCommand(G4String aCommand);
void StoreHistory(G4String fileName="G4history.macro");
void StoreHistory(G4bool historySwitch,
G4String fileName="G4history.macro");
void PauseSession(G4String msg);
void ListCommands(G4String direc);
private:
void CreateMessenger();
G4UIcommandTree* FindDirectory(const char* dirName);
public:
// following three methods will be removed quite soon.
void Interact();
void Interact(char * promptCharacters);
void Interact(G4String promptCharacters);
private:
static G4UImanager * fUImanager;
static G4bool fUImanagerHasBeenKilled;
G4UIcommandTree * treeTop;
G4UIsession * session;
G4UIcontrolMessenger * UImessenger;
G4UnitsMessenger * UnitsMessenger;
G4String savedParameters;
G4UIcommand * savedCommand;
G4int verboseLevel;
ofstream historyFile;
G4bool saveHistory;
RWTValOrderedVector<G4String> histVec;
public:
G4String GetCurrentStringValue(const char * aCommand,
int parameterNumber=1, G4bool reGet=true);
G4int GetCurrentIntValue(const char * aCommand,
int parameterNumber=1, G4bool reGet=true);
G4double GetCurrentDoubleValue(const char * aCommand,
int parameterNumber=1, G4bool reGet=true);
G4String GetCurrentStringValue(const char * aCommand,
const char * aParameterName, G4bool reGet=true);
G4int GetCurrentIntValue(const char * aCommand,
const char * aParameterName, G4bool reGet=true);
G4double GetCurrentDoubleValue(const char * aCommand,
const char * aParameterName, G4bool reGet=true);
public:
inline G4UIcommandTree * GetTree() const
{ return treeTop; };
inline G4UIsession * GetSession() const
{ return session; };
inline void SetSession(G4UIsession *const value)
{ session = value; };
inline void SetVerboseLevel(G4int val)
{ verboseLevel = val; };
inline G4int GetVerboseLevel() const
{ return verboseLevel; };
inline G4int GetNumberOfHistory() const
{ return histVec.entries(); };
inline G4String GetPreviousCommand(G4int i) const
{
G4String st;
if(i>=0 && i<histVec.entries())
{ st = histVec[i]; }
return st;
}
public:
void SetCoutDestination(G4UIsession *const value);
// Old methods kept for backward compatibility
// inline G4UIcommandTree * GetTree() const
// { return treeTop; };
// inline G4UIsession * GetSession() const
// { return session; };
// inline void SetSession(G4UIsession *const value)
// { session = value; };
};
#endif
+44
View File
@@ -0,0 +1,44 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UImessenger.hh,v 2.2 1998/07/13 17:12:50 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
#ifndef G4UImessenger_h
#define G4UImessenger_h 1
#include "globals.hh"
#include "G4ios.hh"
class G4UIcommand;
class G4UImessenger
{
public:
G4UImessenger();
virtual ~G4UImessenger();
virtual G4String GetCurrentValue(G4UIcommand * command);
virtual void SetNewValue(G4UIcommand * command,G4String newValue);
// For RWTPtrOrderedVector...
G4bool operator == (const G4UImessenger& messenger) const;
protected:
G4String ItoS(G4int i);
G4String DtoS(G4double a);
G4String BtoS(G4bool b);
G4int StoI(G4String s);
G4double StoD(G4String s);
G4bool StoB(G4String s);
protected:
void AddUIcommand(G4UIcommand * newCommand);
};
#endif
+144
View File
@@ -0,0 +1,144 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UIparameter.hh,v 2.1 1998/07/12 02:59:36 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ---------------------------------------------------------------------
#ifndef G4UIparameter_h
#define G4UIparameter_h 1
#include "globals.hh"
#ifdef WIN32
# include <Strstrea.h>
#else
# include <strstream.h>
#endif
#include "G4UItokenNum.hh"
class G4UIparameter
{
public:
G4UIparameter();
G4UIparameter(char theType);
G4UIparameter(const char * theName, char theType, G4bool theOmittable);
~G4UIparameter();
int operator==(const G4UIparameter &right) const;
int operator!=(const G4UIparameter &right) const;
G4int CheckNewValue(G4String newValue);
void List();
private:
G4String parameterName;
G4String parameterGuidance;
G4String defaultValue;
G4String parameterRange;
G4String parameterCandidate;
char parameterType;
G4bool omittable;
G4bool currentAsDefaultFlag;
G4int widget;
public:
// defaultValue
inline void SetDefaultValue(const char * theDefaultValue)
{ defaultValue = theDefaultValue; }
void SetDefaultValue(G4int theDefaultValue);
void SetDefaultValue(G4double theDefaultValue);
inline G4String GetDefaultValue() const
{ return defaultValue; }
// parameterType
inline char GetParameterType() const
{ return parameterType; }
// parameterRange
inline void SetParameterRange(const char * theRange)
{ parameterRange = theRange; }
inline G4String GetParameterRange() const
{ return parameterRange; }
// parameterName
inline void SetParameterName(const char * theName)
{ parameterName = theName; }
inline G4String GetParameterName() const
{ return parameterName; }
// parameterCandidates
inline void SetParameterCandidates(const char * theString)
{ parameterCandidate = theString; }
inline G4String GetParameterCandidates() const
{ return parameterCandidate; }
// omittable
inline void SetOmittable(G4bool om)
{ omittable = om; }
inline G4bool IsOmittable() const
{ return omittable; }
// currentAsDefaultFlag
inline void SetCurrentAsDefault(G4bool val)
{ currentAsDefaultFlag = val; }
inline G4bool GetCurrentAsDefault() const
{ return currentAsDefaultFlag; }
// out of date methods
inline void SetWidget(G4int theWidget)
{ widget = theWidget; }
inline const G4String GetParameterGuidance() const
{ return parameterGuidance; }
inline void SetGuidance(const char * theGuidance)
{ parameterGuidance = theGuidance; }
private:
// --- the following is used by CheckNewValue() -------
int TypeCheck(G4String newValue );
int RangeCheck(G4String newValue );
int CandidateCheck(G4String newValue );
int IsInt(const char* str, short maxDigit);
int IsDouble(const char* str);
int ExpectExponent(const char* str);
// syntax nodes
yystype Expression( void );
yystype LogicalORExpression( void );
yystype LogicalANDExpression( void );
yystype EqualityExpression ( void );
yystype RelationalExpression( void );
yystype AdditiveExpression( void );
yystype MultiplicativeExpression( void );
yystype UnaryExpression( void );
yystype PrimaryExpression( void );
// semantics routines
int Eval2( yystype arg1, int op, yystype arg2 );
int CompareInt( int arg1, int op, int arg2);
int CompareDouble( double arg1, int op, double arg2);
// utility
tokenNum Yylex( void ); // returns next token
int G4UIpGetc( void ); // read one char from rangeBuf
int G4UIpUngetc( int c ); // put back
int Backslash( int c );
int Follow( int expect, int ifyes, int ifno );
G4String TokenToStr(int token);
//void PrintToken(void); // debug
// data
G4String rangeBuf;
int bp; // buffer pointer for rangeBuf
tokenNum token;
yystype yylval;
yystype newVal;
int paramERR;
//------------ end of CheckNewValue() related member --------------
};
#endif
+44
View File
@@ -0,0 +1,44 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UIsession.hh,v 2.2 1998/11/04 11:53:31 yhajime Exp $
// GEANT4 tag $Name: geant4-00 $
//
// $id$
#ifndef G4UIsession_h
#define G4UIsession_h 1
#include "G4coutDestination.hh"
#include "globals.hh"
class G4UIsession : public G4coutDestination
{
// Base class of UI/GUI session
public:
G4UIsession();
virtual ~G4UIsession();
virtual G4UIsession * SessionStart();
// This method will be invoked by main().
// Optionally, it can be invoked by another session.
virtual void PauseSessionStart(G4String Prompt);
// This method will be invoked by G4UImanager
// when G4kernel becomes to Pause state.
virtual G4int ReceiveG4cout(G4String coutString);
virtual G4int ReceiveG4cerr(G4String cerrString);
// These two methods will be invoked by G4strstreambuf.
};
#endif
+46
View File
@@ -0,0 +1,46 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UItokenNum.hh,v 2.0 1998/07/02 17:08:13 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
//
// G4UItokenNum.hh
#ifndef G4UItokenNum_hh
#define G4UItokenNum_hh 1
#include "globals.hh"
enum tokenNum {
IDENTIFIER = 257,
CONSTINT = 258,
CONSTDOUBLE= 259,
CONSTCHAR = 260,
CONSTSTRING= 261,
GT = 262,
GE = 263,
LT = 264,
LE = 265,
EQ = 266,
NE = 267,
//LOGICALNOT = 268,
LOGICALOR = 269,
LOGICALAND = 270
};
typedef struct yystype {
tokenNum type;
double D;
int I;
char C;
G4String S;
int operator==(const yystype &right) const
{ return (this == &right); }
} yystype;
#endif
@@ -0,0 +1,41 @@
// This code implementation is the intellectual property of
// the RD44 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: G4UnitsMessenger.hh,v 2.1 1998/11/27 06:12:47 asaim Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifndef G4UnitsMessenger_h
#define G4UnitsMessenger_h 1
#include "globals.hh"
#include "G4UImessenger.hh"
class G4UIdirectory;
class G4UIcmdWithoutParameter;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
class G4UnitsMessenger: public G4UImessenger
{
public:
G4UnitsMessenger();
~G4UnitsMessenger();
void SetNewValue(G4UIcommand*, G4String);
private:
G4UIdirectory* UnitsTableDir;
G4UIcmdWithoutParameter* ListCmd;
};
#endif
@@ -0,0 +1,44 @@
// This code implementation is the intellectual property of
// the RD44 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: G4VStateDependent.hh,v 2.1 1998/07/12 02:59:38 urbi Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// For information related to this code contact:
// CERN, CN Division, ASD group
// ---------------- G4VStateDependent ----------------
// by Gabriele Cosmo, November 1996
// Abstract class responsible to Notify the change of state
// ------------------------------------------------------------
#ifndef G4VStateDependent_h
#define G4VStateDependent_h 1
#include "globals.hh"
#include "G4ApplicationState.hh"
class G4VStateDependent {
public:
G4VStateDependent();
virtual ~G4VStateDependent();
G4int operator==(const G4VStateDependent &right) const;
G4int operator!=(const G4VStateDependent &right) const;
virtual G4bool Notify(G4ApplicationState requestedState) = 0;
private:
G4VStateDependent(const G4VStateDependent &right);
G4VStateDependent& operator=(const G4VStateDependent &right);
};
#endif