Geant4-11
Public Member Functions | Private Attributes
G4Nucleus Class Reference

#include <G4Nucleus.hh>

Public Member Functions

void AddExcitationEnergy (G4double anEnergy)
 
void AddMomentum (const G4ThreeVector aMomentum)
 
G4double AnnihilationEvaporationEffects (G4double kineticEnergy, G4double ekOrg)
 
G4double AtomicMass (const G4double A, const G4double Z, const G4int numberOfLambdas=0) const
 
G4double AtomicMass (const G4int A, const G4int Z, const G4int numberOfLambdas=0) const
 
void ChooseParameters (const G4Material *aMaterial)
 
G4double Cinema (G4double kineticEnergy)
 
G4double EvaporationEffects (G4double kineticEnergy)
 
G4ReactionProductVectorFragmentate ()
 
 G4Nucleus ()
 
 G4Nucleus (const G4double A, const G4double Z, const G4int numberOfLambdas=0)
 
 G4Nucleus (const G4int A, const G4int Z, const G4int numberOfLambdas=0)
 
 G4Nucleus (const G4Material *aMaterial)
 
 G4Nucleus (const G4Nucleus &right)
 
G4int GetA_asInt () const
 
G4double GetAnnihilationDTABlackTrackEnergy () const
 
G4double GetAnnihilationPNBlackTrackEnergy () const
 
G4ReactionProduct GetBiasedThermalNucleus (G4double aMass, G4ThreeVector aVelocity, G4double temp=-1) const
 
G4double GetDTABlackTrackEnergy () const
 
G4double GetEnergyDeposit ()
 
G4ThreeVector GetFermiMomentum ()
 
const G4IsotopeGetIsotope ()
 
G4int GetL () const
 
G4int GetN_asInt () const
 
G4double GetPNBlackTrackEnergy () const
 
G4ReactionProduct GetThermalNucleus (G4double aMass, G4double temp=-1) const
 
G4double GetThermalPz (const G4double mass, const G4double temp) const
 
G4int GetZ_asInt () const
 
G4bool operator!= (const G4Nucleus &right) const
 
G4Nucleusoperator= (const G4Nucleus &right)
 
G4bool operator== (const G4Nucleus &right) const
 
G4DynamicParticleReturnTargetParticle () const
 
void SetIsotope (const G4Isotope *iso)
 
void SetParameters (const G4double A, const G4double Z, const G4int numberOfLambdas=0)
 
void SetParameters (const G4int A, const G4int Z, const G4int numberOfLambdas=0)
 
 ~G4Nucleus ()
 

Private Attributes

G4double aEff
 
G4double dtaBlackTrackEnergy
 
G4double dtaBlackTrackEnergyfromAnnihilation
 
G4double excitationEnergy
 
G4double fermiMomentum
 
const G4IsotopefIsotope
 
G4ThreeVector momentum
 
G4double pnBlackTrackEnergy
 
G4double pnBlackTrackEnergyfromAnnihilation
 
G4int theA
 
G4int theL
 
G4double theTemp
 
G4int theZ
 
G4double zEff
 

Detailed Description

Definition at line 51 of file G4Nucleus.hh.

Constructor & Destructor Documentation

◆ G4Nucleus() [1/5]

G4Nucleus::G4Nucleus ( )

Definition at line 55 of file G4Nucleus.cc.

56 : theA(0), theZ(0), theL(0), aEff(0.0), zEff(0)
57{
62 excitationEnergy = 0.0;
63 momentum = G4ThreeVector(0.,0.,0.);
65 theTemp = 293.16*kelvin;
66 fIsotope = 0;
67}
static constexpr double kelvin
Definition: G4SIunits.hh:274
static constexpr double fermi
Definition: G4SIunits.hh:83
CLHEP::Hep3Vector G4ThreeVector
G4double aEff
Definition: G4Nucleus.hh:189
G4double dtaBlackTrackEnergy
Definition: G4Nucleus.hh:196
G4double zEff
Definition: G4Nucleus.hh:190
G4double pnBlackTrackEnergyfromAnnihilation
Definition: G4Nucleus.hh:198
G4double excitationEnergy
Definition: G4Nucleus.hh:208
G4ThreeVector momentum
Definition: G4Nucleus.hh:211
G4double theTemp
Definition: G4Nucleus.hh:220
G4int theZ
Definition: G4Nucleus.hh:187
G4int theA
Definition: G4Nucleus.hh:186
G4double fermiMomentum
Definition: G4Nucleus.hh:219
G4double dtaBlackTrackEnergyfromAnnihilation
Definition: G4Nucleus.hh:201
G4double pnBlackTrackEnergy
Definition: G4Nucleus.hh:194
const G4Isotope * fIsotope
Definition: G4Nucleus.hh:192
G4int theL
Definition: G4Nucleus.hh:188
float hbarc
Definition: hepunit.py:264

References dtaBlackTrackEnergy, dtaBlackTrackEnergyfromAnnihilation, excitationEnergy, fermi, fermiMomentum, fIsotope, source.hepunit::hbarc, kelvin, momentum, pnBlackTrackEnergy, pnBlackTrackEnergyfromAnnihilation, and theTemp.

◆ G4Nucleus() [2/5]

G4Nucleus::G4Nucleus ( const G4double  A,
const G4double  Z,
const G4int  numberOfLambdas = 0 
)

Definition at line 69 of file G4Nucleus.cc.

70{
71 SetParameters( A, Z, std::max(numberOfLambdas, 0) );
76 excitationEnergy = 0.0;
77 momentum = G4ThreeVector(0.,0.,0.);
79 theTemp = 293.16*kelvin;
80 fIsotope = 0;
81}
const G4int Z[17]
const G4double A[17]
void SetParameters(const G4double A, const G4double Z, const G4int numberOfLambdas=0)
Definition: G4Nucleus.cc:307
T max(const T t1, const T t2)
brief Return the largest of the two arguments

