Geant4 10.7.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 ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
G4bool operator== (const G4UImessenger &messenger) const
 
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)
 
G4long StoL (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 = 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.

48 :StepLengthAction(lengthAct),MagFieldAction(magAct),EnergyLossAction(elossAct)
49{
50
51 myDir = new G4UIdirectory("/geant4e/");
52 myDir->SetGuidance("GEANT4e control commands");
53
54 myDirLimits = new G4UIdirectory("/geant4e/limits/");
55 myDirLimits->SetGuidance("GEANT4e commands to limit the step");
56
57
58 StepLengthLimitCmd = new G4UIcmdWithADoubleAndUnit("/geant4e/limits/stepLength",this);
59 StepLengthLimitCmd->SetGuidance("Limit the length of an step");
60 StepLengthLimitCmd->SetDefaultUnit("mm");
62
63 MagFieldLimitCmd = new G4UIcmdWithADouble("/geant4e/limits/magField",this);
64 MagFieldLimitCmd->SetGuidance("Limit the length of an step");
66
67 EnergyLossCmd = new G4UIcmdWithADouble("/geant4e/limits/energyLoss",this);
68 EnergyLossCmd->SetGuidance("Limit the length of an step");
70}
@ G4State_EventProc
@ G4State_Idle
@ G4State_GeomClosed
@ G4State_PreInit
void SetDefaultUnit(const char *defUnit)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:156
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:273

◆ ~G4ErrorMessenger()

G4ErrorMessenger::~G4ErrorMessenger ( )

Definition at line 74 of file G4ErrorMessenger.cc.

75{
76 delete StepLengthLimitCmd;
77 delete MagFieldLimitCmd;
78 delete EnergyLossCmd;
79 delete myDir;
80 delete myDirLimits;
81}

Member Function Documentation

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 85 of file G4ErrorMessenger.cc.

86{
87 if( command == StepLengthLimitCmd ) {
88#ifdef G4VERBOSE
90 G4cout << " G4ErrorMessenger::StepLengthAction SetStepLimit " << StepLengthLimitCmd->GetNewDoubleValue(newValue) << G4endl;
91 }
92#endif
93 StepLengthAction->SetStepLimit(StepLengthLimitCmd->GetNewDoubleValue(newValue));
94 } else if( command == MagFieldLimitCmd ) {
95#ifdef G4VERBOSE
97 G4cout << " G4ErrorMessenger::MagFieldAction SetStepLimit " << MagFieldLimitCmd->GetNewDoubleValue(newValue) << G4endl;
98 }
99#endif
100 MagFieldAction->SetStepLimit(MagFieldLimitCmd->GetNewDoubleValue(newValue));
101 } else if( command == EnergyLossCmd ) {
102#ifdef G4VERBOSE
103 if(G4ErrorPropagatorData::verbose() >= 3 ) {
104 G4cout << " G4ErrorMessenger::EnergyLossAction SetStepLimit " << EnergyLossCmd->GetNewDoubleValue(newValue) << G4endl;
105 }
106#endif
107 EnergyLossAction->SetStepLimit(EnergyLossCmd->GetNewDoubleValue(newValue));
108 }
109}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
void SetStepLimit(G4double val)
static G4double GetNewDoubleValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)
void SetStepLimit(G4double val)

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