- Timestamp:
- Jan 8, 2010, 11:56:51 AM (15 years ago)
- Location:
- trunk/source/processes/hadronic/models/de_excitation/ablation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/de_excitation/ablation/include/G4WilsonAblationModel.hh
r819 r1228 40 40 // MODULE: G4WilsonAblationModel.hh 41 41 // 42 // Version: B.143 // Date: 15/04/0442 // Version: 1.0 43 // Date: 08/12/2009 44 44 // Author: P R Truscott 45 45 // Organisation: QinetiQ Ltd, UK … … 58 58 // Beta release 59 59 // 60 // 08 December 2009, P R Truscott, QinetiQ Ltd, UK 61 // Ver 1.0 62 // Introduced vector of evaporation channels and evaporation factory. Also 63 // copied directly over the SumProbabilities class in G4Evaporation.hh at 64 // version 9.2.r9, just in cases there's any subtle differences. See .cc 65 // file comments to see impact of the rest of the changes. 66 // 60 67 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 61 68 //////////////////////////////////////////////////////////////////////////////// … … 67 74 #include "G4ParticleDefinition.hh" 68 75 #include "globals.hh" 76 #include "G4VEvaporationFactory.hh" 77 #include "G4EvaporationFactory.hh" 78 69 79 70 80 #include <vector> … … 99 109 VectorOfFragmentTypes evapType; 100 110 101 class SumProbabilities : 102 public std::binary_function<G4double,G4double,G4double> 103 { 104 public: 105 SumProbabilities() : total(0.0) {} 106 G4double operator() (G4double& /* probSoFar */, G4VEvaporationChannel*& frag) 107 { 108 total += frag->GetEmissionProbability(); 109 return total; 110 } 111 std::vector<G4VEvaporationChannel*> * theChannels; 112 G4VEvaporationFactory * theChannelFactory; 111 113 112 G4double GetTotal() { return total; } 113 public: 114 G4double total; 114 class SumProbabilities : public std::binary_function<G4double,G4double,G4double> 115 { 116 public: 117 SumProbabilities() : total(0.0) {} 118 G4double operator() (G4double& /* probSoFar */, G4VEvaporationChannel*& frag) 119 { 120 G4double temp_prob = frag->GetEmissionProbability(); 121 if(temp_prob >= 0.0) total += temp_prob; 122 // total += frag->GetEmissionProbability(); 123 return total; 124 } 125 126 G4double GetTotal() { return total; } 127 public: 128 G4double total; 129 115 130 }; 116 117 118 131 119 132 }; -
trunk/source/processes/hadronic/models/de_excitation/ablation/src/G4WilsonAblationModel.cc
r819 r1228 38 38 // MODULE: G4WilsonAblationModel.cc 39 39 // 40 // Version: B.141 // Date: 15/04/0440 // Version: 1.0 41 // Date: 08/12/2009 42 42 // Author: P R Truscott 43 43 // Organisation: QinetiQ Ltd, UK … … 56 56 // Beta release 57 57 // 58 // 08 December 2009, P R Truscott, QinetiQ Ltd, UK 59 // Ver 1.0 60 // Updated as a result of changes in the G4Evaporation classes. These changes 61 // affect mostly SelectSecondariesByEvaporation, and now you have variables 62 // associated with the evaporation model which can be changed: 63 // OPTxs to select the inverse cross-section 64 // OPTxs = 0 => Dostrovski's parameterization 65 // OPTxs = 1 or 2 => Chatterjee's paramaterization 66 // OPTxs = 3 or 4 => Kalbach's parameterization 67 // useSICB => use superimposed Coulomb Barrier for inverse cross 68 // sections 69 // Other problem found with G4Fragment definition using Lorentz vector and 70 // **G4ParticleDefinition**. This does not allow A and Z to be defined for the 71 // fragment for some reason. Now the fragment is defined more explicitly: 72 // G4Fragment *fragment = new G4Fragment(A, Z, lorentzVector); 73 // to avoid this quirk. Bug found in SelectSecondariesByDefault: *type is now 74 // equated to evapType[i] whereas previously it was equated to fragType[i]. 75 // 58 76 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 59 77 //////////////////////////////////////////////////////////////////////////////// … … 123 141 // 124 142 verboseLevel = 0; 143 theChannelFactory = new G4EvaporationFactory(); 144 theChannels = theChannelFactory->GetChannel(); 145 // 146 // 147 // Set defaults for evaporation classes. These can be overridden by user 148 // "set" methods. 149 // 150 OPTxs = 3; 151 useSICB = false; 125 152 } 126 153 //////////////////////////////////////////////////////////////////////////////// 127 154 // 128 155 G4WilsonAblationModel::~G4WilsonAblationModel() 129 {;} 156 { 157 if (theChannels != 0) theChannels = 0; 158 if (theChannelFactory != 0) delete theChannelFactory; 159 } 130 160 //////////////////////////////////////////////////////////////////////////////// 131 161 // … … 207 237 G4int DAabl = (G4int) (ex / B); 208 238 if (DAabl > A) DAabl = A; 209 if (verboseLevel >= 2) 210 G4cout <<"Number of nucleons ejected = " <<DAabl <<G4endl; 239 // The following lines are no longer accurate given we now treat the final fragment 240 // if (verboseLevel >= 2) 241 // G4cout <<"Number of nucleons ejected = " <<DAabl <<G4endl; 211 242 212 243 // … … 219 250 if (AF > 0) 220 251 { 221 G4double AFd = static_cast<G4double>(AF);252 G4double AFd = (G4double) AF; 222 253 G4double R = 11.8 / std::pow(AFd, 0.45); 223 254 G4int minZ = Z - DAabl; … … 253 284 } 254 285 G4int DZabl = Z - ZF; 255 if (verboseLevel >= 2)256 G4cout <<"Final fragment A=" <<AF257 <<", Z=" <<ZF258 <<G4endl;259 286 // 260 287 // … … 285 312 DAabl -= (G4int) (n * type->GetBaryonNumber() + 1.0E-10); 286 313 DZabl -= (G4int) (n * type->GetPDGCharge() + 1.0E-10); 287 if (verboseLevel >= 2)288 G4cout <<"Particle type: " <<std::setw(10) <<type->GetParticleName()289 <<", number of particles emitted = " <<n 290 <<G4endl; 291 } 292 } 293 // 294 // 295 // Determine the properties of the final nuclear fragment.314 } 315 } 316 // 317 // 318 // Determine the properties of the final nuclear fragment. Note that if 319 // the final fragment is predicted to have a nucleon number of zero, then 320 // really it's the particle last in the vector evapType which becomes the 321 // final fragment. Therefore delete this from the vector if this is the 322 // case. 296 323 // 297 324 G4double massFinalFrag = 0.0; 298 if (AF > 0 .0)325 if (AF > 0) 299 326 massFinalFrag = G4ParticleTable::GetParticleTable()->GetIonTable()-> 300 327 GetIonMass(ZF,AF); 328 else 329 { 330 G4ParticleDefinition *type = evapType[evapType.size()-1]; 331 AF = type->GetBaryonNumber(); 332 ZF = (G4int) (type->GetPDGCharge() + 1.0E-10); 333 evapType.erase(evapType.end()-1); 334 } 301 335 totalEpost += massFinalFrag; 302 336 // 337 // 338 // Provide verbose output on the nuclear fragment if requested. 339 // 340 if (verboseLevel >= 2) 341 { 342 G4cout <<"Final fragment A=" <<AF 343 <<", Z=" <<ZF 344 <<G4endl; 345 for (G4int ift=0; ift<nFragTypes; ift++) 346 { 347 G4ParticleDefinition *type = fragType[ift]; 348 G4int n = std::count(evapType.begin(),evapType.end(),type); 349 if (n > 0) 350 G4cout <<"Particle type: " <<std::setw(10) <<type->GetParticleName() 351 <<", number of particles emitted = " <<n <<G4endl; 352 } 353 } 303 354 // 304 355 // Add the total energy from the fragment. Note that the fragment is assumed … … 326 377 SelectSecondariesByDefault(G4ThreeVector(0.0,0.0,0.0)); 327 378 } 379 328 380 if (AF > 0) 329 381 { … … 352 404 G4int ie = 0; 353 405 G4FragmentVector::iterator iter; 354 for (iter = fragmentVector->begin(); iter != fragmentVector->end(); ++iter)406 for (iter = fragmentVector->begin(); iter != fragmentVector->end(); iter++) 355 407 { 356 408 if (ie == nEvap) 357 409 { 358 G4cout <<*iter <<G4endl;410 // G4cout <<*iter <<G4endl; 359 411 G4cout <<"---------------------------------" <<G4endl; 360 412 G4cout <<"Particles from default emission :" <<G4endl; … … 375 427 (G4Fragment *intermediateNucleus) 376 428 { 429 G4Fragment theResidualNucleus = *intermediateNucleus; 377 430 G4bool evaporate = true; 378 431 while (evaporate && evapType.size() != 0) … … 386 439 std::vector <G4VEvaporationChannel*> theChannels; 387 440 theChannels.clear(); 441 std::vector <G4VEvaporationChannel*>::iterator i; 388 442 VectorOfFragmentTypes::iterator iter; 389 443 std::vector <VectorOfFragmentTypes::iterator> iters; … … 393 447 { 394 448 theChannels.push_back(new G4AlphaEvaporationChannel); 449 i = theChannels.end() - 1; 450 (*i)->SetOPTxs(OPTxs); 451 (*i)->UseSICB(useSICB); 452 // (*i)->Initialize(theResidualNucleus); 395 453 iters.push_back(iter); 396 454 } … … 399 457 { 400 458 theChannels.push_back(new G4He3EvaporationChannel); 459 i = theChannels.end() - 1; 460 (*i)->SetOPTxs(OPTxs); 461 (*i)->UseSICB(useSICB); 462 // (*i)->Initialize(theResidualNucleus); 401 463 iters.push_back(iter); 402 464 } … … 405 467 { 406 468 theChannels.push_back(new G4TritonEvaporationChannel); 469 i = theChannels.end() - 1; 470 (*i)->SetOPTxs(OPTxs); 471 (*i)->UseSICB(useSICB); 472 // (*i)->Initialize(theResidualNucleus); 407 473 iters.push_back(iter); 408 474 } … … 411 477 { 412 478 theChannels.push_back(new G4DeuteronEvaporationChannel); 479 i = theChannels.end() - 1; 480 (*i)->SetOPTxs(OPTxs); 481 (*i)->UseSICB(useSICB); 482 // (*i)->Initialize(theResidualNucleus); 413 483 iters.push_back(iter); 414 484 } … … 417 487 { 418 488 theChannels.push_back(new G4ProtonEvaporationChannel); 489 i = theChannels.end() - 1; 490 (*i)->SetOPTxs(OPTxs); 491 (*i)->UseSICB(useSICB); 492 // (*i)->Initialize(theResidualNucleus); 419 493 iters.push_back(iter); 420 494 } … … 423 497 { 424 498 theChannels.push_back(new G4NeutronEvaporationChannel); 499 i = theChannels.end() - 1; 500 (*i)->SetOPTxs(OPTxs); 501 (*i)->UseSICB(useSICB); 502 // (*i)->Initialize(theResidualNucleus); 425 503 iters.push_back(iter); 426 504 } … … 479 557 for (unsigned i=0; i<evapType.size(); i++) 480 558 { 481 G4ParticleDefinition *type = fragType[i];559 G4ParticleDefinition *type = evapType[i]; 482 560 G4double mass = type->GetPDGMass(); 483 561 G4double e = mass + 10.0*eV; … … 489 567 G4LorentzVector lorentzVector = G4LorentzVector(direction*p, e); 490 568 lorentzVector.boost(-boost); 569 // Possibility that the following line is not correctly carrying over A and Z 570 // from particle definition. Force values. PRT 03/12/2009. 571 // G4Fragment *fragment = 572 // new G4Fragment(lorentzVector, type); 573 G4int A = type->GetBaryonNumber(); 574 G4int Z = (G4int) (type->GetPDGCharge() + 1.0E-10); 491 575 G4Fragment *fragment = 492 new G4Fragment(lorentzVector, type); 576 new G4Fragment(A, Z, lorentzVector); 577 493 578 fragmentVector->push_back(fragment); 494 579 }
Note: See TracChangeset
for help on using the changeset viewer.