Import Geant4 10.1.0 source tree
This commit is contained in:
@@ -13,6 +13,16 @@ introduced in the code and keeptrack of all tags.
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
04-Nov-2014, Robert Hatcher (phys-ctor-fact-V10-00-02)
|
||||
- Resubmit with new tag
|
||||
|
||||
04-Nov-2014, Robert Hatcher (phys-ctor-fact-V10-00-01)
|
||||
- Add macro for declaring phys constructors in a namespace to factory.
|
||||
- Methods for G4PhysicsConstructorRegistry to report known constructors.
|
||||
|
||||
29-Jan-2014, Gunter Folger (phys-ctor-fact-V10-00-00)
|
||||
- Removed electromagnetic/dna, cascade/{evaporation,utils}, and
|
||||
isotope_production from sources.cmake
|
||||
|
||||
07-Nov-2013, Alberto Ribon (phys-ctor-fact-V09-06-03)
|
||||
- Removed low_energy and high_energy from sources.cmake and GNUmakefile.
|
||||
|
||||
@@ -60,6 +60,14 @@ public:
|
||||
#define G4_DECLARE_PHYSCONSTR_FACTORY(physics_constructor) \
|
||||
const G4PhysicsConstructorFactory<physics_constructor>& physics_constructor##Factory = G4PhysicsConstructorFactory<physics_constructor>(#physics_constructor)
|
||||
|
||||
// support for phys constructors defined within a namespace
|
||||
// a bit tricky due to cpp macro expansion and the use of "::"
|
||||
// use G4_DECLARE_PHYSCONSTR_FACTORY_NS( myns::MyProc, myns, MyProc ) // without trailing ";"
|
||||
#define G4_DECLARE_PHYSCONSTR_FACTORY_NS( physics_constructor, nsname, pcbase ) \
|
||||
namespace nsname { \
|
||||
const G4PhysicsConstructorFactory<physics_constructor>& pcbase##Factory = G4PhysicsConstructorFactory<physics_constructor>(#physics_constructor); \
|
||||
}
|
||||
|
||||
#define G4_REFERENCE_PHYSCONSTR_FACTORY(physics_constructor) \
|
||||
class physics_constructor; \
|
||||
extern const G4PhysicsConstructorFactory<physics_constructor>& physics_constructor##Factory; \
|
||||
|
||||
@@ -75,6 +75,12 @@ public:
|
||||
void AddFactory(G4String, G4VBasePhysConstrFactory*);
|
||||
|
||||
G4VPhysicsConstructor* GetPhysicsConstructor(const G4String& name);
|
||||
|
||||
G4bool IsKnownPhysicsConstructor(const G4String& name);
|
||||
|
||||
std::vector<G4String> AvailablePhysicsConstructors() const;
|
||||
|
||||
void PrintAvailablePhysicsConstructors() const;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@ include_directories(${CMAKE_SOURCE_DIR}/source/physics_lists/constructors/stoppi
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/physics_lists/util/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/cuts/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/decay/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/electromagnetic/dna/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/electromagnetic/highenergy/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/electromagnetic/lowenergy/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/electromagnetic/muons/include)
|
||||
@@ -61,8 +60,6 @@ include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/cross_sections
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/management/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/binary_cascade/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/cascade/cascade/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/cascade/evaporation/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/cascade/utils/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/coherent_elastic/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/de_excitation/evaporation/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/de_excitation/fermi_breakup/include)
|
||||
@@ -77,7 +74,6 @@ include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/im_r_ma
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/inclxx/utils/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/inclxx/incl_physics/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/inclxx/interface/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/isotope_production/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/lend/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/lepto_nuclear/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/management/include)
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
//
|
||||
|
||||
#include "G4ios.hh"
|
||||
#include <iomanip>
|
||||
|
||||
#include "G4PhysicsConstructorRegistry.hh"
|
||||
#include "G4VPhysicsConstructor.hh"
|
||||
@@ -92,11 +93,11 @@ void G4PhysicsConstructorRegistry::Register(G4VPhysicsConstructor* p)
|
||||
|
||||
void G4PhysicsConstructorRegistry::DeRegister(G4VPhysicsConstructor* p)
|
||||
{
|
||||
if(!p) return;
|
||||
if ( !p ) return;
|
||||
size_t n = physConstr.size();
|
||||
if(n > 0) {
|
||||
if ( n > 0 ) {
|
||||
for (size_t i=0; i<n; ++i) {
|
||||
if(physConstr[i] == p) {
|
||||
if ( physConstr[i] == p ) {
|
||||
physConstr[i] = 0;
|
||||
return;
|
||||
}
|
||||
@@ -129,3 +130,35 @@ G4VPhysicsConstructor* G4PhysicsConstructorRegistry::GetPhysicsConstructor(const
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
G4bool G4PhysicsConstructorRegistry::IsKnownPhysicsConstructor(const G4String& name)
|
||||
{
|
||||
return ( factories.find(name) != factories.end() );
|
||||
}
|
||||
|
||||
|
||||
std::vector<G4String> G4PhysicsConstructorRegistry::AvailablePhysicsConstructors() const
|
||||
{
|
||||
std::vector<G4String> avail;
|
||||
std::map<G4String,G4VBasePhysConstrFactory*>::const_iterator itr;
|
||||
for ( itr = factories.begin(); itr != factories.end(); ++itr ) {
|
||||
avail.push_back(itr->first);
|
||||
}
|
||||
|
||||
return avail;
|
||||
}
|
||||
|
||||
void G4PhysicsConstructorRegistry::PrintAvailablePhysicsConstructors() const
|
||||
{
|
||||
std::vector<G4String> avail = AvailablePhysicsConstructors();
|
||||
G4cout << "G4VPhysicsConstructors in G4PhysicsConstructorRegistry are:"
|
||||
<< G4endl;
|
||||
if ( avail.empty() ) G4cout << "... no registered processes" << G4endl;
|
||||
else {
|
||||
size_t n = avail.size();
|
||||
for (size_t i=0; i<n; ++i ) {
|
||||
G4cout << " [" << std::setw(3) << i << "] "
|
||||
<< " \"" << avail[i] << "\"" << G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user