References A, dtaBlackTrackEnergy, dtaBlackTrackEnergyfromAnnihilation, excitationEnergy, fermi, fermiMomentum, fIsotope, source.hepunit::hbarc, kelvin, G4INCL::Math::max(), momentum, pnBlackTrackEnergy, pnBlackTrackEnergyfromAnnihilation, SetParameters(), theTemp, and Z.

◆ G4Nucleus() [3/5]

G4Nucleus::G4Nucleus ( const G4int  A,
const G4int  Z,
const G4int  numberOfLambdas = 0 
)

◆ G4Nucleus() [4/5]

G4Nucleus::G4Nucleus ( const G4Material aMaterial)

◆ ~G4Nucleus()

G4Nucleus::~G4Nucleus ( )

Definition at line 111 of file G4Nucleus.cc.

111{}

◆ G4Nucleus() [5/5]

G4Nucleus::G4Nucleus ( const G4Nucleus right)
inline

Definition at line 62 of file G4Nucleus.hh.

63 { *this = right; }

Member Function Documentation

◆ AddExcitationEnergy()

void G4Nucleus::AddExcitationEnergy ( G4double  anEnergy)

Definition at line 566 of file G4Nucleus.cc.

567{
568 excitationEnergy+=anEnergy;
569}

References excitationEnergy.

◆ AddMomentum()

void G4Nucleus::AddMomentum ( const G4ThreeVector  aMomentum)

Definition at line 560 of file G4Nucleus.cc.

561{
562 momentum+=(aMomentum);
563}

References momentum.

◆ AnnihilationEvaporationEffects()

G4double G4Nucleus::AnnihilationEvaporationEffects ( G4double  kineticEnergy,
G4double  ekOrg 
)

Definition at line 453 of file G4Nucleus.cc.

454{
455 // Nuclear evaporation as a function of atomic number and kinetic
456 // energy (MeV) of primary particle. Modified for annihilation effects.
457 //
458 if( aEff < 1.5 || ekOrg < 0.)
459 {
462 return 0.0;
463 }
464 G4double ek = kineticEnergy/GeV;
465 G4float ekin = std::min( 4.0, std::max( 0.1, ek ) );
466 const G4float atno = std::min( 120., aEff );
467 const G4float gfa = 2.0*((aEff-1.0)/70.)*G4Exp(-(aEff-1.0)/70.);
468
469 G4float cfa = std::max( 0.15, 0.35 + ((0.35-0.05)/2.3)*G4Log(ekin) );
470 G4float exnu = 7.716 * cfa * G4Exp(-cfa)
471 * ((atno-1.0)/120.)*G4Exp(-(atno-1.0)/120.);
472 G4float fpdiv = std::max( 0.5, 1.0-0.25*ekin*ekin );
473
475 dtaBlackTrackEnergyfromAnnihilation = exnu*(1.0-fpdiv);
476
477 G4double ran1 = -6.0;
478 G4double ran2 = -6.0;
479 for( G4int i=0; i<12; ++i ) {
480 ran1 += G4UniformRand();
481 ran2 += G4UniformRand();
482 }
483 pnBlackTrackEnergyfromAnnihilation *= 1.0 + ran1*gfa;
484 dtaBlackTrackEnergyfromAnnihilation *= 1.0 + ran2*gfa;
485
489 if (blackSum >= ekOrg/GeV) {
490 pnBlackTrackEnergyfromAnnihilation *= ekOrg/GeV/blackSum;
492 }
493
495}
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:179
G4double G4Log(G4double x)
Definition: G4Log.hh:226
static constexpr double GeV
Definition: G4SIunits.hh:203
float G4float
Definition: G4Types.hh:84
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
#define G4UniformRand()
Definition: Randomize.hh:52
T min(const T t1, const T t2)
brief Return the smallest of the two arguments

References aEff, dtaBlackTrackEnergyfromAnnihilation, G4Exp(), G4Log(), G4UniformRand, GeV, G4INCL::Math::max(), G4INCL::Math::min(), and pnBlackTrackEnergyfromAnnihilation.

◆ AtomicMass() [1/2]

G4double G4Nucleus::AtomicMass ( const G4double  A,
const G4double  Z,
const G4int  numberOfLambdas = 0 
) const

◆ AtomicMass() [2/2]

G4double G4Nucleus::AtomicMass ( const G4int  A,
const G4int  Z,
const G4int  numberOfLambdas = 0 
) const

Definition at line 369 of file G4Nucleus.cc.

370{
371 // Now returns (atomic mass - electron masses)
372 if ( numberOfLambdas > 0 ) {
373 return G4HyperNucleiProperties::GetNuclearMass(A, Z, numberOfLambdas);
374 } else {
376 }
377}

References A, G4NucleiProperties::GetNuclearMass(), G4HyperNucleiProperties::GetNuclearMass(), and Z.

◆ ChooseParameters()

void G4Nucleus::ChooseParameters ( const G4Material aMaterial)

Definition at line 265 of file G4Nucleus.cc.

