Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ErrorMessenger Class Reference

#include <G4ErrorMessenger.hh>

Inheritance diagram for G4ErrorMessenger:

Public Member Functions

 G4ErrorMessenger (G4ErrorStepLengthLimitProcess *lengthAct, G4ErrorMagFieldLimitProcess *magAct, G4ErrorEnergyLoss *elossAct)
 ~G4ErrorMessenger ()
void SetNewValue (G4UIcommand *, G4String)
Public Member Functions inherited from G4UImessenger
 G4UImessenger ()=default
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
virtual ~G4UImessenger ()
virtual G4String GetCurrentValue (G4UIcommand *command)
G4bool CommandsShouldBeInMaster () const

Additional Inherited Members

Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
G4String LtoS (G4long l)
G4String DtoS (G4double a)
G4String BtoS (G4bool b)
G4int StoI (const G4String &s)
G4long StoL (const G4String &s)
G4double StoD (const G4String &s)
G4bool StoB (const 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 = nullptr
G4String baseDirName = ""
G4bool commandsShouldBeInMaster = false

Detailed Description

Definition at line 52 of file G4ErrorMessenger.hh.

Constructor & Destructor Documentation

◆ G4ErrorMessenger()

G4ErrorMessenger::G4ErrorMessenger ( G4ErrorStepLengthLimitProcess * lengthAct,
G4ErrorMagFieldLimitProcess * magAct,
G4ErrorEnergyLoss * elossAct )

Definition at line 47 of file G4ErrorMessenger.cc.

50 : StepLengthAction(lengthAct)
51 , MagFieldAction(magAct)
52 , EnergyLossAction(elossAct)
53{
54 myDir = new G4UIdirectory("/geant4e/");
55 myDir->SetGuidance("GEANT4e control commands");
56
57 myDirLimits = new G4UIdirectory("/geant4e/limits/");
58 myDirLimits->SetGuidance("GEANT4e commands to limit the step");
59
60 StepLengthLimitCmd =
61 new G4UIcmdWithADoubleAndUnit("/geant4e/limits/stepLength", this);
62 StepLengthLimitCmd->SetGuidance("Limit the length of an step");
63 StepLengthLimitCmd->SetDefaultUnit("mm");
64 StepLengthLimitCmd->AvailableForStates(G4State_PreInit, G4State_Idle,
66
67 MagFieldLimitCmd = new G4UIcmdWithADouble("/geant4e/limits/magField", this);
68 MagFieldLimitCmd->SetGuidance("Limit the length of an step");
69 MagFieldLimitCmd->AvailableForStates(G4State_PreInit, G4State_Idle,
71
72 EnergyLossCmd = new G4UIcmdWithADouble("/geant4e/limits/energyLoss", this);
73 EnergyLossCmd->SetGuidance("Limit the length of an step");
74 EnergyLossCmd->AvailableForStates(G4State_PreInit, G4State_Idle,
76}
@ G4State_EventProc
@ G4State_Idle
@ G4State_GeomClosed
@ G4State_PreInit

◆ ~G4ErrorMessenger()

G4ErrorMessenger::~G4ErrorMessenger ( )

Definition at line 79 of file G4ErrorMessenger.cc.

80{
81 delete StepLengthLimitCmd;
82 delete MagFieldLimitCmd;
83 delete EnergyLossCmd;
84 delete myDir;
85 delete myDirLimits;
86}

Member Function Documentation

◆ SetNewValue()

void G4ErrorMessenger::SetNewValue ( G4UIcommand * command,
G4String newValue )
virtual

Reimplemented from G4UImessenger.

Definition at line 89 of file G4ErrorMessenger.cc.

90{
91 if(command == StepLengthLimitCmd)
92 {
93#ifdef G4VERBOSE
95 {
96 G4cout << " G4ErrorMessenger::StepLengthAction SetStepLimit "
97 << StepLengthLimitCmd->GetNewDoubleValue(newValue) << G4endl;
98 }
99#endif
100 StepLengthAction->SetStepLimit(
101 StepLengthLimitCmd->GetNewDoubleValue(newValue));
102 }
103 else if(command == MagFieldLimitCmd)
104 {
105#ifdef G4VERBOSE
107 {
108 G4cout << " G4ErrorMessenger::MagFieldAction SetStepLimit "
109 << MagFieldLimitCmd->GetNewDoubleValue(newValue) << G4endl;
110 }
111#endif
112 MagFieldAction->SetStepLimit(MagFieldLimitCmd->GetNewDoubleValue(newValue));
113 }
114 else if(command == EnergyLossCmd)
115 {
116#ifdef G4VERBOSE
118 {
119 G4cout << " G4ErrorMessenger::EnergyLossAction SetStepLimit "
120 << EnergyLossCmd->GetNewDoubleValue(newValue) << G4endl;
121 }
122#endif
123 EnergyLossAction->SetStepLimit(EnergyLossCmd->GetNewDoubleValue(newValue));
124 }
125}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout

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