311{
312
313
314
315
316
317
318
319
320
321
322
323
324
325 if (verboseLevel > 3)
326 G4cout <<
"Calling SamplingSecondaries() of G4PenelopeRayleighModel" <<
G4endl;
327
329
330 if (photonEnergy0 <= fIntrinsicLowEnergyLimit)
331 {
335 return ;
336 }
337
339
341
342
343 if (!pMaxTable || !samplingTable)
344 {
345 G4Exception(
"G4PenelopeRayleighModel::SampleSecondaries()",
347 return;
348 }
349
350
351 if (!(samplingTable->count(theMat)))
352 InitializeSamplingAlgorithm(theMat);
354
355
356 if (!pMaxTable->count(theMat))
357 GetPMaxTable(theMat);
359
361
362
363 G4double qmax = 2.0*photonEnergy0/electron_mass_c2;
364
365 if (qmax < 1e-10)
366 {
368 do
369 {
370 loopAgain = false;
372 G4double G = 0.5*(1+cosTheta*cosTheta);
374 loopAgain = true;
375 }while(loopAgain);
376 }
377 else
378 {
380 G4double LastQ2inTheTable = theDataTable->
GetX(nData-1);
381 G4double q2max = std::min(qmax*qmax,LastQ2inTheTable);
382
386
387
388
389
390 do{
391 loopAgain = false;
394
395
396 if (xx > q2max)
397 loopAgain = true;
398 cosTheta = 1.0-2.0*xx/q2max;
399 G4double G = 0.5*(1+cosTheta*cosTheta);
401 loopAgain = true;
402 }while(loopAgain);
403 }
404
405 G4double sinTheta = std::sqrt(1-cosTheta*cosTheta);
406
407
409 G4double dirX = sinTheta*std::cos(phi);
410 G4double dirY = sinTheta*std::sin(phi);
412
413
415
416 photonDirection1.rotateUz(photonDirection0);
419
420 return;
421}
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
const G4Material * GetMaterial() const
void SetProposedKineticEnergy(G4double proposedKinEnergy)
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
size_t GetNumberOfStoredPoints()
G4double GetX(size_t index)
G4double SampleValue(G4double rndm)
void ProposeTrackStatus(G4TrackStatus status)
void ProposeLocalEnergyDeposit(G4double anEnergyPart)