266{
267 G4double random = G4UniformRand();
268 G4double sum = aMaterial->GetTotNbOfAtomsPerVolume();
269 const G4ElementVector* theElementVector = aMaterial->GetElementVector();
270 G4double running(0);
271 // G4Element* element(0);
272 const G4Element* element = (*theElementVector)[aMaterial->GetNumberOfElements()-1];
273
274 for (unsigned int i = 0; i < aMaterial->GetNumberOfElements(); ++i) {
275 running += aMaterial->GetVecNbOfAtomsPerVolume()[i];
276 if (running > random*sum) {
277 element = (*theElementVector)[i];
278 break;
279 }
280 }
281
282 if (element->GetNumberOfIsotopes() > 0) {
283 G4double randomAbundance = G4UniformRand();
284 G4double sumAbundance = element->GetRelativeAbundanceVector()[0];
285 unsigned int iso=0;
286 while (iso < element->GetNumberOfIsotopes() && /* Loop checking, 02.11.2015, A.Ribon */
287 sumAbundance < randomAbundance) {
288 ++iso;
289 sumAbundance += element->GetRelativeAbundanceVector()[iso];
290 }
291 theA=element->GetIsotope(iso)->GetN();
292 theZ=element->GetIsotope(iso)->GetZ();
293 theL=0;
294 aEff=theA;
295 zEff=theZ;
296 } else {
297 aEff = element->GetN();
298 zEff = element->GetZ();
299 theZ = G4int(zEff + 0.5);
300 theA = G4int(aEff + 0.5);
301 theL=0;
302 }
303}
std::vector< const G4Element * > G4ElementVector
G4double * GetRelativeAbundanceVector() const
Definition: G4Element.hh:167
G4double GetZ() const
Definition: G4Element.hh:131
const G4Isotope * GetIsotope(G4int iso) const
Definition: G4Element.hh:170
size_t GetNumberOfIsotopes() const
Definition: G4Element.hh:159
G4double GetN() const
Definition: G4Element.hh:135
G4int GetZ() const
Definition: G4Isotope.hh:90
G4int GetN() const
Definition: G4Isotope.hh:93
const G4ElementVector * GetElementVector() const
Definition: G4Material.hh:186
G4double GetTotNbOfAtomsPerVolume() const
Definition: G4Material.hh:205
size_t GetNumberOfElements() const
Definition: G4Material.hh:182
const G4double * GetVecNbOfAtomsPerVolume() const
Definition: G4Material.hh:202

References aEff, G4UniformRand, G4Material::GetElementVector(), G4Element::GetIsotope(), G4Element::GetN(), G4Isotope::GetN(), G4Material::GetNumberOfElements(), G4Element::GetNumberOfIsotopes(), G4Element::GetRelativeAbundanceVector(), G4Material::GetTotNbOfAtomsPerVolume(), G4Material::GetVecNbOfAtomsPerVolume(), G4Element::GetZ(), G4Isotope::GetZ(), theA, theL, theZ, and zEff.

Referenced by G4Nucleus().

◆ Cinema()

G4double G4Nucleus::Cinema ( G4double  kineticEnergy)

Definition at line 499 of file G4Nucleus.cc.

500{
501 // derived from original FORTRAN code CINEMA by H. Fesefeldt (14-Oct-1987)
502 //
503 // input: kineticEnergy (MeV)
504 // returns modified kinetic energy (MeV)
505 //
506 static const G4double expxu = 82.; // upper bound for arg. of exp
507 static const G4double expxl = -expxu; // lower bound for arg. of exp
508
509 G4double ek = kineticEnergy/GeV;
510 G4double ekLog = G4Log( ek );
511 G4double aLog = G4Log( aEff );
512 G4double em = std::min( 1.0, 0.2390 + 0.0408*aLog*aLog );
513 G4double temp1 = -ek * std::min( 0.15, 0.0019*aLog*aLog*aLog );
514 G4double temp2 = G4Exp( std::max( expxl, std::min( expxu, -(ekLog-em)*(ekLog-em)*2.0 ) ) );
515 G4double result = 0.0;
516 if( std::abs( temp1 ) < 1.0 )
517 {
518 if( temp2 > 1.0e-10 )result = temp1*temp2;
519 }
520 else result = temp1*temp2;
521 if( result < -ek )result = -ek;
522 return result*GeV;
523}

References aEff, G4Exp(), G4Log(), GeV, G4INCL::Math::max(), and G4INCL::Math::min().

◆ EvaporationEffects()

G4double G4Nucleus::EvaporationEffects ( G4double  kineticEnergy)

Definition at line 392 of file G4Nucleus.cc.

393{
394 // derived from original FORTRAN code EXNU by H. Fesefeldt (10-Dec-1986)
395 //
396 // Nuclear evaporation as function of atomic number
397 // and kinetic energy (MeV) of primary particle
398 //
399 // returns kinetic energy (MeV)
400 //
401 if( aEff < 1.5 )
402 {
404 return 0.0;
405 }
406 G4double ek = kineticEnergy/GeV;
407 G4float ekin = std::min( 4.0, std::max( 0.1, ek ) );
408 const G4float atno = std::min( 120., aEff );
409 const G4float gfa = 2.0*((aEff-1.0)/70.)*G4Exp(-(aEff-1.0)/70.);
410 //
411 // 0.35 value at 1 GeV
412 // 0.05 value at 0.1 GeV
413 //
414 G4float cfa = std::max( 0.15, 0.35 + ((0.35-0.05)/2.3)*G4Log(ekin) );
415 G4float exnu = 7.716 * cfa * G4Exp(-cfa)
416 * ((atno-1.0)/120.)*G4Exp(-(atno-1.0)/120.);
417 G4float fpdiv = std::max( 0.5, 1.0-0.25*ekin*ekin );
418 //
419 // pnBlackTrackEnergy is the kinetic energy (in GeV) available for
420 // proton/neutron black track particles
421 // dtaBlackTrackEnergy is the kinetic energy (in GeV) available for
422 // deuteron/triton/alpha black track particles
423 //
424 pnBlackTrackEnergy = exnu*fpdiv;
425 dtaBlackTrackEnergy = exnu*(1.0-fpdiv);
426
427 if( G4int(zEff+0.1) != 82 )
428 {
429 G4double ran1 = -6.0;
430 G4double ran2 = -6.0;
431 for( G4int i=0; i<12; ++i )
432 {
433 ran1 += G4UniformRand();
434 ran2 += G4UniformRand();
435 }
436 pnBlackTrackEnergy *= 1.0 + ran1*gfa;
437 dtaBlackTrackEnergy *= 1.0 + ran2*gfa;
438 }
441 while( pnBlackTrackEnergy+dtaBlackTrackEnergy >= ek ) /* Loop checking, 02.11.2015, A.Ribon */
442 {
443 pnBlackTrackEnergy *= 1.0 - 0.5*G4UniformRand();
444 dtaBlackTrackEnergy *= 1.0 - 0.5*G4UniformRand();
445 }
446 //G4cout << "EvaporationEffects "<<kineticEnergy<<" "
447 // <<pnBlackTrackEnergy+dtaBlackTrackEnergy<< G4endl;
449}

