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 #include "G4ParticleHPMessenger.hh" 26 #include "G4ParticleHPMessenger.hh" 27 << 28 #include "G4HadronicParameters.hh" << 29 #include "G4ParticleHPManager.hh" 27 #include "G4ParticleHPManager.hh" 30 #include "G4SystemOfUnits.hh" << 28 31 #include "G4UIcmdWithABool.hh" << 29 #include "G4UIdirectory.hh" 32 #include "G4UIcmdWithADouble.hh" << 33 #include "G4UIcmdWithADoubleAndUnit.hh" << 34 #include "G4UIcmdWithAString.hh" 30 #include "G4UIcmdWithAString.hh" 35 #include "G4UIcmdWithAnInteger.hh" 31 #include "G4UIcmdWithAnInteger.hh" 36 #include "G4UIcommand.hh" << 37 #include "G4UIdirectory.hh" << 38 #include "G4UIparameter.hh" << 39 #include "G4UnitsTable.hh" << 40 32 41 G4ParticleHPMessenger::G4ParticleHPMessenger(G << 33 G4ParticleHPMessenger::G4ParticleHPMessenger( G4ParticleHPManager* man ) >> 34 :manager(man) 42 { 35 { 43 ParticleHPDir = new G4UIdirectory("/process/ << 36 ParticleHPDir = new G4UIdirectory( "/process/had/particle_hp/" ); 44 ParticleHPDir->SetGuidance("UI commands of P << 37 ParticleHPDir->SetGuidance( "UI commands of ParticleHP" ); 45 38 46 PhotoEvaCmd = new G4UIcmdWithAString("/proce << 39 PhotoEvaCmd = new G4UIcmdWithAString("/process/had/particle_hp/use_photo_evaporation",this); 47 PhotoEvaCmd->SetGuidance( << 40 PhotoEvaCmd->SetGuidance(" Force the use of the Photon Evaporation model, instead of the neutron capture final state data."); 48 " Force the use of the Photon Evaporation << 41 PhotoEvaCmd->SetParameterName("choice",false); 49 "data."); << 42 PhotoEvaCmd->SetCandidates("true false"); 50 PhotoEvaCmd->SetParameterName("choice", fals << 43 PhotoEvaCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 51 PhotoEvaCmd->SetCandidates("true false"); << 44 52 PhotoEvaCmd->AvailableForStates(G4State_PreI << 45 SkipMissingCmd = new G4UIcmdWithAString("/process/had/particle_hp/skip_missing_isotopes",this); 53 << 46 SkipMissingCmd->SetGuidance("Use only exact isotope data files, instead of allowing nearby isotope files to be used."); 54 SkipMissingCmd = new G4UIcmdWithAString("/pr << 47 SkipMissingCmd->SetGuidance("In this case if the exact file is not available, the cross section will be set to zero."); 55 SkipMissingCmd->SetGuidance( << 48 SkipMissingCmd->SetParameterName("choice",false); 56 "Use only exact isotope data files, instea << 49 SkipMissingCmd->SetCandidates("true false"); 57 SkipMissingCmd->SetGuidance( << 50 SkipMissingCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 58 "In this case if the exact file is not ava << 51 59 SkipMissingCmd->SetParameterName("choice", f << 52 NeglectDopplerCmd = new G4UIcmdWithAString("/process/had/particle_hp/neglect_Doppler_broadening",this); 60 SkipMissingCmd->SetCandidates("true false"); << 53 NeglectDopplerCmd->SetGuidance("Switch off the Doppler broadening due to the thermal motion of the target nucleus."); 61 SkipMissingCmd->AvailableForStates(G4State_P << 54 NeglectDopplerCmd->SetGuidance("This option provides a significant CPU performance advantage."); 62 << 55 NeglectDopplerCmd->SetParameterName("choice",false); 63 NeglectDopplerCmd = << 56 NeglectDopplerCmd->SetCandidates("true false"); 64 new G4UIcmdWithAString("/process/had/parti << 57 NeglectDopplerCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 65 NeglectDopplerCmd->SetGuidance( << 58 66 "Switch off the Doppler broadening due to << 59 DoNotAdjustFSCmd = new G4UIcmdWithAString("/process/had/particle_hp/do_not_adjust_final_state",this); 67 NeglectDopplerCmd->SetGuidance("This option << 60 DoNotAdjustFSCmd->SetGuidance("Disable to adjust final state for getting better conservation."); 68 NeglectDopplerCmd->SetParameterName("choice" << 61 DoNotAdjustFSCmd->SetParameterName("choice",false); 69 NeglectDopplerCmd->SetCandidates("true false << 62 DoNotAdjustFSCmd->SetCandidates("true false"); 70 NeglectDopplerCmd->AvailableForStates(G4Stat << 63 DoNotAdjustFSCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 71 << 64 72 DoNotAdjustFSCmd = << 65 ProduceFissionFragementCmd = new G4UIcmdWithAString("/process/had/particle_hp/produce_fission_fragment",this); 73 new G4UIcmdWithAString("/process/had/parti << 66 ProduceFissionFragementCmd->SetGuidance("Enable to generate fission fragments."); 74 DoNotAdjustFSCmd->SetGuidance("Disable to ad << 67 ProduceFissionFragementCmd->SetParameterName("choice",false); 75 DoNotAdjustFSCmd->SetParameterName("choice", << 68 ProduceFissionFragementCmd->SetCandidates("true false"); 76 DoNotAdjustFSCmd->SetCandidates("true false" << 69 ProduceFissionFragementCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 77 DoNotAdjustFSCmd->AvailableForStates(G4State << 70 78 << 71 NRESP71Cmd = new G4UIcmdWithAString("/process/had/particle_hp/use_NRESP71_model",this); 79 ProduceFissionFragementCmd = << 72 NRESP71Cmd->SetGuidance("Enable to use NRESP71 model for n on C reaction"); 80 new G4UIcmdWithAString("/process/had/parti << 73 NRESP71Cmd->SetParameterName("choice",false); 81 ProduceFissionFragementCmd->SetGuidance("Ena << 74 NRESP71Cmd->SetCandidates("true false"); 82 ProduceFissionFragementCmd->SetParameterName << 75 NRESP71Cmd->AvailableForStates(G4State_PreInit,G4State_Idle); 83 ProduceFissionFragementCmd->SetCandidates("t << 76 84 ProduceFissionFragementCmd->AvailableForStat << 77 VerboseCmd = new G4UIcmdWithAnInteger("/process/had/particle_hp/verbose",this); 85 << 78 VerboseCmd->SetGuidance("Set Verbose level of ParticleHP package"); 86 WendtFissionModelCmd = << 79 VerboseCmd->SetParameterName("verbose_level",true); 87 new G4UIcmdWithAString("/process/had/parti << 80 VerboseCmd->SetDefaultValue(1); 88 WendtFissionModelCmd->SetGuidance("Enable us << 81 VerboseCmd->SetRange("verbose_level >=0"); 89 WendtFissionModelCmd->SetParameterName("choi << 82 VerboseCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 90 WendtFissionModelCmd->SetCandidates("true fa << 91 WendtFissionModelCmd->AvailableForStates(G4S << 92 << 93 NRESP71Cmd = new G4UIcmdWithAString("/proces << 94 NRESP71Cmd->SetGuidance("Enable to use NRESP << 95 NRESP71Cmd->SetParameterName("choice", false << 96 NRESP71Cmd->SetCandidates("true false"); << 97 NRESP71Cmd->AvailableForStates(G4State_PreIn << 98 << 99 VerboseCmd = new G4UIcmdWithAnInteger("/proc << 100 VerboseCmd->SetGuidance("Set Verbose level o << 101 VerboseCmd->SetParameterName("verbose_level" << 102 VerboseCmd->SetDefaultValue(1); << 103 VerboseCmd->SetRange("verbose_level >=0"); << 104 VerboseCmd->AvailableForStates(G4State_PreIn << 105 << 106 UseDBRCCmd = new G4UIcmdWithABool("/process/ << 107 UseDBRCCmd->SetGuidance("Enable use of Doppl << 108 UseDBRCCmd->SetDefaultValue(false); << 109 UseDBRCCmd->AvailableForStates(G4State_PreIn << 110 << 111 MaxEnergySVTCmd = new G4UIcmdWithADoubleAndU << 112 MaxEnergySVTCmd->SetGuidance("Energy thresho << 113 MaxEnergySVTCmd->SetGuidance("The default is << 114 MaxEnergySVTCmd->SetParameterName("MaxEnergy << 115 MaxEnergySVTCmd->SetRange("MaxEnergySVT>=0." << 116 MaxEnergySVTCmd->SetUnitCategory("Energy"); << 117 MaxEnergySVTCmd->AvailableForStates(G4State_ << 118 << 119 MinADBRCCmd = new G4UIcmdWithADouble("/proce << 120 MinADBRCCmd->SetGuidance("Atomic mass in neu << 121 MinADBRCCmd->SetGuidance("The default is A=2 << 122 MinADBRCCmd->SetParameterName("MinASVT", fal << 123 MinADBRCCmd->SetRange("MinASVT>=0."); << 124 MinADBRCCmd->SetDefaultValue(200); << 125 MinADBRCCmd->AvailableForStates(G4State_PreI << 126 << 127 MinEnergyDBRCCmd = new G4UIcmdWithADoubleAnd << 128 MinEnergyDBRCCmd->SetGuidance( << 129 "Energy threshold under which the DBRC met << 130 MinEnergyDBRCCmd->SetGuidance("The default v << 131 MinEnergyDBRCCmd->SetParameterName("MinEnerg << 132 MinEnergyDBRCCmd->SetRange("MinEnergyDBRC>0. << 133 MinEnergyDBRCCmd->SetUnitCategory("Energy"); << 134 MinEnergyDBRCCmd->SetDefaultValue(0.1 * CLHE << 135 MinEnergyDBRCCmd->AvailableForStates(G4State << 136 << 137 MaxEnergyDBRCCmd = new G4UIcmdWithADoubleAnd << 138 MaxEnergyDBRCCmd->SetGuidance("Energy thresh << 139 MaxEnergyDBRCCmd->SetGuidance("The default v << 140 MaxEnergyDBRCCmd->SetParameterName("MaxEnerg << 141 MaxEnergyDBRCCmd->SetRange("MaxEnergyDBRC>0. << 142 MaxEnergyDBRCCmd->SetUnitCategory("Energy"); << 143 MaxEnergyDBRCCmd->SetDefaultValue(210. * CLH << 144 MaxEnergyDBRCCmd->AvailableForStates(G4State << 145 } 83 } 146 84 147 G4ParticleHPMessenger::~G4ParticleHPMessenger( 85 G4ParticleHPMessenger::~G4ParticleHPMessenger() 148 { 86 { 149 delete ParticleHPDir; << 87 delete ParticleHPDir; 150 delete PhotoEvaCmd; << 88 delete PhotoEvaCmd; 151 delete SkipMissingCmd; << 89 delete SkipMissingCmd; 152 delete NeglectDopplerCmd; << 90 delete NeglectDopplerCmd; 153 delete DoNotAdjustFSCmd; << 91 delete DoNotAdjustFSCmd; 154 delete ProduceFissionFragementCmd; << 92 delete ProduceFissionFragementCmd; 155 delete WendtFissionModelCmd; << 93 delete VerboseCmd; 156 delete NRESP71Cmd; << 157 delete VerboseCmd; << 158 delete UseDBRCCmd; << 159 delete MaxEnergySVTCmd; << 160 delete MinADBRCCmd; << 161 delete MinEnergyDBRCCmd; << 162 delete MaxEnergyDBRCCmd; << 163 } 94 } 164 95 165 void G4ParticleHPMessenger::SetNewValue(G4UIco << 96 void G4ParticleHPMessenger::SetNewValue(G4UIcommand* command,G4String newValue) 166 { 97 { 167 G4bool bValue = false; << 98 G4bool bValue=false; 168 if (newValue == "true") bValue = true; << 99 if ( newValue == "true" ) bValue=true; 169 << 170 if (command == PhotoEvaCmd) { << 171 if (manager->GetUseOnlyPhotoEvaporation() << 172 manager->SetUseOnlyPhotoEvaporation(bVal << 173 #ifdef G4VERBOSE << 174 if (G4HadronicParameters::Instance()->Ge << 175 G4cout << G4endl << 176 << "=== G4ParticleHPMessenger C << 177 << bValue << " ===" << G4endl; << 178 } << 179 if (bValue) { << 180 G4cout << " -> Forced the use of th << 181 "capture final state data)" << 182 << G4endl; << 183 } << 184 else { << 185 G4cout << " -> Go back to use the d << 186 } << 187 #endif << 188 } << 189 } << 190 << 191 if (command == SkipMissingCmd) { << 192 if (manager->GetSkipMissingIsotopes() != b << 193 manager->SetSkipMissingIsotopes(bValue); << 194 #ifdef G4VERBOSE << 195 if (G4HadronicParameters::Instance()->Ge << 196 G4cout << G4endl << "=== G4ParticleHPM << 197 << bValue << " ===" << G4endl; << 198 } << 199 if (bValue) { << 200 G4cout << 201 << " -> Use only exact isotope da << 202 "to be used: \n" << 203 << " if the exact file is not << 204 << G4endl; << 205 } << 206 else { << 207 G4cout << " -> Go back to the defau << 208 "isotope data files are not << 209 << G4endl; << 210 } << 211 #endif << 212 } << 213 } << 214 << 215 if (command == NeglectDopplerCmd) { << 216 if (manager->GetNeglectDoppler() != bValue << 217 manager->SetNeglectDoppler(bValue); << 218 #ifdef G4VERBOSE << 219 if (G4HadronicParameters::Instance()->Ge << 220 G4cout << G4endl << "=== G4ParticleHPM << 221 << bValue << " ===" << G4endl; << 222 } << 223 if (bValue) { << 224 G4cout << " -> Switched off the Dop << 225 "target nucleus: \n" << 226 << " on-the-fly Doppler b << 227 "calculations of \n" << 228 << " capture, elastic, fi << 229 "neutrons below 20 MeV.\n" << 230 << " This option provides << 231 } << 232 else { << 233 G4cout << 234 << " -> Go back to the default, i << 235 << G4endl; << 236 } << 237 #endif << 238 } << 239 } << 240 << 241 if (command == DoNotAdjustFSCmd) { << 242 if (manager->GetDoNotAdjustFinalState() != << 243 manager->SetDoNotAdjustFinalState(bValue << 244 #ifdef G4VERBOSE << 245 if (G4HadronicParameters::Instance()->Ge << 246 G4cout << G4endl << "=== G4ParticleHPM << 247 << bValue << " ===" << G4endl; << 248 } << 249 if (bValue) { << 250 G4cout << 251 << " -> Disabled the adjustment o << 252 << G4endl; << 253 } << 254 else { << 255 G4cout << " -> Go back to the defau << 256 "conservation !" << 257 << G4endl; << 258 } << 259 #endif << 260 } << 261 } << 262 << 263 if (command == ProduceFissionFragementCmd) { << 264 if (manager->GetProduceFissionFragments() << 265 manager->SetProduceFissionFragments(bVal << 266 #ifdef G4VERBOSE << 267 if (G4HadronicParameters::Instance()->Ge << 268 G4cout << G4endl << 269 << "=== G4ParticleHPMessenger C << 270 << bValue << " ===" << G4endl; << 271 } << 272 if (bValue) { << 273 G4cout << " -> Enabled the generati << 274 } << 275 else { << 276 G4cout << " -> Go back to the defau << 277 << G4endl; << 278 } << 279 #endif << 280 } << 281 } << 282 << 283 if (command == WendtFissionModelCmd) { << 284 if (manager->GetUseWendtFissionModel() != << 285 manager->SetUseWendtFissionModel(bValue) << 286 // Make sure both fission fragment model << 287 if (bValue) manager->SetProduceFissionFr << 288 #ifdef G4VERBOSE << 289 if (G4HadronicParameters::Instance()->Ge << 290 G4cout << G4endl << "=== G4ParticleHPM << 291 << bValue << " ===" << G4endl; << 292 } << 293 if (bValue) { << 294 G4cout << " -> Enabled the use of W << 295 } << 296 else { << 297 G4cout << " -> Go back to the defau << 298 << G4endl; << 299 } << 300 #endif << 301 } << 302 } << 303 << 304 if (command == NRESP71Cmd) { << 305 if (manager->GetUseNRESP71Model() != bValu << 306 manager->SetUseNRESP71Model(bValue); << 307 #ifdef G4VERBOSE << 308 if (G4HadronicParameters::Instance()->Ge << 309 G4cout << G4endl << "=== G4ParticleHPM << 310 << bValue << " ===" << G4endl; << 311 } << 312 if (bValue) { << 313 G4cout << " -> Enabled the use of N << 314 } << 315 else { << 316 G4cout << " -> Go back to the defau << 317 } << 318 #endif << 319 } << 320 } << 321 << 322 if (command == VerboseCmd) { << 323 G4int verboseLevel = VerboseCmd->ConvertTo << 324 if (manager->GetVerboseLevel() != verboseL << 325 manager->SetVerboseLevel(verboseLevel); << 326 #ifdef G4VERBOSE << 327 if (G4HadronicParameters::Instance()->Ge << 328 G4cout << G4endl << "=== G4ParticleHPM << 329 << verboseLevel << " ===" << G4 << 330 } << 331 #endif << 332 } << 333 } << 334 << 335 if (command == UseDBRCCmd) { << 336 bValue = UseDBRCCmd->GetNewBoolValue(newVa << 337 if (manager->GetUseDBRC() != bValue) { << 338 manager->SetUseDBRC(bValue); << 339 #ifdef G4VERBOSE << 340 if (G4HadronicParameters::Instance()->Ge << 341 G4cout << G4endl << "=== G4ParticleHPM << 342 << " ===" << G4endl; << 343 } << 344 if (bValue) { << 345 G4cout << " -> Using the DBRC algor << 346 } << 347 else { << 348 G4cout << " -> Do not use the DBRC << 349 } << 350 #endif << 351 } << 352 } << 353 << 354 if (command == MaxEnergySVTCmd) { << 355 G4double energymax = MaxEnergySVTCmd->GetN << 356 if (G4HadronicParameters::Instance()->GetN << 357 G4HadronicParameters::Instance()->SetNeu << 358 #ifdef G4VERBOSE << 359 if (G4HadronicParameters::Instance()->Ge << 360 G4cout << G4endl << 361 << "=== G4ParticleHPMessenger C << 362 G4cout << "max energy: " << G4BestUnit << 363 } << 364 #endif << 365 } << 366 } << 367 << 368 if (command == MinADBRCCmd) { << 369 G4double Amin = MinADBRCCmd->GetNewDoubleV << 370 if (manager->GetMinADBRC() != Amin) { << 371 manager->SetMinADBRC(Amin); << 372 #ifdef G4VERBOSE << 373 if (G4HadronicParameters::Instance()->Ge << 374 G4cout << G4endl << 375 << "=== G4ParticleHPMessenger C << 376 G4cout << "min A: " << Amin << G4endl; << 377 } << 378 #endif << 379 } << 380 } << 381 << 382 if (command == MinEnergyDBRCCmd) { << 383 G4double energymin = MinEnergyDBRCCmd->Get << 384 if (manager->GetMinEnergyDBRC() != energym << 385 manager->SetMinEnergyDBRC(energymin); << 386 #ifdef G4VERBOSE << 387 if (G4HadronicParameters::Instance()->Ge << 388 G4cout << G4endl << 389 << "=== G4ParticleHPMessenger C << 390 G4cout << "min energy: " << G4BestUnit << 391 } << 392 #endif << 393 } << 394 } << 395 << 396 if (command == MaxEnergyDBRCCmd) { << 397 G4double energymax = MaxEnergyDBRCCmd->Get << 398 if (manager->GetMaxEnergyDBRC() != energym << 399 manager->SetMaxEnergyDBRC(energymax); << 400 #ifdef G4VERBOSE << 401 if (G4HadronicParameters::Instance()->Ge << 402 G4cout << G4endl << 403 << "=== G4ParticleHPMessenger C << 404 G4cout << "max energy: " << G4BestUnit << 405 } << 406 #endif << 407 } << 408 } << 409 100 >> 101 if ( command == PhotoEvaCmd ) { >> 102 manager->SetUseOnlyPhotoEvaporation( bValue ); >> 103 } >> 104 if ( command == SkipMissingCmd) { >> 105 manager->SetSkipMissingIsotopes( bValue ); >> 106 } >> 107 if ( command == NeglectDopplerCmd ) { >> 108 manager->SetNeglectDoppler( bValue ); >> 109 } >> 110 if ( command == DoNotAdjustFSCmd ) { >> 111 manager->SetDoNotAdjustFinalState( bValue ); >> 112 } >> 113 if ( command == ProduceFissionFragementCmd ) { >> 114 manager->SetProduceFissionFragments( bValue ); >> 115 } >> 116 if ( command == NRESP71Cmd ) { >> 117 manager->SetUseNRESP71Model( bValue ); >> 118 } >> 119 if ( command == VerboseCmd ) { >> 120 manager->SetVerboseLevel( VerboseCmd->ConvertToInt( newValue ) ); >> 121 } 410 } 122 } >> 123 411 124