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

#include <G4XnpTotalLowE.hh>

Inheritance diagram for G4XnpTotalLowE:
G4VCrossSectionSource

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
 
G4ParticleDefinitionFindKeyParticle (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
G4double GetTransversePionMass () const
 
G4double GetMinStringMass () const
 

Detailed Description

Definition at line 51 of file G4XnpTotalLowE.hh.

Constructor & Destructor Documentation

G4XnpTotalLowE::G4XnpTotalLowE ( )

Definition at line 87 of file G4XnpTotalLowE.cc.

References python.hepunit::GeV, python.hepunit::millibarn, and G4PhysicsVector::PutValue().

88 {
89  // Cross-sections are available in the range (_eMin,_eMax)
90 
91  _eMin = _eMinTable * GeV;
92  _eMin = std::exp(std::log(_eMinTable)-_eStepLog)*GeV;
93  _eMax = std::exp(std::log(_eMinTable) + _tableSize * _eStepLog) * GeV;
94 
95  // Protections: validity limits must be compatible with available data
96 // @@GF this ought to be _lowLimit < _eMin
97  if (_eMin < _lowLimit)
98  throw G4HadronicException(__FILE__, __LINE__, "G4XnpTotalLowE::G4XnpTotalLowE - Low energy limit not valid");
99 
100  if (_highLimit > _eMax)
101  throw G4HadronicException(__FILE__, __LINE__, "G4XnpTotalLowE::G4XnpTotalLowE - High energy limit not valid");
102 
103  _sigma = new G4PhysicsLnVector(_eMin,_eMax,_tableSize);
104  G4int i;
105  for (i=0; i<_tableSize; i++)
106  {
107  G4double value = _sigmaTable[i] * millibarn;
108  _sigma->PutValue(i,value);
109  }
110 }
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
G4XnpTotalLowE::~G4XnpTotalLowE ( )
virtual

Definition at line 113 of file G4XnpTotalLowE.cc.

114 {
115  delete _sigma;
116 }

Member Function Documentation

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

Implements G4VCrossSectionSource.

Definition at line 131 of file G4XnpTotalLowE.cc.

References G4KineticTrack::Get4Momentum(), G4KineticTrack::GetDefinition(), G4PhysicsVector::GetValue(), neutron, G4Neutron::NeutronDefinition(), G4InuclParticleNames::proton, and G4Proton::ProtonDefinition().

132 {
133  G4double sigma = 0.;
134  G4double sqrtS = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag();
135  G4bool dummy = false;
136 
139 
140  G4ParticleDefinition* def1 = trk1.GetDefinition();
141  G4ParticleDefinition* def2 = trk2.GetDefinition();
142  if ( (def1 == proton && def2 == neutron) ||
143  (def1 == neutron && def2 == proton) )
144  {
145  if (sqrtS >= _eMin && sqrtS <= _eMax)
146  {
147  sigma = _sigma->GetValue(sqrtS,dummy);
148  } else if ( sqrtS < _eMin )
149  {
150  sigma = _sigma->GetValue(_eMin,dummy);
151  }
152  }
153 
154  return sigma;
155 }
G4double GetValue(G4double theEnergy, G4bool &isOutRange) const
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
G4ParticleDefinition * GetDefinition() const
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76
const G4LorentzVector & Get4Momentum() const
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:99
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 183 of file G4XnpTotalLowE.cc.

References G4VCrossSectionSource::InLimits().

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

Implements G4VCrossSectionSource.

Definition at line 176 of file G4XnpTotalLowE.cc.

Referenced by Print().

177 {
178  G4String name("NNTotalLowE");
179  return name;
180 }
const XML_Char * name
G4bool G4XnpTotalLowE::operator!= ( const G4XnpTotalLowE right) const

Definition at line 125 of file G4XnpTotalLowE.cc.

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

Definition at line 119 of file G4XnpTotalLowE.cc.

120 {
121  return (this == (G4XnpTotalLowE *) &right);
122 }
void G4XnpTotalLowE::Print ( void  ) const
virtual

Reimplemented from G4VCrossSectionSource.

Definition at line 157 of file G4XnpTotalLowE.cc.

References G4cout, G4endl, G4PhysicsVector::GetLowEdgeEnergy(), G4PhysicsVector::GetValue(), python.hepunit::GeV, python.hepunit::millibarn, Name(), and G4VCrossSectionSource::Print().

158 {
159  // Dump the cross-section table
160 
161  G4cout << Name() << "Cross-section table: " << G4endl;
162  G4bool dummy = false;
163  G4int i;
164 
165  for (i=0; i<_tableSize; i++)
166  {
167  G4double e = _sigma->GetLowEdgeEnergy(i) / GeV;
168  G4double sigma = _sigma->GetValue(e,dummy) / millibarn;
169  G4cout << i << ") e = " << e << " GeV ---- Cross section = " << sigma << " mb " << G4endl;
170  }
171 
173 }
virtual G4String Name() const
G4double GetValue(G4double theEnergy, G4bool &isOutRange) const
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
double G4double
Definition: G4Types.hh:76

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