!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
85{
86
88 static std::vector <G4int> colN;
89 static std::vector <G4int> colZ;
90 static std::vector <G4double> colP;
91 static std::vector <G4double> colTH;
92 static std::vector <G4double> colCS;
93
94#ifdef debug
95 G4cout<<
"G4QaBPCS::GetCS:>>>f="<<fCS<<
", p="<<pMom<<
", Z="<<tgZ<<
"("<<lastZ<<
") ,N="<<tgN
96 <<
"("<<lastN<<
"),PDG="<<PDG<<
", thresh="<<lastTH<<
",Sz="<<colN.size()<<
G4endl;
97#endif
98 if(PDG!=-3112 && PDG!=-3312 && PDG!=-3334)
99 G4cout<<
"-Warning-G4QAntiBaryonPlusCS::GetCS: Not a PositiveAntiBar,PDG="<<PDG<<
G4endl;
101 if(tgN!=lastN || tgZ!=lastZ)
102 {
103 in = false;
104 lastP = 0.;
105 lastN = tgN;
106 lastZ = tgZ;
107 lastI = colN.size();
108 j = 0;
109#ifdef debug
110 G4cout<<
"G4QABPNuclCS::GetCS: the amount of records in the AMDB lastI="<<lastI<<
G4endl;
111#endif
112 if(lastI)
for(
G4int i=0; i<lastI; i++)
113 {
114 if(colN[i]==tgN && colZ[i]==tgZ)
115 {
116 lastI=i;
117 lastTH =colTH[i];
118#ifdef debug
119 G4cout<<
"G4QaBPCS::GetCS:*Found*P="<<pMom<<
",Threshold="<<lastTH<<
",j="<<j<<
G4endl;
120#endif
121 if(pMom<=lastTH)
122 {
123#ifdef debug
124 G4cout<<
"G4QPCS::GetCS:Found,P="<<pMom<<
" < Threshold="<<lastTH<<
",CS=0"<<
G4endl;
125#endif
126 return 0.;
127 }
128 lastP =colP [i];
129 lastCS =colCS[i];
131
132 {
133#ifdef debug
134 G4cout<<
"G4QaBPNCS::GetCS:.DoNothing.P="<<pMom<<
",CS="<<lastCS*millibarn<<
G4endl;
135#endif
136
137 return lastCS*millibarn;
138 }
139 in = true;
140
141#ifdef debug
142 G4cout<<
"G4QaBPNCS::G:UpdDB,P="<<pMom<<
",f="<<fCS<<
",lI="<<lastI<<
",j="<<j<<
G4endl;
143#endif
145#ifdef debug
146 G4cout<<
"G4QaBPNuCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<
G4endl;
147#endif
148 if(lastCS<=0. && pMom>lastTH)
149 {
150#ifdef debug
151 G4cout<<
"G4QaBPNuCS::GetCS: New P="<<pMom<<
"(CS=0) > Threshold="<<lastTH<<
G4endl;
152#endif
153 lastCS=0.;
154 lastTH=pMom;
155 }
156 break;
157 }
158#ifdef debug
159 G4cout<<
"-->G4QaBarPNucCrossSec::GetCrosSec: pPDG="<<PDG<<
", j="<<j<<
", N="<<colN[i]
160 <<
",Z["<<i<<
"]="<<colZ[i]<<
G4endl;
161#endif
162 j++;
163 }
164#ifdef debug
165 G4cout<<
"-?-G4QaBPNCS::GeCS:R,Z="<<tgZ<<
",N="<<tgN<<
",in="<<in<<
",j="<<j<<
" ?"<<
G4endl;
166#endif
167 if(!in)
168 {
169#ifdef debug
170 G4cout<<
"^^^G4QaBPCS::GetCS:CalcNewP="<<pMom<<
", f="<<fCS<<
", lastI="<<lastI<<
G4endl;
171#endif
172
174
175
176
178#ifdef debug
179 G4cout<<
"G4QaBPNucCrossSec::GetCrossSect: NewThresh="<<lastTH<<
",P="<<pMom<<
G4endl;
180#endif
181 colN.push_back(tgN);
182 colZ.push_back(tgZ);
183 colP.push_back(pMom);
184 colTH.push_back(lastTH);
185 colCS.push_back(lastCS);
186#ifdef debug
187 G4cout<<
"G4QaBPNCS::GetCrosSec:lCS="<<lastCS<<
",lZ="<<lastN<<
",lN="<<lastZ<<
G4endl;
188#endif
189
190#ifdef pdebug
191 G4cout<<
"G4QaBPNCS::GCS:1st,P="<<pMom<<
"(MeV),CS="<<lastCS*millibarn<<
"(mb)"<<
G4endl;
192#endif
193 return lastCS*millibarn;
194 }
195 else
196 {
197#ifdef debug
198 G4cout<<
"G4QaBarPNucCrossSect::GetCrosSect: Update lastI="<<lastI<<
",j="<<j<<
G4endl;
199#endif
200 colP[lastI]=pMom;
201 colCS[lastI]=lastCS;
202 }
203 }
204 else if(pMom<=lastTH)
205 {
206#ifdef debug
207 G4cout<<
"G4QaBPNuCS::GetCS:CurrentP="<<pMom<<
" < Threshold="<<lastTH<<
", CS=0"<<
G4endl;
208#endif
209 return 0.;
210 }
211 else if(std::fabs(lastP-pMom)<
tolerance*pMom)
212
213 {
214#ifdef debug
215 G4cout<<
"G4QaBPCS::GetCS:OldNZ&P="<<lastP<<
"="<<pMom<<
",CS="<<lastCS*millibarn<<
G4endl;
216#endif
217 return lastCS*millibarn;
218 }
219 else
220 {
221#ifdef debug
222 G4cout<<
"-!-G4QaBPCS::GeCS:UseCurP="<<pMom<<
",f="<<fCS<<
",I="<<lastI<<
",j="<<j<<
G4endl;
223#endif
225 lastP=pMom;
226 }
227#ifdef debug
228 G4cout<<
"==>G4QaBPCS::GetCroSec:P="<<pMom<<
"(MeV),CS="<<lastCS*millibarn<<
"(mb)"<<
G4endl;
229#endif
230 return lastCS*millibarn;
231}
G4double CalculateCrossSection(G4bool CS, G4int F, G4int I, G4int PDG, G4int Z, G4int N, G4double Momentum)
virtual G4double ThresholdEnergy(G4int Z, G4int N, G4int PDG=0)
static G4double tolerance