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 // $Id: G4PhysListFactory.cc,v 1.16 2010-11-19 19:50:15 vnivanch Exp $ >> 27 // GEANT4 tag $Name: not supported by cvs2svn $ 26 // 28 // 27 //-------------------------------------------- 29 //--------------------------------------------------------------------------- 28 // 30 // 29 // ClassName: G4PhysListFactory 31 // ClassName: G4PhysListFactory 30 // 32 // 31 // Author: 21 April 2008 V. Ivanchenko 33 // Author: 21 April 2008 V. Ivanchenko 32 // 34 // 33 // Modified: 35 // Modified: 34 // 36 // 35 // 2023.04.12 A.Ribon added _HPT variants (i.e << 36 // 2014.08.05 K.L.Genser used provision for Ha << 37 // Shielding for ShieldingM << 38 // << 39 //-------------------------------------------- 37 //---------------------------------------------------------------------------- 40 // 38 // 41 39 42 #include "G4PhysListFactory.hh" 40 #include "G4PhysListFactory.hh" >> 41 #include "CHIPS.hh" 43 #include "FTFP_BERT.hh" 42 #include "FTFP_BERT.hh" 44 #include "FTFP_BERT_HP.hh" << 43 #include "FTFP_BERT_EMV.hh" >> 44 #include "FTFP_BERT_EMX.hh" 45 #include "FTFP_BERT_TRV.hh" 45 #include "FTFP_BERT_TRV.hh" 46 #include "FTFP_BERT_ATL.hh" << 47 #include "FTFQGSP_BERT.hh" << 48 #include "FTFP_INCLXX.hh" << 49 #include "FTFP_INCLXX_HP.hh" << 50 #include "FTF_BIC.hh" 46 #include "FTF_BIC.hh" 51 #include "LBE.hh" 47 #include "LBE.hh" >> 48 #include "LHEP.hh" >> 49 #include "LHEP_EMV.hh" 52 #include "QBBC.hh" 50 #include "QBBC.hh" >> 51 #include "QGSC_BERT.hh" >> 52 #include "QGSP.hh" 53 #include "QGSP_BERT.hh" 53 #include "QGSP_BERT.hh" >> 54 #include "QGSP_BERT_EMV.hh" >> 55 #include "QGSP_BERT_EMX.hh" 54 #include "QGSP_BERT_HP.hh" 56 #include "QGSP_BERT_HP.hh" >> 57 #include "QGSP_BERT_NOLEP.hh" >> 58 #include "QGSP_BERT_TRV.hh" >> 59 #include "QGSP_BERT_CHIPS.hh" 55 #include "QGSP_BIC.hh" 60 #include "QGSP_BIC.hh" >> 61 #include "QGSP_BIC_EMY.hh" 56 #include "QGSP_BIC_HP.hh" 62 #include "QGSP_BIC_HP.hh" 57 #include "QGSP_BIC_HPT.hh" << 58 #include "QGSP_BIC_AllHP.hh" << 59 #include "QGSP_FTFP_BERT.hh" 63 #include "QGSP_FTFP_BERT.hh" 60 #include "QGS_BIC.hh" 64 #include "QGS_BIC.hh" 61 #include "QGSP_INCLXX.hh" << 65 #include "QGSP_INCL_ABLA.hh" 62 #include "QGSP_INCLXX_HP.hh" << 63 #include "Shielding.hh" 66 #include "Shielding.hh" 64 #include "ShieldingLEND.hh" << 65 #include "NuBeam.hh" << 66 #include "G4ThermalNeutrons.hh" << 67 << 68 #include "G4EmStandardPhysics.hh" << 69 #include "G4EmStandardPhysics_option1.hh" << 70 #include "G4EmStandardPhysics_option2.hh" << 71 #include "G4EmStandardPhysics_option3.hh" << 72 #include "G4EmStandardPhysics_option4.hh" << 73 #include "G4EmStandardPhysicsGS.hh" << 74 #include "G4EmStandardPhysicsSS.hh" << 75 #include "G4EmStandardPhysicsWVI.hh" << 76 #include "G4EmLowEPPhysics.hh" << 77 #include "G4EmLivermorePhysics.hh" << 78 #include "G4EmPenelopePhysics.hh" << 79 #include "G4PhysListFactoryMessenger.hh" << 80 #include "G4UImessenger.hh" << 81 67 82 G4PhysListFactory::G4PhysListFactory(G4int ver << 68 G4PhysListFactory::G4PhysListFactory() 83 : defName("FTFP_BERT"),verbose(ver),theMesse << 84 { 69 { 85 nlists_hadr = 36; << 70 defName = "QGSP_BERT"; 86 G4String ss[36] = { << 71 nlists = 26; 87 "FTFP_BERT","FTFP_BERT_TRV","FTFP_BERT_ATL << 72 G4String s[26] = { 88 "FTFP_INCLXX","FTFP_INCLXX_HP","FTF_BIC"," << 73 "CHIPS", 89 "QGSP_BERT","QGSP_BERT_HP","QGSP_BIC","QGS << 74 "FTFP_BERT","FTFP_BERT_EMV","FTFP_BERT_EMX","FTFP_BERT_TRV","FTF_BIC", 90 "QGSP_FTFP_BERT","QGSP_INCLXX","QGSP_INCLX << 75 "LBE","LHEP","LHEP_EMV", 91 "Shielding","ShieldingLEND","ShieldingLIQM << 76 "QBBC", 92 "Shielding_HP","ShieldingLIQMD_HP","Shield << 77 "QGSC_BERT","QGSP", 93 "FTFP_BERT_HPT","FTFP_INCLXX_HPT","QGSP_BE << 78 "QGSP_BERT","QGSP_BERT_EMV","QGSP_BERT_EMX","QGSP_BERT_HP", 94 "QGSP_BIC_AllHPT","QGSP_INCLXX_HPT","Shiel << 79 "QGSP_BERT_NOLEP","QGSP_BERT_TRV","QGSP_BERT_CHIPS", 95 "ShieldingM_HPT"}; << 80 "QGSP_BIC","QGSP_BIC_EMY","QGSP_BIC_HP", 96 for (std::size_t i=0; i<nlists_hadr; ++i) { << 81 "QGSP_FTFP_BERT","QGS_BIC", "QGSP_INCL_ABLA", 97 listnames_hadr.push_back(ss[i]); << 82 "Shielding"}; 98 } << 99 83 100 nlists_em = 12; << 84 for(size_t i=0; i<nlists; ++i) { 101 G4String s1[12] = {"","_EMV","_EMX","_EMY"," << 85 listnames.push_back(s[i]); 102 "__GS","__SS","_EM0","_WVI","__LE"}; << 103 for (std::size_t i=0; i<nlists_em; ++i) { << 104 listnames_em.push_back(s1[i]); << 105 } 86 } 106 } 87 } 107 88 108 G4PhysListFactory::~G4PhysListFactory() 89 G4PhysListFactory::~G4PhysListFactory() 109 { << 90 {} 110 delete theMessenger; << 111 } << 112 91 113 G4VModularPhysicsList* << 92 G4VModularPhysicsList* G4PhysListFactory::ReferencePhysList() 114 G4PhysListFactory::ReferencePhysList() << 115 { 93 { 116 // instantiate PhysList by environment varia 94 // instantiate PhysList by environment variable "PHYSLIST" 117 G4String name = ""; 95 G4String name = ""; 118 char* path = std::getenv("PHYSLIST"); << 96 char* path = getenv("PHYSLIST"); 119 if (path) { 97 if (path) { 120 name = G4String(path); 98 name = G4String(path); 121 } else { 99 } else { 122 name = defName; 100 name = defName; 123 G4cout << "### G4PhysListFactory WARNING: 101 G4cout << "### G4PhysListFactory WARNING: " 124 << " environment variable PHYSLIST is not 102 << " environment variable PHYSLIST is not defined" 125 << G4endl 103 << G4endl 126 << " Default Physics Lists " << name 104 << " Default Physics Lists " << name 127 << " is instantiated" 105 << " is instantiated" 128 << G4endl; 106 << G4endl; 129 } 107 } 130 return GetReferencePhysList(name); 108 return GetReferencePhysList(name); 131 } 109 } 132 110 133 G4VModularPhysicsList* << 111 G4VModularPhysicsList* G4PhysListFactory::GetReferencePhysList( 134 G4PhysListFactory::GetReferencePhysList(const << 112 const G4String& name) 135 { 113 { 136 // analysis on the string << 114 G4VModularPhysicsList* p = 0; 137 std::size_t n = name.size(); << 115 if(name == "CHIPS") {p = new CHIPS();} 138 << 116 else if(name == "FTFP_BERT") {p = new FTFP_BERT();} 139 // last characters in the string << 117 else if(name == "FTFP_BERT_EMV") {p = new FTFP_BERT_EMV();} 140 size_t em_opt = 0; << 118 else if(name == "FTFP_BERT_EMX") {p = new FTFP_BERT_EMX();} 141 G4String em_name = ""; << 119 else if(name == "FTFP_BERT_TRV") {p = new FTFP_BERT_TRV();} 142 << 120 else if(name == "FTF_BIC") {p = new FTF_BIC();} 143 // check EM options << 121 else if(name == "LBE") {p = new LBE();} 144 if(n > 4) { << 122 else if(name == "LHEP") {p = new LHEP();} 145 em_name = name.substr(n - 4, 4); << 123 else if(name == "LHEP_EMV") {p = new LHEP_EMV();} 146 for (std::size_t i=1; i<nlists_em; ++i) { << 124 else if(name == "QBBC") {p = new QBBC();} 147 if(listnames_em[i] == em_name) { << 125 else if(name == "QGSC_BERT") {p = new QGSC_BERT();} 148 em_opt = i; << 126 else if(name == "QGSP") {p = new QGSP();} 149 n -= 4; << 127 else if(name == "QGSP_BERT") {p = new QGSP_BERT();} 150 break; << 128 else if(name == "QGSP_BERT_EMV") {p = new QGSP_BERT_EMV();} 151 } << 129 else if(name == "QGSP_BERT_EMX") {p = new QGSP_BERT_EMX();} 152 } << 130 else if(name == "QGSP_BERT_HP") {p = new QGSP_BERT_HP();} 153 if(0 == em_opt) { em_name = ""; } << 131 else if(name == "QGSP_BERT_NOLEP") {p = new QGSP_BERT_NOLEP();} 154 } << 132 else if(name == "QGSP_BERT_TRV") {p = new QGSP_BERT_TRV();} 155 << 133 else if(name == "QGSP_BERT_CHIPS") {p = new QGSP_BERT_CHIPS();} 156 // hadronic pHysics List << 134 else if(name == "QGSP_BIC") {p = new QGSP_BIC();} 157 G4String had_name = name.substr(0, n); << 135 else if(name == "QGSP_BIC_EMY") {p = new QGSP_BIC_EMY();} 158 << 136 else if(name == "QGSP_BIC_HP") {p = new QGSP_BIC_HP();} 159 if(0 < verbose) { << 137 else if(name == "QGSP_FTFP_BERT"){p = new QGSP_FTFP_BERT();} 160 G4cout << "G4PhysListFactory::GetReference << 138 else if(name == "QGS_BIC") {p = new QGS_BIC();} 161 << em_name << "> EMoption= " << em_opt < << 139 else if(name == "QGSP_INCL_ABLA"){p = new QGSP_INCL_ABLA();} 162 } << 140 else if(name == "Shielding") {p = new Shielding();} 163 G4VModularPhysicsList* p = nullptr; << 164 if(had_name == "FTFP_BERT") {p << 165 else if(had_name == "FTFP_BERT_HP") {p << 166 else if(had_name == "FTFP_BERT_TRV") {p << 167 else if(had_name == "FTFP_BERT_ATL") {p << 168 else if(had_name == "FTFQGSP_BERT") {p << 169 else if(had_name == "FTFP_INCLXX") {p << 170 else if(had_name == "FTFP_INCLXX_HP") {p << 171 else if(had_name == "FTF_BIC") {p << 172 else if(had_name == "LBE") {p << 173 else if(had_name == "QBBC") {p << 174 else if(had_name == "QGSP_BERT") {p << 175 else if(had_name == "QGSP_BERT_HP") {p << 176 else if(had_name == "QGSP_BIC") {p << 177 else if(had_name == "QGSP_BIC_HP") {p << 178 else if(had_name == "QGSP_BIC_AllHP") {p << 179 else if(had_name == "QGSP_FTFP_BERT") {p << 180 else if(had_name == "QGSP_INCLXX") {p << 181 else if(had_name == "QGSP_INCLXX_HP") {p << 182 else if(had_name == "QGS_BIC") {p << 183 else if(had_name == "Shielding") {p << 184 else if(had_name == "ShieldingLEND") {p << 185 else if(had_name == "ShieldingLIQMD") {p << 186 else if(had_name == "ShieldingM") {p << 187 else if(had_name == "NuBeam") {p << 188 else if(had_name == "Shielding_HP") {p << 189 else if(had_name == "ShieldingLIQMD_HP") {p << 190 else if(had_name == "ShieldingM_HP") {p << 191 else if(had_name == "FTFP_BERT_HPT") {p << 192 p << 193 else if(had_name == "FTFP_INCLXX_HPT") {p << 194 p << 195 else if(had_name == "QGSP_BERT_HPT") {p << 196 p << 197 else if(had_name == "QGSP_BIC_HPT") {p << 198 else if(had_name == "QGSP_BIC_AllHPT") {p << 199 p << 200 else if(had_name == "QGSP_INCLXX_HPT") {p << 201 p << 202 else if(had_name == "Shielding_HPT") {p << 203 p << 204 else if(had_name == "ShieldingLIQMD_HPT") {p << 205 p << 206 else if(had_name == "ShieldingM_HPT") {p << 207 p << 208 else { 141 else { 209 p = new FTFP_BERT(verbose); << 142 G4cout << "### G4PhysListFactory WARNING: " 210 G4ExceptionDescription ed; << 143 << "PhysicsList " << name << " is not known" 211 ed << "PhysicsList " << had_name << " is n << 144 << G4endl; 212 << " the default FTFP_BERT is created"; << 145 // << " Default Physics Lists " << defName 213 G4Exception("G4PhysListFactory: ","pl0003" << 146 // << " is instantiated" 214 } << 147 // << G4endl; 215 if(nullptr != p) { << 148 // p = new QGSP_BERT(); 216 if(0 < em_opt && had_name != "LBE") { << 217 if(1 == em_opt) { << 218 p->ReplacePhysics(new G4EmStandardPhysics_op << 219 } else if(2 == em_opt) { << 220 p->ReplacePhysics(new G4EmStandardPhysics_op << 221 } else if(3 == em_opt) { << 222 p->ReplacePhysics(new G4EmStandardPhysics_op << 223 } else if(4 == em_opt) { << 224 p->ReplacePhysics(new G4EmStandardPhysics_op << 225 } else if(5 == em_opt) { << 226 p->ReplacePhysics(new G4EmLivermorePhysics(v << 227 } else if(6 == em_opt) { << 228 p->ReplacePhysics(new G4EmPenelopePhysics(ve << 229 } else if(7 == em_opt) { << 230 p->ReplacePhysics(new G4EmStandardPhysicsGS( << 231 } else if(8 == em_opt) { << 232 p->ReplacePhysics(new G4EmStandardPhysicsSS( << 233 } else if(9 == em_opt) { << 234 p->ReplacePhysics(new G4EmStandardPhysics(ve << 235 } else if(10 == em_opt) { << 236 p->ReplacePhysics(new G4EmStandardPhysicsWVI << 237 } else if(11 == em_opt) { << 238 p->ReplacePhysics(new G4EmLowEPPhysics(verbo << 239 } << 240 } << 241 theMessenger = new G4PhysListFactoryMessen << 242 } 149 } 243 if(0 < verbose) G4cout << G4endl; << 244 return p; 150 return p; 245 } 151 } 246 152 247 G4bool G4PhysListFactory::IsReferencePhysList( << 153 G4bool G4PhysListFactory::IsReferencePhysList(const G4String& name) 248 { 154 { 249 G4bool res = false; 155 G4bool res = false; 250 std::size_t n = name.size(); << 156 for(size_t i=0; i<nlists; i++) { 251 if(n > 4) { << 157 if(name == listnames[i]) { 252 G4String em_name = name.substr(n - 4, 4); << 253 for (std::size_t i=1; i<nlists_em; ++i) { << 254 if(listnames_em[i] == em_name) { << 255 n -= 4; << 256 break; << 257 } << 258 } << 259 } << 260 G4String had_name = name.substr(0, n); << 261 for (std::size_t i=0; i<nlists_hadr; ++i) { << 262 if(had_name == listnames_hadr[i]) { << 263 res = true; 158 res = true; 264 break; 159 break; 265 } 160 } 266 } 161 } 267 return res; 162 return res; 268 } 163 } 269 164 270 const std::vector<G4String>& 165 const std::vector<G4String>& 271 G4PhysListFactory::AvailablePhysLists() const 166 G4PhysListFactory::AvailablePhysLists() const 272 { 167 { 273 return listnames_hadr; << 168 return listnames; 274 } << 275 << 276 const std::vector<G4String>& << 277 G4PhysListFactory::AvailablePhysListsEM() cons << 278 { << 279 return listnames_em; << 280 } 169 } 281 170 282 171