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 electromagnetic/TestEm9/src/PhysicsL << 27 /// \brief Implementation of the PhysicsListMe << 28 // << 29 // 26 // >> 27 // $Id: PhysicsListMessenger.cc,v 1.3 2006/06/29 17:03:43 gunter Exp $ >> 28 // GEANT4 tag $Name: geant4-08-01 $ 30 // 29 // >> 30 // 31 31 32 //....oooOO0OOooo........oooOO0OOooo........oo 32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 33 //....oooOO0OOooo........oooOO0OOooo........oo 33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 34 34 35 #include "PhysicsListMessenger.hh" 35 #include "PhysicsListMessenger.hh" 36 36 37 #include "PhysicsList.hh" 37 #include "PhysicsList.hh" 38 << 39 #include "G4UIcmdWithABool.hh" << 40 #include "G4UIcmdWithADoubleAndUnit.hh" 38 #include "G4UIcmdWithADoubleAndUnit.hh" 41 #include "G4UIcmdWithAString.hh" 39 #include "G4UIcmdWithAString.hh" >> 40 #include "G4UIcmdWithABool.hh" 42 41 43 //....oooOO0OOooo........oooOO0OOooo........oo 42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 44 43 45 PhysicsListMessenger::PhysicsListMessenger(Phy 44 PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys) 46 : G4UImessenger(), fPhysicsList(pPhys) << 45 :pPhysicsList(pPhys) 47 { << 46 { 48 fListCmd = new G4UIcmdWithAString("/testem/p << 47 gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setGCut",this); 49 fListCmd->SetGuidance("Add modula physics li << 48 gammaCutCmd->SetGuidance("Set gamma cut."); 50 fListCmd->SetParameterName("PList", false); << 49 gammaCutCmd->SetParameterName("Gcut",false); 51 fListCmd->AvailableForStates(G4State_PreInit << 50 gammaCutCmd->SetUnitCategory("Length"); >> 51 gammaCutCmd->SetRange("Gcut>0.0"); >> 52 gammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); >> 53 >> 54 electCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setECut",this); >> 55 electCutCmd->SetGuidance("Set electron cut."); >> 56 electCutCmd->SetParameterName("Ecut",false); >> 57 electCutCmd->SetUnitCategory("Length"); >> 58 electCutCmd->SetRange("Ecut>0.0"); >> 59 electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); >> 60 >> 61 protoCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setPCut",this); >> 62 protoCutCmd->SetGuidance("Set positron cut."); >> 63 protoCutCmd->SetParameterName("Pcut",false); >> 64 protoCutCmd->SetUnitCategory("Length"); >> 65 protoCutCmd->SetRange("Pcut>0.0"); >> 66 protoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); >> 67 >> 68 allCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/setCuts",this); >> 69 allCutCmd->SetGuidance("Set cut for all."); >> 70 allCutCmd->SetParameterName("cut",false); >> 71 allCutCmd->SetUnitCategory("Length"); >> 72 allCutCmd->SetRange("cut>0.0"); >> 73 allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); >> 74 >> 75 eCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/VertexCuts",this); >> 76 eCutCmd->SetGuidance("Set cuts for the Vertex Detector"); >> 77 eCutCmd->SetParameterName("Ecut",false); >> 78 eCutCmd->SetUnitCategory("Length"); >> 79 eCutCmd->SetRange("Ecut>0.0"); >> 80 eCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); >> 81 >> 82 mCutCmd = new G4UIcmdWithADoubleAndUnit("/testem/phys/MuonCuts",this); >> 83 mCutCmd->SetGuidance("Set cuts for the Muon Detector"); >> 84 mCutCmd->SetParameterName("Ecut",false); >> 85 mCutCmd->SetUnitCategory("Length"); >> 86 mCutCmd->SetRange("Ecut>0.0"); >> 87 mCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle); >> 88 >> 89 pListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics",this); >> 90 pListCmd->SetGuidance("Add modula physics list."); >> 91 pListCmd->SetParameterName("PList",false); >> 92 pListCmd->AvailableForStates(G4State_PreInit); >> 93 >> 94 mscCmd = new G4UIcmdWithABool("/testem/phys/mscStepLimit",this); >> 95 mscCmd->SetGuidance("Activate Multiple Scattering step limit"); >> 96 mscCmd->SetParameterName("PList",false); >> 97 mscCmd->AvailableForStates(G4State_PreInit); 52 } 98 } 53 99 54 //....oooOO0OOooo........oooOO0OOooo........oo 100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 55 101 56 PhysicsListMessenger::~PhysicsListMessenger() 102 PhysicsListMessenger::~PhysicsListMessenger() 57 { 103 { 58 delete fListCmd; << 104 delete gammaCutCmd; >> 105 delete electCutCmd; >> 106 delete protoCutCmd; >> 107 delete allCutCmd; >> 108 delete pListCmd; >> 109 delete eCutCmd; >> 110 delete mCutCmd; >> 111 delete mscCmd; 59 } 112 } 60 113 61 //....oooOO0OOooo........oooOO0OOooo........oo 114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 62 115 63 void PhysicsListMessenger::SetNewValue(G4UIcom << 116 void PhysicsListMessenger::SetNewValue(G4UIcommand* command, >> 117 G4String newValue) 64 { 118 { 65 if (command == fListCmd) { << 119 if( command == gammaCutCmd ) 66 fPhysicsList->AddPhysicsList(newValue); << 120 { pPhysicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue));} 67 } << 121 >> 122 if( command == electCutCmd ) >> 123 { pPhysicsList->SetCutForElectron(electCutCmd->GetNewDoubleValue(newValue));} >> 124 >> 125 if( command == protoCutCmd ) >> 126 { pPhysicsList->SetCutForPositron(protoCutCmd->GetNewDoubleValue(newValue));} >> 127 >> 128 if( command == allCutCmd ) >> 129 { >> 130 G4double cut = allCutCmd->GetNewDoubleValue(newValue); >> 131 pPhysicsList->SetCutForGamma(cut); >> 132 pPhysicsList->SetCutForElectron(cut); >> 133 pPhysicsList->SetCutForPositron(cut); >> 134 } >> 135 >> 136 if( command == eCutCmd ) >> 137 { pPhysicsList->SetVertexCut(eCutCmd->GetNewDoubleValue(newValue));} >> 138 >> 139 if( command == mCutCmd ) >> 140 { pPhysicsList->SetMuonCut(mCutCmd->GetNewDoubleValue(newValue));} >> 141 >> 142 if( command == pListCmd ) >> 143 { pPhysicsList->AddPhysicsList(newValue);} >> 144 >> 145 if( command == mscCmd ) >> 146 { pPhysicsList->SetMscStepLimit(mscCmd->GetNewBoolValue(newValue));} 68 } 147 } 69 148 70 //....oooOO0OOooo........oooOO0OOooo........oo 149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 71 150