Geant4-11
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
G4XnpTotalLowE Class Reference

#include <G4XnpTotalLowE.hh>

Inheritance diagram for G4XnpTotalLowE:
G4VCrossSectionSource

Public Member Functions

virtual G4double CrossSection (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
 G4XnpTotalLowE ()
 
virtual const G4CrossSectionVectorGetComponents () const
 
virtual G4double HighLimit () const
 
virtual G4bool IsValid (G4double e) const
 
virtual G4double LowLimit () const
 
virtual G4String Name () const
 
G4bool operator!= (const G4VCrossSectionSource &right) const
 
G4bool operator!= (const G4XnpTotalLowE &right) const
 
G4bool operator== (const G4VCrossSectionSource &right) const
 
G4bool operator== (const G4XnpTotalLowE &right) const
 
virtual void Print () const
 
virtual void PrintAll (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
virtual ~G4XnpTotalLowE ()
 

Protected Member Functions

G4double FcrossX (G4double e, G4double e0, G4double sigma, G4double eParam, G4double power) const
 
const G4ParticleDefinitionFindKeyParticle (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
const G4ParticleDefinitionFindLightParticle (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
G4bool InLimits (G4double e, G4double eLow, G4double eHigh) const
 

Private Member Functions

 G4XnpTotalLowE (const G4XnpTotalLowE &right)
 
const G4XnpTotalLowEoperator= (const G4XnpTotalLowE &right)
 

Private Attributes

G4double _eMax
 
G4double _eMin
 
G4PhysicsVector_sigma
 

Static Private Attributes

static const G4double _eMinTable = 1.8964808
 
static const G4double _eStepLog = 0.01
 
static const G4double _highLimit = 3.*GeV
 
static const G4double _lowLimit = 0.
 
static const G4double _sigmaTable [101]
 
static const G4int _tableSize = 101
 

Detailed Description

Definition at line 51 of file G4XnpTotalLowE.hh.

Constructor & Destructor Documentation

◆ G4XnpTotalLowE() [1/2]

G4XnpTotalLowE::G4XnpTotalLowE ( )

Definition at line 88 of file G4XnpTotalLowE.cc.

89{
90 // Cross-sections are available in the range (_eMin,_eMax)
91
95
96 // Protections: validity limits must be compatible with available data
97// @@GF this ought to be _lowLimit < _eMin
98 if (_eMin < _lowLimit)
99 throw G4HadronicException(__FILE__, __LINE__, "G4XnpTotalLowE::G4XnpTotalLowE - Low energy limit not valid");
100
101 if (_highLimit > _eMax)
102 throw G4HadronicException(__FILE__, __LINE__, "G4XnpTotalLowE::G4XnpTotalLowE - High energy limit not valid");
103
105 G4int i;
106 for (i=0; i<_tableSize; i++)
107 {
108 G4double value = _sigmaTable[i] * millibarn;
109 _sigma->PutValue(i,value);
110 }
111}
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:179
G4double G4Log(G4double x)
Definition: G4Log.hh:226
static constexpr double millibarn
Definition: G4SIunits.hh:86
static constexpr double GeV
Definition: G4SIunits.hh:203
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
void PutValue(const std::size_t index, const G4double value)
static const G4double _eMinTable
static const G4double _sigmaTable[101]
static const G4double _highLimit
G4PhysicsVector * _sigma
static const G4double _eStepLog
static const G4int _tableSize
static const G4double _lowLimit

References _eMax, _eMin, _eMinTable, _eStepLog, _highLimit, _lowLimit, _sigma, _sigmaTable, _tableSize, G4Exp(), G4Log(), GeV, millibarn, and G4PhysicsVector::PutValue().

◆ ~G4XnpTotalLowE()

G4XnpTotalLowE::~G4XnpTotalLowE ( )
virtual

Definition at line 114 of file G4XnpTotalLowE.cc.

115{
116 if (_sigma) delete _sigma;
117 _sigma=0;
118}

References _sigma.

◆ G4XnpTotalLowE() [2/2]

G4XnpTotalLowE::G4XnpTotalLowE ( const G4XnpTotalLowE right)
private

Member Function Documentation

◆ CrossSection()

G4double G4XnpTotalLowE::CrossSection ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
) const
virtual

Implements G4VCrossSectionSource.

Definition at line 133 of file G4XnpTotalLowE.cc.

134{
135 G4double sigma = 0.;
136 G4double sqrtS = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag();
137 G4bool dummy = false;
138
141
142 const G4ParticleDefinition* def1 = trk1.GetDefinition();
143 const G4ParticleDefinition* def2 = trk2.GetDefinition();
144 if ( (def1 == proton && def2 == neutron) ||
145 (def1 == neutron && def2 == proton) )
146 {
147 if (sqrtS >= _eMin && sqrtS <= _eMax)
148 {
149 sigma = _sigma->GetValue(sqrtS,dummy);
150 } else if ( sqrtS < _eMin )
151 {
152 sigma = _sigma->GetValue(_eMin,dummy);
153 }
154 }
155
156 return sigma;
157}
bool G4bool
Definition: G4Types.hh:86
const G4ParticleDefinition * GetDefinition() const
const G4LorentzVector & Get4Momentum() const
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:98
G4double GetValue(const G4double energy, G4bool &isOutRange) const
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:87

References _eMax, _eMin, _sigma, G4KineticTrack::Get4Momentum(), G4KineticTrack::GetDefinition(), G4PhysicsVector::GetValue(), G4InuclParticleNames::neutron, G4Neutron::NeutronDefinition(), G4InuclParticleNames::proton, and G4Proton::ProtonDefinition().

◆ FcrossX()

G4double G4VCrossSectionSource::FcrossX ( G4double  e,
G4double  e0,
G4double  sigma,
G4double  eParam,
G4double  power 
) const
protectedinherited

Definition at line 174 of file G4VCrossSectionSource.cc.

176{
177 G4double result = 0.;
178
179 G4double denom = eParam*eParam + (e-e0)*(e-e0);
180 if (denom > 0.)
181 {
182 G4double value = (2.* eParam * sigma * (e-e0) / denom) * G4Pow::GetInstance()->powA(((e0 + eParam) / e), power);
183 result = std::max(0., value);
184 }
185 return result;
186}
static G4Pow * GetInstance()
Definition: G4Pow.cc:41
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:230
T max(const T t1, const T t2)
brief Return the largest of the two arguments

References G4Pow::GetInstance(), G4INCL::Math::max(), and G4Pow::powA().

◆ FindKeyParticle()

const G4ParticleDefinition * G4VCrossSectionSource::FindKeyParticle ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
) const
protectedinherited

Definition at line 49 of file G4VCrossSectionSource.cc.

51{
52 const G4ParticleDefinition * result;
53
54 const G4ParticleDefinition * p1 = trk1.GetDefinition();
55 const G4ParticleDefinition * p2 = trk2.GetDefinition();
56
57 if( (p1==G4Proton::Proton() && p2==G4Proton::Proton() ) ||
58 (p1==G4Neutron::Neutron() && p2==G4Neutron::Neutron()) )
59 {
60 result = G4Proton::Proton();
61 }
62 else if( (p1==G4Neutron::Neutron() && p2==G4Proton::Proton()) ||
63 (p2==G4Neutron::Neutron() && p1==G4Proton::Proton()) )
64 {
65 result = G4Neutron::Neutron();
66 }
67 else
68 {
69 throw G4HadronicException(__FILE__, __LINE__, "G4VCrossSectionSource: unklnown particles in FindKeyParticle");
70 }
71 return result;
72}
static G4Neutron * Neutron()
Definition: G4Neutron.cc:103
static G4Proton * Proton()
Definition: G4Proton.cc:92

References G4KineticTrack::GetDefinition(), G4Neutron::Neutron(), and G4Proton::Proton().

Referenced by G4XNNElasticLowE::CrossSection(), and G4XNNTotalLowE::CrossSection().

◆ FindLightParticle()

const G4ParticleDefinition * G4VCrossSectionSource::FindLightParticle ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
) const
protectedinherited

Definition at line 158 of file G4VCrossSectionSource.cc.

160{
161 G4double mass1 = trk1.GetDefinition()->GetPDGMass();
162 G4double mass2 = trk2.GetDefinition()->GetPDGMass();
163 if (mass1 < mass2)
164 {
165 return trk1.GetDefinition();
166 }
167 else
168 {
169 return trk2.GetDefinition();
170 }
171}

References G4KineticTrack::GetDefinition(), and G4ParticleDefinition::GetPDGMass().

Referenced by G4XMesonBaryonElastic::CrossSection().

◆ GetComponents()

virtual const G4CrossSectionVector * G4XnpTotalLowE::GetComponents ( ) const
inlinevirtual

Implements G4VCrossSectionSource.

Definition at line 65 of file G4XnpTotalLowE.hh.

65{return 0; }

◆ HighLimit()

virtual G4double G4XnpTotalLowE::HighLimit ( ) const
inlinevirtual

Reimplemented from G4VCrossSectionSource.

Definition at line 73 of file G4XnpTotalLowE.hh.

73{ return _highLimit; }

References _highLimit.

◆ InLimits()

G4bool G4VCrossSectionSource::InLimits ( G4double  e,
G4double  eLow,
G4double  eHigh 
) const
protectedinherited

◆ IsValid()

G4bool G4XnpTotalLowE::IsValid ( G4double  e) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 185 of file G4XnpTotalLowE.cc.

186{
188
189 return answer;
190}
G4bool InLimits(G4double e, G4double eLow, G4double eHigh) const

References _highLimit, _lowLimit, and G4VCrossSectionSource::InLimits().

◆ LowLimit()

G4double G4VCrossSectionSource::LowLimit ( ) const
virtualinherited

Reimplemented in G4XPDGElastic, and G4XPDGTotal.

Definition at line 140 of file G4VCrossSectionSource.cc.

141{
142 return 0.;
143}

Referenced by G4CrossSectionPatch::CrossSection(), G4VCrossSectionSource::IsValid(), and G4CrossSectionPatch::Transition().

◆ Name()

G4String G4XnpTotalLowE::Name ( ) const
virtual

Implements G4VCrossSectionSource.

Definition at line 178 of file G4XnpTotalLowE.cc.

179{
180 G4String name("NNTotalLowE");
181 return name;
182}
const char * name(G4int ptype)

References G4InuclParticleNames::name().

Referenced by Print().

◆ operator!=() [1/2]

G4bool G4VCrossSectionSource::operator!= ( const G4VCrossSectionSource right) const
inherited

Definition at line 80 of file G4VCrossSectionSource.cc.

81{
82 return (this != (G4VCrossSectionSource *) &right);
83}

◆ operator!=() [2/2]

G4bool G4XnpTotalLowE::operator!= ( const G4XnpTotalLowE right) const

Definition at line 127 of file G4XnpTotalLowE.cc.

128{
129 return (this != (G4XnpTotalLowE *) &right);
130}

◆ operator=()

const G4XnpTotalLowE & G4XnpTotalLowE::operator= ( const G4XnpTotalLowE right)
private

◆ operator==() [1/2]

G4bool G4VCrossSectionSource::operator== ( const G4VCrossSectionSource right) const
inherited

Definition at line 74 of file G4VCrossSectionSource.cc.

75{
76 return (this == (G4VCrossSectionSource *) &right);
77}

◆ operator==() [2/2]

G4bool G4XnpTotalLowE::operator== ( const G4XnpTotalLowE right) const

Definition at line 121 of file G4XnpTotalLowE.cc.

122{
123 return (this == (G4XnpTotalLowE *) &right);
124}

◆ Print()

void G4XnpTotalLowE::Print ( ) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 159 of file G4XnpTotalLowE.cc.

160{
161 // Dump the cross-section table
162
163 G4cout << Name() << "Cross-section table: " << G4endl;
164 G4bool dummy = false;
165 G4int i;
166
167 for (i=0; i<_tableSize; i++)
168 {
170 G4double sigma = _sigma->GetValue(e,dummy) / millibarn;
171 G4cout << i << ") e = " << e << " GeV ---- Cross section = " << sigma << " mb " << G4endl;
172 }
173
175}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
G4double GetLowEdgeEnergy(const std::size_t index) const
virtual void Print() const
virtual G4String Name() const

References _sigma, _tableSize, G4cout, G4endl, G4PhysicsVector::GetLowEdgeEnergy(), G4PhysicsVector::GetValue(), GeV, millibarn, Name(), and G4VCrossSectionSource::Print().

◆ PrintAll()

void G4VCrossSectionSource::PrintAll ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
) const
virtualinherited

