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

#include <G4QSSMessenger.hh>

+ Inheritance diagram for G4QSSMessenger:

Public Types

enum  StepperSelection { None = 0 , TemplatedDoPri , OldRK45 , G4QSS2 }
 

Public Member Functions

 G4QSSMessenger ()
 
 ~G4QSSMessenger () override
 
void SetNewValue (G4UIcommand *command, G4String newValues) override
 
void selectStepper (const std::string &)
 
StepperSelection selectedStepper ()
 
- 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
 

Static Public Member Functions

static G4QSSMessengerinstance ()
 

Public Attributes

G4double dQMin = 0
 
G4double dQRel = 0
 
G4double trialProposedStepModifier = 1.0
 

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 (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 44 of file G4QSSMessenger.hh.

Member Enumeration Documentation

◆ StepperSelection

Enumerator
None 
TemplatedDoPri 
OldRK45 
G4QSS2 

Definition at line 59 of file G4QSSMessenger.hh.

Constructor & Destructor Documentation

◆ G4QSSMessenger()

G4QSSMessenger::G4QSSMessenger ( )

Definition at line 33 of file G4QSSMessenger.cc.

34{
36
37 qssCmdDir = new G4UIdirectory("/QSS/", false);
38 qssCmdDir->SetGuidance("G4QSStepper configuration.");
39
40 dQMinCmd = new G4UIcmdWithADoubleAndUnit("/QSS/dQMin",this);
41 dQMinCmd->SetDefaultUnit("mm");
42 dQMinCmd->SetParameterName("dQMinCmd",false);
43 dQMinCmd->SetUnitCategory("Length");
44
45 dQRelCmd = new G4UIcmdWithADouble("/QSS/dQRel",this);
46 dQRelCmd->SetGuidance("Default is 1e-5");
47 dQRelCmd->SetParameterName("dQRelCmd",false);
48
49 trialProposedStepModifierCmd = new G4UIcmdWithADouble("/QSS/trialProposedStepModifier",this);
50 trialProposedStepModifierCmd->SetGuidance("Default is 1");
51 trialProposedStepModifierCmd->SetParameterName("trialProposedStepModifier", false);
52
53 stepperSelectorCmd = new G4UIcmdWithAString("/QSS/selectStepper",this);
54 stepperSelectorCmd->SetGuidance("Select stepper.");
55 stepperSelectorCmd->SetParameterName("choice", false);
56 stepperSelectorCmd->SetCandidates("TemplatedDoPri OldRK45 G4QSS2");
57
58}
void SetUnitCategory(const char *unitCategory)
void SetDefaultUnit(const char *defUnit)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetCandidates(const char *candidateList)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetGuidance(const char *aGuidance)
G4bool commandsShouldBeInMaster

◆ ~G4QSSMessenger()

G4QSSMessenger::~G4QSSMessenger ( )
override

Definition at line 60 of file G4QSSMessenger.cc.

61{
62 delete qssCmdDir;
63 delete dQMinCmd;
64 delete dQRelCmd;
65 delete stepperSelectorCmd;
66 delete trialProposedStepModifierCmd;
67 //qssStats.print();
68}

Member Function Documentation

◆ instance()

G4QSSMessenger * G4QSSMessenger::instance ( )
static

Definition at line 70 of file G4QSSMessenger.cc.

71{
72 static G4QSSMessenger theSingleMessengerInstance;
73 return &theSingleMessengerInstance;
74}

◆ selectedStepper()

G4QSSMessenger::StepperSelection G4QSSMessenger::selectedStepper ( )

Definition at line 104 of file G4QSSMessenger.cc.

105{
106 return _selectedStepper;
107}

◆ selectStepper()

void G4QSSMessenger::selectStepper ( const std::string & newValue)

Definition at line 96 of file G4QSSMessenger.cc.

97{
98 const std::map<std::string, StepperSelection> stepperMapping =
99 {{"TemplatedDoPri", TemplatedDoPri}, {"OldRK45", OldRK45}, {"G4QSS2", G4QSS2}};
100 _selectedStepper = stepperMapping.at(newValue);
101 G4cout << "G4QSSMessenger: Selecting stepper " << newValue << G4endl;
102}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout

Referenced by SetNewValue().

◆ SetNewValue()

void G4QSSMessenger::SetNewValue ( G4UIcommand * command,
G4String newValues )
overridevirtual

Reimplemented from G4UImessenger.

Definition at line 76 of file G4QSSMessenger.cc.

77{
78 if ( command == dQMinCmd ) {
79 dQMin = dQMinCmd->GetNewDoubleValue(newValue);
80 }
81
82 if ( command == dQRelCmd ) {
83 dQRel = dQRelCmd->GetNewDoubleValue(newValue);
84 }
85
86 if ( command == trialProposedStepModifierCmd ) {
87 trialProposedStepModifier = trialProposedStepModifierCmd->GetNewDoubleValue(newValue);
88 }
89
90 if(command == stepperSelectorCmd){
91 this->selectStepper(newValue);
92 }
93
94}
G4double trialProposedStepModifier
void selectStepper(const std::string &)
static G4double GetNewDoubleValue(const char *paramString)
static G4double GetNewDoubleValue(const char *paramString)

Member Data Documentation

◆ dQMin

G4double G4QSSMessenger::dQMin = 0

Definition at line 71 of file G4QSSMessenger.hh.

Referenced by SetNewValue().

◆ dQRel

G4double G4QSSMessenger::dQRel = 0

Definition at line 72 of file G4QSSMessenger.hh.

Referenced by SetNewValue().

◆ trialProposedStepModifier

G4double G4QSSMessenger::trialProposedStepModifier = 1.0

Definition at line 73 of file G4QSSMessenger.hh.

Referenced by SetNewValue().


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