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