Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4XnpTotalLowE Class Reference

#include <G4XnpTotalLowE.hh>

Inheritance diagram for G4XnpTotalLowE:
Collaboration 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
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 G4XnpTotalLowE.hh.

Constructor & Destructor Documentation

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 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:

G4XnpTotalLowE::~G4XnpTotalLowE ( )
virtual

Definition at line 114 of file G4XnpTotalLowE.cc.

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

Member Function Documentation

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 
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* G4XnpTotalLowE::GetComponents ( ) const
inlinevirtual

Implements G4VCrossSectionSource.

Definition at line 65 of file G4XnpTotalLowE.hh.

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

Reimplemented from G4VCrossSectionSource.

Definition at line 73 of file G4XnpTotalLowE.hh.

73 { return _highLimit; }
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 }
bool G4bool
Definition: G4Types.hh:79
G4bool InLimits(G4double e, G4double eLow, G4double eHigh) const

Here is the call graph for this function:

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 XML_Char * name
Definition: expat.h:151

Here is the caller graph for this function:

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

Definition at line 127 of file G4XnpTotalLowE.cc.

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

Definition at line 121 of file G4XnpTotalLowE.cc.

122 {
123  return (this == (G4XnpTotalLowE *) &right);
124 }
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 }
virtual G4String Name() const
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 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: