#include <PrimaryGeneratorMessenger.hh>
Public Member Functions | |
PrimaryGeneratorMessenger (PrimaryGeneratorAction *) | |
virtual | ~PrimaryGeneratorMessenger () |
void | SetNewValue (G4UIcommand *, G4String) |
Private Attributes | |
PrimaryGeneratorAction * | Action |
G4UIdirectory * | gunDir |
G4UIcmdWithAnInteger * | root_index_cmd |
G4UIcmdWithAString * | EnergyMode_cmd |
G4UIcmdWithAString * | DirectionMode_cmd |
G4UIcmdWithAString * | PositionMode_cmd |
G4UIcmdWithAString * | EM_hist_filename_cmd |
G4UIcmdWithAString * | EM_hist_histname_cmd |
G4UIcmdWithAString * | DM_hist_filename_cmd |
G4UIcmdWithAString * | DM_hist_histname_cmd |
G4UIcmdWithAString * | root_filename_cmd |
G4UIcmdWithAString * | root_treename_cmd |
G4UIcmdWithAString * | ResetGenCmd |
G4UIcmdWithAString * | ReadCardCmd |
G4UIcmdWithoutParameter * | InitializeCmd |
G4UIcmdWithoutParameter * | histo_build_cmd |
G4UIcmdWithoutParameter * | root_build_cmd |
Definition at line 23 of file PrimaryGeneratorMessenger.hh.
PrimaryGeneratorMessenger::PrimaryGeneratorMessenger | ( | PrimaryGeneratorAction * | Gun | ) |
Definition at line 19 of file PrimaryGeneratorMessenger.cc.
References DirectionMode_cmd, DM_hist_filename_cmd, DM_hist_histname_cmd, EM_hist_filename_cmd, EM_hist_histname_cmd, EnergyMode_cmd, gunDir, histo_build_cmd, InitializeCmd, PositionMode_cmd, ReadCardCmd, ResetGenCmd, root_build_cmd, root_filename_cmd, and root_index_cmd.
00021 :Action(Gun) 00022 { 00023 gunDir = new G4UIdirectory("/g4sim/gun/"); 00024 gunDir->SetGuidance("PrimaryGenerator control"); 00025 00026 InitializeCmd = new G4UIcmdWithoutParameter("/g4sim/gun/initialize",this); 00027 InitializeCmd->SetGuidance("Initialize PrimaryGeneratorAction."); 00028 InitializeCmd->SetGuidance("This command MUST be applied before \"beamOn\" "); 00029 InitializeCmd->SetGuidance("if you changed geometrical value(s)."); 00030 InitializeCmd->AvailableForStates(G4State_Idle); 00031 00032 ResetGenCmd = new G4UIcmdWithAString("/g4sim/gun/ResetGen",this); 00033 ResetGenCmd->SetGuidance("Reset PrimaryGeneratorAction according to given file."); 00034 ResetGenCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00035 00036 ReadCardCmd = new G4UIcmdWithAString("/g4sim/gun/ReadCard",this); 00037 ReadCardCmd->SetGuidance("Read PrimaryGeneratorAction file."); 00038 ReadCardCmd->SetGuidance("You have to call update before you start a new run."); 00039 ReadCardCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00040 00041 EnergyMode_cmd = new G4UIcmdWithAString("/g4sim/gun/EnergyMode",this); 00042 EnergyMode_cmd->SetGuidance("Choose energy model:"); 00043 EnergyMode_cmd->SetGuidance(" Choice : none(default), histo"); 00044 EnergyMode_cmd->SetParameterName("choice",true); 00045 EnergyMode_cmd->SetDefaultValue("none"); 00046 EnergyMode_cmd->SetCandidates("none histo txt root"); 00047 EnergyMode_cmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00048 00049 DirectionMode_cmd = new G4UIcmdWithAString("/g4sim/gun/DirectionMode",this); 00050 DirectionMode_cmd->SetGuidance("Choose direction model:"); 00051 DirectionMode_cmd->SetGuidance(" Choice : none(default), uniform"); 00052 DirectionMode_cmd->SetParameterName("choice",true); 00053 DirectionMode_cmd->SetDefaultValue("none"); 00054 DirectionMode_cmd->SetCandidates("none uniform"); 00055 DirectionMode_cmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00056 00057 PositionMode_cmd = new G4UIcmdWithAString("/g4sim/gun/PositionMode",this); 00058 PositionMode_cmd->SetGuidance("Choose position model:"); 00059 PositionMode_cmd->SetGuidance(" Choice : none(default), uniform"); 00060 PositionMode_cmd->SetParameterName("choice",true); 00061 PositionMode_cmd->SetDefaultValue("none"); 00062 PositionMode_cmd->SetCandidates("none uniform"); 00063 PositionMode_cmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00064 00065 EM_hist_filename_cmd = new G4UIcmdWithAString("/g4sim/gun/EM_hist_filename",this); 00066 EM_hist_filename_cmd->SetGuidance("Choose name of input file for histogram to generate momentum amplitude:"); 00067 EM_hist_filename_cmd->SetGuidance(" default name: default_file_for_mom"); 00068 EM_hist_filename_cmd->SetParameterName("name",true); 00069 EM_hist_filename_cmd->SetDefaultValue("default_file_for_mom"); 00070 EM_hist_filename_cmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00071 00072 EM_hist_histname_cmd = new G4UIcmdWithAString("/g4sim/gun/EM_hist_histname",this); 00073 EM_hist_histname_cmd->SetGuidance("Choose name of input hist for histogram to generate momentum amplitude:"); 00074 EM_hist_histname_cmd->SetGuidance(" default name: default_hist_for_mom"); 00075 EM_hist_histname_cmd->SetParameterName("name",true); 00076 EM_hist_histname_cmd->SetDefaultValue("default_hist_for_mom"); 00077 EM_hist_histname_cmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00078 00079 DM_hist_filename_cmd = new G4UIcmdWithAString("/g4sim/gun/DM_hist_filename",this); 00080 DM_hist_filename_cmd->SetGuidance("Choose name of input file for histogram to generate momentum direction (theta):"); 00081 DM_hist_filename_cmd->SetGuidance(" default name: default_file_for_mom"); 00082 DM_hist_filename_cmd->SetParameterName("name",true); 00083 DM_hist_filename_cmd->SetDefaultValue("default_file_for_mom"); 00084 DM_hist_filename_cmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00085 00086 DM_hist_histname_cmd = new G4UIcmdWithAString("/g4sim/gun/DM_hist_histname",this); 00087 DM_hist_histname_cmd->SetGuidance("Choose name of input hist for histogram to generate momentum direction (theta):"); 00088 DM_hist_histname_cmd->SetGuidance(" default name: default_hist_for_mom"); 00089 DM_hist_histname_cmd->SetParameterName("name",true); 00090 DM_hist_histname_cmd->SetDefaultValue("default_hist_for_mom"); 00091 DM_hist_histname_cmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00092 00093 root_filename_cmd = new G4UIcmdWithAString("/g4sim/gun/root_filename",this); 00094 root_filename_cmd->SetGuidance("root_filename"); 00095 root_filename_cmd->SetParameterName("root_filename",false); 00096 root_filename_cmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00097 00098 root_index_cmd = new G4UIcmdWithAnInteger("/g4sim/gun/root_index",this); 00099 root_index_cmd->SetGuidance("root_index"); 00100 root_index_cmd->SetParameterName("root_index",false); 00101 root_index_cmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00102 00103 histo_build_cmd = new G4UIcmdWithoutParameter("/g4sim/gun/histo_build",this); 00104 histo_build_cmd->SetGuidance("update histogram for momentum."); 00105 histo_build_cmd->SetGuidance("This command MUST be applied before \"beamOn\" "); 00106 histo_build_cmd->SetGuidance("if you use energy model histo and changed input file."); 00107 histo_build_cmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00108 00109 root_build_cmd = new G4UIcmdWithoutParameter("/g4sim/gun/root_build",this); 00110 root_build_cmd->SetGuidance("build TChain for root mode."); 00111 root_build_cmd->SetGuidance("This command MUST be applied before \"beamOn\" "); 00112 root_build_cmd->SetGuidance("if you use energy model root and changed input file."); 00113 root_build_cmd->AvailableForStates(G4State_PreInit,G4State_Idle); 00114 00115 00116 }
PrimaryGeneratorMessenger::~PrimaryGeneratorMessenger | ( | ) | [virtual] |
Definition at line 120 of file PrimaryGeneratorMessenger.cc.
References DirectionMode_cmd, DM_hist_filename_cmd, DM_hist_histname_cmd, EM_hist_filename_cmd, EM_hist_histname_cmd, EnergyMode_cmd, gunDir, histo_build_cmd, InitializeCmd, PositionMode_cmd, ReadCardCmd, ResetGenCmd, root_build_cmd, root_filename_cmd, and root_index_cmd.
00121 { 00122 delete InitializeCmd; 00123 delete ResetGenCmd; 00124 delete ReadCardCmd; 00125 delete EnergyMode_cmd; 00126 delete DirectionMode_cmd; 00127 delete PositionMode_cmd; 00128 delete EM_hist_filename_cmd; 00129 delete EM_hist_histname_cmd; 00130 delete DM_hist_filename_cmd; 00131 delete DM_hist_histname_cmd; 00132 delete root_filename_cmd; 00133 delete root_index_cmd; 00134 delete histo_build_cmd; 00135 delete root_build_cmd; 00136 delete gunDir; 00137 }
void PrimaryGeneratorMessenger::SetNewValue | ( | G4UIcommand * | command, | |
G4String | newValue | |||
) |
Definition at line 141 of file PrimaryGeneratorMessenger.cc.
References Action, PrimaryGeneratorAction::BuildHistoFromFile(), DirectionMode_cmd, DM_hist_filename_cmd, DM_hist_histname_cmd, EM_hist_filename_cmd, EM_hist_histname_cmd, EnergyMode_cmd, histo_build_cmd, PrimaryGeneratorAction::Initialize(), InitializeCmd, PositionMode_cmd, PrimaryGeneratorAction::ReadCard(), ReadCardCmd, PrimaryGeneratorAction::ResetGen(), ResetGenCmd, PrimaryGeneratorAction::root_build(), root_build_cmd, root_filename_cmd, root_index_cmd, PrimaryGeneratorAction::set_DirectionMode(), PrimaryGeneratorAction::set_DM_hist_filename(), PrimaryGeneratorAction::set_DM_hist_histname(), PrimaryGeneratorAction::set_EM_hist_filename(), PrimaryGeneratorAction::set_EM_hist_histname(), PrimaryGeneratorAction::set_EnergyMode(), PrimaryGeneratorAction::set_PositionMode(), PrimaryGeneratorAction::set_root_filename(), and PrimaryGeneratorAction::set_root_index().
00143 { 00144 if( command == EnergyMode_cmd ) { Action->set_EnergyMode(newValue);} 00145 if( command == DirectionMode_cmd ) { Action->set_DirectionMode(newValue);} 00146 if( command == PositionMode_cmd ) { Action->set_PositionMode(newValue);} 00147 if( command == root_filename_cmd ) { Action->set_root_filename(newValue);} 00148 if( command == root_index_cmd ) { Action->set_root_index(root_index_cmd->GetNewIntValue(newValue));} 00149 if( command == EM_hist_filename_cmd ) { Action->set_EM_hist_filename(newValue);} 00150 if( command == EM_hist_histname_cmd ) { Action->set_EM_hist_histname(newValue);} 00151 if( command == DM_hist_filename_cmd ) { Action->set_DM_hist_filename(newValue);} 00152 if( command == DM_hist_histname_cmd ) { Action->set_DM_hist_histname(newValue);} 00153 if( command == histo_build_cmd) { Action->BuildHistoFromFile();} 00154 if( command == root_build_cmd) { Action->root_build();} 00155 if( command == ResetGenCmd ) { Action->ResetGen(newValue); } 00156 if( command == ReadCardCmd ) { Action->ReadCard(newValue); } 00157 if( command == InitializeCmd ) { Action->Initialize(); } 00158 }
Definition at line 32 of file PrimaryGeneratorMessenger.hh.
Referenced by SetNewValue().
G4UIcmdWithAString* PrimaryGeneratorMessenger::DirectionMode_cmd [private] |
Definition at line 36 of file PrimaryGeneratorMessenger.hh.
Referenced by PrimaryGeneratorMessenger(), SetNewValue(), and ~PrimaryGeneratorMessenger().
G4UIcmdWithAString* PrimaryGeneratorMessenger::DM_hist_filename_cmd [private] |
Definition at line 40 of file PrimaryGeneratorMessenger.hh.
Referenced by PrimaryGeneratorMessenger(), SetNewValue(), and ~PrimaryGeneratorMessenger().
G4UIcmdWithAString* PrimaryGeneratorMessenger::DM_hist_histname_cmd [private] |
Definition at line 41 of file PrimaryGeneratorMessenger.hh.
Referenced by PrimaryGeneratorMessenger(), SetNewValue(), and ~PrimaryGeneratorMessenger().
G4UIcmdWithAString* PrimaryGeneratorMessenger::EM_hist_filename_cmd [private] |
Definition at line 38 of file PrimaryGeneratorMessenger.hh.
Referenced by PrimaryGeneratorMessenger(), SetNewValue(), and ~PrimaryGeneratorMessenger().
G4UIcmdWithAString* PrimaryGeneratorMessenger::EM_hist_histname_cmd [private] |
Definition at line 39 of file PrimaryGeneratorMessenger.hh.
Referenced by PrimaryGeneratorMessenger(), SetNewValue(), and ~PrimaryGeneratorMessenger().
G4UIcmdWithAString* PrimaryGeneratorMessenger::EnergyMode_cmd [private] |
Definition at line 35 of file PrimaryGeneratorMessenger.hh.
Referenced by PrimaryGeneratorMessenger(), SetNewValue(), and ~PrimaryGeneratorMessenger().
G4UIdirectory* PrimaryGeneratorMessenger::gunDir [private] |
Definition at line 33 of file PrimaryGeneratorMessenger.hh.
Referenced by PrimaryGeneratorMessenger(), and ~PrimaryGeneratorMessenger().
G4UIcmdWithoutParameter* PrimaryGeneratorMessenger::histo_build_cmd [private] |
Definition at line 47 of file PrimaryGeneratorMessenger.hh.
Referenced by PrimaryGeneratorMessenger(), SetNewValue(), and ~PrimaryGeneratorMessenger().
G4UIcmdWithoutParameter* PrimaryGeneratorMessenger::InitializeCmd [private] |
Definition at line 46 of file PrimaryGeneratorMessenger.hh.
Referenced by PrimaryGeneratorMessenger(), SetNewValue(), and ~PrimaryGeneratorMessenger().
G4UIcmdWithAString* PrimaryGeneratorMessenger::PositionMode_cmd [private] |
Definition at line 37 of file PrimaryGeneratorMessenger.hh.
Referenced by PrimaryGeneratorMessenger(), SetNewValue(), and ~PrimaryGeneratorMessenger().
G4UIcmdWithAString* PrimaryGeneratorMessenger::ReadCardCmd [private] |
Definition at line 45 of file PrimaryGeneratorMessenger.hh.
Referenced by PrimaryGeneratorMessenger(), SetNewValue(), and ~PrimaryGeneratorMessenger().
G4UIcmdWithAString* PrimaryGeneratorMessenger::ResetGenCmd [private] |
Definition at line 44 of file PrimaryGeneratorMessenger.hh.
Referenced by PrimaryGeneratorMessenger(), SetNewValue(), and ~PrimaryGeneratorMessenger().
G4UIcmdWithoutParameter* PrimaryGeneratorMessenger::root_build_cmd [private] |
Definition at line 48 of file PrimaryGeneratorMessenger.hh.
Referenced by PrimaryGeneratorMessenger(), SetNewValue(), and ~PrimaryGeneratorMessenger().
G4UIcmdWithAString* PrimaryGeneratorMessenger::root_filename_cmd [private] |
Definition at line 42 of file PrimaryGeneratorMessenger.hh.
Referenced by PrimaryGeneratorMessenger(), SetNewValue(), and ~PrimaryGeneratorMessenger().
G4UIcmdWithAnInteger* PrimaryGeneratorMessenger::root_index_cmd [private] |
Definition at line 34 of file PrimaryGeneratorMessenger.hh.
Referenced by PrimaryGeneratorMessenger(), SetNewValue(), and ~PrimaryGeneratorMessenger().
G4UIcmdWithAString* PrimaryGeneratorMessenger::root_treename_cmd [private] |
Definition at line 43 of file PrimaryGeneratorMessenger.hh.