Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4ParticleHPKallbachMannSyst.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 // neutron_hp -- source file
27 // J.P. Wellisch, Nov-1996
28 // A prototype of the low energy neutron transport model.
29 //
30 // 080801 Protect div0 error, when theCompundFraction is 1 by T. Koi
31 //
32 // P. Arce, June-2014 Conversion neutron_hp to particle_hp
33 //
35 #include "G4SystemOfUnits.hh"
36 #include "Randomize.hh"
37 #include "G4Exp.hh"
38 #include "G4Log.hh"
39 #include "G4Pow.hh"
40 #include "G4HadronicException.hh"
41 
43 {
45 
46  G4double zero = GetKallbachZero(anEnergy);
47  if(zero>1) zero=1.;
48  if(zero<-1)zero=-1.;
49  G4double max = Kallbach(zero, anEnergy);
50  double upper = Kallbach(1., anEnergy);
51  double lower = Kallbach(-1., anEnergy);
52  if(upper>max) max=upper;
53  if(lower>max) max=lower;
54  G4double value, random;
55 
56  G4int icounter=0;
57  G4int icounter_max=1024;
58  do
59  {
60  icounter++;
61  if ( icounter > icounter_max ) {
62  G4cout << "Loop-counter exceeded the threshold value at " << __LINE__ << "th line of " << __FILE__ << "." << G4endl;
63  break;
64  }
65  result = 2.*G4UniformRand()-1;
66  value = Kallbach(result, anEnergy)/max;
67  random = G4UniformRand();
68  }
69  while(random>value); // Loop checking, 11.05.2015, T. Koi
70 
71  return result;
72 }
73 
75 {
76  // Kallbach-Mann systematics without normalization.
78  G4double theX = A(anEnergy)*cosTh;
79  result = 0.5*(G4Exp( theX)*(1+theCompoundFraction)
80  +G4Exp(-theX)*(1-theCompoundFraction));
81  return result;
82 }
83 
85 {
87  if ( theCompoundFraction == 1 )
88  {
89  //G4cout << "080730b Adjust theCompoundFraction " << G4endl;
90  theCompoundFraction *= (1-1.0e-15);
91  }
92  result = 0.5 * (1./A(anEnergy)) * G4Log((1-theCompoundFraction)/(1+theCompoundFraction));
93  return result;
94 }
95 
97 {
99  G4double C1 = 0.04/MeV;
100  G4double C2 = 1.8E-6/(MeV*MeV*MeV);
101  G4double C3 = 6.7E-7/(MeV*MeV*MeV*MeV);
102 
103  G4double epsa = anEnergy*theTargetMass/(theTargetMass+theIncidentMass);
104  G4int Ac = theTargetA+1;
105  G4int Nc = Ac - theTargetZ;
106  G4int AA = theTargetA;
107  G4int ZA = theTargetZ;
108  G4double ea = epsa+SeparationEnergy(Ac, Nc, AA, ZA);
109  G4double Et1 = 130*MeV;
110  G4double R1 = std::min(ea, Et1);
111  // theProductEnergy is still in CMS!!!
112  G4double epsb = theProductEnergy*(theProductMass+theResidualMass)/theResidualMass;
113  G4int AB = theResidualA;
114  G4int ZB = theResidualZ;
115  G4double eb = epsb+SeparationEnergy(Ac, Nc, AB, ZB );
116  G4double X1 = R1*eb/ea;
117  G4double Et3 = 41*MeV;
118  G4double R3 = std::min(ea, Et3);
119  G4double X3 = R3*eb/ea;
120  G4double Ma = 1;
121  G4double mb(0);
122  G4int productA = theTargetA+1-theResidualA;
123  G4int productZ = theTargetZ-theResidualZ;
124  if(productZ==0)
125  {
126  mb = 0.5;
127  }
128  else if(productZ==1)
129  {
130  mb = 1;
131  }
132  else if(productZ==2)
133  {
134  mb = 2;
135  if(productA==3) mb=1;
136  }
137  else
138  {
139  throw G4HadronicException(__FILE__, __LINE__, "Severe error in the sampling of Kallbach-Mann Systematics");
140  }
141 
142  //result = C1*X1 + C2*G4Pow::GetInstance()->powA(X1, 3.) + C3*Ma*mb*G4Pow::GetInstance()->powA(X3, 4.);
143  result = C1*X1 + C2*G4Pow::GetInstance()->powN(X1, 3) + C3*Ma*mb*G4Pow::GetInstance()->powN(X3, 4);
144  return result;
145 }
146 
148 {
150  G4int NA = AA-ZA;
151  G4int Zc = Ac-Nc;
152  result = 15.68*(Ac-AA);
153  result += -28.07*((Nc-Zc)*(Nc-Zc)/Ac - (NA-ZA)*(NA-ZA)/AA);
154  //result += -18.56*(std::pow(G4double(Ac), 2./3.) - std::pow(G4double(AA), 2./3.));
155  result += -18.56*(G4Pow::GetInstance()->A23(G4double(Ac)) - G4Pow::GetInstance()->A23(G4double(AA)));
156  result += 33.22*((Nc-Zc)*(Nc-Zc)/G4Pow::GetInstance()->powA(G4double(Ac), 4./3.) - (NA-ZA)*(NA-ZA)/G4Pow::GetInstance()->powA(G4double(AA), 4./3.));
157  //result += -0.717*(Zc*Zc/std::pow(G4double(Ac),1./3.)-ZA*ZA/std::pow(G4double(AA),1./3.));
158  result += -0.717*(Zc*Zc/G4Pow::GetInstance()->A13(G4double(Ac))-ZA*ZA/G4Pow::GetInstance()->A13(G4double(AA)));
159  result += 1.211*(Zc*Zc/Ac-ZA*ZA/AA);
160  G4double totalBinding(0);
161  G4int productA = theTargetA+1-theResidualA;
162  G4int productZ = theTargetZ-theResidualZ;
163  if(productZ==0&&productA==1) totalBinding=0;
164  if(productZ==1&&productA==1) totalBinding=0;
165  if(productZ==1&&productA==2) totalBinding=2.22;
166  if(productZ==1&&productA==3) totalBinding=8.48;
167  if(productZ==2&&productA==3) totalBinding=7.72;
168  if(productZ==2&&productA==4) totalBinding=28.3;
169  result += -totalBinding;
170  result *= MeV;
171  return result;
172 }
G4double G4ParticleHPJENDLHEData::G4double result
const double C2
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:259
G4double powN(G4double x, G4int n) const
Definition: G4Pow.cc:128
const double C1
G4double GetKallbachZero(G4double anEnergy)
int G4int
Definition: G4Types.hh:78
#define C3
G4double SeparationEnergy(G4int Ac, G4int Nc, G4int AA, G4int ZA)
G4double A23(G4double A) const
Definition: G4Pow.hh:160
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
const XML_Char int const XML_Char * value
Definition: expat.h:331
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
G4double A13(G4double A) const
Definition: G4Pow.hh:132
T max(const T t1, const T t2)
brief Return the largest of the two arguments
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
double G4double
Definition: G4Types.hh:76
G4double Kallbach(G4double cosTh, G4double anEnergy)