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

#include <GFlashShowerModelMessenger.hh>

Inheritance diagram for GFlashShowerModelMessenger:

Public Member Functions

 GFlashShowerModelMessenger (GFlashShowerModel *myModel)
 ~GFlashShowerModelMessenger ()
void SetNewValue (G4UIcommand *command, G4String newValues)
G4String GetCurrentValue (G4UIcommand *command)
Public Member Functions inherited from G4UImessenger
 G4UImessenger ()=default
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
virtual ~G4UImessenger ()
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 55 of file GFlashShowerModelMessenger.hh.

Constructor & Destructor Documentation

◆ GFlashShowerModelMessenger()

GFlashShowerModelMessenger::GFlashShowerModelMessenger ( GFlashShowerModel * myModel)

Definition at line 54 of file GFlashShowerModelMessenger.cc.

55{
56 myParaDir = new G4UIdirectory("/GFlash/");
57 myParaDir->SetGuidance("Parametrisation control.");
58 myModel = aModel;
59
60 FlagCmd = new G4UIcmdWithAnInteger("/GFlash/flag", this);
61 FlagCmd->SetGuidance("Defines if GFlash is activated");
62 FlagCmd->SetParameterName("flag", false, false);
63
64 ContCmd = new G4UIcmdWithAnInteger("/GFlash/containment ", this);
65 ContCmd->SetGuidance("Defines if Containment is checked");
66 ContCmd->SetParameterName("flag", false, false);
67
68 StepInX0Cmd = new G4UIcmdWithADouble("/GFlash/stepXo", this);
69 StepInX0Cmd->SetGuidance("Defines step lenghts");
70 StepInX0Cmd->SetParameterName("flag", false, false);
71
72 EminCmd = new G4UIcmdWithADoubleAndUnit("/GFlash/Emin", this);
73 EminCmd->SetGuidance("Set minimum kinetic energy to trigger parametrisation");
74 EminCmd->SetParameterName("Emin", false, false);
75 EminCmd->SetDefaultUnit("GeV");
76 EminCmd->SetUnitCategory("Energy");
77 EminCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
78
79 EmaxCmd = new G4UIcmdWithADoubleAndUnit("/GFlash/Emax", this);
80 EmaxCmd->SetGuidance("Set maximum kinetic energy to trigger parametrisation");
81 EmaxCmd->SetParameterName("Emax", false, false);
82 EmaxCmd->SetDefaultUnit("GeV");
83 EmaxCmd->SetUnitCategory("Energy");
84 EmaxCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
85
86 EkillCmd = new G4UIcmdWithADoubleAndUnit("/GFlash/Ekill", this);
87 EkillCmd->SetGuidance("Set maximum kinetic energy for electrons to be killed");
88 EkillCmd->SetParameterName("Ekill", false, false);
89 EkillCmd->SetDefaultUnit("GeV");
90 EkillCmd->SetUnitCategory("Energy");
91 EkillCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
92}
@ G4State_Idle
@ G4State_PreInit

◆ ~GFlashShowerModelMessenger()

GFlashShowerModelMessenger::~GFlashShowerModelMessenger ( )

Definition at line 94 of file GFlashShowerModelMessenger.cc.

95{
96 delete ContCmd;
97 delete FlagCmd;
98 delete StepInX0Cmd;
99 delete EminCmd;
100 delete EmaxCmd;
101 delete EkillCmd;
102}

Member Function Documentation

◆ GetCurrentValue()

G4String GFlashShowerModelMessenger::GetCurrentValue ( G4UIcommand * command)
virtual

Reimplemented from G4UImessenger.

Definition at line 138 of file GFlashShowerModelMessenger.cc.

139{
140 G4String returnValue(1, '\0');
141 std::ostringstream os;
142
143 if (command == FlagCmd) {
144 os << "/GFlash/flag " << myModel->GetFlagParamType() << '\0';
145 returnValue = G4String(os.str());
146 }
147
148 else if (command == EkillCmd) {
149 os << "/GFlash/Ekill " << myModel->PBound->GetEneToKill(*G4Electron::ElectronDefinition()) / GeV
150 << " GeV" << '\0';
151 returnValue = G4String(os.str());
152 }
153
154 else if (command == EminCmd) {
155 os << "/GFlash/Emin "
156 << myModel->PBound->GetMinEneToParametrise(*G4Electron::ElectronDefinition()) / GeV << " GeV"
157 << '\0';
158 returnValue = G4String(os.str());
159 }
160
161 else if (command == EmaxCmd) {
162 os << "/GFlash/Emax "
163 << myModel->PBound->GetMaxEneToParametrise(*G4Electron::ElectronDefinition()) / GeV << " GeV"
164 << '\0';
165 returnValue = G4String(os.str());
166 }
167
168 return returnValue;
169}
static G4Electron * ElectronDefinition()
Definition G4Electron.cc:86

Referenced by SetNewValue().

◆ SetNewValue()

void GFlashShowerModelMessenger::SetNewValue ( G4UIcommand * command,
G4String newValues )
virtual

Reimplemented from G4UImessenger.

Definition at line 104 of file GFlashShowerModelMessenger.cc.

105{
106 if (command == FlagCmd) {
107 myModel->SetFlagParamType(FlagCmd->GetNewIntValue(newValues));
108 this->GetCurrentValue(command);
109 }
110 if (command == ContCmd) {
111 myModel->SetFlagParticleContainment(ContCmd->GetNewIntValue(newValues));
112 this->GetCurrentValue(command);
113 }
114 if (command == StepInX0Cmd) {
115 myModel->SetStepInX0(StepInX0Cmd->GetNewDoubleValue(newValues));
116 this->GetCurrentValue(command);
117 }
118
119 else if (command == EminCmd) {
120 myModel->PBound->SetMinEneToParametrise(*G4Electron::ElectronDefinition(),
121 EminCmd->GetNewDoubleValue(newValues));
122 this->GetCurrentValue(command);
123 }
124
125 else if (command == EmaxCmd) {
126 myModel->PBound->SetMaxEneToParametrise(*G4Electron::ElectronDefinition(),
127 EmaxCmd->GetNewDoubleValue(newValues));
128 this->GetCurrentValue(command);
129 }
130
131 else if (command == EkillCmd) {
132 myModel->PBound->SetEneToKill(*G4Electron::ElectronDefinition(),
133 EkillCmd->GetNewDoubleValue(newValues));
134 this->GetCurrentValue(command);
135 }
136}
G4String GetCurrentValue(G4UIcommand *command)

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