Changeset 962 for trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPInelasticCompFS.cc
- Timestamp:
- Apr 6, 2009, 12:30:29 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/processes/hadronic/models/neutron_hp/src/G4NeutronHPInelasticCompFS.cc
r819 r962 30 30 // 070523 bug fix for G4FPE_DEBUG on by A. Howard ( and T. Koi) 31 31 // 070606 bug fix and migrate to enable to Partial cases by T. Koi 32 // 080603 bug fix for Hadron Hyper News #932 by T. Koi 33 // 080612 bug fix contribution from Benoit Pirard and Laurent Desorgher (Univ. Bern) #4,6 34 // 080717 bug fix of calculation of residual momentum by T. Koi 35 // 080801 protect negative avalable energy by T. Koi 36 // introduce theNDLDataA,Z which has A and Z of NDL data by T. Koi 37 // 081024 G4NucleiPropertiesTable:: to G4NucleiProperties:: 32 38 // 33 39 #include "G4NeutronHPInelasticCompFS.hh" 34 40 #include "G4Nucleus.hh" 35 #include "G4NucleiProperties Table.hh"41 #include "G4NucleiProperties.hh" 36 42 #include "G4He3.hh" 37 43 #include "G4Alpha.hh" … … 74 80 theBaseA = aFile.GetA(); 75 81 theBaseZ = aFile.GetZ(); 82 theNDLDataA = (int)aFile.GetA(); 83 theNDLDataZ = aFile.GetZ(); 76 84 if(!dbool || ( Z<2.5 && ( std::abs(theBaseZ - Z)>0.0001 || std::abs(theBaseA - A)>0.0001))) 77 85 { … … 185 193 } 186 194 195 196 //n,p,d,t,he3,a 187 197 void G4NeutronHPInelasticCompFS::CompositeApply(const G4HadProjectile & theTrack, G4ParticleDefinition * aDefinition) 188 198 { 189 199 190 //G4cout << "G4NeutronHPInelasticCompFS::CompositeApply " << G4endl;191 200 // prepare neutron 192 201 theResult.Clear(); … … 201 210 for(i=0; i<50; i++) 202 211 { if(theXsection[i] != 0) { break; } } 212 203 213 G4double targetMass=0; 204 214 G4double eps = 0.0001; 205 targetMass = ( G4NucleiProperties Table::GetNuclearMass(static_cast<G4int>(theBaseZ+eps), static_cast<G4int>(theBaseA+eps))) /215 targetMass = ( G4NucleiProperties::GetNuclearMass(static_cast<G4int>(theBaseA+eps), static_cast<G4int>(theBaseZ+eps))) / 206 216 G4Neutron::Neutron()->GetPDGMass(); 207 217 // if(theEnergyAngData[i]!=0) … … 220 230 G4double residualZ = theBaseZ - aDefinition->GetPDGCharge(); 221 231 G4double residualA = theBaseA - aDefinition->GetBaryonNumber()+1; 222 residualMass = ( G4NucleiProperties Table::GetNuclearMass(static_cast<G4int>(residualZ+eps), static_cast<G4int>(residualA+eps)) ) /232 residualMass = ( G4NucleiProperties::GetNuclearMass(static_cast<G4int>(residualA+eps), static_cast<G4int>(residualZ+eps)) ) / 223 233 G4Neutron::Neutron()->GetPDGMass(); 224 234 … … 230 240 231 241 // select exit channel for composite FS class. 232 G4int it = SelectExitChannel( eKinetic);242 G4int it = SelectExitChannel( eKinetic ); 233 243 234 244 // set target and neutron in the relevant exit channel … … 241 251 G4double availableEnergy = theNeutron.GetKineticEnergy() + theNeutron.GetMass() - aHadron.GetMass() + 242 252 (targetMass - residualMass)*G4Neutron::Neutron()->GetPDGMass(); 253 //080730c 254 if ( availableEnergy < 0 ) 255 { 256 //G4cout << "080730c Adjust availavleEnergy " << G4endl; 257 availableEnergy = 0; 258 } 243 259 G4int nothingWasKnownOnHadron = 0; 244 260 G4int dummy; 245 261 G4double eGamm = 0; 246 262 G4int iLevel=it-1; 247 // TK debug 070530 (without photon has it = 0) 248 //if(50==it) 249 if( 0 == it ) 250 { 263 264 // TK without photon has it = 0 265 if( 50 == it ) 266 { 267 268 // TK Excitation level is not determined 251 269 iLevel=-1; 252 270 aHadron.SetKineticEnergy(availableEnergy*residualMass*G4Neutron::Neutron()->GetPDGMass()/ 253 271 (aHadron.GetMass()+residualMass*G4Neutron::Neutron()->GetPDGMass())); 254 272 255 //aHadron.SetMomentum(theNeutron.GetMomentum()*(1./theNeutron.GetTotalMomentum())* 256 // std::sqrt(aHadron.GetTotalEnergy()*aHadron.GetTotalEnergy()- 257 // aHadron.GetMass()*aHadron.GetMass())); 258 273 aHadron.SetMomentum(theNeutron.GetMomentum()*(1./theNeutron.GetTotalMomentum())* 274 std::sqrt(aHadron.GetTotalEnergy()*aHadron.GetTotalEnergy()- 275 aHadron.GetMass()*aHadron.GetMass())); 276 277 /* 259 278 G4double p2 = ( aHadron.GetTotalEnergy()*aHadron.GetTotalEnergy()-aHadron.GetMass()*aHadron.GetMass() ); 260 279 G4double p = 0.0; … … 264 283 } 265 284 aHadron.SetMomentum(theNeutron.GetMomentum()*(1./theNeutron.GetTotalMomentum())*p ); 285 */ 266 286 267 287 } … … 270 290 while( iLevel!=-1 && theGammas.GetLevel(iLevel)==0 ) { iLevel--; } 271 291 } 272 if(theAngularDistribution[it]!= 0) 273 { 274 if(theEnergyDistribution[it]!=0) 292 293 294 if ( theAngularDistribution[it] != 0 ) // MF4 295 { 296 if(theEnergyDistribution[it]!=0) // MF5 275 297 { 276 298 aHadron.SetKineticEnergy(theEnergyDistribution[it]->Sample(eKinetic, dummy)); … … 304 326 } 305 327 theAngularDistribution[it]->SampleAndUpdate(aHadron); 306 if(theFinalStatePhotons[it] == 0) 328 329 if( theFinalStatePhotons[it] == 0 ) 307 330 { 308 331 // TK comment Most n,n* eneter to this … … 324 347 } 325 348 } 326 else if(theEnergyAngData[it] != 0) 349 else if(theEnergyAngData[it] != 0) // MF6 327 350 { 328 351 theParticles = theEnergyAngData[it]->Sample(eKinetic); … … 333 356 nothingWasKnownOnHadron = 1; 334 357 } 358 335 359 //G4cout << "theFinalStatePhotons it " << it << G4endl; 336 360 //G4cout << "theFinalStatePhotons[it] " << theFinalStatePhotons[it] << G4endl; 337 // TK 070530338 if ( it != 0 ) it = 50; // it 50 has final state data for photon MF13 cross and MF14 ang339 361 //G4cout << "theFinalStatePhotons it " << it << G4endl; 340 362 //G4cout << "theFinalStatePhotons[it] " << theFinalStatePhotons[it] << G4endl; 341 363 //G4cout << "thePhotons " << thePhotons << G4endl; 342 if(theFinalStatePhotons[it]!=0) 343 { 344 // the photon distributions are in the Nucleus rest frame. 364 365 if ( theFinalStatePhotons[it] != 0 ) 366 { 367 // the photon distributions are in the Nucleus rest frame. 368 // TK residual rest frame 345 369 G4ReactionProduct boosted; 346 370 boosted.Lorentz(theNeutron, theTarget); … … 493 517 ->GetIon(static_cast<G4int>(residualZ), static_cast<G4int>(residualA), 0)); 494 518 theResidual.SetKineticEnergy(aHadron.GetKineticEnergy()*aHadron.GetMass()/theResidual.GetMass()); 495 theResidual.SetMomentum(-1.*aHadron.GetMomentum()); 519 520 //080612TK contribution from Benoit Pirard and Laurent Desorgher (Univ. Bern) #6 521 //theResidual.SetMomentum(-1.*aHadron.GetMomentum()); 522 G4ThreeVector incidentNeutronMomentum = theNeutron.GetMomentum(); 523 theResidual.SetMomentum(incidentNeutronMomentum - aHadron.GetMomentum()); 524 496 525 theResidual.Lorentz(theResidual, -1.*theTarget); 497 526 G4ThreeVector totalPhotonMomentum(0,0,0); … … 529 558 // cout << "Kinetic energy of the residual = "<<resiualKineticEnergy<<endl; 530 559 theResidual.SetKineticEnergy(resiualKineticEnergy); 531 theResidual.SetMomentum(-1.*totalMomentum); 560 561 //080612TK contribution from Benoit Pirard and Laurent Desorgher (Univ. Bern) #4 562 //theResidual.SetMomentum(-1.*totalMomentum); 563 //G4ThreeVector incidentNeutronMomentum = theNeutron.GetMomentum(); 564 //theResidual.SetMomentum(incidentNeutronMomentum - aHadron.GetMomentum()); 565 //080717 TK Comment still do NOT include photon's mometum which produce by thePhotons 566 theResidual.SetMomentum( theNeutron.GetMomentum() + theTarget.GetMomentum() - totalMomentum ); 567 532 568 theSec = new G4DynamicParticle; 533 569 theSec->SetDefinition(theResidual.GetDefinition()); … … 549 585 delete thePhotons; 550 586 } 587 588 //080721 589 G4ParticleDefinition* targ_pd = G4ParticleTable::GetParticleTable()->GetIon ( (G4int)theBaseZ , (G4int)theBaseA , 0.0 ); 590 G4LorentzVector targ_4p_lab ( theTarget.GetMomentum() , std::sqrt( targ_pd->GetPDGMass()*targ_pd->GetPDGMass() + theTarget.GetMomentum().mag2() ) ); 591 G4LorentzVector proj_4p_lab = theTrack.Get4Momentum(); 592 G4LorentzVector init_4p_lab = proj_4p_lab + targ_4p_lab; 593 adjust_final_state ( init_4p_lab ); 594 551 595 // clean up the primary neutron 552 596 theResult.SetStatusChange(stopAndKill);
Note: See TracChangeset
for help on using the changeset viewer.