Geant4  10.00.p02
G4XnpTotalLowE.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // -------------------------------------------------------------------
28 // GEANT4 Class file
29 //
30 // For information related to this code contact:
31 //
32 // File name: G4XnpTotalLowE
33 //
34 // Author:
35 //
36 // Creation date: 15 April 1999
37 //
38 // Modifications:
39 //
40 // Neutron-Proton total cross section
41 // Linear interpolation from data table
42 //
43 // -------------------------------------------------------------------
44 
45 #include "globals.hh"
46 #include "G4ios.hh"
47 #include "G4SystemOfUnits.hh"
48 #include "G4XnpTotalLowE.hh"
49 #include "G4KineticTrack.hh"
50 #include "G4ParticleDefinition.hh"
51 #include "G4PhysicsVector.hh"
52 #include "G4PhysicsLnVector.hh"
53 #include "G4ParticleDefinition.hh"
54 #include "G4Proton.hh"
55 #include "G4Neutron.hh"
56 
59 
60 // Low energy limit of the cross-section table (in GeV)
61 // Units are assigned while filling the PhysicsVector
62 const G4double G4XnpTotalLowE::_eMinTable = 1.8964808;
64 
65 // Cross-sections in mb
66 // Units are assigned while filling the PhysicsVector
69 {
70  1500.0,
71  248.20, 93.38, 55.26, 44.50, 41.33, 38.48, 37.20, 35.98,
72  35.02, 34.47, 34.37, 34.67, 35.23, 35.97, 36.75, 37.37,
73  37.77, 38.03, 38.40, 38.83, 39.26, 39.67, 40.06, 40.45,
74  40.79, 41.06, 41.31, 41.52, 41.70, 41.81, 41.87, 41.98,
75  42.12, 42.29, 42.55, 42.82, 43.01, 43.12, 43.16, 43.14,
76  43.06, 42.95, 42.81, 42.67, 42.54, 42.45, 42.38, 42.33,
77  42.30, 42.29, 42.28, 42.26, 42.24, 42.21, 42.17, 42.14,
78  42.10, 42.07, 42.06, 42.05, 42.04, 42.03, 42.02, 42.00,
79  41.97, 41.94, 41.89, 41.84, 41.79, 41.73, 41.67, 41.61,
80  41.55, 41.49, 41.44, 41.38, 41.34, 41.31, 41.29, 41.28,
81  41.27, 41.28, 41.30, 41.33, 41.36, 41.40, 41.44, 41.49,
82  41.50, 41.51, 41.51, 41.51, 41.52, 41.51, 41.51, 41.50,
83  41.50, 41.49, 41.47, 41.46
84 };
85 
86 
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 
104  G4int i;
105  for (i=0; i<_tableSize; i++)
106  {
107  G4double value = _sigmaTable[i] * millibarn;
108  _sigma->PutValue(i,value);
109  }
110 }
111 
112 
114 {
115  delete _sigma;
116 }
117 
118 
120 {
121  return (this == (G4XnpTotalLowE *) &right);
122 }
123 
124 
126 {
127  return (this != (G4XnpTotalLowE *) &right);
128 }
129 
130 
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 }
156 
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  {
168  G4double sigma = _sigma->GetValue(e,dummy) / millibarn;
169  G4cout << i << ") e = " << e << " GeV ---- Cross section = " << sigma << " mb " << G4endl;
170  }
171 
173 }
174 
175 
177 {
178  G4String name("NNTotalLowE");
179  return name;
180 }
181 
182 
184 {
185  G4bool answer = InLimits(e,_lowLimit,_highLimit);
186 
187  return answer;
188 }
189 
190 
G4PhysicsVector * _sigma
virtual G4String Name() const
static const G4double _eStepLog
G4double GetValue(G4double theEnergy, G4bool &isOutRange) const
G4String name
Definition: TRTMaterials.hh:40
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
static const G4double _highLimit
static const G4double _lowLimit
G4bool operator==(const G4XnpTotalLowE &right) const
G4double GetLowEdgeEnergy(size_t binNumber) const
int G4int
Definition: G4Types.hh:78
G4ParticleDefinition * GetDefinition() const
G4GLOB_DLL std::ostream G4cout
static const G4double _sigmaTable[101]
bool G4bool
Definition: G4Types.hh:79
void PutValue(size_t index, G4double theValue)
static const double GeV
Definition: G4SIunits.hh:196
static const G4double _eMinTable
virtual G4bool IsValid(G4double e) const
virtual void Print() const
static const G4int _tableSize
static const double millibarn
Definition: G4SIunits.hh:96
virtual ~G4XnpTotalLowE()
virtual G4double CrossSection(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
#define G4endl
Definition: G4ios.hh:61
G4bool operator!=(const G4XnpTotalLowE &right) const
double G4double
Definition: G4Types.hh:76
const G4LorentzVector & Get4Momentum() const
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:99
virtual void Print() const
G4bool InLimits(G4double e, G4double eLow, G4double eHigh) const