Import Geant4 10.3.0.beta source tree
This commit is contained in:
@@ -14,6 +14,26 @@ code and to keep track of all tags.
|
||||
* Please list in reverse chronological order (last date on top)
|
||||
---------------------------------------------------------------
|
||||
|
||||
31 May 2016 - Tatsumi Koi (hadr-modman-V10-02-03)
|
||||
-----------------------------------------------------------
|
||||
- "trunk" is revert to the situation at the hadr-modman-V10-02-01
|
||||
|
||||
29 May 2016 - Tatsumi Koi (hadr-modman-V10-02-02)
|
||||
-----------------------------------------------------------
|
||||
- G4HadronicInteractionRegistry Deleted ad-hoc trick which was added in "hadr-modman-V10-01-04"
|
||||
|
||||
18 April 2016 - Vladimir Ivanchenko (hadr-modman-V10-02-01)
|
||||
-----------------------------------------------------------
|
||||
- G4HadronicInteractionRegistry - added InitialiseModels() method
|
||||
- G4HadronicInteraction - added InitialiseModel() method
|
||||
- G4VPreCompoundModel, G4VIntraNuclearTransportModel - added C++11
|
||||
keywords, minor cleanup
|
||||
|
||||
18 April 2016 - Vladimir Ivanchenko (hadr-modman-V10-02-00)
|
||||
-----------------------------------------------------------
|
||||
- G4HadronicInteractionRegistry, G4HadronicInteraction - added C++11
|
||||
keywords, minor cleanup of BuildPhysicsTable interface
|
||||
|
||||
2 November 2015 - Tatsumi Koi (hadr-modman-V10-01-07)
|
||||
-----------------------------------------------------------
|
||||
- G4HadronicInteractionRegistry - adding same ad-hoc trick of NeutronHP to ParticleHP models to prevent problem at termination
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4HadronicInteraction.hh 88839 2015-03-12 10:30:07Z gcosmo $
|
||||
// $Id: G4HadronicInteraction.hh 96490 2016-04-19 06:57:04Z gcosmo $
|
||||
//
|
||||
// Hadronic Interaction abstract base class
|
||||
// This class is the base class for the model classes.
|
||||
@@ -65,7 +65,7 @@ class G4HadronicInteraction
|
||||
{
|
||||
public: // With description
|
||||
|
||||
G4HadronicInteraction(const G4String& modelName = "HadronicModel");
|
||||
explicit G4HadronicInteraction(const G4String& modelName = "HadronicModel");
|
||||
|
||||
virtual ~G4HadronicInteraction();
|
||||
|
||||
@@ -77,10 +77,9 @@ public: // With description
|
||||
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;}
|
||||
|
||||
virtual G4bool IsApplicable(const G4HadProjectile & aTrack,
|
||||
G4Nucleus & targetNucleus);
|
||||
|
||||
inline G4double GetMinEnergy() const
|
||||
{ return theMinEnergy; }
|
||||
@@ -107,14 +106,11 @@ public: // With description
|
||||
void SetMaxEnergy( G4double anEnergy, const G4Element *anElement );
|
||||
|
||||
void SetMaxEnergy( G4double anEnergy, const G4Material *aMaterial );
|
||||
|
||||
inline const G4HadronicInteraction* GetMyPointer() const
|
||||
{ return this; }
|
||||
|
||||
virtual G4int GetVerboseLevel() const
|
||||
inline G4int GetVerboseLevel() const
|
||||
{ return verboseLevel; }
|
||||
|
||||
virtual void SetVerboseLevel( G4int value )
|
||||
inline void SetVerboseLevel( G4int value )
|
||||
{ verboseLevel = value; }
|
||||
|
||||
inline const G4String& GetModelName() const
|
||||
@@ -146,29 +142,20 @@ public: // With description
|
||||
G4double GetRecoilEnergyThreshold() const
|
||||
{ return recoilEnergyThreshold;}
|
||||
|
||||
inline G4bool operator==(const G4HadronicInteraction &right ) const
|
||||
{ return ( this == (G4HadronicInteraction *) &right ); }
|
||||
|
||||
inline G4bool operator!=(const G4HadronicInteraction &right ) const
|
||||
{ return ( this != (G4HadronicInteraction *) &right ); }
|
||||
|
||||
virtual const std::pair<G4double, G4double> GetFatalEnergyCheckLevels() const;
|
||||
|
||||
virtual std::pair<G4double, G4double> GetEnergyMomentumCheckLevels() const;
|
||||
|
||||
inline void SetEnergyMomentumCheckLevels(G4double relativeLevel, G4double absoluteLevel)
|
||||
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&){;};
|
||||
|
||||
private:
|
||||
|
||||
G4HadronicInteraction(const G4HadronicInteraction &right );
|
||||
const G4HadronicInteraction& operator=(const G4HadronicInteraction &right);
|
||||
virtual void BuildPhysicsTable(const G4ParticleDefinition&);
|
||||
virtual void InitialiseModel();
|
||||
|
||||
protected:
|
||||
|
||||
@@ -197,6 +184,11 @@ protected:
|
||||
G4bool isBlocked;
|
||||
|
||||
private:
|
||||
|
||||
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;
|
||||
|
||||
G4HadronicInteractionRegistry* registry;
|
||||
|
||||
|
||||
+5
-1
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HadronicInteractionRegistry.hh 88839 2015-03-12 10:30:07Z gcosmo $
|
||||
// $Id: G4HadronicInteractionRegistry.hh 96490 2016-04-19 06:57:04Z gcosmo $
|
||||
//
|
||||
// 23-Jan-2009 V.Ivanchenko make the class to be a singleton
|
||||
// 17-Aug-2012 V.Ivanchenko added hadronic model factories
|
||||
@@ -61,6 +61,9 @@ public:
|
||||
void Clean();
|
||||
// delete all models
|
||||
|
||||
void InitialiseModels();
|
||||
// delete all models
|
||||
|
||||
G4HadronicInteraction* FindModel(const G4String& name);
|
||||
// find existing hadronic interaction by name
|
||||
|
||||
@@ -74,6 +77,7 @@ private:
|
||||
static G4ThreadLocal G4HadronicInteractionRegistry* instance;
|
||||
|
||||
std::vector <G4HadronicInteraction*> allModels;
|
||||
G4bool isInitialized;
|
||||
|
||||
};
|
||||
|
||||
|
||||
+7
-7
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VIntraNuclearTransportModel.hh 69717 2013-05-13 09:47:57Z gcosmo $
|
||||
// $Id: G4VIntraNuclearTransportModel.hh 96490 2016-04-19 06:57:04Z gcosmo $
|
||||
//
|
||||
// -----------------------------------------------------------------------------
|
||||
// GEANT 4 class header file
|
||||
@@ -65,8 +65,8 @@ class G4VIntraNuclearTransportModel : public G4HadronicInteraction
|
||||
{
|
||||
public:
|
||||
|
||||
G4VIntraNuclearTransportModel(const G4String& modelName = "CascadeModel",
|
||||
G4VPreCompoundModel* ptr = 0);
|
||||
explicit G4VIntraNuclearTransportModel(const G4String& mName = "CascadeModel",
|
||||
G4VPreCompoundModel* ptr = nullptr);
|
||||
|
||||
virtual ~G4VIntraNuclearTransportModel();
|
||||
|
||||
@@ -92,10 +92,10 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
G4VIntraNuclearTransportModel(const G4VIntraNuclearTransportModel& right);
|
||||
const G4VIntraNuclearTransportModel& operator=(const G4VIntraNuclearTransportModel &right);
|
||||
int operator==(const G4VIntraNuclearTransportModel& right) const;
|
||||
int operator!=(const G4VIntraNuclearTransportModel& right) const;
|
||||
G4VIntraNuclearTransportModel(const G4VIntraNuclearTransportModel& right) = delete;
|
||||
const G4VIntraNuclearTransportModel& operator=(const G4VIntraNuclearTransportModel &right) = delete;
|
||||
int operator==(const G4VIntraNuclearTransportModel& right) const = delete;
|
||||
int operator!=(const G4VIntraNuclearTransportModel& right) const = delete;
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VPreCompoundModel.hh 80131 2014-04-02 14:35:47Z gcosmo $
|
||||
// $Id: G4VPreCompoundModel.hh 96490 2016-04-19 06:57:04Z gcosmo $
|
||||
//
|
||||
|
||||
#ifndef G4VPreCompoundModel_h
|
||||
@@ -60,31 +60,16 @@ class G4VPreCompoundModel : public G4HadronicInteraction
|
||||
{
|
||||
public:
|
||||
|
||||
G4VPreCompoundModel(G4ExcitationHandler* ptr = 0,
|
||||
const G4String& modelName = "PrecompoundModel");
|
||||
explicit G4VPreCompoundModel(G4ExcitationHandler* ptr = nullptr,
|
||||
const G4String& modelName = "PrecompoundModel");
|
||||
|
||||
virtual ~G4VPreCompoundModel();
|
||||
|
||||
private:
|
||||
|
||||
// default constructor
|
||||
//G4VPreCompoundModel();
|
||||
// copy constructor
|
||||
G4VPreCompoundModel(const G4VPreCompoundModel &);
|
||||
// operators
|
||||
const G4VPreCompoundModel& operator=(const G4VPreCompoundModel &right);
|
||||
G4bool operator==(const G4VPreCompoundModel &right) const;
|
||||
G4bool operator!=(const G4VPreCompoundModel &right) const;
|
||||
|
||||
public:
|
||||
|
||||
virtual G4HadFinalState *
|
||||
ApplyYourself(const G4HadProjectile & thePrimary, G4Nucleus & theNucleus) = 0;
|
||||
|
||||
virtual G4ReactionProductVector* DeExcite(G4Fragment& aFragment) = 0;
|
||||
|
||||
virtual void DeExciteModelDescription(std::ostream& outFile) const ;
|
||||
|
||||
virtual void DeExciteModelDescription(std::ostream& outFile) const = 0;
|
||||
|
||||
inline void SetExcitationHandler(G4ExcitationHandler* ptr);
|
||||
|
||||
@@ -92,6 +77,11 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
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;
|
||||
|
||||
G4ExcitationHandler* theExcitationHandler;
|
||||
};
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HadronicInteraction.cc 88839 2015-03-12 10:30:07Z gcosmo $
|
||||
// $Id: G4HadronicInteraction.cc 96490 2016-04-19 06:57:04Z gcosmo $
|
||||
//
|
||||
// Hadronic Interaction base class
|
||||
// original by H.P. Wellisch
|
||||
@@ -53,12 +53,25 @@ G4HadronicInteraction::~G4HadronicInteraction()
|
||||
registry->RemoveMe(this);
|
||||
}
|
||||
|
||||
void G4HadronicInteraction::BuildPhysicsTable(const G4ParticleDefinition&)
|
||||
{}
|
||||
|
||||
void G4HadronicInteraction::InitialiseModel()
|
||||
{}
|
||||
|
||||
G4double
|
||||
G4HadronicInteraction::SampleInvariantT(const G4ParticleDefinition*,
|
||||
G4double, G4int, G4int)
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
G4bool G4HadronicInteraction::IsApplicable(const G4HadProjectile&,
|
||||
G4Nucleus&)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
G4double G4HadronicInteraction::GetMinEnergy(
|
||||
const G4Material *aMaterial, const G4Element *anElement ) const
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4HadronicInteractionRegistry.cc 93882 2015-11-03 08:23:54Z gcosmo $
|
||||
// $Id: G4HadronicInteractionRegistry.cc 97302 2016-06-01 09:30:11Z gcosmo $
|
||||
//
|
||||
// 23-Jan-2009 V.Ivanchenko make the class to be a singleton
|
||||
// 17-Aug-2012 V.Ivanchenko added hadronic model factories
|
||||
@@ -31,11 +31,11 @@
|
||||
#include "G4HadronicInteractionRegistry.hh"
|
||||
#include "G4HadronicInteraction.hh"
|
||||
|
||||
G4ThreadLocal G4HadronicInteractionRegistry* G4HadronicInteractionRegistry::instance = 0;
|
||||
G4ThreadLocal G4HadronicInteractionRegistry* G4HadronicInteractionRegistry::instance = nullptr;
|
||||
|
||||
G4HadronicInteractionRegistry* G4HadronicInteractionRegistry::Instance()
|
||||
{
|
||||
if(!instance) {
|
||||
if(nullptr == instance) {
|
||||
static G4ThreadLocalSingleton<G4HadronicInteractionRegistry> inst;
|
||||
instance = inst.Instance();
|
||||
}
|
||||
@@ -43,8 +43,9 @@ G4HadronicInteractionRegistry* G4HadronicInteractionRegistry::Instance()
|
||||
}
|
||||
|
||||
G4HadronicInteractionRegistry::G4HadronicInteractionRegistry()
|
||||
: isInitialized(false)
|
||||
{
|
||||
//std::cout << "G4HadronicInteractionRegistry " << this << std::endl;
|
||||
//G4cout << "G4HadronicInteractionRegistry " << this << G4endl;
|
||||
}
|
||||
|
||||
G4HadronicInteractionRegistry::~G4HadronicInteractionRegistry()
|
||||
@@ -55,25 +56,33 @@ G4HadronicInteractionRegistry::~G4HadronicInteractionRegistry()
|
||||
void G4HadronicInteractionRegistry::Clean()
|
||||
{
|
||||
size_t nModels = allModels.size();
|
||||
//std::cout << "G4HadronicInteractionRegistry::Clean() start " << nModels
|
||||
// << " " << this << std::endl;
|
||||
//G4cout << "G4HadronicInteractionRegistry::Clean() start " << nModels
|
||||
// << " " << this << G4endl;
|
||||
for (size_t i=0; i<nModels; ++i) {
|
||||
if( allModels[i] ) {
|
||||
const char* xxx = (allModels[i]->GetModelName()).c_str();
|
||||
G4int len = (allModels[i]->GetModelName()).length();
|
||||
len = std::min(len, 9);
|
||||
const G4String mname = G4String(xxx, len);
|
||||
//std::cout << "G4HadronicInteractionRegistry: delete " << i << " "
|
||||
//G4cout << "G4HadronicInteractionRegistry: delete " << i << " "
|
||||
// << allModels[i] << " " << mname
|
||||
// << " " << this << std::endl;
|
||||
// << " " << this << G4endl;
|
||||
if(mname != "NeutronHP" && mname != "ParticleH") {
|
||||
delete allModels[i];
|
||||
}
|
||||
// std::cout << "done " << this << std::endl;
|
||||
// G4cout << "done " << this << G4endl;
|
||||
}
|
||||
}
|
||||
allModels.clear();
|
||||
//std::cout <<"G4HadronicInteractionRegistry::Clean() is done "<<std::endl;
|
||||
//G4cout <<"G4HadronicInteractionRegistry::Clean() is done "<<G4endl;
|
||||
}
|
||||
|
||||
void G4HadronicInteractionRegistry::InitialiseModels()
|
||||
{
|
||||
size_t nModels = allModels.size();
|
||||
for (size_t i=0; i<nModels; ++i) {
|
||||
if( allModels[i] ) { allModels[i]->InitialiseModel(); }
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@@ -96,8 +105,8 @@ G4HadronicInteractionRegistry::RemoveMe(G4HadronicInteraction * aModel)
|
||||
size_t nModels = allModels.size();
|
||||
for (size_t i=0; i<nModels; ++i) {
|
||||
if( aModel == allModels[i] ) {
|
||||
//std::cout << "DeRegister model <" << aModel
|
||||
// << "> " << i << std::endl;
|
||||
//G4cout << "DeRegister model <" << aModel
|
||||
// << "> " << i << G4endl;
|
||||
allModels[i] = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user