Import Geant4 4.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:18:25 +02:00
parent 36c080dca6
commit 921d3b1cda
3990 changed files with 185376 additions and 82884 deletions
+29 -13
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Gamma.cc,v 1.3.4.2 2001/06/28 20:18:55 gunter Exp $
// GEANT4 tag $Name: $
// $Id: G4Gamma.cc,v 1.8 2001/10/20 01:36:37 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// ----------------------------------------------------------------------
@@ -96,9 +96,6 @@ G4Gamma G4Gamma::theGamma(
true, 0.0, NULL
);
G4Gamma* G4Gamma::GammaDefinition() {return &theGamma;}
// initialization for static cut values
G4double G4Gamma::theGammaLengthCut = -1.0;
G4double* G4Gamma::theGammaKineticEnergyCuts = NULL;
// ***********************************************************************
// ******************* BuildAbsorptionLengthVector ***********************
@@ -134,7 +131,7 @@ void G4Gamma::BuildAbsorptionLengthVector(
for (G4int iel=0; iel<NumEl; iel++)
{
G4bool isOut;
G4int IndEl = (*elementVector)(iel)->GetIndex();
G4int IndEl = (*elementVector)[iel]->GetIndex();
SIGMA += atomicNumDensityVector[iel]*
(*aCrossSectionTable)[IndEl]->GetValue(lowEdgeEnergy,isOut);
}
@@ -142,7 +139,16 @@ void G4Gamma::BuildAbsorptionLengthVector(
absorptionLengthVector->PutValue(ibin, 5./SIGMA);
if (absorptionLengthMax < 5./SIGMA ) absorptionLengthMax = 5./SIGMA;
}
if ( theCutInMaxInteractionLength >= absorptionLengthMax ) {
//----- Get maximum cut in length
G4int ii,siz = G4Material::GetNumberOfMaterials();
G4double maxCut = 0;
for( ii = 0; ii < siz; ii++ ){
if( theCutInMaxInteractionLength[ii] > maxCut ) maxCut = theCutInMaxInteractionLength[ii]
;
}
if ( maxCut >= absorptionLengthMax ) {
G4cout << "******** SetCuts for " << GetParticleName();
G4cout << " ********************" << G4endl;
G4cout << "The maximal meaningful cut is ";
@@ -152,6 +158,7 @@ void G4Gamma::BuildAbsorptionLengthVector(
}
}
// ***********************************************************************
// ********************** ComputeCrossSection ****************************
// ***********************************************************************
@@ -214,8 +221,11 @@ G4double G4Gamma::ComputeCrossSection(G4double AtomicNumber,
// ******************** ConvertCutToKineticEnergy ***********************
// **********************************************************************
G4double G4Gamma::ConvertCutToKineticEnergy(
G4RangeVector* absorptionLengthVector) const
G4double
G4Gamma::ConvertCutToKineticEnergy(
G4RangeVector* absorptionLengthVector,
size_t materialIndex
) const
{
const G4double epsilon=0.01;
const G4int NBIN=200;
@@ -239,9 +249,9 @@ G4double G4Gamma::ConvertCutToKineticEnergy(
}
G4double T1 = LowestEnergy;
G4double r1 = absorptionLengthVector->GetValue(T1,isOut);
if ( theCutInMaxInteractionLength <= r1 ) {
if ( theCutInMaxInteractionLength[materialIndex] <= r1 ) {
return T1;
} else if ( theCutInMaxInteractionLength >= rmax ) {
} else if ( theCutInMaxInteractionLength[materialIndex] >= rmax ) {
G4cout << "******** ConvertCutToKineticEnergy for " << GetParticleName();
G4cout << " ********************" << G4endl;
G4cout << "The cut energy is set " << DBL_MAX/GeV << "GeV " <<G4endl;
@@ -250,8 +260,8 @@ G4double G4Gamma::ConvertCutToKineticEnergy(
G4double T2 = Tmax;
G4double T3 = sqrt(T1*T2);
G4double r3 = absorptionLengthVector->GetValue(T3,isOut);
while ( abs(1.-r3/theCutInMaxInteractionLength)>epsilon ) {
if ( theCutInMaxInteractionLength <= r3 )
while ( abs(1.-r3/theCutInMaxInteractionLength[materialIndex])>epsilon ) {
if ( theCutInMaxInteractionLength[materialIndex] <= r3 )
T2 = T3;
else
T1 = T3;
@@ -261,3 +271,9 @@ G4double G4Gamma::ConvertCutToKineticEnergy(
return T3;
}
}
G4Gamma* G4Gamma::Gamma()
{
return &theGamma;
}