Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ParticleHPInelasticCompFS Class Referenceabstract

#include <G4ParticleHPInelasticCompFS.hh>

+ Inheritance diagram for G4ParticleHPInelasticCompFS:

Public Member Functions

 G4ParticleHPInelasticCompFS ()
 
virtual ~G4ParticleHPInelasticCompFS ()
 
void Init (G4double A, G4double Z, G4int M, G4String &dirName, G4String &aSFType, G4ParticleDefinition *)
 
void InitGammas (G4double AR, G4double ZR)
 
virtual G4HadFinalStateApplyYourself (const G4HadProjectile &theTrack)=0
 
virtual G4ParticleHPFinalStateNew ()=0
 
virtual G4double GetXsec (G4double anEnergy)
 
virtual G4ParticleHPVectorGetXsec ()
 
G4int SelectExitChannel (G4double eKinetic)
 
void CompositeApply (const G4HadProjectile &theTrack, G4ParticleDefinition *aHadron)
 
void InitDistributionInitialState (G4ReactionProduct &anIncidentPart, G4ReactionProduct &aTarget, G4int it)
 
- Public Member Functions inherited from G4ParticleHPFinalState
 G4ParticleHPFinalState ()
 
virtual ~G4ParticleHPFinalState ()
 
void Init (G4double A, G4double Z, G4String &dirName, G4String &aFSType, G4ParticleDefinition *projectile)
 
virtual void Init (G4double A, G4double Z, G4int M, G4String &dirName, G4String &aFSType, G4ParticleDefinition *)=0
 
virtual G4HadFinalStateApplyYourself (const G4HadProjectile &)
 
virtual G4ParticleHPFinalStateNew ()=0
 
G4bool HasXsec ()
 
G4bool HasFSData ()
 
G4bool HasAnyData ()
 
virtual G4double GetXsec (G4double)
 
virtual G4ParticleHPVectorGetXsec ()
 
void SetA_Z (G4double anA, G4double aZ, G4int aM=0)
 
G4double GetZ ()
 
G4double GetN ()
 
G4double GetA ()
 
G4int GetM ()
 
void SetAZMs (G4double anA, G4double aZ, G4int aM, G4ParticleHPDataUsed used)
 
void SetProjectile (G4ParticleDefinition *projectile)
 

Protected Attributes

G4ParticleHPVectortheXsection [51]
 
G4ParticleHPEnergyDistributiontheEnergyDistribution [51]
 
G4ParticleHPAngulartheAngularDistribution [51]
 
G4ParticleHPEnAngCorrelationtheEnergyAngData [51]
 
G4ParticleHPPhotonDisttheFinalStatePhotons [51]
 
G4ParticleHPDeExGammas theGammas
 
G4String gammaPath
 
std::vector< G4doubleQI
 
std::vector< G4intLR
 
- Protected Attributes inherited from G4ParticleHPFinalState
G4bool hasXsec
 
G4bool hasFSData
 
G4bool hasAnyData
 
G4ParticleHPNames theNames
 
G4Cache< G4HadFinalState * > theResult
 
G4ParticleDefinitiontheProjectile
 
G4double theBaseA
 
G4double theBaseZ
 
G4int theBaseM
 
G4int theNDLDataZ
 
G4int theNDLDataA
 
G4int theNDLDataM
 
G4int secID
 

Additional Inherited Members

- Protected Member Functions inherited from G4ParticleHPFinalState
void adjust_final_state (G4LorentzVector)
 

Detailed Description

Definition at line 50 of file G4ParticleHPInelasticCompFS.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPInelasticCompFS()

G4ParticleHPInelasticCompFS::G4ParticleHPInelasticCompFS ( )
inline

Definition at line 54 of file G4ParticleHPInelasticCompFS.hh.

55 {
56 QI.resize(51);
57 LR.resize(51);
58 for(G4int i=0; i<51; i++) {
59 hasXsec = true;
60 theXsection[i] = 0;
63 theEnergyAngData[i] = 0;
65 QI[i] = 0.0;
66 LR[i] = 0;
67 }
68 }
int G4int
Definition: G4Types.hh:85
G4ParticleHPAngular * theAngularDistribution[51]
G4ParticleHPEnergyDistribution * theEnergyDistribution[51]
G4ParticleHPEnAngCorrelation * theEnergyAngData[51]
G4ParticleHPPhotonDist * theFinalStatePhotons[51]

◆ ~G4ParticleHPInelasticCompFS()

virtual G4ParticleHPInelasticCompFS::~G4ParticleHPInelasticCompFS ( )
inlinevirtual

Definition at line 70 of file G4ParticleHPInelasticCompFS.hh.

71 {
72 for(G4int i=0; i<51; i++) {
73 if (theXsection[i] != 0) delete theXsection[i];
74 if (theEnergyDistribution[i] != 0) delete theEnergyDistribution[i];
76 if (theEnergyAngData[i] != 0) delete theEnergyAngData[i];
77 if (theFinalStatePhotons[i] != 0) delete theFinalStatePhotons[i];
78 }
79 }

Member Function Documentation

◆ ApplyYourself()

virtual G4HadFinalState * G4ParticleHPInelasticCompFS::ApplyYourself ( const G4HadProjectile theTrack)
pure virtual

◆ CompositeApply()

void G4ParticleHPInelasticCompFS::CompositeApply ( const G4HadProjectile theTrack,
G4ParticleDefinition aHadron 
)

Definition at line 213 of file G4ParticleHPInelasticCompFS.cc.

