Import Geant4 9.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 16:15:05 +02:00
parent b79225fb37
commit 74cad5e589
3877 changed files with 234205 additions and 167127 deletions
@@ -24,185 +24,179 @@
// ********************************************************************
//
//
// $Id: G4HadronicInteraction.hh,v 1.8 2007/01/11 05:30:01 dennis Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4HadronicInteraction.hh,v 1.13 2009/10/02 17:18:33 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// 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
// Adding a registry for memory management of hadronic models, HPW 22-Mar-99
// 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
// Adding a registry for memory management of hadronic models, HPW 22-Mar-99
// 23-Jan-2009 V.Ivanchenko move constructor and destructor to the body
// and reorder methods in the header
// 29-Jun-2009 V.Ivanchenko add SampleInvariantT method
// 29-Aug-2009 V.Ivanchenko moved G4ReactionDynamics to G4InelasticInteraction,
// add const pointers, and added recoilEnergyThreshold
// member and accesors
// Class Description
// This is the base class for all hadronic interaction models in geant4.
// If you want to implement a new way of producing a final state, please inherit
// from here.
// If you want to implement a new way of producing a final state, please,
// inherit from here.
// Class Description - End
#ifndef G4HadronicInteraction_h
#define G4HadronicInteraction_h 1
#include "G4HadFinalState.hh"
#include "G4DynamicParticle.hh"
#include "G4ReactionDynamics.hh"
#include "G4Material.hh"
#include "G4Nucleus.hh"
#include "G4Track.hh"
#include "G4HadProjectile.hh"
#include "G4HadronicInteractionRegistry.hh"
#include "G4HadronicException.hh"
class G4HadronicInteraction
{
public:
G4HadronicInteraction(const G4String& modelName = "HadronicModel") :
verboseLevel(0), theMinEnergy(0.0*GeV), theMaxEnergy(25.0*GeV),
isBlocked(false), theModelName(modelName)
{
G4HadronicInteractionRegistry::RegisterMe(this);
}
virtual ~G4HadronicInteraction()
{
G4HadronicInteractionRegistry::RemoveMe(this);
}
private:
inline G4HadronicInteraction(
const G4HadronicInteraction &right )
{ *this = right; }
inline const G4HadronicInteraction & operator=(
const G4HadronicInteraction &right )
{
G4String text = "unintended use of G4HadronicInteraction::operator=";
throw G4HadronicException(__FILE__, __LINE__, text);
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; }
virtual G4double GetMinEnergy( const G4Material *aMaterial,
const G4Element *anElement ) const;
inline void SetMinEnergy( const G4double anEnergy )
{ theMinEnergy = anEnergy; }
virtual void SetMinEnergy( G4double anEnergy, G4Element *anElement );
virtual void SetMinEnergy( G4double anEnergy, G4Material *aMaterial );
inline G4double GetMaxEnergy() const
{ return theMaxEnergy; }
virtual G4double GetMaxEnergy( const G4Material *aMaterial,
const G4Element *anElement ) const;
inline void SetMaxEnergy( const G4double anEnergy )
{ theMaxEnergy = anEnergy; }
virtual void SetMaxEnergy( G4double anEnergy, G4Element *anElement );
virtual 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; }
inline const G4String& GetModelName() const
{ return theModelName; }
#include "G4ReactionDynamics.hh"
class G4HadronicInteraction
{
public: // With description
// This is the interface to implement for final state production code.
virtual G4HadFinalState *ApplyYourself(
const G4HadProjectile &aTrack, G4Nucleus & targetNucleus ) = 0;
G4HadronicInteraction(const G4String& modelName = "HadronicModel");
public: // Without description
virtual ~G4HadronicInteraction();
virtual G4HadFinalState *ApplyYourself(const G4HadProjectile &aTrack,
G4Nucleus & targetNucleus ) = 0;
// The interface to implement for final state production code.
virtual void DeActivateFor( G4Material *aMaterial );
virtual G4double SampleInvariantT(const G4ParticleDefinition* p,
G4double plab,
G4int Z, G4int A);
// The interface to implement sampling of scattering or change exchange
virtual G4bool IsApplicable(const G4HadProjectile &/*aTrack*/,
G4Nucleus & /*targetNucleus*/)
{ return true;}
inline G4double GetMinEnergy() const
{ return theMinEnergy; }
virtual void ActivateFor( G4Material *aMaterial )
{
Block();
SetMaxEnergy(GetMaxEnergy(), aMaterial);
SetMinEnergy(GetMinEnergy(), aMaterial);
}
G4double GetMinEnergy( const G4Material *aMaterial,
const G4Element *anElement ) const;
inline void SetMinEnergy( G4double anEnergy )
{ theMinEnergy = anEnergy; }
void SetMinEnergy( G4double anEnergy, const G4Element *anElement );
void SetMinEnergy( G4double anEnergy, const 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, const G4Element *anElement );
void SetMaxEnergy( G4double anEnergy, const G4Material *aMaterial );
inline const G4HadronicInteraction *GetMyPointer() const
{ return this; }
virtual void DeActivateFor( G4Element *anElement );
virtual void ActivateFor( G4Element *anElement )
{
Block();
SetMaxEnergy(GetMaxEnergy(), anElement);
SetMinEnergy(GetMinEnergy(), anElement);
}
inline G4int GetVerboseLevel() const
{ return verboseLevel; }
virtual G4bool IsBlocked( const G4Material *aMaterial ) const;
inline void SetVerboseLevel( G4int value )
{ verboseLevel = value; }
virtual G4bool IsBlocked( const G4Element *anElement) const;
inline const G4String& GetModelName() const
{ return theModelName; }
virtual G4bool IsApplicable(const G4HadProjectile &/*aTrack*/,
G4Nucleus & /*targetNucleus*/){ return true;}
protected:
void DeActivateFor( const G4Material *aMaterial );
G4HadFinalState theParticleChange;
// the G4HadFinalState 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;
G4bool IsBlocked() const { return isBlocked;}
void Block() { isBlocked = true; }
G4bool isBlocked;
inline void ActivateFor( const G4Material *aMaterial )
{
Block();
SetMaxEnergy(GetMaxEnergy(), aMaterial);
SetMinEnergy(GetMinEnergy(), aMaterial);
}
G4String theModelName;
void DeActivateFor( const G4Element *anElement );
inline void ActivateFor( const G4Element *anElement )
{
Block();
SetMaxEnergy(GetMaxEnergy(), anElement);
SetMinEnergy(GetMinEnergy(), anElement);
}
G4bool IsBlocked( const G4Material *aMaterial ) const;
G4bool IsBlocked( const G4Element *anElement) const;
inline void SetRecoilEnergyThreshold(G4double val)
{ recoilEnergyThreshold = val; }
G4double GetRecoilEnergyThreshold() const
{ return recoilEnergyThreshold;}
inline G4bool operator==(const G4HadronicInteraction &right ) const
{ return ( this == (G4HadronicInteraction *) &right ); }
private:
std::vector<std::pair<G4double, G4Material *> > theMinEnergyList;
std::vector<std::pair<G4double, G4Material *> > theMaxEnergyList;
std::vector<std::pair<G4double, G4Element *> > theMinEnergyListElements;
std::vector<std::pair<G4double, G4Element *> > theMaxEnergyListElements;
std::vector<G4Material *> theBlockedList;
std::vector<G4Element *> theBlockedListElements;
};
inline G4bool operator!=(const G4HadronicInteraction &right ) const
{ return ( this != (G4HadronicInteraction *) &right ); }
private:
G4HadronicInteraction(const G4HadronicInteraction &right );
const G4HadronicInteraction& operator=(const G4HadronicInteraction &right);
protected:
inline void SetModelName(const G4String& nam)
{ theModelName = nam; }
inline G4bool IsBlocked() const { return isBlocked;}
inline void Block() { isBlocked = true; }
G4HadFinalState theParticleChange;
// the G4HadFinalState 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)
// these two have global validity energy range
G4double theMinEnergy;
G4double theMaxEnergy;
G4bool isBlocked;
private:
G4double recoilEnergyThreshold;
G4String theModelName;
std::vector<std::pair<G4double, const G4Material *> > theMinEnergyList;
std::vector<std::pair<G4double, const G4Material *> > theMaxEnergyList;
std::vector<std::pair<G4double, const G4Element *> > theMinEnergyListElements;
std::vector<std::pair<G4double, const G4Element *> > theMaxEnergyListElements;
std::vector<const G4Material *> theBlockedList;
std::vector<const G4Element *> theBlockedListElements;
};
#endif
@@ -23,41 +23,47 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4HadronicInteractionRegistry.hh,v 1.5 2009/08/30 16:12:34 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// 23-Jan-2009 V.Ivanchenko make the class to be a singleton
// Class Description
// This is the a singleton class to store all hadronic interactions
// Class Description - End
#ifndef G4HadronicInteractionRegistry_h
#define G4HadronicInteractionRegistry_h 1
#include <vector>
#include "globals.hh"
class G4HadronicInteraction;
class G4HadronicInteractionRegistry
{
public:
public:
static G4HadronicInteractionRegistry* Instance();
// access
~G4HadronicInteractionRegistry();
void Clean();
//delete models
static void RegisterMe(G4HadronicInteraction * aModel);
static void RemoveMe(G4HadronicInteraction * aModel);
void RegisterMe(G4HadronicInteraction * aModel);
//register new model
void RemoveMe(G4HadronicInteraction * aModel);
//deregister model
protected:
private:
G4HadronicInteractionRegistry(G4String );
static G4HadronicInteractionRegistry & theRegistry();
G4HadronicInteractionRegistry();
private:
// !!! can not use "copy constructor" nor "default constructor" !!!!
G4HadronicInteractionRegistry(const G4HadronicInteractionRegistry &right)
{ nModels = right.nModels; }
G4HadronicInteractionRegistry() {nModels = 0;}
// !!! Assignment operation is forbidden !!!
const G4HadronicInteractionRegistry & operator=(const G4HadronicInteractionRegistry &)
{ return *this;}
void AddModel(G4HadronicInteraction * aModel);
static G4HadronicInteractionRegistry* theInstance;
G4int nModels;
std::vector <G4HadronicInteraction *> allModels;
};
@@ -24,22 +24,24 @@
// ********************************************************************
//
//
// $Id: G4InelasticInteraction.hh,v 1.5 2007/01/11 05:30:12 dennis Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4InelasticInteraction.hh,v 1.7 2009/08/30 16:12:13 vnivanch Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
// 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
// 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
// 23-Jan-2009 V.Ivanchenko move constructor and destructor to the body
// 29-Aug-2009 V.Ivanchenko moveded G4ReactionDynamics instance from the based class
#ifndef G4InelasticInteraction_h
#define G4InelasticInteraction_h 1
@@ -52,18 +54,15 @@
#include "Randomize.hh"
#include "G4ReactionDynamics.hh"
class G4InelasticInteraction : public G4HadronicInteraction
{
public:
class G4InelasticInteraction : public G4HadronicInteraction
{
public:
G4InelasticInteraction(const G4String& modelName = "LEInelastic")
: G4HadronicInteraction(modelName)
{ cache = 0.0;}
G4InelasticInteraction(const G4String& modelName = "LEInelastic");
virtual ~G4InelasticInteraction()
{ }
virtual ~G4InelasticInteraction();
protected:
protected:
G4double Pmltpc( G4int np, G4int nm, G4int nz, G4int n,
G4double b, G4double c );
@@ -99,12 +98,15 @@
G4ReactionProduct &currentParticle,
G4ReactionProduct &targetParticle,
G4bool &incidentHasChanged );
private:
private:
G4double cache;
G4ThreeVector what;
};
protected:
G4ReactionDynamics theReactionDynamics;
};
#endif
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4V3DNucleus.hh,v 1.6 2008/05/16 14:02:37 gunter Exp $
// GEANT4 tag $Name: geant4-09-02 $
// $Id: G4V3DNucleus.hh,v 1.7 2009/11/19 14:29:05 gunter Exp $
// GEANT4 tag $Name: geant4-09-03 $
//
#ifndef G4V3DNucleus_h
#define G4V3DNucleus_h 1
@@ -68,7 +68,8 @@ class G4V3DNucleus
virtual void DoLorentzContraction(const G4ThreeVector & theBeta) = 0;
virtual void DoTranslation(const G4ThreeVector & theShift) = 0;
virtual const G4VNuclearDensity * GetNuclearDensity() const = 0;
virtual void SortNucleonsInZ() = 0;
virtual void SortNucleonsIncZ() = 0;
virtual void SortNucleonsDecZ() = 0;
public:
std::pair<G4double, G4double> ChooseImpactXandY(G4double maxImpact);