Import Geant4 10.4.1 source tree

This commit is contained in:
Gabriele Cosmo
2018-03-02 09:34:30 +01:00
parent fc6af9e721
commit fe04dcb406
341 changed files with 18389 additions and 24522 deletions
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4Cerenkov.cc 106116 2017-09-13 10:19:06Z gcosmo $
// $Id: G4Cerenkov.cc 108508 2018-02-15 15:54:35Z gcosmo $
//
////////////////////////////////////////////////////////////////////////
// Cerenkov Radiation Class Implementation
@@ -679,3 +679,15 @@ G4double
return NumPhotons;
}
void G4Cerenkov::DumpPhysicsTable() const
{
G4int PhysicsTableSize = thePhysicsTable->entries();
G4PhysicsOrderedFreeVector *v;
for (G4int i = 0 ; i < PhysicsTableSize ; i++ ) {
v = (G4PhysicsOrderedFreeVector*)(*thePhysicsTable)[i];
v->DumpValues();
}
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4ForwardXrayTR.cc 97385 2016-06-02 09:59:53Z gcosmo $
// $Id: G4ForwardXrayTR.cc 108508 2018-02-15 15:54:35Z gcosmo $
//
// G4ForwardXrayTR class -- implementation file
//
@@ -800,16 +800,36 @@ G4ForwardXrayTR::GetEnergyTR(G4int iMat, G4int jMat, G4int iTkin) const
// theta angle relative to particle direction
//
G4double
G4ForwardXrayTR::GetThetaTR(G4int, G4int, G4int) const
{
G4double theta = 0.0;
return theta;
return 0.0;
}
G4int G4ForwardXrayTR::GetSympsonNumber()
{
return fSympsonNumber;
}
G4int G4ForwardXrayTR::GetBinTR()
{
return fBinTR;
}
G4double G4ForwardXrayTR::GetMinProtonTkin()
{
return fMinProtonTkin;
}
G4double G4ForwardXrayTR::GetMaxProtonTkin()
{
return fMaxProtonTkin;
}
G4int G4ForwardXrayTR::GetTotBin()
{
return fTotBin;
}
// end of G4ForwardXrayTR implementation file
//
@@ -23,7 +23,7 @@
// ********************************************************************
//
//
// $Id: G4Scintillation.cc 107824 2017-12-05 15:47:44Z gunter $
// $Id: G4Scintillation.cc 108508 2018-02-15 15:54:35Z gcosmo $
//
////////////////////////////////////////////////////////////////////////
// Scintillation Light Class Implementation
@@ -155,6 +155,14 @@ G4Scintillation::~G4Scintillation()
// Methods
////////////
G4bool G4Scintillation::IsApplicable(const G4ParticleDefinition& aParticleType)
{
if (aParticleType.GetParticleName() == "opticalphoton") return false;
if (aParticleType.IsShortLived()) return false;
return true;
}
void G4Scintillation::BuildPhysicsTable(const G4ParticleDefinition&)
{
if (fFastIntegralTable != nullptr) {
@@ -854,3 +862,28 @@ GetScintillationYieldByParticleType(const G4Track &aTrack, const G4Step &aStep)
return ScintillationYield;
}
void G4Scintillation::DumpPhysicsTable() const
{
if (fFastIntegralTable) {
G4int PhysicsTableSize = fFastIntegralTable->entries();
G4PhysicsOrderedFreeVector *v;
for (G4int i = 0 ; i < PhysicsTableSize ; i++ )
{
v = (G4PhysicsOrderedFreeVector*)(*fFastIntegralTable)[i];
v->DumpValues();
}
}
if (fSlowIntegralTable) {
G4int PhysicsTableSize = fSlowIntegralTable->entries();
G4PhysicsOrderedFreeVector *v;
for (G4int i = 0 ; i < PhysicsTableSize ; i++ )
{
v = (G4PhysicsOrderedFreeVector*)(*fSlowIntegralTable)[i];
v->DumpValues();
}
}
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4SynchrotronRadiationInMat.cc 97385 2016-06-02 09:59:53Z gcosmo $
// $Id: G4SynchrotronRadiationInMat.cc 108508 2018-02-15 15:54:35Z gcosmo $
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
@@ -123,15 +123,9 @@ G4SynchrotronRadiationInMat::fIntegralProbabilityOfSR[200] =
G4SynchrotronRadiationInMat::G4SynchrotronRadiationInMat(const G4String& processName,
G4ProcessType type):G4VDiscreteProcess (processName, type),
LowestKineticEnergy (10.*keV),
//HighestKineticEnergy (100.*TeV),
//TotBin(200),
theGamma (G4Gamma::Gamma() ),
theElectron ( G4Electron::Electron() ),
thePositron ( G4Positron::Positron() ),
//GammaCutInKineticEnergy(nullptr),
//ElectronCutInKineticEnergy(nullptr),
//PositronCutInKineticEnergy(nullptr),
//ParticleCutInKineticEnergy(nullptr),
fAlpha(0.0), fRootNumber(80),
fVerboseLevel( verboseLevel )
{
@@ -156,10 +150,18 @@ G4SynchrotronRadiationInMat::~G4SynchrotronRadiationInMat()
G4bool
G4SynchrotronRadiationInMat::IsApplicable( const G4ParticleDefinition& particle )
{
return ( ( &particle == (const G4ParticleDefinition *)theElectron ) ||
( &particle == (const G4ParticleDefinition *)thePositron ) );
( &particle == (const G4ParticleDefinition *)thePositron ));
}
G4double G4SynchrotronRadiationInMat::GetLambdaConst()
{
return fLambdaConst;
}
G4double G4SynchrotronRadiationInMat::GetEnergyConst()
{
return fEnergyConst;
}
/////////////////////////////// METHODS /////////////////////////////////
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4TransitionRadiation.cc 68037 2013-03-13 14:15:08Z gcosmo $
// $Id: G4TransitionRadiation.cc 108508 2018-02-15 15:54:35Z gcosmo $
//
// G4TransitionRadiation class -- implementation file
@@ -228,7 +228,4 @@ EnergyIntegralDistribution( G4double energy1,
+ 4.0*sumOdd + 2.0*sumEven )/3.0 ;
}
// end of G4TransitionRadiation implementation file --------------------------
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VTransitionRadiation.cc 97385 2016-06-02 09:59:53Z gcosmo $
// $Id: G4VTransitionRadiation.cc 108508 2018-02-15 15:54:35Z gcosmo $
//
// G4VTransitionRadiation class -- implementation file
@@ -167,3 +167,21 @@ void G4VTransitionRadiation::PrintInfoDefinition()
}
///////////////////////////////////////////////////////////////////////
G4double G4VTransitionRadiation::GetMeanFreePath(
const G4Track& track, G4double,
G4ForceCondition* condition)
{
if(nSteps > 0) {
*condition = StronglyForced;
} else {
*condition = NotForced;
if(track.GetKineticEnergy()/track.GetDefinition()->GetPDGMass() + 1.0 > gammaMin &&
track.GetVolume()->GetLogicalVolume()->GetRegion() == region) {
*condition = StronglyForced;
}
}
return DBL_MAX; // so TR doesn't limit mean free path
}
///////////////////////////////////////////////////////////////////////
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4VXTRenergyLoss.cc 97385 2016-06-02 09:59:53Z gcosmo $
// $Id: G4VXTRenergyLoss.cc 108508 2018-02-15 15:54:35Z gcosmo $
//
// History:
// 2001-2002 R&D by V.Grichine
@@ -85,13 +85,16 @@ G4VXTRenergyLoss::G4VXTRenergyLoss(G4LogicalVolume *anEnvelope,
// Initialization of local constants
fTheMinEnergyTR = 1.0*keV;
fTheMaxEnergyTR = 100.0*keV;
fTheMaxAngle = 1.0e-2;
fTheMinAngle = 5.0e-6;
fBinTR = 50;
fTheMaxAngle = 1.0e-2; // 100 mrad
fTheMinAngle = 2.5e-5;
fBinTR = 200; // 100; // 50;
fMinProtonTkin = 100.0*GeV;
fMaxProtonTkin = 100.0*TeV;
fTotBin = 50;
fTotBin = 50; // 100; //
// Proton energy vector initialization
fProtonEnergyVector = new G4PhysicsLogVector(fMinProtonTkin,
@@ -120,7 +123,7 @@ G4VXTRenergyLoss::G4VXTRenergyLoss(G4LogicalVolume *anEnvelope,
// default is XTR dEdx, not flux after radiator
fExitFlux = false;
fAngleRadDistr = false;
fAngleRadDistr = true; // false;
fCompton = false;
fLambda = DBL_MAX;
@@ -280,7 +283,7 @@ void G4VXTRenergyLoss::BuildPhysicsTable(const G4ParticleDefinition& pd)
}
BuildEnergyTable();
if (fAngleRadDistr)
if ( fAngleRadDistr )
{
if(verboseLevel > 0)
{
@@ -336,7 +339,7 @@ void G4VXTRenergyLoss::BuildEnergyTable()
fGamma = 1.0 + (fProtonEnergyVector->
GetLowEdgeEnergy(iTkin)/proton_mass_c2);
fMaxThetaTR = 2500.0/(fGamma*fGamma) ; // theta^2
fMaxThetaTR = 25.*2500.0/(fGamma*fGamma) ; // theta^2
fTheMinAngle = 1.0e-3; // was 5.e-6, e-6 !!!, e-5, e-4
@@ -428,7 +431,7 @@ void G4VXTRenergyLoss::BuildAngleForEnergyBank()
fGamma = 1.0 + (fProtonEnergyVector->
GetLowEdgeEnergy(iTkin)/proton_mass_c2);
fMaxThetaTR = 2500.0/(fGamma*fGamma) ; // theta^2
fMaxThetaTR = 25*2500.0/(fGamma*fGamma) ; // theta^2
fTheMinAngle = 1.0e-3; // was 5.e-6, e-6 !!!, e-5, e-4
@@ -509,7 +512,7 @@ void G4VXTRenergyLoss::BuildAngleTable()
fGamma = 1.0 + (fProtonEnergyVector->
GetLowEdgeEnergy(iTkin)/proton_mass_c2);
fMaxThetaTR = 25.0/(fGamma*fGamma); // theta^2
fMaxThetaTR = 25*2500.0/(fGamma*fGamma); // theta^2
fTheMinAngle = 1.0e-3; // was 5.e-6, e-6 !!!, e-5, e-4
@@ -585,7 +588,7 @@ G4PhysicsFreeVector* G4VXTRenergyLoss::GetAngleVector(G4double energy, G4int n)
for( iTheta = n - 1; iTheta >= 1; iTheta-- )
{
k = iTheta- 1 + kMin;
k = iTheta - 1 + kMin;
tmp = pi*fPlateThick*(k + cof2)/(fPlateThick + fGasThick);
@@ -793,12 +796,14 @@ G4VParticleChange* G4VXTRenergyLoss::PostStepDoIt( const G4Track& aTrack,
{
G4cout<<"energyTR = "<<energyTR/keV<<" keV"<<G4endl;
}
if (fAngleRadDistr)
if ( fAngleRadDistr )
{
// theta = std::fabs(G4RandGauss::shoot(0.0,pi/gamma));
theta2 = GetRandomAngle(energyTR,iTkin);
if(theta2 > 0.) theta = std::sqrt(theta2);
else theta = 0.; // theta2;
if( theta2 > 0.) theta = std::sqrt(theta2);
else theta = 0.; // theta2;
}
else theta = std::fabs(G4RandGauss::shoot(0.0,pi/gamma));
@@ -990,6 +995,7 @@ G4double G4VXTRenergyLoss::AngleXTRdEdx(G4double varAngle)
if( i == 0 )
{
if (energy1 > fTheMaxEnergyTR || energy1 < fTheMinEnergyTR) continue;
tmp1 = ( energy1*energy1*(1./fGamma/fGamma + varAngle) + fSigma1 )
* fPlateThick/(4*hbarc*energy1);
tmp2 = std::sin(tmp1);
@@ -999,12 +1005,14 @@ G4double G4VXTRenergyLoss::AngleXTRdEdx(G4double varAngle)
tmp *= (tmp1-tmp2)*(tmp1-tmp2);
tmp1 = cof1/(4.*hbarc) - cof2/(4.*hbarc*energy1*energy1);
tmp2 = std::abs(tmp1);
if(tmp2 > 0.) tmp /= tmp2;
else continue;
}
else
{
if (energy2 > fTheMaxEnergyTR || energy2 < fTheMinEnergyTR) continue;
tmp1 = ( energy2*energy2*(1./fGamma/fGamma + varAngle) + fSigma1 )
* fPlateThick/(4.*hbarc*energy2);
tmp2 = std::sin(tmp1);
@@ -1014,6 +1022,7 @@ G4double G4VXTRenergyLoss::AngleXTRdEdx(G4double varAngle)
tmp *= (tmp1-tmp2)*(tmp1-tmp2);
tmp1 = cof1/(4.*hbarc) - cof2/(4.*hbarc*energy2*energy2);
tmp2 = std::abs(tmp1);
if(tmp2 > 0.) tmp /= tmp2;
else continue;
}
@@ -1574,9 +1583,9 @@ G4double G4VXTRenergyLoss::GetRandomAngle( G4double energyXTR, G4int iTkin )
position = (*(*fAngleForEnergyTable)(iTR))(0)*G4UniformRand();
for(iAngle = 0;;iAngle++)
for( iAngle = 0;; iAngle++)
{
if(position >= (*(*fAngleForEnergyTable)(iTR))(iAngle)) break;
if( position >= (*(*fAngleForEnergyTable)(iTR))(iAngle) ) break;
}
angle = GetAngleXTR(iTR,position,iAngle);
return angle;
@@ -1588,12 +1597,12 @@ G4double G4VXTRenergyLoss::GetRandomAngle( G4double energyXTR, G4int iTkin )
// over integral energy distribution
G4double G4VXTRenergyLoss::GetAngleXTR( G4int iPlace,
G4double position,
G4int iTransfer )
G4double position,
G4int iTransfer )
{
G4double x1, x2, y1, y2, result;
if(iTransfer == 0)
if( iTransfer == 0 )
{
result = (*fAngleForEnergyTable)(iPlace)->GetLowEdgeEnergy(iTransfer);
}