215{
216
217 // prepare neutron
218 if ( theResult.Get() == nullptr ) theResult.Put( new G4HadFinalState );
219 theResult.Get()->Clear();
220 G4double eKinetic = theTrack.GetKineticEnergy();
221 const G4HadProjectile *hadProjectile = &theTrack;
222 G4ReactionProduct incidReactionProduct( const_cast<G4ParticleDefinition *>(hadProjectile->GetDefinition()) ); // incidReactionProduct
223 incidReactionProduct.SetMomentum( hadProjectile->Get4Momentum().vect() );
224 incidReactionProduct.SetKineticEnergy( eKinetic );
225
226 // prepare target
227 G4int i;
228 for(i=0; i<50; ++i)
229 { if(theXsection[i] != 0) { break; } }
230
231 G4double targetMass=0;
232 G4double eps = 0.0001;
233 targetMass = G4NucleiProperties::GetNuclearMass(static_cast<G4int>(theBaseA+eps), static_cast<G4int>(theBaseZ+eps));
234#ifdef G4PHPDEBUG
235 if( std::getenv("G4ParticleHPDebug"))
236 G4cout <<this <<" G4ParticleHPInelasticCompFS::CompositeApply A "
237 <<theBaseA <<" Z " <<theBaseZ <<" incident "
238 <<hadProjectile->GetDefinition()->GetParticleName() <<G4endl;
239#endif
240 G4ReactionProduct theTarget;
241 G4Nucleus aNucleus;
242 //G4ThreeVector neuVelo = (1./hadProjectile->GetDefinition()->GetPDGMass())*incidReactionProduct.GetMomentum();
243 //theTarget = aNucleus.GetBiasedThermalNucleus( targetMass/hadProjectile->GetDefinition()->GetPDGMass() , neuVelo, theTrack.GetMaterial()->GetTemperature());
244 //G4Nucleus::GetBiasedThermalNucleus requests normalization of mass and velocity in neutron mass
245 G4ThreeVector neuVelo = ( 1./G4Neutron::Neutron()->GetPDGMass() )*incidReactionProduct.GetMomentum();
246 theTarget = aNucleus.GetBiasedThermalNucleus( targetMass/G4Neutron::Neutron()->GetPDGMass()
247 , neuVelo, theTrack.GetMaterial()->GetTemperature() );
248
250
251 // prepare the residual mass
252 G4double residualMass=0;
253 G4double residualZ = theBaseZ + theProjectile->GetPDGCharge() - aDefinition->GetPDGCharge();
254 G4double residualA = theBaseA + theProjectile->GetBaryonNumber() - aDefinition->GetBaryonNumber();
255 residualMass = G4NucleiProperties::GetNuclearMass(static_cast<G4int>(residualA+eps), static_cast<G4int>(residualZ+eps));
256
257 // prepare energy in target rest frame
258 G4ReactionProduct boosted;
259 boosted.Lorentz(incidReactionProduct, theTarget);
260 eKinetic = boosted.GetKineticEnergy();
261
262 // select exit channel for composite FS class.
263 G4int it = SelectExitChannel( eKinetic );
264
265 //E. Mendoza (2018) -- to use JENDL/AN-2005
268 it=50;
269 }
270 }
271
272 // set target and neutron in the relevant exit channel
273 InitDistributionInitialState(incidReactionProduct, theTarget, it);
274
275 //---------------------------------------------------------------------//
276 // Hook for NRESP71MODEL
277 if ( G4ParticleHPManager::GetInstance()->GetUseNRESP71Model() && eKinetic<20*MeV) {
278 if ( (G4int)(theBaseZ+0.1) == 6 ) // If the reaction is with Carbon...
279 {
281 if ( use_nresp71_model( aDefinition , it , theTarget , boosted ) ) return;
282 }
283 }
284 }
285 //---------------------------------------------------------------------//
286
287 G4ReactionProductVector * thePhotons = 0;
288 G4ReactionProductVector * theParticles = 0;
289 G4ReactionProduct aHadron;
290 aHadron.SetDefinition(aDefinition); // what if only cross-sections exist ==> Na 23 11 @@@@
291 G4double availableEnergy = incidReactionProduct.GetKineticEnergy() + incidReactionProduct.GetMass() - aHadron.GetMass() +
292 (targetMass - residualMass);
293
294 if ( availableEnergy < 0 )
295 {
296 availableEnergy = 0;
297 }
298 G4int nothingWasKnownOnHadron = 0;
299 G4int dummy;
300 G4double eGamm = 0;
301 G4int iLevel=it-1;
302
303 // without photon has it = 0
304 if( 50 == it )
305 {
306 // Excitation level is not determined
307 iLevel=-1;
308 aHadron.SetKineticEnergy(availableEnergy*residualMass/
309 (aHadron.GetMass()+residualMass));
310
311 //aHadron.SetMomentum(incidReactionProduct.GetMomentum()*(1./incidReactionProduct.GetTotalMomentum())*
312 // std::sqrt(aHadron.GetTotalEnergy()*aHadron.GetTotalEnergy()-
313 // aHadron.GetMass()*aHadron.GetMass()));
314
315 //TK add safty 100909
316 G4double p2 = ( aHadron.GetTotalEnergy()*aHadron.GetTotalEnergy() - aHadron.GetMass()*aHadron.GetMass() );
317 G4double p = 0.0;
318 if ( p2 > 0.0 )
319 p = std::sqrt( p );
320 aHadron.SetMomentum(incidReactionProduct.GetMomentum()*(1./incidReactionProduct.GetTotalMomentum())*p );
321 }
322 else
323 {
324 while ( iLevel!=-1 && theGammas.GetLevel(iLevel) == 0 ) { iLevel--; } // Loop checking, 11.05.2015, T. Koi
325 }
326
327 if ( theAngularDistribution[it] != 0 ) // MF4
328 {
329 if(theEnergyDistribution[it]!=0) // MF5
330 {
331 //************************************************************
332 /*
333 aHadron.SetKineticEnergy(theEnergyDistribution[it]->Sample(eKinetic, dummy));
334 G4double eSecN = aHadron.GetKineticEnergy();
335 */
336 //************************************************************
337 //EMendoza --> maximum allowable energy should be taken into account.
338 G4double dqi = 0.0;
339 if ( QI[it] < 0 || 849 < QI[it] ) dqi = QI[it]; //For backword compatibility QI introduced since G4NDL3.15
340 G4double MaxEne=eKinetic+dqi;
341 G4double eSecN=0.;
342
343 G4int icounter=0;
344 G4int icounter_max=1024;
345 do {
346 ++icounter;
347 if ( icounter > icounter_max ) {
348 G4cout << "Loop-counter exceeded the threshold value at " << __LINE__ << "th line of " << __FILE__ << "." << G4endl;
349 break;
350 }
351 eSecN=theEnergyDistribution[it]->Sample(eKinetic, dummy);
352 } while(eSecN>MaxEne); // Loop checking, 11.05.2015, T. Koi
353 aHadron.SetKineticEnergy(eSecN);
354 //************************************************************
355 eGamm = eKinetic-eSecN;
356 for(iLevel=theGammas.GetNumberOfLevels()-1; iLevel>=0; --iLevel)
357 {
358 if(theGammas.GetLevelEnergy(iLevel)<eGamm) break;
359 }
360 G4double random = 2*G4UniformRand();
361 iLevel+=G4int(random);
362 if(iLevel>theGammas.GetNumberOfLevels()-1)iLevel = theGammas.GetNumberOfLevels()-1;
363 }
364 else
365 {
366 G4double eExcitation = 0;
367 if(iLevel>=0) eExcitation = theGammas.GetLevel(iLevel)->GetLevelEnergy();
368 while (eKinetic-eExcitation < 0 && iLevel>0) // Loop checking, 11.05.2015, T. Koi
369 {
370 --iLevel;
371 eExcitation = theGammas.GetLevel(iLevel)->GetLevelEnergy();
372 }
373
374 // Use QI value for calculating excitation energy of residual.
375 G4bool useQI=false;
376 G4double dqi = QI[it];
377 if (dqi < 0 || 849 < dqi) useQI = true; // Former libraries do not have values in this range
378
379 if (useQI) {
380 // QI introudced since G4NDL3.15
381 // G4double QM=(incidReactionProduct.GetMass()+targetMass)-(aHadron.GetMass()+residualMass);
382 // eExcitation = QM-QI[it];
383 // eExcitation = QI[0] - QI[it]; // Bug fix #1838
384 // if(eExcitation < 20*CLHEP::keV) eExcitation = 0;
385
386 eExcitation = std::max(0.,QI[0] - QI[it]); // Bug fix 2333
387
388 // Re-evaluate iLevel based on this eExcitation
389 iLevel = 0;
390 G4bool find = false;
391 G4int imaxEx = 0;
392 G4double level_tolerance = 1.0*CLHEP::keV;
393
394 while( theGammas.GetLevel(iLevel+1) != 0 ) { // Loop checking, 11.05.2015, T. Koi
395 G4double maxEx = 0.0;
396 if (maxEx < theGammas.GetLevel(iLevel)->GetLevelEnergy() ) {
397 maxEx = theGammas.GetLevel(iLevel)->GetLevelEnergy();
398 imaxEx = iLevel;
399 }
400
401 // Fix bug 1789 DHW - first if-branch added because gamma data come from ENSDF
402 // and do not necessarily match the excitations used in ENDF-B.VII
403 // Compromise solution: use 1 keV tolerance suggested by T. Koi
404 if (std::abs(eExcitation - theGammas.GetLevel(iLevel)->GetLevelEnergy() ) < level_tolerance) {
405 find = true;
406 break;
407
408 } else if (eExcitation < theGammas.GetLevel(iLevel)->GetLevelEnergy() ) {
409 find = true;
410 --iLevel;
411 // very small eExcitation, iLevel becomes -1, this is protected below
412 if (theTrack.GetDefinition() == aDefinition) { // this line added as part of fix #1838
413 if (iLevel == -1) iLevel = 0;
414 }
415 break;
416 }
417 ++iLevel;
418 }
419
420 // If proper level cannot be found, use the maximum level
421 if (!find) iLevel = imaxEx;
422 }
423
424 if(std::getenv("G4ParticleHPDebug") && eKinetic-eExcitation < 0)
425 {
426 throw G4HadronicException(__FILE__, __LINE__, "SEVERE: InelasticCompFS: Consistency of data not good enough, please file report");
427 }
428 if(eKinetic-eExcitation < 0) eExcitation = 0;
429 if(iLevel!= -1) aHadron.SetKineticEnergy(eKinetic - eExcitation);
430
431 }
433
434 if( theFinalStatePhotons[it] == 0 )
435 {
436 thePhotons = theGammas.GetDecayGammas(iLevel);
437 eGamm -= theGammas.GetLevelEnergy(iLevel);
438 if(eGamm>0) // @ ok for now, but really needs an efficient way of correllated sampling @
439 {
440 G4ReactionProduct * theRestEnergy = new G4ReactionProduct;
441 theRestEnergy->SetDefinition(G4Gamma::Gamma());
442 theRestEnergy->SetKineticEnergy(eGamm);
443 G4double costh = 2.*G4UniformRand()-1.;
444 G4double phi = CLHEP::twopi*G4UniformRand();
445 theRestEnergy->SetMomentum(eGamm*std::sin(std::acos(costh))*std::cos(phi),
446 eGamm*std::sin(std::acos(costh))*std::sin(phi),
447 eGamm*costh);
448 if(thePhotons == 0) { thePhotons = new G4ReactionProductVector; }
449 thePhotons->push_back(theRestEnergy);
450 }
451 }
452 }
453 else if(theEnergyAngData[it] != 0) // MF6
454 {
455
456 theParticles = theEnergyAngData[it]->Sample(eKinetic);
457
458 // Adjust A and Z in the case of miss much between selected data and target nucleus
459 if ( theParticles != NULL ) {
460 G4int sumA = 0;
461 G4int sumZ = 0;
462 G4int maxA = 0;
463 G4int jAtMaxA = 0;
464 for ( G4int j = 0 ; j != (G4int)theParticles->size() ; ++j ) {
465 if ( theParticles->at(j)->GetDefinition()->GetBaryonNumber() > maxA ) {
466 maxA = theParticles->at(j)->GetDefinition()->GetBaryonNumber();
467 jAtMaxA = j;
468 }
469 sumA += theParticles->at(j)->GetDefinition()->GetBaryonNumber();
470 sumZ += G4int( theParticles->at(j)->GetDefinition()->GetPDGCharge() + eps );
471 }
472 G4int dA = (G4int)theBaseA + hadProjectile->GetDefinition()->GetBaryonNumber() - sumA;
473 G4int dZ = (G4int)theBaseZ + G4int( hadProjectile->GetDefinition()->GetPDGCharge() + eps ) - sumZ;
474 if ( dA < 0 || dZ < 0 ) {
475 G4int newA = theParticles->at(jAtMaxA)->GetDefinition()->GetBaryonNumber() + dA ;
476 G4int newZ = G4int( theParticles->at(jAtMaxA)->GetDefinition()->GetPDGCharge() + eps ) + dZ;
477 G4ParticleDefinition* pd = G4IonTable::GetIonTable()->GetIon ( newZ , newA );
478 theParticles->at( jAtMaxA )->SetDefinition( pd );
479 }
480 }
481 }
482 else
483 {
484 // @@@ what to do, if we have photon data, but no info on the hadron itself
485 nothingWasKnownOnHadron = 1;
486 }
487
488 if ( theFinalStatePhotons[it] != 0 )
489 {
490 // the photon distributions are in the Nucleus rest frame.
491 // TK residual rest frame
492 G4ReactionProduct boosted_tmp;
493 boosted_tmp.Lorentz(incidReactionProduct, theTarget);
494 G4double anEnergy = boosted_tmp.GetKineticEnergy();
495 thePhotons = theFinalStatePhotons[it]->GetPhotons(anEnergy);
496 G4double aBaseEnergy = theFinalStatePhotons[it]->GetLevelEnergy();
497 G4double testEnergy = 0;
498 if(thePhotons!=0 && thePhotons->size()!=0)
499 { aBaseEnergy-=thePhotons->operator[](0)->GetTotalEnergy(); }
500 if(theFinalStatePhotons[it]->NeedsCascade())
501 {
502 while(aBaseEnergy>0.01*CLHEP::keV) // Loop checking, 11.05.2015, T. Koi
503 {
504 // cascade down the levels
505 G4bool foundMatchingLevel = false;
506 G4int closest = 2;
507 G4double deltaEold = -1;
508 for(G4int j=1; j<it; ++j)
509 {
510 if(theFinalStatePhotons[j]!=0)
511 {
512 testEnergy = theFinalStatePhotons[j]->GetLevelEnergy();
513 }
514 else
515 {
516 testEnergy = 0;
517 }
518 G4double deltaE = std::abs(testEnergy-aBaseEnergy);
519 if(deltaE<0.1*CLHEP::keV)
520 {
521 G4ReactionProductVector * theNext =
522 theFinalStatePhotons[j]->GetPhotons(anEnergy);
523 if ( thePhotons != nullptr )
524 thePhotons->push_back(theNext->operator[](0));
525 aBaseEnergy = testEnergy-theNext->operator[](0)->GetTotalEnergy();
526 delete theNext;
527 foundMatchingLevel = true;
528 break; // ===>
529 }
530 if(theFinalStatePhotons[j]!=0 && ( deltaE<deltaEold||deltaEold<0.) )
531 {
532 closest = j;
533 deltaEold = deltaE;
534 }
535 } // <=== the break goes here.
536 if(!foundMatchingLevel)
537 {
538 G4ReactionProductVector * theNext =
539 theFinalStatePhotons[closest]->GetPhotons(anEnergy);
540 if ( thePhotons != nullptr )
541 thePhotons->push_back(theNext->operator[](0));
542 aBaseEnergy = aBaseEnergy-theNext->operator[](0)->GetTotalEnergy();
543 delete theNext;
544 }
545 }
546 }
547 }
548 unsigned int i0;
549 if(thePhotons!=0)
550 {
551 for(i0=0; i0<thePhotons->size(); ++i0)
552 {
553 // back to lab
554 thePhotons->operator[](i0)->Lorentz(*(thePhotons->operator[](i0)), -1.*theTarget);
555 }
556 }
557 if (nothingWasKnownOnHadron)
558 {
559 // In this case, hadron should be isotropic in CM
560 // Next 12 lines are Emilio's replacement
561 // G4double QM=(incidReactionProduct.GetMass()+targetMass)-(aHadron.GetMass()+residualMass);
562 // G4double eExcitation = QM-QI[it];
563 // G4double eExcitation = QI[0] - QI[it]; // Fix of bug #1838
564 // if(eExcitation<20*CLHEP::keV){eExcitation=0;}
565
566 G4double eExcitation = std::max(0.,QI[0] - QI[it]); // Fix of bug #2333
567
568 two_body_reaction(&incidReactionProduct,&theTarget,&aHadron,eExcitation);
569 if(thePhotons==0 && eExcitation>0){
570 for(iLevel=theGammas.GetNumberOfLevels()-1; iLevel>=0; --iLevel)
571 {
572 if(theGammas.GetLevelEnergy(iLevel)<eExcitation+5*keV) break; // 5 keV tolerance
573 }
574 thePhotons = theGammas.GetDecayGammas(iLevel);
575 }
576 }
577
578 // fill the result
579 // Beware - the recoil is not necessarily in the particles...
580 // Can be calculated from momentum conservation?
581 // The idea is that the particles ar emitted forst, and the gammas only once the
582 // recoil is on the residual; assumption is that gammas do not contribute to
583 // the recoil.
584 // This needs more design @@@
585
586 G4bool needsSeparateRecoil = false;
587 G4int totalBaryonNumber = 0;
588 G4int totalCharge = 0;
589 G4ThreeVector totalMomentum(0);
590 if(theParticles != 0)
591 {
592 const G4ParticleDefinition * aDef;
593 std::size_t ii0;
594 for(ii0=0; ii0<theParticles->size(); ++ii0)
595 {
596 aDef = theParticles->operator[](ii0)->GetDefinition();
597 totalBaryonNumber+=aDef->GetBaryonNumber();
598 totalCharge+=G4int(aDef->GetPDGCharge()+eps);
599 totalMomentum += theParticles->operator[](ii0)->GetMomentum();
600 }
601 if(totalBaryonNumber!=G4int(theBaseA+eps+hadProjectile->GetDefinition()->GetBaryonNumber()))
602 {
603 needsSeparateRecoil = true;
604 residualA = G4int(theBaseA+eps+hadProjectile->GetDefinition()->GetBaryonNumber()
605 -totalBaryonNumber);
606 residualZ = G4int(theBaseZ+eps+hadProjectile->GetDefinition()->GetPDGCharge()
607 -totalCharge);
608 }
609 }
610
611 std::size_t nPhotons = 0;
612 if(thePhotons!=0) { nPhotons = thePhotons->size(); }
613
614 G4DynamicParticle * theSec;
615
616 if( theParticles==0 )
617 {
618 theSec = new G4DynamicParticle;
619 theSec->SetDefinition(aHadron.GetDefinition());
620 theSec->SetMomentum(aHadron.GetMomentum());
621 theResult.Get()->AddSecondary(theSec, secID);
622#ifdef G4PHPDEBUG
623 if( std::getenv("G4ParticleHPDebug"))
624 G4cout << this << " G4ParticleHPInelasticCompFS::BaseApply add secondary1 "
625 << theSec->GetParticleDefinition()->GetParticleName() << " E= "
626 << theSec->GetKineticEnergy() << " NSECO "
628#endif
629
630 aHadron.Lorentz(aHadron, theTarget);
631 G4ReactionProduct theResidual;
633 ->GetIon(static_cast<G4int>(residualZ), static_cast<G4int>(residualA), 0));
634 theResidual.SetKineticEnergy(aHadron.GetKineticEnergy()*aHadron.GetMass()/theResidual.GetMass());
635
636 //080612TK contribution from Benoit Pirard and Laurent Desorgher (Univ. Bern) #6
637 //theResidual.SetMomentum(-1.*aHadron.GetMomentum());
638 G4ThreeVector incidentNeutronMomentum = incidReactionProduct.GetMomentum();
639 theResidual.SetMomentum(incidentNeutronMomentum - aHadron.GetMomentum());
640
641 theResidual.Lorentz(theResidual, -1.*theTarget);
642 G4ThreeVector totalPhotonMomentum(0,0,0);
643 if(thePhotons!=0)
644 {
645 for(i=0; i<(G4int)nPhotons; ++i)
646 {
647 totalPhotonMomentum += thePhotons->operator[](i)->GetMomentum();
648 }
649 }
650 theSec = new G4DynamicParticle;
651 theSec->SetDefinition(theResidual.GetDefinition());
652 theSec->SetMomentum(theResidual.GetMomentum()-totalPhotonMomentum);
653 theResult.Get()->AddSecondary(theSec, secID);
654#ifdef G4PHPDEBUG
655 if( std::getenv("G4ParticleHPDebug"))
656 G4cout << this
657 << " G4ParticleHPInelasticCompFS::BaseApply add secondary2 "
658 << theSec->GetParticleDefinition()->GetParticleName() << " E= "
659 << theSec->GetKineticEnergy() << " NSECO "
661#endif
662 }
663 else
664 {
665 for(i0=0; i0<theParticles->size(); ++i0)
666 {
667 theSec = new G4DynamicParticle;
668 theSec->SetDefinition(theParticles->operator[](i0)->GetDefinition());
669 theSec->SetMomentum(theParticles->operator[](i0)->GetMomentum());
670 theResult.Get()->AddSecondary(theSec, secID);
671#ifdef G4PHPDEBUG
672 if( std::getenv("G4ParticleHPDebug"))
673 G4cout << this
674 << " G4ParticleHPInelasticCompFS::BaseApply add secondary3 "
675 << theSec->GetParticleDefinition()->GetParticleName() << " E= "
676 << theSec->GetKineticEnergy() << " NSECO "
678#endif
679 delete theParticles->operator[](i0);
680 }
681 delete theParticles;
682 if(needsSeparateRecoil && residualZ!=0)
683 {
684 G4ReactionProduct theResidual;
686 ->GetIon(static_cast<G4int>(residualZ), static_cast<G4int>(residualA), 0));
687 G4double resiualKineticEnergy = theResidual.GetMass()*theResidual.GetMass();
688 resiualKineticEnergy += totalMomentum*totalMomentum;
689 resiualKineticEnergy = std::sqrt(resiualKineticEnergy) - theResidual.GetMass();
690 theResidual.SetKineticEnergy(resiualKineticEnergy);
691
692 //080612TK contribution from Benoit Pirard and Laurent Desorgher (Univ. Bern) #4
693 //theResidual.SetMomentum(-1.*totalMomentum);
694 //G4ThreeVector incidentNeutronMomentum = incidReactionProduct.GetMomentum();
695 //theResidual.SetMomentum(incidentNeutronMomentum - aHadron.GetMomentum());
696 //080717 TK Comment still do NOT include photon's mometum which produce by thePhotons
697 theResidual.SetMomentum( incidReactionProduct.GetMomentum() + theTarget.GetMomentum() - totalMomentum );
698
699 theSec = new G4DynamicParticle;
700 theSec->SetDefinition(theResidual.GetDefinition());
701 theSec->SetMomentum(theResidual.GetMomentum());
702 theResult.Get()->AddSecondary(theSec, secID);
703#ifdef G4PHPDEBUG
704 if( std::getenv("G4ParticleHPDebug"))
705 G4cout << this
706 << " G4ParticleHPInelasticCompFS::BaseApply add secondary4 "
707 << theSec->GetParticleDefinition()->GetParticleName() << " E= "
708 << theSec->GetKineticEnergy() << " NSECO "
710#endif
711 }
712 }
713 if(thePhotons!=0)
714 {
715 for(i=0; i<(G4int)nPhotons; ++i)
716 {
717 theSec = new G4DynamicParticle;
718 //Bug reported Chao Zhang ([email protected]), Dongming Mei([email protected]) Feb. 25, 2009
719 //theSec->SetDefinition(G4Gamma::Gamma());
720 theSec->SetDefinition( thePhotons->operator[](i)->GetDefinition() );
721 //But never cause real effect at least with G4NDL3.13 TK
722 theSec->SetMomentum(thePhotons->operator[](i)->GetMomentum());
723 theResult.Get()->AddSecondary(theSec, secID);
724#ifdef G4PHPDEBUG
725 if( std::getenv("G4ParticleHPDebug"))
726 G4cout << this
727 << " G4ParticleHPInelasticCompFS::BaseApply add secondary5 "
728 << theSec->GetParticleDefinition()->GetParticleName() << " E= "
729 << theSec->GetKineticEnergy() << " NSECO "
731#endif
732
733 delete thePhotons->operator[](i);
734 }
735 // some garbage collection
736 delete thePhotons;
737 }
738
740 G4LorentzVector targ_4p_lab ( theTarget.GetMomentum() , std::sqrt( targ_pd->GetPDGMass()*targ_pd->GetPDGMass() + theTarget.GetMomentum().mag2() ) );
741 G4LorentzVector proj_4p_lab = theTrack.Get4Momentum();
742 G4LorentzVector init_4p_lab = proj_4p_lab + targ_4p_lab;
743 adjust_final_state ( init_4p_lab );
744
745 // clean up the primary neutron
747}
@ stopAndKill
std::vector< G4ReactionProduct * > G4ReactionProductVector
double G4double
Definition: G4Types.hh:83
bool G4bool
Definition: G4Types.hh:86
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
#define G4UniformRand()
Definition: Randomize.hh:52
double mag2() const
Hep3Vector vect() const
value_type & Get() const
Definition: G4Cache.hh:315
void Put(const value_type &val) const
Definition: G4Cache.hh:321
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
const G4ParticleDefinition * GetParticleDefinition() const
G4double GetKineticEnergy() const
void SetMomentum(const G4ThreeVector &momentum)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:85
void SetStatusChange(G4HadFinalStateStatus aS)
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
std::size_t GetNumberOfSecondaries() const
const G4Material * GetMaterial() const
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4ParticleDefinition * GetIon(G4int Z, G4int A, G4int lvl=0)
Definition: G4IonTable.cc:522
static G4IonTable * GetIonTable()
Definition: G4IonTable.cc:170
G4double GetTemperature() const
Definition: G4Material.hh:177
static G4Neutron * Neutron()
Definition: G4Neutron.cc:103
static G4Neutron * Definition()
Definition: G4Neutron.cc:53
static G4double GetNuclearMass(const G4double A, const G4double Z)
G4ReactionProduct GetBiasedThermalNucleus(G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
Definition: G4Nucleus.cc:118
G4double GetPDGCharge() const
const G4String & GetParticleName() const
void SampleAndUpdate(G4ReactionProduct &anIncidentParticle)
G4ParticleHPLevel * GetLevel(G4int i)
G4ReactionProductVector * GetDecayGammas(G4int aLevel)
G4double GetLevelEnergy(G4int aLevel)
G4ReactionProductVector * Sample(G4double anEnergy)
G4double Sample(G4double anEnergy, G4int &it)
G4ParticleDefinition * theProjectile
G4Cache< G4HadFinalState * > theResult
void adjust_final_state(G4LorentzVector)
void InitDistributionInitialState(G4ReactionProduct &anIncidentPart, G4ReactionProduct &aTarget, G4int it)
G4int SelectExitChannel(G4double eKinetic)
static G4ParticleHPManager * GetInstance()
G4ReactionProductVector * GetPhotons(G4double anEnergy)
void SetMomentum(const G4double x, const G4double y, const G4double z)
G4double GetKineticEnergy() const
const G4ParticleDefinition * GetDefinition() const
G4double GetTotalEnergy() const
G4ThreeVector GetMomentum() const
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetKineticEnergy(const G4double en)
G4double GetMass() const

Referenced by G4ParticleHPAInelasticFS::ApplyYourself(), G4ParticleHPDInelasticFS::ApplyYourself(), G4ParticleHPHe3InelasticFS::ApplyYourself(), G4ParticleHPNInelasticFS::ApplyYourself(), G4ParticleHPPInelasticFS::ApplyYourself(), and G4ParticleHPTInelasticFS::ApplyYourself().

◆ GetXsec() [1/2]

virtual G4ParticleHPVector * G4ParticleHPInelasticCompFS::GetXsec ( )
inlinevirtual

Reimplemented from G4ParticleHPFinalState.

Definition at line 95 of file G4ParticleHPInelasticCompFS.hh.

95{ return theXsection[50]; }

Referenced by SelectExitChannel().

◆ GetXsec() [2/2]

virtual G4double G4ParticleHPInelasticCompFS::GetXsec ( G4double  anEnergy)
inlinevirtual

Reimplemented from G4ParticleHPFinalState.

Definition at line 90 of file G4ParticleHPInelasticCompFS.hh.

91 {
92 return std::max(0., theXsection[50]->GetY(anEnergy));
93 }

◆ Init()

void G4ParticleHPInelasticCompFS::Init ( G4double  A,
G4double  Z,
G4int  M,
G4String dirName,
G4String aSFType,
G4ParticleDefinition  
)
virtual

Implements G4ParticleHPFinalState.

Reimplemented in G4ParticleHPNInelasticFS, G4ParticleHPPInelasticFS, and G4ParticleHPTInelasticFS.

Definition at line 77 of file G4ParticleHPInelasticCompFS.cc.

78{
79 gammaPath = "/Inelastic/Gammas/"; //only in neutron data base
80 if(!G4FindDataDir("G4NEUTRONHPDATA"))
81 throw G4HadronicException(__FILE__, __LINE__, "Please setenv G4NEUTRONHPDATA to point to the neutron cross-section files where Inelastic/Gammas data is found.");
82 G4String tBase = G4FindDataDir("G4NEUTRONHPDATA");
83 gammaPath = tBase+gammaPath;
84 G4String tString = dirName;
85 G4bool dbool;
86 G4ParticleHPDataUsed aFile = theNames.GetName(static_cast<G4int>(A), static_cast<G4int>(Z), M, tString, aFSType, dbool);
87 G4String filename = aFile.GetName();
88#ifdef G4PHPDEBUG
89 if( std::getenv("G4ParticleHPDebug") ) G4cout << " G4ParticleHPInelasticCompFS::Init FILE " << filename << G4endl;
90#endif
91
92 SetAZMs( A, Z, M, aFile );
93
94 if ( !dbool || ( Z<2.5 && ( std::abs(theNDLDataZ - Z)>0.0001 || std::abs(theNDLDataA - A)>0.0001)) )
95 {
96#ifdef G4PHPDEBUG
97 if(std::getenv("G4ParticleHPDebug_NamesLogging")) G4cout << "Skipped = "<< filename <<" "<<A<<" "<<Z<<G4endl;
98#endif
99 hasAnyData = false;
100 hasFSData = false;
101 hasXsec = false;
102 return;
103 }
104 std::istringstream theData(std::ios::in);
106 if(!theData) //"!" is a operator of ios
107 {
108 hasAnyData = false;
109 hasFSData = false;
110 hasXsec = false;
111 // theData.close();
112 return;
113 }
114 // here we go
115 G4int infoType, dataType, dummy;
116 G4int sfType, it;
117 hasFSData = false;
118 while (theData >> infoType) // Loop checking, 11.05.2015, T. Koi
119 {
120 hasFSData = true;
121 theData >> dataType;
122 theData >> sfType >> dummy;
123 it = 50;
124 if(sfType>=600||(sfType<100&&sfType>=50)) it = sfType%50;
125 if(dataType==3)
126 {
127 //theData >> dummy >> dummy;
128 //TK110430
129 // QI and LR introudced since G4NDL3.15
130 G4double dqi;
131 G4int ilr;
132 theData >> dqi >> ilr;
133
134 QI[ it ] = dqi*CLHEP::eV;
135 LR[ it ] = ilr;
137 G4int total;
138 theData >> total;
139 theXsection[it]->Init(theData, total, CLHEP::eV);
140 //std::cout << theXsection[it]->GetXsec(1*MeV) << std::endl;
141 }
142 else if(dataType==4)
143 {
145 theAngularDistribution[it]->Init(theData);
146 }
147 else if(dataType==5)
148 {
150 theEnergyDistribution[it]->Init(theData);
151 }
152 else if(dataType==6)
153 {
155 // G4cout << this << " CompFS theEnergyAngData " << it << theEnergyAngData[it] << G4endl; //GDEB
156 theEnergyAngData[it]->Init(theData);
157 }
158 else if(dataType==12)
159 {
161 theFinalStatePhotons[it]->InitMean(theData);
162 }
163 else if(dataType==13)
164 {
167 }
168 else if(dataType==14)
169 {
170 theFinalStatePhotons[it]->InitAngular(theData);
171 }
172 else if(dataType==15)
173 {
175 }
176 else
177 {
178 throw G4HadronicException(__FILE__, __LINE__, "Data-type unknown to G4ParticleHPInelasticCompFS");
179 }
180 }
181 // theData.close();
182}
const char * G4FindDataDir(const char *)
#define M(row, col)
const G4int Z[17]
const G4double A[17]
void Init(std::istream &aDataFile)
void Init(std::istream &aDataFile)
void SetAZMs(G4double anA, G4double aZ, G4int aM, G4ParticleHPDataUsed used)
void GetDataStream(G4String, std::istringstream &iss)
G4ParticleHPDataUsed GetName(G4int A, G4int Z, G4String base, G4String rest, G4bool &active)
void InitEnergies(std::istream &aDataFile)
void InitAngular(std::istream &aDataFile)
void InitPartials(std::istream &aDataFile, G4ParticleHPVector *theXsec=0)
G4bool InitMean(std::istream &aDataFile)
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
G4double total(Particle const *const p1, Particle const *const p2)

Referenced by G4ParticleHPAInelasticFS::Init(), G4ParticleHPDInelasticFS::Init(), G4ParticleHPHe3InelasticFS::Init(), G4ParticleHPNInelasticFS::Init(), G4ParticleHPPInelasticFS::Init(), and G4ParticleHPTInelasticFS::Init().

◆ InitDistributionInitialState()

void G4ParticleHPInelasticCompFS::InitDistributionInitialState ( G4ReactionProduct anIncidentPart,
G4ReactionProduct aTarget,
G4int  it 
)
inline

Definition at line 102 of file G4ParticleHPInelasticCompFS.hh.

105 {
106 if (theAngularDistribution[it] != 0) {
107 theAngularDistribution[it]->SetTarget(aTarget);
108 theAngularDistribution[it]->SetProjectileRP(anIncidentPart);
109 }
110
111 if (theEnergyAngData[it] != 0) {
112 theEnergyAngData[it]->SetTarget(aTarget);
113 theEnergyAngData[it]->SetProjectileRP(anIncidentPart);
114 }
115 }
void SetTarget(const G4ReactionProduct &aTarget)
void SetProjectileRP(const G4ReactionProduct &anIncidentParticleRP)
void SetProjectileRP(G4ReactionProduct &aIncidentPart)
void SetTarget(G4ReactionProduct &aTarget)

Referenced by CompositeApply().

◆ InitGammas()

void G4ParticleHPInelasticCompFS::InitGammas ( G4double  AR,
G4double  ZR 
)

Definition at line 64 of file G4ParticleHPInelasticCompFS.cc.

65{
66 std::ostringstream ost;
67 ost <<gammaPath<<"z"<<ZR<<".a"<<AR;
68 G4String aName = ost.str();
69 std::ifstream from(aName, std::ios::in);
70
71 if(!from) return; // no data found for this isotope
72 std::ifstream theGammaData(aName, std::ios::in);
73
74 theGammas.Init(theGammaData);
75}
void Init(std::istream &aDataFile)

Referenced by G4ParticleHPAInelasticFS::Init(), G4ParticleHPDInelasticFS::Init(), G4ParticleHPHe3InelasticFS::Init(), G4ParticleHPNInelasticFS::Init(), G4ParticleHPPInelasticFS::Init(), and G4ParticleHPTInelasticFS::Init().

◆ New()

◆ SelectExitChannel()

G4int G4ParticleHPInelasticCompFS::SelectExitChannel ( G4double  eKinetic)

Definition at line 184 of file G4ParticleHPInelasticCompFS.cc.

185{
186 G4double running[50];
187 running[0] = 0;
188 G4int i;
189 for(i=0; i<50; ++i)
190 {
191 if(i!=0) running[i]=running[i-1];
192 if(theXsection[i] != 0)
193 {
194 running[i] += std::max(0., theXsection[i]->GetXsec(eKinetic));
195 }
196 }
197 G4double random = G4UniformRand();
198 G4double sum = running[49];
199 G4int it = 50;
200 if(0!=sum)
201 {
202 G4int i0;
203 for(i0=0; i0<50; ++i0)
204 {
205 it = i0;
206 if(random < running[i0]/sum) break;
207 }
208 }
209 return it;
210}
virtual G4ParticleHPVector * GetXsec()

Referenced by CompositeApply().

Member Data Documentation

◆ gammaPath

G4String G4ParticleHPInelasticCompFS::gammaPath
protected

Definition at line 127 of file G4ParticleHPInelasticCompFS.hh.

Referenced by Init(), and InitGammas().

◆ LR

std::vector<G4int> G4ParticleHPInelasticCompFS::LR
protected

Definition at line 131 of file G4ParticleHPInelasticCompFS.hh.

Referenced by G4ParticleHPInelasticCompFS(), and Init().

◆ QI

std::vector<G4double> G4ParticleHPInelasticCompFS::QI
protected

◆ theAngularDistribution

G4ParticleHPAngular* G4ParticleHPInelasticCompFS::theAngularDistribution[51]
protected

◆ theEnergyAngData

G4ParticleHPEnAngCorrelation* G4ParticleHPInelasticCompFS::theEnergyAngData[51]
protected

◆ theEnergyDistribution

G4ParticleHPEnergyDistribution* G4ParticleHPInelasticCompFS::theEnergyDistribution[51]
protected

◆ theFinalStatePhotons

G4ParticleHPPhotonDist* G4ParticleHPInelasticCompFS::theFinalStatePhotons[51]
protected

◆ theGammas

G4ParticleHPDeExGammas G4ParticleHPInelasticCompFS::theGammas
protected

Definition at line 126 of file G4ParticleHPInelasticCompFS.hh.

Referenced by CompositeApply(), and InitGammas().

◆ theXsection

G4ParticleHPVector* G4ParticleHPInelasticCompFS::theXsection[51]
protected

The documentation for this class was generated from the following files: