112{
115 static const G4int nL=105;
116
117 static const G4double Emin=THmin+(nL-1)*dE;
119 static const G4int nH=224;
120 static const G4double milE=std::log(Emin);
121
122 static const G4double malE=std::log(Emax);
123
124 static const G4double dlE=(malE-milE)/(nH-1);
125
126
127
133
134
135
136
137 static std::vector <G4int> colN;
138 static std::vector <G4int> colZ;
139 static std::vector <G4double> spA;
140 static std::vector <G4double> eTH;
141
143 const G4int targetAtomicNumber = AA;
144 const G4int targZ = ZZ;
145 const G4int targN = targetAtomicNumber-targZ;
146#ifdef debug
147 G4cout <<
"G4PhotoNuclearCrossSection::GetCS:N=" << targN <<
",Z="
148 << targZ <<
",E=" << Energy <<
G4endl;
149#endif
150 if (Energy<THmin) return 0.;
153 {
155 if(targN!=lastN || targZ!=lastZ)
156 {
157 lastN = targN;
158 lastZ = targZ;
161 if(n) {
162 for(
G4int i=0; i<
n; i++) {
163 if(colN[i]==targN && colZ[i]==targZ)
164 {
165 in=true;
166 lastGDR=GDR[i];
167 lastHEN=HEN[i];
168 lastTH =eTH[i];
169 lastSP =spA[i];
170 }
171 }
172 }
173#ifdef debug
174 G4cout<<
"G4PhotoNucCrossSect::GetCS:A="<<A<<
",n="<<
n<<
",in="<<in<<
G4endl;
175#endif
176 if(!in)
177 {
179 if(A==1.) lastSP=1.;
180 else lastSP=A*(1.-shc*lnA);
181#ifdef debug
182 G4cout <<
"G4PhotoNucCrossSect::GetCS: lnA="
183 << lnA <<
",lastSP=" << lastSP <<
G4endl;
184#endif
185 lastTH=ThresholdEnergy(targZ, targN);
186#ifdef debug
187 G4cout <<
"G4PhotoNucCrossSect::GetCS: lastTH=" << lastTH <<
G4endl;
188#endif
189#ifdef debug3
190 if(A==3)
G4cout <<
"G4PhotoNucCrossSect::GetCS: lastTH="
191 << lastTH <<
",lastSP=" << lastSP <<
G4endl;
192#endif
194
196
197 G4int er=GetFunctions(A,lastGDR,lastHEN);
198
199 if(er<1)
G4cerr <<
"***G4PhotoNucCrossSection::GetCrossSection: A="
200 << A <<
" failed" <<
G4endl;
201#ifdef debug
202 G4cout<<
"G4PhotoNucCrossSect::GetCS: GetFunctions er="<<er<<
G4endl;
203#endif
204 colN.push_back(targN);
205 colZ.push_back(targZ);
206 GDR.push_back(lastGDR);
207 HEN.push_back(lastHEN);
208 eTH.push_back(lastTH);
209 spA.push_back(lastSP);
210 }
211 }
212
213
214
215
216 if (Energy<lastTH)
217 {
218 lastE=Energy;
219 lastSig=0.;
220 return 0.;
221 }
222 else if (Energy<Emin)
223 {
224#ifdef debug
225 G4cout <<
"G4PNCS::GetCS: before GDR A=" << A
226 <<
", nL=" << nL <<
",TH=" << THmin <<
",dE=" <<dE <<
G4endl;
227#endif
228 if(A<=1.) sigma=0.;
229 else sigma=EquLinearFit(Energy,nL,THmin,dE,lastGDR);
230#ifdef debugn
231 if(sigma<0.)
G4cout <<
"G4PNCS::GetCS:A=" << A <<
",E=" << Energy
232 <<
",TH=" << THmin <<
",dE=" << dE <<
G4endl;
233#endif
234 }
235 else if (Energy<Emax)
236 {
238#ifdef debug
239 G4cout <<
"G4PNCS::GetCS: before HEN nH=" << nH <<
",iE="
240 << milE <<
",dlE=" << dlE <<
G4endl;
241#endif
242 sigma=EquLinearFit(lE,nH,milE,dlE,lastHEN);
243 }
244 else
245 {
247
248
249 sigma=lastSP*(poc*(lE-pos)+shd*std::exp(-reg*lE));
250 }
251#ifdef debug
253#endif
254#ifdef pdebug
255 if(Energy>45000.&&Energy<60000.)
G4cout<<
"PN::CS:A="<<A<<
",E="<<Energy<<
",sigma="<<sigma<<
G4endl;
256#endif
257 }
258 else return 0.;
259
260 if(sigma<0.) return 0.;
261 return sigma*millibarn;
262}
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4int GetPDGEncoding() const