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,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Cerenkov.cc,v 1.12 2001/11/07 17:07:40 radoone Exp $
// GEANT4 tag $Name: geant4-04-00 $
// $Id: G4Cerenkov.cc,v 1.13 2002/05/16 21:21:14 gum Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
////////////////////////////////////////////////////////////////////////
// Cerenkov Radiation Class Implementation
@@ -181,8 +181,10 @@ G4Cerenkov::AlongStepDoIt(const G4Track& aTrack, const G4Step& aStep)
aParticleChange.SetNumberOfSecondaries(NumPhotons);
if (fTrackSecondariesFirst)
aParticleChange.SetStatusChange(fSuspend);
if (fTrackSecondariesFirst) {
if (aTrack.GetTrackStatus() == fAlive )
aParticleChange.SetStatusChange(fSuspend);
}
////////////////////////////////////////////////////////////////
@@ -22,7 +22,7 @@
//
//
// $Id: G4ForwardXrayTR.cc,v 1.7 2001/10/24 16:40:54 maire Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
// G4ForwardXrayTR class -- implementation file
@@ -0,0 +1,120 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4GammaXTRadiator.cc,v 1.1 2002/01/22 15:22:53 grichine Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
#include "g4std/complex"
#include "G4GammaXTRadiator.hh"
#include "Randomize.hh"
#include "G4Gamma.hh"
////////////////////////////////////////////////////////////////////////////
//
// Constructor, destructor
G4GammaXTRadiator::G4GammaXTRadiator(G4LogicalVolume* anEnvelope,
G4double alphaPlate,
G4double alphaGas,
G4Material* foilMat,G4Material* gasMat,
G4double a, G4double b, G4int n,
const G4String& processName) :
G4VXTRenergyLoss(anEnvelope,foilMat,gasMat,a,b,n,processName)
{
G4cout<<"Gammma distributed X-ray TR radiator model is called"<<G4endl ;
// Build energy and angular integral spectra of X-ray TR photons from
// a radiator
fAlphaPlate = alphaPlate ;
fAlphaGas = alphaGas ;
G4cout<<"fAlphaPlate = "<<fAlphaPlate<<" ; fAlphaGas = "<<fAlphaGas<<G4endl ;
BuildTable() ;
}
///////////////////////////////////////////////////////////////////////////
G4GammaXTRadiator::~G4GammaXTRadiator()
{
;
}
///////////////////////////////////////////////////////////////////////////
//
// Rough approximation for radiator interference factor for the case of
// fully GamDistr radiator. The plate and gas gap thicknesses are distributed
// according to exponent. The mean values of the plate and gas gap thicknesses
// are supposed to be about XTR formation zones but much less than
// mean absorption length of XTR photons in coresponding material.
G4double
G4GammaXTRadiator::GetStackFactor( G4double energy,
G4double gamma, G4double varAngle )
{
G4double result, Za, Zb, Ma, Mb ;
Za = GetPlateFormationZone(energy,gamma,varAngle) ;
Zb = GetGasFormationZone(energy,gamma,varAngle) ;
Ma = GetPlateLinearPhotoAbs(energy) ;
Mb = GetGasLinearPhotoAbs(energy) ;
G4complex Ca(1.0+0.5*fPlateThick*Ma/fAlphaPlate,fPlateThick/Za/fAlphaPlate) ;
G4complex Cb(1.0+0.5*fGasThick*Mb/fAlphaGas,fGasThick/Zb/fAlphaGas) ;
G4complex Ha = G4std::pow(Ca,-fAlphaPlate) ;
G4complex Hb = G4std::pow(Cb,-fAlphaGas) ;
G4complex H = Ha*Hb ;
G4complex F1 = (1.0 - Ha)*(1.0 - Hb )/(1.0 - H)
* G4double(fPlateNumber) ;
G4complex F2 = (1.0-Ha)*(1.0-Ha)*Hb/(1.0-H)/(1.0-H)
* (1.0 - G4std::pow(H,fPlateNumber)) ;
G4complex R = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle) ;
result = 2.0*G4std::real(R) ;
return result ;
}
//
//
////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,123 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: G4RegularXTRadiator.cc,v 1.2 2002/01/18 17:26:21 grichine Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
#include "g4std/complex"
#include "G4RegularXTRadiator.hh"
#include "Randomize.hh"
#include "G4Gamma.hh"
////////////////////////////////////////////////////////////////////////////
//
// Constructor, destructor
G4RegularXTRadiator::G4RegularXTRadiator(G4LogicalVolume *anEnvelope,
G4Material* foilMat,G4Material* gasMat,
G4double a, G4double b, G4int n,
const G4String& processName) :
G4VXTRenergyLoss(anEnvelope,foilMat,gasMat,a,b,n,processName)
{
G4cout<<"Regular X-ray TR radiator EM process is called"<<G4endl ;
// Build energy and angular integral spectra of X-ray TR photons from
// a radiator
BuildTable() ;
}
///////////////////////////////////////////////////////////////////////////
G4RegularXTRadiator::~G4RegularXTRadiator()
{
;
}
///////////////////////////////////////////////////////////////////////////
//
// Approximation for radiator interference factor for the case of
// fully Regular radiator. The plate and gas gap thicknesses are fixed .
// The mean values of the plate and gas gap thicknesses
// are supposed to be about XTR formation zones but much less than
// mean absorption length of XTR photons in coresponding material.
G4double
G4RegularXTRadiator::GetStackFactor( G4double energy,
G4double gamma, G4double varAngle )
{
G4double result, Qa, Qb, Q, aZa, bZb, aMa, bMb, D ;
aZa = fPlateThick/GetPlateFormationZone(energy,gamma,varAngle) ;
bZb = fGasThick/GetGasFormationZone(energy,gamma,varAngle) ;
aMa = fPlateThick*GetPlateLinearPhotoAbs(energy) ;
bMb = fGasThick*GetGasLinearPhotoAbs(energy) ;
Qa = exp(-aMa) ;
Qb = exp(-bMb) ;
Q = Qa*Qb ;
G4complex Ha( exp(-0.5*aMa)*cos(aZa),
-exp(-0.5*aMa)*sin(aZa) ) ;
G4complex Hb( exp(-0.5*bMb)*cos(bZb),
-exp(-0.5*bMb)*sin(bZb) ) ;
G4complex H = Ha*Hb ;
G4complex Hs = G4std::conj(H) ;
D = 1.0 /( (1 - sqrt(Q))*(1 - sqrt(Q)) +
4*sqrt(Q)*sin(0.5*(aZa+bZb))*sin(0.5*(aZa+bZb)) ) ;
G4complex F1 = (1.0 - Ha)*(1.0 - Hb)*(1.0 - Hs)
* G4double(fPlateNumber)*D ;
G4complex F2 = (1.0-Ha)*(1.0-Ha)*Hb*(1.0-Hs)*(1.0-Hs)
* (1.0 - G4std::pow(H,fPlateNumber)) * D*D ;
G4complex R = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle) ;
result = 2.0*G4std::real(R) ;
return result ;
}
//
//
////////////////////////////////////////////////////////////////////////////
@@ -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;
}
@@ -22,7 +22,7 @@
//
//
// $Id: G4TransitionRadiation.cc,v 1.3 2001/07/11 10:03:42 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
// G4TransitionRadiation class -- implementation file
File diff suppressed because it is too large Load Diff