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

Protected Attributes

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

Additional Inherited Members

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

Detailed Description

Definition at line 51 of file G4ParticleHPInelasticCompFS.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPInelasticCompFS() [1/2]

G4ParticleHPInelasticCompFS::G4ParticleHPInelasticCompFS ( )

Definition at line 72 of file G4ParticleHPInelasticCompFS.cc.

74{
75 QI.resize(51);
76 LR.resize(51);
77 for (G4int i = 0; i < 51; ++i) {
78 hasXsec = true;
79 theXsection[i] = nullptr;
80 theEnergyDistribution[i] = nullptr;
81 theAngularDistribution[i] = nullptr;
82 theEnergyAngData[i] = nullptr;
83 theFinalStatePhotons[i] = nullptr;
84 QI[i] = 0.0;
85 LR[i] = 0;
86 }
87}
int G4int
Definition G4Types.hh:85
G4ParticleHPAngular * theAngularDistribution[51]
G4ParticleHPEnergyDistribution * theEnergyDistribution[51]
G4ParticleHPEnAngCorrelation * theEnergyAngData[51]
G4ParticleHPPhotonDist * theFinalStatePhotons[51]

◆ ~G4ParticleHPInelasticCompFS()

G4ParticleHPInelasticCompFS::~G4ParticleHPInelasticCompFS ( )
override

Definition at line 89 of file G4ParticleHPInelasticCompFS.cc.

90{
91 for (G4int i = 0; i < 51; ++i) {
92 if (theXsection[i] != nullptr) delete theXsection[i];
93 if (theEnergyDistribution[i] != nullptr) delete theEnergyDistribution[i];
94 if (theAngularDistribution[i] != nullptr) delete theAngularDistribution[i];
95 if (theEnergyAngData[i] != nullptr) delete theEnergyAngData[i];
96 if (theFinalStatePhotons[i] != nullptr) delete theFinalStatePhotons[i];
97 }
98}

◆ G4ParticleHPInelasticCompFS() [2/2]

G4ParticleHPInelasticCompFS::G4ParticleHPInelasticCompFS ( G4ParticleHPInelasticCompFS & )
delete

Member Function Documentation

◆ ApplyYourself()

G4HadFinalState * G4ParticleHPInelasticCompFS::ApplyYourself ( const G4HadProjectile & theTrack)
overridepure virtual

◆ CompositeApply()

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

Definition at line 254 of file G4ParticleHPInelasticCompFS.cc.

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

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

◆ GetXsec() [1/2]

G4ParticleHPVector * G4ParticleHPInelasticCompFS::GetXsec ( )
inlineoverridevirtual

Reimplemented from G4ParticleHPFinalState.

Definition at line 71 of file G4ParticleHPInelasticCompFS.hh.

71{ return theXsection[50]; }

Referenced by SelectExitChannel().

◆ GetXsec() [2/2]

G4double G4ParticleHPInelasticCompFS::GetXsec ( G4double anEnergy)
inlineoverridevirtual

Reimplemented from G4ParticleHPFinalState.

Definition at line 66 of file G4ParticleHPInelasticCompFS.hh.

67 {
68 return std::max(0., theXsection[50]->GetY(anEnergy));
69 }

◆ Init()

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

Implements G4ParticleHPFinalState.

Reimplemented in G4ParticleHPNInelasticFS, G4ParticleHPPInelasticFS, and G4ParticleHPTInelasticFS.

Definition at line 129 of file G4ParticleHPInelasticCompFS.cc.

