Import Geant4 0.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-01 15:25:35 +02:00
parent 54d6b71f95
commit b97f8d0df7
3237 changed files with 807095 additions and 0 deletions
@@ -0,0 +1,47 @@
// This code implementation is the intellectual property of
// the RD44 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: G4BosonConstructor.cc,v 2.0 1998/07/02 17:20:56 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// --------------------------------------------------------------
// GEANT 4 class implementatBoson file
//
#include "G4BosonConstructor.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleTable.hh"
// Bosons
#include "G4ChargedGeantino.hh"
#include "G4Geantino.hh"
#include "G4Gamma.hh"
#include "G4OpticalPhoton.hh"
G4BosonConstructor::G4BosonConstructor()
{
}
G4BosonConstructor::~G4BosonConstructor()
{
}
void G4BosonConstructor::ConstructParticle()
{
// pseudo-particles
G4Geantino::GeantinoDefinition();
G4ChargedGeantino::ChargedGeantinoDefinition();
// gamma
G4Gamma::GammaDefinition();
// optical photon
G4OpticalPhoton::OpticalPhotonDefinition();
}
@@ -0,0 +1,103 @@
// This code implementation is the intellectual property of
// the RD44 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: G4ChargedGeantino.cc,v 2.4 1998/09/24 05:42:24 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ----------------------------------------------------------------------
// GEANT 4 class implementation file
//
// For information related to this code contact:
// CERN, CN Division, ASD Group
// History: first implementation, based on object model of
// 4th April 1996, G.Cosmo
// **********************************************************************
// Added particle definitions, H.Kurashige, 19 April 1996
// Operators (+=, *=, ++, -> etc.) correctly used, P. Urban, 26/6/96
// Add G4ChargedGeantino::ChargedGeantinoDefinition() H.Kurashige, 4 July 1996
// ----------------------------------------------------------------------
#include <fstream.h>
#include <iomanip.h>
#include "G4ChargedGeantino.hh"
// ######################################################################
// ### ChargedGeantino ###
// ######################################################################
G4ChargedGeantino::G4ChargedGeantino(
const G4String& aName, G4double mass,
G4double width, G4double charge,
G4int iSpin, G4int iParity,
G4int iConjugation, G4int iIsospin,
G4int iIsospin3, G4int gParity,
const G4String& pType, G4int lepton,
G4int baryon, G4int encoding,
G4bool stable, G4double lifetime,
G4DecayTable *decaytable )
: G4VBoson( aName,mass,width,charge,iSpin,iParity,
iConjugation,iIsospin,iIsospin3,gParity,pType,
lepton,baryon,encoding,stable,lifetime,decaytable )
{
// Anti-particle of ChargedGeantino is ChargedGeantino itself
SetAntiPDGEncoding(encoding);
}
// ......................................................................
// ... static member definitions ...
// ......................................................................
//
// Arguments for constructor are as follows
// name mass width charge
// 2*spin parity C-conjugation
// 2*Isospin 2*Isospin3 G-parity
// type lepton number baryon number PDG encoding
// stable lifetime decay table
G4ChargedGeantino G4ChargedGeantino::theChargedGeantino(
"chargedgeantino", 0.0*MeV, 0.0*MeV, +1.*eplus,
0, 0, 0,
0, 0, 0,
"geantino", 0, 0, 0,
true, 0.0, NULL
);
G4ChargedGeantino* G4ChargedGeantino::ChargedGeantinoDefinition(){return &theChargedGeantino;}
// initialization for static cut values
G4double G4ChargedGeantino::theChargedGeantinoLengthCut = -1.0;
G4double* G4ChargedGeantino::theChargedGeantinoKineticEnergyCuts = NULL;
// **********************************************************************
// **************************** SetCuts *********************************
// **********************************************************************
void G4ChargedGeantino::SetCuts(G4double aCut)
{
theCutInMaxInteractionLength = aCut;
const G4MaterialTable* materialTable = G4Material::GetMaterialTable();
// Create the vector of cuts in energy
// corresponding to the stopping range cut
if(theKineticEnergyCuts) delete theKineticEnergyCuts;
theKineticEnergyCuts = new G4double [materialTable->length()];
// Build range vector for every material, convert cut into energy-cut,
// fill theKineticEnergyCuts and delete the range vector
for (G4int J=0; J<materialTable->length(); J++)
{
G4Material* aMaterial = (*materialTable)[J];
theKineticEnergyCuts[J] = 0.0*keV;
}
theChargedGeantinoLengthCut = theCutInMaxInteractionLength;
theChargedGeantinoKineticEnergyCuts = theKineticEnergyCuts;
// Rebuild the physics tables for every process for this particle type
}
+248
View File
@@ -0,0 +1,248 @@
// This code implementation is the intellectual property of
// the RD44 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: G4Gamma.cc,v 2.4 1998/09/24 05:42:30 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ----------------------------------------------------------------------
// GEANT 4 class implementation file
//
// For information related to this code contact:
// CERN, CN Division, ASD Group
// History: first implementation, based on object model of
// 4th April 1996, G.Cosmo
// **********************************************************************
// Added particle definitions, H.Kurashige, 19 April 1996
// Added SetCuts implementation , L.Urban , 12 June 1996
// Code uses operators (+=, *=, ++, -> etc.) correctly, P. Urban, 26/6/96
// Add GammaDefinition(), H.Kurashige, 4 July 1996
// ----------------------------------------------------------------------
#include "G4ios.hh"
#include <fstream.h>
#include <iomanip.h>
#include "G4Gamma.hh"
// ######################################################################
// ### GAMMA ###
// ######################################################################
G4Gamma::G4Gamma(
const G4String& aName, G4double mass,
G4double width, G4double charge,
G4int iSpin, G4int iParity,
G4int iConjugation, G4int iIsospin,
G4int iIsospin3, G4int gParity,
const G4String& pType, G4int lepton,
G4int baryon, G4int encoding,
G4bool stable, G4double lifetime,
G4DecayTable *decaytable )
: G4VBoson( aName,mass,width,charge,iSpin,iParity,
iConjugation,iIsospin,iIsospin3,gParity,pType,
lepton,baryon,encoding,stable,lifetime,decaytable )
//-- members initialisation for SetCuts ------------------------------
{
const G4double DefaultLowestEnergy = 1.0*keV;
const G4double DefaultHighestEnergy = 1.0*GeV;
const G4int DefaultTotBin = 100;
//-- members initialisation for SetCuts ------------------------------
LowestEnergy = DefaultLowestEnergy;
HighestEnergy = DefaultHighestEnergy;
TotBin = DefaultTotBin;
// Anti-particle of gamma is gamma itself
SetAntiPDGEncoding(encoding);
}
// ......................................................................
// ... static member definitions ...
// ......................................................................
//
// Arguments for constructor are as follows
// name mass width charge
// 2*spin parity C-conjugation
// 2*Isospin 2*Isospin3 G-parity
// type lepton number baryon number PDG encoding
// stable lifetime decay table
G4Gamma G4Gamma::theGamma(
"gamma", 0.0*MeV, 0.0*MeV, 0.0,
2, -1, -1,
0, 0, 0,
"gamma", 0, 0, 22,
true, 0.0, NULL
);
G4Gamma* G4Gamma::GammaDefinition() {return &theGamma;}
// initialization for static cut values
G4double G4Gamma::theGammaLengthCut = -1.0;
G4double* G4Gamma::theGammaKineticEnergyCuts = NULL;
// ***********************************************************************
// ******************* BuildAbsorptionLengthVector ***********************
// ***********************************************************************
void G4Gamma::BuildAbsorptionLengthVector(
const G4Material* aMaterial,
const G4CrossSectionTable* aCrossSectionTable,
G4double ,
G4double ,
G4RangeVector* absorptionLengthVector )
{
// fill the absorption length vector for this material
// absorption length is defined here as
//
// absorption length = 5./ macroscopic absorption cross section
//
const G4ElementVector* elementVector = aMaterial->GetElementVector();
const G4double* atomicNumDensityVector = aMaterial->GetAtomicNumDensityVector();
// fill absorption length vector
if (absorptionLengthVector == NULL) {
G4String aErrorMessage("Error in G4Gamma::BuildAbsorptionLengthVector()");
aErrorMessage += " NULL pointer is found in absorptionLengthVector \n";
G4Exception((const char*)aErrorMessage);
}
G4int NumEl = aMaterial->GetNumberOfElements();
G4double absorptionLengthMax = 0.0;
for (G4int ibin=0; ibin<TotBin; ibin++)
{
G4double lowEdgeEnergy = absorptionLengthVector->GetLowEdgeEnergy(ibin);
G4double SIGMA = 0. ;
for (G4int iel=0; iel<NumEl; iel++)
{
G4bool isOut;
G4int IndEl = (*elementVector)(iel)->GetIndex();
SIGMA += atomicNumDensityVector[iel]*
(*aCrossSectionTable)[IndEl]->GetValue(lowEdgeEnergy,isOut);
}
// absorption length=5./SIGMA
absorptionLengthVector->PutValue(ibin, 5./SIGMA);
if (absorptionLengthMax < 5./SIGMA ) absorptionLengthMax = 5./SIGMA;
}
if ( theCutInMaxInteractionLength >= absorptionLengthMax ) {
G4cout << "******** SetCuts for " << GetParticleName();
G4cout << " ********************" << endl;
G4cout << "The maximal meaningful cut is ";
G4cout << absorptionLengthMax/mm << " mm." << endl;
G4cout << "All the " << GetParticleName() << "will be killed !" << endl;
G4cout << "in the material " << aMaterial->GetName() << "." << endl;
}
}
// ***********************************************************************
// ********************** ComputeCrossSection ****************************
// ***********************************************************************
G4double G4Gamma::ComputeCrossSection(G4double AtomicNumber,
G4double KineticEnergy) const
{
// Compute the "absorption" cross section of the photon "absorption"
// cross section means here the sum of the cross sections of the
// pair production, Compton scattering and photoelectric processes
static G4double Z;
const G4double t1keV = 1.*keV;
const G4double t200keV = 200.*keV;
const G4double t100MeV = 100.*MeV;
static G4double s200keV, s1keV;
static G4double tmin, tlow;
static G4double smin, slow;
static G4double cmin, clow, chigh;
// compute Z dependent quantities in the case of a new AtomicNumber
if(abs(AtomicNumber-Z)>0.1)
{
Z = AtomicNumber;
G4double Zsquare = Z*Z;
G4double Zlog = log(Z);
G4double Zlogsquare = Zlog*Zlog;
s200keV = (0.2651-0.1501*Zlog+0.02283*Zlogsquare)*Zsquare;
tmin = (0.552+218.5/Z+557.17/Zsquare)*MeV;
smin = (0.01239+0.005585*Zlog-0.000923*Zlogsquare)*exp(1.5*Zlog);
cmin=log(s200keV/smin)/(log(tmin/t200keV)*log(tmin/t200keV));
tlow = 0.2*exp(-7.355/sqrt(Z))*MeV;
slow = s200keV*exp(0.042*Z*log(t200keV/tlow)*log(t200keV/tlow));
s1keV = 300.*Zsquare;
clow =log(s1keV/slow)/log(tlow/t1keV);
chigh=(7.55e-5-0.0542e-5*Z)*Zsquare*Z/log(t100MeV/tmin);
}
// calculate the cross section (using an approximate empirical formula)
G4double s;
if ( KineticEnergy<tlow ) {
if(KineticEnergy<t1keV) s = slow*exp(clow*log(tlow/t1keV));
else s = slow*exp(clow*log(tlow/KineticEnergy));
} else if ( KineticEnergy<t200keV ) {
s = s200keV
* exp(0.042*Z*log(t200keV/KineticEnergy)*log(t200keV/KineticEnergy));
} else if( KineticEnergy<tmin ){
s = smin
* exp(cmin*log(tmin/KineticEnergy)*log(tmin/KineticEnergy));
} else {
s = smin + chigh*log(KineticEnergy/tmin);
}
return s * barn;
}
// **********************************************************************
// ******************** ConvertCutToKineticEnergy ***********************
// **********************************************************************
G4double G4Gamma::ConvertCutToKineticEnergy(
G4RangeVector* absorptionLengthVector) const
{
const G4double epsilon=0.01;
const G4int NBIN=200;
// find max. absorption length and the corresponding energy (rmax,Tmax)
G4double fac=log(HighestEnergy/LowestEnergy)/NBIN;
fac=exp(fac);
G4double T=LowestEnergy/fac;
G4double Tmax = T;
G4double rmax = -1.e10*mm;
G4bool isOut;
for (G4int ibin=0; ibin<NBIN; ibin++)
{
T=fac*T;
G4double r=absorptionLengthVector->GetValue(T,isOut);
if ( r>rmax )
{
Tmax=T;
rmax=r;
}
}
G4double T1 = LowestEnergy;
G4double r1 = absorptionLengthVector->GetValue(T1,isOut);
if ( theCutInMaxInteractionLength <= r1 ) {
return T1;
} else if ( theCutInMaxInteractionLength >= rmax ) {
G4cout << "******** ConvertCutToKineticEnergy for " << GetParticleName();
G4cout << " ********************" << endl;
G4cout << "The cut energy is set " << DBL_MAX/GeV << "GeV " <<endl;
return DBL_MAX;
} else {
G4double T2 = Tmax;
G4double T3 = sqrt(T1*T2);
G4double r3 = absorptionLengthVector->GetValue(T3,isOut);
while ( abs(1.-r3/theCutInMaxInteractionLength)>epsilon ) {
if ( theCutInMaxInteractionLength <= r3 )
T2 = T3;
else
T1 = T3;
T3 = sqrt(T1*T2);
r3 = absorptionLengthVector->GetValue(T3,isOut);
}
return T3;
}
}
+107
View File
@@ -0,0 +1,107 @@
// This code implementation is the intellectual property of
// the RD44 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: G4Geantino.cc,v 2.4 1998/09/24 05:42:35 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ----------------------------------------------------------------------
// GEANT 4 class implementation file
//
// For information related to this code contact:
// CERN, CN Division, ASD Group
// History: first implementation, based on object model of
// 4th April 1996, G.Cosmo
// **********************************************************************
// Added particle definitions, H.Kurashige, 19 April 1996
// Operators (+=, *=, ++, -> etc.) correctly used, P. Urban, 26/6/96
// Add G4Geantino::GeantinoDefinition() H.Kurashige, 4 July 1996
// ----------------------------------------------------------------------
#include <fstream.h>
#include <iomanip.h>
#include "G4Geantino.hh"
// ######################################################################
// ### GEANTINO ###
// ######################################################################
G4Geantino::G4Geantino(
const G4String& aName, G4double mass,
G4double width, G4double charge,
G4int iSpin, G4int iParity,
G4int iConjugation, G4int iIsospin,
G4int iIsospin3, G4int gParity,
const G4String& pType, G4int lepton,
G4int baryon, G4int encoding,
G4bool stable, G4double lifetime,
G4DecayTable *decaytable )
: G4VBoson( aName,mass,width,charge,iSpin,iParity,
iConjugation,iIsospin,iIsospin3,gParity,pType,
lepton,baryon,encoding,stable,lifetime,decaytable )
{
// Anti-particle of geantino is geantino itself
SetAntiPDGEncoding(encoding);
}
// ......................................................................
// ... static member definitions ...
// ......................................................................
//
// Arguments for constructor are as follows
// name mass width charge
// 2*spin parity C-conjugation
// 2*Isospin 2*Isospin3 G-parity
// type lepton number baryon number PDG encoding
// stable lifetime decay table
G4Geantino G4Geantino::theGeantino(
"geantino", 0.0*MeV, 0.0*MeV, 0.0,
0, 0, 0,
0, 0, 0,
"geantino", 0, 0, 0,
true, 0.0, NULL
);
G4Geantino* G4Geantino::GeantinoDefinition() {return &theGeantino;}
// initialization for static cut values
G4double G4Geantino::theGeantinoLengthCut = -1.0;
G4double* G4Geantino::theGeantinoKineticEnergyCuts = NULL;
// **********************************************************************
// **************************** SetCuts *********************************
// **********************************************************************
void G4Geantino::SetCuts(G4double aCut)
{
theCutInMaxInteractionLength = aCut;
const G4MaterialTable* materialTable = G4Material::GetMaterialTable();
// Create the vector of cuts in energy
// corresponding to the stopping range cut
if(theKineticEnergyCuts) delete theKineticEnergyCuts;
theKineticEnergyCuts = new G4double [materialTable->length()];
// Build range vector for every material, convert cut into energy-cut,
// fill theKineticEnergyCuts and delete the range vector
theGeantinoLengthCut = theCutInMaxInteractionLength;
theGeantinoKineticEnergyCuts = theKineticEnergyCuts;
for (G4int J=0; J<materialTable->length(); J++)
{
G4Material* aMaterial = (*materialTable)[J];
theKineticEnergyCuts[J] = 0.0*keV;
}
// Rebuild the physics tables for every process for this particle type
}
@@ -0,0 +1,104 @@
// This code implementation is the intellectual property of
// the RD44 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: G4OpticalPhoton.cc,v 2.2 1998/09/24 05:42:41 kurasige Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// ----------------------------------------------------------------------
// GEANT 4 class implementation file
//
// For information related to this code contact:
// CERN, CN Division, ASD Group
// History: first implementation, based on object model of
// 4th April 1996, G.Cosmo
// by H.Kurashige,17 Oct. 1996
// **********************************************************************
// Changed name intto "opticalphoton" Hisaya Kurashige, 08 Jan 1998
// ----------------------------------------------------------------------
#include <fstream.h>
#include <iomanip.h>
#include "G4OpticalPhoton.hh"
// ######################################################################
// ### OPTICAL PHOTON ###
// ######################################################################
G4OpticalPhoton::G4OpticalPhoton(
const G4String& aName, G4double mass,
G4double width, G4double charge,
G4int iSpin, G4int iParity,
G4int iConjugation, G4int iIsospin,
G4int iIsospin3, G4int gParity,
const G4String& pType, G4int lepton,
G4int baryon, G4int encoding,
G4bool stable, G4double lifetime,
G4DecayTable *decaytable )
: G4VBoson( aName,mass,width,charge,iSpin,iParity,
iConjugation,iIsospin,iIsospin3,gParity,pType,
lepton,baryon,encoding,stable,lifetime,decaytable )
{
// Anti-particle of OpticalPhoton is OpticalPhoton itself
SetAntiPDGEncoding(encoding);
}
// ......................................................................
// ... static member definitions ...
// ......................................................................
//
// Arguments for constructor are as follows
// name mass width charge
// 2*spin parity C-conjugation
// 2*Isospin 2*Isospin3 G-parity
// type lepton number baryon number PDG encoding
// stable lifetime decay table
// !! PDG encoding is set to 0 because G4OpticalPhoton is not
// !! gamma which has PDG code of 22
G4OpticalPhoton G4OpticalPhoton::theOpticalPhoton(
"opticalphoton", 0.0*MeV, 0.0*MeV, 0.0,
2, -1, -1,
0, 0, 0,
"opticalphoton", 0, 0, 0,
true, 0.0, NULL
);
// initialization for static cut values
G4double G4OpticalPhoton::theOpticalPhotonLengthCut = -1.0;
G4double* G4OpticalPhoton::theOpticalPhotonKineticEnergyCuts = NULL;
G4OpticalPhoton* G4OpticalPhoton::OpticalPhotonDefinition()
{return &theOpticalPhoton;}
// **********************************************************************
// **************************** SetCuts *********************************
// **********************************************************************
// In this version Input Cut Value is meaning less
// theKineticEnergyCuts for all materials are set to Zero.
void G4OpticalPhoton::SetCuts(G4double aCut)
{
theCutInMaxInteractionLength = aCut;
const G4MaterialTable* materialTable = G4Material::GetMaterialTable();
// Create the vector of cuts in energy
// corresponding to the stopping range cut
if(theKineticEnergyCuts) delete theKineticEnergyCuts;
theKineticEnergyCuts = new G4double [materialTable->length()];
// Build range vector for every material, convert cut into energy-cut,
// fill theKineticEnergyCuts and delete the range vector
for (G4int J=0; J<materialTable->length(); J++)
{
G4Material* aMaterial = (*materialTable)[J];
theKineticEnergyCuts[J] = 0.0;
}
theOpticalPhotonLengthCut = theCutInMaxInteractionLength;
theOpticalPhotonKineticEnergyCuts = theKineticEnergyCuts;
// Rebuild the physics tables for every process for this particle type
}
+37
View File
@@ -0,0 +1,37 @@
// This code implementation is the intellectual property of
// the RD44 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: G4VBoson.cc,v 2.0 1998/07/02 17:20:54 gunter Exp $
// GEANT4 tag $Name: geant4-00 $
//
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
// For information related to this code contact:
// CERN, CN Division, ASD Group
// History: first implementation, based on object model of
// 2nd December 1995, G.Cosmo
// --------------------------------------------------------------
#include "G4VBoson.hh"
const G4VBoson & G4VBoson::operator=(const G4VBoson &right)
{
if (this != &right) {
} return right;
}
G4int G4VBoson::operator==(const G4VBoson &right) const
{
return (this->GetParticleName() == right.GetParticleName());
}
G4int G4VBoson::operator!=(const G4VBoson &right) const
{
return (this->GetParticleName() != right.GetParticleName());
}