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: G4DeexPrecoParameters.cc 68028 2013-03-13 13:48:15Z gcosmo $ >> 27 // 26 // 15.03.2016 V.Ivanchenko 28 // 15.03.2016 V.Ivanchenko 27 // 29 // 28 // List of parameters of the pre-compound mode 30 // List of parameters of the pre-compound model 29 // and the deexcitation module 31 // and the deexcitation module 30 // 32 // 31 33 32 #include "G4DeexPrecoParameters.hh" 34 #include "G4DeexPrecoParameters.hh" 33 #include "G4ApplicationState.hh" 35 #include "G4ApplicationState.hh" 34 #include "G4StateManager.hh" 36 #include "G4StateManager.hh" 35 #include "G4SystemOfUnits.hh" 37 #include "G4SystemOfUnits.hh" 36 #include "G4UnitsTable.hh" << 37 #include "G4PhysicsModelCatalog.hh" 38 #include "G4PhysicsModelCatalog.hh" 38 #include "G4DeexParametersMessenger.hh" 39 #include "G4DeexParametersMessenger.hh" 39 #include "G4HadronicParameters.hh" << 40 40 #include "G4Threading.hh" << 41 #ifdef G4MULTITHREADED >> 42 G4Mutex G4DeexPrecoParameters::deexPrecoMutex = G4MUTEX_INITIALIZER; >> 43 #endif 41 44 42 G4DeexPrecoParameters::G4DeexPrecoParameters() 45 G4DeexPrecoParameters::G4DeexPrecoParameters() 43 { 46 { 44 fStateManager = G4StateManager::GetStateMana << 47 SetDefaults(); 45 theMessenger = new G4DeexParametersMessenger << 46 Initialise(); << 47 } 48 } 48 49 49 G4DeexPrecoParameters::~G4DeexPrecoParameters( 50 G4DeexPrecoParameters::~G4DeexPrecoParameters() 50 { 51 { 51 delete theMessenger; 52 delete theMessenger; 52 } 53 } 53 54 54 void G4DeexPrecoParameters::SetDefaults() 55 void G4DeexPrecoParameters::SetDefaults() 55 { 56 { 56 if(!IsLocked()) { Initialise(); } << 57 #ifdef G4MULTITHREADED 57 } << 58 G4MUTEXLOCK(&G4DeexPrecoParameters::deexPrecoMutex); >> 59 #endif >> 60 fStateManager = G4StateManager::GetStateManager(); >> 61 theMessenger = new G4DeexParametersMessenger(this); 58 62 59 void G4DeexPrecoParameters::Initialise() << 63 fLevelDensity = 0.10/CLHEP::MeV; 60 { << 61 // common parameters << 62 fVerbose = 1; << 63 fLevelDensity = 0.075/CLHEP::MeV; << 64 fR0 = 1.5*CLHEP::fermi; 64 fR0 = 1.5*CLHEP::fermi; 65 fTransitionsR0 = 0.6*CLHEP::fermi; 65 fTransitionsR0 = 0.6*CLHEP::fermi; 66 << 66 fFermiEnergy = 35.0*CLHEP::MeV; 67 // preco parameters << 67 fPrecoLowEnergy = 0.1*CLHEP::MeV; 68 fPrecoLowEnergy = 0.1*CLHEP::MeV; << 68 fPhenoFactor = 1.0; 69 fPrecoHighEnergy = 30*CLHEP::MeV; << 69 fMinExcitation = 10*CLHEP::eV; 70 fPhenoFactor = 1.0; << 70 fMaxLifeTime = 1000*CLHEP::second; 71 << 71 fMinExPerNucleounForMF = 100*CLHEP::GeV; 72 fPrecoType = 1; << 73 fMinZForPreco = 3; 72 fMinZForPreco = 3; 74 fMinAForPreco = 5; 73 fMinAForPreco = 5; 75 << 74 fPrecoType = 3; >> 75 fDeexType = 3; >> 76 fTwoJMAX = 10; 76 fNeverGoBack = false; 77 fNeverGoBack = false; 77 fUseSoftCutoff = false; 78 fUseSoftCutoff = false; 78 fUseCEM = true; 79 fUseCEM = true; 79 fUseGNASH = false; 80 fUseGNASH = false; 80 fUseHETC = false; 81 fUseHETC = false; 81 fUseAngularGen = true; 82 fUseAngularGen = true; 82 fPrecoDummy = false; 83 fPrecoDummy = false; 83 << 84 // de-exitation parameters << 85 fMinExcitation = 10*CLHEP::eV; << 86 fNuclearLevelWidth = 0.2*CLHEP::MeV; << 87 fFBUEnergyLimit = 20.0*CLHEP::MeV; << 88 fFermiEnergy = 35.0*CLHEP::MeV; << 89 fMaxLifeTime = 1*CLHEP::nanosecond; << 90 fMinExPerNucleounForMF = 200*CLHEP::GeV; << 91 << 92 fDeexChannelType = fCombined; << 93 fDeexType = 3; << 94 fTwoJMAX = 10; << 95 << 96 fCorrelatedGamma = false; 84 fCorrelatedGamma = false; 97 fStoreAllLevels = true; << 85 fStoreAllLevels = false; 98 fInternalConversion = true; 86 fInternalConversion = true; 99 fLD = true; // use simple level density mod << 87 fDeexChannelType = fEvaporation; 100 fFD = false; // use transition to discrete l << 88 fInternalConversionID = 101 fIsomerFlag = true; // enable isomere produc << 89 G4PhysicsModelCatalog::Register("e-InternalConvertion"); >> 90 #ifdef G4MULTITHREADED >> 91 G4MUTEXUNLOCK(&G4DeexPrecoParameters::deexPrecoMutex); >> 92 #endif 102 } 93 } 103 94 104 void G4DeexPrecoParameters::SetLevelDensity(G4 95 void G4DeexPrecoParameters::SetLevelDensity(G4double val) 105 { 96 { 106 if(IsLocked() || val <= 0.0) { return; } << 97 if(IsLocked()) { return; } 107 fLevelDensity = val/CLHEP::MeV; 98 fLevelDensity = val/CLHEP::MeV; 108 } 99 } 109 100 110 void G4DeexPrecoParameters::SetR0(G4double val 101 void G4DeexPrecoParameters::SetR0(G4double val) 111 { 102 { 112 if(IsLocked() || val <= 0.0) { return; } << 103 if(IsLocked()) { return; } 113 fR0 = val; 104 fR0 = val; 114 } 105 } 115 106 116 void G4DeexPrecoParameters::SetTransitionsR0(G 107 void G4DeexPrecoParameters::SetTransitionsR0(G4double val) 117 { 108 { 118 if(IsLocked() || val <= 0.0) { return; } << 109 if(IsLocked()) { return; } 119 fTransitionsR0 = val; 110 fTransitionsR0 = val; 120 } 111 } 121 112 122 void G4DeexPrecoParameters::SetFBUEnergyLimit( << 123 { << 124 if(IsLocked() || val <= 0.0) { return; } << 125 fFBUEnergyLimit = val; << 126 } << 127 << 128 void G4DeexPrecoParameters::SetFermiEnergy(G4d 113 void G4DeexPrecoParameters::SetFermiEnergy(G4double val) 129 { 114 { 130 if(IsLocked() || val <= 0.0) { return; } << 115 if(IsLocked()) { return; } 131 fFermiEnergy = val; 116 fFermiEnergy = val; 132 } 117 } 133 118 134 void G4DeexPrecoParameters::SetPrecoLowEnergy( 119 void G4DeexPrecoParameters::SetPrecoLowEnergy(G4double val) 135 { 120 { 136 if(IsLocked() || val < 0.0) { return; } << 121 if(IsLocked()) { return; } 137 fPrecoLowEnergy = val; 122 fPrecoLowEnergy = val; 138 } 123 } 139 124 140 void G4DeexPrecoParameters::SetPrecoHighEnergy << 141 { << 142 if(IsLocked() || val < 0.0) { return; } << 143 fPrecoHighEnergy = val; << 144 } << 145 << 146 void G4DeexPrecoParameters::SetPhenoFactor(G4d 125 void G4DeexPrecoParameters::SetPhenoFactor(G4double val) 147 { 126 { 148 if(IsLocked() || val <= 0.0) { return; } << 127 if(IsLocked()) { return; } 149 fPhenoFactor = val; 128 fPhenoFactor = val; 150 } 129 } 151 130 152 void G4DeexPrecoParameters::SetMinExcitation(G 131 void G4DeexPrecoParameters::SetMinExcitation(G4double val) 153 { 132 { 154 if(IsLocked() || val < 0.0) { return; } << 133 if(IsLocked()) { return; } 155 fMinExcitation = val; 134 fMinExcitation = val; 156 } 135 } 157 136 158 void G4DeexPrecoParameters::SetNuclearLevelWid << 159 { << 160 if(IsLocked() || val < 0.0) { return; } << 161 fNuclearLevelWidth = val; << 162 } << 163 << 164 void G4DeexPrecoParameters::SetMaxLifeTime(G4d 137 void G4DeexPrecoParameters::SetMaxLifeTime(G4double val) 165 { 138 { 166 if(IsLocked() || val < 0.0) { return; } << 139 if(IsLocked()) { return; } 167 fMaxLifeTime = val; 140 fMaxLifeTime = val; 168 } 141 } 169 142 170 void G4DeexPrecoParameters::SetMinExPerNucleou 143 void G4DeexPrecoParameters::SetMinExPerNucleounForMF(G4double val) 171 { 144 { 172 if(IsLocked() || val < 0.0) { return; } << 145 if(IsLocked()) { return; } 173 fMinExPerNucleounForMF = val; 146 fMinExPerNucleounForMF = val; 174 } 147 } 175 148 176 void G4DeexPrecoParameters::SetMinZForPreco(G4 149 void G4DeexPrecoParameters::SetMinZForPreco(G4int n) 177 { 150 { 178 if(IsLocked() || n < 2) { return; } << 151 if(IsLocked() && n < 2) { return; } 179 fMinZForPreco = n; 152 fMinZForPreco = n; 180 } 153 } 181 154 182 void G4DeexPrecoParameters::SetMinAForPreco(G4 155 void G4DeexPrecoParameters::SetMinAForPreco(G4int n) 183 { 156 { 184 if(IsLocked() || n < 0) { return; } << 157 if(IsLocked() && n < 0) { return; } 185 fMinAForPreco = n; 158 fMinAForPreco = n; 186 } 159 } 187 160 188 void G4DeexPrecoParameters::SetPrecoModelType( 161 void G4DeexPrecoParameters::SetPrecoModelType(G4int n) 189 { 162 { 190 if(IsLocked() || n < 0 || n > 3) { return; } << 163 if(IsLocked() && n < 0) { return; } 191 fPrecoType = n; 164 fPrecoType = n; 192 } 165 } 193 166 194 void G4DeexPrecoParameters::SetDeexModelType(G 167 void G4DeexPrecoParameters::SetDeexModelType(G4int n) 195 { 168 { 196 if(IsLocked() || n < 0 || n > 3) { return; } << 169 if(IsLocked() && n < 0) { return; } 197 fDeexType = n; 170 fDeexType = n; 198 } 171 } 199 172 200 void G4DeexPrecoParameters::SetTwoJMAX(G4int n 173 void G4DeexPrecoParameters::SetTwoJMAX(G4int n) 201 { 174 { 202 if(IsLocked() || n < 0) { return; } << 175 if(IsLocked() && n < 0) { return; } 203 fTwoJMAX = n; 176 fTwoJMAX = n; 204 } 177 } 205 178 206 void G4DeexPrecoParameters::SetVerbose(G4int n << 207 { << 208 if(IsLocked()) { return; } << 209 fVerbose = n; << 210 } << 211 << 212 void G4DeexPrecoParameters::SetNeverGoBack(G4b 179 void G4DeexPrecoParameters::SetNeverGoBack(G4bool val) 213 { 180 { 214 if(IsLocked()) { return; } 181 if(IsLocked()) { return; } 215 fNeverGoBack = val; 182 fNeverGoBack = val; 216 } 183 } 217 184 218 void G4DeexPrecoParameters::SetUseSoftCutoff(G 185 void G4DeexPrecoParameters::SetUseSoftCutoff(G4bool val) 219 { 186 { 220 if(IsLocked()) { return; } 187 if(IsLocked()) { return; } 221 fUseSoftCutoff = val; 188 fUseSoftCutoff = val; 222 } 189 } 223 190 224 void G4DeexPrecoParameters::SetUseCEM(G4bool v 191 void G4DeexPrecoParameters::SetUseCEM(G4bool val) 225 { 192 { 226 if(IsLocked()) { return; } 193 if(IsLocked()) { return; } 227 fUseCEM = val; 194 fUseCEM = val; 228 } 195 } 229 196 230 void G4DeexPrecoParameters::SetUseGNASH(G4bool 197 void G4DeexPrecoParameters::SetUseGNASH(G4bool val) 231 { 198 { 232 if(IsLocked()) { return; } 199 if(IsLocked()) { return; } 233 fUseGNASH = val; 200 fUseGNASH = val; 234 } 201 } 235 202 236 void G4DeexPrecoParameters::SetUseHETC(G4bool 203 void G4DeexPrecoParameters::SetUseHETC(G4bool val) 237 { 204 { 238 if(IsLocked()) { return; } 205 if(IsLocked()) { return; } 239 fUseHETC = val; 206 fUseHETC = val; 240 } 207 } 241 208 242 void G4DeexPrecoParameters::SetUseAngularGen(G 209 void G4DeexPrecoParameters::SetUseAngularGen(G4bool val) 243 { 210 { 244 if(IsLocked()) { return; } 211 if(IsLocked()) { return; } 245 fUseAngularGen = val; 212 fUseAngularGen = val; 246 } 213 } 247 214 248 void G4DeexPrecoParameters::SetPrecoDummy(G4bo 215 void G4DeexPrecoParameters::SetPrecoDummy(G4bool val) 249 { 216 { 250 if(IsLocked()) { return; } 217 if(IsLocked()) { return; } 251 fPrecoDummy = val; 218 fPrecoDummy = val; 252 fDeexChannelType = fDummy; 219 fDeexChannelType = fDummy; 253 } 220 } 254 221 255 void G4DeexPrecoParameters::SetCorrelatedGamma 222 void G4DeexPrecoParameters::SetCorrelatedGamma(G4bool val) 256 { 223 { 257 if(IsLocked()) { return; } 224 if(IsLocked()) { return; } 258 fCorrelatedGamma = val; 225 fCorrelatedGamma = val; 259 } 226 } 260 227 261 void G4DeexPrecoParameters::SetStoreICLevelDat 228 void G4DeexPrecoParameters::SetStoreICLevelData(G4bool val) 262 { 229 { 263 if(IsLocked()) { return; } 230 if(IsLocked()) { return; } 264 fStoreAllLevels = val; 231 fStoreAllLevels = val; 265 } 232 } 266 233 267 void G4DeexPrecoParameters::SetStoreAllLevels( 234 void G4DeexPrecoParameters::SetStoreAllLevels(G4bool val) 268 { 235 { 269 SetStoreICLevelData(val); 236 SetStoreICLevelData(val); 270 } 237 } 271 238 272 void G4DeexPrecoParameters::SetInternalConvers 239 void G4DeexPrecoParameters::SetInternalConversionFlag(G4bool val) 273 { 240 { 274 if(IsLocked()) { return; } 241 if(IsLocked()) { return; } 275 fInternalConversion = val; 242 fInternalConversion = val; 276 } 243 } 277 244 278 void G4DeexPrecoParameters::SetLevelDensityFla << 279 { << 280 if(IsLocked()) { return; } << 281 fLD = val; << 282 } << 283 << 284 void G4DeexPrecoParameters::SetDiscreteExcitat << 285 { << 286 if(IsLocked()) { return; } << 287 fFD = val; << 288 } << 289 << 290 void G4DeexPrecoParameters::SetIsomerProductio << 291 { << 292 if(IsLocked()) { return; } << 293 fIsomerFlag = val; << 294 } << 295 << 296 void G4DeexPrecoParameters::SetDeexChannelsTyp 245 void G4DeexPrecoParameters::SetDeexChannelsType(G4DeexChannelType val) 297 { 246 { 298 if(IsLocked()) { return; } 247 if(IsLocked()) { return; } 299 fDeexChannelType = val; 248 fDeexChannelType = val; 300 } 249 } 301 250 302 std::ostream& G4DeexPrecoParameters::StreamInf 251 std::ostream& G4DeexPrecoParameters::StreamInfo(std::ostream& os) const 303 { 252 { 304 static const G4String namm[5] = {"Evaporatio << 253 static const G4String namm[4] = {"Evaporation","GEM","Evaporation+GEM","Dummy"}; 305 static const G4int nmm[5] = {8, 68, 68, 31, << 254 static const G4int nmm[4] = {8, 68, 68, 0}; 306 G4int idx = fDeexChannelType; << 255 size_t idx = (size_t)fDeexChannelType; 307 256 308 G4long prec = os.precision(5); << 257 G4int prec = os.precision(5); 309 os << "===================================== 258 os << "=======================================================================" << "\n"; 310 os << "====== Geant4 Native Pre-compou << 259 os << "====== Pre-compound/De-excitation Physics Parameters ========" << "\n"; 311 os << "===================================== 260 os << "=======================================================================" << "\n"; 312 os << "Type of pre-compound inverse x-sectio 261 os << "Type of pre-compound inverse x-section " << fPrecoType << "\n"; 313 os << "Pre-compound model active 262 os << "Pre-compound model active " << (!fPrecoDummy) << "\n"; 314 os << "Pre-compound excitation low energy << 263 os << "Pre-compound low energy (MeV) " 315 << G4BestUnit(fPrecoLowEnergy, "Energy") << 264 << fPrecoLowEnergy/CLHEP::MeV << "\n"; 316 os << "Pre-compound excitation high energy << 317 << G4BestUnit(fPrecoHighEnergy, "Energy") << 318 os << "Angular generator for pre-compound mo << 319 os << "Use NeverGoBack option for pre-compou << 320 os << "Use SoftCutOff option for pre-compoun << 321 os << "Use CEM transitions for pre-compound << 322 os << "Use GNASH transitions for pre-compoun << 323 os << "Use HETC submodel for pre-compound mo << 324 os << "===================================== << 325 os << "====== Nuclear De-excitation Mo << 326 os << "===================================== << 327 os << "Type of de-excitation inverse x-secti 265 os << "Type of de-excitation inverse x-section " << fDeexType << "\n"; 328 os << "Type of de-excitation factory 266 os << "Type of de-excitation factory " << namm[idx] << "\n"; 329 os << "Number of de-excitation channels 267 os << "Number of de-excitation channels " << nmm[idx] << "\n"; 330 os << "Min excitation energy << 268 os << "Min excitation energy (keV) " 331 << G4BestUnit(fMinExcitation, "Energy") < << 269 << fMinExcitation/CLHEP::keV << "\n"; 332 os << "Min energy per nucleon for multifragm << 270 os << "Min energy per nucleon for multifragmentation (MeV) " 333 << G4BestUnit(fMinExPerNucleounForMF, "En << 271 << fMinExPerNucleounForMF/CLHEP::MeV << "\n"; 334 os << "Limit excitation energy for Fermi Bre << 335 << G4BestUnit(fFBUEnergyLimit, "Energy") << 336 os << "Level density (1/MeV) 272 os << "Level density (1/MeV) " 337 << fLevelDensity*CLHEP::MeV << "\n"; 273 << fLevelDensity*CLHEP::MeV << "\n"; 338 os << "Use simple level density model << 274 os << "Time limit for long lived isomeres (ns) " 339 os << "Use discrete excitation energy of the << 275 << fMaxLifeTime/CLHEP::ns << "\n"; 340 os << "Time limit for long lived isomeres << 341 << G4BestUnit(fMaxLifeTime, "Time") << "\ << 342 os << "Isomer production flag << 343 os << "Internal e- conversion flag 276 os << "Internal e- conversion flag " 344 << fInternalConversion << "\n"; 277 << fInternalConversion << "\n"; 345 os << "Store e- internal conversion data 278 os << "Store e- internal conversion data " << fStoreAllLevels << "\n"; >> 279 os << "Electron internal conversion ID " >> 280 << fInternalConversionID << "\n"; 346 os << "Correlated gamma emission flag 281 os << "Correlated gamma emission flag " << fCorrelatedGamma << "\n"; 347 os << "Max 2J for sampling of angular correl << 282 os << "Max 2J for sampling of angular correlations " << fTwoJMAX << "\n"; 348 os << "===================================== << 283 os << "=======================================================================" << "\n"; 349 os.precision(prec); 284 os.precision(prec); 350 return os; 285 return os; 351 } 286 } 352 287 353 G4int G4DeexPrecoParameters::GetVerbose() cons << 288 void G4DeexPrecoParameters::Dump() const 354 { << 355 G4int verb = G4HadronicParameters::Instance( << 356 return (verb > 0) ? std::max(fVerbose, verb) << 357 } << 358 << 359 void G4DeexPrecoParameters::Dump() << 360 { 289 { 361 if(!fIsPrinted && GetVerbose() > 0 && G4Thre << 290 if (G4Threading::IsMasterThread()) { StreamInfo(G4cout); } 362 StreamInfo(G4cout); << 363 fIsPrinted = true; << 364 } << 365 } 291 } 366 292 367 std::ostream& operator<< (std::ostream& os, co 293 std::ostream& operator<< (std::ostream& os, const G4DeexPrecoParameters& par) 368 { 294 { 369 return par.StreamInfo(os); 295 return par.StreamInfo(os); 370 } 296 } 371 297 372 G4bool G4DeexPrecoParameters::IsLocked() const 298 G4bool G4DeexPrecoParameters::IsLocked() const 373 { 299 { 374 return (!G4Threading::IsMasterThread() || 300 return (!G4Threading::IsMasterThread() || 375 (fStateManager->GetCurrentState() != G4Sta 301 (fStateManager->GetCurrentState() != G4State_PreInit)); 376 } 302 } 377 303