Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4XNNElasticLowE Class Reference

#include <G4XNNElasticLowE.hh>

Inheritance diagram for G4XNNElasticLowE:
G4VCrossSectionSource

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
G4CrossSectionVector
GetComponents () 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
 
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 ( )

Definition at line 88 of file G4XNNElasticLowE.cc.

References python.hepunit::GeV, python.hepunit::millibarn, G4Neutron::NeutronDefinition(), G4InuclParticleNames::pp, G4Proton::ProtonDefinition(), and G4PhysicsVector::PutValue().

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  }
113  xMap[G4Proton::ProtonDefinition()] = pp;
114  xMap[G4Neutron::NeutronDefinition()] = np;
115 }
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
int G4int
Definition: G4Types.hh:78
int millibarn
Definition: hepunit.py:40
void PutValue(size_t index, G4double theValue)
const XML_Char int const XML_Char * value
double G4double
Definition: G4Types.hh:76
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:99
G4XNNElasticLowE::~G4XNNElasticLowE ( )
virtual

Definition at line 118 of file G4XNNElasticLowE.cc.

References G4Neutron::NeutronDefinition(), and G4Proton::ProtonDefinition().

119 {
120  delete xMap[G4Proton::ProtonDefinition()];
121  delete xMap[G4Neutron::NeutronDefinition()];
122 }
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:99

Member Function Documentation

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

Implements G4VCrossSectionSource.

Definition at line 138 of file G4XNNElasticLowE.cc.

References G4VCrossSectionSource::FindKeyParticle(), G4KineticTrack::Get4Momentum(), and G4PhysicsVector::GetValue().

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 }
G4double GetValue(G4double theEnergy, G4bool &isOutRange) const
bool G4bool
Definition: G4Types.hh:79
G4ParticleDefinition * FindKeyParticle(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
double G4double
Definition: G4Types.hh:76
const G4LorentzVector & Get4Momentum() const
virtual const G4CrossSectionVector* G4XNNElasticLowE::GetComponents ( ) const
inlinevirtual

Implements G4VCrossSectionSource.

Definition at line 53 of file G4XNNElasticLowE.hh.

53 { return 0; }
virtual G4double G4XNNElasticLowE::HighLimit ( ) const
inlinevirtual

Reimplemented from G4VCrossSectionSource.

Definition at line 61 of file G4XNNElasticLowE.hh.

61 { return _highLimit; }
G4bool G4XNNElasticLowE::IsValid ( G4double  e) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 246 of file G4XNNElasticLowE.cc.

References G4VCrossSectionSource::InLimits().

247 {
248  G4bool answer = InLimits(e,_lowLimit,_highLimit);
249 
250  return answer;
251 }
bool G4bool
Definition: G4Types.hh:79
G4bool InLimits(G4double e, G4double eLow, G4double eHigh) const
G4String G4XNNElasticLowE::Name ( ) const
virtual

Implements G4VCrossSectionSource.

Definition at line 238 of file G4XNNElasticLowE.cc.

Referenced by Print().

239 {
240  G4String name("NNElasticLowE");
241  return name;
242 }
const XML_Char * name
G4bool G4XNNElasticLowE::operator!= ( const G4XNNElasticLowE right) const

Definition at line 131 of file G4XNNElasticLowE.cc.

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

Definition at line 125 of file G4XNNElasticLowE.cc.

126 {
127  return (this == (G4XNNElasticLowE *) &right);
128 }
void G4XNNElasticLowE::Print ( void  ) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 175 of file G4XNNElasticLowE.cc.

References G4cout, G4endl, G4PhysicsVector::GetLowEdgeEnergy(), G4PhysicsVector::GetValue(), python.hepunit::GeV, python.hepunit::millibarn, Name(), G4Neutron::NeutronDefinition(), G4InuclParticleNames::pp, G4VCrossSectionSource::Print(), and G4Proton::ProtonDefinition().

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 }
G4double GetValue(G4double theEnergy, G4bool &isOutRange) const
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
G4double GetLowEdgeEnergy(size_t binNumber) const
int G4int
Definition: G4Types.hh:78
int millibarn
Definition: hepunit.py:40
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
virtual void Print() const
#define G4endl
Definition: G4ios.hh:61
virtual G4String Name() const
double G4double
Definition: G4Types.hh:76
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:99

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