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

Private Attributes

B2aDetectorConstructionfDetectorConstruction
 
G4UIdirectoryfB2Directory
 
G4UIdirectoryfDetDirectory
 
G4UIcmdWithAStringfTargMatCmd
 
G4UIcmdWithAStringfChamMatCmd
 
G4UIcmdWithADoubleAndUnitfStepMaxCmd
 

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::B2aDetectorMessenger ( B2aDetectorConstruction Det)

Definition at line 40 of file B2aDetectorMessenger.cc.

41  : G4UImessenger(),
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");
65 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithAString * fChamMatCmd
G4UIcmdWithAString * fTargMatCmd
void SetUnitCategory(const char *unitCategory)
G4UIdirectory * fDetDirectory
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
B2aDetectorConstruction * fDetectorConstruction
G4UIcmdWithADoubleAndUnit * fStepMaxCmd
G4UIdirectory * fB2Directory
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
Here is the call graph for this function:

◆ ~B2aDetectorMessenger()

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 }
G4UIcmdWithAString * fChamMatCmd
G4UIcmdWithAString * fTargMatCmd
G4UIdirectory * fDetDirectory
G4UIcmdWithADoubleAndUnit * fStepMaxCmd
G4UIdirectory * fB2Directory

Member Function Documentation

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 80 of file B2aDetectorMessenger.cc.

81 {
82  if( command == fTargMatCmd )
84 
85  if( command == fChamMatCmd )
87 
88  if( command == fStepMaxCmd ) {
91  }
92 }
G4UIcmdWithAString * fChamMatCmd
G4UIcmdWithAString * fTargMatCmd
static G4double GetNewDoubleValue(const char *paramString)
B2aDetectorConstruction * fDetectorConstruction
G4UIcmdWithADoubleAndUnit * fStepMaxCmd
Here is the call graph for this function:

Member Data Documentation

◆ fB2Directory

G4UIdirectory* B2aDetectorMessenger::fB2Directory
private

Definition at line 62 of file B2aDetectorMessenger.hh.

◆ fChamMatCmd

G4UIcmdWithAString* B2aDetectorMessenger::fChamMatCmd
private

Definition at line 66 of file B2aDetectorMessenger.hh.

◆ fDetDirectory

G4UIdirectory* B2aDetectorMessenger::fDetDirectory
private

Definition at line 63 of file B2aDetectorMessenger.hh.

◆ fDetectorConstruction

B2aDetectorConstruction* B2aDetectorMessenger::fDetectorConstruction
private

Definition at line 60 of file B2aDetectorMessenger.hh.

◆ fStepMaxCmd

G4UIcmdWithADoubleAndUnit* B2aDetectorMessenger::fStepMaxCmd
private

Definition at line 68 of file B2aDetectorMessenger.hh.

◆ fTargMatCmd

G4UIcmdWithAString* B2aDetectorMessenger::fTargMatCmd
private

Definition at line 65 of file B2aDetectorMessenger.hh.


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