Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 /// \file electromagnetic/TestEm2/src/RunActio << 23 // $Id: RunActionMessenger.cc,v 1.2 2004/09/17 10:51:40 maire Exp $ 27 /// \brief Implementation of the RunActionMess << 24 // GEANT4 tag $Name: geant4-07-00-patch-01 $ 28 // << 29 // 25 // 30 //....oooOO0OOooo........oooOO0OOooo........oo 26 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 31 //....oooOO0OOooo........oooOO0OOooo........oo 27 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 32 28 33 #include "RunActionMessenger.hh" 29 #include "RunActionMessenger.hh" 34 30 35 #include "RunAction.hh" 31 #include "RunAction.hh" 36 << 32 #include "G4UIdirectory.hh" 37 #include "G4UIcmdWith3Vector.hh" 33 #include "G4UIcmdWith3Vector.hh" 38 #include "G4UIcmdWithAString.hh" 34 #include "G4UIcmdWithAString.hh" 39 #include "G4UIcmdWithAnInteger.hh" << 40 #include "G4UIdirectory.hh" << 41 35 42 //....oooOO0OOooo........oooOO0OOooo........oo 36 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 43 37 44 RunActionMessenger::RunActionMessenger(RunActi << 38 RunActionMessenger::RunActionMessenger(RunAction* run) >> 39 :Run(run) 45 { 40 { 46 fRunDir = new G4UIdirectory("/testem/run/"); << 41 runDir = new G4UIdirectory("/testem/run/"); 47 fRunDir->SetGuidance("run control"); << 42 runDir->SetGuidance("run control"); 48 << 43 49 fAccCmd = new G4UIcmdWith3Vector("/testem/ru << 44 accCmd = new G4UIcmdWith3Vector("/testem/run/acceptance",this); 50 fAccCmd->SetGuidance("set Edep and RMS"); << 45 accCmd->SetGuidance("set Edep and RMS"); 51 fAccCmd->SetGuidance("acceptance values for << 46 accCmd->SetGuidance("acceptance values for first layer"); 52 fAccCmd->SetParameterName("edep", "rms", "li << 47 accCmd->SetParameterName("edep","rms","limit",true); 53 fAccCmd->SetRange("edep>0 && edep<1 && rms>0 << 48 accCmd->SetRange("edep>0 && edep<1 && rms>0"); 54 fAccCmd->AvailableForStates(G4State_PreInit, << 49 accCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 55 << 50 56 fVerbCmd = new G4UIcmdWithAnInteger("/testem << 51 histoDir = new G4UIdirectory("/testem/histo/"); 57 fVerbCmd->SetGuidance("set verbose level for << 52 histoDir->SetGuidance("histograms control"); 58 fVerbCmd->SetParameterName("verbose", false) << 53 >> 54 factoryCmd = new G4UIcmdWithAString("/testem/histo/setFileName",this); >> 55 factoryCmd->SetGuidance("set name for the histograms file"); >> 56 >> 57 typeCmd = new G4UIcmdWithAString("/testem/histo/setFileType",this); >> 58 typeCmd->SetGuidance("set type (hbook, root, XML) for the histograms file"); >> 59 typeCmd->SetCandidates("hbook root XML"); 59 } 60 } 60 61 61 //....oooOO0OOooo........oooOO0OOooo........oo 62 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 62 63 63 RunActionMessenger::~RunActionMessenger() 64 RunActionMessenger::~RunActionMessenger() 64 { 65 { 65 delete fVerbCmd; << 66 delete accCmd; 66 delete fAccCmd; << 67 delete runDir; 67 delete fRunDir; << 68 delete factoryCmd; >> 69 delete typeCmd; >> 70 delete histoDir; 68 } 71 } 69 72 70 //....oooOO0OOooo........oooOO0OOooo........oo 73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 71 74 72 void RunActionMessenger::SetNewValue(G4UIcomma << 75 void RunActionMessenger::SetNewValue(G4UIcommand* command,G4String newValue) 73 { << 76 { 74 if (command == fAccCmd) { << 77 if (command == accCmd ) 75 fRun->SetEdepAndRMS(fAccCmd->GetNew3Vector << 78 { Run->SetEdepAndRMS(accCmd->GetNew3VectorValue(newValue));} 76 } << 79 77 << 80 if (command == factoryCmd) 78 if (command == fVerbCmd) { << 81 { Run->SetHistoName(newValue);} 79 fRun->SetVerbose(fVerbCmd->GetNewIntValue( << 82 80 } << 83 if (command == typeCmd) >> 84 { Run->SetHistoType(newValue);} 81 } 85 } 82 86 83 //....oooOO0OOooo........oooOO0OOooo........oo 87 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 84 88