!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
90{
92 static std::vector <G4int> colPDG;
93 static std::vector <G4int> colN;
94 static std::vector <G4int> colZ;
95 static std::vector <G4double> colP;
96 static std::vector <G4double> colTH;
97 static std::vector <G4double> colCS;
98
100#ifdef debug
101 G4cout<<
"G4QPhCS::GetCS:>>> f="<<fCS<<
", p="<<pMom<<
", Z="<<tgZ<<
"("<<lastZ<<
") ,N="<<tgN
102 <<"("<<lastN<<"),PDG="<<pPDG<<"("<<lastPDG<<"), T="<<pEn<<"("<<lastTH<<")"<<",Sz="
104
105#endif
106 if(!pPDG)
107 {
108#ifdef debug
109 G4cout<<
"G4QPhCS::GetCS: *** Found pPDG="<<pPDG<<
" =--=> CS=0"<<
G4endl;
110
111#endif
112 return 0.;
113 }
114 if(pPDG==22 && tgZ==1 && !tgN && pMom<150.*MeV) return 0.;
116 if(tgN!=lastN || tgZ!=lastZ || pPDG!=lastPDG)
117 {
118 in = false;
119 lastP = 0.;
120 lastPDG = pPDG;
121 lastN = tgN;
122 lastZ = tgZ;
123 lastI = colN.size();
124 j = 0;
125 if(lastI)
for(
G4int i=0; i<lastI; i++)
if(colPDG[i]==pPDG)
126 {
127 if(colN[i]==tgN && colZ[i]==tgZ)
128 {
129 lastI=i;
130 lastTH =colTH[i];
131#ifdef debug
132 G4cout<<
"G4QPhCS::GetCS:*Found* P="<<pMom<<
",Threshold="<<lastTH<<
",j="<<j<<
G4endl;
133
134#endif
135 if(pEn<=lastTH)
136 {
137#ifdef debug
138 G4cout<<
"G4QPhCS::GetCS:Found T="<<pEn<<
" < Threshold="<<lastTH<<
",CS=0"<<
G4endl;
139
140#endif
141 return 0.;
142 }
143 lastP =colP [i];
144 lastCS =colCS[i];
145 if(lastP == pMom)
146 {
147#ifdef debug
148 G4cout<<
"G4QPhCS::GetCS:P="<<pMom<<
",CS="<<lastCS*millibarn<<
G4endl;
149#endif
151 return lastCS*millibarn;
152 }
153 in = true;
154
155#ifdef pdebug
156 G4cout<<
"G4QPhCS::G:UpdatDB P="<<pMom<<
",f="<<fCS<<
",lI="<<lastI<<
",j="<<j<<
G4endl;
157#endif
159#ifdef debug
160 G4cout<<
"G4QPhCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<
G4endl;
161
162#endif
163 if(lastCS<=0. && pEn>lastTH)
164 {
165#ifdef debug
166 G4cout<<
"G4QPhCS::GetCS: New T="<<pEn<<
"(CS=0) > Threshold="<<lastTH<<
G4endl;
167#endif
168 lastTH=pEn;
169 }
170 break;
171 }
172#ifdef debug
173 G4cout<<
"---G4QPhCrossSec::GetCrosSec:pPDG="<<pPDG<<
",j="<<j<<
",N="<<colN[i]
174 <<
",Z["<<i<<
"]="<<colZ[i]<<
",cPDG="<<colPDG[i]<<
G4endl;
175
176#endif
177 j++;
178 }
179 if(!in)
180 {
181#ifdef debug
182 G4cout<<
"G4QPhCS::GetCrosSec:CalcNew P="<<pMom<<
",f="<<fCS<<
",lastI="<<lastI<<
G4endl;
183#endif
184
186 if(lastCS<=0.)
187 {
189#ifdef debug
190 G4cout<<
"G4QPhCrossSection::GetCrossSect: NewThresh="<<lastTH<<
",T="<<pEn<<
G4endl;
191#endif
192 if(pEn>lastTH)
193 {
194#ifdef debug
195 G4cout<<
"G4QPhCS::GetCS: First T="<<pEn<<
"(CS=0) > Threshold="<<lastTH<<
G4endl;
196#endif
197 lastTH=pEn;
198 }
199 }
200#ifdef debug
201 G4cout<<
"G4QPhCS::GetCrosSec: New CS="<<lastCS<<
",lZ="<<lastN<<
",lN="<<lastZ<<
G4endl;
202
203#endif
204 colN.push_back(tgN);
205 colZ.push_back(tgZ);
206 colPDG.push_back(pPDG);
207 colP.push_back(pMom);
208 colTH.push_back(lastTH);
209 colCS.push_back(lastCS);
210#ifdef debug
211 G4cout<<
"G4QPhCS::GetCS:1st,P="<<pMom<<
"(MeV),CS="<<lastCS*millibarn<<
"(mb)"<<
G4endl;
212
213#endif
214 return lastCS*millibarn;
215 }
216 else
217 {
218#ifdef debug
219 G4cout<<
"G4QPrCS::GetCS: Update lastI="<<lastI<<
",j="<<j<<
G4endl;
220#endif
221 colP[lastI]=pMom;
222 colPDG[lastI]=pPDG;
223 colCS[lastI]=lastCS;
224 }
225 }
226 else if(pEn<=lastTH)
227 {
228#ifdef debug
229 G4cout<<
"G4QPhCS::GetCS: Current T="<<pEn<<
" < Threshold="<<lastTH<<
", CS=0"<<
G4endl;
230
231#endif
232 return 0.;
233 }
234 else if(lastP == pMom)
235 {
236#ifdef debug
237 G4cout<<
"G4QPhCS::GetCS:OldCur P="<<pMom<<
"="<<pMom<<
", CS="<<lastCS*millibarn<<
G4endl;
238
239#endif
240 return lastCS*millibarn;
241 }
242 else
243 {
244#ifdef debug
245 G4cout<<
"G4QPhCS::GetCS:UpdatCur P="<<pMom<<
",f="<<fCS<<
",I="<<lastI<<
",j="<<j<<
G4endl;
246#endif
248 lastP=pMom;
249 }
250#ifdef debug
251 G4cout<<
"G4QPhCS::GetCroSec:End,P="<<pMom<<
"(MeV),CS="<<lastCS*millibarn<<
"(mb)"<<
G4endl;
252
253#endif
254 return lastCS*millibarn;
255}
G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int PDG, G4int Z, G4int N, G4double Momentum)
G4double ThresholdEnergy(G4int Z, G4int N, G4int PDG=22)