#include <GFlashShowerModelMessenger.hh>
Inheritance diagram for GFlashShowerModelMessenger:
Public Member Functions | |
GFlashShowerModelMessenger (GFlashShowerModel *myModel) | |
~GFlashShowerModelMessenger () | |
void | SetNewValue (G4UIcommand *command, G4String newValues) |
G4String | GetCurrentValue (G4UIcommand *command) |
Definition at line 56 of file GFlashShowerModelMessenger.hh.
GFlashShowerModelMessenger::GFlashShowerModelMessenger | ( | GFlashShowerModel * | myModel | ) |
Definition at line 54 of file GFlashShowerModelMessenger.cc.
References G4UIcommand::AvailableForStates(), G4State_Idle, G4State_PreInit, G4UIcmdWithADoubleAndUnit::SetDefaultUnit(), G4UIcommand::SetGuidance(), G4UIcmdWithADoubleAndUnit::SetParameterName(), G4UIcmdWithADouble::SetParameterName(), G4UIcmdWithAnInteger::SetParameterName(), and G4UIcmdWithADoubleAndUnit::SetUnitCategory().
00055 { 00056 myParaDir = new G4UIdirectory("/GFlash/"); 00057 myParaDir->SetGuidance("Parametrisation control."); 00058 myModel= aModel; 00059 00060 FlagCmd = new G4UIcmdWithAnInteger("/GFlash/flag",this); 00061 FlagCmd->SetGuidance("Defines if GFlash is activated"); 00062 FlagCmd->SetParameterName("flag",false,false); 00063 00064 ContCmd = new G4UIcmdWithAnInteger("/GFlash/containment ",this); 00065 ContCmd->SetGuidance("Defines if Containment is checked"); 00066 ContCmd->SetParameterName("flag",false,false); 00067 00068 StepInX0Cmd = new G4UIcmdWithADouble("/GFlash/stepXo",this); 00069 StepInX0Cmd->SetGuidance("Defines step lenghts"); 00070 StepInX0Cmd->SetParameterName("flag",false,false); 00071 00072 EminCmd = new G4UIcmdWithADoubleAndUnit("/GFlash/Emin",this); 00073 EminCmd->SetGuidance("Set minimum kinetic energy to trigger parametrisation"); 00074 EminCmd->SetParameterName("Emin",false,false); 00075 EminCmd->SetDefaultUnit("GeV"); 00076 EminCmd->SetUnitCategory("Energy"); 00077 EminCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00078 00079 EmaxCmd = new G4UIcmdWithADoubleAndUnit("/GFlash/Emax",this); 00080 EmaxCmd->SetGuidance("Set maximum kinetic energy to trigger parametrisation"); 00081 EmaxCmd->SetParameterName("Emax",false,false); 00082 EmaxCmd->SetDefaultUnit("GeV"); 00083 EmaxCmd->SetUnitCategory("Energy"); 00084 EmaxCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00085 00086 EkillCmd = new G4UIcmdWithADoubleAndUnit("/GFlash/Ekill",this); 00087 EkillCmd->SetGuidance("Set maximum kinetic energy for electrons to be killed"); 00088 EkillCmd->SetParameterName("Ekill",false,false); 00089 EkillCmd->SetDefaultUnit("GeV"); 00090 EkillCmd->SetUnitCategory("Energy"); 00091 EkillCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00092 }
GFlashShowerModelMessenger::~GFlashShowerModelMessenger | ( | ) |
Definition at line 95 of file GFlashShowerModelMessenger.cc.
00096 { 00097 delete ContCmd; 00098 delete FlagCmd; 00099 delete StepInX0Cmd; 00100 delete EminCmd; 00101 delete EmaxCmd; 00102 delete EkillCmd; 00103 }
G4String GFlashShowerModelMessenger::GetCurrentValue | ( | G4UIcommand * | command | ) | [virtual] |
Reimplemented from G4UImessenger.
Definition at line 144 of file GFlashShowerModelMessenger.cc.
References G4Electron::ElectronDefinition(), GFlashParticleBounds::GetEneToKill(), GFlashShowerModel::GetFlagParamType(), GFlashParticleBounds::GetMaxEneToParametrise(), GFlashParticleBounds::GetMinEneToParametrise(), and GFlashShowerModel::PBound.
Referenced by SetNewValue().
00145 { 00146 G4String returnValue('\0'); 00147 std::ostringstream os; 00148 00149 if( command == FlagCmd ) { 00150 os << "/GFlash/flag " << myModel->GetFlagParamType() << '\0'; 00151 returnValue = G4String(os.str()); 00152 } 00153 00154 else if( command == EkillCmd ) { 00155 os << "/GFlash/Ekill " 00156 << myModel->PBound->GetEneToKill(*G4Electron::ElectronDefinition())/GeV 00157 << " GeV" << '\0'; 00158 returnValue = G4String(os.str()); 00159 } 00160 00161 else if( command == EminCmd ) { 00162 os << "/GFlash/Emin " 00163 << myModel->PBound->GetMinEneToParametrise(*G4Electron::ElectronDefinition())/GeV 00164 << " GeV" << '\0'; 00165 returnValue = G4String(os.str()); 00166 } 00167 00168 else if( command == EmaxCmd ) { 00169 os << "/GFlash/Emax " 00170 << myModel->PBound->GetMaxEneToParametrise(*G4Electron::ElectronDefinition())/GeV 00171 << " GeV" << '\0'; 00172 returnValue = G4String(os.str()); 00173 } 00174 00175 return returnValue; 00176 }
void GFlashShowerModelMessenger::SetNewValue | ( | G4UIcommand * | command, | |
G4String | newValues | |||
) | [virtual] |
Reimplemented from G4UImessenger.
Definition at line 107 of file GFlashShowerModelMessenger.cc.
References G4Electron::ElectronDefinition(), GetCurrentValue(), G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(), G4UIcmdWithADouble::GetNewDoubleValue(), G4UIcmdWithAnInteger::GetNewIntValue(), GFlashShowerModel::PBound, GFlashParticleBounds::SetEneToKill(), GFlashShowerModel::SetFlagParamType(), GFlashShowerModel::SetFlagParticleContainment(), GFlashParticleBounds::SetMaxEneToParametrise(), GFlashParticleBounds::SetMinEneToParametrise(), and GFlashShowerModel::SetStepInX0().
00108 { 00109 00110 if( command == FlagCmd ) { 00111 myModel->SetFlagParamType(FlagCmd->GetNewIntValue(newValues)); 00112 this->GetCurrentValue(command); 00113 } 00114 if( command == ContCmd ) { 00115 myModel->SetFlagParticleContainment(ContCmd->GetNewIntValue(newValues)); 00116 this->GetCurrentValue(command); 00117 } 00118 if( command == StepInX0Cmd ) { 00119 myModel->SetStepInX0(StepInX0Cmd->GetNewDoubleValue(newValues)); 00120 this->GetCurrentValue(command); 00121 } 00122 00123 else if( command == EminCmd ) { 00124 myModel->PBound->SetMinEneToParametrise(*G4Electron::ElectronDefinition(), 00125 EminCmd->GetNewDoubleValue(newValues)); 00126 this->GetCurrentValue(command); 00127 } 00128 00129 else if( command == EmaxCmd ) { 00130 myModel->PBound->SetMaxEneToParametrise(*G4Electron::ElectronDefinition(), 00131 EmaxCmd->GetNewDoubleValue(newValues)); 00132 this->GetCurrentValue(command); 00133 } 00134 00135 else if( command == EkillCmd ) { 00136 myModel->PBound->SetEneToKill(*G4Electron::ElectronDefinition(), 00137 EkillCmd->GetNewDoubleValue(newValues)); 00138 this->GetCurrentValue(command); 00139 } 00140 00141 }