00001 // **************************************************** 00002 // * * 00003 // * MollerFieldMessenger to change values of * 00004 // * field map names and scale factors. * 00005 // * * 00006 // * Added 8-31-2011 by Juliette Mammei * 00007 // * * 00008 // **************************************************** 00009 00010 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00011 00012 #include "MollerGlobalMagnetFieldMessenger.hh" 00013 00014 #include "MollerGlobalMagnetField.hh" 00015 00016 #include "G4UImessenger.hh" 00017 #include "G4UIdirectory.hh" 00018 #include "G4UIcmdWithAString.hh" 00019 00020 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00021 00022 MollerGlobalMagnetFieldMessenger::MollerGlobalMagnetFieldMessenger(MollerGlobalMagnetField* myField) 00023 :setField(myField) 00024 { 00025 fieldDir = new G4UIdirectory("/moller/field/"); 00026 fieldDir->SetGuidance("Magnet field control."); 00027 00028 hybridFileCmd = new G4UIcmdWithAString("/moller/field/setHybridMap",this); 00029 hybridFileCmd->SetGuidance("Set the hybrid field map file name."); 00030 hybridFileCmd->SetParameterName("hybridFilename",true); 00031 hybridFileCmd->SetDefaultValue("blockyHybrid_3.0"); 00032 //hybridFileCmd->AvailableForStates(G4State_Init); 00033 //hybridFileCmd->AvailableForStates(G4State_PreInit,G4State_Idle, G4State_GeomClosed); 00034 00035 upstreamFileCmd = new G4UIcmdWithAString("/moller/field/setUpstreamMap",this); 00036 upstreamFileCmd->SetGuidance("Set the upstream field map file name."); 00037 upstreamFileCmd->SetParameterName("upstreamFilename",true); 00038 upstreamFileCmd->SetDefaultValue("blockyUpstream_1.1"); 00039 //upstreamFileCmd->AvailableForStates(G4State_Init); 00040 //upstreamFileCmd->AvailableForStates(G4State_PreInit,G4State_Idle, G4State_GeomClosed); 00041 00042 } 00043 00044 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00045 00046 MollerGlobalMagnetFieldMessenger::~MollerGlobalMagnetFieldMessenger() 00047 { 00048 delete hybridFileCmd; 00049 delete upstreamFileCmd; 00050 00051 delete fieldDir; 00052 } 00053 00054 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 00055 00056 void MollerGlobalMagnetFieldMessenger::SetNewValue(G4UIcommand* command, G4String newValue) 00057 { 00058 if (command == hybridFileCmd) 00059 { setField->SetHybridMapFile(newValue); } 00060 else if (command == upstreamFileCmd) 00061 { setField->SetUpstreamMapFile(newValue); } 00062 } 00063 00064 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......