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 // Hadrontherapy advanced example for Geant4 << 26 // $Id: HadrontherapyPhysicsList.cc,v 1.0 27 // See more at: https://twiki.cern.ch/twiki/bi << 27 // ---------------------------------------------------------------------------- >> 28 // GEANT 4 - Hadrontherapy example >> 29 // ---------------------------------------------------------------------------- >> 30 // Code developed by: 28 // 31 // 29 // Using the builder concepts of Geant4 we ass << 32 // G.A.P. Cirrone(a)*, F. Di Rosa(a), S. Guatelli(b), G. Russo(a) 30 // Physics Lists that are particuilarly suited << 33 // 31 // << 34 // (a) Laboratori Nazionali del Sud 32 // 'HADRONTHERAPY_1' is more suited for proton << 35 // of the National Institute for Nuclear Physics, Catania, Italy 33 // 'HADRONTHERAPY_2' is suggested for better p << 36 // (b) National Institute for Nuclear Physics Section of Genova, genova, Italy 34 // << 37 // 35 // The Reference physics lists (already presen << 38 // * cirrone@lns.infn.it 36 // be used as well. In this case the more suit << 39 // ---------------------------------------------------------------------------- 37 // "QBBC", "QGSP_BIC", "Shielding", "QGSP_BERT << 38 // "QGSP_BIC_AllHP" and "QGSP_BIC_HP" << 39 // << 40 // NOTE: to activate the "_HP" physics you hav << 41 // variable pointing to the external dataset n << 42 // << 43 // All the lists can be activated inside any << 44 // /Physics/addPhysics << 45 // << 46 // Examples of usage are: << 47 // /Physics/addPhysics HADRONTHERAPY_1 or /Phy << 48 40 49 #include "G4SystemOfUnits.hh" << 41 #include "globals.hh" 50 #include "G4RunManager.hh" << 42 #include "G4ProcessManager.hh" 51 #include "G4Region.hh" 43 #include "G4Region.hh" 52 #include "G4RegionStore.hh" 44 #include "G4RegionStore.hh" 53 #include "HadrontherapyPhysicsList.hh" 45 #include "HadrontherapyPhysicsList.hh" 54 #include "HadrontherapyPhysicsListMessenger.hh 46 #include "HadrontherapyPhysicsListMessenger.hh" 55 #include "HadrontherapyStepMax.hh" << 47 #include "HadrontherapyParticles.hh" 56 #include "G4PhysListFactory.hh" << 48 #include "HadrontherapyPhotonStandard.hh" 57 #include "G4VPhysicsConstructor.hh" << 49 #include "HadrontherapyPhotonEPDL.hh" 58 #include "G4HadronPhysicsQGSP_BIC_HP.hh" << 50 #include "HadrontherapyPhotonPenelope.hh" 59 #include "G4HadronPhysicsQGSP_BIC.hh" << 51 #include "HadrontherapyElectronStandard.hh" 60 #include "G4EmStandardPhysics_option4.hh" << 52 #include "HadrontherapyElectronEEDL.hh" 61 #include "G4EmStandardPhysics.hh" << 53 #include "HadrontherapyElectronPenelope.hh" 62 #include "G4EmExtraPhysics.hh" << 54 #include "HadrontherapyPositronStandard.hh" 63 #include "G4StoppingPhysics.hh" << 55 #include "HadrontherapyPositronPenelope.hh" 64 #include "G4DecayPhysics.hh" << 56 #include "HadrontherapyIonLowE.hh" 65 #include "G4HadronElasticPhysics.hh" << 57 #include "HadrontherapyIonLowEZiegler1977.hh" 66 #include "G4HadronElasticPhysicsHP.hh" << 58 #include "HadrontherapyIonLowEZiegler1985.hh" 67 #include "G4RadioactiveDecayPhysics.hh" << 59 #include "HadrontherapyIonLowEZiegler2000.hh" 68 #include "G4IonBinaryCascadePhysics.hh" << 60 #include "HadrontherapyIonStandard.hh" 69 #include "G4DecayPhysics.hh" << 61 #include "HadrontherapyProtonPrecompound.hh" 70 #include "G4NeutronTrackingCut.hh" << 62 #include "HadrontherapyProtonBertini.hh" 71 #include "G4LossTableManager.hh" << 63 #include "HadrontherapyMuonStandard.hh" 72 #include "G4UnitsTable.hh" << 64 #include "HadrontherapyDecay.hh" 73 #include "G4ProcessManager.hh" << 65 #include "HadrontherapyParticles.hh" 74 #include "G4IonFluctuations.hh" << 66 #include "G4ParticleDefinition.hh" 75 #include "G4IonParametrisedLossModel.hh" << 67 #include "G4ParticleTypes.hh" 76 #include "G4EmParameters.hh" << 68 #include "G4ParticleTable.hh" 77 #include "G4ParallelWorldPhysics.hh" << 78 #include "G4EmLivermorePhysics.hh" << 79 #include "G4AutoDelete.hh" << 80 #include "G4HadronPhysicsQGSP_BIC_AllHP.hh" << 81 #include "QGSP_BIC_HP.hh" << 82 #include "QGSP_BIC.hh" << 83 #include "G4HadronPhysicsQGSP_BERT.hh" << 84 #include "G4HadronPhysicsQGSP_BERT_HP.hh" << 85 #include "G4ParallelWorldPhysics.hh" << 86 // Physics List << 87 #include "QBBC.hh" << 88 #include "QGSP_BIC.hh" << 89 #include "Shielding.hh" << 90 #include "QGSP_BERT.hh" << 91 #include "QGSP_BIC_AllHP.hh" << 92 #include "QGSP_BIC_HP.hh" << 93 69 >> 70 HadrontherapyPhysicsList::HadrontherapyPhysicsList(): G4VModularPhysicsList(), >> 71 electronIsRegistered(false), >> 72 positronIsRegistered(false), >> 73 photonIsRegistered(false), >> 74 ionIsRegistered(false), >> 75 protonHadronicIsRegistered(false), >> 76 muonIsRegistered(false), >> 77 decayIsRegistered(false) >> 78 { >> 79 // The secondary production threshold is set to 10. mm >> 80 // for all the particles in all the experimental set-up >> 81 // The phantom is defined as a Geant4 Region. Here the cut is fixed to 0.001 mm >> 82 defaultCutValue = 0.01 * mm; 94 83 >> 84 // Messenger: it is possible to activate physics processes and models interactively >> 85 messenger = new HadrontherapyPhysicsListMessenger(this); 95 86 96 ////////////////////////////////////////////// << 87 SetVerboseLevel(1); 97 HadrontherapyPhysicsList::HadrontherapyPhysics << 88 98 { << 89 // Register all the particles involved in the experimental set-up 99 G4LossTableManager::Instance(); << 90 RegisterPhysics( new HadrontherapyParticles("particles") ); 100 defaultCutValue = 1.*mm; << 101 cutForGamma = defaultCutValue; << 102 cutForElectron = defaultCutValue; << 103 cutForPositron = defaultCutValue; << 104 << 105 pMessenger = new HadrontherapyPhysicsListM << 106 SetVerboseLevel(1); << 107 decay_List = new G4DecayPhysics(); << 108 // Elecromagnetic physics << 109 // << 110 emPhysicsList = new G4EmStandardPhysics_op << 111 } 91 } 112 92 113 ////////////////////////////////////////////// << 114 HadrontherapyPhysicsList::~HadrontherapyPhysic 93 HadrontherapyPhysicsList::~HadrontherapyPhysicsList() >> 94 { >> 95 delete messenger; >> 96 } >> 97 >> 98 void HadrontherapyPhysicsList::AddPhysicsList(const G4String& name) 115 { 99 { 116 delete pMessenger; << 100 G4cout << "Adding PhysicsList component " << name << G4endl; 117 delete emPhysicsList; << 101 118 delete decay_List; << 102 //*************************// 119 //delete radioactiveDecay_List; << 103 // Electromagnetic physics // 120 hadronPhys.clear(); << 104 //*************************// 121 for(size_t i=0; i<hadronPhys.size(); i++) << 105 // >> 106 // The user can choose three alternative approaches for electrons and photons: >> 107 // Standard, Low Energy based on the Livermore libraries and Low Energy Penelope >> 108 // >> 109 >> 110 // ******** PHOTONS ********// >> 111 >> 112 // Register standard processes for photons >> 113 >> 114 if (name == "photon-standard") 122 { 115 { 123 delete hadronPhys[i]; << 116 if (photonIsRegistered) >> 117 { >> 118 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 119 << " cannot be registered ---- photon List already existing" >> 120 << G4endl; >> 121 } >> 122 else >> 123 { >> 124 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 125 << " is registered" << G4endl; >> 126 RegisterPhysics( new HadrontherapyPhotonStandard(name) ); >> 127 photonIsRegistered = true; >> 128 } 124 } 129 } 125 } << 126 130 127 ////////////////////////////////////////////// << 131 // Register LowE-EPDL processes for photons 128 void HadrontherapyPhysicsList::ConstructPartic << 132 if (name == "photon-epdl") 129 { << 133 { 130 decay_List -> ConstructParticle(); << 134 if (photonIsRegistered) 131 << 135 { 132 } << 136 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 137 << " cannot be registered ---- photon List already existing" >> 138 << G4endl; >> 139 } >> 140 else >> 141 { >> 142 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 143 << " is registered" << G4endl; >> 144 RegisterPhysics( new HadrontherapyPhotonEPDL(name) ); >> 145 photonIsRegistered = true; >> 146 } >> 147 } 133 148 134 ////////////////////////////////////////////// << 149 // Register processes a' la Penelope for photons 135 void HadrontherapyPhysicsList::ConstructProces << 150 if (name == "photon-penelope") 136 { << 151 { 137 // Transportation << 152 if (photonIsRegistered) 138 // << 153 { 139 AddTransportation(); << 154 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name 140 << 155 << " cannot be registered ---- photon List already existing" 141 decay_List -> ConstructProcess(); << 156 << G4endl; 142 emPhysicsList -> ConstructProcess(); << 157 } 143 << 158 else 144 << 159 { 145 //em_config.AddModels(); << 160 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name 146 << 161 << " is registered" << G4endl; 147 // Hadronic physics << 162 RegisterPhysics( new HadrontherapyPhotonPenelope(name) ); 148 // << 163 photonIsRegistered = true; 149 for(size_t i=0; i < hadronPhys.size(); i++ << 164 } 150 { << 165 } 151 hadronPhys[i] -> ConstructProcess(); << 152 } << 153 << 154 // step limitation (as a full process) << 155 // << 156 AddStepMax(); << 157 << 158 //Parallel world sensitivity << 159 // << 160 G4ParallelWorldPhysics* pWorld = new G4Par << 161 pWorld->ConstructProcess(); << 162 << 163 return; << 164 } << 165 166 166 ////////////////////////////////////////////// << 167 // ******** Electrons ********// 167 void HadrontherapyPhysicsList::AddPhysicsList( << 168 168 { << 169 // Register standard processes for electrons 169 if (verboseLevel>1) { << 170 if (name == "electron-standard") 170 G4cout << "PhysicsList::AddPhysicsList << 171 { >> 172 if (electronIsRegistered) >> 173 { >> 174 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 175 << " cannot be registered ---- electron List already existing" >> 176 << G4endl; >> 177 } >> 178 else >> 179 { >> 180 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 181 << " is registered" << G4endl; >> 182 RegisterPhysics( new HadrontherapyElectronStandard(name) ); >> 183 electronIsRegistered = true; >> 184 } 171 } 185 } 172 if (name == emName) return; << 173 << 174 /////////////////////////////////// << 175 // ELECTROMAGNETIC MODELS << 176 /////////////////////////////////// << 177 if (name == "standard_opt4") { << 178 emName = name; << 179 delete emPhysicsList; << 180 hadronPhys.clear(); << 181 emPhysicsList = new G4EmStandardPhysic << 182 G4RunManager::GetRunManager() -> Physi << 183 G4cout << "THE FOLLOWING ELECTROMAGNET << 184 << 185 ////////////////////////////////////// << 186 // ELECTROMAGNETIC + HADRONIC MODELS << 187 ////////////////////////////////////// << 188 << 189 } else if (name == "HADRONTHERAPY_1") { << 190 << 191 AddPhysicsList("standard_opt4"); << 192 hadronPhys.push_back( new G4DecayPhysi << 193 hadronPhys.push_back( new G4Radioactiv << 194 hadronPhys.push_back( new G4IonBinaryC << 195 hadronPhys.push_back( new G4EmExtraPhy << 196 hadronPhys.push_back( new G4HadronElas << 197 hadronPhys.push_back( new G4StoppingPh << 198 hadronPhys.push_back( new G4HadronPhys << 199 hadronPhys.push_back( new G4NeutronTra << 200 << 201 G4cout << "HADRONTHERAPY_1 PHYSICS LIS << 202 } << 203 << 204 else if (name == "HADRONTHERAPY_2") { << 205 << 206 AddPhysicsList("standard_opt4"); << 207 hadronPhys.push_back( new G4DecayPhysi << 208 hadronPhys.push_back( new G4Radioactiv << 209 hadronPhys.push_back( new G4IonBinaryC << 210 hadronPhys.push_back( new G4EmExtraPhy << 211 hadronPhys.push_back( new G4HadronElas << 212 hadronPhys.push_back( new G4StoppingPh << 213 hadronPhys.push_back( new G4HadronPhys << 214 hadronPhys.push_back( new G4NeutronTra << 215 << 216 G4cout << "HADRONTHERAPY_2 PHYSICS LIS << 217 186 >> 187 // Register LowE-EEDL processes for electrons >> 188 if (name == "electron-eedl") >> 189 { >> 190 if (electronIsRegistered) >> 191 { >> 192 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 193 << " cannot be registered ---- electron List already existing" >> 194 << G4endl; >> 195 } >> 196 else >> 197 { >> 198 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 199 << " is registered" << G4endl; >> 200 RegisterPhysics( new HadrontherapyElectronEEDL(name) ); >> 201 electronIsRegistered = true; >> 202 } >> 203 } >> 204 >> 205 // Register processes a' la Penelope for electrons >> 206 if (name == "electron-penelope") >> 207 { >> 208 if (electronIsRegistered) >> 209 { >> 210 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 211 << " cannot be registered ---- electron List already existing" >> 212 << G4endl; >> 213 } >> 214 else >> 215 { >> 216 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 217 << " is registered" << G4endl; >> 218 RegisterPhysics( new HadrontherapyElectronPenelope(name) ); >> 219 electronIsRegistered = true; >> 220 } >> 221 } >> 222 >> 223 // ******** Positrons ********// >> 224 // Register standard processes for positrons >> 225 if (name == "positron-standard") >> 226 { >> 227 if (positronIsRegistered) >> 228 { >> 229 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 230 << " cannot be registered ---- positron List already existing" >> 231 << G4endl; >> 232 } >> 233 else >> 234 { >> 235 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 236 << " is registered" << G4endl; >> 237 RegisterPhysics( new HadrontherapyPositronStandard(name) ); >> 238 positronIsRegistered = true; >> 239 } >> 240 } >> 241 // Register penelope processes for positrons >> 242 if (name == "positron-penelope") >> 243 { >> 244 if (positronIsRegistered) >> 245 { >> 246 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 247 << " cannot be registered ---- positron List already existing" << G4endl; >> 248 } >> 249 else >> 250 { >> 251 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 252 << " is registered" << G4endl; >> 253 RegisterPhysics( new HadrontherapyPositronPenelope(name) ); >> 254 positronIsRegistered = true; >> 255 } >> 256 } >> 257 >> 258 // ******** HADRONS AND IONS ********// >> 259 // Register Low Energy processes for protons and ions >> 260 // Stopping power parameterisation: ICRU49 (default model) >> 261 >> 262 if (name == "ion-LowE") >> 263 { >> 264 if (ionIsRegistered) >> 265 { >> 266 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 267 << " cannot be registered ---- proton List already existing" >> 268 << G4endl; >> 269 } >> 270 else >> 271 { >> 272 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 273 << " is registered" << G4endl; >> 274 RegisterPhysics( new HadrontherapyIonLowE(name) ); >> 275 ionIsRegistered = true; >> 276 } >> 277 } >> 278 >> 279 // Register Low Energy processes for protons and ions >> 280 // Stopping power parameterisation: Ziegler 1977 >> 281 if (name == "ion-LowE-ziegler1977") >> 282 { >> 283 if (ionIsRegistered) >> 284 { >> 285 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 286 << " cannot be registered ---- proton List already existing" >> 287 << G4endl; >> 288 } >> 289 else >> 290 { >> 291 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 292 << " is registered" << G4endl; >> 293 RegisterPhysics( new HadrontherapyIonLowEZiegler1977(name) ); >> 294 ionIsRegistered = true; >> 295 } >> 296 } >> 297 >> 298 >> 299 // Register Low Energy processes for protons and ions >> 300 // Stopping power parameterisation: Ziegler 1985 >> 301 if (name == "ion-LowE-ziegler1985") >> 302 { >> 303 if (ionIsRegistered) >> 304 { >> 305 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 306 << " cannot be registered ---- proton List already existing" >> 307 << G4endl; >> 308 } >> 309 else >> 310 { >> 311 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 312 << " is registered" << G4endl; >> 313 RegisterPhysics( new HadrontherapyIonLowEZiegler1985(name) ); >> 314 ionIsRegistered = true; >> 315 } >> 316 } >> 317 >> 318 >> 319 // Register Low Energy processes for protons and ions >> 320 // Stopping power parameterisation: SRIM2000 >> 321 if (name == "ion-LowE-ziegler2000") >> 322 { >> 323 if (ionIsRegistered) >> 324 { >> 325 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 326 << " cannot be registered ---- proton List already existing" >> 327 << G4endl; >> 328 } >> 329 else >> 330 { >> 331 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 332 << " is registered" << G4endl; >> 333 RegisterPhysics( new HadrontherapyIonLowEZiegler2000(name) ); >> 334 ionIsRegistered = true; >> 335 } >> 336 } >> 337 >> 338 // Register Standard processes for protons and ions >> 339 >> 340 if (name == "ion-standard") >> 341 { >> 342 if (ionIsRegistered) >> 343 { >> 344 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 345 << " cannot be registered ---- ion List already existing" >> 346 << G4endl; >> 347 } >> 348 else >> 349 { >> 350 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 351 << " is registered" << G4endl; >> 352 RegisterPhysics( new HadrontherapyIonStandard(name) ); >> 353 ionIsRegistered = true; >> 354 } >> 355 } >> 356 >> 357 // Register the Standard processes for muons >> 358 if (name == "muon-standard") >> 359 { >> 360 if (muonIsRegistered) >> 361 { >> 362 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 363 << " cannot be registered ---- decay List already existing" >> 364 << G4endl; >> 365 } >> 366 else >> 367 { >> 368 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 369 << " is registered" << G4endl; >> 370 RegisterPhysics( new HadrontherapyMuonStandard(name) ); >> 371 muonIsRegistered = true; >> 372 } >> 373 } >> 374 >> 375 // Register the decay process >> 376 if (name == "decay") >> 377 { >> 378 if (decayIsRegistered) >> 379 { >> 380 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 381 << " cannot be registered ---- decay List already existing" >> 382 << G4endl; >> 383 } >> 384 else >> 385 { >> 386 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 387 << " is registered" << G4endl; >> 388 RegisterPhysics( new HadrontherapyDecay(name) ); >> 389 decayIsRegistered = true; >> 390 } >> 391 } >> 392 >> 393 >> 394 //-------------------------------------------------------------------------------------------- >> 395 // Begin Hadronic Precompound models >> 396 //-------------------------------------------------------------------------------------------- >> 397 // >> 398 // Register the hadronic physics for protons, neutrons, ions >> 399 // >> 400 >> 401 //Precompound Default Evaporation >> 402 >> 403 if (name == "proton-precompound") >> 404 { >> 405 if (protonHadronicIsRegistered) >> 406 { >> 407 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 408 << " cannot be registered ---- decay List already existing" >> 409 << G4endl; >> 410 } >> 411 else >> 412 { >> 413 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name >> 414 << " is registered" << G4endl; >> 415 RegisterPhysics( new HadrontherapyProtonPrecompound(name) ); >> 416 protonHadronicIsRegistered = true; >> 417 } 218 } 418 } 219 419 220 else if (name == "QGSP_BIC"){ << 420 //------------------------------------------------------------------------------------------------- 221 auto physicsList = new QGSP_BIC; << 421 // End Hadronic Precompound models 222 G4RunManager::GetRunManager() -> SetUs << 422 //------------------------------------------------------------------------------------------------- 223 G4RunManager::GetRunManager() -> Physi << 423 224 physicsList -> RegisterPhysics(new G4P << 424 //-------------------------------------------------------------------------------------------- 225 } << 425 // Begin Hadronic Bertini model 226 << 426 //-------------------------------------------------------------------------------------------- 227 else if (name == "QGSP_BERT"){ << 427 228 auto physicsList = new QGSP_BERT; << 428 // Bertini model for protons, pions and neutrons 229 G4RunManager::GetRunManager() -> SetUs << 429 230 G4RunManager::GetRunManager() -> Physi << 430 if (name == "proton-bertini") 231 physicsList -> RegisterPhysics(new G4P << 431 { 232 } << 432 if (protonHadronicIsRegistered) 233 << 433 { 234 else if (name == "QGSP_BIC_AllHP"){ << 434 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name 235 auto physicsList = new QGSP_BIC_AllHP; << 435 << " cannot be registered ---- decay List already existing" 236 G4RunManager::GetRunManager() -> SetUs << 436 << G4endl; 237 G4RunManager::GetRunManager() -> Physi << 437 } 238 physicsList -> RegisterPhysics(new G4P << 438 else 239 } << 439 { 240 << 440 G4cout << "HadrontherapyPhysicsList::AddPhysicsList: " << name 241 else if (name == "QGSP_BIC_HP"){ << 441 << " is registered" << G4endl; 242 auto physicsList = new QGSP_BIC_HP; << 442 RegisterPhysics( new HadrontherapyProtonBertini(name) ); 243 G4RunManager::GetRunManager() -> SetUs << 443 protonHadronicIsRegistered = true; 244 G4RunManager::GetRunManager() -> Physi << 444 } 245 physicsList -> RegisterPhysics(new G4P << 445 246 } << 247 << 248 else if (name == "Shielding"){ << 249 auto physicsList = new Shielding; << 250 G4RunManager::GetRunManager() -> SetUs << 251 G4RunManager::GetRunManager() -> Physi << 252 physicsList -> RegisterPhysics(new G4P << 253 } << 254 << 255 else if (name == "QBBC"){ << 256 auto physicsList = new QBBC; << 257 G4RunManager::GetRunManager() -> SetUs << 258 G4RunManager::GetRunManager() -> Physi << 259 physicsList -> RegisterPhysics(new G4P << 260 } << 261 << 262 else { << 263 G4cout << "PhysicsList::AddPhysicsList << 264 << " is not defined" << 265 << G4endl; << 266 } 446 } 267 << 268 } << 269 447 270 ////////////////////////////////////////////// << 448 //-------------------------------------------------------------------------------------------- 271 void HadrontherapyPhysicsList::AddStepMax() << 449 // End Hadronic models 272 { << 450 //-------------------------------------------------------------------------------------------- 273 // Step limitation seen as a process << 451 274 // This process must exist in all threads. << 452 if (electronIsRegistered && positronIsRegistered && photonIsRegistered && 275 // << 453 ionIsRegistered) 276 HadrontherapyStepMax* stepMaxProcess = ne << 454 { 277 << 455 G4cout << 278 << 456 "Electromagnetic physics is registered for electron, positron, photons, protons" 279 auto particleIterator = GetParticleIterato << 457 << G4endl; 280 particleIterator->reset(); << 281 while ((*particleIterator)()){ << 282 G4ParticleDefinition* particle = parti << 283 G4ProcessManager* pmanager = particle- << 284 << 285 if (stepMaxProcess->IsApplicable(*part << 286 { << 287 pmanager ->AddDiscreteProcess(step << 288 } << 289 } 458 } >> 459 >> 460 if (protonHadronicIsRegistered && muonIsRegistered && decayIsRegistered) >> 461 { >> 462 G4cout << " Hadronic physics is registered" << G4endl; >> 463 } 290 } 464 } >> 465 >> 466 void HadrontherapyPhysicsList::SetCuts() >> 467 { >> 468 // Set the threshold of production equal to the defaultCutValue >> 469 // in the experimental set-up >> 470 G4VUserPhysicsList::SetCutsWithDefault(); >> 471 >> 472 G4double lowlimit=250*eV; >> 473 G4ProductionCutsTable::GetProductionCutsTable() ->SetEnergyRange(lowlimit, 100.*GeV); >> 474 // Definition of a smaller threshold of production in the phantom region >> 475 // where high accuracy is required in the energy deposit calculation >> 476 >> 477 G4String regionName = "PhantomLog"; >> 478 G4Region* region = G4RegionStore::GetInstance()->GetRegion(regionName); >> 479 G4ProductionCuts* cuts = new G4ProductionCuts ; >> 480 G4double regionCut = 0.01*mm; >> 481 cuts -> SetProductionCut(regionCut,G4ProductionCuts::GetIndex("gamma")); >> 482 cuts -> SetProductionCut(regionCut,G4ProductionCuts::GetIndex("e-")); >> 483 cuts -> SetProductionCut(regionCut,G4ProductionCuts::GetIndex("e+")); >> 484 cuts -> SetProductionCut(regionCut,G4ProductionCuts::GetIndex("proton")); >> 485 cuts -> SetProductionCut(regionCut,G4ProductionCuts::GetIndex("genericIons")); >> 486 region -> SetProductionCuts(cuts); >> 487 >> 488 if (verboseLevel>0) DumpCutValuesTable(); >> 489 } >> 490 >> 491 291 492