Geant4 9.6.0
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 G4double CrossSection (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const =0
 
virtual const G4CrossSectionVectorGetComponents () const =0
 
virtual G4String Name () const =0
 
virtual void Print () const
 
virtual void PrintAll (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
virtual G4bool IsValid (G4double e) const
 
virtual G4double HighLimit () 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
 
G4ParticleDefinitionFindKeyParticle (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
G4double GetTransversePionMass () const
 
G4double GetMinStringMass () const
 

Detailed Description

Definition at line 51 of file G4XnpElasticLowE.hh.

Constructor & Destructor Documentation

◆ G4XnpElasticLowE()

G4XnpElasticLowE::G4XnpElasticLowE ( )

Definition at line 87 of file G4XnpElasticLowE.cc.

88{
89 // Cross-sections are available in the range (_eMin,_eMax)
90
91 _eMin = _eMinTable * GeV;
92 _eMin = std::exp(std::log(_eMinTable)-_eStepLog)*GeV;
93 _eMax = std::exp(std::log(_eMinTable) + _tableSize * _eStepLog) * GeV;
94
95 // Protections: validity limits must be compatible with available data
96
97 if (_eMin < _lowLimit)
98 throw G4HadronicException(__FILE__, __LINE__, "G4XnpElasticLowE::G4XnpElasticLowE - Low energy limit not valid");
99
100 if (_highLimit > _eMax)
101 throw G4HadronicException(__FILE__, __LINE__, "G4XnpElasticLowE::G4XnpElasticLowE - High energy limit not valid");
102
103 _sigma = new G4PhysicsLnVector(_eMin,_eMax,_tableSize);
104 G4int i;
105 for (i=0; i<_tableSize; i++)
106 {
107 G4double value = _sigmaTable[i] * millibarn;
108 _sigma->PutValue(i,value);
109 }
110}
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
void PutValue(size_t index, G4double theValue)

◆ ~G4XnpElasticLowE()

G4XnpElasticLowE::~G4XnpElasticLowE ( )
virtual

Definition at line 113 of file G4XnpElasticLowE.cc.

114{
115 delete _sigma;
116}

Member Function Documentation

◆ CrossSection()

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

Implements G4VCrossSectionSource.

Definition at line 131 of file G4XnpElasticLowE.cc.

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

◆ 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 182 of file G4XnpElasticLowE.cc.

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

◆ Name()

G4String G4XnpElasticLowE::Name ( ) const
virtual

Implements G4VCrossSectionSource.

Definition at line 175 of file G4XnpElasticLowE.cc.

176{
177 G4String name("npElasticLowE");
178 return name;
179}

Referenced by Print().

◆ operator!=()

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

Definition at line 125 of file G4XnpElasticLowE.cc.

126{
127 return (this != (G4XnpElasticLowE *) &right);
128}

◆ operator==()

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

Definition at line 119 of file G4XnpElasticLowE.cc.

120{
121 return (this == (G4XnpElasticLowE *) &right);
122}

◆ Print()

void G4XnpElasticLowE::Print ( ) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 157 of file G4XnpElasticLowE.cc.

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

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