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

#include <B2aDetectorMessenger.hh>

Inheritance diagram for B2aDetectorMessenger:
Collaboration diagram for B2aDetectorMessenger:

Public Member Functions

 B2aDetectorMessenger (B2aDetectorConstruction *)
 
virtual ~B2aDetectorMessenger ()
 
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

Messenger class that defines commands for B2aDetectorConstruction.

It implements commands:

  • /B2/det/setTargetMaterial name
  • /B2/det/setChamberMaterial name
  • /B2/det/stepMax value unit

Definition at line 51 of file B2aDetectorMessenger.hh.

Constructor & Destructor Documentation

B2aDetectorMessenger::B2aDetectorMessenger ( B2aDetectorConstruction Det)

Definition at line 40 of file B2aDetectorMessenger.cc.

41  : G4UImessenger(),
42  fDetectorConstruction(Det)
43 {
44  fB2Directory = new G4UIdirectory("/B2/");
45  fB2Directory->SetGuidance("UI commands specific to this example.");
46 
47  fDetDirectory = new G4UIdirectory("/B2/det/");
48  fDetDirectory->SetGuidance("Detector construction control");
49 
50  fTargMatCmd = new G4UIcmdWithAString("/B2/det/setTargetMaterial",this);
51  fTargMatCmd->SetGuidance("Select Material of the Target.");
52  fTargMatCmd->SetParameterName("choice",false);
54 
55  fChamMatCmd = new G4UIcmdWithAString("/B2/det/setChamberMaterial",this);
56  fChamMatCmd->SetGuidance("Select Material of the Chamber.");
57  fChamMatCmd->SetParameterName("choice",false);
59 
60  fStepMaxCmd = new G4UIcmdWithADoubleAndUnit("/B2/det/stepMax",this);
61  fStepMaxCmd->SetGuidance("Define a step max");
62  fStepMaxCmd->SetParameterName("stepMax",false);
63  fStepMaxCmd->SetUnitCategory("Length");
64  fStepMaxCmd->AvailableForStates(G4State_Idle);
65 }
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:

B2aDetectorMessenger::~B2aDetectorMessenger ( )
virtual

Definition at line 69 of file B2aDetectorMessenger.cc.

70 {
71  delete fTargMatCmd;
72  delete fChamMatCmd;
73  delete fStepMaxCmd;
74  delete fB2Directory;
75  delete fDetDirectory;
76 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 80 of file B2aDetectorMessenger.cc.

81 {
82  if( command == fTargMatCmd )
83  { fDetectorConstruction->SetTargetMaterial(newValue);}
84 
85  if( command == fChamMatCmd )
86  { fDetectorConstruction->SetChamberMaterial(newValue);}
87 
88  if( command == fStepMaxCmd ) {
89  fDetectorConstruction
90  ->SetMaxStep(fStepMaxCmd->GetNewDoubleValue(newValue));
91  }
92 }
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: