Geant4 Cross Reference |
1 // 2 // ******************************************************************** 3 // * License and Disclaimer * 4 // * * 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. * 10 // * * 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitation of liability. * 17 // * * 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************************************** 25 // 26 // Code developed by: 27 // S.Larsson 28 // 29 // ******************************** 30 // * * 31 // * PurgMagPhysicsList.cc * 32 // * * 33 // ******************************** 34 // 35 36 #include "PurgMagPhysicsList.hh" 37 #include "G4SystemOfUnits.hh" 38 #include "G4ParticleDefinition.hh" 39 #include "G4ParticleWithCuts.hh" 40 #include "G4ProcessManager.hh" 41 #include "G4ParticleTypes.hh" 42 #include "G4ParticleTable.hh" 43 #include "G4Material.hh" 44 #include "G4UnitsTable.hh" 45 #include "G4ios.hh" 46 #include "G4EmStandardPhysics_option4.hh" 47 #include "G4VPhysicsConstructor.hh" 48 #include "G4DecayPhysics.hh" 49 50 PurgMagPhysicsList::PurgMagPhysicsList(): G4VUserPhysicsList() 51 { 52 defaultCutValue = 1*micrometer; 53 cutForGamma = defaultCutValue; 54 cutForElectron = defaultCutValue; 55 cutForPositron = defaultCutValue; 56 cutForProton = defaultCutValue; 57 58 fEmPhysicsList = new G4EmStandardPhysics_option4(); 59 fDecPhysicsList = new G4DecayPhysics(); 60 SetVerboseLevel(1); 61 } 62 63 PurgMagPhysicsList::~PurgMagPhysicsList() 64 { 65 delete fDecPhysicsList; 66 delete fEmPhysicsList; 67 } 68 69 void PurgMagPhysicsList::ConstructParticle() 70 { 71 fDecPhysicsList -> ConstructParticle(); 72 } 73 74 void PurgMagPhysicsList::ConstructProcess() 75 { 76 AddTransportation(); 77 fEmPhysicsList -> ConstructProcess(); 78 79 // Deexcitation 80 // Both Fluorescence and Auger e- emission activated 81 //G4VAtomDeexcitation* de = new G4UAtomicDeexcitation(); 82 //G4LossTableManager::Instance()->SetAtomDeexcitation(de); 83 //de -> SetFluo(true); 84 //de -> SetAuger(true); 85 } 86 87 void PurgMagPhysicsList::SetCuts() 88 { 89 if (verboseLevel >0){ 90 G4cout << "PurgMagPhysicsList::SetCuts:"; 91 G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl; 92 } 93 94 // set cut values for gamma at first and for e- second and next for e+, 95 // because some processes for e+/e- need cut values for gamma 96 SetCutValue(cutForGamma, "gamma"); 97 SetCutValue(cutForElectron, "e-"); 98 SetCutValue(cutForPositron, "e+"); 99 100 // set cut values for proton and anti_proton before all other hadrons 101 // because some processes for hadrons need cut values for proton/anti_proton 102 SetCutValue(cutForProton, "proton"); 103 SetCutValue(cutForProton, "anti_proton"); 104 105 // SetCutValueForOthers(defaultCutValue); 106 107 if (verboseLevel>0) DumpCutValuesTable(); 108 } 109 110 void PurgMagPhysicsList::SetGammaLowLimit(G4double lowcut) 111 { 112 if (verboseLevel >0){ 113 G4cout << "PurgMagPhysicsList::SetCuts:"; 114 G4cout << "Gamma cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; 115 } 116 117 // G4Gamma::SetEnergyRange(lowcut,1e5); 118 SetGELowLimit(lowcut); 119 } 120 121 void PurgMagPhysicsList::SetElectronLowLimit(G4double lowcut) 122 { 123 if (verboseLevel >0){ 124 125 G4cout << "PurgMagPhysicsList::SetCuts:"; 126 G4cout << "Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; 127 } 128 129 // G4Electron::SetEnergyRange(lowcut,1e5); 130 SetGELowLimit(lowcut); 131 } 132 133 void PurgMagPhysicsList::SetPositronLowLimit(G4double lowcut) 134 { 135 if (verboseLevel >0){ 136 137 G4cout << "PurgMagPhysicsList::SetCuts:"; 138 G4cout << "Positron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; 139 } 140 141 G4cerr << "PurgMagPhysicsList::SetPositronLowLimit: Not currently able to set Positron LowLimit." << G4endl; 142 G4Exception("PurgMagPhysicsList::SetPositronLowLimit()","PurMag001", 143 FatalException,"Positron Low Limit: not implemented in PurgMagPhysicsList"); 144 // 145 // G4Positron::SetEnergyRange(lowcut,1e5); 146 } 147 148 149 void PurgMagPhysicsList::SetProtonLowLimit(G4double lowcut) 150 { 151 if (verboseLevel >0){ 152 153 G4cout << "PurgMagPhysicsList::SetCuts:"; 154 G4cout << "Proton cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; 155 } 156 157 G4cerr << "PurgMagPhysicsList::SetProtonLowLimit: Not currently able to set Proton LowLimit." << G4endl; 158 G4Exception("PurgMagPhysicsList::SetProtonLowLimit()","PurMag002", 159 FatalException,"Proton Low Limit: not implemented in PurgMagPhysicsList"); 160 // 161 // G4Proton::SetEnergyRange(lowcut,1e5); 162 // G4AntiProton::SetEnergyRange(lowcut,1e5); 163 } 164 165 void PurgMagPhysicsList::SetGEPLowLimit(G4double lowcut) 166 { 167 if (verboseLevel >0){ 168 G4cout << "PurgMagPhysicsList::SetGEPLowLimit:"; 169 G4cout << "Gamma and Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; 170 } 171 172 // G4Gamma::SetEnergyRange(lowcut,1e5); 173 // G4Electron::SetEnergyRange(lowcut,1e5); 174 // G4Positron::SetEnergyRange(lowcut,1e5); 175 this->SetGELowLimit(lowcut); 176 177 G4cerr << " SetGEPLowLimit : Uncertain whether setting Positron low limit " << G4endl; 178 } 179 180 void PurgMagPhysicsList::SetGELowLimit(G4double lowcut) 181 { 182 if (verboseLevel >0){ 183 G4cout << "PurgMagPhysicsList::SetGELowLimit:"; 184 G4cout << "Gamma and Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; 185 } 186 187 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(lowcut,1e5); 188 } 189 void PurgMagPhysicsList::SetGammaCut(G4double val) 190 { 191 cutForGamma = val; 192 } 193 194 void PurgMagPhysicsList::SetElectronCut(G4double val) 195 { 196 cutForElectron = val; 197 } 198 199 void PurgMagPhysicsList::SetPositronCut(G4double val) 200 { 201 cutForPositron = val; 202 } 203 204 void PurgMagPhysicsList::SetProtonCut(G4double val) 205 { 206 cutForProton = val; 207 } 208 209 210 211 212 213 214