Geant4 9.6.0
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 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 39 of file G4XNNElasticLowE.hh.

Constructor & Destructor Documentation

◆ G4XNNElasticLowE()

G4XNNElasticLowE::G4XNNElasticLowE ( )

Definition at line 88 of file G4XNNElasticLowE.cc.

89{
90 // Cross-sections are available in the range (_eMin,_eMax)
91
92 _eMin = _eMinTable * GeV;
93 _eMax = std::exp(std::log(_eMinTable) + tableSize * _eStepLog) * GeV;
94 if (_eMin < _lowLimit)
95 throw G4HadronicException(__FILE__, __LINE__, "G4XNNElasticLowE::G4XNNElasticLowE - Low energy limit not valid");
96 if (_highLimit > _eMax)
97 throw G4HadronicException(__FILE__, __LINE__, "G4XNNElasticLowE::G4XNNElasticLowE - High energy limit not valid");
98 G4PhysicsVector* pp = new G4PhysicsLnVector(_eMin,_eMax,tableSize);
99
100 _eMin = std::exp(std::log(_eMinTable)-_eStepLog)*GeV;
101 if (_eMin < _lowLimit)
102 throw G4HadronicException(__FILE__, __LINE__, "G4XNNElasticLowE::G4XNNElasticLowE - Low energy limit not valid");
103 G4PhysicsVector* np = new G4PhysicsLnVector(_eMin,_eMax,tableSize);
104
105 G4int i;
106 for (i=0; i<tableSize; i++)
107 {
108 G4double value = ppTable[i] * millibarn;
109 pp->PutValue(i,value);
110 value = npTable[i] * millibarn;
111 np->PutValue(i,value);
112 }
114 xMap[G4Neutron::NeutronDefinition()] = np;
115}
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:99
void PutValue(size_t index, G4double theValue)
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88

◆ ~G4XNNElasticLowE()

G4XNNElasticLowE::~G4XNNElasticLowE ( )
virtual

Definition at line 118 of file G4XNNElasticLowE.cc.

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

Member Function Documentation

◆ CrossSection()

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

Implements G4VCrossSectionSource.

Definition at line 138 of file G4XNNElasticLowE.cc.

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

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

◆ Name()

G4String G4XNNElasticLowE::Name ( ) const
virtual

Implements G4VCrossSectionSource.

Definition at line 238 of file G4XNNElasticLowE.cc.

239{
240 G4String name("NNElasticLowE");
241 return name;
242}

Referenced by Print().

◆ operator!=()

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

Definition at line 131 of file G4XNNElasticLowE.cc.

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

◆ operator==()

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

Definition at line 125 of file G4XNNElasticLowE.cc.

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

◆ Print()

void G4XNNElasticLowE::Print ( ) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 175 of file G4XNNElasticLowE.cc.

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