00001 // 00002 // $Id: PrimaryGeneratorMessenger.cc 157 2008-09-12 12:30:03Z jacquem $ 00003 // 00004 // PrimaryGeneratorMessenger.cc 00005 // 00006 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00007 00008 #include "PrimaryGeneratorMessenger.hh" 00009 00010 #include "PrimaryGeneratorAction.hh" 00011 #include "G4UIdirectory.hh" 00012 #include "G4UIcmdWithAString.hh" 00013 00014 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00015 00016 PrimaryGeneratorMessenger::PrimaryGeneratorMessenger( 00017 PrimaryGeneratorAction* gun) 00018 :m_action(gun) 00019 { 00020 m_gunDir = new G4UIdirectory("/tutorial/gun/"); 00021 m_gunDir->SetGuidance("PrimaryGenerator control"); 00022 00023 m_rndmCmd = new G4UIcmdWithAString("/tutorial/gun/rndm",this); 00024 m_rndmCmd->SetGuidance("Shoot randomly the incident particle."); 00025 m_rndmCmd->SetGuidance("Choice : on, off"); 00026 m_rndmCmd->SetCandidates("on off"); 00027 m_rndmCmd->SetParameterName("flag",false); 00028 } 00029 00030 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00031 00032 PrimaryGeneratorMessenger::~PrimaryGeneratorMessenger() 00033 { 00034 delete m_rndmCmd; 00035 } 00036 00037 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00038 00039 void PrimaryGeneratorMessenger::SetNewValue(G4UIcommand* command, 00040 G4String newValue) 00041 { 00042 if( command == m_rndmCmd ) 00043 { m_action->SetRndmFlag(newValue);} 00044 } 00045 00046 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00047