Geant4  10.01.p03
G4XNNElasticLowE.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 #include "globals.hh"
27 #include "G4ios.hh"
28 #include "G4SystemOfUnits.hh"
29 #include "G4XNNElasticLowE.hh"
30 #include "G4KineticTrack.hh"
31 #include "G4ParticleDefinition.hh"
32 #include "G4PhysicsVector.hh"
33 #include "G4PhysicsLnVector.hh"
34 #include "G4Proton.hh"
35 #include "G4Neutron.hh"
36 
39 
40 // Low energy limit of the cross-section table (in GeV)
41 // Units are assigned while filling the PhysicsVector
42 const G4double G4XNNElasticLowE::_eMinTable = 1.8964808;
44 
45 // Cross-sections in mb
46 // Units are assigned while filling the PhysicsVector
47 
49 
51 {
52  60.00, //was 0.
53  33.48, 26.76, 25.26, 24.55, 23.94, 23.77, 23.72, 23.98,
54  25.48, 27.52, 27.72, 27.21, 25.80, 26.00, 24.32, 23.81,
55  24.37, 24.36, 23.13, 22.43, 21.71, 21.01, 20.83, 20.74,
56  20.25, 20.10, 20.59, 20.04, 20.83, 20.84, 21.07, 20.83,
57  20.79, 21.88, 21.15, 20.92, 19.00, 18.60, 17.30, 17.00,
58  16.70, 16.50, 16.20, 15.80, 15.57, 15.20, 15.00, 14.60,
59  14.20, 14.00, 13.80, 13.60, 13.40, 13.20, 13.00, 12.85,
60  12.70, 12.60, 12.50, 12.40, 12.30, 12.20, 12.10, 12.00,
61  11.90, 11.80, 11.75, 11.70, 11.64, 11.53, 11.41, 11.31,
62  11.22, 11.13, 11.05, 10.97, 10.89, 10.82, 10.75, 10.68,
63  10.61, 10.54, 10.48, 10.41, 10.35, 10.28, 10.22, 10.16,
64  10.13, 10.10, 10.08, 10.05, 10.02, 9.99, 9.96, 9.93,
65  9.90, 9.87, 9.84, 9.80
66 };
67 
69 {
70  1500.00, // was 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  _eMax = std::exp(std::log(_eMinTable) + tableSize * _eStepLog) * GeV;
93  if (_eMin < _lowLimit)
94  throw G4HadronicException(__FILE__, __LINE__, "G4XNNElasticLowE::G4XNNElasticLowE - Low energy limit not valid");
95  if (_highLimit > _eMax)
96  throw G4HadronicException(__FILE__, __LINE__, "G4XNNElasticLowE::G4XNNElasticLowE - High energy limit not valid");
98 
99  _eMin = std::exp(std::log(_eMinTable)-_eStepLog)*GeV;
100  if (_eMin < _lowLimit)
101  throw G4HadronicException(__FILE__, __LINE__, "G4XNNElasticLowE::G4XNNElasticLowE - Low energy limit not valid");
103 
104  G4int i;
105  for (i=0; i<tableSize; i++)
106  {
107  G4double value = ppTable[i] * millibarn;
108  pp->PutValue(i,value);
109  value = npTable[i] * millibarn;
110  np->PutValue(i,value);
111  }
114 }
115 
116 
118 {
121 }
122 
123 
125 {
126  return (this == (G4XNNElasticLowE *) &right);
127 }
128 
129 
131 {
132 
133  return (this != (G4XNNElasticLowE *) &right);
134 }
135 
136 
138 {
139  G4double sigma = 0.;
140  G4double sqrtS = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag();
141  G4bool dummy = false;
142 
143  const G4ParticleDefinition * key = FindKeyParticle(trk1,trk2);
144 
145  typedef std::map <const G4ParticleDefinition *, G4PhysicsVector*, std::less<const G4ParticleDefinition *> > StringPhysMap;
146 
147  if (xMap.find(key)!= xMap.end())
148  {
149 
150  StringPhysMap::const_iterator iter;
151  for (iter = xMap.begin(); iter != xMap.end(); ++iter)
152  {
153  const G4ParticleDefinition * str = (*iter).first;
154  if (str == key)
155  {
156  G4PhysicsVector* physVector = (*iter).second;
157  // G4PhysicsVector* physVector = xMap[key];
158  if (sqrtS >= _eMin && sqrtS <= _eMax)
159  {
160  sigma = physVector->GetValue(sqrtS,dummy);
161  } else if ( sqrtS < _eMin )
162  {
163  sigma = physVector->GetValue(_eMin,dummy);
164  }
165  //G4cout << " sqrtS / sigma " << sqrtS/GeV << " / " <<
166  // sigma/millibarn << G4endl;
167  }
168  }
169  }
170  return sigma;
171 }
172 
173 
175 {
176  // Dump the pp cross-section table
177 
178  G4cout << Name() << ", pp cross-section: " << G4endl;
179 
180  G4bool dummy = false;
181  G4int i;
183  G4PhysicsVector* pp = 0;
184 
185  typedef std::map <const G4ParticleDefinition *, G4PhysicsVector*, std::less<const G4ParticleDefinition *> > StringPhysMap;
186  StringPhysMap::const_iterator iter;
187 
188  for (iter = xMap.begin(); iter != xMap.end(); ++iter)
189  {
190  const G4ParticleDefinition * str = (*iter).first;
191  if (str == key)
192  {
193  pp = (*iter).second;
194  }
195  }
196 
197  if (pp != 0)
198  {
199  for (i=0; i<tableSize; i++)
200  {
201  G4double e = pp->GetLowEdgeEnergy(i);
202  G4double sigma = pp->GetValue(e,dummy) / millibarn;
203  G4cout << i << ") e = " << e / GeV << " GeV ---- Cross section = " << sigma << " mb " << G4endl;
204  }
205  }
206 
207  // Dump the np cross-section table
208 
209  G4cout << Name() << ", np cross-section: " << G4endl;
210 
212  G4PhysicsVector* np = 0;
213  for (iter = xMap.begin(); iter != xMap.end(); ++iter)
214  {
215  const G4ParticleDefinition * str = (*iter).first;
216  if (str == key)
217  {
218  np = (*iter).second;
219  }
220  }
221 
222  // G4PhysicsVector* np = xMap[G4Neutron::NeutronDefinition()->GetParticleName()];
223 
224  if (np != 0)
225  {
226  for (i=0; i<tableSize; i++)
227  {
228  G4double e = np->GetLowEdgeEnergy(i);
229  G4double sigma = np->GetValue(e,dummy) / millibarn;
230  G4cout << i << ") e = " << e / GeV << " GeV ---- Cross section = " << sigma << " mb " << G4endl;
231  }
232  }
234 }
235 
236 
238 {
239  G4String name("NNElasticLowE");
240  return name;
241 }
242 
243 
244 
246 {
247  G4bool answer = InLimits(e,_lowLimit,_highLimit);
248 
249  return answer;
250 }
251 
252 
std::map< const G4ParticleDefinition *, G4PhysicsVector *, std::less< const G4ParticleDefinition * > > xMap
const G4ParticleDefinition * FindKeyParticle(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
G4double GetValue(G4double theEnergy, G4bool &isOutRange) const
G4bool operator==(const G4XNNElasticLowE &right) const
virtual G4double CrossSection(const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
static const G4double _highLimit
static const G4double _eMinTable
static const G4int tableSize
G4String name
Definition: TRTMaterials.hh:40
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
static const G4double npTable[101]
static const G4double _lowLimit
G4double GetLowEdgeEnergy(size_t binNumber) const
static const G4double _eStepLog
int G4int
Definition: G4Types.hh:78
virtual ~G4XNNElasticLowE()
G4GLOB_DLL std::ostream G4cout
static const G4double ppTable[101]
bool G4bool
Definition: G4Types.hh:79
void PutValue(size_t index, G4double theValue)
static const double GeV
Definition: G4SIunits.hh:196
virtual void Print() const
virtual G4bool IsValid(G4double e) const
virtual void Print() const
static const double millibarn
Definition: G4SIunits.hh:96
#define G4endl
Definition: G4ios.hh:61
virtual G4String Name() const
double G4double
Definition: G4Types.hh:76
G4bool operator!=(const G4XNNElasticLowE &right) const
const G4LorentzVector & Get4Momentum() const
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:99
G4bool InLimits(G4double e, G4double eLow, G4double eHigh) const