References aEff, dtaBlackTrackEnergy, G4Exp(), G4Log(), G4UniformRand, GeV, G4INCL::Math::max(), G4INCL::Math::min(), pnBlackTrackEnergy, and zEff.

◆ Fragmentate()

G4ReactionProductVector * G4Nucleus::Fragmentate ( )

Definition at line 553 of file G4Nucleus.cc.

554{
555 // needs implementation!
556 return nullptr;
557}

◆ GetA_asInt()

G4int G4Nucleus::GetA_asInt ( ) const
inline

Definition at line 99 of file G4Nucleus.hh.

100 { return theA; }

References theA.

Referenced by G4INCLXXInterface::AccurateProjectile(), G4WilsonAbrasionModel::ApplyYourself(), G4EMDissociation::ApplyYourself(), G4LENDorBERTModel::ApplyYourself(), G4LENDCapture::ApplyYourself(), G4LENDCombinedModel::ApplyYourself(), G4LENDElastic::ApplyYourself(), G4LENDFission::ApplyYourself(), G4LENDGammaModel::ApplyYourself(), G4LENDInelastic::ApplyYourself(), G4LENDModel::ApplyYourself(), G4LFission::ApplyYourself(), G4ANuElNucleusCcModel::ApplyYourself(), G4ANuElNucleusNcModel::ApplyYourself(), G4ANuMuNucleusCcModel::ApplyYourself(), G4ANuMuNucleusNcModel::ApplyYourself(), G4NuElNucleusCcModel::ApplyYourself(), G4NuElNucleusNcModel::ApplyYourself(), G4NuMuNucleusCcModel::ApplyYourself(), G4NuMuNucleusNcModel::ApplyYourself(), G4QMDReaction::ApplyYourself(), G4EmCaptureCascade::ApplyYourself(), G4MuMinusCapturePrecompound::ApplyYourself(), G4MuonMinusBoundDecay::ApplyYourself(), G4NeutronRadCapture::ApplyYourself(), G4LowEGammaNuclearModel::ApplyYourself(), G4ChargeExchange::ApplyYourself(), G4HadronElastic::ApplyYourself(), G4LEHadronProtonElastic::ApplyYourself(), G4LEnp::ApplyYourself(), G4LEpp::ApplyYourself(), G4BinaryCascade::ApplyYourself(), G4BinaryLightIonReaction::ApplyYourself(), G4CascadeInterface::ApplyYourself(), G4INCLXXInterface::ApplyYourself(), G4LMsdGenerator::ApplyYourself(), G4PreCompoundModel::ApplyYourself(), G4LowEIonFragmentation::ApplyYourself(), G4TheoFSGenerator::ApplyYourself(), G4HadronStoppingProcess::AtRestDoIt(), G4MuonMinusAtomicCapture::AtRestDoIt(), G4HadronicProcess::CheckEnergyMomentumConservation(), G4HadronicProcess::CheckResult(), G4NeutrinoNucleusModel::CoherentPion(), G4CascadeInterface::createTarget(), G4MuonicAtomDecay::DecayIt(), G4NeutrinoNucleusModel::FermiMomentum(), G4HadronicProcess::FillResult(), G4NeutrinoNucleusModel::FinalBarion(), G4QuasiElasticChannel::GetFraction(), G4NeutrinoNucleusModel::GgSampleNM(), G4FTFModel::Init(), G4LMsdGenerator::IsApplicable(), G4NeutrinoNucleusModel::NucleonMomentum(), G4NeutrinoElectronProcess::PostStepDoIt(), G4HadronicProcess::PostStepDoIt(), G4ElNeutrinoNucleusProcess::PostStepDoIt(), G4HadronElasticProcess::PostStepDoIt(), G4MuNeutrinoNucleusProcess::PostStepDoIt(), G4ANuElNucleusCcModel::SampleLVkr(), G4ANuElNucleusNcModel::SampleLVkr(), G4ANuMuNucleusCcModel::SampleLVkr(), G4ANuMuNucleusNcModel::SampleLVkr(), G4NuElNucleusCcModel::SampleLVkr(), G4NuElNucleusNcModel::SampleLVkr(), G4NuMuNucleusCcModel::SampleLVkr(), G4NuMuNucleusNcModel::SampleLVkr(), G4VPartonStringModel::Scatter(), and G4QuasiElasticChannel::Scatter().

◆ GetAnnihilationDTABlackTrackEnergy()

G4double G4Nucleus::GetAnnihilationDTABlackTrackEnergy ( ) const
inline

Definition at line 152 of file G4Nucleus.hh.

References dtaBlackTrackEnergyfromAnnihilation.

◆ GetAnnihilationPNBlackTrackEnergy()

G4double G4Nucleus::GetAnnihilationPNBlackTrackEnergy ( ) const
inline

Definition at line 149 of file G4Nucleus.hh.

References pnBlackTrackEnergyfromAnnihilation.

◆ GetBiasedThermalNucleus()

G4ReactionProduct G4Nucleus::GetBiasedThermalNucleus ( G4double  aMass,
G4ThreeVector  aVelocity,
G4double  temp = -1 
) const

Definition at line 118 of file G4Nucleus.cc.

