Import Geant4 9.5.0 source tree
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: CMakeLists.txt,v 1.1 2010/09/29 18:55:53 bmorgan Exp $
|
||||
# $Id: CMakeLists.txt,v 1.1 2010-09-29 18:55:53 bmorgan Exp $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.4 2003/11/26 09:19:20 gcosmo Exp $
|
||||
# $Id: GNUmakefile,v 1.4 2003-11-26 09:19:20 gcosmo Exp $
|
||||
# -----------------------------------------------------------
|
||||
# GNUmakefile for hadronic library. Gabriele Cosmo, 18/9/96.
|
||||
# -----------------------------------------------------------
|
||||
@@ -11,6 +11,7 @@ endif
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
CPPFLAGS += -DG4HADRONIC_ALLOC_EXPORT
|
||||
CPPFLAGS += -I$(G4BASE)/global/management/include \
|
||||
-I$(G4BASE)/global/HEPRandom/include \
|
||||
-I$(G4BASE)/global/HEPNumerics/include \
|
||||
|
||||
@@ -13,6 +13,78 @@ code and to keep track of all tags.
|
||||
* Please list in reverse chronological order (last date on top)
|
||||
---------------------------------------------------------------
|
||||
|
||||
21 Nov 2011 Gunter Folger had-binary-V09-04-14
|
||||
- correct G4GeneratorPrecompoundInterface.cc to delete correct object,
|
||||
i.e. the kinetic track,
|
||||
|
||||
21 Nov 2011 Gunter Folger had-binary-V09-04-13
|
||||
- fix memory leak in G4GeneratorPrecompoundInterface.cc.
|
||||
|
||||
11-November-2011, Gunter Folger had-binary-V09-04-12
|
||||
- move to G4HadronicException in G4BinaryCascade::GetIonMass()
|
||||
|
||||
11-November 2011, Dennis Wright had-binary-V09-04-11
|
||||
- G4BinaryCascade.cc : update G4Exception to new format
|
||||
|
||||
07-November 2011, Dennis Wright had-binary-V09-04-10
|
||||
- G4BinaryCascade.hh, .cc: add ModelDescription()
|
||||
|
||||
03/04-November 2011, Gunter Folger had-binary-V09-04-09
|
||||
- G4RKFieldIntegrator.cc fix for Xcode warning.
|
||||
- BinaryCascade: add handling of detroyed nucleus, ie. when charge becomes 0
|
||||
|
||||
28-October-2011, Gunter Folger had-binary-V09-04-08
|
||||
svn rev 53628 ( except History)
|
||||
- BinaryCascade: more changes/fixes for use with propagate interface.
|
||||
|
||||
14-October-2011, Gunter Folger had-binary-V09-04-07
|
||||
svn rev 53102
|
||||
- G4GeneratorPrecompoundInterface: without de-excitation, need to
|
||||
add Fragment Nucleus to reaction products.
|
||||
- BinaryCascade: More cleanup. Revised claculation of excitation energy
|
||||
when used for rescattering, removing systematic energy non-conservation.
|
||||
|
||||
12-October-2011, Gunter Folger had-binary-V09-04-06
|
||||
svn rev 53051
|
||||
- G4GeneratorPrecompoundInterface: If (exact) excitation energy is <0,
|
||||
not not try to de-execite; energy non-conservation remains, but at a
|
||||
smaller value.
|
||||
|
||||
28-September-2011, Gunter Folger
|
||||
svn rev 52599
|
||||
- Some code cleanup in G4BinaryCascade, mostly ApplyCollision. No change in
|
||||
functionality.
|
||||
|
||||
4-August-2011, M.Kelsey had-binary-V09-04-05
|
||||
- G4GeneratorPrecompoundInterface.cc: BUG FIXES: had wrong order of iterators
|
||||
in theFinalResult->insert(...), and incorrectly deleted precompound
|
||||
output after moving onto result. The tests I ran (test25 and test30) did
|
||||
not exercise this module.
|
||||
|
||||
28-July-2011, M.Kelsey had-binary-V09-04-04
|
||||
- G4GeneratorPrecompoundInterface.cc: replace loop to decay input
|
||||
secondaries with new G4DecayKineticTracks utility.
|
||||
|
||||
NOTE: Requires hadronic/model/util tag hadr-mod-util-V09-04-01 or later.
|
||||
|
||||
10-June-2011, G.Folger had-binary-V09-04-03
|
||||
- G4GeneratorPrecompoundInterface: add code to calculate excitation
|
||||
energy from as difference of initial-final state; Results in Energy
|
||||
conservation for string models. Requires tag on QGS increasing exciattion
|
||||
energy by decrease of participant nucleon energies.
|
||||
|
||||
25-May-2011,G.Folger had-binary-V09-04-02
|
||||
- Fix compilation warning on almost unused variables
|
||||
|
||||
12 May 2011, G.Folger had-binary-V09-04-01
|
||||
- Fix large energy non-conservation for Hydrogen target.
|
||||
(theFinalState vector was not cleared before use)
|
||||
Also move check for Hydrogen to ApplyYourSelf, directly calling
|
||||
Progategate1H1().
|
||||
|
||||
17 Mar 2011, G.Folger had-binary-V09-04-00
|
||||
- set E/p checking limits
|
||||
|
||||
11 Nov 2010, G.Folger had-binary-V09-03-05
|
||||
- fix compilation errors and warnings in G4BinaryCascade.
|
||||
|
||||
|
||||
@@ -55,6 +55,8 @@
|
||||
#include "G4BCLateParticle.hh"
|
||||
#include "G4BCAction.hh"
|
||||
|
||||
#include "G4DecayKineticTracks.hh"
|
||||
|
||||
class G4CollisionManager;
|
||||
|
||||
class G4Track;
|
||||
@@ -80,6 +82,8 @@ public:
|
||||
virtual G4ReactionProductVector * Propagate(G4KineticTrackVector *,
|
||||
G4V3DNucleus *);
|
||||
|
||||
virtual void ModelDescription(std::ostream&) const;
|
||||
|
||||
private:
|
||||
|
||||
G4int GetTotalCharge(std::vector<G4KineticTrack *> & aV)
|
||||
@@ -116,6 +120,10 @@ private:
|
||||
G4double GetExcitationEnergy();
|
||||
G4bool CheckDecay(G4KineticTrackVector *);
|
||||
void CorrectFinalPandE();
|
||||
G4double CorrectShortlivedPrimaryForFermi(
|
||||
G4KineticTrack* primary,G4KineticTrackVector target_collection);
|
||||
G4bool CorrectShortlivedFinalsForFermi(
|
||||
G4KineticTrackVector * products, G4double initial_Efermi);
|
||||
void UpdateTracksAndCollisions(G4KineticTrackVector * oldSecondaries,
|
||||
G4KineticTrackVector * oldTarget,
|
||||
G4KineticTrackVector * newSecondaries);
|
||||
@@ -130,6 +138,9 @@ private:
|
||||
G4V3DNucleus *);
|
||||
G4double GetIonMass(G4int Z, G4int A);
|
||||
|
||||
G4ReactionProductVector * HighEnergyModelFSProducts(G4ReactionProductVector *,
|
||||
G4KineticTrackVector * secondaries);
|
||||
G4ReactionProductVector * FillVoidNucleusProducts(G4ReactionProductVector * );
|
||||
// utility methods
|
||||
G4ThreeVector GetSpherePoint(G4double r, const G4LorentzVector & momentumdirection);
|
||||
void ClearAndDestroy(G4KineticTrackVector * ktv);
|
||||
@@ -138,33 +149,40 @@ private:
|
||||
// for debugging purpose
|
||||
void PrintKTVector(G4KineticTrackVector * ktv, std::string comment=std::string(""));
|
||||
void PrintKTVector(G4KineticTrack* kt, std::string comment=std::string(""));
|
||||
void DebugApplyCollisionFail(G4CollisionInitialState * collision,
|
||||
G4KineticTrackVector * products);
|
||||
void DebugApplyCollision(G4CollisionInitialState * collision,
|
||||
G4KineticTrackVector *products);
|
||||
void DebugEpConservation(const G4HadProjectile & aTrack, G4ReactionProductVector* products);
|
||||
|
||||
private:
|
||||
G4KineticTrackVector theProjectileList;
|
||||
G4KineticTrackVector theTargetList;
|
||||
G4KineticTrackVector theSecondaryList;
|
||||
G4KineticTrackVector theCapturedList;
|
||||
G4KineticTrackVector theFinalState;
|
||||
G4KineticTrackVector theProjectileList; // replaced by theProjectile4Momentum
|
||||
G4KineticTrackVector theTargetList; // list of nucleons in Nucleus
|
||||
G4KineticTrackVector theSecondaryList; // particles being followed
|
||||
G4KineticTrackVector theCapturedList; // captured particles
|
||||
G4KineticTrackVector theFinalState; // particles for final state
|
||||
|
||||
|
||||
G4ExcitationHandler * theExcitationHandler;
|
||||
G4CollisionManager * theCollisionMgr;
|
||||
|
||||
G4Scatterer * theH1Scatterer;
|
||||
|
||||
G4Scatterer * theH1Scatterer;
|
||||
|
||||
std::vector<G4BCAction *> theImR;
|
||||
G4BCDecay * theDecay;
|
||||
G4BCLateParticle * theLateParticle;
|
||||
G4VFieldPropagation * thePropagator;
|
||||
G4DecayKineticTracks decayKTV;
|
||||
|
||||
G4double theCurrentTime;
|
||||
G4double theBCminP;
|
||||
G4double theCutOnP;
|
||||
G4double theCutOnPAbsorb;
|
||||
G4LorentzVector theInitial4Mom;
|
||||
G4LorentzVector theInitial4Mom; // suppress?
|
||||
G4LorentzVector theProjectile4Momentum;
|
||||
G4int currentA, currentZ;
|
||||
G4double massInNucleus;
|
||||
G4int initialZ, initialA;
|
||||
G4double massInNucleus, initial_nuclear_mass;
|
||||
G4double currentInitialEnergy; // for debugging
|
||||
G4LorentzRotation precompoundLorentzboost;
|
||||
G4double theOuterRadius;
|
||||
|
||||
+2
-2
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4GeneratorPrecompoundInterface.hh,v 1.6 2010/08/31 16:16:51 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04 $
|
||||
// $Id: G4GeneratorPrecompoundInterface.hh,v 1.6 2010-08-31 16:16:51 vnivanch Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# Generated on : 24/9/2010
|
||||
#
|
||||
# $Id: sources.cmake,v 1.1 2010/09/29 18:56:01 bmorgan Exp $
|
||||
# $Id: sources.cmake,v 1.1 2010-09-29 18:56:01 bmorgan Exp $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -78,12 +78,18 @@ G4bool G4Absorber::Absorb(G4KineticTrack & kt, G4KineticTrackVector & tgt)
|
||||
G4bool G4Absorber::FindAbsorbers(G4KineticTrack & kt,
|
||||
G4KineticTrackVector & tgt)
|
||||
{
|
||||
// Find a closest ( in space) pair of Nucleons capable to absorb pi+/pi-
|
||||
// pi+ can be absorbed on np or nn resulting in pp or np
|
||||
// pi- can be absorbed on np or pp resulting in nn or np
|
||||
|
||||
// @GF: FindAbsorbers is unused, logic is seriously wrong
|
||||
|
||||
G4KineticTrack * kt1 = NULL;
|
||||
G4KineticTrack * kt2 = NULL;
|
||||
G4double dist1 = DBL_MAX;
|
||||
G4double dist2 = DBL_MAX;
|
||||
G4double dist1 = DBL_MAX; // dist to closest nucleon
|
||||
G4double dist2 = DBL_MAX; // dist to next close
|
||||
G4double charge1 = 0;
|
||||
G4double charge2 = 0;
|
||||
// G4double charge2 = 0; // charge2 is only assigned to, never used
|
||||
G4double charge0 = kt.GetDefinition()->GetPDGCharge();
|
||||
G4ThreeVector pos = kt.GetPosition();
|
||||
|
||||
@@ -96,28 +102,28 @@ G4bool G4Absorber::FindAbsorbers(G4KineticTrack & kt,
|
||||
continue;
|
||||
if(dist < dist1)
|
||||
{
|
||||
if(dist1 == DBL_MAX) // accept the candidate
|
||||
if(dist1 == DBL_MAX) // accept 1st as a candidate,
|
||||
{
|
||||
kt1 = curr;
|
||||
charge1 = kt1->GetDefinition()->GetPDGCharge();
|
||||
dist1 = dist;
|
||||
continue;
|
||||
}
|
||||
if(dist2 == DBL_MAX) // accept the candidate put kt1 in kt2
|
||||
{
|
||||
if(dist2 == DBL_MAX) // accept the candidate and shift kt1 to kt2
|
||||
{ // @GF: should'nt we check if compatible?
|
||||
kt2 = kt1;
|
||||
charge2 = charge1;
|
||||
// charge2 = charge1;
|
||||
dist2 = dist1;
|
||||
kt1 = curr;
|
||||
charge1 = kt1->GetDefinition()->GetPDGCharge();
|
||||
dist1 = dist;
|
||||
continue;
|
||||
}
|
||||
// test the compatibility with charge conservation
|
||||
// test the compatibility with charge conservation for new config
|
||||
G4double charge = curr->GetDefinition()->GetPDGCharge();
|
||||
if((charge0+charge1+charge < 0.) ||
|
||||
if((charge0+charge1+charge < 0.) || //test config (curr,kt1)
|
||||
(charge0+charge1+charge) > 2*eplus)
|
||||
{ // incomatible: change kt1 with curr.
|
||||
{ // incompatible: change kt1 with curr.
|
||||
kt1 = curr;
|
||||
charge1 = charge;
|
||||
dist1 = dist;
|
||||
@@ -125,7 +131,7 @@ G4bool G4Absorber::FindAbsorbers(G4KineticTrack & kt,
|
||||
else
|
||||
{ // compatible: change kt1 with curr and kt2 with kt1
|
||||
kt2 = kt1;
|
||||
charge2 = charge1;
|
||||
// charge2 = charge1;
|
||||
dist2 = dist1;
|
||||
kt1 = curr;
|
||||
charge1 = charge;
|
||||
@@ -137,7 +143,7 @@ G4bool G4Absorber::FindAbsorbers(G4KineticTrack & kt,
|
||||
if(dist2 == DBL_MAX) // accept the candidate
|
||||
{
|
||||
kt2 = curr;
|
||||
charge2 = kt2->GetDefinition()->GetPDGCharge();
|
||||
// charge2 = kt2->GetDefinition()->GetPDGCharge();
|
||||
dist2 = dist;
|
||||
continue;
|
||||
}
|
||||
@@ -148,7 +154,7 @@ G4bool G4Absorber::FindAbsorbers(G4KineticTrack & kt,
|
||||
continue; // incomatible: do nothing
|
||||
// compatible: change kt2 with curr
|
||||
kt2 = curr;
|
||||
charge2 = charge;
|
||||
// charge2 = charge;
|
||||
dist2 = dist;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+148
-122
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4GeneratorPrecompoundInterface.cc,v 1.11 2010/11/10 17:04:35 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04 $
|
||||
// $Id: G4GeneratorPrecompoundInterface.cc,v 1.11 2010-11-10 17:04:35 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
// GEANT 4 class file
|
||||
@@ -33,7 +33,8 @@
|
||||
// HPW, 10DEC 98, the decay part originally written by Gunter Folger
|
||||
// in his FTF-test-program.
|
||||
//
|
||||
//
|
||||
// M.Kelsey, 28 Jul 2011 -- Replace loop to decay input secondaries
|
||||
// with new utility class, simplify cleanup loops
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
#include "G4GeneratorPrecompoundInterface.hh"
|
||||
@@ -45,8 +46,13 @@
|
||||
#include "G4Nucleon.hh"
|
||||
#include "G4FragmentVector.hh"
|
||||
#include "G4ReactionProduct.hh"
|
||||
#include "G4ReactionProductVector.hh"
|
||||
#include "G4PreCompoundModel.hh"
|
||||
#include "G4ExcitationHandler.hh"
|
||||
#include "G4DecayKineticTracks.hh"
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
|
||||
G4GeneratorPrecompoundInterface::G4GeneratorPrecompoundInterface(G4VPreCompoundModel* p)
|
||||
: CaptureThreshold(10*MeV)
|
||||
@@ -59,133 +65,153 @@ G4GeneratorPrecompoundInterface::G4GeneratorPrecompoundInterface(G4VPreCompoundM
|
||||
|
||||
G4GeneratorPrecompoundInterface::~G4GeneratorPrecompoundInterface()
|
||||
{}
|
||||
|
||||
|
||||
|
||||
// choose to calculate excitation energy from energy balance
|
||||
#define exactExcitationEnergy
|
||||
|
||||
G4ReactionProductVector* G4GeneratorPrecompoundInterface::
|
||||
Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus)
|
||||
{
|
||||
G4ReactionProductVector * theTotalResult = new G4ReactionProductVector;
|
||||
G4ReactionProductVector * theTotalResult = new G4ReactionProductVector;
|
||||
|
||||
// decay the strong resonances
|
||||
G4KineticTrackVector *result1, *secondaries, *result;
|
||||
result1=theSecondaries;
|
||||
result=new G4KineticTrackVector();
|
||||
//G4cout << "### G4GeneratorPrecompoundInterface::Propagate "
|
||||
// << result1->size() << " tracks " << theDeExcitation << G4endl;
|
||||
for (unsigned int aResult=0; aResult < result1->size(); ++aResult)
|
||||
{
|
||||
G4ParticleDefinition * pdef;
|
||||
pdef=result1->operator[](aResult)->GetDefinition();
|
||||
secondaries=0;
|
||||
if ( pdef->IsShortLived() )
|
||||
{
|
||||
secondaries = result1->operator[](aResult)->Decay();
|
||||
}
|
||||
if ( 0 == secondaries )
|
||||
{
|
||||
result->push_back(result1->operator[](aResult));
|
||||
result1->operator[](aResult)=NULL; //protect for clearAndDestroy
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned int amax = secondaries->size();
|
||||
for (unsigned int aSecondary=0; aSecondary<amax; ++aSecondary)
|
||||
{
|
||||
result1->push_back(secondaries->operator[](aSecondary));
|
||||
}
|
||||
delete secondaries;
|
||||
}
|
||||
}
|
||||
//G4cout << "Delete tracks" << G4endl;
|
||||
std::for_each(result1->begin(), result1->end(), DeleteKineticTrack());
|
||||
delete result1;
|
||||
|
||||
// prepare the fragment
|
||||
G4int anA=theNucleus->GetMassNumber();
|
||||
G4int aZ=theNucleus->GetCharge();
|
||||
G4int numberOfEx = 0;
|
||||
G4int numberOfCh = 0;
|
||||
G4int numberOfHoles = 0;
|
||||
G4double exEnergy = 0.0;
|
||||
G4double R = theNucleus->GetNuclearRadius();
|
||||
G4ThreeVector exciton3Momentum(0.,0.,0.);
|
||||
// decay the strong resonances
|
||||
G4DecayKineticTracks decay(theSecondaries);
|
||||
|
||||
// loop over secondaries
|
||||
unsigned int amax = result->size();
|
||||
for(unsigned int list=0; list<amax; ++list)
|
||||
{
|
||||
G4KineticTrack *aTrack = result->operator[](list);
|
||||
G4ParticleDefinition* part = aTrack->GetDefinition();
|
||||
G4double e = aTrack->Get4Momentum().e();
|
||||
G4double mass = aTrack->Get4Momentum().mag();
|
||||
G4ThreeVector mom = aTrack->Get4Momentum().vect();
|
||||
if((part != proton && part != neutron) ||
|
||||
(e > mass + CaptureThreshold) ||
|
||||
(aTrack->GetPosition().mag() > R))
|
||||
{
|
||||
G4ReactionProduct * theNew = new G4ReactionProduct(part);
|
||||
theNew->SetMomentum(mom);
|
||||
theNew->SetTotalEnergy(e);
|
||||
theTotalResult->push_back(theNew);
|
||||
}
|
||||
else
|
||||
{
|
||||
// within the nucleus, neutron or proton
|
||||
// now calculate A, Z of the fragment, momentum, number of exciton states
|
||||
++anA;
|
||||
++numberOfEx;
|
||||
G4int Z = G4int(part->GetPDGCharge()/eplus + 0.1);
|
||||
aZ += Z;
|
||||
numberOfCh += Z;
|
||||
exciton3Momentum += mom;
|
||||
exEnergy += (e - mass);
|
||||
}
|
||||
}
|
||||
|
||||
// loop over wounded nucleus
|
||||
G4Nucleon * theCurrentNucleon =
|
||||
theNucleus->StartLoop() ? theNucleus->GetNextNucleon() : 0;
|
||||
while(0 != theCurrentNucleon)
|
||||
{
|
||||
if(theCurrentNucleon->AreYouHit())
|
||||
{
|
||||
++numberOfHoles;
|
||||
++numberOfEx;
|
||||
--anA;
|
||||
aZ -= G4int(theCurrentNucleon->GetDefinition()->GetPDGCharge()/eplus + 0.1);
|
||||
exciton3Momentum -= theCurrentNucleon->Get4Momentum().vect();
|
||||
exEnergy += theCurrentNucleon->GetBindingEnergy();
|
||||
}
|
||||
theCurrentNucleon = theNucleus->GetNextNucleon();
|
||||
}
|
||||
|
||||
if(0!=anA && 0!=aZ)
|
||||
{
|
||||
G4double fMass = G4NucleiProperties::GetNuclearMass(anA, aZ);
|
||||
fMass += exEnergy;
|
||||
// prepare the fragment
|
||||
G4int anA=theNucleus->GetMassNumber();
|
||||
G4int aZ=theNucleus->GetCharge();
|
||||
G4int numberOfEx = 0;
|
||||
G4int numberOfCh = 0;
|
||||
G4int numberOfHoles = 0;
|
||||
G4double exEnergy = 0.0;
|
||||
G4double R = theNucleus->GetNuclearRadius();
|
||||
G4ThreeVector exciton3Momentum(0.,0.,0.);
|
||||
|
||||
G4LorentzVector exciton4Momentum(exciton3Momentum,
|
||||
std::sqrt(exciton3Momentum.mag2() + fMass*fMass));
|
||||
|
||||
G4Fragment anInitialState(anA, aZ, exciton4Momentum);
|
||||
anInitialState.SetNumberOfParticles(numberOfEx-numberOfHoles);
|
||||
anInitialState.SetNumberOfCharged(numberOfCh);
|
||||
anInitialState.SetNumberOfHoles(numberOfHoles);
|
||||
G4ReactionProductVector * aPreResult = theDeExcitation->DeExcite(anInitialState);
|
||||
// loop over secondaries
|
||||
unsigned int amax = theSecondaries->size();
|
||||
#ifdef exactExcitationEnergy
|
||||
G4LorentzVector secondary4Momemtum(0,0,0,0);
|
||||
#endif
|
||||
for(unsigned int list=0; list<amax; ++list)
|
||||
{
|
||||
G4KineticTrack *aTrack = (*theSecondaries)[list];
|
||||
G4ParticleDefinition* part = aTrack->GetDefinition();
|
||||
G4double e = aTrack->Get4Momentum().e();
|
||||
G4double mass = aTrack->Get4Momentum().mag();
|
||||
G4ThreeVector mom = aTrack->Get4Momentum().vect();
|
||||
if((part != proton && part != neutron) ||
|
||||
(e > mass + CaptureThreshold) ||
|
||||
(aTrack->GetPosition().mag() > R)) {
|
||||
G4ReactionProduct * theNew = new G4ReactionProduct(part);
|
||||
theNew->SetMomentum(mom);
|
||||
theNew->SetTotalEnergy(e);
|
||||
theTotalResult->push_back(theNew);
|
||||
#ifdef exactExcitationEnergy
|
||||
secondary4Momemtum += aTrack->Get4Momentum();
|
||||
#endif
|
||||
} else {
|
||||
// within the nucleus, neutron or proton
|
||||
// now calculate A, Z of the fragment, momentum, number of exciton states
|
||||
++anA;
|
||||
++numberOfEx;
|
||||
G4int Z = G4int(part->GetPDGCharge()/eplus + 0.1);
|
||||
aZ += Z;
|
||||
numberOfCh += Z;
|
||||
exciton3Momentum += mom;
|
||||
exEnergy += (e - mass);
|
||||
}
|
||||
delete aTrack;
|
||||
}
|
||||
delete theSecondaries;
|
||||
|
||||
// fill pre-compound part into the result, and return
|
||||
unsigned int amax = aPreResult->size();
|
||||
for(unsigned int ll=0; ll<amax; ++ll)
|
||||
{
|
||||
theTotalResult->push_back(aPreResult->operator[](ll));
|
||||
}
|
||||
delete aPreResult;
|
||||
}
|
||||
|
||||
std::for_each(result->begin(), result->end(), DeleteKineticTrack());
|
||||
delete result;
|
||||
return theTotalResult;
|
||||
// loop over wounded nucleus
|
||||
G4Nucleon * theCurrentNucleon =
|
||||
theNucleus->StartLoop() ? theNucleus->GetNextNucleon() : 0;
|
||||
while(0 != theCurrentNucleon) {
|
||||
if(theCurrentNucleon->AreYouHit()) {
|
||||
++numberOfHoles;
|
||||
++numberOfEx;
|
||||
--anA;
|
||||
aZ -= G4int(theCurrentNucleon->GetDefinition()->GetPDGCharge()/eplus + 0.1);
|
||||
exciton3Momentum -= theCurrentNucleon->Get4Momentum().vect();
|
||||
exEnergy += theCurrentNucleon->GetBindingEnergy();
|
||||
}
|
||||
theCurrentNucleon = theNucleus->GetNextNucleon();
|
||||
}
|
||||
|
||||
if(0!=anA && 0!=aZ) {
|
||||
G4double fMass = G4NucleiProperties::GetNuclearMass(anA, aZ);
|
||||
#ifdef exactExcitationEnergy
|
||||
// recalculate exEnergy from Energy balance....
|
||||
const G4HadProjectile * primary = GetPrimaryProjectile();
|
||||
G4double Einitial= primary->Get4Momentum().e()
|
||||
+ G4NucleiProperties::GetNuclearMass(theNucleus->GetMassNumber(),theNucleus->GetCharge());
|
||||
G4double Efinal = fMass + secondary4Momemtum.e();
|
||||
if ( (Einitial - Efinal) > 0 ) {
|
||||
// G4cout << "G4GPI::Propagate() : positive exact excitation Energy "
|
||||
// << (Einitial - Efinal)/MeV << " MeV, exciton estimate " << exEnergy/MeV << " MeV" << G4endl;
|
||||
exEnergy=Einitial - Efinal;
|
||||
}
|
||||
else {
|
||||
// G4cout << "G4GeneratorPrecompoundInterface::Propagate() : negative exact excitation Energy "
|
||||
// << (Einitial - Efinal)/MeV << " MeV, using exciton estimate " << exEnergy/MeV << " MeV" << G4endl;
|
||||
exEnergy=0.;
|
||||
}
|
||||
#endif
|
||||
fMass += exEnergy;
|
||||
|
||||
#ifdef exactExcitationEnergy
|
||||
G4LorentzVector exciton4Momentum(exciton3Momentum, fMass);
|
||||
#else
|
||||
G4LorentzVector exciton4Momentum(exciton3Momentum,
|
||||
std::sqrt(exciton3Momentum.mag2() + fMass*fMass));
|
||||
#endif
|
||||
if ( exEnergy > 0.0 ) { // Need to de-excite the remnant nucleus only if excitation energy > 0.
|
||||
G4Fragment anInitialState(anA, aZ, exciton4Momentum);
|
||||
anInitialState.SetNumberOfParticles(numberOfEx-numberOfHoles);
|
||||
anInitialState.SetNumberOfCharged(numberOfCh);
|
||||
anInitialState.SetNumberOfHoles(numberOfHoles);
|
||||
|
||||
G4ReactionProductVector * aPreResult = theDeExcitation->DeExcite(anInitialState);
|
||||
|
||||
// fill pre-compound part into the result, and return
|
||||
unsigned int amax = aPreResult->size();
|
||||
for(unsigned int ll=0; ll<amax; ++ll) {
|
||||
theTotalResult->push_back(aPreResult->operator[](ll));
|
||||
}
|
||||
delete aPreResult;
|
||||
} else { // No excitation energy, we only need to create the remnant nucleus
|
||||
G4ParticleDefinition* theKindOfFragment = 0;
|
||||
if (anA == 1 && aZ == 0) {
|
||||
theKindOfFragment = G4Neutron::NeutronDefinition();
|
||||
} else if (anA == 1 && aZ == 1) {
|
||||
theKindOfFragment = G4Proton::ProtonDefinition();
|
||||
} else if (anA == 2 && aZ == 1) {
|
||||
theKindOfFragment = G4Deuteron::DeuteronDefinition();
|
||||
} else if (anA == 3 && aZ == 1) {
|
||||
theKindOfFragment = G4Triton::TritonDefinition();
|
||||
} else if (anA == 3 && aZ == 2) {
|
||||
theKindOfFragment = G4He3::He3Definition();
|
||||
} else if (anA == 4 && aZ == 2) {
|
||||
theKindOfFragment = G4Alpha::AlphaDefinition();;
|
||||
} else {
|
||||
theKindOfFragment =
|
||||
G4ParticleTable::GetParticleTable()->GetIonTable()->GetIon(aZ,anA,0.0);
|
||||
}
|
||||
if (theKindOfFragment != 0) {
|
||||
G4ReactionProduct * theNew = new G4ReactionProduct(theKindOfFragment);
|
||||
theNew->SetMomentum(exciton3Momentum);
|
||||
theNew->SetTotalEnergy(fMass);
|
||||
//theNew->SetFormationTime(??0.??);
|
||||
theTotalResult->push_back(theNew);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return theTotalResult;
|
||||
}
|
||||
|
||||
|
||||
G4HadFinalState* G4GeneratorPrecompoundInterface::
|
||||
ApplyYourself(const G4HadProjectile &, G4Nucleus & )
|
||||
{
|
||||
|
||||
@@ -143,7 +143,7 @@ G4double G4RKFieldIntegrator::Erf(G4double X)
|
||||
H = 1 - std::exp(-V*V)*(C1+Y*(P30 + P31*Y)/(Q30 + Y))/V;
|
||||
}
|
||||
if (X < 0)
|
||||
H =- H;
|
||||
H = -H;
|
||||
}
|
||||
return H;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user