Import Geant4 10.5.0 source tree

This commit is contained in:
Gabriele Cosmo
2018-12-07 15:15:39 +01:00
parent 6aa23be517
commit db49709b53
11370 changed files with 187480 additions and 160142 deletions
@@ -7,7 +7,6 @@
#
# Generated on : 24/9/2010
#
# $Id: CMakeLists.txt 66892 2013-01-17 10:57:59Z gunter $
#
#------------------------------------------------------------------------------
@@ -1,4 +1,3 @@
# $Id: GNUmakefile 81945 2014-06-06 16:00:38Z gcosmo $
# ----------------------------------------------------------------
# GNUmakefile for hadronic management library. G.Folger 10-Dec-97
# ----------------------------------------------------------------
@@ -12,10 +11,6 @@ endif
include $(G4INSTALL)/config/architecture.gmk
ifdef PRECOMPOUND_TEST
CPPFLAGS += -DPRECOMPOUND_TEST
endif
CPPFLAGS += -DG4HADRONIC_ALLOC_EXPORT
CPPFLAGS += -I$(G4BASE)/global/management/include \
-I$(G4BASE)/global/HEPRandom/include \
@@ -34,24 +29,3 @@ CPPFLAGS += -I$(G4BASE)/global/management/include \
include $(G4INSTALL)/config/common.gmk
ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
CXXFLAGS_WITH_ZM = $(filter-out -Zm%,$(CXXFLAGS)) -Zm500
$(G4TMPDIR)/G4HadronicWhiteBoard.o: src/G4HadronicWhiteBoard.cc
@$(ECHO) Compiling G4HadronicWhiteBoard.cc ...
@$(CXX) $(CXXFLAGS_WITH_ZM) $(CPPFLAGS) -c $(OUT_OBJ)$@ \
src/G4HadronicWhiteBoard.cc
else
CXXFLAGS_WITHOUT_O := $(filter-out -O% , $(CXXFLAGS))
CXXFLAGS_WITHOUT_O := $(filter-out +O% , $(CXXFLAGS_WITHOUT_O))
$(G4TMPDIR)/G4HadronicWhiteBoard.o: src/G4HadronicWhiteBoard.cc
@$(ECHO) Compiling G4HadronicWhiteBoard.cc ...
@$(CXX) $(CXXFLAGS_WITHOUT_O) $(CPPFLAGS) -c -o $@ \
src/G4HadronicWhiteBoard.cc
endif
+11
View File
@@ -14,6 +14,17 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
22 August 2018 Vladimir Ivanchenko (hadr-util-V10-04-04)
--------------------------------------------------------
- sources.cmake, GNUmakefile - removed G4HadronicWhiteBoard
10 August 2018 Alberto Ribon (hadr-util-V10-04-03)
-------------------------------------------------
- sources.cmake, G4HadronicParameters : moved in class G4HadronicParameters
from hadronic/management/ to avoid circular dependency between
hadronic/management/ and hadronic/cross_sections/ (the former has to depend
on the latter, but not vice versa; hadronic/util/ does not depend on either).
17 May 2018 Jonathan Madsen (hadr-util-V10-04-02)
-------------------------------------------------
- updated "thread-local-static-var" model to
@@ -0,0 +1,75 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//---------------------------------------------------------------------------
//
// ClassName: G4HadronicParameters
//
// Author: 2018 Alberto Ribon
//
// Description: Singleton to keep global hadronic parameters.
//
// For the time being, at least, offers only "getters" but
// not "setters", i.e. a recompilation is needed to change
// the default parameters.
//
// Modified:
//
//----------------------------------------------------------------------------
//
#ifndef G4HadronicParameters_h
#define G4HadronicParameters_h 1
#include "globals.hh"
class G4HadronicParameters {
public:
static G4HadronicParameters* Instance();
~G4HadronicParameters();
G4double GetMaxEnergy() const;
// Upper limit for Geant4 hadronic physics, for any application.
// Any hadronic model, physics list builder and constructor should use this method
// instead of putting an arbitrary value in the code.
// Any application which tries to use hadronic physics for an energy higher than this limit
// will get a run-time crash, because no model is found.
private:
G4HadronicParameters();
static G4HadronicParameters* sInstance;
G4double fMaxEnergy;
};
inline G4double G4HadronicParameters::GetMaxEnergy() const {
return fMaxEnergy;
}
#endif
+2 -3
View File
@@ -11,7 +11,6 @@
#
# Generated on : 24/9/2010
#
# $Id: sources.cmake 103898 2017-05-03 08:25:03Z gcosmo $
#
#------------------------------------------------------------------------------
@@ -55,7 +54,7 @@ GEANT4_DEFINE_MODULE(NAME G4hadronic_util
G4HadronicDeprecate.hh
G4HadronicDeveloperParameters.hh
G4HadronicException.hh
G4HadronicWhiteBoard.hh
G4HadronicParameters.hh
G4IsoResult.hh
G4LightMedia.hh
G4NuclearPolarization.hh
@@ -73,7 +72,7 @@ GEANT4_DEFINE_MODULE(NAME G4hadronic_util
G4HadSignalHandler.cc
G4HadTmpUtil.cc
G4HadronicDeveloperParameters.cc
G4HadronicWhiteBoard.cc
G4HadronicParameters.cc
G4IsoResult.cc
G4LightMedia.cc
G4NuclearPolarization.cc
@@ -23,61 +23,43 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
#ifndef G4HadronicWhiteBoard_h
#define G4HadronicWhiteBoard_h
//
//---------------------------------------------------------------------------
//
// ClassName: G4HadronicParameters
//
// Author: 2018 Alberto Ribon
//
// Description: Singleton to keep global hadronic parameters.
//
// For the time being, at least, offers only "getters" but
// not "setters", i.e. a recompilation is needed to change
// the default parameters.
//
// Modified:
//
//----------------------------------------------------------------------------
#include "G4HadProjectile.hh"
#include "G4Nucleus.hh"
#include "G4ParticleDefinition.hh"
#include "G4HadronicParameters.hh"
#include <CLHEP/Units/PhysicalConstants.h>
class G4HadronicWhiteBoard
{
public:
G4HadronicWhiteBoard();
static G4HadronicWhiteBoard& Instance();
void SetProjectile(const G4HadProjectile& aProjectile);
void SetTargetNucleus(const G4Nucleus& aTarget);
G4HadronicParameters* G4HadronicParameters::sInstance = nullptr;
void SetProcessName(const G4String& aProcessName);
void SetModelName(const G4String& aModelName);
G4HadronicParameters* G4HadronicParameters::Instance() {
if ( sInstance == nullptr ) {
static G4HadronicParameters theHadronicParametersObject;
sInstance = &theHadronicParametersObject;
}
return sInstance;
}
const G4HadProjectile* GetProjectile();
const G4Nucleus& GetTargetNucleus();
const G4ParticleDefinition* GetPDef();
G4String GetParticleName();
G4double GetEnergy();
G4double GetPx();
G4double GetPy();
G4double GetPz();
G4int GetA();
G4int GetZ();
void Dump();
private:
G4HadronicParameters::~G4HadronicParameters() {}
static G4ThreadLocal G4HadronicWhiteBoard *theInstance;
const G4HadProjectile* theProjectile;
const G4ParticleDefinition* theDef;
const char* theName;
G4double theE;
G4double thePx;
G4double thePy;
G4double thePz;
G4Nucleus theTarget;
G4int theA;
G4int theZ;
G4HadronicParameters::G4HadronicParameters() {
fMaxEnergy = 100.0*CLHEP::TeV;
}
G4String theProcessName;
G4String theModelName;
};
#endif
@@ -1,112 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
#include "G4HadronicWhiteBoard.hh"
G4ThreadLocal G4HadronicWhiteBoard * G4HadronicWhiteBoard::theInstance = 0;
G4HadronicWhiteBoard::G4HadronicWhiteBoard()
: theProjectile(0), theDef(0), theName(0), theE(0.0), thePx(0.0),
thePy(0.0), thePz(0.0), theA(0), theZ(0)
{}
G4HadronicWhiteBoard & G4HadronicWhiteBoard::Instance()
{
if (!theInstance) theInstance = new G4HadronicWhiteBoard;
return *theInstance;
}
const G4HadProjectile * G4HadronicWhiteBoard::GetProjectile()
{
return theProjectile;
}
const G4Nucleus & G4HadronicWhiteBoard::GetTargetNucleus()
{
return theTarget;
}
const G4ParticleDefinition * G4HadronicWhiteBoard::GetPDef() {return theDef;}
G4String G4HadronicWhiteBoard::GetParticleName() {return theName;}
G4double G4HadronicWhiteBoard::GetEnergy() {return theE;}
G4double G4HadronicWhiteBoard::GetPx(){return thePx;}
G4double G4HadronicWhiteBoard::GetPy(){return thePy;}
G4double G4HadronicWhiteBoard::GetPz(){return thePz;}
G4int G4HadronicWhiteBoard::GetA(){return theA;}
G4int G4HadronicWhiteBoard::GetZ(){return theZ;}
void G4HadronicWhiteBoard::SetProjectile(const G4HadProjectile & aProjectile)
{
theProjectile = & aProjectile;
theDef = theProjectile->GetDefinition();
theName = theDef->GetParticleName().c_str();
theE = theProjectile->Get4Momentum().t();
thePx = theProjectile->Get4Momentum().vect().x();
thePy = theProjectile->Get4Momentum().vect().y();
thePz = theProjectile->Get4Momentum().vect().z();
}
void G4HadronicWhiteBoard::SetTargetNucleus(const G4Nucleus & aTarget)
{
theTarget = aTarget;
theA = theTarget.GetA_asInt();
theZ = theTarget.GetZ_asInt();
}
void G4HadronicWhiteBoard::SetProcessName(const G4String& aProcessName)
{
theProcessName = aProcessName;
}
void G4HadronicWhiteBoard::SetModelName(const G4String& aModelName)
{
theModelName = aModelName;
}
void G4HadronicWhiteBoard::Dump()
{
std::cerr << std::endl;
std::cerr << "*** Geant4 Hadronic Reaction Information ***"
<< std::endl;
std::cerr << " Process: " << theProcessName << " , Model: "
<< theModelName << std::endl;
std::cerr << " Nucleus A, Z = " << theA << " " << theZ
<< std::endl;
std::cerr << " Projectile was a " << theName
<< std::endl;
std::cerr << " projectile momentum (px, py, pz) = (" << thePx << ", "
<< thePy << ", " << thePz << ")" << std::endl;
std::cerr << " Projectile energy = "<< theE
<< std::endl;
std::cerr << "*** End of Geant4 Hadronic Reaction Information ***"
<< std::endl;
G4Exception(theModelName, "001", FatalException, "segmentation fault");
}