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/TestEm6/src/PhysicsL << 23 // $Id: PhysicsListMessenger.cc,v 1.6 2004/09/27 09:35:38 maire Exp $ 27 /// \brief Implementation of the PhysicsListMe << 24 // GEANT4 tag $Name: geant4-08-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 "G4UIcmdWithADouble.hh" << 38 #include "G4UIcmdWithAString.hh" << 39 #include "G4UIdirectory.hh" 32 #include "G4UIdirectory.hh" >> 33 #include "G4UIcmdWithADouble.hh" 40 34 41 //....oooOO0OOooo........oooOO0OOooo........oo 35 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 42 36 43 PhysicsListMessenger::PhysicsListMessenger(Phy 37 PhysicsListMessenger::PhysicsListMessenger(PhysicsList* physL) 44 : G4UImessenger(), << 38 :physList(physL) 45 fPhysList(physL), << 46 fPhysDir(0), << 47 fGammaToMuPairFacCmd(0), << 48 fAnnihiToMuPairFacCmd(0), << 49 fAnnihiToHadronFacCmd(0), << 50 fListCmd(0) << 51 { 39 { 52 fPhysDir = new G4UIdirectory("/testem/phys/" << 40 physDir = new G4UIdirectory("/testem/phys/"); 53 fPhysDir->SetGuidance("physics list commands << 41 physDir->SetGuidance("physics list commands"); 54 << 42 55 fGammaToMuPairFacCmd = new G4UIcmdWithADoubl << 43 GammaToMuPairFac=new G4UIcmdWithADouble 56 fGammaToMuPairFacCmd->SetGuidance( << 44 ("/testem/phys/SetGammaToMuPairFac",this); 57 "Set factor to artificially increase the G << 45 GammaToMuPairFac->SetGuidance( 58 fGammaToMuPairFacCmd->SetParameterName("Gamm << 46 "Set factor to artificially increase the GammaToMuPair cross section"); 59 fGammaToMuPairFacCmd->SetRange("GammaToMuPai << 47 GammaToMuPairFac->SetParameterName("GammaToMuPairFac",false); 60 fGammaToMuPairFacCmd->AvailableForStates(G4S << 48 GammaToMuPairFac->SetRange("GammaToMuPairFac>0.0"); 61 << 49 GammaToMuPairFac->AvailableForStates(G4State_PreInit,G4State_Idle); 62 fAnnihiToMuPairFacCmd = new G4UIcmdWithADoub << 50 63 fAnnihiToMuPairFacCmd->SetGuidance( << 51 AnnihiToMuPairFac=new G4UIcmdWithADouble 64 "Set factor to artificially increase the A << 52 ("/testem/phys/SetAnnihiToMuPairFac",this); 65 fAnnihiToMuPairFacCmd->SetParameterName("Ann << 53 AnnihiToMuPairFac->SetGuidance( 66 fAnnihiToMuPairFacCmd->SetRange("AnnihiToMuP << 54 "Set factor to artificially increase the AnnihiToMuPair cross section"); 67 fAnnihiToMuPairFacCmd->AvailableForStates(G4 << 55 AnnihiToMuPairFac->SetParameterName("AnnihiToMuPairFac",false); 68 << 56 AnnihiToMuPairFac->SetRange("AnnihiToMuPairFac>0.0"); 69 fAnnihiToHadronFacCmd = new G4UIcmdWithADoub << 57 AnnihiToMuPairFac->AvailableForStates(G4State_PreInit,G4State_Idle); 70 fAnnihiToHadronFacCmd->SetGuidance( << 71 "Set factor to artificially increase the A << 72 fAnnihiToHadronFacCmd->SetParameterName("Ann << 73 fAnnihiToHadronFacCmd->SetRange("AnnihiToHad << 74 fAnnihiToHadronFacCmd->AvailableForStates(G4 << 75 << 76 fListCmd = new G4UIcmdWithAString("/testem/p << 77 fListCmd->SetGuidance("Add modula physics li << 78 fListCmd->SetParameterName("PList", false); << 79 fListCmd->AvailableForStates(G4State_PreInit << 80 } 58 } 81 59 82 //....oooOO0OOooo........oooOO0OOooo........oo 60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 83 61 84 PhysicsListMessenger::~PhysicsListMessenger() 62 PhysicsListMessenger::~PhysicsListMessenger() 85 { 63 { 86 delete fGammaToMuPairFacCmd; << 64 delete GammaToMuPairFac; 87 delete fAnnihiToMuPairFacCmd; << 65 delete AnnihiToMuPairFac; 88 delete fAnnihiToHadronFacCmd; << 66 delete physDir; 89 delete fPhysDir; << 90 delete fListCmd; << 91 } 67 } 92 68 93 //....oooOO0OOooo........oooOO0OOooo........oo 69 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 94 70 95 void PhysicsListMessenger::SetNewValue(G4UIcom << 71 void PhysicsListMessenger::SetNewValue(G4UIcommand* command, 96 { << 72 G4String newValue) 97 if (command == fGammaToMuPairFacCmd) { << 73 { 98 fPhysList->SetGammaToMuPairFac(fGammaToMuP << 74 if(command == GammaToMuPairFac) 99 } << 75 { physList->SetGammaToMuPairFac( 100 << 76 GammaToMuPairFac->GetNewDoubleValue(newValue));} 101 if (command == fAnnihiToMuPairFacCmd) { << 77 102 fPhysList->SetAnnihiToMuPairFac(fAnnihiToM << 78 if( command == AnnihiToMuPairFac) 103 } << 79 { physList->SetAnnihiToMuPairFac( 104 << 80 AnnihiToMuPairFac->GetNewDoubleValue(newValue));} 105 if (command == fAnnihiToHadronFacCmd) { << 106 fPhysList->SetAnnihiToHadronFac(fAnnihiToH << 107 } << 108 << 109 if (command == fListCmd) { << 110 fPhysList->AddPhysicsList(newValue); << 111 } << 112 } 81 } 113 82 114 //....oooOO0OOooo........oooOO0OOooo........oo 83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 115 84