Import Geant4 11.0.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2021-06-25 16:12:29 +02:00
parent c968e26a39
commit 6399a014b6
4200 changed files with 207479 additions and 237366 deletions
@@ -59,13 +59,9 @@ class G4HadronicEPTestMessenger: public G4UImessenger
private:
G4HadronicProcessStore* theProcessStore;
G4UIdirectory* old_heptstDirectory; // To be removed in G4 11.0
G4UIdirectory* heptstDirectory;
G4UIcmdWithAnInteger* old_reportLvlCmd; // To be removed in G4 11.0
G4UIcmdWithAnInteger* reportLvlCmd;
G4UIcmdWithADouble* old_procRelLvlCmd; // To be removed in G4 11.0
G4UIcmdWithADouble* procRelLvlCmd;
G4UIcmdWithADoubleAndUnit* old_procAbsLvlCmd; // To be removed in G4 11.0
G4UIcmdWithADoubleAndUnit* procAbsLvlCmd;
};
@@ -0,0 +1,208 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//
// 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.
// Class Description - End
#ifndef G4HadronicInteraction_h
#define G4HadronicInteraction_h 1
#include "G4HadFinalState.hh"
#include "G4Material.hh"
#include "G4Nucleus.hh"
#include "G4Track.hh"
#include "G4HadProjectile.hh"
class G4HadronicInteractionRegistry;
class G4HadronicInteraction
{
public: // With description
explicit G4HadronicInteraction(const G4String& modelName = "HadronicModel");
virtual ~G4HadronicInteraction();
virtual G4HadFinalState *ApplyYourself(const G4HadProjectile &aTrack,
G4Nucleus & targetNucleus );
// The interface to implement for final state production code.
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);
inline G4double GetMinEnergy() const
{ return theMinEnergy; }
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 G4int GetVerboseLevel() const
{ return verboseLevel; }
inline void SetVerboseLevel( G4int value )
{ verboseLevel = value; }
inline const G4String& GetModelName() const
{ return theModelName; }
void DeActivateFor(const G4Material* aMaterial);
inline void ActivateFor( const G4Material *aMaterial )
{
Block();
SetMaxEnergy(GetMaxEnergy(), aMaterial);
SetMinEnergy(GetMinEnergy(), aMaterial);
}
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;}
virtual const std::pair<G4double, G4double> GetFatalEnergyCheckLevels() const;
virtual std::pair<G4double, G4double> GetEnergyMomentumCheckLevels() const;
inline void
SetEnergyMomentumCheckLevels(G4double relativeLevel, G4double absoluteLevel)
{ epCheckLevels.first = relativeLevel;
epCheckLevels.second = absoluteLevel; }
virtual void ModelDescription(std::ostream& outFile) const ; //=0;
// Initialisation before run
virtual void BuildPhysicsTable(const G4ParticleDefinition&);
virtual void InitialiseModel();
G4HadronicInteraction(const G4HadronicInteraction &right ) = delete;
const G4HadronicInteraction& operator=(const G4HadronicInteraction &right) = delete;
G4bool operator==(const G4HadronicInteraction &right ) const = delete;
G4bool operator!=(const G4HadronicInteraction &right ) const = delete;
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:
G4HadronicInteractionRegistry* registry;
G4double recoilEnergyThreshold;
G4String theModelName;
std::pair<G4double, G4double> epCheckLevels;
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,44 +23,59 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// 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
//
// 23-Jan-2009 V.Ivanchenko make the class to be a singleton
// 17-Aug-2012 V.Ivanchenko added hadronic model factories
#ifndef G4HadronInelasticProcess_h
#define G4HadronInelasticProcess_h 1
// Class Description
// This is a singleton class to store all hadronic interactions
// Class Description - End
#include "G4HadronicProcess.hh"
#ifndef G4HadronicInteractionRegistry_h
#define G4HadronicInteractionRegistry_h 1
class G4ParticleDefinition;
#include <vector>
#include "globals.hh"
#include "G4ThreadLocalSingleton.hh"
class G4HadronInelasticProcess : public G4HadronicProcess
class G4HadronicInteraction;
class G4HadronicInteractionRegistry
{
friend class G4ThreadLocalSingleton<G4HadronicInteractionRegistry>;
public:
explicit G4HadronInelasticProcess(const G4String &processName,
const G4ParticleDefinition*);
~G4HadronInelasticProcess() override;
G4bool IsApplicable(const G4ParticleDefinition&) override;
static G4HadronicInteractionRegistry* Instance();
// access
~G4HadronicInteractionRegistry();
void RegisterMe(G4HadronicInteraction * aModel);
// register new model
void RemoveMe(G4HadronicInteraction * aModel);
// deregister model
void Clean();
// delete all models
void InitialiseModels();
// initialise all models before the run
G4HadronicInteraction* FindModel(const G4String& name);
// find existing hadronic interaction by name
std::vector<G4HadronicInteraction*> FindAllModels(const G4String& name);
// find all existing hadronic interactions by name
private:
// hide assignment operator as private
G4HadronInelasticProcess& operator=
(const G4HadronInelasticProcess& right) = delete;
G4HadronInelasticProcess(const G4HadronInelasticProcess&) = delete;
G4HadronicInteractionRegistry();
static G4ThreadLocal G4HadronicInteractionRegistry* instance;
std::vector<G4HadronicInteraction*> allModels;
};
#endif
@@ -113,6 +113,10 @@ public:
// access to an hadronic interaction by name
G4HadronicInteraction* GetHadronicModel(const G4String&);
// access to the chosen generator
inline G4HadronicInteraction* GetHadronicInteraction() const
{ return theInteraction; }
// get inverse cross section per volume
G4double GetMeanFreePath(const G4Track &aTrack, G4double,
@@ -177,10 +181,6 @@ protected:
void DumpState(const G4Track&, const G4String&, G4ExceptionDescription&);
// access to the chosen generator
inline G4HadronicInteraction* GetHadronicInteraction() const
{ return theInteraction; }
// access to the cross section data set
inline G4double GetLastCrossSection()
{ return theLastCrossSection; }
@@ -0,0 +1,69 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// V. Uzhinsky Nov. 2012
// Added method GetProjectileNucleus for simulation of nucleus-nucleus inter.
//
#ifndef G4VHighEnergyGenerator_h
#define G4VHighEnergyGenerator_h 1
// Class Description
// Base class for high energy interaction models in geant4.
// By merit of inheriting from this class a high energy
// interaction model can be used in conjunction with
// any cascade, precompound model and evaporation phase in the
// generation of complete final states for inelastic scattering.
// Class Description - End
#include "G4HadronicInteraction.hh"
#include "G4Nucleus.hh"
#include "G4HadProjectile.hh"
#include "G4ReactionProduct.hh"
#include "G4V3DNucleus.hh"
class G4KineticTrackVector;
class G4VHighEnergyGenerator : public G4HadronicInteraction
{
public:
G4VHighEnergyGenerator(const G4String& modelName = "HighEnergyGenerator");
~G4VHighEnergyGenerator() override;
G4VHighEnergyGenerator(const G4VHighEnergyGenerator &right) = delete;
const G4VHighEnergyGenerator & operator=(const G4VHighEnergyGenerator &right) = delete;
G4bool operator==(const G4VHighEnergyGenerator &right) const = delete;
G4bool operator!=(const G4VHighEnergyGenerator &right) const = delete;
virtual G4V3DNucleus * GetWoundedNucleus() const = 0;
virtual G4V3DNucleus * GetProjectileNucleus() const;
virtual G4KineticTrackVector * Scatter(const G4Nucleus &theNucleus,
const G4DynamicParticle &thePrimary) = 0;
void ModelDescription(std::ostream&) const override;
};
#endif
@@ -0,0 +1,156 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// -----------------------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, A. Feliciello, 30th June 1998
// A.Pavliouk 26.11.98
// In Set...() methods a pointer is deleted now before new
// value will be asigned.
// M.Kelsey 07.03.2011
// Add data member and Set method to store original projectile
// V.Ivanchenko 03.01.2012
// Added G4VPreCompoundModel pointer to the constructor and cleanup
// V. Uzhinsky Nov. 2012
// Added method PropagateNuclNucl for simulation of nucleus-nucleus inter.
// -----------------------------------------------------------------------------
#ifndef G4VIntraNuclearTransportModel_h
#define G4VIntraNuclearTransportModel_h 1
// Class Description
// Base class for intra-nuclear transport models in geant4. By merit
// of inheriting from this class a intra-nuclear transport model can
// be used in conjunction with any precompound, string parton model
// or other high energy generator in the generation of final states
// for inelastic scattering.
// Class Description - End
#include "G4V3DNucleus.hh"
#include "G4VPreCompoundModel.hh"
#include "G4HadronicInteraction.hh"
#include "G4ReactionProductVector.hh"
#include "G4ReactionProduct.hh"
#include "G4HadProjectile.hh"
#include "G4HadFinalState.hh"
class G4KineticTrackVector;
class G4VIntraNuclearTransportModel : public G4HadronicInteraction
{
public:
explicit G4VIntraNuclearTransportModel(const G4String& mName = "CascadeModel",
G4VPreCompoundModel* ptr = nullptr);
virtual ~G4VIntraNuclearTransportModel();
virtual
G4ReactionProductVector* Propagate(G4KineticTrackVector* theSecondaries,
G4V3DNucleus* theNucleus) = 0;
virtual
G4ReactionProductVector* PropagateNuclNucl(G4KineticTrackVector* theSecondaries,
G4V3DNucleus* theNucleus,
G4V3DNucleus* theProjectileNucleus); // Uzhi Nov. 2012
inline void SetDeExcitation(G4VPreCompoundModel* ptr);
inline void Set3DNucleus(G4V3DNucleus* const value);
inline void SetPrimaryProjectile(const G4HadProjectile &aPrimary);
inline const G4String& GetModelName() const;
virtual void ModelDescription(std::ostream& outFile) const ;
virtual void PropagateModelDescription(std::ostream& outFile) const ;
G4VIntraNuclearTransportModel(const G4VIntraNuclearTransportModel& right) = delete;
const G4VIntraNuclearTransportModel& operator=(const G4VIntraNuclearTransportModel &right) = delete;
G4bool operator==(const G4VIntraNuclearTransportModel& right) const = delete;
G4bool operator!=(const G4VIntraNuclearTransportModel& right) const = delete;
protected:
inline G4V3DNucleus* Get3DNucleus() const;
inline G4VPreCompoundModel* GetDeExcitation() const;
inline const G4HadProjectile* GetPrimaryProjectile() const;
G4String theTransportModelName;
G4V3DNucleus* the3DNucleus;
G4VPreCompoundModel* theDeExcitation;
const G4HadProjectile* thePrimaryProjectile;
};
inline const G4String& G4VIntraNuclearTransportModel::GetModelName() const
{
return theTransportModelName;
}
inline G4V3DNucleus* G4VIntraNuclearTransportModel::Get3DNucleus() const
{
return the3DNucleus;
}
inline void G4VIntraNuclearTransportModel::Set3DNucleus(G4V3DNucleus* const value)
{
delete the3DNucleus; the3DNucleus = value;
}
inline G4VPreCompoundModel* G4VIntraNuclearTransportModel::GetDeExcitation() const
{
return theDeExcitation;
}
inline void
G4VIntraNuclearTransportModel::SetDeExcitation(G4VPreCompoundModel* value)
{
// previous pre-compound model will be deleted at the end of job
theDeExcitation = value;
}
inline const G4HadProjectile*
G4VIntraNuclearTransportModel::GetPrimaryProjectile() const
{
return thePrimaryProjectile;
}
inline void
G4VIntraNuclearTransportModel::SetPrimaryProjectile(const G4HadProjectile &aPrimary)
{
// NOTE: Previous pointer is NOT deleted: passed by reference, no ownership
thePrimaryProjectile = &aPrimary;
}
#endif
@@ -0,0 +1,93 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
#ifndef G4VPreCompoundModel_h
#define G4VPreCompoundModel_h 1
// -----------------------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation 1998
//
// V.Ivanchenko 03.01.2012
// Added G4ExcitationHandler pointer to the constructor and cleanup
// -----------------------------------------------------------------------------
// Class Description
// Base class for pre-equilibrium decay models in geant4. By merit of
// inheriting from this class a pre-equilibrium decay model can be used
// in conjunction with any cascade, string parton model or other high
// energy generator in the generation of final states for inelastic scattering.
// Class Description - End
#include "G4HadronicInteraction.hh"
#include "G4ReactionProductVector.hh"
#include "G4ReactionProduct.hh"
class G4HadProjectile;
class G4HadFinalState;
class G4Nucleus;
class G4Fragment;
class G4ExcitationHandler;
class G4VPreCompoundModel : public G4HadronicInteraction
{
public:
explicit G4VPreCompoundModel(G4ExcitationHandler* ptr = nullptr,
const G4String& modelName = "PrecompoundModel");
virtual ~G4VPreCompoundModel();
virtual G4ReactionProductVector* DeExcite(G4Fragment& aFragment) = 0;
virtual void DeExciteModelDescription(std::ostream& outFile) const = 0;
inline void SetExcitationHandler(G4ExcitationHandler* ptr);
inline G4ExcitationHandler* GetExcitationHandler() const;
G4VPreCompoundModel(const G4VPreCompoundModel &) = delete;
const G4VPreCompoundModel& operator=(const G4VPreCompoundModel &right) = delete;
G4bool operator==(const G4VPreCompoundModel &right) const = delete;
G4bool operator!=(const G4VPreCompoundModel &right) const = delete;
private:
G4ExcitationHandler* theExcitationHandler;
};
inline void G4VPreCompoundModel::SetExcitationHandler(G4ExcitationHandler* ptr)
{
theExcitationHandler = ptr;
}
inline G4ExcitationHandler* G4VPreCompoundModel::GetExcitationHandler() const
{
return theExcitationHandler;
}
#endif