Import Geant4 1.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:28:20 +02:00
parent aaa409b6ee
commit ca1c8cb059
2995 changed files with 106830 additions and 299600 deletions
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4EnergyRangeManager.hh,v 1.1 1999/01/07 16:11:35 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4EnergyRangeManager.hh,v 1.1.10.1 1999/12/07 20:51:30 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// Hadronic Process: Energy Range Manager
// original by H.P. Wellisch
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4HadronInelasticProcess.hh,v 1.1 1999/01/07 16:11:35 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4HadronInelasticProcess.hh,v 1.1.10.1 1999/12/07 20:51:30 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// Hadronic Inelastic Process class
// The specific particle inelastic processes derive from this class
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4HadronicInteraction.hh,v 1.2 1999/03/29 09:35:31 hpw Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4HadronicInteraction.hh,v 1.2.8.1 1999/12/07 20:51:30 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// Hadronic Interaction abstract base class
// This class is the base class for the model classes.
@@ -1,7 +1,7 @@
#ifndef G4HadronicInteractionRegistry_h
#define G4HadronicInteractionRegistry_h 1
#include <rw/tpvector.h>
#include "g4rw/tpvector.h"
#include "globals.hh"
class G4HadronicInteraction;
@@ -27,7 +27,7 @@ class G4HadronicInteractionRegistry
void AddModel(G4HadronicInteraction * aModel);
G4int nModels;
RWTPtrVector<G4HadronicInteraction> allModels;
G4RWTPtrVector<G4HadronicInteraction> allModels;
static G4HadronicInteractionRegistry theRegistry;
};
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4HadronicProcess.hh,v 1.1 1999/01/07 16:11:35 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4HadronicProcess.hh,v 1.4.2.1 1999/12/07 20:51:30 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// This is the top level Hadronic Process class
// The inelastic, elastic, capture, and fission processes
@@ -34,6 +34,9 @@
#include "G4PhysicsVector.hh"
#include "G4Nucleus.hh"
#include "G4ReactionProduct.hh"
#include "g4rw/tpordvec.h"
#include "G4VIsotopeProduction.hh"
#include "G4IsoParticleChange.hh"
class G4HadronicProcess : public G4VDiscreteProcess
{
@@ -41,10 +44,10 @@
G4HadronicProcess( const G4String &processName = "Hadronic" ) :
G4VDiscreteProcess( processName )
{ }
{ isoIsOnAnyway = 0; }
virtual ~G4HadronicProcess()
{ }
{ theProductionModels.clearAndDestroy(); }
inline void RegisterMe( G4HadronicInteraction *a )
{ GetManagerPointer()->RegisterMe( a ); }
@@ -83,6 +86,25 @@
G4double GetCurrentN()
{ return currentN; }
// Set methods for isotope production
static void EnableIsotopeProductionGlobally();
static void DisableIsotopeProductionGlobally();
void EnableIsotopeCounting() {isoIsOnAnyway = 1;}
void DisableIsotopeCounting() {isoIsOnAnyway = -1;}
void RegisterIsotopeProductionModel(G4VIsotopeProduction * aModel)
{ theProductionModels.insert(aModel); }
static G4IsoParticleChange * GetIsotopeProductionInfo()
{
G4IsoParticleChange * anIsoResult = theIsoResult;
if(theIsoResult) theOldIsoResult = theIsoResult;
theIsoResult = NULL;
return anIsoResult;
}
protected:
@@ -95,11 +117,33 @@
G4Nucleus targetNucleus;
private:
G4VParticleChange * DoIsotopeCounting(G4VParticleChange * aResult,
const G4Track & aTrack,
const G4Nucleus & aNucleus);
G4IsoResult * ExtractResidualNucleus(const G4Track & aTrack,
const G4Nucleus & aNucleus,
G4VParticleChange * aResult);
private:
G4double currentZ;
G4double currentN;
G4HadronicProcess *dispatch;
// swiches for isotope production
static G4bool isoIsEnabled; // true or false; local swich overrides
G4int isoIsOnAnyway; // true(1), false(-1) or default(0)
G4IsoParticleChange theIsoPC;
G4RWTPtrOrderedVector<G4VIsotopeProduction> theProductionModels;
static G4IsoParticleChange * theIsoResult;
static G4IsoParticleChange * theOldIsoResult;
};
#endif
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4InelasticInteraction.hh,v 1.1 1999/01/07 16:11:36 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4InelasticInteraction.hh,v 1.1.10.1 1999/12/07 20:51:30 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// Hadronic Process: Inelastic Interaction
// This class is an abstract base class, since the pure virtual
@@ -0,0 +1,34 @@
#ifndef G4IsoParticleChange_h
#define G4IsoParticleChange_h
#include "G4Nucleus.hh"
class G4IsoParticleChange
{
public:
void SetIsotope(const G4String & anIsotope) {theIsotope = anIsotope;}
void SetProductionPosition(const G4ThreeVector & aPosition) {thePosition = aPosition;}
void SetProductionTime(const G4double & aProductionTime) {theProductionTime = aProductionTime; }
void SetParentParticle(const G4DynamicParticle & aProjectile) {theProjectile = aProjectile; }
void SetMotherNucleus(const G4Nucleus & aTarget) {theTarget = aTarget; }
void SetProducer(const G4String & aProducer) { theProducer = aProducer; }
G4String GetIsotope() {return theIsotope;}
G4ThreeVector GetProductionPosition() {return thePosition;}
G4double GetProductionTime() {return theProductionTime;}
G4DynamicParticle GetParentParticle() {return theProjectile;}
G4Nucleus GetMotherNucleus() {return theTarget;}
G4String GetProducer() {return theProducer;}
private:
G4String theIsotope;
G4ThreeVector thePosition;
G4double theProductionTime;
G4DynamicParticle theProjectile;
G4Nucleus theTarget;
G4String theProducer;
};
#endif
@@ -0,0 +1,22 @@
#ifndef G4VIsotopeProduction_h
#define G4VIsotopeProduction_h 1
#include "G4IsoResult.hh"
#include "G4Track.hh"
#include "G4Nucleus.hh"
class G4VIsotopeProduction
{
public:
virtual G4IsoResult * GetIsotope(const G4Track & aTrack, const G4Nucleus & aNucleus) = 0;
G4bool operator == (const G4VIsotopeProduction & aProd)
{
G4bool result = false;
if(&aProd==this) result = true;
return result;
}
};
#endif
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4EnergyRangeManager.cc,v 1.2 1999/03/29 09:35:36 hpw Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4EnergyRangeManager.cc,v 1.2.8.1 1999/12/07 20:51:31 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// Hadronic Process: Energy Range Manager
// original by H.P. Wellisch
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4HadronInelasticProcess.cc,v 1.1 1999/01/07 16:11:36 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4HadronInelasticProcess.cc,v 1.1.8.1.2.1 1999/12/07 20:51:31 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// Hadronic Inelastic Process Class
// J.L. Chuma, TRIUMF, 24-Mar-1997
@@ -37,7 +37,7 @@
// returns the mean free path in GEANT4 internal units
const RWTPtrVector<G4Element> *theElementVector =
const G4RWTPtrVector<G4Element> *theElementVector =
aMaterial->GetElementVector();
const G4double *theAtomicNumDensityVector =
@@ -1,12 +1,12 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4HadronicInteraction.cc,v 1.1 1999/01/07 16:11:36 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4HadronicInteraction.cc,v 1.1.10.1 1999/12/07 20:51:31 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// Hadronic Interaction base class
// original by H.P. Wellisch
@@ -1,15 +1,29 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// 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: G4HadronicProcess.cc,v 1.1 1999/01/07 16:11:36 gunter Exp $
// GEANT4 tag $Name: geant4-00-01 $
// $Id: G4HadronicProcess.cc,v 1.7.2.1 1999/12/07 20:51:31 gunter Exp $
// GEANT4 tag $Name: geant4-01-00 $
//
// HPW to implement the choosing of an element for scattering.
#include <fstream.h>
#ifdef WIN32
#include <strstrea.h>
#else
#include <strstream.h>
#endif
#include <stdlib.h>
#include "G4HadronicProcess.hh"
//@@ add model name info, once typeinfo available #include <typeinfo.h>
G4IsoParticleChange * G4HadronicProcess::theIsoResult = NULL;
G4IsoParticleChange * G4HadronicProcess::theOldIsoResult = NULL;
G4bool G4HadronicProcess::isoIsEnabled = true;
void G4HadronicProcess::EnableIsotopeProductionGlobally() {isoIsEnabled = true;}
void G4HadronicProcess::DisableIsotopeProductionGlobally() {isoIsEnabled = false;}
G4Element * G4HadronicProcess::ChooseAandZ(
const G4DynamicParticle *aParticle, const G4Material *aMaterial )
@@ -66,7 +80,98 @@
G4VParticleChange *result =
theInteraction->ApplyYourself( aTrack, targetNucleus);
ResetNumberOfInteractionLengthLeft();
if(isoIsOnAnyway!=-1)
{
if(isoIsEnabled||isoIsOnAnyway)
{
result = DoIsotopeCounting(result, aTrack, targetNucleus);
}
}
return result;
}
G4VParticleChange * G4HadronicProcess::
DoIsotopeCounting(G4VParticleChange * aResult,
const G4Track & aTrack,
const G4Nucleus & aNucleus)
{
// get the PC from iso-production
if(theOldIsoResult) delete theOldIsoResult;
if(theIsoResult) delete theIsoResult;
theIsoResult = new G4IsoParticleChange;
G4bool done = false;
G4IsoResult * anIsoResult = NULL;
for(G4int i=0; i<theProductionModels.length(); i++)
{
anIsoResult = theProductionModels(i)->GetIsotope(aTrack, aNucleus);
if(anIsoResult!=NULL)
{
done = true;
break;
}
}
// if none in charge, use default iso production
if(!done) anIsoResult = ExtractResidualNucleus(aTrack, aNucleus, aResult);
// Add all info explicitely and add typename from model called.
theIsoResult->SetIsotope(anIsoResult->GetIsotope());
theIsoResult->SetProductionPosition(aTrack.GetPosition());
theIsoResult->SetProductionTime(aTrack.GetGlobalTime());
theIsoResult->SetParentParticle(*aTrack.GetDynamicParticle());
theIsoResult->SetMotherNucleus(anIsoResult->GetMotherNucleus());
// theIsoResult->SetProducer(typeid(*theInteraction).name()); @@@@@@@
G4String aWorkaround("WaitingForTypeidToBeAvailableInCompilers"); // @@@@@ workaround for DEC.
theIsoResult->SetProducer(aWorkaround);
delete anIsoResult;
return aResult;
}
G4IsoResult * G4HadronicProcess::
ExtractResidualNucleus(const G4Track & aTrack,
const G4Nucleus & aNucleus,
G4VParticleChange * aResult)
{
G4double A = aNucleus.GetN();
G4double Z = aNucleus.GetZ();
G4double bufferA = 0;
G4double bufferZ = 0;
// loop over aResult, and decrement A, Z accordingly
// cash the max
for(G4int i=0; i<aResult->GetNumberOfSecondaries(); i++)
{
G4Track* aSecTrack = aResult->GetSecondary(i);
if(bufferA<aSecTrack->GetDefinition()->GetBaryonNumber())
{
bufferA = aSecTrack->GetDefinition()->GetBaryonNumber();
bufferZ = aSecTrack->GetDefinition()->GetPDGCharge();
}
Z-=aSecTrack->GetDefinition()->GetPDGCharge();
A-=aSecTrack->GetDefinition()->GetBaryonNumber();
}
// if the fragment was part of the final state, it is
// assumed to be the heaviest secondary.
if(A<0.1)
{
A = bufferA;
Z = bufferZ;
}
// prepare the IsoResult.
char the1[100] = {""};
ostrstream ost1(the1, 100, ios::out);
ost1 <<Z<<"_"<<A;
G4String * biff = new G4String(the1);
G4IsoResult * theResult = new G4IsoResult(*biff, aNucleus);
// cleaning up.
delete biff;
return theResult;
}
/* end of file */
@@ -1,5 +1,5 @@
// This code implementation is the intellectual property of
// the RD44 GEANT4 collaboration.
// the GEANT4 collaboration.
//
// By copying, distributing or modifying the Program (or any work
// based on the Program) you indicate your acceptance of this statement,