Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 /// \file exoticphysics/monopole/src/RunAction << 26 // $Id: RunActionMessenger.cc,v 1.1 2007/08/16 10:32:04 vnivanch Exp $ 27 /// \brief Implementation of the RunActionMess << 27 // GEANT4 tag $Name: geant4-09-02 $ 28 // << 29 // 28 // 30 //....oooOO0OOooo........oooOO0OOooo........oo 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 31 //....oooOO0OOooo........oooOO0OOooo........oo 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 32 31 33 #include "RunActionMessenger.hh" 32 #include "RunActionMessenger.hh" 34 33 35 #include "RunAction.hh" 34 #include "RunAction.hh" 36 << 37 #include "G4UIcmdWithADouble.hh" << 38 #include "G4UIdirectory.hh" 35 #include "G4UIdirectory.hh" >> 36 #include "G4UIcmdWithADouble.hh" >> 37 #include "G4UIcmdWithAnInteger.hh" >> 38 #include "G4UIcmdWithAString.hh" 39 39 40 //....oooOO0OOooo........oooOO0OOooo........oo 40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 41 41 42 RunActionMessenger::RunActionMessenger(RunActi << 42 RunActionMessenger::RunActionMessenger(RunAction * ra): runaction(ra) 43 : G4UImessenger(), fRunAction(ra), fActDir(0 << 43 { 44 { << 44 actDir = new G4UIdirectory("/testex/run/"); 45 fActDir = new G4UIdirectory("/testex/run/"); << 45 actDir->SetGuidance("run commands"); 46 fActDir->SetGuidance("run commands"); << 46 >> 47 binSizeCmd = new G4UIcmdWithADouble("/testex/run/binSize", this); >> 48 binSizeCmd->SetGuidance("Set bin size."); >> 49 binSizeCmd->SetParameterName("binSize", false); >> 50 binSizeCmd->AvailableForStates(G4State_PreInit, G4State_Idle); >> 51 >> 52 verboseCmd = new G4UIcmdWithAnInteger("/testex/run/verbose", this); >> 53 verboseCmd->SetGuidance("Set verbose level."); >> 54 verboseCmd->SetParameterName("verbose", false); >> 55 verboseCmd->AvailableForStates(G4State_PreInit, G4State_Idle); >> 56 >> 57 histoNameCmd = new G4UIcmdWithAString("/testex/run/HistoName", this); >> 58 histoNameCmd->SetGuidance("Set histo file name."); >> 59 histoNameCmd->SetParameterName("histoName", false); >> 60 histoNameCmd->AvailableForStates(G4State_PreInit, G4State_Idle); >> 61 >> 62 histoTypeCmd = new G4UIcmdWithAString("/testex/run/HistoType", this); >> 63 histoTypeCmd->SetGuidance("Set histo file type."); >> 64 histoTypeCmd->SetParameterName("histoType", false); >> 65 histoTypeCmd->AvailableForStates(G4State_PreInit, G4State_Idle); 47 66 48 fBinSizeCmd = new G4UIcmdWithADouble("/teste << 49 fBinSizeCmd->SetGuidance("Set bin size."); << 50 fBinSizeCmd->SetParameterName("binSize", fal << 51 fBinSizeCmd->AvailableForStates(G4State_PreI << 52 } 67 } 53 68 54 //....oooOO0OOooo........oooOO0OOooo........oo << 55 69 >> 70 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 56 RunActionMessenger::~RunActionMessenger() 71 RunActionMessenger::~RunActionMessenger() 57 { 72 { 58 delete fBinSizeCmd; << 73 delete binSizeCmd; 59 delete fActDir; << 74 delete verboseCmd; >> 75 delete histoNameCmd; >> 76 delete histoTypeCmd; 60 } 77 } 61 78 >> 79 62 //....oooOO0OOooo........oooOO0OOooo........oo 80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 81 void RunActionMessenger::SetNewValue(G4UIcommand* command,G4String newValue) >> 82 { >> 83 >> 84 if( command == binSizeCmd ) >> 85 { runaction->SetBinSize(binSizeCmd->GetNewDoubleValue(newValue));} >> 86 >> 87 if( command == verboseCmd ) >> 88 { runaction->SetVerbose(verboseCmd->GetNewIntValue(newValue));} >> 89 >> 90 if( command == histoNameCmd ) >> 91 { runaction->SetHistoName(newValue);} >> 92 >> 93 if( command == histoTypeCmd ) >> 94 { runaction->SetHistoType(newValue);} 63 95 64 void RunActionMessenger::SetNewValue(G4UIcomma << 65 { << 66 if (command == fBinSizeCmd) { << 67 fRunAction->SetBinSize(fBinSizeCmd->GetNew << 68 } << 69 } 96 } 70 97 71 //....oooOO0OOooo........oooOO0OOooo........oo 98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 72 99