Import Geant4 7.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 11:11:55 +02:00
parent e083ffb441
commit 516dbf1a58
5914 changed files with 202605 additions and 71141 deletions
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Cerenkov.cc,v 1.14 2003/02/12 08:52:55 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// $Id: G4Cerenkov.cc,v 1.17 2004/12/10 18:49:57 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-00-cand-05 $
//
////////////////////////////////////////////////////////////////////////
// Cerenkov Radiation Class Implementation
@@ -55,6 +55,8 @@
#include "G4Poisson.hh"
#include "G4Cerenkov.hh"
using namespace std;
/////////////////////////
// Class Implementation
/////////////////////////
@@ -181,7 +183,7 @@ G4Cerenkov::AlongStepDoIt(const G4Track& aTrack, const G4Step& aStep)
if (fTrackSecondariesFirst) {
if (aTrack.GetTrackStatus() == fAlive )
aParticleChange.SetStatusChange(fSuspend);
aParticleChange.ProposeTrackStatus(fSuspend);
}
////////////////////////////////////////////////////////////////
@@ -224,7 +226,7 @@ G4Cerenkov::AlongStepDoIt(const G4Track& aTrack, const G4Step& aStep)
rand = G4UniformRand();
G4double phi = 2*M_PI*rand;
G4double phi = twopi*rand;
G4double sinPhi = sin(phi);
G4double cosPhi = cos(phi);
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ForwardXrayTR.cc,v 1.10 2003/06/03 08:11:01 vnivanch Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// $Id: G4ForwardXrayTR.cc,v 1.12 2004/12/02 08:31:07 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
//
// G4ForwardXrayTR class -- implementation file
@@ -81,6 +81,7 @@ G4double G4ForwardXrayTR::fPlasmaCof = 4.0*pi*fine_structure_const*
G4double G4ForwardXrayTR::fCofTR = fine_structure_const/pi ;
using namespace std;
/* ************************************************************************
@@ -676,7 +677,7 @@ G4VParticleChange* G4ForwardXrayTR::PostStepDoIt(const G4Track& aTrack,
// G4cout<<"energyTR = "<<energyTR/keV<<"keV"<<G4endl ;
kinEnergy -= energyTR ;
aParticleChange.SetEnergyChange(kinEnergy);
aParticleChange.ProposeEnergy(kinEnergy);
anglePos = (*(*fAngleDistrTable)(iPlace))(0)*G4UniformRand() ;
for(iTransfer=0;iTransfer<fBinTR-1;iTransfer++)
@@ -749,7 +750,7 @@ G4VParticleChange* G4ForwardXrayTR::PostStepDoIt(const G4Track& aTrack,
// G4cout<<"energyTR = "<<energyTR/keV<<"keV"<<G4endl ;
kinEnergy -= energyTR ;
aParticleChange.SetEnergyChange(kinEnergy);
aParticleChange.ProposeEnergy(kinEnergy);
anglePos = ((*(*fAngleDistrTable)(iPlace))(0)*W1+
(*(*fAngleDistrTable)(iPlace + 1))(0)*W2)*G4UniformRand() ;
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4GammaXTRadiator.cc,v 1.2 2003/06/16 17:02:55 gunter Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// $Id: G4GammaXTRadiator.cc,v 1.3 2004/12/02 08:31:07 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
//
#include <complex>
@@ -32,6 +32,8 @@
#include "G4Gamma.hh"
using namespace std;
////////////////////////////////////////////////////////////////////////////
//
// Constructor, destructor
@@ -89,19 +91,19 @@ G4GammaXTRadiator::GetStackFactor( G4double 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 = std::pow(Ca,-fAlphaPlate) ;
G4complex Hb = std::pow(Cb,-fAlphaGas) ;
G4complex Ha = pow(Ca,-fAlphaPlate) ;
G4complex Hb = 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 - std::pow(H,fPlateNumber)) ;
* (1.0 - pow(H,fPlateNumber)) ;
G4complex R = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle) ;
result = 2.0*std::real(R) ;
result = 2.0*real(R) ;
return result ;
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4RegularXTRadiator.cc,v 1.3 2003/06/16 17:02:56 gunter Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// $Id: G4RegularXTRadiator.cc,v 1.4 2004/12/02 08:31:07 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
//
#include <complex>
@@ -32,6 +32,8 @@
#include "G4Gamma.hh"
using namespace std;
////////////////////////////////////////////////////////////////////////////
//
// Constructor, destructor
@@ -91,7 +93,7 @@ G4RegularXTRadiator::GetStackFactor( G4double energy,
G4complex H = Ha*Hb ;
G4complex Hs = std::conj(H) ;
G4complex Hs = conj(H) ;
D = 1.0 /( (1 - sqrt(Q))*(1 - sqrt(Q)) +
4*sqrt(Q)*sin(0.5*(aZa+bZb))*sin(0.5*(aZa+bZb)) ) ;
@@ -100,11 +102,11 @@ G4RegularXTRadiator::GetStackFactor( G4double energy,
* G4double(fPlateNumber)*D ;
G4complex F2 = (1.0-Ha)*(1.0-Ha)*Hb*(1.0-Hs)*(1.0-Hs)
* (1.0 - std::pow(H,fPlateNumber)) * D*D ;
* (1.0 - pow(H,fPlateNumber)) * D*D ;
G4complex R = (F1 + F2)*OneInterfaceXTRdEdx(energy,gamma,varAngle) ;
result = 2.0*std::real(R) ;
result = 2.0*real(R) ;
return result ;
}
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Scintillation.cc,v 1.18 2003/06/16 17:02:57 gunter Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// $Id: G4Scintillation.cc,v 1.22 2004/12/10 18:49:57 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-00-cand-05 $
//
////////////////////////////////////////////////////////////////////////
// Scintillation Light Class Implementation
@@ -33,7 +33,9 @@
// Version: 1.0
// Created: 1998-11-07
// Author: Peter Gumplinger
// Updated: 2002-11-21 by Peter Gumplinger
// Updated: 2004-08-05 by Peter Gumplinger
// > changed StronglyForced back to Forced in GetMeanLifeTime
// 2002-11-21 by Peter Gumplinger
// > change to use G4Poisson for small MeanNumPhotons
// 2002-11-07 by Peter Gumplinger
// > now allow for fast and slow scintillation component
@@ -56,6 +58,8 @@
#include "G4ios.hh"
#include "G4Scintillation.hh"
using namespace std;
/////////////////////////
// Class Implementation
/////////////////////////
@@ -198,7 +202,7 @@ G4Scintillation::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
if (fTrackSecondariesFirst) {
if (aTrack.GetTrackStatus() == fAlive )
aParticleChange.SetStatusChange(fSuspend);
aParticleChange.ProposeTrackStatus(fSuspend);
}
////////////////////////////////////////////////////////////////
@@ -234,10 +238,10 @@ G4Scintillation::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
G4double YieldRatio = aMaterialPropertiesTable->
GetConstProperty("YIELDRATIO");
if ( ExcitationRatio == 1.0 ) {
Num = G4int (std::min(YieldRatio,1.0) * NumPhotons);
Num = G4int (min(YieldRatio,1.0) * NumPhotons);
}
else {
Num = G4int (std::min(ExcitationRatio,1.0) * NumPhotons);
Num = G4int (min(ExcitationRatio,1.0) * NumPhotons);
}
ScintillationTime = aMaterialPropertiesTable->
GetConstProperty("FASTTIMECONSTANT");
@@ -277,7 +281,7 @@ G4Scintillation::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
G4double cost = 1. - 2.*G4UniformRand();
G4double sint = sqrt((1.-cost)*(1.+cost));
G4double phi = 2*M_PI*G4UniformRand();
G4double phi = twopi*G4UniformRand();
G4double sinp = sin(phi);
G4double cosp = cos(phi);
@@ -299,7 +303,7 @@ G4Scintillation::PostStepDoIt(const G4Track& aTrack, const G4Step& aStep)
G4ThreeVector perp = photonMomentum.cross(photonPolarization);
phi = 2*M_PI*G4UniformRand();
phi = twopi*G4UniformRand();
sinp = sin(phi);
cosp = cos(phi);
@@ -550,7 +554,7 @@ G4double G4Scintillation::GetMeanFreePath(const G4Track&,
G4double G4Scintillation::GetMeanLifeTime(const G4Track&,
G4ForceCondition* condition)
{
*condition = StronglyForced;
*condition = Forced;
return DBL_MAX;
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4TransitionRadiation.cc,v 1.3 2001/07/11 10:03:42 gunter Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// $Id: G4TransitionRadiation.cc,v 1.4 2004/12/02 08:31:07 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
//
// G4TransitionRadiation class -- implementation file
@@ -53,6 +53,7 @@ const G4int G4TransitionRadiation::fSympsonNumber = 100 ;
const G4int G4TransitionRadiation::fGammaNumber = 15 ;
const G4int G4TransitionRadiation::fPointNumber = 100 ;
using namespace std;
///////////////////////////////////////////////////////////////////////
//
@@ -0,0 +1,163 @@
//
// ********************************************************************
// * 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: G4VTransitionRadiation.cc,v 1.3 2004/12/02 08:31:08 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
//
// G4VTransitionRadiation class -- implementation file
// GEANT 4 class implementation file --- Copyright CERN 1995
// CERN Geneva Switzerland
// History:
// 29.02.04 V.Ivanchenko create
#include "G4VTransitionRadiation.hh"
#include "G4ParticleDefinition.hh"
#include "G4VTRModel.hh"
#include "G4Material.hh"
#include "G4Region.hh"
#include "G4TransportationManager.hh"
///////////////////////////////////////////////////////////////////////
using namespace std;
G4VTransitionRadiation::G4VTransitionRadiation( const G4String& processName )
: G4VDiscreteProcess(processName),
nSteps(0),
gammaMin(100),
cosDThetaMax(cos(0.1))
{
Clear();
}
///////////////////////////////////////////////////////////////////////
G4VTransitionRadiation::~G4VTransitionRadiation()
{
Clear();
}
///////////////////////////////////////////////////////////////////////
void G4VTransitionRadiation::Clear()
{
materials.clear();
steps.clear();
normals.clear();
nSteps = 0;
}
///////////////////////////////////////////////////////////////////////
G4VParticleChange* G4VTransitionRadiation::PostStepDoIt(
const G4Track& track,
const G4Step& step)
{
// Fill temporary vectors
const G4Material* material = track.GetMaterial();
G4double length = step.GetStepLength();
G4ThreeVector direction = track.GetMomentumDirection();
if(nSteps == 0) {
nSteps = 1;
materials.push_back(material);
steps.push_back(length);
const G4StepPoint* point = step.GetPreStepPoint();
startingPosition = point->GetPosition();
startingDirection = point->GetMomentumDirection();
G4bool valid = true;
G4ThreeVector n = G4TransportationManager::GetTransportationManager()
->GetNavigatorForTracking()->GetLocalExitNormal(&valid);
if(valid) normals.push_back(n);
else normals.push_back(direction);
} else {
if(material == materials[nSteps-1]) {
steps[nSteps-1] += length;
} else {
nSteps++;
materials.push_back(material);
steps.push_back(length);
G4bool valid = true;
G4ThreeVector n = G4TransportationManager::GetTransportationManager()
->GetNavigatorForTracking()->GetLocalExitNormal(&valid);
if(valid) normals.push_back(n);
else normals.push_back(direction);
}
}
// Check POstStepPoint condition
if(track.GetTrackStatus() == fStopAndKill ||
track.GetVolume()->GetLogicalVolume()->GetRegion() != region ||
startingDirection.x()*direction.x() +
startingDirection.y()*direction.y() +
startingDirection.z()*direction.z() < cosDThetaMax)
{
if(model) {
model->GenerateSecondaries(*pParticleChange, materials, steps,
normals, startingPosition, track);
}
Clear();
}
return pParticleChange;
}
///////////////////////////////////////////////////////////////////////
G4bool G4VTransitionRadiation::IsApplicable(
const G4ParticleDefinition& aParticle)
{
return ( aParticle.GetPDGCharge() != 0.0 );
}
///////////////////////////////////////////////////////////////////////
void G4VTransitionRadiation::SetRegion(const G4Region* reg)
{
region = reg;
}
///////////////////////////////////////////////////////////////////////
void G4VTransitionRadiation::SetModel(G4VTRModel* m)
{
model = m;
}
///////////////////////////////////////////////////////////////////////
void G4VTransitionRadiation::PrintInfoDefinition()
{
if(model) model->PrintInfo();
}
///////////////////////////////////////////////////////////////////////
@@ -22,8 +22,8 @@
//
//
// $Id: G4VXTRenergyLoss.cc,v 1.11 2003/06/20 15:10:20 grichine Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
// $Id: G4VXTRenergyLoss.cc,v 1.14 2004/12/02 08:31:08 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
//
// History:
// 2001-2002 R&D by V.Grichine
@@ -54,6 +54,8 @@ G4double G4VXTRenergyLoss::fMaxProtonTkin = 100.0*TeV ;
G4int G4VXTRenergyLoss::fTotBin = 50 ;
// Proton energy vector initialization
using namespace std;
G4PhysicsLogVector* G4VXTRenergyLoss::
fProtonEnergyVector = new G4PhysicsLogVector(fMinProtonTkin,
fMaxProtonTkin,
@@ -415,7 +417,7 @@ G4VParticleChange* G4VXTRenergyLoss::AlongStepDoIt( const G4Track& aTrack,
}
sumEnergyTR += energyTR ;
theta = abs(G4RandGauss::shoot(0.0,pi/gamma)) ;
theta = fabs(G4RandGauss::shoot(0.0,pi/gamma)) ;
if( theta >= 0.1 ) theta = 0.1 ;
@@ -457,7 +459,7 @@ G4VParticleChange* G4VXTRenergyLoss::AlongStepDoIt( const G4Track& aTrack,
aParticleChange.AddSecondary(aSecondaryTrack);
}
kinEnergy -= sumEnergyTR ;
aParticleChange.SetEnergyChange(kinEnergy) ;
aParticleChange.ProposeEnergy(kinEnergy) ;
}
}
// return G4VContinuousProcess::AlongStepDoIt(aTrack, aStep);
@@ -741,7 +743,7 @@ void G4VXTRenergyLoss::ComputeGasPhotoAbsCof()
for(i=0;i<fGasIntervalNumber;i++)
{
fGasPhotoAbsCof[i] = new G4double[5] ;
}
}
for(i=0;i<fGasIntervalNumber;i++)
{
fGasPhotoAbsCof[i][0] = thisMaterialSandiaTable.
@@ -805,8 +807,8 @@ G4double G4VXTRenergyLoss::GetPlateZmuProduct( G4double omega ,
void G4VXTRenergyLoss::GetPlateZmuProduct()
{
std::ofstream outPlate("plateZmu.dat", std::ios::out ) ;
outPlate.setf( std::ios::scientific, std::ios::floatfield );
ofstream outPlate("plateZmu.dat", ios::out ) ;
outPlate.setf( ios::scientific, ios::floatfield );
G4int i ;
G4double omega, varAngle, gamma ;
@@ -840,8 +842,8 @@ G4double G4VXTRenergyLoss::GetGasZmuProduct( G4double omega ,
void G4VXTRenergyLoss::GetGasZmuProduct()
{
std::ofstream outGas("gasZmu.dat", std::ios::out ) ;
outGas.setf( std::ios::scientific, std::ios::floatfield );
ofstream outGas("gasZmu.dat", ios::out ) ;
outGas.setf( ios::scientific, ios::floatfield );
G4int i ;
G4double omega, varAngle, gamma ;
gamma = 10000. ;
@@ -943,11 +945,11 @@ void G4VXTRenergyLoss::GetNumberOfPhotons()
G4int iTkin ;
G4double gamma, numberE ;
std::ofstream outEn("numberE.dat", std::ios::out ) ;
outEn.setf( std::ios::scientific, std::ios::floatfield );
ofstream outEn("numberE.dat", ios::out ) ;
outEn.setf( ios::scientific, ios::floatfield );
std::ofstream outAng("numberAng.dat", std::ios::out ) ;
outAng.setf( std::ios::scientific, std::ios::floatfield );
ofstream outAng("numberAng.dat", ios::out ) ;
outAng.setf( ios::scientific, ios::floatfield );
for(iTkin=0;iTkin<fTotBin;iTkin++) // Lorentz factor loop
{