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

#include <G4XnpTotalLowE.hh>

Inheritance diagram for G4XnpTotalLowE:

Public Member Functions

 G4XnpTotalLowE ()
virtual ~G4XnpTotalLowE ()
G4bool operator== (const G4XnpTotalLowE &right) const
G4bool operator!= (const G4XnpTotalLowE &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 G4XnpTotalLowE.hh.

Constructor & Destructor Documentation

◆ G4XnpTotalLowE()

G4XnpTotalLowE::G4XnpTotalLowE ( )

Definition at line 88 of file G4XnpTotalLowE.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// @@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
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:132
G4double G4Log(G4double x)
Definition G4Log.hh:169
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85

Referenced by operator!=(), and operator==().

◆ ~G4XnpTotalLowE()

G4XnpTotalLowE::~G4XnpTotalLowE ( )
virtual

Definition at line 114 of file G4XnpTotalLowE.cc.

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

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
139 const G4ParticleDefinition* proton = G4Proton::ProtonDefinition();
140 const G4ParticleDefinition* neutron = G4Neutron::NeutronDefinition();
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
static G4Proton * ProtonDefinition()
Definition G4Proton.cc:85

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

◆ IsValid()

G4bool G4XnpTotalLowE::IsValid ( G4double e) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 185 of file G4XnpTotalLowE.cc.

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

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

Referenced by Print().

◆ operator!=()

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

Definition at line 127 of file G4XnpTotalLowE.cc.

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

◆ operator==()

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

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