Import Geant4 10.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 14:11:04 +02:00
parent c9b32a6c0a
commit d4af681f38
4886 changed files with 420149 additions and 1023309 deletions
@@ -14,6 +14,49 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
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
30 October 2015 - Gunter Folger (hadr-modman-V10-01-06)
-----------------------------------------------------------
- Loop checking: include/G4V3DNucleus.hh checked.
2 July 2015 - Tatsumi Koi (hadr-modman-V10-01-05)
-----------------------------------------------------------
- G4HadronicInteractionRegistry - delete the ad-hoc tricks of NeutronHP and ParticleHP models to prevent problem at
termination
16 June 2015 - Tatsumi Koi (hadr-modman-V10-01-04)
-----------------------------------------------------------
- G4HadronicInteractionRegistry - adding same ad-hoc trick of NeutronHP to ParticleHP models to prevent problem at
termination
13 March 2015 - Vladimir Ivanchenko (hadr-modman-V10-01-03)
-----------------------------------------------------------
- G4HadronicInteractionRegistry - more accurate check on HP models
11 March 2015 - Vladimir Ivanchenko (hadr-modman-V10-01-02)
-----------------------------------------------------------
- G4HadronicInteractionRegistry - temporary do not delete HP models
11 March 2015 - Vladimir Ivanchenko (hadr-modman-V10-01-01)
-----------------------------------------------------------
- G4HadronicInteractionRegistry, G4HadronicInteraction - fixed deletion of
models at exit
11 March 2015 - Vladimir Ivanchenko (hadr-modman-V10-01-00)
-----------------------------------------------------------
- G4HadronicInteractionRegistry - make it thread local singleton
for proper deletion of models end of run
18 November 2014 - Vladimir Ivanchenko previous tag is restored to the trunk
18 November 2014 - Vladimir Ivanchenko (hadr-modman-V10-00-06)
---------------------------------------------------------
- G4HadronicInteractionRegistry - make it thread local singleton
for proper deletion of models end of run
12 September 2014 - Tatsumi Koi (hadr-modman-V10-00-05)
---------------------------------------------------------
- Add BuildPhysics method for Initialisation before run
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4HadronicInteraction.hh 83773 2014-09-15 07:19:09Z gcosmo $
// $Id: G4HadronicInteraction.hh 88839 2015-03-12 10:30:07Z gcosmo $
//
// Hadronic Interaction abstract base class
// This class is the base class for the model classes.
@@ -59,6 +59,8 @@
#include "G4Track.hh"
#include "G4HadProjectile.hh"
class G4HadronicInteractionRegistry;
class G4HadronicInteraction
{
public: // With description
@@ -194,9 +196,10 @@ protected:
G4bool isBlocked;
private:
G4HadronicInteractionRegistry* registry;
G4double recoilEnergyThreshold;
G4String theModelName;
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4HadronicInteractionRegistry.hh 82440 2014-06-20 10:39:49Z gcosmo $
// $Id: G4HadronicInteractionRegistry.hh 88839 2015-03-12 10:30:07Z gcosmo $
//
// 23-Jan-2009 V.Ivanchenko make the class to be a singleton
// 17-Aug-2012 V.Ivanchenko added hadronic model factories
@@ -37,11 +37,14 @@
#include <vector>
#include "globals.hh"
#include "G4ThreadLocalSingleton.hh"
class G4HadronicInteraction;
class G4HadronicInteractionRegistry
{
friend class G4ThreadLocalSingleton<G4HadronicInteractionRegistry>;
public:
static G4HadronicInteractionRegistry* Instance();
@@ -49,15 +52,15 @@ public:
~G4HadronicInteractionRegistry();
void Clean();
// delete models
void RegisterMe(G4HadronicInteraction * aModel);
// register new model
void RemoveMe(G4HadronicInteraction * aModel);
// deregister model
void Clean();
// delete all models
G4HadronicInteraction* FindModel(const G4String& name);
// find existing hadronic interaction by name
@@ -68,8 +71,8 @@ private:
G4HadronicInteractionRegistry();
static G4ThreadLocal G4HadronicInteractionRegistry* theInstance;
static G4ThreadLocal G4HadronicInteractionRegistry* instance;
std::vector <G4HadronicInteraction*> allModels;
};
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
// $Id: G4V3DNucleus.hh 66785 2013-01-12 15:10:13Z gcosmo $
// $Id: G4V3DNucleus.hh 93818 2015-11-02 11:34:19Z gcosmo $
//
// 20110805 M. Kelsey -- Change nucleon vector to use objects, not pointers
@@ -92,7 +92,8 @@ ChooseImpactXandY(G4double maxImpact)
x = 2*G4UniformRand() - 1;
y = 2*G4UniformRand() - 1;
}
while(x*x + y*y > 1);
while(x*x + y*y > 1); /* Loop checking, 30-Oct-2015, G.Folger */
G4double impactX = x*(maxImpact);
G4double impactY = y*(maxImpact);
theImpactParameter.first = impactX;
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4HadronicInteraction.cc 70714 2013-06-05 07:39:59Z gcosmo $
// $Id: G4HadronicInteraction.cc 88839 2015-03-12 10:30:07Z gcosmo $
//
// Hadronic Interaction base class
// original by H.P. Wellisch
@@ -44,16 +44,15 @@ G4HadronicInteraction::G4HadronicInteraction(const G4String& modelName) :
isBlocked(false), recoilEnergyThreshold(0.0), theModelName(modelName),
epCheckLevels(DBL_MAX, DBL_MAX)
{
G4HadronicInteractionRegistry::Instance()->RegisterMe(this);
registry = G4HadronicInteractionRegistry::Instance();
registry->RegisterMe(this);
}
G4HadronicInteraction::~G4HadronicInteraction()
{
G4HadronicInteractionRegistry::Instance()->RemoveMe(this);
registry->RemoveMe(this);
}
G4double
G4HadronicInteraction::SampleInvariantT(const G4ParticleDefinition*,
G4double, G4int, G4int)
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4HadronicInteractionRegistry.cc 82440 2014-06-20 10:39:49Z gcosmo $
// $Id: G4HadronicInteractionRegistry.cc 93882 2015-11-03 08:23:54Z gcosmo $
//
// 23-Jan-2009 V.Ivanchenko make the class to be a singleton
// 17-Aug-2012 V.Ivanchenko added hadronic model factories
@@ -31,19 +31,21 @@
#include "G4HadronicInteractionRegistry.hh"
#include "G4HadronicInteraction.hh"
G4ThreadLocal G4HadronicInteractionRegistry* G4HadronicInteractionRegistry::theInstance = 0;
G4ThreadLocal G4HadronicInteractionRegistry* G4HadronicInteractionRegistry::instance = 0;
G4HadronicInteractionRegistry* G4HadronicInteractionRegistry::Instance()
{
if(0 == theInstance) {
static G4ThreadLocal G4HadronicInteractionRegistry *manager_G4MT_TLS_ = 0 ; if (!manager_G4MT_TLS_) manager_G4MT_TLS_ = new G4HadronicInteractionRegistry ; G4HadronicInteractionRegistry &manager = *manager_G4MT_TLS_;
theInstance = &manager;
if(!instance) {
static G4ThreadLocalSingleton<G4HadronicInteractionRegistry> inst;
instance = inst.Instance();
}
return theInstance;
return instance;
}
G4HadronicInteractionRegistry::G4HadronicInteractionRegistry()
{}
{
//std::cout << "G4HadronicInteractionRegistry " << this << std::endl;
}
G4HadronicInteractionRegistry::~G4HadronicInteractionRegistry()
{
@@ -53,20 +55,25 @@ G4HadronicInteractionRegistry::~G4HadronicInteractionRegistry()
void G4HadronicInteractionRegistry::Clean()
{
size_t nModels = allModels.size();
//G4cout << "G4HadronicInteractionRegistry::Clean() start " << nModels << G4endl;
if(0 < nModels) {
for (size_t i=0; i<nModels; ++i) {
if( allModels[i] ) {
//G4cout << "delete " << i << G4endl;
//G4cout << allModels[i]->GetModelName() << G4endl;
G4HadronicInteraction * model = allModels[i];
allModels[i] = 0;
delete model;
//std::cout << "G4HadronicInteractionRegistry::Clean() start " << nModels
// << " " << this << std::endl;
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 << " "
// << allModels[i] << " " << mname
// << " " << this << std::endl;
if(mname != "NeutronHP" && mname != "ParticleH") {
delete allModels[i];
}
// std::cout << "done " << this << std::endl;
}
allModels.clear();
}
//G4cout << "G4HadronicInteractionRegistry::Clean() is done " << G4endl;
allModels.clear();
//std::cout <<"G4HadronicInteractionRegistry::Clean() is done "<<std::endl;
}
void
@@ -74,13 +81,11 @@ G4HadronicInteractionRegistry::RegisterMe(G4HadronicInteraction * aModel)
{
if(!aModel) { return; }
size_t nModels = allModels.size();
if(nModels > 0) {
for (size_t i=0; i<nModels; ++i) {
if( aModel == allModels[i] ) { return; }
}
for (size_t i=0; i<nModels; ++i) {
if( aModel == allModels[i] ) { return; }
}
//G4cout << "Register model <" << aModel->GetModelName()
//<< "> " << nModels+1 << G4endl;
// << "> " << nModels+1 << " " << aModel << G4endl;
allModels.push_back(aModel);
}
@@ -89,11 +94,10 @@ G4HadronicInteractionRegistry::RemoveMe(G4HadronicInteraction * aModel)
{
if(!aModel) { return; }
size_t nModels = allModels.size();
if(0 == nModels) { return; }
for (size_t i=0; i<nModels; ++i) {
if( aModel == allModels[i] ) {
//G4cout << "DeRegister model <" << aModel->GetModelName()
//<< "> " << i << G4endl;
//std::cout << "DeRegister model <" << aModel
// << "> " << i << std::endl;
allModels[i] = 0;
return;
}