Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4XnpElasticLowE Class Reference

#include <G4XnpElasticLowE.hh>

Inheritance diagram for G4XnpElasticLowE:
Collaboration 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
G4CrossSectionVector
GetComponents () 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 G4XnpElasticLowE.hh.

Constructor & Destructor Documentation

G4XnpElasticLowE::G4XnpElasticLowE ( )

Definition at line 88 of file G4XnpElasticLowE.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 
98  if (_eMin < _lowLimit)
99  throw G4HadronicException(__FILE__, __LINE__, "G4XnpElasticLowE::G4XnpElasticLowE - Low energy limit not valid");
100 
101  if (_highLimit > _eMax)
102  throw G4HadronicException(__FILE__, __LINE__, "G4XnpElasticLowE::G4XnpElasticLowE - High energy limit not valid");
103 
104  _sigma = new G4PhysicsLnVector(_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 }
int G4int
Definition: G4Types.hh:78
const XML_Char int const XML_Char * value
Definition: expat.h:331
void PutValue(size_t index, G4double theValue)
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
static constexpr double GeV
Definition: G4SIunits.hh:217
double G4double
Definition: G4Types.hh:76
G4PhysicsLogVector G4PhysicsLnVector
static constexpr double millibarn
Definition: G4SIunits.hh:106

Here is the call graph for this function:

G4XnpElasticLowE::~G4XnpElasticLowE ( )
virtual

Definition at line 114 of file G4XnpElasticLowE.cc.

115 {
116  delete _sigma;
117  _sigma = 0;
118 }

Member Function Documentation

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

Implements G4VCrossSectionSource.

Definition at line 133 of file G4XnpElasticLowE.cc.

134 {
135  G4double sigma = 0.;
136  G4double sqrtS = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag();
137  G4bool dummy = false;
138 
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 }
G4double GetValue(G4double theEnergy, G4bool &isOutRange) const
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
const G4LorentzVector & Get4Momentum() const
const G4ParticleDefinition * GetDefinition() const
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:99

Here is the call graph for this function:

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

Implements G4VCrossSectionSource.

Definition at line 65 of file G4XnpElasticLowE.hh.

65 { return 0; }
virtual G4double G4XnpElasticLowE::HighLimit ( ) const
inlinevirtual

Reimplemented from G4VCrossSectionSource.

Definition at line 73 of file G4XnpElasticLowE.hh.

73 { return _highLimit; }
G4bool G4XnpElasticLowE::IsValid ( G4double  e) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 184 of file G4XnpElasticLowE.cc.

185 {
186  G4bool answer = InLimits(e,_lowLimit,_highLimit);
187 
188  return answer;
189 }
bool G4bool
Definition: G4Types.hh:79
G4bool InLimits(G4double e, G4double eLow, G4double eHigh) const

Here is the call graph for this function:

G4String G4XnpElasticLowE::Name ( ) const
virtual

Implements G4VCrossSectionSource.

Definition at line 177 of file G4XnpElasticLowE.cc.

178 {
179  G4String name("npElasticLowE");
180  return name;
181 }
const XML_Char * name
Definition: expat.h:151

Here is the caller graph for this function:

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

Definition at line 127 of file G4XnpElasticLowE.cc.

128 {
129  return (this != (G4XnpElasticLowE *) &right);
130 }
G4bool G4XnpElasticLowE::operator== ( const G4XnpElasticLowE right) const

Definition at line 121 of file G4XnpElasticLowE.cc.

122 {
123  return (this == (G4XnpElasticLowE *) &right);
124 }
void G4XnpElasticLowE::Print ( void  ) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 159 of file G4XnpElasticLowE.cc.

160 {
161  // Dump the cross-section table
162  G4cout << Name() << "Cross-section table: " << G4endl;
163  G4bool dummy = false;
164  G4int i;
165 
166  for (i=0; i<_tableSize; i++)
167  {
168  G4double e = _sigma->GetLowEdgeEnergy(i) / GeV;
169  G4double sigma = _sigma->GetValue(e,dummy) / millibarn;
170  G4cout << i << ") e = " << e << " GeV ---- Cross section = " << sigma << " mb " << G4endl;
171  }
172 
174 }
G4double GetValue(G4double theEnergy, G4bool &isOutRange) const
G4double GetLowEdgeEnergy(size_t binNumber) const
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
virtual G4String Name() const
virtual void Print() const
static constexpr double GeV
Definition: G4SIunits.hh:217
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
static constexpr double millibarn
Definition: G4SIunits.hh:106

Here is the call graph for this function:


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