Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
B2bDetectorMessenger Class Reference

#include <B2bDetectorMessenger.hh>

Inheritance diagram for B2bDetectorMessenger:
G4UImessenger G4UImessenger

Public Member Functions

 B2bDetectorMessenger (B2bDetectorConstruction *)
 
virtual ~B2bDetectorMessenger ()
 
virtual void SetNewValue (G4UIcommand *, G4String)
 
 B2bDetectorMessenger (B2bDetectorConstruction *)
 
virtual ~B2bDetectorMessenger ()
 
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
 

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
 

Detailed Description

Messenger class that defines commands for B2bDetectorConstruction.

It implements commands:

Definition at line 51 of file basic/B2/B2b/include/B2bDetectorMessenger.hh.

Constructor & Destructor Documentation

B2bDetectorMessenger::B2bDetectorMessenger ( B2bDetectorConstruction Det)

Definition at line 40 of file basic/B2/B2b/src/B2bDetectorMessenger.cc.

References G4UIcommand::AvailableForStates(), G4State_Idle, G4State_PreInit, G4UIcommand::SetGuidance(), G4UIcmdWithAString::SetParameterName(), G4UIcmdWithADoubleAndUnit::SetParameterName(), and G4UIcmdWithADoubleAndUnit::SetUnitCategory().

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:225
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
B2bDetectorMessenger::~B2bDetectorMessenger ( )
virtual

Definition at line 69 of file basic/B2/B2b/src/B2bDetectorMessenger.cc.

70 {
71  delete fTargMatCmd;
72  delete fChamMatCmd;
73  delete fStepMaxCmd;
74  delete fB2Directory;
75  delete fDetDirectory;
76 }
B2bDetectorMessenger::B2bDetectorMessenger ( B2bDetectorConstruction )
virtual B2bDetectorMessenger::~B2bDetectorMessenger ( )
virtual

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 80 of file basic/B2/B2b/src/B2bDetectorMessenger.cc.

References G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(), B2bDetectorConstruction::SetChamberMaterial(), B2bDetectorConstruction::SetMaxStep(), and B2bDetectorConstruction::SetTargetMaterial().

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)
virtual void B2bDetectorMessenger::SetNewValue ( G4UIcommand ,
G4String   
)
virtual

Reimplemented from G4UImessenger.


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