Import Geant4 4.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:39:52 +02:00
parent 921d3b1cda
commit 330b82b769
4524 changed files with 178689 additions and 43575 deletions
@@ -21,19 +21,23 @@
// ********************************************************************
//
//
// $Id: G4Scintillation.cc,v 1.8 2001/11/07 17:07:41 radoone Exp $
// GEANT4 tag $Name: geant4-04-00 $
// $Id: G4Scintillation.cc,v 1.10 2002/05/16 21:20:11 gum Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
////////////////////////////////////////////////////////////////////////
// Scintillation Light Class Implementation
////////////////////////////////////////////////////////////////////////
//
// File: G4Scintillation.cc
// Description: Discrete Process - Generation of Scintillation Photons
// Description: RestDiscrete Process - Generation of Scintillation Photons
// Version: 1.0
// Created: 1998-11-07
// Author: Peter Gumplinger
// Updated: 2000-09-18 by Peter Gumplinger
// Updated: 2002-05-09 by Peter Gumplinger
// > use only the PostStepPoint location for the origin of
// scintillation photons when energy is lost to the medium
// by a neutral particle
// 2000-09-18 by Peter Gumplinger
// > change: aSecondaryPosition=x0+rand*aStep.GetDeltaPosition();
// aSecondaryTrack->SetTouchable(0);
// 2001-09-17, migration of Materials to pure STL (mma)
@@ -62,7 +66,7 @@
/////////////////
G4Scintillation::G4Scintillation(const G4String& processName)
: G4VDiscreteProcess(processName)
: G4VRestDiscreteProcess(processName)
{
fTrackSecondariesFirst = false;
@@ -99,6 +103,19 @@ G4Scintillation::~G4Scintillation()
// Methods
////////////
// AtRestDoIt
// ----------
//
G4VParticleChange*
G4Scintillation::AtRestDoIt(const G4Track& aTrack, const G4Step& aStep)
// This routine simply calls the equivalent PostStepDoIt since all the
// necessary information resides in aStep.GetTotalEnergyDeposit()
{
return G4Scintillation::PostStepDoIt(aTrack, aStep);
}
// PostStepDoIt
// -------------
//
@@ -113,6 +130,7 @@ G4Scintillation::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
{
aParticleChange.Initialize(aTrack);
const G4DynamicParticle* aParticle = aTrack.GetDynamicParticle();
const G4Material* aMaterial = aTrack.GetMaterial();
G4StepPoint* pPreStepPoint = aStep.GetPreStepPoint();
@@ -127,12 +145,12 @@ G4Scintillation::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
G4MaterialPropertiesTable* aMaterialPropertiesTable =
aMaterial->GetMaterialPropertiesTable();
if (!aMaterialPropertiesTable)
return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
return G4VRestDiscreteProcess::PostStepDoIt(aTrack, aStep);
const G4MaterialPropertyVector* Intensity =
aMaterialPropertiesTable->GetProperty("SCINTILLATION");
if (!Intensity)
return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
return G4VRestDiscreteProcess::PostStepDoIt(aTrack, aStep);
G4double MeanNumPhotons = ScintillationYield * TotalEnergyDeposit;
@@ -145,15 +163,17 @@ G4Scintillation::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
aParticleChange.SetNumberOfSecondaries(0);
return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
return G4VRestDiscreteProcess::PostStepDoIt(aTrack, aStep);
}
////////////////////////////////////////////////////////////////
aParticleChange.SetNumberOfSecondaries(NumPhotons);
if (fTrackSecondariesFirst)
aParticleChange.SetStatusChange(fSuspend);
if (fTrackSecondariesFirst) {
if (aTrack.GetTrackStatus() == fAlive )
aParticleChange.SetStatusChange(fSuspend);
}
////////////////////////////////////////////////////////////////
@@ -231,7 +251,13 @@ G4Scintillation::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
// Generate new G4Track object:
G4double rand = G4UniformRand();
G4double rand;
if (aParticle->GetDefinition()->GetPDGCharge() != 0) {
rand = G4UniformRand();
} else {
rand = 1.0;
}
G4double delta = rand * aStep.GetStepLength();
G4double deltaTime = delta /
@@ -262,7 +288,7 @@ G4Scintillation::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
<< aParticleChange.GetNumberOfSecondaries() << G4endl;
}
return G4VDiscreteProcess::PostStepDoIt(aTrack, aStep);
return G4VRestDiscreteProcess::PostStepDoIt(aTrack, aStep);
}
// BuildThePhysicsTable for the scintillation process
@@ -383,3 +409,16 @@ G4double G4Scintillation::GetMeanFreePath(const G4Track& aTrack,
return DBL_MAX;
}
// GetMeanLifeTime
// ---------------
//
G4double G4Scintillation::GetMeanLifeTime(const G4Track& aTrack,
G4ForceCondition* condition)
{
*condition = Forced;
return DBL_MAX;
}