Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExP01DetectorMessenger Class Reference

Detector messenger for the persistency example. More...

#include <ExP01DetectorMessenger.hh>

Inheritance diagram for ExP01DetectorMessenger:
Collaboration diagram for ExP01DetectorMessenger:

Public Member Functions

 ExP01DetectorMessenger (ExP01DetectorConstruction *)
 
 ~ExP01DetectorMessenger ()
 
virtual void SetNewValue (G4UIcommand *, G4String)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Detector messenger for the persistency example.

Definition at line 50 of file ExP01DetectorMessenger.hh.

Constructor & Destructor Documentation

ExP01DetectorMessenger::ExP01DetectorMessenger ( ExP01DetectorConstruction myDet)

Definition at line 45 of file ExP01DetectorMessenger.cc.

46 : G4UImessenger(),
47  fDetector(myDet),
48  fN02Dir(0),
49  fDetDir(0),
50  fTargMatCmd(0),
51  fChamMatCmd(0),
52  fFieldCmd(0)
53 {
54  fN02Dir = new G4UIdirectory("/P01/");
55  fN02Dir->SetGuidance("UI commands specific to this example.");
56 
57  fDetDir = new G4UIdirectory("/P01/det/");
58  fDetDir->SetGuidance("detector control.");
59 
60  fTargMatCmd = new G4UIcmdWithAString("/P01/det/setTargetMate",this);
61  fTargMatCmd->SetGuidance("Select Material of the Target.");
62  fTargMatCmd->SetParameterName("choice",false);
64 
65  fChamMatCmd = new G4UIcmdWithAString("/P01/det/setChamberMate",this);
66  fChamMatCmd->SetGuidance("Select Material of the Target.");
67  fChamMatCmd->SetParameterName("choice",false);
69 
70  fFieldCmd = new G4UIcmdWithADoubleAndUnit("/P01/det/setField",this);
71  fFieldCmd->SetGuidance("Define magnetic field.");
72  fFieldCmd->SetGuidance("Magnetic field will be in X direction.");
73  fFieldCmd->SetParameterName("Bx",false);
74  fFieldCmd->SetUnitCategory("Magnetic flux density");
76 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetUnitCategory(const char *unitCategory)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:240
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)

Here is the call graph for this function:

ExP01DetectorMessenger::~ExP01DetectorMessenger ( )

Definition at line 80 of file ExP01DetectorMessenger.cc.

81 {
82  delete fTargMatCmd;
83  delete fChamMatCmd;
84  delete fFieldCmd;
85  delete fDetDir;
86  delete fN02Dir;
87 }

Member Function Documentation

void ExP01DetectorMessenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 91 of file ExP01DetectorMessenger.cc.

92 {
93  if( command == fTargMatCmd )
94  { fDetector->SetTargetMaterial(newValue);}
95 
96  if( command == fChamMatCmd )
97  { fDetector->SetChamberMaterial(newValue);}
98 
99  if( command == fFieldCmd )
100  { fDetector->SetMagField(fFieldCmd->GetNewDoubleValue(newValue));}
101 }
static G4double GetNewDoubleValue(const char *paramString)

Here is the call graph for this function:


The documentation for this class was generated from the following files: