Import Geant4 10.1.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$Id: History 77998 2013-12-02 08:14:57Z gcosmo $
|
||||
$Id: History 86241 2014-11-07 17:27:00Z gcosmo $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -14,6 +14,25 @@ introduced in the code and keeptrack of all tags.
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
07-Nov-2014, Marc Verderi (phys-ctor-limiters-V10-00-04)
|
||||
- G4GenericBiasingPhysics : fix bug of PhysicsBias(...) which was not
|
||||
taking into account the vector of processes passed, but biasing all
|
||||
physics processes.
|
||||
|
||||
05-Aug-2014, Vladimir Ivanchenko (phys-ctor-limiters-V10-00-03)
|
||||
- G4NeurtonTrackingCut - register G4NeutronKiller in
|
||||
G4HadronicProcessStore - improved log and process deleted at exit
|
||||
|
||||
05-Jul-2014, Andrea Dotti (phys-ctor-limiters-V10-00-02)
|
||||
- Fix (possible) data-race condition in G4NeutronTrackingCut in
|
||||
calling G4MTcout (defect seen from DRD)
|
||||
|
||||
27-May-2014, Vladimir Ivanchenko (phys-ctor-limiters-V10-00-01)
|
||||
- G4StepLimiterPhysics - fixed minor memory leak reported by Coverity
|
||||
|
||||
29-Jan-2014, Gunter Folger (phys-ctor-limiters-V10-00-00)
|
||||
- Removed from photolepton_hadron/muon_nuclear from sources.cmake
|
||||
|
||||
30-Nov-2013, Alex Howard (phys-ctor-limiters-V09-06-14)
|
||||
- Fixed coverity errors (uninitialised variables)
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4NeutronTrackingCut.hh 71040 2013-06-10 09:25:30Z gcosmo $
|
||||
// $Id: G4NeutronTrackingCut.hh 83417 2014-08-21 15:29:32Z gcosmo $
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
@@ -45,10 +45,10 @@ class G4NeutronKiller;
|
||||
|
||||
class G4NeutronTrackingCut : public G4VPhysicsConstructor
|
||||
{
|
||||
public:
|
||||
G4NeutronTrackingCut(G4int ver=0);
|
||||
G4NeutronTrackingCut(const G4String& name,G4int ver=0);
|
||||
virtual ~G4NeutronTrackingCut();
|
||||
public:
|
||||
G4NeutronTrackingCut(G4int ver=0);
|
||||
G4NeutronTrackingCut(const G4String& name,G4int ver=0);
|
||||
virtual ~G4NeutronTrackingCut();
|
||||
|
||||
// This method will be invoked in the Construct() method.
|
||||
// each particle type will be instantiated
|
||||
@@ -70,7 +70,6 @@ private:
|
||||
G4double kineticEnergyLimit;
|
||||
|
||||
G4int verbose;
|
||||
static G4ThreadLocal G4bool wasActivated;
|
||||
};
|
||||
|
||||
inline void G4NeutronTrackingCut::SetTimeLimit(G4double val)
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4StepLimiterPhysics.hh 69707 2013-05-13 09:14:34Z gcosmo $
|
||||
// $Id: G4StepLimiterPhysics.hh 81367 2014-05-27 12:59:27Z gcosmo $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -63,6 +63,9 @@ private:
|
||||
G4StepLimiterPhysics & operator=(const G4StepLimiterPhysics &right);
|
||||
G4StepLimiterPhysics(const G4StepLimiterPhysics&);
|
||||
|
||||
G4StepLimiter* fStepLimiter;
|
||||
G4UserSpecialCuts* fUserSpecialCuts;
|
||||
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#
|
||||
# Generated on : 10/01/2013
|
||||
#
|
||||
# $Id: sources.cmake 77493 2013-11-25 10:23:04Z gcosmo $
|
||||
# $Id: sources.cmake 78908 2014-02-03 15:01:15Z gcosmo $
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
@@ -78,7 +78,6 @@ include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/parton_
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/parton_string/hadronization/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/parton_string/management/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/parton_string/qgsm/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/photolepton_hadron/muon_nuclear/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/pre_equilibrium/exciton_model/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/radioactive_decay/include)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/source/processes/hadronic/models/theo_high_energy/include)
|
||||
|
||||
@@ -30,8 +30,9 @@
|
||||
// ClassName: G4GenericBiasingPhysics
|
||||
//
|
||||
// Author: M. Verderi (Sept.10.2013)
|
||||
//
|
||||
// Modified:
|
||||
// 07/11/2014, M. Verderi : fix bug of PhysicsBias(...) which was not taking
|
||||
// into account the vector of processes passed, but biasing all.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
//
|
||||
@@ -121,31 +122,42 @@ void G4GenericBiasingPhysics::ConstructProcess()
|
||||
{
|
||||
G4ParticleDefinition* particle = aParticleIterator->value();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
|
||||
// -- include non physics process interface for biasing:
|
||||
if ( std::find(fNonPhysBiasedParticles.begin(),
|
||||
fNonPhysBiasedParticles.end(),
|
||||
particleName ) != fNonPhysBiasedParticles.end() )
|
||||
{
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
G4BiasingHelper::ActivateNonPhysicsBiasing(pmanager);
|
||||
}
|
||||
|
||||
// -- wrap biased physics processes, all processes or only user selected:
|
||||
std::vector< G4String >::const_iterator particleIt =
|
||||
std::find(fBiasedParticles.begin(),
|
||||
fBiasedParticles.end(),
|
||||
particleName );
|
||||
if ( particleIt == fBiasedParticles.end() ) continue;
|
||||
|
||||
if ( std::find(fBiasedParticles.begin(),
|
||||
fBiasedParticles.end(),
|
||||
particleName ) == fBiasedParticles.end() ) continue;
|
||||
std::vector < G4String >& biasedProcesses = fBiasedProcesses [ particleIt - fBiasedParticles.begin() ];
|
||||
G4bool biasAll = fBiasAllProcesses[ particleIt - fBiasedParticles.begin() ];
|
||||
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
G4ProcessVector* vprocess = pmanager->GetProcessList();
|
||||
if ( biasAll )
|
||||
{
|
||||
G4ProcessVector* vprocess = pmanager->GetProcessList();
|
||||
for (G4int ip = 0 ; ip < vprocess->size() ; ip++)
|
||||
{
|
||||
G4VProcess* process = (*vprocess)[ip];
|
||||
biasedProcesses.push_back( process->GetProcessName() );
|
||||
}
|
||||
}
|
||||
|
||||
G4bool restartLoop(true);
|
||||
while ( restartLoop )
|
||||
{
|
||||
for (G4int ip = 0 ; ip < vprocess->size() ; ip++)
|
||||
for (std::size_t ip = 0 ; ip < biasedProcesses.size() ; ip++)
|
||||
{
|
||||
G4VProcess* process = (*vprocess)[ip];
|
||||
G4bool activ = G4BiasingHelper::ActivatePhysicsBiasing(pmanager, process->GetProcessName());
|
||||
G4bool activ = G4BiasingHelper::ActivatePhysicsBiasing(pmanager, biasedProcesses[ip] );
|
||||
restartLoop = activ;
|
||||
if ( restartLoop ) break;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4NeutronTrackingCut.cc 71040 2013-06-10 09:25:30Z gcosmo $
|
||||
// $Id: G4NeutronTrackingCut.cc 83417 2014-08-21 15:29:32Z gcosmo $
|
||||
//
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
@@ -43,13 +43,13 @@
|
||||
|
||||
#include "G4Neutron.hh"
|
||||
#include "G4NeutronKiller.hh"
|
||||
#include "G4HadronicProcessStore.hh"
|
||||
|
||||
// factory
|
||||
#include "G4PhysicsConstructorFactory.hh"
|
||||
//
|
||||
G4_DECLARE_PHYSCONSTR_FACTORY(G4NeutronTrackingCut);
|
||||
//
|
||||
G4ThreadLocal G4bool G4NeutronTrackingCut::wasActivated = false;
|
||||
|
||||
G4NeutronTrackingCut::G4NeutronTrackingCut(G4int ver)
|
||||
: G4VPhysicsConstructor("neutronTrackingCut")
|
||||
@@ -57,7 +57,6 @@ G4NeutronTrackingCut::G4NeutronTrackingCut(G4int ver)
|
||||
{
|
||||
timeLimit = 10.*microsecond;
|
||||
kineticEnergyLimit = 0.0;
|
||||
//pNeutronKiller = 0;
|
||||
}
|
||||
|
||||
G4NeutronTrackingCut::G4NeutronTrackingCut(const G4String& name, G4int ver)
|
||||
@@ -65,13 +64,10 @@ G4NeutronTrackingCut::G4NeutronTrackingCut(const G4String& name, G4int ver)
|
||||
{
|
||||
timeLimit = 10.*microsecond;
|
||||
kineticEnergyLimit = 0.0;
|
||||
//pNeutronKiller = 0;
|
||||
}
|
||||
|
||||
G4NeutronTrackingCut::~G4NeutronTrackingCut()
|
||||
{
|
||||
//delete pNeutronKiller;
|
||||
}
|
||||
{}
|
||||
|
||||
void G4NeutronTrackingCut::ConstructParticle()
|
||||
{
|
||||
@@ -80,17 +76,14 @@ void G4NeutronTrackingCut::ConstructParticle()
|
||||
|
||||
void G4NeutronTrackingCut::ConstructProcess()
|
||||
{
|
||||
if(wasActivated) return;
|
||||
wasActivated = true;
|
||||
|
||||
// Add Process
|
||||
|
||||
G4NeutronKiller* pNeutronKiller = new G4NeutronKiller();
|
||||
G4ParticleDefinition * particle = G4Neutron::Neutron();
|
||||
G4ProcessManager * pmanager = particle->GetProcessManager();
|
||||
|
||||
if(verbose > 0) {
|
||||
G4cout << "### Adding tracking cuts for " << particle->GetParticleName()
|
||||
G4String pn = particle->GetParticleName();//Avoid data-race when passing
|
||||
//this string to G4MTcout
|
||||
G4cout << "### Adding tracking cuts for " << pn
|
||||
<< " TimeCut(ns)= " << timeLimit/ns
|
||||
<< " KinEnergyCut(MeV)= " << kineticEnergyLimit/MeV
|
||||
<< G4endl;
|
||||
@@ -98,6 +91,9 @@ void G4NeutronTrackingCut::ConstructProcess()
|
||||
pmanager -> AddDiscreteProcess(pNeutronKiller);
|
||||
pNeutronKiller->SetKinEnergyLimit(kineticEnergyLimit);
|
||||
pNeutronKiller->SetTimeLimit(timeLimit);
|
||||
|
||||
G4HadronicProcessStore::Instance()->RegisterExtraProcess(pNeutronKiller);
|
||||
G4HadronicProcessStore::Instance()->RegisterParticleForExtraProcess(pNeutronKiller, particle);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -55,14 +55,15 @@ G4_DECLARE_PHYSCONSTR_FACTORY(G4StepLimiterPhysics);
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4StepLimiterPhysics::G4StepLimiterPhysics(const G4String& name)
|
||||
: G4VPhysicsConstructor(name)
|
||||
{;
|
||||
}
|
||||
: G4VPhysicsConstructor(name),fStepLimiter(0),fUserSpecialCuts(0)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4StepLimiterPhysics::~G4StepLimiterPhysics()
|
||||
{;
|
||||
{
|
||||
delete fStepLimiter;
|
||||
delete fUserSpecialCuts;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -76,8 +77,8 @@ void G4StepLimiterPhysics::ConstructProcess()
|
||||
{
|
||||
aParticleIterator->reset();
|
||||
|
||||
G4StepLimiter* fStepLimiter = new G4StepLimiter();
|
||||
G4UserSpecialCuts* fUserSpecialCuts = new G4UserSpecialCuts();
|
||||
fStepLimiter = new G4StepLimiter();
|
||||
fUserSpecialCuts = new G4UserSpecialCuts();
|
||||
while ((*aParticleIterator)()) {
|
||||
G4ParticleDefinition* particle = aParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
|
||||
Reference in New Issue
Block a user