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 // << 27 /// \file medical/electronScattering2/src/Phys << 28 /// \brief Implementation of the PhysicsListMe << 29 26 30 #include "PhysicsListMessenger.hh" 27 #include "PhysicsListMessenger.hh" 31 28 32 #include "PhysicsList.hh" 29 #include "PhysicsList.hh" 33 << 34 #include "G4UIcmdWithAString.hh" << 35 #include "G4UIdirectory.hh" 30 #include "G4UIdirectory.hh" 36 << 31 #include "G4UIcmdWithADoubleAndUnit.hh" 37 //....oooOO0OOooo........oooOO0OOooo........oo << 32 #include "G4UIcmdWithAString.hh" 38 33 39 PhysicsListMessenger::PhysicsListMessenger(Phy 34 PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys) 40 : G4UImessenger(), fPhysicsList(pPhys), fPLi << 35 :pPhysicsList(pPhys) 41 { << 36 { 42 fPhysDir = new G4UIdirectory("/testem/phys/" << 37 physDir = new G4UIdirectory("/physics/"); 43 fPhysDir->SetGuidance("physics list commands << 38 physDir->SetGuidance("Physics list commands"); 44 << 39 45 fPListCmd = new G4UIcmdWithAString("/testem/ << 40 gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/physics/SetGCut",this); 46 fPListCmd->SetGuidance("Add modula physics l << 41 gammaCutCmd->SetGuidance("Set gamma cut."); 47 fPListCmd->SetParameterName("PList", false); << 42 gammaCutCmd->SetParameterName("Gcut",false); 48 fPListCmd->AvailableForStates(G4State_PreIni << 43 gammaCutCmd->SetUnitCategory("Length"); 49 fPListCmd->SetToBeBroadcasted(false); << 44 gammaCutCmd->SetRange("Gcut>0.0"); >> 45 gammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); >> 46 >> 47 electCutCmd = new G4UIcmdWithADoubleAndUnit("/physics/SetECut",this); >> 48 electCutCmd->SetGuidance("Set electron cut."); >> 49 electCutCmd->SetParameterName("Ecut",false); >> 50 electCutCmd->SetUnitCategory("Length"); >> 51 electCutCmd->SetRange("Ecut>0.0"); >> 52 electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); >> 53 >> 54 protoCutCmd = new G4UIcmdWithADoubleAndUnit("/physics/SetPCut",this); >> 55 protoCutCmd->SetGuidance("Set positron cut."); >> 56 protoCutCmd->SetParameterName("Pcut",false); >> 57 protoCutCmd->SetUnitCategory("Length"); >> 58 protoCutCmd->SetRange("Pcut>0.0"); >> 59 protoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); >> 60 >> 61 allCutCmd = new G4UIcmdWithADoubleAndUnit("/physics/SetCuts",this); >> 62 allCutCmd->SetGuidance("Set cut for all."); >> 63 allCutCmd->SetParameterName("cut",false); >> 64 allCutCmd->SetUnitCategory("Length"); >> 65 allCutCmd->SetRange("cut>0.0"); >> 66 allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); >> 67 >> 68 pListCmd = new G4UIcmdWithAString("/physics/SetList",this); >> 69 pListCmd->SetGuidance("Select physics list."); >> 70 pListCmd->SetParameterName("PList",false); >> 71 pListCmd->AvailableForStates(G4State_PreInit); 50 } 72 } 51 73 52 //....oooOO0OOooo........oooOO0OOooo........oo << 53 << 54 PhysicsListMessenger::~PhysicsListMessenger() 74 PhysicsListMessenger::~PhysicsListMessenger() 55 { 75 { 56 delete fPListCmd; << 76 delete gammaCutCmd; 57 delete fPhysDir; << 77 delete electCutCmd; >> 78 delete protoCutCmd; >> 79 delete allCutCmd; >> 80 delete pListCmd; >> 81 delete physDir; 58 } 82 } 59 83 60 //....oooOO0OOooo........oooOO0OOooo........oo << 84 void PhysicsListMessenger::SetNewValue(G4UIcommand* command, 61 << 85 G4String newValue) 62 void PhysicsListMessenger::SetNewValue(G4UIcom << 86 { 63 { << 87 if( command == gammaCutCmd ) { 64 if (command == fPListCmd) { << 88 pPhysicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue)); 65 fPhysicsList->AddPhysicsList(newValue); << 89 } else if ( command == electCutCmd ) { >> 90 pPhysicsList->SetCutForElectron(electCutCmd->GetNewDoubleValue(newValue)); >> 91 } else if( command == protoCutCmd ) { >> 92 pPhysicsList->SetCutForPositron(protoCutCmd->GetNewDoubleValue(newValue)); >> 93 } else if( command == allCutCmd ) { >> 94 G4double cut = allCutCmd->GetNewDoubleValue(newValue); >> 95 pPhysicsList->SetCutForGamma(cut); >> 96 pPhysicsList->SetCutForElectron(cut); >> 97 pPhysicsList->SetCutForPositron(cut); >> 98 } else if( command == pListCmd ) { >> 99 pPhysicsList->AddPhysicsList(newValue); >> 100 } else { >> 101 G4cerr << "***** Command is not found !!! " << newValue << G4endl; 66 } 102 } 67 } 103 } 68 104 69 //....oooOO0OOooo........oooOO0OOooo........oo << 70 105