Import Geant4 0.0.0 source tree
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# $Id: GNUmakefile,v 2.0 1998/07/02 16:22:17 gunter Exp $
|
||||
# ----------------------------------------------------------------
|
||||
# GNUmakefile for hadronic management library. G.Folger 10-Dec-97
|
||||
# ----------------------------------------------------------------
|
||||
|
||||
name := G4hadronic_mgt
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../../..
|
||||
endif
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
CPPFLAGS += -I$(G4BASE)/global/management/include \
|
||||
-I$(G4BASE)/global/HEPRandom/include \
|
||||
-I$(G4BASE)/global/HEPGeometry/include \
|
||||
-I$(G4BASE)/track/include \
|
||||
-I$(G4BASE)/geometry/volumes/include \
|
||||
-I$(G4BASE)/geometry/management/include \
|
||||
-I$(G4BASE)/processes/hadronic/util/include \
|
||||
-I$(G4BASE)/processes/hadronic/cross_sections/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)/processes/management/include \
|
||||
-I$(G4BASE)/materials/include
|
||||
|
||||
include $(G4INSTALL)/config/common.gmk
|
||||
@@ -0,0 +1,68 @@
|
||||
// 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: G4EnergyRangeManager.hh,v 2.0 1998/07/02 16:22:08 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// Hadronic Process: Energy Range Manager
|
||||
// original by H.P. Wellisch
|
||||
// modified by J.L. Chuma, TRIUMF, 22-Nov-1996
|
||||
// Last modified: 24-Mar-1997
|
||||
|
||||
#ifndef G4EnergyRangeManager_h
|
||||
#define G4EnergyRangeManager_h 1
|
||||
|
||||
#include "G4HadronicInteraction.hh"
|
||||
|
||||
class G4EnergyRangeManager
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
G4EnergyRangeManager()
|
||||
{ theHadronicInteractionCounter = 0; }
|
||||
|
||||
~G4EnergyRangeManager()
|
||||
{ }
|
||||
|
||||
G4EnergyRangeManager( const G4EnergyRangeManager &right );
|
||||
|
||||
G4EnergyRangeManager & operator=( const G4EnergyRangeManager &right );
|
||||
|
||||
public:
|
||||
|
||||
inline G4bool operator==( const G4EnergyRangeManager &right ) const
|
||||
{ return ( this == (G4EnergyRangeManager *) &right ); }
|
||||
|
||||
inline G4bool operator!=( const G4EnergyRangeManager &right ) const
|
||||
{ return ( this != (G4EnergyRangeManager *) &right ); }
|
||||
|
||||
void RegisterMe( G4HadronicInteraction *a );
|
||||
|
||||
G4HadronicInteraction *GetHadronicInteraction(
|
||||
const G4double kineticEnergy,
|
||||
const G4Material *aMaterial,
|
||||
const G4Element *anElement ) const;
|
||||
|
||||
private:
|
||||
|
||||
inline G4int GetHadronicInteractionCounter() const
|
||||
{ return theHadronicInteractionCounter; }
|
||||
|
||||
private:
|
||||
|
||||
enum { MAX_NUMBER_OF_MODELS = 100 };
|
||||
|
||||
G4HadronicInteraction *
|
||||
theHadronicInteraction[ MAX_NUMBER_OF_MODELS ];
|
||||
|
||||
G4int theHadronicInteractionCounter;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
// 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: G4HadronInelasticProcess.hh,v 2.1 1998/07/13 19:02:45 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// Hadronic Inelastic Process class
|
||||
// The specific particle inelastic processes derive from this class
|
||||
// This is an abstract base class, since the pure virtual function
|
||||
// PostStepDoIt has not been defined yet.
|
||||
//
|
||||
// J.L. Chuma, TRIUMF, 10-Mar-1997
|
||||
// Last modified: 27-Mar-1997
|
||||
//
|
||||
// 14-APR-98 F.W.Jones: variant G4HadronInelastic process for
|
||||
// G4CrossSectionDataSet/DataStore class design.
|
||||
// 29-JUN-98 F.W.Jones: default data set G4HadronCrossSections
|
||||
//
|
||||
|
||||
#ifndef G4HadronInelasticProcess_h
|
||||
#define G4HadronInelasticProcess_h 1
|
||||
|
||||
#include "G4HadronicProcess.hh"
|
||||
//#include "G4LPhysicsFreeVector.hh"
|
||||
#include "G4HadronCrossSections.hh"
|
||||
#include "G4CrossSectionDataStore.hh"
|
||||
#include "G4HadronInelasticDataSet.hh"
|
||||
|
||||
|
||||
class G4HadronInelasticProcess : public G4HadronicProcess
|
||||
{
|
||||
public:
|
||||
|
||||
G4HadronInelasticProcess(
|
||||
const G4String &processName,
|
||||
G4ParticleDefinition *aParticle ) :
|
||||
G4HadronicProcess( processName ),
|
||||
theCrossSectionDataStore(new G4CrossSectionDataStore)
|
||||
{
|
||||
theCrossSectionDataStore->AddDataSet(new G4HadronInelasticDataSet);
|
||||
theParticle = aParticle;
|
||||
// BuildThePhysicsTable();
|
||||
}
|
||||
|
||||
virtual ~G4HadronInelasticProcess()
|
||||
{ }
|
||||
|
||||
G4double GetMeanFreePath(
|
||||
const G4Track &aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition *condition );
|
||||
|
||||
void BuildThePhysicsTable();
|
||||
|
||||
G4double GetMicroscopicCrossSection(
|
||||
const G4DynamicParticle *aParticle,
|
||||
const G4Element *anElement);
|
||||
|
||||
G4VParticleChange *PostStepDoIt(
|
||||
const G4Track &aTrack, const G4Step &aStep )
|
||||
{
|
||||
SetDispatch( this );
|
||||
return G4HadronicProcess::GeneralPostStepDoIt( aTrack, aStep );
|
||||
}
|
||||
|
||||
void SetCrossSectionDataStore(G4CrossSectionDataStore* aDataStore)
|
||||
{
|
||||
theCrossSectionDataStore = aDataStore;
|
||||
}
|
||||
|
||||
G4CrossSectionDataStore* GetCrossSectionDataStore()
|
||||
{
|
||||
return theCrossSectionDataStore;
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
// G4HadronicCrossSections theCrossSectionData;
|
||||
G4CrossSectionDataStore* theCrossSectionDataStore;
|
||||
|
||||
G4ParticleDefinition *theParticle;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
// 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: G4HadronicInteraction.hh,v 2.3 1998/08/24 11:47:22 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// Hadronic Interaction abstract base class
|
||||
// This class is the base class for the model classes.
|
||||
// It sorts out the energy-range for the models and provides
|
||||
// class utilities.
|
||||
// original by H.P. Wellisch
|
||||
// Modified by J.L.Chuma, TRIUMF, 21-Mar-1997
|
||||
// Last modified: 3-Apr-1997
|
||||
// Added units to energy initialization: J.L. Chuma 04-Apr-97
|
||||
// Modified by J.L.Chuma, 05-May-97 to Initialize theBlockedCounter
|
||||
// Modified by J.L.Chuma, 08-Jul-97 to implement the Nucleus changes
|
||||
|
||||
#ifndef G4HadronicInteraction_h
|
||||
#define G4HadronicInteraction_h 1
|
||||
|
||||
#include "G4ParticleChange.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4ReactionDynamics.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4Nucleus.hh"
|
||||
#include "G4Track.hh"
|
||||
|
||||
class G4HadronicInteraction
|
||||
{
|
||||
public:
|
||||
|
||||
G4HadronicInteraction() :
|
||||
verboseLevel(0), theMinEnergy(0.0*GeV), theMaxEnergy(25.0*GeV),
|
||||
theBlockedCounter(0), theMinCounter(0), theMaxCounter(0),
|
||||
theMinCounterElements(0), theMaxCounterElements(0),
|
||||
theBlockedCounterElements(0)
|
||||
{ }
|
||||
|
||||
virtual ~G4HadronicInteraction()
|
||||
{ }
|
||||
|
||||
private:
|
||||
|
||||
inline G4HadronicInteraction(
|
||||
const G4HadronicInteraction &right )
|
||||
{ *this = right; }
|
||||
|
||||
inline const G4HadronicInteraction & operator=(
|
||||
const G4HadronicInteraction &right )
|
||||
{
|
||||
if(this!=&right) G4Exception("unintended use of G4HadronicInteraction::operator=");
|
||||
return right;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
inline G4bool operator==(
|
||||
const G4HadronicInteraction &right ) const
|
||||
{ return ( this == (G4HadronicInteraction *) &right ); }
|
||||
|
||||
inline G4bool operator!=(
|
||||
const G4HadronicInteraction &right ) const
|
||||
{ return ( this != (G4HadronicInteraction *) &right ); }
|
||||
|
||||
inline G4double GetMinEnergy() const
|
||||
{ return theMinEnergy; }
|
||||
|
||||
G4double GetMinEnergy( const G4Material *aMaterial,
|
||||
const G4Element *anElement ) const;
|
||||
|
||||
inline void SetMinEnergy( const G4double anEnergy )
|
||||
{ theMinEnergy = anEnergy; }
|
||||
|
||||
void SetMinEnergy( G4double anEnergy,
|
||||
G4Element *anElement );
|
||||
|
||||
void SetMinEnergy( G4double anEnergy,
|
||||
G4Material *aMaterial );
|
||||
|
||||
inline G4double GetMaxEnergy() const
|
||||
{ return theMaxEnergy; }
|
||||
|
||||
G4double GetMaxEnergy( const G4Material *aMaterial,
|
||||
const G4Element *anElement ) const;
|
||||
|
||||
inline void SetMaxEnergy( const G4double anEnergy )
|
||||
{ theMaxEnergy = anEnergy; }
|
||||
|
||||
void SetMaxEnergy( G4double anEnergy,
|
||||
G4Element *anElement );
|
||||
|
||||
void SetMaxEnergy( G4double anEnergy,
|
||||
G4Material *aMaterial );
|
||||
|
||||
inline const G4HadronicInteraction *GetMyPointer() const
|
||||
{ return this; }
|
||||
|
||||
inline G4int GetVerboseLevel() const
|
||||
{ return verboseLevel; }
|
||||
|
||||
inline void SetVerboseLevel( G4int value )
|
||||
{ verboseLevel = value; }
|
||||
|
||||
virtual G4VParticleChange *ApplyYourself(
|
||||
const G4Track &aTrack, G4Nucleus & targetNucleus ) = 0;
|
||||
|
||||
void DeActivateFor( G4Material *aMaterial );
|
||||
|
||||
void DeActivateFor( G4Element *anElement );
|
||||
|
||||
G4bool IsBlocked( const G4Material *aMaterial ) const;
|
||||
|
||||
G4bool IsBlocked( const G4Element *anElement) const;
|
||||
|
||||
protected:
|
||||
|
||||
G4ParticleChange theParticleChange;
|
||||
// the G4VParticleChange object which is modified and returned
|
||||
// by address by the ApplyYourself method,
|
||||
// (instead of aParticleChange as found in G4VProcess)
|
||||
|
||||
G4int verboseLevel;
|
||||
// control flag for output messages
|
||||
// 0: silent
|
||||
// 1: warning messages
|
||||
// 2: more
|
||||
// (instead of verboseLevel as found in G4VProcess)
|
||||
|
||||
G4ReactionDynamics theReactionDynamics;
|
||||
|
||||
// these two have global validity
|
||||
// units are assumed to be MeV
|
||||
|
||||
G4double theMinEnergy;
|
||||
G4double theMaxEnergy;
|
||||
|
||||
private:
|
||||
|
||||
enum { MAX_LIST_SIZE = 500 };
|
||||
|
||||
// the following allow for restrictions/additions for specific materials
|
||||
|
||||
G4double theMinEnergyList[ MAX_LIST_SIZE ];
|
||||
G4Material *theMinMaterials[ MAX_LIST_SIZE ];
|
||||
G4int theMinCounter;
|
||||
|
||||
G4double theMaxEnergyList[ MAX_LIST_SIZE ];
|
||||
G4Material *theMaxMaterials[ MAX_LIST_SIZE ];
|
||||
G4int theMaxCounter;
|
||||
|
||||
G4Material *theBlockedList[ MAX_LIST_SIZE ];
|
||||
G4int theBlockedCounter;
|
||||
|
||||
// the following allow for restrictions/additions for specific elements
|
||||
|
||||
G4double theMinEnergyListElements[ MAX_LIST_SIZE ];
|
||||
G4Element *theMinElements[ MAX_LIST_SIZE ];
|
||||
G4int theMinCounterElements;
|
||||
|
||||
G4double theMaxEnergyListElements[ MAX_LIST_SIZE ];
|
||||
G4Element *theMaxElements[ MAX_LIST_SIZE ];
|
||||
G4int theMaxCounterElements;
|
||||
|
||||
G4Element *theBlockedListElements[ MAX_LIST_SIZE ];
|
||||
G4int theBlockedCounterElements;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,106 @@
|
||||
// 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: G4HadronicProcess.hh,v 2.0 1998/07/02 16:22:13 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// This is the top level Hadronic Process class
|
||||
// The inelastic, elastic, capture, and fission processes
|
||||
// should derive from this class
|
||||
// This is an abstract base class, since the pure virtual function
|
||||
// PostStepDoIt has not been defined yet.
|
||||
// Note: there is no .cc file
|
||||
//
|
||||
// original by H.P.Wellisch
|
||||
// J.L. Chuma, TRIUMF, 10-Mar-1997
|
||||
// Last modified: 04-Apr-1997
|
||||
|
||||
#ifndef G4HadronicProcess_h
|
||||
#define G4HadronicProcess_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VDiscreteProcess.hh"
|
||||
#include "G4EnergyRangeManager.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4Element.hh"
|
||||
#include "G4ElementVector.hh"
|
||||
#include "G4ElementTable.hh"
|
||||
#include "G4PhysicsTable.hh"
|
||||
#include "G4PhysicsVector.hh"
|
||||
#include "G4Nucleus.hh"
|
||||
#include "G4ReactionProduct.hh"
|
||||
|
||||
class G4HadronicProcess : public G4VDiscreteProcess
|
||||
{
|
||||
public:
|
||||
|
||||
G4HadronicProcess( const G4String &processName = "Hadronic" ) :
|
||||
G4VDiscreteProcess( processName )
|
||||
{ }
|
||||
|
||||
virtual ~G4HadronicProcess()
|
||||
{ }
|
||||
|
||||
inline void RegisterMe( G4HadronicInteraction *a )
|
||||
{ GetManagerPointer()->RegisterMe( a ); }
|
||||
|
||||
inline G4HadronicInteraction *GetHadronicInteraction()
|
||||
{ return theInteraction; }
|
||||
|
||||
inline G4HadronicInteraction *ChooseHadronicInteraction(
|
||||
G4double kineticEnergy, G4Material *aMaterial, G4Element *anElement )
|
||||
{ return GetManagerPointer()->
|
||||
GetHadronicInteraction( kineticEnergy, aMaterial, anElement ); }
|
||||
|
||||
inline const G4EnergyRangeManager &GetEnergyRangeManager() const
|
||||
{ return theEnergyRangeManager; }
|
||||
|
||||
inline void SetEnergyRangeManager( const G4EnergyRangeManager &value )
|
||||
{ theEnergyRangeManager = value; }
|
||||
|
||||
G4Element * ChooseAandZ( const G4DynamicParticle *aParticle,
|
||||
const G4Material *aMaterial );
|
||||
|
||||
virtual G4VParticleChange *PostStepDoIt( const G4Track &aTrack,
|
||||
const G4Step &aStep ) = 0;
|
||||
|
||||
G4VParticleChange *GeneralPostStepDoIt( const G4Track &aTrack,
|
||||
const G4Step &aStep );
|
||||
|
||||
void SetDispatch( G4HadronicProcess *value )
|
||||
{ dispatch=value; }
|
||||
|
||||
virtual G4double GetMicroscopicCrossSection( const G4DynamicParticle *aParticle,
|
||||
const G4Element *anElement ) = 0;
|
||||
|
||||
G4double GetCurrentZ()
|
||||
{ return currentZ; }
|
||||
|
||||
G4double GetCurrentN()
|
||||
{ return currentN; }
|
||||
|
||||
protected:
|
||||
|
||||
inline G4EnergyRangeManager *GetManagerPointer()
|
||||
{ return &theEnergyRangeManager; }
|
||||
|
||||
G4EnergyRangeManager theEnergyRangeManager;
|
||||
|
||||
G4HadronicInteraction *theInteraction;
|
||||
|
||||
G4Nucleus targetNucleus;
|
||||
|
||||
private:
|
||||
|
||||
G4double currentZ;
|
||||
G4double currentN;
|
||||
G4HadronicProcess *dispatch;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
// 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: G4InelasticInteraction.hh,v 2.3 1998/07/13 19:03:32 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// Hadronic Process: Inelastic Interaction
|
||||
// This class is an abstract base class, since the pure virtual
|
||||
// function ApplyYourself has not been defined yet.
|
||||
// original by H.P. Wellisch
|
||||
// Modified by J.L. Chuma, TRIUMF, 22-Nov-1996
|
||||
// Modified by J.L. Chuma 27-Mar-1997
|
||||
// Modified by J.L. Chuma 30-Apr-1997
|
||||
// Modified by J.L. Chuma 05-Aug-1997 to pass the original incident particle to
|
||||
// CalculateMomenta
|
||||
// Modified by J.L. Chuma 05-Jun-1998 to include quasiElastic flag to allow for
|
||||
// TwoBody to be called directly, bypassing
|
||||
// TwoCluster, and allowing TwoCluster to be
|
||||
// called with no secondaries
|
||||
|
||||
#ifndef G4InelasticInteraction_h
|
||||
#define G4InelasticInteraction_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4FastVector.hh"
|
||||
#include "G4HadronicInteraction.hh"
|
||||
#include "G4ReactionProduct.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
class G4InelasticInteraction : public G4HadronicInteraction
|
||||
{
|
||||
public:
|
||||
|
||||
G4InelasticInteraction() : G4HadronicInteraction()
|
||||
{ }
|
||||
|
||||
virtual ~G4InelasticInteraction()
|
||||
{ }
|
||||
|
||||
protected:
|
||||
|
||||
G4double Pmltpc( G4int np, G4int nm, G4int nz, G4int n,
|
||||
G4double b, G4double c );
|
||||
|
||||
G4bool MarkLeadingStrangeParticle( const G4ReactionProduct ¤tParticle,
|
||||
const G4ReactionProduct &targetParticle,
|
||||
G4ReactionProduct &leadParticle );
|
||||
|
||||
void SetUpPions( const G4int np, const G4int nm, const G4int nz,
|
||||
G4FastVector<G4ReactionProduct,128> &vec,
|
||||
G4int &vecLen );
|
||||
|
||||
void GetNormalizationConstant( const G4double availableEnergy,
|
||||
G4double &n,
|
||||
G4double &anpn );
|
||||
|
||||
void CalculateMomenta( G4FastVector<G4ReactionProduct,128> &vec,
|
||||
G4int &vecLen,
|
||||
const G4DynamicParticle *originalIncident,
|
||||
const G4DynamicParticle *originalTarget,
|
||||
G4ReactionProduct &modifiedOriginal,
|
||||
G4Nucleus &targetNucleus,
|
||||
G4ReactionProduct ¤tParticle,
|
||||
G4ReactionProduct &targetParticle,
|
||||
G4bool &incidentHasChanged,
|
||||
G4bool &targetHasChanged,
|
||||
G4bool quasiElastic );
|
||||
|
||||
void SetUpChange( G4FastVector<G4ReactionProduct,128> &vec,
|
||||
G4int &vecLen,
|
||||
G4ReactionProduct ¤tParticle,
|
||||
G4ReactionProduct &targetParticle,
|
||||
G4bool &incidentHasChanged );
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
// 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: G4EnergyRangeManager.cc,v 2.3 1998/07/13 17:38:15 fjones Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// Hadronic Process: Energy Range Manager
|
||||
// original by H.P. Wellisch
|
||||
// modified by J.L. Chuma, TRIUMF, 22-Nov-1996
|
||||
// Last modified: 24-Mar-1997
|
||||
// fix in the counter-hndling: H.P. Wellisch 04-Apr-97
|
||||
// throw an exception if no model found: J.L. Chuma 04-Apr-97
|
||||
|
||||
#include "G4EnergyRangeManager.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
G4EnergyRangeManager::G4EnergyRangeManager(
|
||||
const G4EnergyRangeManager &right )
|
||||
{
|
||||
if( this != &right )
|
||||
{
|
||||
for( G4int i=0; i<theHadronicInteractionCounter; ++i )
|
||||
theHadronicInteraction[i] = right.theHadronicInteraction[i];
|
||||
theHadronicInteractionCounter = right.theHadronicInteractionCounter;
|
||||
}
|
||||
}
|
||||
|
||||
G4EnergyRangeManager &
|
||||
G4EnergyRangeManager::operator=(
|
||||
const G4EnergyRangeManager &right )
|
||||
{
|
||||
if( this != &right )
|
||||
{
|
||||
for( G4int i=0; i<theHadronicInteractionCounter; ++i )
|
||||
theHadronicInteraction[i] =
|
||||
right.theHadronicInteraction[i];
|
||||
theHadronicInteractionCounter =
|
||||
right.theHadronicInteractionCounter;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
void
|
||||
G4EnergyRangeManager::RegisterMe(
|
||||
G4HadronicInteraction *a )
|
||||
{
|
||||
if( theHadronicInteractionCounter+1 > MAX_NUMBER_OF_MODELS )
|
||||
G4Exception(
|
||||
"EnergyRangeManager::RegisterMe: TOO MANY MODELS");
|
||||
theHadronicInteraction[ theHadronicInteractionCounter++ ] = a;
|
||||
}
|
||||
|
||||
G4HadronicInteraction *
|
||||
G4EnergyRangeManager::GetHadronicInteraction(
|
||||
const G4double kineticEnergy,
|
||||
const G4Material *aMaterial,
|
||||
const G4Element *anElement ) const
|
||||
{
|
||||
G4int counter = GetHadronicInteractionCounter();
|
||||
if( counter == 0 )
|
||||
G4Exception("GetHadronicInteraction: NO MODELS STORED");
|
||||
|
||||
G4int cou = 0, memory = 0, memor2 = 0;
|
||||
G4double emi1 = 0.0, ema1 = 0.0, emi2 = 0.0, ema2 = 0.0;
|
||||
for( G4int i=0; i<counter; i++ ) {
|
||||
G4double low = theHadronicInteraction[i]->GetMinEnergy( aMaterial, anElement );
|
||||
// Work-around for particles with 0 kinetic energy, which still
|
||||
// require a model to return a ParticleChange
|
||||
if (low == 0.) low = -DBL_MIN;
|
||||
G4double high = theHadronicInteraction[i]->GetMaxEnergy( aMaterial, anElement );
|
||||
if( low < kineticEnergy && high >= kineticEnergy )
|
||||
{
|
||||
++cou;
|
||||
emi2 = emi1;
|
||||
ema2 = ema1;
|
||||
emi1 = low;
|
||||
ema1 = high;
|
||||
memor2 = memory;
|
||||
memory = i;
|
||||
}
|
||||
}
|
||||
G4int m;
|
||||
G4double rand;
|
||||
switch ( cou )
|
||||
{
|
||||
case 0:
|
||||
G4Exception("GetHadronicInteraction: No model found for this energy range");
|
||||
return 0;
|
||||
case 1:
|
||||
m = memory;
|
||||
break;
|
||||
case 2:
|
||||
if( (emi2<=emi1 && ema2>=ema1) || (emi2>=emi1 && ema2<=ema1) )
|
||||
G4Exception(
|
||||
"GetHadronicInteraction: Energy ranges of two models fully overlapping");
|
||||
rand = G4UniformRand();
|
||||
if( emi1 < emi2 )
|
||||
{
|
||||
if( (ema1-kineticEnergy)/(ema1-emi2)<rand )
|
||||
m = memory;
|
||||
else
|
||||
m = memor2;
|
||||
} else {
|
||||
if( (ema2-kineticEnergy)/(ema2-emi1)<rand )
|
||||
m = memor2;
|
||||
else
|
||||
m = memory;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
G4Exception(
|
||||
"GetHadronicInteraction: More than two competing models in this energy range");
|
||||
}
|
||||
return theHadronicInteraction[m];
|
||||
}
|
||||
|
||||
/* end of file */
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
// 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: G4HadronInelasticProcess.cc,v 2.1 1998/08/24 11:56:59 hpw Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// Hadronic Inelastic Process Class
|
||||
// J.L. Chuma, TRIUMF, 24-Mar-1997
|
||||
// Last modified: 27-Mar-1997
|
||||
// J.P. Wellisch: Bug hunting, 23-Apr-97
|
||||
// Modified by J.L.Chuma 8-Jul-97 to eliminate possible division by zero for sigma
|
||||
//
|
||||
// 14-APR-98 F.W.Jones: variant G4HadronInelastic process for
|
||||
// G4CrossSectionDataSet/DataStore class design.
|
||||
//
|
||||
// 17-JUN-98 F.W.Jones: removed extraneous code causing core dump.
|
||||
//
|
||||
|
||||
#include "G4HadronInelasticProcess.hh"
|
||||
|
||||
G4double G4HadronInelasticProcess::GetMeanFreePath(
|
||||
const G4Track &aTrack,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition *condition )
|
||||
{
|
||||
const G4DynamicParticle *aParticle = aTrack.GetDynamicParticle();
|
||||
if( aParticle->GetDefinition() != theParticle )
|
||||
G4Exception( this->GetProcessName()+
|
||||
" called for "+
|
||||
aParticle->GetDefinition()->GetParticleName() );
|
||||
G4Material *aMaterial = aTrack.GetMaterial();
|
||||
G4int nElements = aMaterial->GetNumberOfElements();
|
||||
|
||||
// returns the mean free path in GEANT4 internal units
|
||||
|
||||
const RWTPtrVector<G4Element> *theElementVector =
|
||||
aMaterial->GetElementVector();
|
||||
|
||||
const G4double *theAtomicNumDensityVector =
|
||||
aMaterial->GetAtomicNumDensityVector();
|
||||
|
||||
G4Element *anElement = (*theElementVector)[0];
|
||||
G4int j = anElement->GetIndex();
|
||||
|
||||
// This apparently should not be here (not useful and dumps core)
|
||||
// FWJ 17-JUN-1998
|
||||
// G4bool isOutRange;
|
||||
// G4double xSection = (*((*thePhysicsTable)(j))).GetValue(
|
||||
// aParticle->GetTotalMomentum()/GeV, isOutRange );
|
||||
|
||||
G4double sigma = 0.0;
|
||||
for( G4int i=0; i<nElements; ++i )
|
||||
{
|
||||
G4double xSection =
|
||||
GetMicroscopicCrossSection( aParticle, (*theElementVector)[i] );
|
||||
sigma += theAtomicNumDensityVector[i] * xSection;
|
||||
}
|
||||
if( sigma > 0.0 )
|
||||
return 1.0/sigma;
|
||||
else
|
||||
return DBL_MAX;
|
||||
}
|
||||
|
||||
void
|
||||
G4HadronInelasticProcess::BuildThePhysicsTable()
|
||||
{
|
||||
if (!theCrossSectionDataStore) {
|
||||
// G4Exception("G4HadronInelasticProcess::BuildThePhysicsTable: "
|
||||
// "no CrossSectionDataStore");
|
||||
return;
|
||||
}
|
||||
|
||||
theCrossSectionDataStore->BuildPhysicsTable(*theParticle);
|
||||
|
||||
// G4int numberOfElements = G4Element::GetNumberOfElements();
|
||||
// thePhysicsTable = new G4PhysicsTable( numberOfElements );
|
||||
//
|
||||
// // make a PhysicsVector for each element
|
||||
//
|
||||
// static const G4ElementTable *theElementTable = G4Element::GetElementTable();
|
||||
// for( G4int i=0; i<numberOfElements; ++i )
|
||||
// (*thePhysicsTable)(i) =
|
||||
// theCrossSectionData.MakePhysicsVector( *this, *theParticle,
|
||||
// (*theElementTable)[i] );
|
||||
}
|
||||
|
||||
G4double G4HadronInelasticProcess::GetMicroscopicCrossSection(
|
||||
const G4DynamicParticle *aParticle,
|
||||
const G4Element *anElement)
|
||||
{
|
||||
// returns the microscopic cross section in GEANT4 internal units
|
||||
|
||||
if (!theCrossSectionDataStore) {
|
||||
G4Exception("G4HadronInelasticProcess::GetMicroscopicCrossSection:"
|
||||
"no CrossSectionDataStore");
|
||||
return DBL_MIN;
|
||||
}
|
||||
return theCrossSectionDataStore->GetCrossSection(aParticle, anElement);
|
||||
|
||||
// G4bool isOutRange;
|
||||
// G4int j = anElement->GetIndex();
|
||||
//
|
||||
// G4double s = (*((*thePhysicsTable)(j))).GetValue(
|
||||
// aParticle->GetTotalMomentum()/GeV, isOutRange );
|
||||
// return s;
|
||||
}
|
||||
|
||||
/* end of file */
|
||||
@@ -0,0 +1,206 @@
|
||||
// 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: G4HadronicInteraction.cc,v 2.2 1998/07/13 17:22:13 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// Hadronic Interaction base class
|
||||
// original by H.P. Wellisch
|
||||
// modified by J.L. Chuma, TRIUMF, 21-Mar-1997
|
||||
// Last modified: 04-Apr-1997
|
||||
|
||||
#include "G4HadronicInteraction.hh"
|
||||
|
||||
G4double
|
||||
G4HadronicInteraction::GetMinEnergy(
|
||||
const G4Material *aMaterial, const G4Element *anElement ) const
|
||||
{
|
||||
G4int i;
|
||||
if( IsBlocked(aMaterial) )return 0.*GeV;
|
||||
if( IsBlocked(anElement) )return 0.*GeV;
|
||||
for( i=0; i<theMinCounterElements; ++i )
|
||||
{
|
||||
if( anElement == theMinElements[i] )return theMinEnergyListElements[i];
|
||||
}
|
||||
for( i=0; i<theMinCounter; ++i )
|
||||
{
|
||||
if( aMaterial == theMinMaterials[i] )return theMinEnergyList[i];
|
||||
}
|
||||
if( verboseLevel > 0 )
|
||||
G4cout << "*** Warning from HadronicInteraction::GetMinEnergy" << endl
|
||||
<< " material " << aMaterial->GetName()
|
||||
<< " not found in min energy List" << endl;
|
||||
return theMinEnergy;
|
||||
}
|
||||
|
||||
void
|
||||
G4HadronicInteraction::SetMinEnergy(
|
||||
G4double anEnergy,
|
||||
G4Element *anElement )
|
||||
{
|
||||
if( IsBlocked(anElement) )
|
||||
G4cout << "*** Warning from HadronicInteraction::SetMinEnergy" << endl
|
||||
<< " The model is not active for the Element "
|
||||
<< anElement->GetName() << "." << endl;
|
||||
|
||||
for( G4int i=0; i<theMinCounterElements; ++i )
|
||||
{
|
||||
if( anElement == theMinElements[i] )
|
||||
{
|
||||
theMinEnergyListElements[i] = anEnergy;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if( theMinCounterElements == MAX_LIST_SIZE )
|
||||
G4Exception("SetMinEnergy: exceeded size of min energy element List");
|
||||
theMinElements[theMinCounterElements] = anElement;
|
||||
theMinEnergyListElements[theMinCounterElements++] = anEnergy;
|
||||
}
|
||||
|
||||
void
|
||||
G4HadronicInteraction::SetMinEnergy(
|
||||
G4double anEnergy,
|
||||
G4Material *aMaterial )
|
||||
{
|
||||
if( IsBlocked(aMaterial) )
|
||||
G4cout << "*** Warning from HadronicInteraction::SetMinEnergy" << endl
|
||||
<< " The model is not active for the Material "
|
||||
<< aMaterial->GetName() << "." << endl;
|
||||
|
||||
for( G4int i=0; i<theMinCounter; ++i )
|
||||
{
|
||||
if( aMaterial == theMinMaterials[i] )
|
||||
{
|
||||
theMinEnergyList[i] = anEnergy;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if( theMinCounter == MAX_LIST_SIZE )
|
||||
G4Exception("SetMinEnergy: exceeded size of min energy material List");
|
||||
theMinMaterials[theMinCounter] = aMaterial;
|
||||
theMinEnergyList[theMinCounter++] = anEnergy;
|
||||
}
|
||||
|
||||
G4double
|
||||
G4HadronicInteraction::GetMaxEnergy(
|
||||
const G4Material *aMaterial, const G4Element *anElement ) const
|
||||
{
|
||||
G4int i;
|
||||
if( IsBlocked(aMaterial) )return 0.0*GeV;
|
||||
if( IsBlocked(anElement) )return 0.0*GeV;
|
||||
for( i=0; i<theMaxCounterElements; ++i )
|
||||
{
|
||||
if( anElement == theMaxElements[i] )return theMaxEnergyListElements[i];
|
||||
}
|
||||
for( i=0; i<theMaxCounter; ++i )
|
||||
{
|
||||
if( aMaterial == theMaxMaterials[i] )return theMaxEnergyList[i];
|
||||
}
|
||||
if( verboseLevel > 0 )
|
||||
G4cout << "*** Warning from HadronicInteraction::GetMaxEnergy" << endl
|
||||
<< " material " << aMaterial->GetName()
|
||||
<< " not found in min energy List" << endl;
|
||||
|
||||
return theMaxEnergy;
|
||||
}
|
||||
|
||||
void
|
||||
G4HadronicInteraction::SetMaxEnergy(
|
||||
G4double anEnergy,
|
||||
G4Element *anElement )
|
||||
{
|
||||
if( IsBlocked(anElement) )
|
||||
G4cout << "*** Warning from HadronicInteraction::SetMaxEnergy" << endl
|
||||
<< "Warning: The model is not active for the Element "
|
||||
<< anElement->GetName() << "." << endl;
|
||||
|
||||
for( G4int i=0; i<theMaxCounterElements; ++i )
|
||||
{
|
||||
if( anElement == theMaxElements[i] )
|
||||
{
|
||||
theMaxEnergyListElements[i] = anEnergy;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if( theMaxCounterElements == MAX_LIST_SIZE )
|
||||
G4Exception("SetMaxEnergy: exceeded size of max energy element List");
|
||||
theMaxElements[theMaxCounterElements] = anElement;
|
||||
theMaxEnergyListElements[theMaxCounterElements++] = anEnergy;
|
||||
}
|
||||
|
||||
void
|
||||
G4HadronicInteraction::SetMaxEnergy(
|
||||
G4double anEnergy,
|
||||
G4Material *aMaterial )
|
||||
{
|
||||
if( IsBlocked(aMaterial) )
|
||||
G4cout << "*** Warning from HadronicInteraction::SetMaxEnergy" << endl
|
||||
<< "Warning: The model is not active for the Material "
|
||||
<< aMaterial->GetName() << "." << endl;
|
||||
|
||||
for( G4int i=0; i<theMaxCounter; ++i )
|
||||
{
|
||||
if( aMaterial == theMaxMaterials[i] )
|
||||
{
|
||||
theMaxEnergyList[i] = anEnergy;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if( theMaxCounter == MAX_LIST_SIZE )
|
||||
G4Exception("SetMaxEnergy: exceeded size of max energy material List");
|
||||
theMaxMaterials[theMaxCounter] = aMaterial;
|
||||
theMaxEnergyList[theMaxCounter++] = anEnergy;
|
||||
}
|
||||
|
||||
void
|
||||
G4HadronicInteraction::DeActivateFor( G4Material *aMaterial )
|
||||
{
|
||||
if( theBlockedCounter == MAX_LIST_SIZE )
|
||||
G4Exception("DeActivateFor: exceeded size of blocked material List");
|
||||
theBlockedList[ theBlockedCounter++ ] = aMaterial;
|
||||
}
|
||||
|
||||
void
|
||||
G4HadronicInteraction::DeActivateFor( G4Element *anElement )
|
||||
{
|
||||
if( theBlockedCounterElements == MAX_LIST_SIZE )
|
||||
G4Exception("DeActivateFor: exceeded size of blocked elements List");
|
||||
theBlockedListElements[ theBlockedCounterElements++ ] = anElement;
|
||||
}
|
||||
|
||||
G4bool
|
||||
G4HadronicInteraction::IsBlocked( const G4Material *aMaterial ) const
|
||||
{
|
||||
G4bool tt = false;
|
||||
for( G4int i=0; i<theBlockedCounter; ++i )
|
||||
{
|
||||
if( aMaterial == theBlockedList[i] )
|
||||
{
|
||||
tt = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return tt;
|
||||
}
|
||||
|
||||
G4bool
|
||||
G4HadronicInteraction::IsBlocked( const G4Element *anElement ) const
|
||||
{
|
||||
G4bool tt = false;
|
||||
for( G4int i=0; i<theBlockedCounterElements; ++i )
|
||||
{
|
||||
if( anElement == theBlockedListElements[i] )
|
||||
{
|
||||
tt = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return tt;
|
||||
}
|
||||
|
||||
/* end of file */
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
// 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: G4HadronicProcess.cc,v 2.0 1998/07/02 16:22:25 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// HPW to implement the choosing of an element for scattering.
|
||||
#include "G4HadronicProcess.hh"
|
||||
|
||||
G4Element * G4HadronicProcess::ChooseAandZ(
|
||||
const G4DynamicParticle *aParticle, const G4Material *aMaterial )
|
||||
{
|
||||
currentZ = 0;
|
||||
currentN = 0;
|
||||
const G4int numberOfElements = aMaterial->GetNumberOfElements();
|
||||
const G4ElementVector *theElementVector = aMaterial->GetElementVector();
|
||||
|
||||
if( numberOfElements == 1 )
|
||||
{
|
||||
currentZ = G4double((*theElementVector)(0)->GetZ());
|
||||
currentN = (*theElementVector)(0)->GetN();
|
||||
targetNucleus.SetParameters(currentN, currentZ);
|
||||
return (*theElementVector)(0);
|
||||
}
|
||||
|
||||
const G4double *theAtomicNumberDensity = aMaterial->GetAtomicNumDensityVector();
|
||||
G4double crossSectionTotal = 0;
|
||||
G4int i;
|
||||
for( i=0; i < numberOfElements; ++i )
|
||||
crossSectionTotal += theAtomicNumberDensity[i] *
|
||||
dispatch->GetMicroscopicCrossSection( aParticle, (*theElementVector)(i) );
|
||||
|
||||
G4double crossSectionSum= 0.;
|
||||
G4double random = G4UniformRand()*crossSectionTotal;
|
||||
for( i=0; i < numberOfElements; ++i )
|
||||
{
|
||||
crossSectionSum += theAtomicNumberDensity[i] *
|
||||
dispatch->GetMicroscopicCrossSection( aParticle, (*theElementVector)(i) );
|
||||
if( random<=crossSectionSum )
|
||||
{
|
||||
currentZ = G4double((*theElementVector)(i)->GetZ());
|
||||
currentN = (*theElementVector)(i)->GetN();
|
||||
targetNucleus.SetParameters(currentN, currentZ);
|
||||
return (*theElementVector)(i);
|
||||
}
|
||||
}
|
||||
currentZ = G4double((*theElementVector)(numberOfElements-1)->GetZ());
|
||||
currentN = (*theElementVector)(numberOfElements-1)->GetN();
|
||||
targetNucleus.SetParameters(currentN, currentZ);
|
||||
return (*theElementVector)(numberOfElements-1);
|
||||
}
|
||||
|
||||
G4VParticleChange *G4HadronicProcess::GeneralPostStepDoIt(
|
||||
const G4Track &aTrack, const G4Step &aStep )
|
||||
{
|
||||
const G4DynamicParticle *aParticle = aTrack.GetDynamicParticle();
|
||||
G4Material *aMaterial = aTrack.GetMaterial();
|
||||
G4double kineticEnergy = aParticle->GetKineticEnergy();
|
||||
G4Element * anElement = ChooseAandZ( aParticle, aMaterial );
|
||||
theInteraction = ChooseHadronicInteraction( kineticEnergy,
|
||||
aMaterial, anElement );
|
||||
G4VParticleChange *result =
|
||||
theInteraction->ApplyYourself( aTrack, targetNucleus);
|
||||
ResetNumberOfInteractionLengthLeft();
|
||||
return result;
|
||||
}
|
||||
|
||||
/* end of file */
|
||||
@@ -0,0 +1,365 @@
|
||||
// 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.
|
||||
//
|
||||
//
|
||||
// Hadronic Process: Inelastic Interaction
|
||||
// original by H.P. Wellisch
|
||||
// modified by J.L. Chuma, TRIUMF, 22-Nov-1996
|
||||
// Last modified: 27-Mar-1997
|
||||
// J.P. Wellisch: 23-Apr-97: G4Exception removed
|
||||
// J.P. Wellisch: 24-Apr-97: correction for SetUpPions
|
||||
// Modified by J.L. Chuma, 30-Apr-97: added originalTarget to CalculateMomenta
|
||||
// since TwoBody needed to reset the target particle
|
||||
// J.L. Chuma, 20-Jun-97: Modified CalculateMomenta to correct the decision process
|
||||
// for whether to use GenerateXandPt or TwoCluster
|
||||
// J.L. Chuma, 06-Aug-97: added original incident particle, before Fermi motion and
|
||||
// evaporation effects are included, needed for calculating
|
||||
// self absorption and corrections for single particle spectra
|
||||
// HPW removed misunderstanding of LocalEnergyDeposit, 11.04.98.
|
||||
|
||||
#include "G4InelasticInteraction.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
G4double
|
||||
G4InelasticInteraction::Pmltpc( // used in Cascade functions
|
||||
G4int np, G4int nm, G4int nz, G4int n, G4double b, G4double c )
|
||||
{
|
||||
const G4double expxu = 82.; // upper bound for arg. of exp
|
||||
const G4double expxl = -expxu; // lower bound for arg. of exp
|
||||
G4double npf = 0.0;
|
||||
G4double nmf = 0.0;
|
||||
G4double nzf = 0.0;
|
||||
G4int i;
|
||||
for( i=2; i<=np; i++ )npf += log((double)i);
|
||||
for( i=2; i<=nm; i++ )nmf += log((double)i);
|
||||
for( i=2; i<=nz; i++ )nzf += log((double)i);
|
||||
G4double r;
|
||||
r = min( expxu, max( expxl, -(np-nm+nz+b)*(np-nm+nz+b)/(2*c*c*n*n)-npf-nmf-nzf ) );
|
||||
return exp(r);
|
||||
}
|
||||
|
||||
G4bool
|
||||
G4InelasticInteraction::MarkLeadingStrangeParticle(
|
||||
const G4ReactionProduct ¤tParticle,
|
||||
const G4ReactionProduct &targetParticle,
|
||||
G4ReactionProduct &leadParticle )
|
||||
{
|
||||
// the following was in GenerateXandPt and TwoCluster
|
||||
// add a parameter to the GenerateXandPt function telling it about the strange particle
|
||||
//
|
||||
// assumes that the original particle was a strange particle
|
||||
//
|
||||
G4bool lead = false;
|
||||
if( (currentParticle.GetMass() >= G4KaonPlus::KaonPlus()->GetPDGMass()) &&
|
||||
(currentParticle.GetDefinition() != G4Proton::Proton()) &&
|
||||
(currentParticle.GetDefinition() != G4Neutron::Neutron()) )
|
||||
{
|
||||
lead = true;
|
||||
leadParticle = currentParticle; // set lead to the incident particle
|
||||
}
|
||||
else if( (targetParticle.GetMass() >= G4KaonPlus::KaonPlus()->GetPDGMass()) &&
|
||||
(targetParticle.GetDefinition() != G4Proton::Proton()) &&
|
||||
(targetParticle.GetDefinition() != G4Neutron::Neutron()) )
|
||||
{
|
||||
lead = true;
|
||||
leadParticle = targetParticle; // set lead to the target particle
|
||||
}
|
||||
return lead;
|
||||
}
|
||||
|
||||
void
|
||||
G4InelasticInteraction::SetUpPions(
|
||||
const G4int np,
|
||||
const G4int nm,
|
||||
const G4int nz,
|
||||
G4FastVector<G4ReactionProduct,128> &vec,
|
||||
G4int &vecLen )
|
||||
{
|
||||
if( np+nm+nz == 0 )return;
|
||||
G4int i;
|
||||
G4ReactionProduct *p = new G4ReactionProduct [np+nm+nz];
|
||||
for( i=0; i<np; ++i )
|
||||
{
|
||||
p[i].SetDefinition( G4PionPlus::PionPlus() );
|
||||
(G4UniformRand() < 0.5) ? p[i].SetSide( -1 ) : p[i].SetSide( 1 );
|
||||
vec.SetElement( vecLen++, &p[i] );
|
||||
}
|
||||
for( i=np; i<np+nm; ++i )
|
||||
{
|
||||
p[i].SetDefinition( G4PionMinus::PionMinus() );
|
||||
(G4UniformRand() < 0.5) ? p[i].SetSide( -1 ) : p[i].SetSide( 1 );
|
||||
vec.SetElement( vecLen++, &p[i] );
|
||||
}
|
||||
for( i=np+nm; i<np+nm+nz; ++i )
|
||||
{
|
||||
p[i].SetDefinition( G4PionZero::PionZero() );
|
||||
(G4UniformRand() < 0.5) ? p[i].SetSide( -1 ) : p[i].SetSide( 1 );
|
||||
vec.SetElement( vecLen++, &p[i] );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
G4InelasticInteraction::GetNormalizationConstant(
|
||||
const G4double energy, // MeV, <0 means annihilation channels
|
||||
G4double &n,
|
||||
G4double &anpn )
|
||||
{
|
||||
const G4double expxu = 82.; // upper bound for arg. of exp
|
||||
const G4double expxl = -expxu; // lower bound for arg. of exp
|
||||
const G4int numSec = 60;
|
||||
//
|
||||
// the only difference between the calculation for annihilation channels
|
||||
// and normal is the starting value, iBegin, for the loop below
|
||||
//
|
||||
G4int iBegin = 1;
|
||||
G4double en = energy;
|
||||
if( energy < 0.0 )
|
||||
{
|
||||
iBegin = 2;
|
||||
en *= -1.0;
|
||||
}
|
||||
//
|
||||
// number of total particles vs. centre of mass Energy - 2*proton mass
|
||||
//
|
||||
G4double aleab = log(en/GeV);
|
||||
n = 3.62567 + aleab*(0.665843 + aleab*(0.336514 + aleab*(0.117712 + 0.0136912*aleab)));
|
||||
n -= 2.0;
|
||||
//
|
||||
// normalization constant for kno-distribution
|
||||
//
|
||||
anpn = 0.0;
|
||||
G4double test, temp;
|
||||
for( G4int i=iBegin; i<=numSec; ++i )
|
||||
{
|
||||
temp = pi*i/(2.0*n*n);
|
||||
test = exp( min( expxu, max( expxl, -(pi/4.0)*(i*i)/(n*n) ) ) );
|
||||
if( temp < 1.0 )
|
||||
{
|
||||
if( test >= 1.0e-10 )anpn += temp*test;
|
||||
}
|
||||
else
|
||||
anpn += temp*test;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
G4InelasticInteraction::CalculateMomenta(
|
||||
G4FastVector<G4ReactionProduct,128> &vec,
|
||||
G4int &vecLen,
|
||||
const G4DynamicParticle *originalIncident, // the original incident particle
|
||||
const G4DynamicParticle *originalTarget,
|
||||
G4ReactionProduct &modifiedOriginal, // Fermi motion and evap. effects included
|
||||
G4Nucleus &targetNucleus,
|
||||
G4ReactionProduct ¤tParticle,
|
||||
G4ReactionProduct &targetParticle,
|
||||
G4bool &incidentHasChanged,
|
||||
G4bool &targetHasChanged,
|
||||
G4bool quasiElastic )
|
||||
{
|
||||
theReactionDynamics.ProduceStrangeParticlePairs( vec, vecLen,
|
||||
modifiedOriginal, originalTarget,
|
||||
currentParticle, targetParticle,
|
||||
incidentHasChanged, targetHasChanged );
|
||||
if( quasiElastic )
|
||||
{
|
||||
theReactionDynamics.TwoBody( vec, vecLen,
|
||||
modifiedOriginal, originalTarget,
|
||||
currentParticle, targetParticle,
|
||||
targetNucleus, targetHasChanged );
|
||||
return;
|
||||
}
|
||||
G4ReactionProduct leadingStrangeParticle;
|
||||
G4bool leadFlag = MarkLeadingStrangeParticle( currentParticle,
|
||||
targetParticle,
|
||||
leadingStrangeParticle );
|
||||
//
|
||||
// Note: the number of secondaries can be reduced in GenerateXandPt and TwoCluster
|
||||
//
|
||||
G4bool finishedGenXPt = false;
|
||||
G4bool annihilation = false;
|
||||
if( originalIncident->GetDefinition()->GetPDGEncoding() < 0 &&
|
||||
currentParticle.GetMass() == 0.0 && targetParticle.GetMass() == 0.0 )
|
||||
{
|
||||
// original was an anti-particle and annihilation has taken place
|
||||
annihilation = true;
|
||||
G4double ekcor = 1.0;
|
||||
G4double ek = originalIncident->GetKineticEnergy()/GeV;
|
||||
const G4double tarmas = originalTarget->GetDefinition()->GetPDGMass()/GeV;
|
||||
if( ek > 1.0 )ekcor = 1./ek;
|
||||
const G4double atomicWeight = targetNucleus.GetN();
|
||||
ek = 2*tarmas + ek*(1.+ekcor/atomicWeight);
|
||||
modifiedOriginal.SetKineticEnergy( ek*GeV );
|
||||
//
|
||||
// evaporation -- re-calculate black track energies
|
||||
// this was Done already just before the cascade
|
||||
//
|
||||
G4double tkin = targetNucleus.EvaporationEffects( ek*GeV )/GeV;
|
||||
ek -= tkin;
|
||||
ek = max( 0.0001, ek );
|
||||
modifiedOriginal.SetKineticEnergy( ek*GeV );
|
||||
G4double amas = originalIncident->GetDefinition()->GetPDGMass()/GeV;
|
||||
G4double et = ek + amas;
|
||||
G4double p = sqrt( abs(et*et-amas*amas) );
|
||||
G4double pp = modifiedOriginal.GetMomentum().mag()/GeV;
|
||||
if( pp > 0.0 )
|
||||
{
|
||||
G4ThreeVector momentum = modifiedOriginal.GetMomentum();
|
||||
modifiedOriginal.SetMomentum( momentum * (p/pp) );
|
||||
}
|
||||
if( ek <= 0.0001 )
|
||||
{
|
||||
modifiedOriginal.SetKineticEnergy( 0.0 );
|
||||
modifiedOriginal.SetMomentum( 0.0, 0.0, 0.0 );
|
||||
}
|
||||
}
|
||||
const G4double twsup[] = { 1.0, 0.7, 0.5, 0.3, 0.2, 0.1 };
|
||||
G4double rand1 = G4UniformRand();
|
||||
G4double rand2 = G4UniformRand();
|
||||
if( annihilation || (vecLen >= 6) ||
|
||||
(modifiedOriginal.GetKineticEnergy()/GeV >= 1.0) &&
|
||||
(((originalIncident->GetDefinition() == G4KaonPlus::KaonPlus() ||
|
||||
originalIncident->GetDefinition() == G4KaonMinus::KaonMinus() ||
|
||||
originalIncident->GetDefinition() == G4KaonZeroLong::KaonZeroLong() ||
|
||||
originalIncident->GetDefinition() == G4KaonZeroShort::KaonZeroShort()) &&
|
||||
rand1 < 0.5) || rand2 > twsup[vecLen]) )
|
||||
finishedGenXPt =
|
||||
theReactionDynamics.GenerateXandPt( vec, vecLen,
|
||||
modifiedOriginal, originalIncident,
|
||||
currentParticle, targetParticle,
|
||||
targetNucleus, incidentHasChanged,
|
||||
targetHasChanged, leadFlag,
|
||||
leadingStrangeParticle );
|
||||
if( finishedGenXPt )return;
|
||||
G4bool finishedTwoClu = false;
|
||||
if( modifiedOriginal.GetTotalMomentum()/MeV < 1.0 )vecLen = 0;
|
||||
else
|
||||
{
|
||||
theReactionDynamics.SuppressChargedPions( vec, vecLen,
|
||||
modifiedOriginal, currentParticle,
|
||||
targetParticle, targetNucleus,
|
||||
incidentHasChanged, targetHasChanged );
|
||||
finishedTwoClu = theReactionDynamics.TwoCluster( vec, vecLen,
|
||||
modifiedOriginal, originalIncident,
|
||||
currentParticle, targetParticle,
|
||||
targetNucleus, incidentHasChanged,
|
||||
targetHasChanged, leadFlag,
|
||||
leadingStrangeParticle );
|
||||
}
|
||||
if( finishedTwoClu )return;
|
||||
//
|
||||
// PNBlackTrackEnergy is the kinetic energy available for
|
||||
// proton/neutron black track particles [was enp(1) in fortran code]
|
||||
// DTABlackTrackEnergy is the kinetic energy available for
|
||||
// deuteron/triton/alpha particles [was enp(3) in fortran code]
|
||||
//const G4double pnCutOff = 0.1;
|
||||
//const G4double dtaCutOff = 0.1;
|
||||
//if( (targetNucleus.GetN() >= 1.5)
|
||||
// && !(incidentHasChanged || targetHasChanged)
|
||||
// && (targetNucleus.GetPNBlackTrackEnergy()/MeV <= pnCutOff)
|
||||
// && (targetNucleus.GetDTABlackTrackEnergy()/MeV <= dtaCutOff) )
|
||||
//{
|
||||
// the atomic weight of the target nucleus is >= 1.5 AND
|
||||
// neither the incident nor the target particles have changed AND
|
||||
// there is no kinetic energy available for either proton/neutron
|
||||
// or for deuteron/triton/alpha black track particles
|
||||
// For diffraction scattering on heavy nuclei use elastic routines instead
|
||||
//G4cerr << "*** Error in G4InelasticInteraction::CalculateMomenta" << endl;
|
||||
//G4cerr << "*** the elastic scattering would be better here ***" <<endl;
|
||||
//}
|
||||
theReactionDynamics.TwoBody( vec, vecLen,
|
||||
modifiedOriginal, originalTarget,
|
||||
currentParticle, targetParticle,
|
||||
targetNucleus, targetHasChanged );
|
||||
}
|
||||
|
||||
void
|
||||
G4InelasticInteraction::SetUpChange(
|
||||
G4FastVector<G4ReactionProduct,128> &vec,
|
||||
G4int &vecLen,
|
||||
G4ReactionProduct ¤tParticle,
|
||||
G4ReactionProduct &targetParticle,
|
||||
G4bool &incidentHasChanged )
|
||||
{
|
||||
G4ParticleDefinition *aKaonZL = G4KaonZeroLong::KaonZeroLong();
|
||||
G4ParticleDefinition *aKaonZS = G4KaonZeroShort::KaonZeroShort();
|
||||
G4int i;
|
||||
if( currentParticle.GetDefinition() == aKaonZL )
|
||||
{
|
||||
if( G4UniformRand() <= 0.5 )
|
||||
{
|
||||
currentParticle.SetDefinition( aKaonZS );
|
||||
incidentHasChanged = true;
|
||||
}
|
||||
}
|
||||
else if( currentParticle.GetDefinition() == aKaonZS )
|
||||
{
|
||||
if( G4UniformRand() > 0.5 )
|
||||
{
|
||||
currentParticle.SetDefinition( aKaonZL );
|
||||
incidentHasChanged = true;
|
||||
}
|
||||
}
|
||||
if( targetParticle.GetDefinition() == aKaonZL )
|
||||
{
|
||||
if( G4UniformRand() <= 0.5 )targetParticle.SetDefinition( aKaonZS );
|
||||
}
|
||||
else if( targetParticle.GetDefinition() == aKaonZS )
|
||||
{
|
||||
if( G4UniformRand() > 0.5 )targetParticle.SetDefinition( aKaonZL );
|
||||
}
|
||||
for( i=0; i<vecLen; ++i )
|
||||
{
|
||||
if( vec[i]->GetDefinition() == aKaonZL )
|
||||
{
|
||||
if( G4UniformRand() <= 0.5 )vec[i]->SetDefinition( aKaonZS );
|
||||
}
|
||||
else if( vec[i]->GetDefinition() == aKaonZS )
|
||||
{
|
||||
if( G4UniformRand() > 0.5 )vec[i]->SetDefinition( aKaonZL );
|
||||
}
|
||||
}
|
||||
if( incidentHasChanged )
|
||||
{
|
||||
theParticleChange.SetNumberOfSecondaries( vecLen+2 );
|
||||
G4DynamicParticle* p0 = new G4DynamicParticle;
|
||||
p0->SetDefinition( currentParticle.GetDefinition() );
|
||||
p0->SetMomentum( currentParticle.GetMomentum() );
|
||||
theParticleChange.AddSecondary( p0 );
|
||||
theParticleChange.SetStatusChange( fStopAndKill );
|
||||
theParticleChange.SetEnergyChange( 0.0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
theParticleChange.SetNumberOfSecondaries( vecLen+1 );
|
||||
G4double p = currentParticle.GetMomentum().mag()/MeV;
|
||||
G4ThreeVector m = currentParticle.GetMomentum();
|
||||
if( p > DBL_MIN )
|
||||
theParticleChange.SetMomentumChange( m.x()/p, m.y()/p, m.z()/p );
|
||||
else
|
||||
theParticleChange.SetMomentumChange( 0.0, 0.0, 0.0 );
|
||||
|
||||
theParticleChange.SetEnergyChange( currentParticle.GetKineticEnergy() );
|
||||
}
|
||||
if( targetParticle.GetMass() > 0.0 ) // targetParticle can be eliminated in TwoBody
|
||||
{
|
||||
G4DynamicParticle *p1 = new G4DynamicParticle;
|
||||
p1->SetDefinition( targetParticle.GetDefinition() );
|
||||
p1->SetMomentum( targetParticle.GetMomentum() );
|
||||
theParticleChange.AddSecondary( p1 );
|
||||
}
|
||||
G4DynamicParticle *p;
|
||||
for( i=0; i<vecLen; ++i )
|
||||
{
|
||||
p = new G4DynamicParticle();
|
||||
p->SetDefinition( vec[i]->GetDefinition() );
|
||||
p->SetMomentum( vec[i]->GetMomentum() );
|
||||
theParticleChange.AddSecondary( p );
|
||||
}
|
||||
}
|
||||
|
||||
/* end of file */
|
||||
|
||||
Reference in New Issue
Block a user