[807] | 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 | // $Id: PhysicsList.cc,v 1.15 2007/07/04 11:14:33 vnivanch Exp $ |
---|
| 27 | // GEANT4 tag $Name: $ |
---|
| 28 | // |
---|
| 29 | //--------------------------------------------------------------------------- |
---|
| 30 | // |
---|
| 31 | // ClassName: PhysicsList |
---|
| 32 | // |
---|
| 33 | // Author: V.Ivanchenko 03.05.2004 |
---|
| 34 | // |
---|
| 35 | // Modified: |
---|
| 36 | // 16.11.06 Use components from physics_lists subdirectory (V.Ivanchenko) |
---|
| 37 | // 16.05.07 Use renamed EM components from physics_lists (V.Ivanchenko) |
---|
| 38 | // |
---|
| 39 | //---------------------------------------------------------------------------- |
---|
| 40 | // |
---|
| 41 | |
---|
| 42 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 43 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 44 | |
---|
| 45 | #include "PhysicsList.hh" |
---|
| 46 | #include "PhysicsListMessenger.hh" |
---|
| 47 | |
---|
| 48 | #include "ParticlesBuilder.hh" |
---|
| 49 | #include "G4EmStandardPhysics.hh" |
---|
| 50 | #include "G4EmStandardPhysics_option1.hh" |
---|
| 51 | #include "G4EmStandardPhysics_option2.hh" |
---|
| 52 | #include "PhysListEmLivermore.hh" |
---|
| 53 | #include "PhysListEmPenelope.hh" |
---|
| 54 | #include "G4StepLimiterBuilder.hh" |
---|
| 55 | #include "G4DecayPhysics.hh" |
---|
| 56 | #include "G4HadronElasticPhysics.hh" |
---|
| 57 | #include "G4HadronInelasticQBBC.hh" |
---|
| 58 | #include "G4IonBinaryCascadePhysics.hh" |
---|
| 59 | #include "G4EmExtraPhysics.hh" |
---|
| 60 | #include "G4QStoppingPhysics.hh" |
---|
| 61 | //#include "PhysListEmModelPai.hh" |
---|
| 62 | |
---|
| 63 | #include "G4UnitsTable.hh" |
---|
| 64 | #include "G4LossTableManager.hh" |
---|
| 65 | #include "G4EmProcessOptions.hh" |
---|
| 66 | |
---|
| 67 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 68 | |
---|
| 69 | PhysicsList::PhysicsList() |
---|
| 70 | : G4VModularPhysicsList() |
---|
| 71 | { |
---|
| 72 | emBuilderIsRegisted = false; |
---|
| 73 | decayIsRegisted = false; |
---|
| 74 | stepLimiterIsRegisted = false; |
---|
| 75 | helIsRegisted = false; |
---|
| 76 | bicIsRegisted = false; |
---|
| 77 | ionIsRegisted = false; |
---|
| 78 | gnucIsRegisted = false; |
---|
| 79 | stopIsRegisted = false; |
---|
| 80 | verbose = 1; |
---|
| 81 | G4LossTableManager::Instance()->SetVerbose(1); |
---|
| 82 | defaultCutValue = 1.*mm; |
---|
| 83 | cutForGamma = defaultCutValue; |
---|
| 84 | cutForElectron = defaultCutValue; |
---|
| 85 | cutForPositron = defaultCutValue; |
---|
| 86 | |
---|
| 87 | pMessenger = new PhysicsListMessenger(this); |
---|
| 88 | |
---|
| 89 | // Add Physics builders |
---|
| 90 | RegisterPhysics(new ParticlesBuilder()); |
---|
| 91 | } |
---|
| 92 | |
---|
| 93 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 94 | |
---|
| 95 | PhysicsList::~PhysicsList() |
---|
| 96 | {} |
---|
| 97 | |
---|
| 98 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 99 | |
---|
| 100 | void PhysicsList::ConstructParticle() |
---|
| 101 | { |
---|
| 102 | if(verbose > 0) |
---|
| 103 | G4cout << "### PhysicsList Construte Particles" << G4endl; |
---|
| 104 | G4VModularPhysicsList::ConstructParticle(); |
---|
| 105 | } |
---|
| 106 | |
---|
| 107 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 108 | |
---|
| 109 | void PhysicsList::ConstructProcess() |
---|
| 110 | { |
---|
| 111 | if(verbose > 0) |
---|
| 112 | G4cout << "### PhysicsList Construte Processes" << G4endl; |
---|
| 113 | if(!emBuilderIsRegisted) AddPhysicsList("emstandard"); |
---|
| 114 | RegisterPhysics(new G4StepLimiterBuilder()); |
---|
| 115 | G4VModularPhysicsList::ConstructProcess(); |
---|
| 116 | |
---|
| 117 | // Define energy interval for loss processes |
---|
| 118 | G4EmProcessOptions emOptions; |
---|
| 119 | emOptions.SetMinEnergy(0.1*keV); |
---|
| 120 | emOptions.SetMaxEnergy(100.*GeV); |
---|
| 121 | emOptions.SetDEDXBinning(90); |
---|
| 122 | emOptions.SetLambdaBinning(90); |
---|
| 123 | // emOptions.SetBuildCSDARange(false); |
---|
| 124 | emOptions.SetApplyCuts(true); |
---|
| 125 | //emOptions.SetVerbose(0); |
---|
| 126 | } |
---|
| 127 | |
---|
| 128 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 129 | |
---|
| 130 | void PhysicsList::AddPhysicsList(const G4String& name) |
---|
| 131 | { |
---|
| 132 | if(verbose > 0) { |
---|
| 133 | G4cout << "### PhysicsList Add Physics <" << name |
---|
| 134 | << "> emBuilderIsRegisted= " << emBuilderIsRegisted |
---|
| 135 | << G4endl; |
---|
| 136 | } |
---|
| 137 | if ((name == "emstandard") && !emBuilderIsRegisted) { |
---|
| 138 | RegisterPhysics(new G4EmStandardPhysics()); |
---|
| 139 | emBuilderIsRegisted = true; |
---|
| 140 | G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl; |
---|
| 141 | |
---|
| 142 | } else if (name == "emstandard_opt1" && !emBuilderIsRegisted) { |
---|
| 143 | RegisterPhysics(new G4EmStandardPhysics_option1()); |
---|
| 144 | emBuilderIsRegisted = true; |
---|
| 145 | G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl; |
---|
| 146 | |
---|
| 147 | } else if (name == "emstandard_opt2" && !emBuilderIsRegisted) { |
---|
| 148 | RegisterPhysics(new G4EmStandardPhysics_option2()); |
---|
| 149 | emBuilderIsRegisted = true; |
---|
| 150 | G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl; |
---|
| 151 | |
---|
| 152 | } else if (name == "livermore" && !emBuilderIsRegisted) { |
---|
| 153 | RegisterPhysics(new PhysListEmLivermore()); |
---|
| 154 | emBuilderIsRegisted = true; |
---|
| 155 | G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl; |
---|
| 156 | |
---|
| 157 | } else if (name == "penelope" && !emBuilderIsRegisted) { |
---|
| 158 | RegisterPhysics(new PhysListEmPenelope()); |
---|
| 159 | emBuilderIsRegisted = true; |
---|
| 160 | G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl; |
---|
| 161 | /* |
---|
| 162 | } else if (name == "pai" && !emBuilderIsRegisted) { |
---|
| 163 | RegisterPhysics(new PhysListEmModelPai()); |
---|
| 164 | emBuilderIsRegisted = true; |
---|
| 165 | G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl; |
---|
| 166 | */ |
---|
| 167 | |
---|
| 168 | } else if (name == "decay" && !decayIsRegisted && emBuilderIsRegisted) { |
---|
| 169 | RegisterPhysics(new G4DecayPhysics()); |
---|
| 170 | decayIsRegisted = true; |
---|
| 171 | G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl; |
---|
| 172 | |
---|
| 173 | } else if (name == "elastic" && !helIsRegisted && emBuilderIsRegisted) { |
---|
| 174 | RegisterPhysics(new G4HadronElasticPhysics()); |
---|
| 175 | helIsRegisted = true; |
---|
| 176 | G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl; |
---|
| 177 | |
---|
| 178 | } else if (name == "binary" && !bicIsRegisted && emBuilderIsRegisted) { |
---|
| 179 | RegisterPhysics(new G4HadronInelasticQBBC()); |
---|
| 180 | bicIsRegisted = true; |
---|
| 181 | G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl; |
---|
| 182 | |
---|
| 183 | } else if (name == "binary_ion" && !ionIsRegisted && emBuilderIsRegisted) { |
---|
| 184 | RegisterPhysics(new G4IonBinaryCascadePhysics()); |
---|
| 185 | ionIsRegisted = true; |
---|
| 186 | G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl; |
---|
| 187 | |
---|
| 188 | } else if (name == "gamma_nuc" && !gnucIsRegisted && emBuilderIsRegisted) { |
---|
| 189 | RegisterPhysics(new G4EmExtraPhysics()); |
---|
| 190 | gnucIsRegisted = true; |
---|
| 191 | G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl; |
---|
| 192 | |
---|
| 193 | } else if (name == "stopping" && !stopIsRegisted && emBuilderIsRegisted) { |
---|
| 194 | RegisterPhysics(new G4QStoppingPhysics()); |
---|
| 195 | gnucIsRegisted = true; |
---|
| 196 | G4cout << "PhysicsList::AddPhysicsList <" << name << ">" << G4endl; |
---|
| 197 | |
---|
| 198 | } else if(!emBuilderIsRegisted) { |
---|
| 199 | G4cout << "PhysicsList::AddPhysicsList <" << name << ">" |
---|
| 200 | << " fail - EM physics should be registered first " << G4endl; |
---|
| 201 | } else { |
---|
| 202 | G4cout << "PhysicsList::AddPhysicsList <" << name << ">" |
---|
| 203 | << " fail - module is already regitered or is unknown " << G4endl; |
---|
| 204 | } |
---|
| 205 | } |
---|
| 206 | |
---|
| 207 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 208 | |
---|
| 209 | void PhysicsList::SetCuts() |
---|
| 210 | { |
---|
| 211 | |
---|
| 212 | SetCutValue(cutForGamma, "gamma"); |
---|
| 213 | SetCutValue(cutForElectron, "e-"); |
---|
| 214 | SetCutValue(cutForPositron, "e+"); |
---|
| 215 | |
---|
| 216 | if (verbose>0) DumpCutValuesTable(); |
---|
| 217 | } |
---|
| 218 | |
---|
| 219 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 220 | |
---|
| 221 | void PhysicsList::SetVerbose(G4int val) |
---|
| 222 | { |
---|
| 223 | verbose = val; |
---|
| 224 | } |
---|
| 225 | |
---|
| 226 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 227 | |
---|
| 228 | void PhysicsList::SetCutForGamma(G4double cut) |
---|
| 229 | { |
---|
| 230 | cutForGamma = cut; |
---|
| 231 | SetParticleCuts(cutForGamma, G4Gamma::Gamma()); |
---|
| 232 | } |
---|
| 233 | |
---|
| 234 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 235 | |
---|
| 236 | void PhysicsList::SetCutForElectron(G4double cut) |
---|
| 237 | { |
---|
| 238 | cutForElectron = cut; |
---|
| 239 | SetParticleCuts(cutForElectron, G4Electron::Electron()); |
---|
| 240 | } |
---|
| 241 | |
---|
| 242 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|
| 243 | |
---|
| 244 | void PhysicsList::SetCutForPositron(G4double cut) |
---|
| 245 | { |
---|
| 246 | cutForPositron = cut; |
---|
| 247 | SetParticleCuts(cutForPositron, G4Positron::Positron()); |
---|
| 248 | } |
---|
| 249 | |
---|
| 250 | //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... |
---|