250{
251 if (verboseLevel > 3)
252 G4cout <<
"Calling SampleSecondaries() of G4PenelopeBremsstrahlungModel" <<
G4endl;
253
256
257 if (kineticEnergy <= fIntrinsicLowEnergyLimit)
258 {
261 return ;
262 }
263
265
267
268
269 if (kineticEnergy < cutG)
270 return;
271
272 if (verboseLevel > 3)
273 G4cout <<
"Going to sample gamma energy for: " <<material->
GetName() <<
" " <<
274 "energy = " << kineticEnergy/keV <<
", cut = " << cutG/keV <<
G4endl;
275
276
279
280 if (verboseLevel > 3)
281 G4cout <<
"Sampled gamma energy: " << gammaEnergy/keV <<
" keV" <<
G4endl;
282
283
284
286 fPenelopeAngular->
SampleDirection(aDynamicParticle,gammaEnergy,0,material);
287
288 if (verboseLevel > 3)
290
291 G4double residualPrimaryEnergy = kineticEnergy-gammaEnergy;
292 if (residualPrimaryEnergy < 0)
293 {
294
295 gammaEnergy += residualPrimaryEnergy;
296 residualPrimaryEnergy = 0.0;
297 }
298
299
300 G4ThreeVector particleDirection1 = initialMomentum - gammaEnergy*gammaDirection1;
301 particleDirection1 = particleDirection1.
unit();
302
303
304 if (residualPrimaryEnergy > 0.)
305 {
308 }
309 else
310 {
312 }
313
314
316 gammaDirection1,
317 gammaEnergy);
318 fvect->push_back(theGamma);
319
320 if (verboseLevel > 1)
321 {
322 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
323 G4cout <<
"Energy balance from G4PenelopeBremsstrahlung" <<
G4endl;
324 G4cout <<
"Incoming primary energy: " << kineticEnergy/keV <<
" keV" <<
G4endl;
325 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
326 G4cout <<
"Outgoing primary energy: " << residualPrimaryEnergy/keV <<
" keV" <<
G4endl;
327 G4cout <<
"Bremsstrahlung photon " << gammaEnergy/keV <<
" keV" <<
G4endl;
328 G4cout <<
"Total final state: " << (residualPrimaryEnergy+gammaEnergy)/keV
330 G4cout <<
"-----------------------------------------------------------" <<
G4endl;
331 }
332
333 if (verboseLevel > 0)
334 {
335 G4double energyDiff = std::fabs(residualPrimaryEnergy+gammaEnergy-kineticEnergy);
336 if (energyDiff > 0.05*keV)
337 G4cout <<
"Warning from G4PenelopeBremsstrahlung: problem with energy conservation: "
338 <<
339 (residualPrimaryEnergy+gammaEnergy)/keV <<
340 " keV (final) vs. " <<
341 kineticEnergy/keV <<
" keV (initial)" <<
G4endl;
342 }
343 return;
344}
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
G4ThreeVector GetMomentum() const
const G4Material * GetMaterial() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
G4ThreeVector & SampleDirection(const G4DynamicParticle *dp, G4double out_energy, G4int Z, const G4Material *mat=0)
G4double SampleGammaEnergy(G4double energy, const G4Material *, G4double cut)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)