131{
132 gammaPath = fManager->GetNeutronHPPath() + "/Inelastic/Gammas/";
133 G4String tString = dirName;
134 SetA_Z(A, Z, M);
135 G4bool dbool;
137 theNames.GetName(theBaseA, theBaseZ, M, tString, aFSType, dbool);
138 SetAZMs(aFile);
139 G4String filename = aFile.GetName();
140#ifdef G4VERBOSE
141 if (fManager->GetDEBUG())
142 G4cout << " G4ParticleHPInelasticCompFS::Init FILE " << filename << G4endl;
143#endif
144
145 SetAZMs(A, Z, M, aFile);
146
147 if (!dbool || (theBaseZ <= 2 && (theNDLDataZ != theBaseZ || theNDLDataA != theBaseA)))
148 {
149#ifdef G4VERBOSE
150 if (fManager->GetDEBUG())
151 G4cout << "Skipped = " << filename << " " << A << " " << Z << G4endl;
152#endif
153 hasAnyData = false;
154 hasFSData = false;
155 hasXsec = false;
156 return;
157 }
158 std::istringstream theData(std::ios::in);
159 fManager->GetDataStream(filename, theData);
160 if (!theData) //"!" is a operator of ios
161 {
162 hasAnyData = false;
163 hasFSData = false;
164 hasXsec = false;
165 return;
166 }
167 // here we go
168 G4int infoType, dataType, dummy;
169 G4int sfType, it;
170 hasFSData = false;
171 while (theData >> infoType) // Loop checking, 11.05.2015, T. Koi
172 {
173 hasFSData = true;
174 theData >> dataType;
175 theData >> sfType >> dummy;
176 it = 50;
177 if (sfType >= 600 || (sfType < 100 && sfType >= 50))
178 it = sfType % 50;
179 if (dataType == 3)
180 {
181 G4double dqi;
182 G4int ilr;
183 theData >> dqi >> ilr;
184
185 QI[it] = dqi * CLHEP::eV;
186 LR[it] = ilr;
188 G4int total;
189 theData >> total;
190 theXsection[it]->Init(theData, total, CLHEP::eV);
191 }
192 else if (dataType == 4) {
194 theAngularDistribution[it]->Init(theData);
195 }
196 else if (dataType == 5) {
198 theEnergyDistribution[it]->Init(theData);
199 }
200 else if (dataType == 6) {
202 // G4cout << this << " CompFS theEnergyAngData " << it << theEnergyAngData[it] << G4endl;
203 theEnergyAngData[it]->Init(theData);
204 }
205 else if (dataType == 12) {
207 theFinalStatePhotons[it]->InitMean(theData);
208 }
209 else if (dataType == 13) {
212 }
213 else if (dataType == 14) {
214 theFinalStatePhotons[it]->InitAngular(theData);
215 }
216 else if (dataType == 15) {
218 }
219 else {
221 ed << "Z=" << theBaseZ << " A=" << theBaseA << " dataType=" << dataType
222 << " projectile: " << theProjectile->GetParticleName();
223 G4Exception("G4ParticleHPInelasticCompFS::Init", "hadr01", JustWarning,
224 ed, "Data-type unknown");
225 }
226 }
227}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
#define M(row, col)
const G4double A[17]
void Init(std::istream &aDataFile)
void SetA_Z(G4double anA, G4double aZ, G4int aM=0)
void SetAZMs(G4ParticleHPDataUsed used)
const G4String & GetNeutronHPPath() const
void GetDataStream(const G4String &, std::istringstream &iss)
G4ParticleHPDataUsed GetName(G4int A, G4int Z, const G4String &base, const G4String &rest, G4bool &active)
void InitEnergies(std::istream &aDataFile)
void InitAngular(std::istream &aDataFile)
void InitPartials(std::istream &aDataFile, G4ParticleHPVector *theXsec=nullptr)
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 )

Definition at line 100 of file G4ParticleHPInelasticCompFS.cc.

102{
103 if (theAngularDistribution[it] != nullptr) {
104 theAngularDistribution[it]->SetTarget(aTarget);
106 }
107
108 if (theEnergyAngData[it] != nullptr) {
109 theEnergyAngData[it]->SetTarget(aTarget);
111 }
112}
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 114 of file G4ParticleHPInelasticCompFS.cc.

115{
116 G4int Z = G4lrint(ZR);
117 G4int A = G4lrint(AR);
118 std::ostringstream ost;
119 ost << gammaPath << "z" << Z << ".a" << A;
120 G4String aName = ost.str();
121 std::ifstream from(aName, std::ios::in);
122
123 if (!from) return; // no data found for this isotope
124 std::ifstream theGammaData(aName, std::ios::in);
125
126 theGammas.Init(theGammaData);
127}
void Init(std::istream &aDataFile)

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

◆ New()

◆ operator=()

G4ParticleHPInelasticCompFS & G4ParticleHPInelasticCompFS::operator= ( const G4ParticleHPInelasticCompFS & right)
delete

◆ SelectExitChannel()

G4int G4ParticleHPInelasticCompFS::SelectExitChannel ( G4double eKinetic)

Definition at line 229 of file G4ParticleHPInelasticCompFS.cc.

230{
231 G4double running[50];
232 running[0] = 0;
233 G4int i;
234 for (i = 0; i < 50; ++i) {
235 if (i != 0) running[i] = running[i - 1];
236 if (theXsection[i] != nullptr) {
237 running[i] += std::max(0., theXsection[i]->GetXsec(eKinetic));
238 }
239 }
240 G4double random = G4UniformRand();
241 G4double sum = running[49];
242 G4int it = 50;
243 if (0 != sum) {
244 G4int i0;
245 for (i0 = 0; i0 < 50; ++i0) {
246 it = i0;
247 if (random < running[i0] / sum) break;
248 }
249 }
250 return it;
251}
G4ParticleHPVector * GetXsec() override

Referenced by CompositeApply().

Member Data Documentation

◆ gammaPath

G4String G4ParticleHPInelasticCompFS::gammaPath
protected

Definition at line 108 of file G4ParticleHPInelasticCompFS.hh.

Referenced by Init(), and InitGammas().

◆ LR

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

Definition at line 105 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 107 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: