Geant4  10.02.p03
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
 

Private Attributes

ExP01DetectorConstructionfDetector
 
G4UIdirectoryfN02Dir
 
G4UIdirectoryfDetDir
 
G4UIcmdWithAStringfTargMatCmd
 
G4UIcmdWithAStringfChamMatCmd
 
G4UIcmdWithADoubleAndUnitfFieldCmd
 

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::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)
G4UIcmdWithADoubleAndUnit * fFieldCmd
G4UIcmdWithAString * fTargMatCmd
G4UIcmdWithAString * fChamMatCmd
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
ExP01DetectorConstruction * fDetector
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
Here is the call graph for this function:

◆ ~ExP01DetectorMessenger()

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 }
G4UIcmdWithADoubleAndUnit * fFieldCmd
G4UIcmdWithAString * fTargMatCmd
G4UIcmdWithAString * fChamMatCmd

Member Function Documentation

◆ SetNewValue()

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 )
101 }
static G4double GetNewDoubleValue(const char *paramString)
G4UIcmdWithADoubleAndUnit * fFieldCmd
G4UIcmdWithAString * fTargMatCmd
G4UIcmdWithAString * fChamMatCmd
ExP01DetectorConstruction * fDetector
Here is the call graph for this function:

Member Data Documentation

◆ fChamMatCmd

G4UIcmdWithAString* ExP01DetectorMessenger::fChamMatCmd
private

Definition at line 64 of file ExP01DetectorMessenger.hh.

◆ fDetDir

G4UIdirectory* ExP01DetectorMessenger::fDetDir
private

Definition at line 62 of file ExP01DetectorMessenger.hh.

◆ fDetector

ExP01DetectorConstruction* ExP01DetectorMessenger::fDetector
private

Definition at line 59 of file ExP01DetectorMessenger.hh.

◆ fFieldCmd

G4UIcmdWithADoubleAndUnit* ExP01DetectorMessenger::fFieldCmd
private

Definition at line 65 of file ExP01DetectorMessenger.hh.

◆ fN02Dir

G4UIdirectory* ExP01DetectorMessenger::fN02Dir
private

Definition at line 61 of file ExP01DetectorMessenger.hh.

◆ fTargMatCmd

G4UIcmdWithAString* ExP01DetectorMessenger::fTargMatCmd
private

Definition at line 63 of file ExP01DetectorMessenger.hh.


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