Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4XnpElasticLowE Class Reference

#include <G4XnpElasticLowE.hh>

+ Inheritance diagram for G4XnpElasticLowE:

Public Member Functions

 G4XnpElasticLowE ()
 
virtual ~G4XnpElasticLowE ()
 
G4bool operator== (const G4XnpElasticLowE &right) const
 
G4bool operator!= (const G4XnpElasticLowE &right) const
 
virtual G4double CrossSection (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
virtual const G4CrossSectionVectorGetComponents () const
 
virtual G4bool IsValid (G4double e) const
 
virtual void Print () const
 
virtual G4String Name () const
 
virtual G4double HighLimit () const
 
- Public Member Functions inherited from G4VCrossSectionSource
 G4VCrossSectionSource ()
 
virtual ~G4VCrossSectionSource ()
 
G4bool operator== (const G4VCrossSectionSource &right) const
 
G4bool operator!= (const G4VCrossSectionSource &right) const
 
virtual void PrintAll (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
virtual G4double LowLimit () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4VCrossSectionSource
G4bool InLimits (G4double e, G4double eLow, G4double eHigh) const
 
const G4ParticleDefinitionFindLightParticle (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
G4double FcrossX (G4double e, G4double e0, G4double sigma, G4double eParam, G4double power) const
 
const G4ParticleDefinitionFindKeyParticle (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 

Detailed Description

Definition at line 51 of file G4XnpElasticLowE.hh.

Constructor & Destructor Documentation

◆ G4XnpElasticLowE()

G4XnpElasticLowE::G4XnpElasticLowE ( )

Definition at line 88 of file G4XnpElasticLowE.cc.

89{
90 // Cross-sections are available in the range (_eMin,_eMax)
91
92 _eMin = _eMinTable * GeV;
93 _eMin = G4Exp(G4Log(_eMinTable)-_eStepLog)*GeV;
94 _eMax = G4Exp(G4Log(_eMinTable) + _tableSize * _eStepLog) * GeV;
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
104 _sigma = new G4PhysicsLogVector(_eMin,_eMax,_tableSize);
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:180
G4double G4Log(G4double x)
Definition G4Log.hh:227
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
void PutValue(const std::size_t index, const G4double value)

◆ ~G4XnpElasticLowE()

G4XnpElasticLowE::~G4XnpElasticLowE ( )
virtual

Definition at line 114 of file G4XnpElasticLowE.cc.

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

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:96
G4double GetValue(const G4double energy, G4bool &isOutRange) const
static G4Proton * ProtonDefinition()
Definition G4Proton.cc:85

◆ 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; }

◆ IsValid()

G4bool G4XnpElasticLowE::IsValid ( G4double e) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 184 of file G4XnpElasticLowE.cc.

185{
186 G4bool answer = InLimits(e,_lowLimit,_highLimit);
187
188 return answer;
189}
G4bool InLimits(G4double e, G4double eLow, G4double eHigh) const

◆ 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)

Referenced by Print().

◆ operator!=()

G4bool G4XnpElasticLowE::operator!= ( const G4XnpElasticLowE & right) const

Definition at line 127 of file G4XnpElasticLowE.cc.

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

◆ operator==()

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 {
168 G4double e = _sigma->GetLowEdgeEnergy(i) / GeV;
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:67
G4GLOB_DLL std::ostream G4cout
G4double GetLowEdgeEnergy(const std::size_t index) const
virtual void Print() const
virtual G4String Name() const

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