Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4XnpElasticLowE.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: G4XnpElasticLowE
33 //
34 // Author:
35 //
36 // Creation date: 15 April 1999
37 //
38 // Modifications:
39 //
40 // Neutron-Proton elastic 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 "G4XnpElasticLowE.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 
57 const G4double G4XnpElasticLowE::_lowLimit = 0.;
58 const G4double G4XnpElasticLowE::_highLimit = 3.*GeV;
59 
60 // Low energy limit of the cross-section table (in GeV)
61 // Units are assigned while filling the PhysicsVector
62 const G4double G4XnpElasticLowE::_eMinTable = 1.8964808;
63 const G4double G4XnpElasticLowE::_eStepLog = 0.01;
64 
65 // Cross-sections in mb
66 // Units are assigned while filling the PhysicsVector
67 const G4int G4XnpElasticLowE::_tableSize = 101;
68 const G4double G4XnpElasticLowE::_sigmaTable[101] =
69 {
70  1500.0, //GF was 0.0
71  248.20, 93.38, 55.26, 44.50, 41.33, 38.48, 37.20, 35.98,
72  35.02, 34.47, 32.48, 30.76, 29.46, 28.53, 27.84, 27.20,
73  26.53, 25.95, 25.59, 25.46, 25.00, 24.49, 24.08, 23.86,
74  23.17, 22.70, 21.88, 21.48, 20.22, 19.75, 18.97, 18.39,
75  17.98, 17.63, 17.21, 16.72, 16.68, 16.58, 16.42, 16.22,
76  15.98, 15.71, 15.42, 15.14, 14.87, 14.65, 14.44, 14.26,
77  14.10, 13.95, 13.80, 13.64, 13.47, 13.29, 13.09, 12.89,
78  12.68, 12.47, 12.27, 12.06, 11.84, 11.76, 11.69, 11.60,
79  11.50, 11.41, 11.29, 11.17, 11.06, 10.93, 10.81, 10.68,
80  10.56, 10.44, 10.33, 10.21, 10.12, 10.03, 9.96, 9.89,
81  9.83, 9.80, 9.77, 9.75, 9.74, 9.74, 9.74, 9.76,
82  9.73, 9.70, 9.68, 9.65, 9.63, 9.60, 9.57, 9.55,
83  9.52, 9.49, 9.46, 9.43
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 
97  if (_eMin < _lowLimit)
98  throw G4HadronicException(__FILE__, __LINE__, "G4XnpElasticLowE::G4XnpElasticLowE - Low energy limit not valid");
99 
100  if (_highLimit > _eMax)
101  throw G4HadronicException(__FILE__, __LINE__, "G4XnpElasticLowE::G4XnpElasticLowE - 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 }
111 
112 
114 {
115  delete _sigma;
116 }
117 
118 
120 {
121  return (this == (G4XnpElasticLowE *) &right);
122 }
123 
124 
126 {
127  return (this != (G4XnpElasticLowE *) &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  G4cout << Name() << "Cross-section table: " << G4endl;
161  G4bool dummy = false;
162  G4int i;
163 
164  for (i=0; i<_tableSize; i++)
165  {
166  G4double e = _sigma->GetLowEdgeEnergy(i) / GeV;
167  G4double sigma = _sigma->GetValue(e,dummy) / millibarn;
168  G4cout << i << ") e = " << e << " GeV ---- Cross section = " << sigma << " mb " << G4endl;
169  }
170 
172 }
173 
174 
176 {
177  G4String name("npElasticLowE");
178  return name;
179 }
180 
181 
183 {
184  G4bool answer = InLimits(e,_lowLimit,_highLimit);
185 
186  return answer;
187 }
188 
189