119{
120 // If E_neutron <= 400*kB*T (400 is a common value encounter in MC neutron transport code)
121 // Then apply the Sampling ot the Velocity of the Target (SVT) method
122 // Else consider the target nucleus being without motion
123 G4double E_threshold = 400.0*8.617333262E-11*temp; // 400*kBoltzman*T
124 G4double E_neutron = 0.5*aVelocity.mag2()*G4Neutron::Neutron()->GetPDGMass(); // E=0.5*m*v2
125
126 G4ReactionProduct result;
127 result.SetMass(aMass*G4Neutron::Neutron()->GetPDGMass());
128
129 if ( E_neutron <= E_threshold ) {
130
131 // Beta = sqrt(m/2kT)
132 G4double beta = std::sqrt(result.GetMass()/(2.*8.617333262E-11*temp)); // kT E-5[eV] mass E-11[MeV] => beta in [m/s]-1
133
134 // Neutron speed vn
135 G4double vN_norm = aVelocity.mag();
136 G4double vN_norm2 = vN_norm*vN_norm;
137 G4double y = beta*vN_norm;
138
139 // Normalize neutron velocity
140 aVelocity = (1./vN_norm)*aVelocity;
141
142 // Sample target speed
143 G4double x2;
144 G4double randThreshold;
145 G4double vT_norm, vT_norm2, mu; //theta, val1, val2,
146 G4double acceptThreshold;
147 G4double vRelativeSpeed;
148 G4double cdf0 = 2./(2.+std::sqrt(CLHEP::pi)*y);
149
150 do {
151 // Sample the target velocity vT in the laboratory frame
152 if ( G4UniformRand() < cdf0 ) {
153 // Sample in C45 from https://laws.lanl.gov/vhosts/mcnp.lanl.gov/pdf_files/la-9721.pdf
154 x2 = -std::log(G4UniformRand()*G4UniformRand());
155 } else {
156 // Sample in C61 from https://laws.lanl.gov/vhosts/mcnp.lanl.gov/pdf_files/la-9721.pdf
157 G4double ampl = std::cos(CLHEP::pi/2.0 * G4UniformRand());
158 x2 = -std::log(G4UniformRand()) - std::log(G4UniformRand())*ampl*ampl;
159 }
160
161 vT_norm = std::sqrt(x2)/beta;
162 vT_norm2 = vT_norm*vT_norm;
163
164 // Sample cosine between the incident neutron and the target in the laboratory frame
165 mu = 2*G4UniformRand() - 1;
166
167 // Define acceptance threshold
168 vRelativeSpeed = std::sqrt(vN_norm2 + vT_norm2 - 2*vN_norm*vT_norm*mu);
169 acceptThreshold = vRelativeSpeed/(vN_norm + vT_norm);
170 randThreshold = G4UniformRand();
171 } while ( randThreshold >= acceptThreshold );
172
173 // Get target nucleus direction from the neutron direction and the relative angle between target nucleus and neutron (mu)
174 G4double cosTh = mu;
175 G4ThreeVector uNorm = aVelocity;
176
177 G4double sinTh = std::sqrt(1. - cosTh*cosTh);
178
179 // Sample randomly the phi angle between the neutron veloicty and the target velocity
181 G4double sinPhi = std::sin(phi);
182 G4double cosPhi = std::cos(phi);
183
184 // Find orthogonal vector to aVelocity - solve equation xx' + yy' + zz' = 0
185 G4ThreeVector ortho(1,1,1);
186 if ( uNorm[0] ) ortho[0] = -(uNorm[1]+uNorm[2])/uNorm[0];
187 else if ( uNorm[1] ) ortho[1] = -(uNorm[0]+uNorm[2])/uNorm[1];
188 else if ( uNorm[2] ) ortho[2] = -(uNorm[0]+uNorm[1])/uNorm[2];
189
190 // Normalize the vector
191 ortho = (1/ortho.mag())*ortho;
192
193 // Find vector to draw a plan perpendicular to uNorm (i.e neutron velocity) with vectors ortho & orthoComp
194 G4ThreeVector orthoComp( uNorm[1]*ortho[2] - ortho[1]*uNorm[2],
195 uNorm[2]*ortho[0] - ortho[2]*uNorm[0],
196 uNorm[0]*ortho[1] - ortho[0]*uNorm[1] );
197
198 // Find the direction of the target velocity in the laboratory frame
199 G4ThreeVector directionTarget( cosTh*uNorm[0] + sinTh*(cosPhi*orthoComp[0] + sinPhi*ortho[0]),
200 cosTh*uNorm[1] + sinTh*(cosPhi*orthoComp[1] + sinPhi*ortho[1]),
201 cosTh*uNorm[2] + sinTh*(cosPhi*orthoComp[2] + sinPhi*ortho[2]) );
202
203 // Normalize directionTarget
204 directionTarget = (1/directionTarget.mag())*directionTarget;
205
206 // Set momentum
207 G4double px = result.GetMass()*vT_norm*directionTarget[0];
208 G4double py = result.GetMass()*vT_norm*directionTarget[1];
209 G4double pz = result.GetMass()*vT_norm*directionTarget[2];
210 result.SetMomentum(px, py, pz);
211
212 G4double tMom = std::sqrt(px*px+py*py+pz*pz);
213 G4double tEtot = std::sqrt((tMom+result.GetMass())*(tMom+result.GetMass())
214 - 2.*tMom*result.GetMass());
215
216 if ( tEtot/result.GetMass() - 1. > 0.001 ) {
217 // use relativistic energy for higher energies
218 result.SetTotalEnergy(tEtot);
219 } else {
220 // use p**2/2M for lower energies (to preserve precision?)
221 result.SetKineticEnergy(tMom*tMom/(2.*result.GetMass()));
222 }
223
224 } else { // target nucleus considered as being without motion
225
226 result.SetMomentum(0., 0., 0.);
227 result.SetKineticEnergy(0.);
228
229 }
230
231 return result;
232}
double mag2() const
double mag() const
static G4Neutron * Neutron()
Definition: G4Neutron.cc:103
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetTotalEnergy(const G4double en)
void SetKineticEnergy(const G4double en)
G4double GetMass() const
void SetMass(const G4double mas)
static constexpr double twopi
Definition: SystemOfUnits.h:56
static constexpr double pi
Definition: SystemOfUnits.h:55

