Import Geant4 10.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 14:11:04 +02:00
parent c9b32a6c0a
commit d4af681f38
4886 changed files with 420149 additions and 1023309 deletions
@@ -1,4 +1,4 @@
$Id: History 87013 2014-11-21 16:22:53Z gcosmo $
$Id: History 92046 2015-08-14 07:22:07Z gcosmo $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,13 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
13 Aug 14: V.Ivanchenko, P. Gumplinger (xrays-V10-01-01/02)
- G4Cerenkov, G4Scintillation, G4SynchrotronRadiationMat - checked while
loops
29 Apr 15: P.Gumplinger (xrays-V10-01-00)
- calculate deltaTime more accurately in G4Scintillation and G4Cerenkov
21 Nov 14: V.Ivanchenko (xrays-V10-00-07)
- G4ForwardXrayTR - fixed Coverity report (V.Grichine)
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Cerenkov.cc 85355 2014-10-28 09:58:59Z gcosmo $
// $Id: G4Cerenkov.cc 92046 2015-08-14 07:22:07Z gcosmo $
//
////////////////////////////////////////////////////////////////////////
// Cerenkov Radiation Class Implementation
@@ -202,11 +202,11 @@ G4Cerenkov::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
if (!Rindex) return pParticleChange;
// particle charge
const G4double charge = aParticle->GetDefinition()->GetPDGCharge();
G4double charge = aParticle->GetDefinition()->GetPDGCharge();
// particle beta
const G4double beta = (pPreStepPoint ->GetBeta() +
pPostStepPoint->GetBeta())/2.;
G4double beta = (pPreStepPoint ->GetBeta() +
pPostStepPoint->GetBeta())*0.5;
G4double MeanNumberOfPhotons =
GetAverageNumberOfPhotons(charge,beta,aMaterial,Rindex);
@@ -259,14 +259,14 @@ G4Cerenkov::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
G4double maxCos = BetaInverse / nMax;
G4double maxSin2 = (1.0 - maxCos) * (1.0 + maxCos);
const G4double beta1 = pPreStepPoint ->GetBeta();
const G4double beta2 = pPostStepPoint->GetBeta();
G4double beta1 = pPreStepPoint ->GetBeta();
G4double beta2 = pPostStepPoint->GetBeta();
G4double MeanNumberOfPhotons1 =
GetAverageNumberOfPhotons(charge,beta1,aMaterial,Rindex);
G4double MeanNumberOfPhotons2 =
GetAverageNumberOfPhotons(charge,beta2,aMaterial,Rindex);
for (G4int i = 0; i < NumPhotons; i++) {
// Determine photon energy
@@ -286,6 +286,7 @@ G4Cerenkov::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
sin2Theta = (1.0 - cosTheta)*(1.0 + cosTheta);
rand = G4UniformRand();
// Loop checking, 07-Aug-2015, Vladimir Ivanchenko
} while (rand*maxSin2 > sin2Theta);
// Generate random position of photon on cone surface
@@ -344,21 +345,22 @@ G4Cerenkov::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
// Generate new G4Track object:
G4double delta, NumberOfPhotons, N;
G4double NumberOfPhotons, N;
do {
rand = G4UniformRand();
delta = rand * aStep.GetStepLength();
NumberOfPhotons = MeanNumberOfPhotons1 - delta *
(MeanNumberOfPhotons1-MeanNumberOfPhotons2)/
aStep.GetStepLength();
NumberOfPhotons = MeanNumberOfPhotons1 - rand *
(MeanNumberOfPhotons1-MeanNumberOfPhotons2);
N = G4UniformRand() *
std::max(MeanNumberOfPhotons1,MeanNumberOfPhotons2);
// Loop checking, 07-Aug-2015, Vladimir Ivanchenko
} while (N > NumberOfPhotons);
G4double deltaTime = delta /
((pPreStepPoint->GetVelocity()+
pPostStepPoint->GetVelocity())/2.);
G4double delta = rand * aStep.GetStepLength();
G4double deltaTime = delta / (pPreStepPoint->GetVelocity()+
rand*(pPostStepPoint->GetVelocity()-
pPreStepPoint->GetVelocity())*0.5);
G4double aSecondaryTime = t0 + deltaTime;
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Scintillation.cc 85355 2014-10-28 09:58:59Z gcosmo $
// $Id: G4Scintillation.cc 91871 2015-08-07 15:22:30Z gcosmo $
//
////////////////////////////////////////////////////////////////////////
// Scintillation Light Class Implementation
@@ -441,9 +441,9 @@ G4Scintillation::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
}
G4double delta = rand * aStep.GetStepLength();
G4double deltaTime = delta /
((pPreStepPoint->GetVelocity()+
pPostStepPoint->GetVelocity())/2.);
G4double deltaTime = delta / (pPreStepPoint->GetVelocity()+
rand*(pPostStepPoint->GetVelocity()-
pPreStepPoint->GetVelocity())/2.);
// emission time distribution
if (ScintillationRiseTime==0.0) {
@@ -712,6 +712,7 @@ G4double G4Scintillation::sample_time(G4double tau1, G4double tau2)
{
// tau1: rise time and tau2: decay time
// Loop checking, 07-Aug-2015, Vladimir Ivanchenko
while(1) {
// two random numbers
G4double ran1 = G4UniformRand();
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4SynchrotronRadiationInMat.cc 68037 2013-03-13 14:15:08Z gcosmo $
// $Id: G4SynchrotronRadiationInMat.cc 91871 2015-08-07 15:22:30Z gcosmo $
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
@@ -338,6 +338,7 @@ G4SynchrotronRadiationInMat::PostStepDoIt(const G4Track& trackData,
cosTheta = 1. - 2.*G4UniformRand();
fcos = (1 + cosTheta*cosTheta)*0.5;
}
// Loop checking, 07-Aug-2015, Vladimir Ivanchenko
while( fcos < G4UniformRand() );
beta = std::sqrt(1. - 1./(gamma*gamma));