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

#include <G4XNNElasticLowE.hh>

+ Inheritance diagram for G4XNNElasticLowE:

Public Member Functions

 G4XNNElasticLowE ()
 
virtual ~G4XNNElasticLowE ()
 
G4bool operator== (const G4XNNElasticLowE &right) const
 
G4bool operator!= (const G4XNNElasticLowE &right) const
 
virtual G4double CrossSection (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
virtual const G4CrossSectionVectorGetComponents () const
 
virtual G4bool IsValid (G4double e) const
 
virtual G4String Name () const
 
virtual void Print () 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 39 of file G4XNNElasticLowE.hh.

Constructor & Destructor Documentation

◆ G4XNNElasticLowE()

G4XNNElasticLowE::G4XNNElasticLowE ( )

Definition at line 89 of file G4XNNElasticLowE.cc.

90{
91 // Cross-sections are available in the range (_eMin,_eMax)
92
93 _eMin = _eMinTable * GeV;
94 _eMax = G4Exp(G4Log(_eMinTable) + tableSize * _eStepLog) * GeV;
95 if (_eMin < _lowLimit)
96 throw G4HadronicException(__FILE__, __LINE__, "G4XNNElasticLowE::G4XNNElasticLowE - Low energy limit not valid");
97 if (_highLimit > _eMax)
98 throw G4HadronicException(__FILE__, __LINE__, "G4XNNElasticLowE::G4XNNElasticLowE - High energy limit not valid");
99 G4PhysicsVector* pp = new G4PhysicsLogVector(_eMin,_eMax,tableSize);
100
101 _eMin = G4Exp(G4Log(_eMinTable)-_eStepLog)*GeV;
102 if (_eMin < _lowLimit)
103 throw G4HadronicException(__FILE__, __LINE__, "G4XNNElasticLowE::G4XNNElasticLowE - Low energy limit not valid");
104 G4PhysicsVector* np = new G4PhysicsLogVector(_eMin,_eMax,tableSize);
105
106 G4int i;
107 for (i=0; i<tableSize; i++)
108 {
109 G4double value = ppTable[i] * millibarn;
110 pp->PutValue(i,value);
111 value = npTable[i] * millibarn;
112 np->PutValue(i,value);
113 }
115 xMap[G4Neutron::NeutronDefinition()] = np;
116}
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
static G4Neutron * NeutronDefinition()
Definition G4Neutron.cc:96
void PutValue(const std::size_t index, const G4double value)
static G4Proton * ProtonDefinition()
Definition G4Proton.cc:85

◆ ~G4XNNElasticLowE()

G4XNNElasticLowE::~G4XNNElasticLowE ( )
virtual

Definition at line 119 of file G4XNNElasticLowE.cc.

120{
121 delete xMap[G4Proton::ProtonDefinition()];
122 delete xMap[G4Neutron::NeutronDefinition()];
123}

Member Function Documentation

◆ CrossSection()

G4double G4XNNElasticLowE::CrossSection ( const G4KineticTrack & trk1,
const G4KineticTrack & trk2 ) const
virtual

Implements G4VCrossSectionSource.

Definition at line 139 of file G4XNNElasticLowE.cc.

140{
141 G4double sigma = 0.;
142 G4double sqrtS = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag();
143 G4bool dummy = false;
144
145 const G4ParticleDefinition * key = FindKeyParticle(trk1,trk2);
146
147 typedef std::map <const G4ParticleDefinition *, G4PhysicsVector*, std::less<const G4ParticleDefinition *> > StringPhysMap;
148
149 if (xMap.find(key)!= xMap.end())
150 {
151
152 StringPhysMap::const_iterator iter;
153 for (iter = xMap.begin(); iter != xMap.end(); ++iter)
154 {
155 const G4ParticleDefinition * str = (*iter).first;
156 if (str == key)
157 {
158 G4PhysicsVector* physVector = (*iter).second;
159 // G4PhysicsVector* physVector = xMap[key];
160 if (sqrtS >= _eMin && sqrtS <= _eMax)
161 {
162 sigma = physVector->GetValue(sqrtS,dummy);
163 } else if ( sqrtS < _eMin )
164 {
165 sigma = physVector->GetValue(_eMin,dummy);
166 }
167 //G4cout << " sqrtS / sigma " << sqrtS/GeV << " / " <<
168 // sigma/millibarn << G4endl;
169 }
170 }
171 }
172 return sigma;
173}
bool G4bool
Definition G4Types.hh:86
const G4LorentzVector & Get4Momentum() const
G4double GetValue(const G4double energy, G4bool &isOutRange) const
const G4ParticleDefinition * FindKeyParticle(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const

◆ GetComponents()

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

Implements G4VCrossSectionSource.

Definition at line 53 of file G4XNNElasticLowE.hh.

53{ return 0; }

◆ HighLimit()

virtual G4double G4XNNElasticLowE::HighLimit ( ) const
inlinevirtual

Reimplemented from G4VCrossSectionSource.

Definition at line 61 of file G4XNNElasticLowE.hh.

61{ return _highLimit; }

◆ IsValid()

G4bool G4XNNElasticLowE::IsValid ( G4double e) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 247 of file G4XNNElasticLowE.cc.

248{
249 G4bool answer = InLimits(e,_lowLimit,_highLimit);
250
251 return answer;
252}
G4bool InLimits(G4double e, G4double eLow, G4double eHigh) const

◆ Name()

G4String G4XNNElasticLowE::Name ( ) const
virtual

Implements G4VCrossSectionSource.

Definition at line 239 of file G4XNNElasticLowE.cc.

240{
241 G4String name("NNElasticLowE");
242 return name;
243}
const char * name(G4int ptype)

Referenced by Print().

◆ operator!=()

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

Definition at line 132 of file G4XNNElasticLowE.cc.

133{
134
135 return (this != (G4XNNElasticLowE *) &right);
136}

◆ operator==()

G4bool G4XNNElasticLowE::operator== ( const G4XNNElasticLowE & right) const

Definition at line 126 of file G4XNNElasticLowE.cc.

127{
128 return (this == (G4XNNElasticLowE *) &right);
129}

◆ Print()

void G4XNNElasticLowE::Print ( ) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 176 of file G4XNNElasticLowE.cc.

177{
178 // Dump the pp cross-section table
179
180 G4cout << Name() << ", pp cross-section: " << G4endl;
181
182 G4bool dummy = false;
183 G4int i;
185 G4PhysicsVector* pp = 0;
186
187 typedef std::map <const G4ParticleDefinition *, G4PhysicsVector*, std::less<const G4ParticleDefinition *> > StringPhysMap;
188 StringPhysMap::const_iterator iter;
189
190 for (iter = xMap.begin(); iter != xMap.end(); ++iter)
191 {
192 const G4ParticleDefinition * str = (*iter).first;
193 if (str == key)
194 {
195 pp = (*iter).second;
196 }
197 }
198
199 if (pp != 0)
200 {
201 for (i=0; i<tableSize; i++)
202 {
203 G4double e = pp->GetLowEdgeEnergy(i);
204 G4double sigma = pp->GetValue(e,dummy) / millibarn;
205 G4cout << i << ") e = " << e / GeV << " GeV ---- Cross section = " << sigma << " mb " << G4endl;
206 }
207 }
208
209 // Dump the np cross-section table
210
211 G4cout << Name() << ", np cross-section: " << G4endl;
212
214 G4PhysicsVector* np = 0;
215 for (iter = xMap.begin(); iter != xMap.end(); ++iter)
216 {
217 const G4ParticleDefinition * str = (*iter).first;
218 if (str == key)
219 {
220 np = (*iter).second;
221 }
222 }
223
224 // G4PhysicsVector* np = xMap[G4Neutron::NeutronDefinition()->GetParticleName()];
225
226 if (np != 0)
227 {
228 for (i=0; i<tableSize; i++)
229 {
230 G4double e = np->GetLowEdgeEnergy(i);
231 G4double sigma = np->GetValue(e,dummy) / millibarn;
232 G4cout << i << ") e = " << e / GeV << " GeV ---- Cross section = " << sigma << " mb " << G4endl;
233 }
234 }
236}
#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: