78{
80 auto Z =
static_cast<G4int>(massCode / 1000);
81 auto A =
static_cast<G4int>(massCode - 1000 * Z);
82
83 if (massCode == 0) {
85 }
89 }
93 }
96 }
99 if (Z == 2) result->SetDefinition(
G4He3::He3());
100 }
104 }
105 else {
107 "G4ParticleHPLabAngularEnergy: Unknown ion case 2");
108 }
109
110
113
114 for (i = 0; i < nEnergies; i++) {
115 it = i;
116 if (anEnergy < theEnergies[i]) break;
117 }
118
119 if (it == 0)
120
121 {
122
123
124
127 for (i = 0; i < nCosTh[it]; i++) {
128 theThVec.
SetX(i, theData[it][i].GetLabel());
129 theThVec.
SetY(i, theData[it][i].GetIntegral());
130 }
131 cosTh = theThVec.
Sample();
132
133
134
135
138 for (i = 1; i < nCosTh[it]; i++) {
139 i1 = i;
140 if (cosTh < theData[it][i].GetLabel()) break;
141 }
142
143 x = cosTh;
144 x1 = theData[it][i1 - 1].
GetLabel();
149 E = theData[it][i1 - 1].
GetX(i);
150 y1 = theData[it][i1 - 1].
GetY(i);
151 y2 = theData[it][i1].
GetY(E);
152 y = theInt.
Interpolate(theSecondManager[it].GetScheme(i1), x, x1, x2, y1, y2);
154 }
158 E = theData[it][i1].
GetX(i);
159 y1 = theData[it][i1 - 1].
GetY(E);
160 y2 = theData[it][i1].
GetY(i);
161 y = theInt.
Interpolate(theSecondManager[it].GetScheme(i1), x, x1, x2, y1, y2);
163 }
165 theStore.
Merge(&theBuff1a, &theBuff2a);
166 secEnergy = theStore.
Sample();
167 currentMeanEnergy = theStore.
GetMeanX();
168
169 }
170 else
171 {
172 G4double x, x1, x2, y1, y2, y, tmp, E;
173
175 for (i = 0; i < nCosTh[it - 1]; i++) {
176 run1.
SetX(i, theData[it - 1][i].GetLabel());
177 run1.
SetY(i, theData[it - 1][i].GetIntegral());
178 }
180 for (i = 0; i < nCosTh[it]; i++) {
181 run2.
SetX(i, theData[it][i].GetLabel());
182 run2.
SetY(i, theData[it][i].GetIntegral());
183 }
184
185 x = anEnergy;
186 x1 = theEnergies[it - 1];
187 x2 = theEnergies[it];
196 }
205 }
207 theThVec.
Merge(&thBuff1, &thBuff2);
208 cosTh = theThVec.
Sample();
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
232
233
234 for (i = 1; i < nCosTh[it - 1]; i++) {
235 i1 = i;
236 if (cosTh < theData[it - 1][i].GetLabel()) break;
237 }
238
239 x = cosTh;
240 x1 = theData[it - 1][i1 - 1].
GetLabel();
241 x2 = theData[it - 1][i1].
GetLabel();
245 E = theData[it - 1][i1 - 1].
GetX(i);
246 y1 = theData[it - 1][i1 - 1].
GetY(i);
247 y2 = theData[it - 1][i1].
GetY(E);
248 y = theInt.
Interpolate(theSecondManager[it - 1].GetScheme(i1), x, x1, x2, y1, y2);
250 }
254 E = theData[it - 1][i1].
GetX(i);
255 y1 = theData[it - 1][i1 - 1].
GetY(E);
256 y2 = theData[it - 1][i1].
GetY(i);
257 y = theInt.
Interpolate(theSecondManager[it - 1].GetScheme(i1), x, x1, x2, y1, y2);
259 }
261 theStore1.
Merge(&theBuff1a, &theBuff2a);
262
263
264
265 for (i = 1; i < nCosTh[it]; i++) {
266 i2 = i;
267 if (cosTh < theData[it][i2].GetLabel()) break;
268 }
269 x1 = theData[it][i2 - 1].
GetLabel();
274 E = theData[it][i2 - 1].
GetX(i);
275 y1 = theData[it][i2 - 1].
GetY(i);
276 y2 = theData[it][i2].
GetY(E);
277 y = theInt.
Interpolate(theSecondManager[it].GetScheme(i2), x, x1, x2, y1, y2);
279 }
282
283
285
286
287
288 E = theData[it][i2].
GetX(i);
289 y1 = theData[it][i2 - 1].
GetY(E);
290 y2 = theData[it][i2].
GetY(i);
291 y = theInt.
Interpolate(theSecondManager[it].GetScheme(i2), x, x1, x2, y1, y2);
293 }
295 theStore2.
Merge(&theBuff1b, &theBuff2b);
296
297
298 x = anEnergy;
299 x1 = theEnergies[it - 1];
300 x2 = theEnergies[it];
304 E = theStore1.
GetX(i);
305 y1 = theStore1.
GetY(i);
306 y2 = theStore2.
GetY(E);
309 }
313 E = theStore2.
GetX(i);
314 y1 = theStore1.
GetY(E);
315 y2 = theStore2.
GetY(i);
318 }
320 theOne.
Merge(&theOne1, &theOne2);
321
322 secEnergy = theOne.
Sample();
323 currentMeanEnergy = theOne.
GetMeanX();
324 }
325
326
327
328 result->SetKineticEnergy(secEnergy);
329
333 G4double mtot = result->GetTotalMomentum();
334 G4ThreeVector tempVector(mtot * sinth * std::cos(phi), mtot * sinth * std::sin(phi),
335 mtot * std::cos(theta));
336 result->SetMomentum(tempVector);
337
338 return result;
339}
static G4Deuteron * Deuteron()
static G4Electron * Electron()
G4InterpolationScheme GetScheme(G4int index) const
static G4Neutron * Neutron()
G4double Interpolate(G4InterpolationScheme aScheme, G4double x, G4double x1, G4double x2, G4double y1, G4double y2) const
void SetY(G4int i, G4double x)
void SetX(G4int i, G4double e)
void SetData(G4int i, G4double x, G4double y)
const G4InterpolationManager & GetInterpolationManager() const
void SetInterpolationManager(const G4InterpolationManager &aManager)
G4double GetY(G4double x)
G4double GetX(G4int i) const
void Merge(G4ParticleHPVector *active, G4ParticleHPVector *passive)
G4int GetVectorLength() const
static G4Positron * Positron()
static G4Proton * Proton()
static G4Triton * Triton()