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,43 @@
# $Id: GNUmakefile,v 1.3 1998/12/01 17:37:17 pavliouk Exp $
# -----------------------------------------------------------
# GNUmakefile for hadronic library. Gabriele Cosmo, 18/9/96.
# -----------------------------------------------------------
name := G4hadronic_kinetic
ifndef G4INSTALL
G4INSTALL = ../../../../../..
endif
include $(G4INSTALL)/config/architecture.gmk
G4TMPDIR = $(G4TMP)/$(G4SYSTEM)/$(name)
CPPFLAGS += -I$(G4BASE)/global/management/include \
-I$(G4BASE)/global/HEPRandom/include \
-I$(G4BASE)/global/HEPNumerics/include \
-I$(G4BASE)/global/HEPGeometry/include \
-I$(G4BASE)/track/include \
-I$(G4BASE)/geometry/volumes/include \
-I$(G4BASE)/geometry/management/include \
-I$(G4BASE)/processes/management/include \
-I$(G4BASE)/processes/hadronic/management/include/ \
-I$(G4BASE)/processes/hadronic/util/include \
-I$(G4BASE)/processes/hadronic/processes/include \
-I$(G4BASE)/processes/hadronic/cross_sections/include \
-I$(G4BASE)/processes/hadronic/models/generator/de_excitation/include \
-I$(G4BASE)/processes/hadronic/models/generator/management/include \
-I$(G4BASE)/processes/hadronic/models/generator/util/include \
-I$(G4BASE)/processes/hadronic/models/generator/pre_equilibrium/include \
-I$(G4BASE)/processes/hadronic/models/generator/diffractive_string/include \
-I$(G4BASE)/particles/management/include \
-I$(G4BASE)/particles/leptons/include \
-I$(G4BASE)/particles/bosons/include \
-I$(G4BASE)/particles/hadrons/mesons/include \
-I$(G4BASE)/particles/hadrons/barions/include \
-I$(G4BASE)/particles/hadrons/ions/include \
-I$(G4BASE)/particles/shortlived/include \
-I$(G4BASE)/materials/include
include $(G4INSTALL)/config/common.gmk
@@ -0,0 +1,5 @@
For the moment a trivial (and hence approximative) interface to pre-equilibrium
is provided, along with the diffractive string approach in case you would like
to try the generator category in this first release.
Note that these two are fairly fresh code, and testing and
physics validation will continue.
@@ -0,0 +1,34 @@
#ifndef G4GeneratorPrecompoundInterface_h
#define G4GeneratorPrecompoundInterface_h 1
#include "G4Fancy3DNucleus.hh"
#include "G4Nucleon.hh"
#include "G4Nucleus.hh"
#include "G4VIntraNuclearTransportModel.hh"
#include "G4KineticTrackVector.hh"
#include "G4FragmentVector.hh"
#include "G4ParticleChange.hh"
#include "G4DynamicParticleVector.hh"
class G4GeneratorPrecompoundInterface : public G4VIntraNuclearTransportModel
{
public:
G4GeneratorPrecompoundInterface(){}
~G4GeneratorPrecompoundInterface(){}
private:
G4int operator==(G4GeneratorPrecompoundInterface& right) {return (this == &right);}
G4int operator!=(G4GeneratorPrecompoundInterface& right) {return (this != &right);}
public:
G4VParticleChange* ApplyYourself(const G4Track& aTrack, G4Nucleus& theNucleus);
G4DynamicParticleVector* Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus);
private:
};
#endif // G4GeneratorPrecompoundInterface_h
@@ -0,0 +1,138 @@
#include "G4GeneratorPrecompoundInterface.hh"
#include "G4DynamicParticleVector.hh"
#include "G4IonTable.hh"
//
// HPW, 10DEC 98, the decay part originally written by Gunter Folger in his FTF-test-program.
//
G4VParticleChange* G4GeneratorPrecompoundInterface::
ApplyYourself(const G4Track& aTrack, G4Nucleus& theNucleus)
{
cout << "G4GeneratorPrecompoundInterface: ApplyYourself interface called stand-allone."<< endl;
cout << "This class is only a mediator between generator and precompound"<<endl;
cout << "Please remove from your physics list."<<endl;
G4Exception("SEVERE: G4GeneratorPrecompoundInterface model interface called stand-allone.");
return new G4ParticleChange;
}
G4DynamicParticleVector* G4GeneratorPrecompoundInterface::
Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
{
G4DynamicParticleVector * theTotalResult = new G4DynamicParticleVector;
// decay the strong resonances
G4KineticTrackVector *result1, *secondaries, *result;
result1=theSecondaries;
result=new G4KineticTrackVector();
for (G4int aResult=0; aResult < result1->entries(); aResult++)
{
G4ParticleDefinition * pdef;
pdef=result1->at(aResult)->GetDefinition();
secondaries=NULL;
if ( pdef->GetPDGWidth() > 0 || pdef->GetPDGLifeTime() < 1*ns )
{
secondaries = result1->at(aResult)->Decay();
}
if ( secondaries == NULL )
{
result->insert(result1->at(aResult));
result1->at(aResult)=NULL; //protect for clearAndDestroy
}
else
{
for (G4int aSecondary=0; aSecondary<secondaries->entries(); aSecondary++)
{
result1->append(secondaries->at(aSecondary));
}
delete secondaries;
}
}
result1->clearAndDestroy();
delete result1;
// prepare the fragment
G4Fragment anInitialState;
G4int anA=theNucleus->GetMassNumber();
G4int aZ=theNucleus->GetCharge();
G4int numberOfEx = 0;
G4int numberOfCh = 0;
G4int numberOfHoles = 0;
G4double exEnergy = 0;
G4ThreeVector exciton3Momentum(0,0,0);
// loop over secondaries
for(G4int list=0; list < result->entries(); list++)
{
G4KineticTrack *aTrack = result->at(list);
if(aTrack->GetDefinition() != G4Proton::Proton() &&
aTrack->GetDefinition() != G4Neutron::Neutron())
{
theTotalResult->insert(new G4DynamicParticle(aTrack->GetDefinition(), aTrack->Get4Momentum()));
}
else if(aTrack->Get4Momentum().t() - aTrack->Get4Momentum().mag()>80*MeV)
{
theTotalResult->insert(new G4DynamicParticle(aTrack->GetDefinition(), aTrack->Get4Momentum()));
}
else if(aTrack->GetPosition().mag() > theNucleus->GetNuclearRadius())
{
theTotalResult->insert(new G4DynamicParticle(aTrack->GetDefinition(), aTrack->Get4Momentum()));
}
else
{
// within the nucleus, neutron or proton
// now calculate A, Z of the fragment, momentum, number of exciton states
anA++;;
numberOfEx++;
aZ += aTrack->GetDefinition()->GetPDGCharge();
numberOfCh += aTrack->GetDefinition()->GetPDGCharge();
exciton3Momentum += aTrack->Get4Momentum().vect();
exEnergy += (aTrack->Get4Momentum().t()-aTrack->Get4Momentum().m());
}
}
// loop over wounded nucleus
G4Nucleon * theCurrentNucleon = theNucleus->StartLoop() ? theNucleus->GetNextNucleon() : NULL;
while(theCurrentNucleon != NULL)
{
if(theCurrentNucleon->AreYouHit())
{
numberOfHoles++;
numberOfEx++;
anA--;
aZ -= theCurrentNucleon->GetDefinition()->GetPDGCharge();
exciton3Momentum -= theCurrentNucleon->Get4Momentum().vect();
exEnergy+=theCurrentNucleon->GetBindingEnergy();
}
theCurrentNucleon = theNucleus->GetNextNucleon();
}
G4double residualMass =
G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(aZ ,anA);
residualMass += exEnergy;
G4LorentzVector exciton4Momentum(exciton3Momentum,
sqrt(exciton3Momentum.mag2()+residualMass*residualMass));
anInitialState.SetA(anA);
anInitialState.SetZ(aZ);
anInitialState.SetNumberOfCharged(numberOfCh);
anInitialState.SetNumberOfHoles(numberOfHoles);
anInitialState.SetNumberOfExcitons(numberOfEx);
anInitialState.SetMomentum(exciton4Momentum);
anInitialState.SetExcitationEnergy(exEnergy);
// call pre-compound
const G4Fragment aFragment(anInitialState);
G4DynamicParticleVector * aPreResult = theDeExcitation->DeExcite(aFragment);
// fill pre-compound part into the result, and return
for(G4int ll=0; ll<aPreResult->entries(); ll++)
{
theTotalResult->insert(aPreResult->at(ll));
}
delete aPreResult;
// now return
return theTotalResult;
}