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

#include <G4XnpElasticLowE.hh>

Inheritance diagram for G4XnpElasticLowE:
G4VCrossSectionSource

Public Member Functions

virtual G4double CrossSection (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
 G4XnpElasticLowE ()
 
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 G4XnpElasticLowE &right) const
 
G4bool operator== (const G4VCrossSectionSource &right) const
 
G4bool operator== (const G4XnpElasticLowE &right) const
 
virtual void Print () const
 
virtual void PrintAll (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
virtual ~G4XnpElasticLowE ()
 

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

 G4XnpElasticLowE (const G4XnpElasticLowE &right)
 
const G4XnpElasticLowEoperator= (const G4XnpElasticLowE &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 G4XnpElasticLowE.hh.

Constructor & Destructor Documentation

◆ G4XnpElasticLowE() [1/2]

G4XnpElasticLowE::G4XnpElasticLowE ( )

Definition at line 88 of file G4XnpElasticLowE.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
98 if (_eMin < _lowLimit)
99 throw G4HadronicException(__FILE__, __LINE__, "G4XnpElasticLowE::G4XnpElasticLowE - Low energy limit not valid");
100
101 if (_highLimit > _eMax)
102 throw G4HadronicException(__FILE__, __LINE__, "G4XnpElasticLowE::G4XnpElasticLowE - 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 _highLimit
static const G4double _eMinTable
static const G4double _eStepLog
static const G4int _tableSize
static const G4double _sigmaTable[101]
G4PhysicsVector * _sigma
static const G4double _lowLimit

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

◆ ~G4XnpElasticLowE()

G4XnpElasticLowE::~G4XnpElasticLowE ( )
virtual

Definition at line 114 of file G4XnpElasticLowE.cc.

115{
116 delete _sigma;
117 _sigma = 0;
118}

References _sigma.

◆ G4XnpElasticLowE() [2/2]

G4XnpElasticLowE::G4XnpElasticLowE ( const G4XnpElasticLowE right)
private

Member Function Documentation

◆ CrossSection()

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

Implements G4VCrossSectionSource.

Definition at line 133 of file G4XnpElasticLowE.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 * G4XnpElasticLowE::GetComponents ( ) const
inlinevirtual

Implements G4VCrossSectionSource.

Definition at line 65 of file G4XnpElasticLowE.hh.

65{ return 0; }

◆ HighLimit()

virtual G4double G4XnpElasticLowE::HighLimit ( ) const
inlinevirtual

Reimplemented from G4VCrossSectionSource.

Definition at line 73 of file G4XnpElasticLowE.hh.

73{ return _highLimit; }

References _highLimit.

◆ InLimits()

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

◆ IsValid()

G4bool G4XnpElasticLowE::IsValid ( G4double  e) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 184 of file G4XnpElasticLowE.cc.

185{
187
188 return answer;
189}
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 G4XnpElasticLowE::Name ( ) const
virtual

Implements G4VCrossSectionSource.

Definition at line 177 of file G4XnpElasticLowE.cc.

178{
179 G4String name("npElasticLowE");
180 return name;
181}
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 G4XnpElasticLowE::operator!= ( const G4XnpElasticLowE right) const

Definition at line 127 of file G4XnpElasticLowE.cc.

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

◆ operator=()

const G4XnpElasticLowE & G4XnpElasticLowE::operator= ( const G4XnpElasticLowE 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 G4XnpElasticLowE::operator== ( const G4XnpElasticLowE right) const

Definition at line 121 of file G4XnpElasticLowE.cc.

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

◆ Print()

void G4XnpElasticLowE::Print ( ) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 159 of file G4XnpElasticLowE.cc.

160{
161 // Dump the cross-section table
162 G4cout << Name() << "Cross-section table: " << G4endl;
163 G4bool dummy = false;
164 G4int i;
165
166 for (i=0; i<_tableSize; i++)
167 {
169 G4double sigma = _sigma->GetValue(e,dummy) / millibarn;
170 G4cout << i << ") e = " << e << " GeV ---- Cross section = " << sigma << " mb " << G4endl;
171 }
172
174}
#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 G4XnpElasticLowE::_eMax
private

Definition at line 93 of file G4XnpElasticLowE.hh.

Referenced by CrossSection(), and G4XnpElasticLowE().

◆ _eMin

G4double G4XnpElasticLowE::_eMin
private

Definition at line 92 of file G4XnpElasticLowE.hh.

Referenced by CrossSection(), and G4XnpElasticLowE().

◆ _eMinTable

const G4double G4XnpElasticLowE::_eMinTable = 1.8964808
staticprivate

Definition at line 88 of file G4XnpElasticLowE.hh.

Referenced by G4XnpElasticLowE().

◆ _eStepLog

const G4double G4XnpElasticLowE::_eStepLog = 0.01
staticprivate

Definition at line 89 of file G4XnpElasticLowE.hh.

Referenced by G4XnpElasticLowE().

◆ _highLimit

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

Definition at line 85 of file G4XnpElasticLowE.hh.

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

◆ _lowLimit

const G4double G4XnpElasticLowE::_lowLimit = 0.
staticprivate

Definition at line 84 of file G4XnpElasticLowE.hh.

Referenced by G4XnpElasticLowE(), and IsValid().

◆ _sigma

G4PhysicsVector* G4XnpElasticLowE::_sigma
private

Definition at line 91 of file G4XnpElasticLowE.hh.

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

◆ _sigmaTable

const G4double G4XnpElasticLowE::_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, 32.48, 30.76, 29.46, 28.53, 27.84, 27.20,
26.53, 25.95, 25.59, 25.46, 25.00, 24.49, 24.08, 23.86,
23.17, 22.70, 21.88, 21.48, 20.22, 19.75, 18.97, 18.39,
17.98, 17.63, 17.21, 16.72, 16.68, 16.58, 16.42, 16.22,
15.98, 15.71, 15.42, 15.14, 14.87, 14.65, 14.44, 14.26,
14.10, 13.95, 13.80, 13.64, 13.47, 13.29, 13.09, 12.89,
12.68, 12.47, 12.27, 12.06, 11.84, 11.76, 11.69, 11.60,
11.50, 11.41, 11.29, 11.17, 11.06, 10.93, 10.81, 10.68,
10.56, 10.44, 10.33, 10.21, 10.12, 10.03, 9.96, 9.89,
9.83, 9.80, 9.77, 9.75, 9.74, 9.74, 9.74, 9.76,
9.73, 9.70, 9.68, 9.65, 9.63, 9.60, 9.57, 9.55,
9.52, 9.49, 9.46, 9.43
}

Definition at line 86 of file G4XnpElasticLowE.hh.

Referenced by G4XnpElasticLowE().

◆ _tableSize

const G4int G4XnpElasticLowE::_tableSize = 101
staticprivate

Definition at line 87 of file G4XnpElasticLowE.hh.

Referenced by G4XnpElasticLowE(), and Print().


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