00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "G4HadronicEPTestMessenger.hh"
00028 #include "G4UIdirectory.hh"
00029 #include "G4UIcmdWithAnInteger.hh"
00030 #include "G4UIcmdWithADouble.hh"
00031 #include "G4UIcmdWithADoubleAndUnit.hh"
00032
00033
00034 G4HadronicEPTestMessenger::G4HadronicEPTestMessenger(G4HadronicProcessStore* theStore)
00035 :theProcessStore(theStore)
00036 {
00037
00038 heptstDirectory = new G4UIdirectory("/heptst/");
00039 heptstDirectory->SetGuidance("Controls for the hadronic energy/momentum test");
00040
00041
00042 reportLvlCmd = new G4UIcmdWithAnInteger("/heptst/reportLevel",this);
00043 reportLvlCmd->SetGuidance("Set level of detail reported upon E/p non-conservation");
00044 reportLvlCmd->SetGuidance(" 0 - (default) no reporting ");
00045 reportLvlCmd->SetGuidance(" 1 - report only when E/p not conserved ");
00046 reportLvlCmd->SetGuidance(" 2 - report regardless of E/p conservation ");
00047 reportLvlCmd->SetGuidance(" 3 - report only when E/p not conserved, with names, limits ");
00048 reportLvlCmd->SetGuidance(" 4 - report regardless of E/p conservation, with names, limits ");
00049 reportLvlCmd->SetParameterName("ReportLevel",true);
00050 reportLvlCmd->SetDefaultValue(0);
00051 reportLvlCmd->SetRange("ReportLevel >= 0 && ReportLevel < 5");
00052
00053
00054 procAbsLvlCmd = new G4UIcmdWithADoubleAndUnit("/heptst/processAbsLevel",this);
00055 procAbsLvlCmd->SetGuidance("Set absolute energy level (with unit) of allowed energy non-conservation");
00056 procAbsLvlCmd->SetParameterName("ProcessAbsLevel",true);
00057 procAbsLvlCmd->SetDefaultValue(-1.0);
00058 procAbsLvlCmd->SetUnitCategory("Energy");
00059
00060
00061 procRelLvlCmd = new G4UIcmdWithADouble("/heptst/processRelLevel",this);
00062 procRelLvlCmd->SetGuidance("Set relative level of allowed energy non-conservation");
00063 procRelLvlCmd->SetParameterName("ProcessRelLevel",true);
00064 procRelLvlCmd->SetDefaultValue(-1.0);
00065 }
00066
00067
00068 G4HadronicEPTestMessenger::~G4HadronicEPTestMessenger()
00069 {
00070 delete heptstDirectory;
00071 delete reportLvlCmd;
00072 delete procAbsLvlCmd;
00073 delete procRelLvlCmd;
00074 }
00075
00076
00077 void G4HadronicEPTestMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
00078 {
00079 if (command==reportLvlCmd) {
00080 theProcessStore->SetEpReportLevel(reportLvlCmd->GetNewIntValue(newValue) );
00081
00082 } else if(command==procRelLvlCmd) {
00083
00084 theProcessStore->SetProcessRelLevel(procRelLvlCmd->GetNewDoubleValue(newValue) );
00085 } else if(command==procAbsLvlCmd) {
00086
00087 theProcessStore->SetProcessAbsLevel(procAbsLvlCmd->GetNewDoubleValue(newValue) );
00088 }
00089 }