Belle II Software development
ExtMessenger Class Reference

Define the mechanism by which the user can communicate with the geant4e extrapolator using geant4 UI commands. More...

#include <ExtMessenger.h>

Inheritance diagram for ExtMessenger:

Public Member Functions

 ExtMessenger (ExtStepLengthLimitProcess *, ExtMagFieldLimitProcess *, ExtEnergyLoss *)
 constructor
 
 ~ExtMessenger ()
 destructor
 
void SetNewValue (G4UIcommand *, G4String)
 Process a geant4 UI command.
 

Private Attributes

ExtStepLengthLimitProcessm_stepLengthAction
 Process that limits the geant4e step length.
 
ExtMagFieldLimitProcessm_magFieldAction
 Process that limits the geant4e step length in magnetic field.
 
ExtEnergyLossm_energyLossAction
 Process that limits the geant4e step length due to energy loss.
 
G4UIdirectory * m_dir
 Defines UI directory for "/geant4e/" commands.
 
G4UIdirectory * m_dirLimits
 Defines UI directory for "/geant4e/limits/" commands.
 
G4UIcmdWithADoubleAndUnit * m_stepLengthLimitCmd
 Defines UI command "/geant4e/limits/stepLength" to limit step length.
 
G4UIcmdWithADouble * m_magFieldLimitCmd
 Defines UI command "/geant4e/limits/magField" to limit step length.
 
G4UIcmdWithADouble * m_energyLossCmd
 defines UI command "/geant4e/limits/energyLoss" to limit step length
 

Detailed Description

Define the mechanism by which the user can communicate with the geant4e extrapolator using geant4 UI commands.

Definition at line 36 of file ExtMessenger.h.

Constructor & Destructor Documentation

◆ ExtMessenger()

constructor

Definition at line 24 of file ExtMessenger.cc.

24 :
26 m_magFieldAction(mAct),
28{
29
30 m_dir = new G4UIdirectory("/geant4e/");
31 m_dir->SetGuidance("GEANT4e control commands");
32 m_dirLimits = new G4UIdirectory("/geant4e/limits/");
33 m_dirLimits->SetGuidance("GEANT4e commands to limit the step");
34
35 m_stepLengthLimitCmd = new G4UIcmdWithADoubleAndUnit("/geant4e/limits/stepLength", this);
36 m_stepLengthLimitCmd->SetGuidance("Limit the length of a step (distance)");
37 m_stepLengthLimitCmd->SetDefaultUnit("mm");
38 m_stepLengthLimitCmd->AvailableForStates(G4State_PreInit, G4State_Idle, G4State_GeomClosed, G4State_EventProc);
39
40 m_magFieldLimitCmd = new G4UIcmdWithADouble("/geant4e/limits/magField", this);
41 m_magFieldLimitCmd->SetGuidance("Limit the length of a step (field/momentum)");
42 m_magFieldLimitCmd->AvailableForStates(G4State_PreInit, G4State_Idle, G4State_GeomClosed, G4State_EventProc);
43
44 m_energyLossCmd = new G4UIcmdWithADouble("/geant4e/limits/energyLoss", this);
45 m_energyLossCmd->SetGuidance("Limit the length of a step (fractional KE loss)");
46 m_energyLossCmd->AvailableForStates(G4State_PreInit, G4State_Idle, G4State_GeomClosed, G4State_EventProc);
47
48 if (false) {
49 G4UIcommand* command = nullptr;
50 SetNewValue(command, G4String(""));
51 }
52
53}
G4UIcmdWithADouble * m_magFieldLimitCmd
Defines UI command "/geant4e/limits/magField" to limit step length.
Definition: ExtMessenger.h:72
G4UIdirectory * m_dir
Defines UI directory for "/geant4e/" commands.
Definition: ExtMessenger.h:63
G4UIcmdWithADoubleAndUnit * m_stepLengthLimitCmd
Defines UI command "/geant4e/limits/stepLength" to limit step length.
Definition: ExtMessenger.h:69
void SetNewValue(G4UIcommand *, G4String)
Process a geant4 UI command.
Definition: ExtMessenger.cc:64
ExtEnergyLoss * m_energyLossAction
Process that limits the geant4e step length due to energy loss.
Definition: ExtMessenger.h:60
ExtStepLengthLimitProcess * m_stepLengthAction
Process that limits the geant4e step length.
Definition: ExtMessenger.h:54
G4UIcmdWithADouble * m_energyLossCmd
defines UI command "/geant4e/limits/energyLoss" to limit step length
Definition: ExtMessenger.h:75
ExtMagFieldLimitProcess * m_magFieldAction
Process that limits the geant4e step length in magnetic field.
Definition: ExtMessenger.h:57
G4UIdirectory * m_dirLimits
Defines UI directory for "/geant4e/limits/" commands.
Definition: ExtMessenger.h:66