References anonymous_namespace{G4PionRadiativeDecayChannel.cc}::beta, G4UniformRand, G4ReactionProduct::GetMass(), G4ParticleDefinition::GetPDGMass(), CLHEP::Hep3Vector::mag(), CLHEP::Hep3Vector::mag2(), G4Neutron::Neutron(), CLHEP::pi, G4ReactionProduct::SetKineticEnergy(), G4ReactionProduct::SetMass(), G4ReactionProduct::SetMomentum(), G4ReactionProduct::SetTotalEnergy(), and CLHEP::twopi.

Referenced by G4FissionLibrary::ApplyYourself(), G4ParticleHPCaptureFS::ApplyYourself(), G4ParticleHPElasticFS::ApplyYourself(), G4ParticleHPFissionFS::ApplyYourself(), G4ParticleHPInelasticBaseFS::BaseApply(), G4ParticleHPInelasticCompFS::CompositeApply(), and G4ParticleHPThermalBoost::GetThermalEnergy().

◆ GetDTABlackTrackEnergy()

G4double G4Nucleus::GetDTABlackTrackEnergy ( ) const
inline

Definition at line 146 of file G4Nucleus.hh.

147 { return dtaBlackTrackEnergy; }

References dtaBlackTrackEnergy.

◆ GetEnergyDeposit()

G4double G4Nucleus::GetEnergyDeposit ( )
inline

Definition at line 177 of file G4Nucleus.hh.

177{return excitationEnergy; }

References excitationEnergy.

Referenced by G4WilsonAbrasionModel::ApplyYourself().

◆ GetFermiMomentum()

G4ThreeVector G4Nucleus::GetFermiMomentum ( )

Definition at line 526 of file G4Nucleus.cc.

527{
528 // chv: .. we assume zero temperature!
529
530 // momentum is equally distributed in each phasespace volume dpx, dpy, dpz.
531 G4double ranflat1=
533 G4double ranflat2=
535 G4double ranflat3=
537 G4double ranmax = (ranflat1>ranflat2? ranflat1: ranflat2);
538 ranmax = (ranmax>ranflat3? ranmax : ranflat3);
539
540 // Isotropic momentum distribution
541 G4double costheta = 2.*G4UniformRand() - 1.0;
542 G4double sintheta = std::sqrt(1.0 - costheta*costheta);
543 G4double phi = 2.0*pi*G4UniformRand();
544
545 G4double pz=costheta*ranmax;
546 G4double px=sintheta*std::cos(phi)*ranmax;
547 G4double py=sintheta*std::sin(phi)*ranmax;
548 G4ThreeVector p(px,py,pz);
549 return p;
550}
static constexpr double pi
Definition: G4SIunits.hh:55
ThreeVector shoot(const G4int Ap, const G4int Af)

References fermiMomentum, G4UniformRand, pi, and G4INCL::DeJongSpin::shoot().

◆ GetIsotope()

const G4Isotope * G4Nucleus::GetIsotope ( )
inline

◆ GetL()

G4int G4Nucleus::GetL ( ) const
inline

Definition at line 108 of file G4Nucleus.hh.

109 { return theL; }

References theL.

Referenced by G4INCLXXInterface::ApplyYourself().

◆ GetN_asInt()

G4int G4Nucleus::GetN_asInt ( ) const
inline

Definition at line 102 of file G4Nucleus.hh.

103 { return theA-theZ; }

References theA, and theZ.

Referenced by G4QuasiElasticChannel::GetFraction().

◆ GetPNBlackTrackEnergy()

G4double G4Nucleus::GetPNBlackTrackEnergy ( ) const
inline

Definition at line 143 of file G4Nucleus.hh.

144 { return pnBlackTrackEnergy; }

References pnBlackTrackEnergy.

◆ GetThermalNucleus()

G4ReactionProduct G4Nucleus::GetThermalNucleus ( G4double  aMass,
G4double  temp = -1 
) const

Definition at line 236 of file G4Nucleus.cc.

237{
238 G4double currentTemp = temp;
239 if (currentTemp < 0) currentTemp = theTemp;
240 G4ReactionProduct theTarget;
241 theTarget.SetMass(targetMass*G4Neutron::Neutron()->GetPDGMass());
242 G4double px, py, pz;
243 px = GetThermalPz(theTarget.GetMass(), currentTemp);
244 py = GetThermalPz(theTarget.GetMass(), currentTemp);
245 pz = GetThermalPz(theTarget.GetMass(), currentTemp);
246 theTarget.SetMomentum(px, py, pz);
247 G4double tMom = std::sqrt(px*px+py*py+pz*pz);
248 G4double tEtot = std::sqrt((tMom+theTarget.GetMass())*
249 (tMom+theTarget.GetMass())-
250 2.*tMom*theTarget.GetMass());
251 // if(1-tEtot/theTarget.GetMass()>0.001) this line incorrect (Bug report 1911)
252 if (tEtot/theTarget.GetMass() - 1. > 0.001) {
253 // use relativistic energy for higher energies
254 theTarget.SetTotalEnergy(tEtot);
255
256 } else {
257 // use p**2/2M for lower energies (to preserve precision?)
258 theTarget.SetKineticEnergy(tMom*tMom/(2.*theTarget.GetMass()));
259 }
260 return theTarget;
261}
G4double GetThermalPz(const G4double mass, const G4double temp) const
Definition: G4Nucleus.cc:381

