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 // Code developed by: 26 // Code developed by: 27 // S.Larsson 27 // S.Larsson 28 // 28 // 29 // ******************************** 29 // ******************************** 30 // * * 30 // * * 31 // * PurgMagPhysicsList.cc * 31 // * PurgMagPhysicsList.cc * 32 // * * 32 // * * 33 // ******************************** 33 // ******************************** 34 // 34 // 35 35 36 #include "PurgMagPhysicsList.hh" 36 #include "PurgMagPhysicsList.hh" 37 #include "G4SystemOfUnits.hh" 37 #include "G4SystemOfUnits.hh" 38 #include "G4ParticleDefinition.hh" 38 #include "G4ParticleDefinition.hh" 39 #include "G4ParticleWithCuts.hh" 39 #include "G4ParticleWithCuts.hh" 40 #include "G4ProcessManager.hh" 40 #include "G4ProcessManager.hh" 41 #include "G4ParticleTypes.hh" 41 #include "G4ParticleTypes.hh" 42 #include "G4ParticleTable.hh" 42 #include "G4ParticleTable.hh" 43 #include "G4Material.hh" 43 #include "G4Material.hh" 44 #include "G4UnitsTable.hh" 44 #include "G4UnitsTable.hh" 45 #include "G4ios.hh" 45 #include "G4ios.hh" 46 #include "G4EmStandardPhysics_option4.hh" 46 #include "G4EmStandardPhysics_option4.hh" 47 #include "G4VPhysicsConstructor.hh" 47 #include "G4VPhysicsConstructor.hh" 48 #include "G4DecayPhysics.hh" 48 #include "G4DecayPhysics.hh" 49 49 50 PurgMagPhysicsList::PurgMagPhysicsList(): G4V 50 PurgMagPhysicsList::PurgMagPhysicsList(): G4VUserPhysicsList() 51 { 51 { 52 defaultCutValue = 1*micrometer; 52 defaultCutValue = 1*micrometer; 53 cutForGamma = defaultCutValue; 53 cutForGamma = defaultCutValue; 54 cutForElectron = defaultCutValue; 54 cutForElectron = defaultCutValue; 55 cutForPositron = defaultCutValue; 55 cutForPositron = defaultCutValue; 56 cutForProton = defaultCutValue; 56 cutForProton = defaultCutValue; 57 57 58 fEmPhysicsList = new G4EmStandardPhysics_opt 58 fEmPhysicsList = new G4EmStandardPhysics_option4(); 59 fDecPhysicsList = new G4DecayPhysics(); 59 fDecPhysicsList = new G4DecayPhysics(); 60 SetVerboseLevel(1); 60 SetVerboseLevel(1); 61 } 61 } 62 62 63 PurgMagPhysicsList::~PurgMagPhysicsList() 63 PurgMagPhysicsList::~PurgMagPhysicsList() 64 { 64 { 65 delete fDecPhysicsList; 65 delete fDecPhysicsList; 66 delete fEmPhysicsList; 66 delete fEmPhysicsList; 67 } 67 } 68 68 69 void PurgMagPhysicsList::ConstructParticle() 69 void PurgMagPhysicsList::ConstructParticle() 70 { 70 { 71 fDecPhysicsList -> ConstructParticle(); 71 fDecPhysicsList -> ConstructParticle(); 72 } 72 } 73 73 74 void PurgMagPhysicsList::ConstructProcess() 74 void PurgMagPhysicsList::ConstructProcess() 75 { 75 { 76 AddTransportation(); 76 AddTransportation(); 77 fEmPhysicsList -> ConstructProcess(); 77 fEmPhysicsList -> ConstructProcess(); 78 78 79 // Deexcitation 79 // Deexcitation 80 // Both Fluorescence and Auger e- emission act 80 // Both Fluorescence and Auger e- emission activated 81 //G4VAtomDeexcitation* de = new G4UAtomicDeexc 81 //G4VAtomDeexcitation* de = new G4UAtomicDeexcitation(); 82 //G4LossTableManager::Instance()->SetAtomDeexc 82 //G4LossTableManager::Instance()->SetAtomDeexcitation(de); 83 //de -> SetFluo(true); 83 //de -> SetFluo(true); 84 //de -> SetAuger(true); 84 //de -> SetAuger(true); 85 } 85 } 86 86 87 void PurgMagPhysicsList::SetCuts() 87 void PurgMagPhysicsList::SetCuts() 88 { 88 { 89 if (verboseLevel >0){ 89 if (verboseLevel >0){ 90 G4cout << "PurgMagPhysicsList::SetCuts:"; 90 G4cout << "PurgMagPhysicsList::SetCuts:"; 91 G4cout << "CutLength : " << G4BestUnit(def 91 G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl; 92 } 92 } 93 93 94 // set cut values for gamma at first and for 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 95 // because some processes for e+/e- need cut values for gamma 96 SetCutValue(cutForGamma, "gamma"); 96 SetCutValue(cutForGamma, "gamma"); 97 SetCutValue(cutForElectron, "e-"); 97 SetCutValue(cutForElectron, "e-"); 98 SetCutValue(cutForPositron, "e+"); 98 SetCutValue(cutForPositron, "e+"); 99 99 100 // set cut values for proton and anti_proton 100 // set cut values for proton and anti_proton before all other hadrons 101 // because some processes for hadrons need c 101 // because some processes for hadrons need cut values for proton/anti_proton 102 SetCutValue(cutForProton, "proton"); 102 SetCutValue(cutForProton, "proton"); 103 SetCutValue(cutForProton, "anti_proton"); 103 SetCutValue(cutForProton, "anti_proton"); 104 104 105 // SetCutValueForOthers(defaultCutValue); 105 // SetCutValueForOthers(defaultCutValue); 106 106 107 if (verboseLevel>0) DumpCutValuesTable(); 107 if (verboseLevel>0) DumpCutValuesTable(); 108 } 108 } 109 109 110 void PurgMagPhysicsList::SetGammaLowLimit(G4do 110 void PurgMagPhysicsList::SetGammaLowLimit(G4double lowcut) 111 { 111 { 112 if (verboseLevel >0){ 112 if (verboseLevel >0){ 113 G4cout << "PurgMagPhysicsList::SetCuts:"; 113 G4cout << "PurgMagPhysicsList::SetCuts:"; 114 G4cout << "Gamma cut in energy: " << lowcu 114 G4cout << "Gamma cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; 115 } 115 } 116 116 117 // G4Gamma::SetEnergyRange(lowcut,1e5); 117 // G4Gamma::SetEnergyRange(lowcut,1e5); 118 SetGELowLimit(lowcut); 118 SetGELowLimit(lowcut); 119 } 119 } 120 120 121 void PurgMagPhysicsList::SetElectronLowLimit(G 121 void PurgMagPhysicsList::SetElectronLowLimit(G4double lowcut) 122 { 122 { 123 if (verboseLevel >0){ 123 if (verboseLevel >0){ 124 124 125 G4cout << "PurgMagPhysicsList::SetCuts:"; 125 G4cout << "PurgMagPhysicsList::SetCuts:"; 126 G4cout << "Electron cut in energy: " << lo 126 G4cout << "Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; 127 } 127 } 128 128 129 // G4Electron::SetEnergyRange(lowcut,1e5); 129 // G4Electron::SetEnergyRange(lowcut,1e5); 130 SetGELowLimit(lowcut); 130 SetGELowLimit(lowcut); 131 } 131 } 132 132 133 void PurgMagPhysicsList::SetPositronLowLimit(G 133 void PurgMagPhysicsList::SetPositronLowLimit(G4double lowcut) 134 { 134 { 135 if (verboseLevel >0){ 135 if (verboseLevel >0){ 136 136 137 G4cout << "PurgMagPhysicsList::SetCuts:"; 137 G4cout << "PurgMagPhysicsList::SetCuts:"; 138 G4cout << "Positron cut in energy: " << lo 138 G4cout << "Positron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; 139 } 139 } 140 140 141 G4cerr << "PurgMagPhysicsList::SetPositronLo 141 G4cerr << "PurgMagPhysicsList::SetPositronLowLimit: Not currently able to set Positron LowLimit." << G4endl; 142 G4Exception("PurgMagPhysicsList::SetPositron 142 G4Exception("PurgMagPhysicsList::SetPositronLowLimit()","PurMag001", 143 FatalException,"Positron Low Limit: no 143 FatalException,"Positron Low Limit: not implemented in PurgMagPhysicsList"); 144 // 144 // 145 // G4Positron::SetEnergyRange(lowcut,1e5); 145 // G4Positron::SetEnergyRange(lowcut,1e5); 146 } 146 } 147 147 148 148 149 void PurgMagPhysicsList::SetProtonLowLimit(G4d 149 void PurgMagPhysicsList::SetProtonLowLimit(G4double lowcut) 150 { 150 { 151 if (verboseLevel >0){ 151 if (verboseLevel >0){ 152 152 153 G4cout << "PurgMagPhysicsList::SetCuts:"; 153 G4cout << "PurgMagPhysicsList::SetCuts:"; 154 G4cout << "Proton cut in energy: " << lowc 154 G4cout << "Proton cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; 155 } 155 } 156 156 157 G4cerr << "PurgMagPhysicsList::SetProtonLowL 157 G4cerr << "PurgMagPhysicsList::SetProtonLowLimit: Not currently able to set Proton LowLimit." << G4endl; 158 G4Exception("PurgMagPhysicsList::SetProtonLo 158 G4Exception("PurgMagPhysicsList::SetProtonLowLimit()","PurMag002", 159 FatalException,"Proton Low Limit: not 159 FatalException,"Proton Low Limit: not implemented in PurgMagPhysicsList"); 160 // 160 // 161 // G4Proton::SetEnergyRange(lowcut,1e5); 161 // G4Proton::SetEnergyRange(lowcut,1e5); 162 // G4AntiProton::SetEnergyRange(lowcut,1e5); 162 // G4AntiProton::SetEnergyRange(lowcut,1e5); 163 } 163 } 164 164 165 void PurgMagPhysicsList::SetGEPLowLimit(G4doub 165 void PurgMagPhysicsList::SetGEPLowLimit(G4double lowcut) 166 { 166 { 167 if (verboseLevel >0){ 167 if (verboseLevel >0){ 168 G4cout << "PurgMagPhysicsList::SetGEPLowLi 168 G4cout << "PurgMagPhysicsList::SetGEPLowLimit:"; 169 G4cout << "Gamma and Electron cut in energ 169 G4cout << "Gamma and Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; 170 } 170 } 171 171 172 // G4Gamma::SetEnergyRange(lowcut,1e5); 172 // G4Gamma::SetEnergyRange(lowcut,1e5); 173 // G4Electron::SetEnergyRange(lowcut,1e5); 173 // G4Electron::SetEnergyRange(lowcut,1e5); 174 // G4Positron::SetEnergyRange(lowcut,1e5); 174 // G4Positron::SetEnergyRange(lowcut,1e5); 175 this->SetGELowLimit(lowcut); 175 this->SetGELowLimit(lowcut); 176 176 177 G4cerr << " SetGEPLowLimit : Uncertain wheth 177 G4cerr << " SetGEPLowLimit : Uncertain whether setting Positron low limit " << G4endl; 178 } 178 } 179 179 180 void PurgMagPhysicsList::SetGELowLimit(G4doubl 180 void PurgMagPhysicsList::SetGELowLimit(G4double lowcut) 181 { 181 { 182 if (verboseLevel >0){ 182 if (verboseLevel >0){ 183 G4cout << "PurgMagPhysicsList::SetGELowLim 183 G4cout << "PurgMagPhysicsList::SetGELowLimit:"; 184 G4cout << "Gamma and Electron cut in energ 184 G4cout << "Gamma and Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl; 185 } 185 } 186 186 187 G4ProductionCutsTable::GetProductionCutsTabl 187 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(lowcut,1e5); 188 } 188 } 189 void PurgMagPhysicsList::SetGammaCut(G4double 189 void PurgMagPhysicsList::SetGammaCut(G4double val) 190 { 190 { 191 cutForGamma = val; 191 cutForGamma = val; 192 } 192 } 193 193 194 void PurgMagPhysicsList::SetElectronCut(G4doub 194 void PurgMagPhysicsList::SetElectronCut(G4double val) 195 { 195 { 196 cutForElectron = val; 196 cutForElectron = val; 197 } 197 } 198 198 199 void PurgMagPhysicsList::SetPositronCut(G4doub 199 void PurgMagPhysicsList::SetPositronCut(G4double val) 200 { 200 { 201 cutForPositron = val; 201 cutForPositron = val; 202 } 202 } 203 203 204 void PurgMagPhysicsList::SetProtonCut(G4double 204 void PurgMagPhysicsList::SetProtonCut(G4double val) 205 { 205 { 206 cutForProton = val; 206 cutForProton = val; 207 } 207 } 208 208 209 209 210 210 211 211 212 212 213 213 214 214