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