Import Geant4 11.1.0.beta source tree
This commit is contained in:
@@ -1,17 +1,23 @@
|
||||
-------------------------------------------------------------------
|
||||
# Category phys-util History
|
||||
|
||||
=========================================================
|
||||
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
||||
=========================================================
|
||||
See `CONTRIBUTING.rst` for details of **required** info/format for each entry,
|
||||
which **must** added in reverse chronological order (newest at the top). It must **not**
|
||||
be used as a substitute for writing good git commit messages!
|
||||
|
||||
Hadronic physics-list/util History
|
||||
-----------------------------
|
||||
This file should be used to briefly summarize all major modifications
|
||||
introduced in the code and keeptrack of all tags.
|
||||
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
## 2022-03-26 Vladimir Ivanchenko (phys-util-V11-00-02)
|
||||
- G4PhysListUtil - use dynamic_cast instead of static_cast
|
||||
|
||||
## 2022-03-10 Vladimir Ivanchenko (phys-util-V11-00-01)
|
||||
- G4PhysListUtil - added new utility method to access a process
|
||||
via sub-type, simplified methods to access hadron processes
|
||||
|
||||
## 2021-12-10 Ben Morgan (phys-util-V11-00-00)
|
||||
- Change to new Markdown History format
|
||||
|
||||
---
|
||||
|
||||
# History entries prior to 11.0
|
||||
|
||||
22-October-2021, Vladimir Ivanchenko (phys-util-V10-07-02)
|
||||
- G4HadParticles - added hyper-nuclei
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4HadronicProcess.hh"
|
||||
#include "G4VProcess.hh"
|
||||
|
||||
class G4PhysListUtil
|
||||
{
|
||||
@@ -49,6 +50,8 @@ public:
|
||||
|
||||
static void InitialiseParameters();
|
||||
|
||||
static G4VProcess* FindProcess(const G4ParticleDefinition*, G4int subtype);
|
||||
|
||||
static G4HadronicProcess* FindInelasticProcess(const G4ParticleDefinition*);
|
||||
|
||||
static G4HadronicProcess* FindElasticProcess(const G4ParticleDefinition*);
|
||||
@@ -57,9 +60,5 @@ public:
|
||||
|
||||
static G4HadronicProcess* FindFissionProcess(const G4ParticleDefinition*);
|
||||
|
||||
private:
|
||||
// no instance needed
|
||||
G4PhysListUtil();
|
||||
~G4PhysListUtil();
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -49,79 +49,52 @@
|
||||
void G4PhysListUtil::InitialiseParameters()
|
||||
{
|
||||
G4NistManager::Instance();
|
||||
G4EmParameters::Instance()->SetDefaults();
|
||||
G4HadronicParameters::Instance();
|
||||
G4NuclearLevelData::GetInstance();
|
||||
}
|
||||
|
||||
G4VProcess* G4PhysListUtil::FindProcess(const G4ParticleDefinition* part,
|
||||
G4int subtype)
|
||||
{
|
||||
G4VProcess* proc = nullptr;
|
||||
if(nullptr == part) { return proc; }
|
||||
G4ProcessVector* pvec = part->GetProcessManager()->GetProcessList();
|
||||
if(nullptr == pvec) { return proc; }
|
||||
size_t n = pvec->size();
|
||||
for(size_t i=0; i<n; ++i) {
|
||||
auto ptr = (*pvec)[i];
|
||||
if(ptr != nullptr && subtype == ptr->GetProcessSubType()) {
|
||||
proc = ptr;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return proc;
|
||||
}
|
||||
|
||||
G4HadronicProcess*
|
||||
G4PhysListUtil::FindInelasticProcess(const G4ParticleDefinition* p)
|
||||
{
|
||||
G4HadronicProcess* had = nullptr;
|
||||
if(p) {
|
||||
G4ProcessVector* pvec = p->GetProcessManager()->GetProcessList();
|
||||
size_t n = pvec->size();
|
||||
for(size_t i=0; i<n; ++i) {
|
||||
auto proc = (*pvec)[i];
|
||||
if(proc != nullptr && fHadronInelastic == proc->GetProcessSubType()) {
|
||||
had = static_cast<G4HadronicProcess*>(proc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return had;
|
||||
auto proc = FindProcess(p, fHadronInelastic);
|
||||
return dynamic_cast<G4HadronicProcess*>(proc);
|
||||
}
|
||||
|
||||
G4HadronicProcess*
|
||||
G4PhysListUtil::FindElasticProcess(const G4ParticleDefinition* p)
|
||||
{
|
||||
G4HadronicProcess* had = nullptr;
|
||||
if(p) {
|
||||
G4ProcessVector* pvec = p->GetProcessManager()->GetProcessList();
|
||||
size_t n = pvec->size();
|
||||
for(size_t i=0; i<n; ++i) {
|
||||
auto proc = (*pvec)[i];
|
||||
if(proc != nullptr && fHadronElastic == proc->GetProcessSubType()) {
|
||||
had = static_cast<G4HadronicProcess*>(proc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return had;
|
||||
auto proc = FindProcess(p, fHadronElastic);
|
||||
return dynamic_cast<G4HadronicProcess*>(proc);
|
||||
}
|
||||
|
||||
G4HadronicProcess*
|
||||
G4PhysListUtil::FindCaptureProcess(const G4ParticleDefinition* p)
|
||||
{
|
||||
G4HadronicProcess* had = nullptr;
|
||||
if(p) {
|
||||
G4ProcessVector* pvec = p->GetProcessManager()->GetProcessList();
|
||||
size_t n = pvec->size();
|
||||
for(size_t i=0; i<n; ++i) {
|
||||
auto proc = (*pvec)[i];
|
||||
if(proc != nullptr && fCapture == proc->GetProcessSubType()) {
|
||||
had = static_cast<G4HadronicProcess*>(proc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return had;
|
||||
auto proc = FindProcess(p, fCapture);
|
||||
return dynamic_cast<G4HadronicProcess*>(proc);
|
||||
}
|
||||
|
||||
G4HadronicProcess*
|
||||
G4PhysListUtil::FindFissionProcess(const G4ParticleDefinition* p)
|
||||
{
|
||||
G4HadronicProcess* had = nullptr;
|
||||
if(p) {
|
||||
G4ProcessVector* pvec = p->GetProcessManager()->GetProcessList();
|
||||
size_t n = pvec->size();
|
||||
for(size_t i=0; i<n; ++i) {
|
||||
auto proc = (*pvec)[i];
|
||||
if(proc != nullptr && fFission == proc->GetProcessSubType()) {
|
||||
had = static_cast<G4HadronicProcess*>(proc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return had;
|
||||
auto proc = FindProcess(p, fFission);
|
||||
return dynamic_cast<G4HadronicProcess*>(proc);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user