Definition at line 107 of file G4VCrossSectionSource.cc.

108{
109 G4double sqrtS = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag();
110 G4double sigma = CrossSection(trk1,trk2) / millibarn;
111 G4cout << "---- " << Name() << ": "
112 << "Ecm = " << sqrtS / GeV << " GeV - "
113 << " Cross section = " << sigma << " mb "
114 << G4endl;
115
116 G4int nComponents = 0;
117 const G4CrossSectionVector* components = GetComponents();
118 if (components != 0)
119 {
120 nComponents = components->size();
121 }
122 G4int i;
123 for (i=0; i<nComponents; i++)
124 {
125 G4cout << "* Component " << i << ": ";
126 G4CrossSectionSourcePtr componentPtr = (*components)[i];
127 G4VCrossSectionSource* component = componentPtr();
128 component->PrintAll(trk1,trk2);
129 }
130}
std::vector< G4CrossSectionSourcePtr > G4CrossSectionVector
virtual const G4CrossSectionVector * GetComponents() const =0
virtual G4double CrossSection(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const =0
virtual void PrintAll(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
virtual G4String Name() const =0

References G4VCrossSectionSource::CrossSection(), G4cout, G4endl, G4KineticTrack::Get4Momentum(), G4VCrossSectionSource::GetComponents(), GeV, millibarn, G4VCrossSectionSource::Name(), and G4VCrossSectionSource::PrintAll().

Referenced by G4VCrossSectionSource::PrintAll().

Field Documentation

◆ _eMax

G4double G4XnpTotalLowE::_eMax
private

Definition at line 93 of file G4XnpTotalLowE.hh.

Referenced by CrossSection(), and G4XnpTotalLowE().

◆ _eMin

G4double G4XnpTotalLowE::_eMin
private

Definition at line 92 of file G4XnpTotalLowE.hh.

Referenced by CrossSection(), and G4XnpTotalLowE().

◆ _eMinTable

const G4double G4XnpTotalLowE::_eMinTable = 1.8964808
staticprivate

Definition at line 88 of file G4XnpTotalLowE.hh.

Referenced by G4XnpTotalLowE().

◆ _eStepLog

const G4double G4XnpTotalLowE::_eStepLog = 0.01
staticprivate

Definition at line 89 of file G4XnpTotalLowE.hh.

Referenced by G4XnpTotalLowE().

◆ _highLimit

const G4double G4XnpTotalLowE::_highLimit = 3.*GeV
staticprivate

Definition at line 85 of file G4XnpTotalLowE.hh.

Referenced by G4XnpTotalLowE(), HighLimit(), and IsValid().

◆ _lowLimit

const G4double G4XnpTotalLowE::_lowLimit = 0.
staticprivate

Definition at line 84 of file G4XnpTotalLowE.hh.

Referenced by G4XnpTotalLowE(), and IsValid().

◆ _sigma

G4PhysicsVector* G4XnpTotalLowE::_sigma
private

Definition at line 91 of file G4XnpTotalLowE.hh.

Referenced by CrossSection(), G4XnpTotalLowE(), Print(), and ~G4XnpTotalLowE().

◆ _sigmaTable

const G4double G4XnpTotalLowE::_sigmaTable
staticprivate
Initial value:
=
{
1500.0,
248.20, 93.38, 55.26, 44.50, 41.33, 38.48, 37.20, 35.98,
35.02, 34.47, 34.37, 34.67, 35.23, 35.97, 36.75, 37.37,
37.77, 38.03, 38.40, 38.83, 39.26, 39.67, 40.06, 40.45,
40.79, 41.06, 41.31, 41.52, 41.70, 41.81, 41.87, 41.98,
42.12, 42.29, 42.55, 42.82, 43.01, 43.12, 43.16, 43.14,
43.06, 42.95, 42.81, 42.67, 42.54, 42.45, 42.38, 42.33,
42.30, 42.29, 42.28, 42.26, 42.24, 42.21, 42.17, 42.14,
42.10, 42.07, 42.06, 42.05, 42.04, 42.03, 42.02, 42.00,
41.97, 41.94, 41.89, 41.84, 41.79, 41.73, 41.67, 41.61,
41.55, 41.49, 41.44, 41.38, 41.34, 41.31, 41.29, 41.28,
41.27, 41.28, 41.30, 41.33, 41.36, 41.40, 41.44, 41.49,
41.50, 41.51, 41.51, 41.51, 41.52, 41.51, 41.51, 41.50,
41.50, 41.49, 41.47, 41.46
}

Definition at line 86 of file G4XnpTotalLowE.hh.

Referenced by G4XnpTotalLowE().

◆ _tableSize

const G4int G4XnpTotalLowE::_tableSize = 101
staticprivate

Definition at line 87 of file G4XnpTotalLowE.hh.

Referenced by G4XnpTotalLowE(), and Print().


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