References G4ReactionProduct::GetMass(), GetThermalPz(), G4Neutron::Neutron(), G4ReactionProduct::SetKineticEnergy(), G4ReactionProduct::SetMass(), G4ReactionProduct::SetMomentum(), G4ReactionProduct::SetTotalEnergy(), and theTemp.

Referenced by G4ParticleHPCaptureData::GetCrossSection(), G4ParticleHPElasticData::GetCrossSection(), G4ParticleHPFissionData::GetCrossSection(), and G4ParticleHPInelasticData::GetCrossSection().

◆ GetThermalPz()

G4double G4Nucleus::GetThermalPz ( const G4double  mass,
const G4double  temp 
) const

Definition at line 381 of file G4Nucleus.cc.

382{
383 G4double result = G4RandGauss::shoot();
384 result *= std::sqrt(k_Boltzmann*temp*mass); // Das ist impuls (Pz),
385 // nichtrelativistische rechnung
386 // Maxwell verteilung angenommen
387 return result;
388}
float k_Boltzmann
Definition: hepunit.py:298

References source.hepunit::k_Boltzmann, and G4INCL::DeJongSpin::shoot().

Referenced by GetThermalNucleus().

◆ GetZ_asInt()

G4int G4Nucleus::GetZ_asInt ( ) const
inline

Definition at line 105 of file G4Nucleus.hh.

106 { return theZ; }

References theZ.

Referenced by G4INCLXXInterface::AccurateProjectile(), G4WilsonAbrasionModel::ApplyYourself(), G4EMDissociation::ApplyYourself(), G4LENDorBERTModel::ApplyYourself(), G4LENDCapture::ApplyYourself(), G4LENDCombinedModel::ApplyYourself(), G4LENDElastic::ApplyYourself(), G4LENDFission::ApplyYourself(), G4LENDGammaModel::ApplyYourself(), G4LENDInelastic::ApplyYourself(), G4LENDModel::ApplyYourself(), G4ElectroVDNuclearModel::ApplyYourself(), G4ParticleHPThermalScattering::ApplyYourself(), G4ParticleHPElastic::ApplyYourself(), G4LFission::ApplyYourself(), G4ANuElNucleusCcModel::ApplyYourself(), G4ANuElNucleusNcModel::ApplyYourself(), G4ANuMuNucleusCcModel::ApplyYourself(), G4ANuMuNucleusNcModel::ApplyYourself(), G4NuElNucleusCcModel::ApplyYourself(), G4NuElNucleusNcModel::ApplyYourself(), G4NuMuNucleusCcModel::ApplyYourself(), G4NuMuNucleusNcModel::ApplyYourself(), G4QMDReaction::ApplyYourself(), G4EmCaptureCascade::ApplyYourself(), G4MuMinusCapturePrecompound::ApplyYourself(), G4MuonMinusBoundDecay::ApplyYourself(), G4NeutronRadCapture::ApplyYourself(), G4LowEGammaNuclearModel::ApplyYourself(), G4ChargeExchange::ApplyYourself(), G4HadronElastic::ApplyYourself(), G4LEHadronProtonElastic::ApplyYourself(), G4LEnp::ApplyYourself(), G4LEpp::ApplyYourself(), G4BinaryCascade::ApplyYourself(), G4BinaryLightIonReaction::ApplyYourself(), G4INCLXXInterface::ApplyYourself(), G4LMsdGenerator::ApplyYourself(), G4PreCompoundModel::ApplyYourself(), G4LowEIonFragmentation::ApplyYourself(), G4TheoFSGenerator::ApplyYourself(), G4HadronStoppingProcess::AtRestDoIt(), G4MuonMinusAtomicCapture::AtRestDoIt(), G4ElectroVDNuclearModel::CalculateEMVertex(), G4MuonVDNuclearModel::CalculateEMVertex(), G4HadronicProcess::CheckEnergyMomentumConservation(), G4HadronicProcess::CheckResult(), G4NeutrinoNucleusModel::CoherentPion(), G4CascadeInterface::createTarget(), G4MuonicAtomDecay::DecayIt(), G4NeutrinoNucleusModel::FermiMomentum(), G4HadronicProcess::FillResult(), G4NeutrinoNucleusModel::FinalBarion(), G4QuasiElasticChannel::GetFraction(), G4FTFModel::Init(), G4DiffuseElastic::IsApplicable(), G4DiffuseElasticV2::IsApplicable(), G4hhElastic::IsApplicable(), G4NeutrinoElectronProcess::PostStepDoIt(), G4HadronicProcess::PostStepDoIt(), G4ElNeutrinoNucleusProcess::PostStepDoIt(), G4HadronElasticProcess::PostStepDoIt(), G4MuNeutrinoNucleusProcess::PostStepDoIt(), G4ANuElNucleusCcModel::SampleLVkr(), G4ANuElNucleusNcModel::SampleLVkr(), G4ANuMuNucleusCcModel::SampleLVkr(), G4ANuMuNucleusNcModel::SampleLVkr(), G4NuElNucleusCcModel::SampleLVkr(), G4NuElNucleusNcModel::SampleLVkr(), G4NuMuNucleusCcModel::SampleLVkr(), G4NuMuNucleusNcModel::SampleLVkr(), G4VPartonStringModel::Scatter(), and G4QuasiElasticChannel::Scatter().

◆ operator!=()

G4bool G4Nucleus::operator!= ( const G4Nucleus right) const
inline

Definition at line 91 of file G4Nucleus.hh.

92 { return ( this != (G4Nucleus *) &right ); }

◆ operator=()

G4Nucleus & G4Nucleus::operator= ( const G4Nucleus right)
inline

◆ operator==()

G4bool G4Nucleus::operator== ( const G4Nucleus right) const
inline

