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 PhysicsListMessenger.cc << 23 // $Id: PhysicsListMessenger.cc,v 1.2 2004/10/20 14:32:36 maire Exp $ 27 /// \brief Implementation of the PhysicsListMe << 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 "PhysicsListMessenger.hh" 29 #include "PhysicsListMessenger.hh" 34 30 35 #include "PhysicsList.hh" 31 #include "PhysicsList.hh" 36 << 37 #include "G4UIcmdWithAString.hh" << 38 #include "G4UIdirectory.hh" 32 #include "G4UIdirectory.hh" >> 33 #include "G4UIcmdWithADoubleAndUnit.hh" >> 34 #include "G4UIcmdWithAString.hh" 39 35 40 //....oooOO0OOooo........oooOO0OOooo........oo 36 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 41 37 42 PhysicsListMessenger::PhysicsListMessenger(Phy << 38 PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys) >> 39 :pPhysicsList(pPhys) 43 { 40 { 44 fPhysDir = new G4UIdirectory("/testem/phys/" << 41 physDir = new G4UIdirectory("/testem/phys/"); 45 fPhysDir->SetGuidance("physics list commands << 42 physDir->SetGuidance("physics list commands"); 46 << 43 47 fListCmd = new G4UIcmdWithAString("/testem/p << 44 gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setGCut",this); 48 fListCmd->SetGuidance("Add modula physics li << 45 gammaCutCmd->SetGuidance("Set gamma cut."); 49 fListCmd->SetParameterName("PList", false); << 46 gammaCutCmd->SetParameterName("Gcut",false); 50 fListCmd->AvailableForStates(G4State_PreInit << 47 gammaCutCmd->SetUnitCategory("Length"); 51 fListCmd->SetToBeBroadcasted(false); << 48 gammaCutCmd->SetRange("Gcut>0.0"); >> 49 gammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); >> 50 >> 51 electCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setECut",this); >> 52 electCutCmd->SetGuidance("Set electron cut."); >> 53 electCutCmd->SetParameterName("Ecut",false); >> 54 electCutCmd->SetUnitCategory("Length"); >> 55 electCutCmd->SetRange("Ecut>0.0"); >> 56 electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); >> 57 >> 58 protoCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setPCut",this); >> 59 protoCutCmd->SetGuidance("Set positron cut."); >> 60 protoCutCmd->SetParameterName("Pcut",false); >> 61 protoCutCmd->SetUnitCategory("Length"); >> 62 protoCutCmd->SetRange("Pcut>0.0"); >> 63 protoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); >> 64 >> 65 allCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setCuts",this); >> 66 allCutCmd->SetGuidance("Set cut for all."); >> 67 allCutCmd->SetParameterName("cut",false); >> 68 allCutCmd->SetUnitCategory("Length"); >> 69 allCutCmd->SetRange("cut>0.0"); >> 70 allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); >> 71 >> 72 pListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this); >> 73 pListCmd->SetGuidance("Add modula physics list."); >> 74 pListCmd->SetParameterName("PList",false); >> 75 pListCmd->AvailableForStates(G4State_PreInit); 52 } 76 } 53 77 54 //....oooOO0OOooo........oooOO0OOooo........oo 78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 55 79 56 PhysicsListMessenger::~PhysicsListMessenger() 80 PhysicsListMessenger::~PhysicsListMessenger() 57 { 81 { 58 delete fListCmd; << 82 delete gammaCutCmd; 59 delete fPhysDir; << 83 delete electCutCmd; >> 84 delete protoCutCmd; >> 85 delete allCutCmd; >> 86 delete pListCmd; >> 87 delete physDir; 60 } 88 } 61 89 62 //....oooOO0OOooo........oooOO0OOooo........oo 90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 63 91 64 void PhysicsListMessenger::SetNewValue(G4UIcom << 92 void PhysicsListMessenger::SetNewValue(G4UIcommand* command, 65 { << 93 G4String newValue) 66 if (command == fListCmd) { << 94 { 67 fPhysicsList->AddPhysicsList(newValue); << 95 if( command == gammaCutCmd ) 68 } << 96 { pPhysicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue));} >> 97 >> 98 if( command == electCutCmd ) >> 99 { pPhysicsList->SetCutForElectron(electCutCmd->GetNewDoubleValue(newValue));} >> 100 >> 101 if( command == protoCutCmd ) >> 102 { pPhysicsList->SetCutForPositron(protoCutCmd->GetNewDoubleValue(newValue));} >> 103 >> 104 if( command == allCutCmd ) >> 105 { >> 106 G4double cut = allCutCmd->GetNewDoubleValue(newValue); >> 107 pPhysicsList->SetCutForGamma(cut); >> 108 pPhysicsList->SetCutForElectron(cut); >> 109 pPhysicsList->SetCutForPositron(cut); >> 110 } >> 111 >> 112 if( command == pListCmd ) >> 113 { pPhysicsList->AddPhysicsList(newValue);} 69 } 114 } 70 115 71 //....oooOO0OOooo........oooOO0OOooo........oo 116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 72 117