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 /// \file hadronic/Hadr01/src/PhysicsList.cc 27 /// \brief Implementation of the PhysicsList class 28 // 29 // 30 // 31 ///////////////////////////////////////////////////////////////////////// 32 // 33 // PhysicsList 34 // 35 // Created: 31.04.2006 V.Ivanchenko 36 // 37 // Modified: 38 // 04.06.2006 Adoptation of Hadr01 (V.Ivanchenko) 39 // 26.04.2007 Physics according to 8.3 Physics List (V.Ivanchenko) 40 // 16.10.2012 Renamed used classes (A.Ribon) 41 // 42 //////////////////////////////////////////////////////////////////////// 43 // 44 45 #include "PhysicsList.hh" 46 47 #include "PhysicsListMessenger.hh" 48 49 #include "G4DecayPhysics.hh" 50 #include "G4Electron.hh" 51 #include "G4EmExtraPhysics.hh" 52 #include "G4EmLivermorePhysics.hh" 53 #include "G4EmParameters.hh" 54 #include "G4EmPenelopePhysics.hh" 55 #include "G4EmStandardPhysics.hh" 56 #include "G4EmStandardPhysicsGS.hh" 57 #include "G4EmStandardPhysics_option1.hh" 58 #include "G4EmStandardPhysics_option2.hh" 59 #include "G4EmStandardPhysics_option3.hh" 60 #include "G4EmStandardPhysics_option4.hh" 61 #include "G4Gamma.hh" 62 #include "G4HadronElasticPhysics.hh" 63 #include "G4HadronElasticPhysicsHP.hh" 64 #include "G4HadronElasticPhysicsXS.hh" 65 #include "G4HadronHElasticPhysics.hh" 66 #include "G4HadronInelasticQBBC.hh" 67 #include "G4HadronPhysicsFTFP_BERT.hh" 68 #include "G4HadronPhysicsFTFP_BERT_HP.hh" 69 #include "G4HadronPhysicsFTFP_BERT_TRV.hh" 70 #include "G4HadronPhysicsFTF_BIC.hh" 71 #include "G4HadronPhysicsQGSP_BERT.hh" 72 #include "G4HadronPhysicsQGSP_BERT_HP.hh" 73 #include "G4HadronPhysicsQGSP_BIC.hh" 74 #include "G4HadronPhysicsQGSP_BIC_HP.hh" 75 #include "G4HadronPhysicsQGSP_FTFP_BERT.hh" 76 #include "G4HadronPhysicsQGS_BIC.hh" 77 #include "G4IonBinaryCascadePhysics.hh" 78 #include "G4IonElasticPhysics.hh" 79 #include "G4IonPhysics.hh" 80 #include "G4IonPhysicsXS.hh" 81 #include "G4NeutronCrossSectionXS.hh" 82 #include "G4NeutronTrackingCut.hh" 83 #include "G4ParticleTable.hh" 84 #include "G4ParticleTypes.hh" 85 #include "G4PhysListFactoryMessenger.hh" 86 #include "G4Positron.hh" 87 #include "G4ProcessManager.hh" 88 #include "G4Proton.hh" 89 #include "G4RadioactiveDecayPhysics.hh" 90 #include "G4StoppingPhysics.hh" 91 #include "G4SystemOfUnits.hh" 92 93 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 94 95 PhysicsList::PhysicsList() : G4VModularPhysicsList() 96 { 97 SetDefaultCutValue(0.7 * CLHEP::mm); 98 verboseLevel = 1; 99 100 // Messengers 101 fMessenger = new PhysicsListMessenger(this); 102 fFactMessenger = new G4PhysListFactoryMessenger(this); 103 104 // Particles 105 fParticleList = new G4DecayPhysics(verboseLevel); 106 107 // EM physics 108 fEmPhysicsList = new G4EmStandardPhysics(verboseLevel); 109 } 110 111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 112 113 PhysicsList::~PhysicsList() 114 { 115 delete fMessenger; 116 delete fParticleList; 117 delete fEmPhysicsList; 118 for (std::size_t i = 0; i < fHadronPhys.size(); ++i) { 119 delete fHadronPhys[i]; 120 } 121 } 122 123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 124 125 void PhysicsList::ConstructParticle() 126 { 127 fParticleList->ConstructParticle(); 128 } 129 130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 131 132 void PhysicsList::ConstructProcess() 133 { 134 AddTransportation(); 135 fEmPhysicsList->ConstructProcess(); 136 fParticleList->ConstructProcess(); 137 for (std::size_t i = 0; i < fHadronPhys.size(); ++i) { 138 fHadronPhys[i]->ConstructProcess(); 139 } 140 } 141 142 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 143 144 void PhysicsList::AddPhysicsList(const G4String& name) 145 { 146 if (verboseLevel > 0) { 147 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl; 148 } 149 if (name == "emstandard_opt0") { 150 delete fEmPhysicsList; 151 fEmPhysicsList = new G4EmStandardPhysics(verboseLevel); 152 } 153 else if (name == "emstandard_opt1") { 154 delete fEmPhysicsList; 155 fEmPhysicsList = new G4EmStandardPhysics_option1(verboseLevel); 156 } 157 else if (name == "emstandard_opt2") { 158 delete fEmPhysicsList; 159 fEmPhysicsList = new G4EmStandardPhysics_option2(verboseLevel); 160 } 161 else if (name == "emstandard_opt3") { 162 delete fEmPhysicsList; 163 fEmPhysicsList = new G4EmStandardPhysics_option3(verboseLevel); 164 } 165 else if (name == "emstandard_opt4") { 166 delete fEmPhysicsList; 167 fEmPhysicsList = new G4EmStandardPhysics_option4(verboseLevel); 168 } 169 else if (name == "emstandardGS") { 170 delete fEmPhysicsList; 171 fEmPhysicsList = new G4EmStandardPhysicsGS(verboseLevel); 172 } 173 else if (name == "FTFP_BERT_EMV") { 174 AddPhysicsList("FTFP_BERT"); 175 AddPhysicsList("emstandard_opt1"); 176 } 177 else if (name == "FTFP_BERT_EMX") { 178 AddPhysicsList("FTFP_BERT"); 179 AddPhysicsList("emstandard_opt2"); 180 } 181 else if (name == "FTFP_BERT_EMY") { 182 AddPhysicsList("FTFP_BERT"); 183 AddPhysicsList("emstandard_opt3"); 184 } 185 else if (name == "FTFP_BERT_EMZ") { 186 AddPhysicsList("FTFP_BERT"); 187 AddPhysicsList("emstandard_opt4"); 188 } 189 else if (name == "FTFP_BERT") { 190 SetBuilderList0(false); 191 fHadronPhys.push_back(new G4HadronPhysicsFTFP_BERT(verboseLevel)); 192 } 193 else if (name == "FTFP_BERT_TRV") { 194 AddPhysicsList("emstandardGS"); 195 SetBuilderList1(false); 196 fHadronPhys.push_back(new G4HadronPhysicsFTFP_BERT_TRV(verboseLevel)); 197 } 198 else if (name == "FTF_BIC") { 199 SetBuilderList0(false); 200 fHadronPhys.push_back(new G4HadronPhysicsFTF_BIC(verboseLevel)); 201 } 202 else if (name == "QBBC") { 203 AddPhysicsList("emstandard_opt0"); 204 SetBuilderList2(); 205 fHadronPhys.push_back(new G4HadronInelasticQBBC(verboseLevel)); 206 } 207 else if (name == "QGSP_BERT") { 208 SetBuilderList0(false); 209 fHadronPhys.push_back(new G4HadronPhysicsQGSP_BERT(verboseLevel)); 210 } 211 else if (name == "QGSP_FTFP_BERT") { 212 SetBuilderList0(false); 213 fHadronPhys.push_back(new G4HadronPhysicsQGSP_FTFP_BERT(verboseLevel)); 214 } 215 else if (name == "QGSP_FTFP_BERT_EMV") { 216 AddPhysicsList("QGSP_FTFP_BERT"); 217 AddPhysicsList("emstandard_opt1"); 218 } 219 else if (name == "QGSP_BERT_EMV") { 220 AddPhysicsList("QGSP_BERT"); 221 AddPhysicsList("emstandard_opt1"); 222 } 223 else if (name == "QGSP_BERT_EMX") { 224 AddPhysicsList("QGSP_BERT"); 225 AddPhysicsList("emstandard_opt2"); 226 } 227 else if (name == "QGSP_BERT_HP") { 228 SetBuilderList0(true); 229 fHadronPhys.push_back(new G4HadronPhysicsQGSP_BERT_HP(verboseLevel)); 230 AddPhysicsList("RadioactiveDecay"); 231 } 232 else if (name == "QGSP_BIC") { 233 SetBuilderList0(false); 234 fHadronPhys.push_back(new G4HadronPhysicsQGSP_BIC(verboseLevel)); 235 fHadronPhys.push_back(new G4IonElasticPhysics(verboseLevel)); 236 } 237 else if (name == "QGSP_BIC_EMY") { 238 AddPhysicsList("QGSP_BIC"); 239 AddPhysicsList("emstandard_opt3"); 240 } 241 else if (name == "QGS_BIC") { 242 SetBuilderList0(false); 243 fHadronPhys.push_back(new G4HadronPhysicsQGS_BIC(verboseLevel)); 244 } 245 else if (name == "QGSP_BIC_HP") { 246 SetBuilderList0(true); 247 fHadronPhys.push_back(new G4HadronPhysicsQGSP_BIC_HP(verboseLevel)); 248 AddPhysicsList("RadioactiveDecay"); 249 } 250 else if (name == "RadioactiveDecay") { 251 fHadronPhys.push_back(new G4RadioactiveDecayPhysics(verboseLevel)); 252 } 253 else { 254 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" 255 << " is not defined" << G4endl; 256 } 257 } 258 259 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 260 261 void PhysicsList::SetBuilderList0(G4bool flagHP) 262 { 263 fHadronPhys.push_back(new G4EmExtraPhysics(verboseLevel)); 264 if (flagHP) { 265 fHadronPhys.push_back(new G4HadronElasticPhysicsHP(verboseLevel)); 266 } 267 else { 268 fHadronPhys.push_back(new G4HadronElasticPhysics(verboseLevel)); 269 } 270 fHadronPhys.push_back(new G4StoppingPhysics(verboseLevel)); 271 fHadronPhys.push_back(new G4IonPhysics(verboseLevel)); 272 if (!flagHP) { 273 fHadronPhys.push_back(new G4NeutronTrackingCut(verboseLevel)); 274 } 275 } 276 277 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 278 279 void PhysicsList::SetBuilderList1(G4bool flagHP) 280 { 281 fHadronPhys.push_back(new G4EmExtraPhysics(verboseLevel)); 282 if (flagHP) { 283 fHadronPhys.push_back(new G4HadronElasticPhysicsHP(verboseLevel)); 284 } 285 else { 286 fHadronPhys.push_back(new G4HadronHElasticPhysics(verboseLevel)); 287 } 288 fHadronPhys.push_back(new G4StoppingPhysics(verboseLevel)); 289 fHadronPhys.push_back(new G4IonPhysics(verboseLevel)); 290 if (!flagHP) { 291 fHadronPhys.push_back(new G4NeutronTrackingCut(verboseLevel)); 292 } 293 } 294 295 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 296 297 void PhysicsList::SetBuilderList2() 298 { 299 fHadronPhys.push_back(new G4EmExtraPhysics(verboseLevel)); 300 fHadronPhys.push_back(new G4HadronElasticPhysicsXS(verboseLevel)); 301 fHadronPhys.push_back(new G4StoppingPhysics(verboseLevel)); 302 fHadronPhys.push_back(new G4IonPhysicsXS(verboseLevel)); 303 fHadronPhys.push_back(new G4IonElasticPhysics(verboseLevel)); 304 fHadronPhys.push_back(new G4NeutronTrackingCut(verboseLevel)); 305 } 306 307 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo..... 308 309 void PhysicsList::List() 310 { 311 G4cout << "### PhysicsLists available: FTFP_BERT FTFP_BERT_EMV " 312 << "FTFP_BERT_EMX FTFP_BERT_EMZ FTFP_BERT_TRV" << G4endl; 313 G4cout << " FTF_BIC QBBC QGSP_BERT " 314 << "QGSP_BERT_EMV QGSP_BERT_EMX" << G4endl; 315 G4cout << " QGSP_BERT_HP QGSP_FTFP_BERT " 316 << "QGSP_FTFP_BERT_EMV" << G4endl; 317 G4cout << " QGS_BIC QGSP_BIC QGSP_BIC_EMY " 318 << "QGSP_BIC_HP" << G4endl; 319 } 320 321 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 322