38{
40
42
43
44
46 G4int je2 = NENERGY - 1;
47 G4int iterationsLeft=2*NENERGY +1;
48 do {
49 G4int midBin = (je1 + je2)/2;
50 if (ek < elab[midBin])
51 je2 = midBin;
52 else
53 je1 = midBin;
54 } while ( (je2 - je1) > 1 && --iterationsLeft > 0 );
55 if ( iterationsLeft <= 0 ) {
57 "Problem with energy bin (elab) data");
58
59 }
60
61
62 G4double delab = elab[je2] - elab[je1];
63
64
65
68 G4int ke2 = NANGLE - 1;
69 G4double dsig = sig[je2][0] - sig[je1][0];
71 G4double b = sig[je1][0] - rc*elab[je1];
74
75 if (verboseLevel > 1)
G4cout <<
"sample=" << sample <<
G4endl
76 << ek << " " << ke1 << " " << ke2 << " "
77 << sigint1 <<
" " << sigint2 <<
G4endl;
78
79 iterationsLeft= 2*NANGLE +1;
80 do {
81 G4int midBin = (ke1 + ke2)/2;
82 dsig = sig[je2][midBin] - sig[je1][midBin];
83 rc = dsig/delab;
84 b = sig[je1][midBin] - rc*elab[je1];
86 if (sample < sigint) {
87 ke2 = midBin;
88 sigint2 = sigint;
89 }
90 else {
91 ke1 = midBin;
92 sigint1 = sigint;
93 }
94 if (verboseLevel > 1)
G4cout << ke1 <<
" " << ke2 <<
" "
95 << sigint1 <<
" " << sigint2 <<
G4endl;
96 } while ( (ke2 - ke1) > 1 && --iterationsLeft > 0);
97 if ( iterationsLeft <= 0 ) {
99 "Problem with angular distribution (sig) data");
100 }
101
102
103
104
105
106
107
108
109
110
111
112
113
114 dsig = sigint2 - sigint1;
115 rc = 1./dsig;
116 b = ke1 - rc*sigint1;
118 G4double theta = (0.5 + kint)*pi/180.;
119
120
121
122
123
124 if (verboseLevel > 1) {
125 G4cout <<
" energy bin " << je1 <<
" energy=" << elab[je1] <<
G4endl;
126 G4cout <<
" angle bin " << kint <<
" angle=" << theta/degree <<
G4endl;
127 }
129
130 return costh;
131}
G4double S(G4double temp)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout