Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4ParticleHPKallbachMannSyst.cc
이 파일의 문서화 페이지로 가기
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  G4double upper = Kallbach(1., anEnergy);
51  G4double 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  //delta 2.0e-16 in not good.
88  //delta 4.0e-16 is OK
89  //safety factor of 2
90  G4double delta = 8.0e-16;
91  if ( std::abs (theCompoundFraction - 1 ) < delta ) {
92  theCompoundFraction = 1.0-delta;
93  }
94  result = 0.5 * (1./A(anEnergy)) * G4Log((1-theCompoundFraction)/(1+theCompoundFraction));
95  return result;
96 }
97 
99 {
101  G4double C1 = 0.04/MeV;
102  G4double C2 = 1.8E-6/(MeV*MeV*MeV);
103  G4double C3 = 6.7E-7/(MeV*MeV*MeV*MeV);
104 
106  G4int Ac = theTargetA+1;
107  G4int Nc = Ac - theTargetZ;
108  G4int AA = theTargetA;
109  G4int ZA = theTargetZ;
110  G4double ea = epsa+SeparationEnergy(Ac, Nc, AA, ZA);
111  G4double Et1 = 130*MeV;
112  G4double R1 = std::min(ea, Et1);
113  // theProductEnergy is still in CMS!!!
115  G4int AB = theResidualA;
116  G4int ZB = theResidualZ;
117  G4double eb = epsb+SeparationEnergy(Ac, Nc, AB, ZB );
118  G4double X1 = R1*eb/ea;
119  G4double Et3 = 41*MeV;
120  G4double R3 = std::min(ea, Et3);
121  G4double X3 = R3*eb/ea;
122  G4double Ma = 1;
123  G4double mb(0);
124  G4int productA = theTargetA+1-theResidualA;
125  G4int productZ = theTargetZ-theResidualZ;
126  if(productZ==0)
127  {
128  mb = 0.5;
129  }
130  else if(productZ==1)
131  {
132  mb = 1;
133  }
134  else if(productZ==2)
135  {
136  mb = 2;
137  if(productA==3) mb=1;
138  }
139  else
140  {
141  throw G4HadronicException(__FILE__, __LINE__, "Severe error in the sampling of Kallbach-Mann Systematics");
142  }
143 
144  result = C1*X1 + C2*G4Pow::GetInstance()->powN(X1, 3) + C3*Ma*mb*G4Pow::GetInstance()->powN(X3, 4);
145  return result;
146 }
147 
149 {
151  G4int NA = AA-ZA;
152  G4int Zc = Ac-Nc;
153  result = 15.68*(Ac-AA);
154  result += -28.07*((Nc-Zc)*(Nc-Zc)/Ac - (NA-ZA)*(NA-ZA)/AA);
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/G4Pow::GetInstance()->A13(G4double(Ac))-ZA*ZA/G4Pow::GetInstance()->A13(G4double(AA)));
158  result += 1.211*(Zc*Zc/Ac-ZA*ZA/AA);
159  G4double totalBinding(0);
160  G4int productA = theTargetA+1-theResidualA;
161  G4int productZ = theTargetZ-theResidualZ;
162  if(productZ==0&&productA==1) totalBinding=0;
163  if(productZ==1&&productA==1) totalBinding=0;
164  if(productZ==1&&productA==2) totalBinding=2.22;
165  if(productZ==1&&productA==3) totalBinding=8.48;
166  if(productZ==2&&productA==3) totalBinding=7.72;
167  if(productZ==2&&productA==4) totalBinding=28.3;
168  result += -totalBinding;
169  result *= MeV;
170  return result;
171 }
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4double A13(G4double A) const
Definition: G4Pow.cc:138
static constexpr double MeV
Definition: G4SIunits.hh:214
G4double SeparationEnergy(G4int Ac, G4int Nc, G4int AA, G4int ZA)
const double C1
#define G4endl
Definition: G4ios.hh:61
G4double A23(G4double A) const
Definition: G4Pow.hh:143
#define C3
G4double G4Log(G4double x)
Definition: G4Log.hh:230
G4double powN(G4double x, G4int n) const
Definition: G4Pow.cc:177
double G4double
Definition: G4Types.hh:76
static G4Pow * GetInstance()
Definition: G4Pow.cc:57
G4double Kallbach(G4double cosTh, G4double anEnergy)
const XML_Char int const XML_Char * value
Definition: expat.h:331
G4double powA(G4double A, G4double y) const
Definition: G4Pow.hh:242
Double_t X1
#define G4UniformRand()
Definition: Randomize.hh:53
G4double GetKallbachZero(G4double anEnergy)
G4double G4ParticleHPJENDLHEData::G4double result
int G4int
Definition: G4Types.hh:78
Double_t Zc
G4GLOB_DLL std::ostream G4cout
T min(const T t1, const T t2)
brief Return the smallest of the two arguments
const double C2