!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
75{
77 static std::vector <G4int> colPDG;
78 static std::vector <G4int> colN;
79 static std::vector <G4int> colZ;
80 static std::vector <G4double> colP;
81 static std::vector <G4double> colTH;
82 static std::vector <G4double> colICS;
83 static std::vector <G4double> colECS;
84
85#ifdef pdebug
86 G4cout<<
"G4QIICS::GetCS:>>> f="<<fCS<<
", Z="<<tZ<<
"("<<lastZ<<
"), N="<<tN<<
"("<<lastN
87 <<"),PDG="<<pPDG<<"("<<lastPDG<<"), p="<<pMom<<"("<<lastTH<<")"<<",Sz="
89#endif
90 if(!pPDG)
91 {
92#ifdef pdebug
93 G4cout<<
"G4QIonIonCS::GetCS: *** Found pPDG="<<pPDG<<
" =--=> CS=0"<<
G4endl;
94#endif
95 return 0.;
96 }
98 if(tN!=lastN || tZ!=lastZ || pPDG!=lastPDG)
99 {
100 in = false;
101 lastP = 0.;
102 lastPDG = pPDG;
103 lastN = tN;
104 lastZ = tZ;
105 lastI = colN.size();
106 j = 0;
107#ifdef pdebug
108 G4cout<<
"G4QIICS::GetCS:FindI="<<lastI<<
",pPDG="<<pPDG<<
",tN="<<tN<<
",tZ="<<tZ<<
G4endl;
109#endif
110 if(lastI)
for(
G4int i=0; i<lastI; i++)
111 {
112#ifdef pdebug
113 G4cout<<
"G4QII::GCS:P="<<colPDG[i]<<
",N="<<colN[i]<<
",Z="<<colZ[i]<<
",j="<<j<<
G4endl;
114#endif
115 if(colPDG[i]==pPDG && colN[i]==tN && colZ[i]==tZ)
116 {
117 lastI=i;
118 lastTH =colTH[i];
119#ifdef pdebug
120 G4cout<<
"G4QIICS::GetCS:*Found* P="<<pMom<<
",Threshold="<<lastTH<<
",j="<<j<<
G4endl;
121#endif
122 if(pMom<=lastTH)
123 {
124#ifdef pdebug
125 G4cout<<
"G4QIICS::GetCS:Found P="<<pMom<<
"<Threshold="<<lastTH<<
"->XS=0"<<
G4endl;
126#endif
127 return 0.;
128 }
129 lastP =colP [i];
130 lastICS=colICS[i];
131 lastECS=colECS[i];
133 {
134#ifdef pdebug
135 G4cout<<
"G4QIonIonCS::GetCS:P="<<pMom<<
",InXS="<<lastICS*millibarn<<
",ElXS="
136 <<lastECS*millibarn<<
G4endl;
137#endif
139 if(fCS) return lastICS*millibarn;
140 return lastECS*millibarn;
141 }
142 in = true;
143
144#ifdef pdebug
145 G4cout<<
"G4QIICS::G:UpdatDB P="<<pMom<<
",f="<<fCS<<
",lI="<<lastI<<
",j="<<j<<
G4endl;
146#endif
149#ifdef pdebug
150 G4cout<<
"G4QIonIonCS::GetCS:=>New(inDB) InCS="<<lastICS<<
",ElCS="<<lastECS<<
G4endl;
151#endif
152 if((lastICS<=0. || lastECS<=0.) && pMom>lastTH)
153 {
154#ifdef pdebug
155 G4cout<<
"G4QIonIonCS::GetCS:New,T="<<pMom<<
"(CS=0) > Threshold="<<lastTH<<
G4endl;
156#endif
157 lastTH=pMom;
158 }
159 break;
160 }
161#ifdef pdebug
162 G4cout<<
"--->G4QIonIonCrossSec::GetCrosSec: pPDG="<<pPDG<<
",j="<<j<<
",N="<<colN[i]
163 <<
",Z["<<i<<
"]="<<colZ[i]<<
",PDG="<<colPDG[i]<<
G4endl;
164#endif
165 j++;
166 }
167 if(!in)
168 {
169#ifdef pdebug
170 G4cout<<
"G4QIICS::GetCrosSec:CalcNew P="<<pMom<<
",f="<<fCS<<
",lastI="<<lastI<<
G4endl;
171#endif
172
175 if(lastICS<=0. || lastECS<=0.)
176 {
178#ifdef pdebug
179 G4cout<<
"G4QIonIonCrossSect::GetCrossSect:NewThresh="<<lastTH<<
",P="<<pMom<<
G4endl;
180#endif
181 if(pMom>lastTH)
182 {
183#ifdef pdebug
184 G4cout<<
"G4QIonIonCS::GetCS:1-st,P="<<pMom<<
">Thresh="<<lastTH<<
"->XS=0"<<
G4endl;
185#endif
186 lastTH=pMom;
187 }
188 }
189#ifdef pdebug
190 G4cout<<
"G4QIICS::GetCS: *New* ICS="<<lastICS<<
", ECS="<<lastECS<<
",N="<<lastN<<
",Z="
192#endif
193 colN.push_back(tN);
194 colZ.push_back(tZ);
195 colPDG.push_back(pPDG);
196 colP.push_back(pMom);
197 colTH.push_back(lastTH);
198 colICS.push_back(lastICS);
199 colECS.push_back(lastECS);
200#ifdef pdebug
201 G4cout<<
"G4QIICS::GetCS:*1st*, P="<<pMom<<
"(MeV), InCS="<<lastICS*millibarn
202 <<
", ElCS="<<lastECS*millibarn<<
"(mb)"<<
G4endl;
203#endif
204 if(fCS) return lastICS*millibarn;
205 return lastECS*millibarn;
206 }
207 else
208 {
209#ifdef pdebug
210 G4cout<<
"G4QIICS::GetCS: Update lastI="<<lastI<<
",j="<<j<<
G4endl;
211#endif
212 colP[lastI]=pMom;
213 colPDG[lastI]=pPDG;
214 colICS[lastI]=lastICS;
215 colECS[lastI]=lastECS;
216 }
217 }
218 else if(pMom<=lastTH)
219 {
220#ifdef pdebug
221 G4cout<<
"G4QIICS::GetCS: Current T="<<pMom<<
" < Threshold="<<lastTH<<
", CS=0"<<
G4endl;
222#endif
223 return 0.;
224 }
225 else if(std::fabs(lastP/pMom-1.)<
tolerance)
226 {
227#ifdef pdebug
228 G4cout<<
"G4QIICS::GetCS:OldCur P="<<pMom<<
"="<<pMom<<
", InCS="<<lastICS*millibarn
229 <<
", ElCS="<<lastECS*millibarn<<
"(mb)"<<
G4endl;
230#endif
231 if(fCS) return lastICS*millibarn;
232 return lastECS*millibarn;
233 }
234 else
235 {
236#ifdef pdebug
237 G4cout<<
"G4QIICS::GetCS:UpdatCur P="<<pMom<<
",f="<<fCS<<
",I="<<lastI<<
",j="<<j<<
G4endl;
238#endif
241 lastP=pMom;
242 }
243#ifdef pdebug
244 G4cout<<
"G4QIICS::GetCroSec:*End*,P="<<pMom<<
"(MeV), InCS="<<lastICS*millibarn<<
", ElCS="
245 <<lastECS*millibarn<<
"(mb)"<<
G4endl;
246#endif
247 if(fCS) return lastICS*millibarn;
248 return lastECS*millibarn;
249}
G4double CalculateCrossSection(G4bool fCS, G4int F, G4int I, G4int PDG, G4int tZ, G4int tN, G4double Momentum)
virtual G4double ThresholdEnergy(G4int Z, G4int N, G4int PDG=0)
static G4double tolerance