◆ ~ExtMessenger()

destructor

Definition at line 55 of file ExtMessenger.cc.

56{
58 delete m_magFieldLimitCmd;
59 delete m_energyLossCmd;
60 delete m_dir;
61 delete m_dirLimits;
62}

Member Function Documentation

◆ SetNewValue()

void SetNewValue ( G4UIcommand *  command,
G4String  newValue 
)

Process a geant4 UI command.

Definition at line 64 of file ExtMessenger.cc.

65{
66 if (command == m_stepLengthLimitCmd) {
67 B2DEBUG(200, "ExtMessenger::SetNewValue() StepLengthAction SetStepLimit "
68 << m_stepLengthLimitCmd->GetNewDoubleValue(newValue));
69 m_stepLengthAction->SetStepLimit(m_stepLengthLimitCmd->GetNewDoubleValue(newValue));
70 } else if (command == m_magFieldLimitCmd) {
71 B2DEBUG(200, "ExtMessenger::SetNewValue() MagFieldAction SetStepLimit "
72 << m_magFieldLimitCmd->GetNewDoubleValue(newValue));
73 m_magFieldAction->SetStepLimit(m_magFieldLimitCmd->GetNewDoubleValue(newValue));
74 } else if (command == m_energyLossCmd) {
75 B2DEBUG(200, "ExtMessenger::SetNewValue() EnergyLossAction SetStepLimit "
76 << m_energyLossCmd->GetNewDoubleValue(newValue));
77 m_energyLossAction->SetStepLimit(m_energyLossCmd->GetNewDoubleValue(newValue));
78 }
79}
void SetStepLimit(G4double)
Sets the step limit for this process.
Definition: ExtEnergyLoss.h:79
void SetStepLimit(G4double val)
Sets the step limit.
void SetStepLimit(G4double val)
Sets the step limit.

Member Data Documentation

◆ m_dir

G4UIdirectory* m_dir
private

Defines UI directory for "/geant4e/" commands.

Definition at line 63 of file ExtMessenger.h.

◆ m_dirLimits

G4UIdirectory* m_dirLimits
private

Defines UI directory for "/geant4e/limits/" commands.

Definition at line 66 of file ExtMessenger.h.

◆ m_energyLossAction

ExtEnergyLoss* m_energyLossAction
private

Process that limits the geant4e step length due to energy loss.

Definition at line 60 of file ExtMessenger.h.

◆ m_energyLossCmd

G4UIcmdWithADouble* m_energyLossCmd
private

defines UI command "/geant4e/limits/energyLoss" to limit step length

Definition at line 75 of file ExtMessenger.h.

◆ m_magFieldAction

ExtMagFieldLimitProcess* m_magFieldAction
private

Process that limits the geant4e step length in magnetic field.

Definition at line 57 of file ExtMessenger.h.

◆ m_magFieldLimitCmd

G4UIcmdWithADouble* m_magFieldLimitCmd
private

Defines UI command "/geant4e/limits/magField" to limit step length.

Definition at line 72 of file ExtMessenger.h.

◆ m_stepLengthAction

ExtStepLengthLimitProcess* m_stepLengthAction
private

Process that limits the geant4e step length.

Definition at line 54 of file ExtMessenger.h.

◆ m_stepLengthLimitCmd

G4UIcmdWithADoubleAndUnit* m_stepLengthLimitCmd
private

Defines UI command "/geant4e/limits/stepLength" to limit step length.

Definition at line 69 of file ExtMessenger.h.


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