Definition at line 88 of file G4Nucleus.hh.

89 { return ( this == (G4Nucleus *) &right ); }

◆ ReturnTargetParticle()

G4DynamicParticle * G4Nucleus::ReturnTargetParticle ( ) const

Definition at line 340 of file G4Nucleus.cc.

341{
342 // choose a proton or a neutron (or a lamba if a hypernucleus) as the target particle
343 G4DynamicParticle *targetParticle = new G4DynamicParticle;
344 const G4double rnd = G4UniformRand();
345 if ( rnd < zEff/aEff ) {
346 targetParticle->SetDefinition( G4Proton::Proton() );
347 } else if ( rnd < (zEff + theL*1.0)/aEff ) {
348 targetParticle->SetDefinition( G4Lambda::Lambda() );
349 } else {
350 targetParticle->SetDefinition( G4Neutron::Neutron() );
351 }
352 return targetParticle;
353}
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
static G4Lambda * Lambda()
Definition: G4Lambda.cc:107
static G4Proton * Proton()
Definition: G4Proton.cc:92

References aEff, G4UniformRand, G4Lambda::Lambda(), G4Neutron::Neutron(), G4Proton::Proton(), G4DynamicParticle::SetDefinition(), theL, and zEff.

Referenced by G4LEHadronProtonElastic::ApplyYourself(), G4LEnp::ApplyYourself(), and G4LEpp::ApplyYourself().

◆ SetIsotope()

void G4Nucleus::SetIsotope ( const G4Isotope iso)
inline

◆ SetParameters() [1/2]

void G4Nucleus::SetParameters ( const G4double  A,
const G4double  Z,
const G4int  numberOfLambdas = 0 
)

Definition at line 307 of file G4Nucleus.cc.

308{
309 theZ = G4lrint(Z);
310 theA = G4lrint(A);
311 theL = std::max(numberOfLambdas, 0);
312 if (theA<1 || theZ<0 || theZ>theA) {
313 throw G4HadronicException(__FILE__, __LINE__,
314 "G4Nucleus::SetParameters called with non-physical parameters");
315 }
316 aEff = A; // atomic weight
317 zEff = Z; // atomic number
318 fIsotope = 0;
319}
int G4lrint(double ad)
Definition: templates.hh:134

References A, aEff, fIsotope, G4lrint(), G4INCL::Math::max(), theA, theL, theZ, Z, and zEff.

Referenced by G4FissLib::ApplyYourself(), G4ParticleHPCapture::ApplyYourself(), G4ParticleHPFission::ApplyYourself(), G4ParticleHPInelastic::ApplyYourself(), G4ParticleHPElastic::ApplyYourself(), G4MuonicAtomDecay::DecayIt(), G4Nucleus(), and G4ElementSelector::SelectZandA().

◆ SetParameters() [2/2]

void G4Nucleus::SetParameters ( const G4int  A,
const G4int  Z,
const G4int  numberOfLambdas = 0 
)

Definition at line 323 of file G4Nucleus.cc.

324{
325 theZ = Z;
326 theA = A;
327 theL = std::max(numberOfLambdas, 0);
328 if( theA<1 || theZ<0 || theZ>theA )
329 {
330 throw G4HadronicException(__FILE__, __LINE__,
331 "G4Nucleus::SetParameters called with non-physical parameters");
332 }
333 aEff = A; // atomic weight
334 zEff = Z; // atomic number
335 fIsotope = 0;
336}

References A, aEff, fIsotope, G4INCL::Math::max(), theA, theL, theZ, Z, and zEff.

Field Documentation

◆ aEff

G4double G4Nucleus::aEff
private

◆ dtaBlackTrackEnergy

G4double G4Nucleus::dtaBlackTrackEnergy
private

Definition at line 196 of file G4Nucleus.hh.

Referenced by EvaporationEffects(), G4Nucleus(), GetDTABlackTrackEnergy(), and operator=().

◆ dtaBlackTrackEnergyfromAnnihilation

G4double G4Nucleus::dtaBlackTrackEnergyfromAnnihilation
private

◆ excitationEnergy

G4double G4Nucleus::excitationEnergy
private

Definition at line 208 of file G4Nucleus.hh.

Referenced by AddExcitationEnergy(), G4Nucleus(), GetEnergyDeposit(), and operator=().

◆ fermiMomentum

G4double G4Nucleus::fermiMomentum
private

Definition at line 219 of file G4Nucleus.hh.

Referenced by G4Nucleus(), GetFermiMomentum(), and operator=().

◆ fIsotope

const G4Isotope* G4Nucleus::fIsotope
private

Definition at line 192 of file G4Nucleus.hh.

Referenced by G4Nucleus(), GetIsotope(), operator=(), SetIsotope(), and SetParameters().

◆ momentum

G4ThreeVector G4Nucleus::momentum
private

Definition at line 211 of file G4Nucleus.hh.

Referenced by AddMomentum(), G4Nucleus(), and operator=().

◆ pnBlackTrackEnergy

G4double G4Nucleus::pnBlackTrackEnergy
private

Definition at line 194 of file G4Nucleus.hh.

Referenced by EvaporationEffects(), G4Nucleus(), GetPNBlackTrackEnergy(), and operator=().

◆ pnBlackTrackEnergyfromAnnihilation

G4double G4Nucleus::pnBlackTrackEnergyfromAnnihilation
private

◆ theA

G4int G4Nucleus::theA
private

◆ theL

G4int G4Nucleus::theL
private

◆ theTemp

G4double G4Nucleus::theTemp
private

Definition at line 220 of file G4Nucleus.hh.

Referenced by G4Nucleus(), GetThermalNucleus(), and operator=().

◆ theZ

G4int G4Nucleus::theZ
private

◆ zEff

G4double G4Nucleus::zEff
private

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