!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
83{
84
86 static std::vector <G4int> colN;
87 static std::vector <G4int> colZ;
88 static std::vector <G4double> colP;
89 static std::vector <G4double> colTH;
90 static std::vector <G4double> colCS;
91
92#ifdef debug
93 G4cout<<
"G4QHyCS::GetCS:>>> f="<<fCS<<
", p="<<pMom<<
", Z="<<tgZ<<
"("<<lastZ<<
") ,N="<<tgN
94 <<
"("<<lastN<<
"), PDG="<<PDG<<
", thresh="<<lastTH<<
",Sz="<<colN.size()<<
G4endl;
95#endif
96 if(PDG!=3122 && PDG!=3212 && PDG!=3112 && PDG!=3322 && PDG!=3312 && PDG!=3334)
97 G4cout<<
"-Warning-G4QHyperonCS::GetCS:Not a Zero or Negative Hyperon,PDG="<<PDG<<
G4endl;
99 if(tgN!=lastN || tgZ!=lastZ)
100 {
101 in = false;
102 lastP = 0.;
103 lastN = tgN;
104 lastZ = tgZ;
105 lastI = colN.size();
106 j = 0;
107#ifdef debug
108 G4cout<<
"G4QHyCS::GetCS: the amount of records in the AMDB lastI="<<lastI<<
G4endl;
109#endif
110 if(lastI)
for(
G4int i=0; i<lastI; i++)
111 {
112 if(colN[i]==tgN && colZ[i]==tgZ)
113 {
114 lastI=i;
115 lastTH =colTH[i];
116#ifdef debug
117 G4cout<<
"G4QHyCS::GetCS:*Found* P="<<pMom<<
",Threshold="<<lastTH<<
",j="<<j<<
G4endl;
118#endif
119 if(pMom<=lastTH)
120 {
121#ifdef debug
122 G4cout<<
"G4QPCS::GetCS:Found,P="<<pMom<<
" < Threshold="<<lastTH<<
",CS=0"<<
G4endl;
123#endif
124 return 0.;
125 }
126 lastP =colP [i];
127 lastCS =colCS[i];
129
130 {
131#ifdef debug
132 G4cout<<
"..G4QHyCS::GetCS:.DoNothing.P="<<pMom<<
",CS="<<lastCS*millibarn<<
G4endl;
133#endif
134
135 return lastCS*millibarn;
136 }
137 in = true;
138
139#ifdef debug
140 G4cout<<
"G4QHyCS::G:UpdatDB P="<<pMom<<
",f="<<fCS<<
",lI="<<lastI<<
",j="<<j<<
G4endl;
141#endif
143#ifdef debug
144 G4cout<<
"G4QHyCS::GetCrosSec: *****> New (inDB) Calculated CS="<<lastCS<<
G4endl;
145#endif
146 if(lastCS<=0. && pMom>lastTH)
147 {
148#ifdef debug
149 G4cout<<
"G4QHyCS::GetCS: New P="<<pMom<<
"(CS=0) > Threshold="<<lastTH<<
G4endl;
150#endif
151 lastCS=0.;
152 lastTH=pMom;
153 }
154 break;
155 }
156#ifdef debug
157 G4cout<<
"-->G4QHyCrossSec::GetCrosSec: pPDG="<<PDG<<
", j="<<j<<
", N="<<colN[i]
158 <<
",Z["<<i<<
"]="<<colZ[i]<<
G4endl;
159#endif
160 j++;
161 }
162#ifdef debug
163 G4cout<<
"-?-G4QHyCS::GetCS:RC Z="<<tgZ<<
",N="<<tgN<<
",in="<<in<<
",j="<<j<<
" ?"<<
G4endl;
164#endif
165 if(!in)
166 {
167#ifdef debug
168 G4cout<<
"^^^G4QHyCS::GetCS:CalcNew P="<<pMom<<
", f="<<fCS<<
", lastI="<<lastI<<
G4endl;
169#endif
170
172
173
174
176#ifdef debug
177 G4cout<<
"G4QHyCrossSection::GetCrossSect: NewThresh="<<lastTH<<
",P="<<pMom<<
G4endl;
178#endif
179 colN.push_back(tgN);
180 colZ.push_back(tgZ);
181 colP.push_back(pMom);
182 colTH.push_back(lastTH);
183 colCS.push_back(lastCS);
184#ifdef debug
185 G4cout<<
"G4QHyCS::GetCrosSec:recCS="<<lastCS<<
",lZ="<<lastN<<
",lN="<<lastZ<<
G4endl;
186#endif
187
188#ifdef pdebug
189 G4cout<<
"G4QHyCS::GetCS:1st,P="<<pMom<<
"(MeV),CS="<<lastCS*millibarn<<
"(mb)"<<
G4endl;
190#endif
191 return lastCS*millibarn;
192 }
193 else
194 {
195#ifdef debug
196 G4cout<<
"G4QHyCS::GetCS: Update lastI="<<lastI<<
",j="<<j<<
G4endl;
197#endif
198 colP[lastI]=pMom;
199 colCS[lastI]=lastCS;
200 }
201 }
202 else if(pMom<=lastTH)
203 {
204#ifdef debug
205 G4cout<<
"G4QHyCS::GetCS: Current P="<<pMom<<
" < Threshold="<<lastTH<<
", CS=0"<<
G4endl;
206#endif
207 return 0.;
208 }
209 else if(std::fabs(lastP-pMom)<
tolerance*pMom)
210
211 {
212#ifdef debug
213 G4cout<<
".G4QHyCS::GetCS:OldNZ&P="<<lastP<<
"="<<pMom<<
",CS="<<lastCS*millibarn<<
G4endl;
214#endif
215 return lastCS*millibarn;
216 }
217 else
218 {
219#ifdef debug
220 G4cout<<
"!-G4QHyCS::GetCS:UseCur P="<<pMom<<
",f="<<fCS<<
",I="<<lastI<<
",j="<<j<<
G4endl;
221#endif
223 lastP=pMom;
224 }
225#ifdef debug
226 G4cout<<
"==>G4QHyCS::GetCroSec: P="<<pMom<<
"(MeV),CS="<<lastCS*millibarn<<
"(mb)"<<
G4endl;
227#endif
228 return lastCS*millibarn;
229}
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