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 66892 2013-01-17 10:57:59Z gunter $
# ----------------------------------------------------------------
# GNUmakefile for hadronic management library. G.Folger 10-Dec-97
# ----------------------------------------------------------------
@@ -33,18 +32,3 @@ CPPFLAGS += -I$(G4BASE)/global/management/include \
-I$(G4BASE)/materials/include
include $(G4INSTALL)/config/common.gmk
ifneq (,$(findstring WIN32-VC,$(G4SYSTEM)))
CXXFLAGS_WITH_ZM = $(filter-out -Zm%,$(CXXFLAGS)) -Zm500
else
CXXFLAGS_WITHOUT_O := $(filter-out -O% , $(CXXFLAGS))
CXXFLAGS_WITHOUT_O := $(filter-out +O% , $(CXXFLAGS_WITHOUT_O))
$(G4TMPDIR)/G4HadronicInteractionWrapper.o: src/G4HadronicInteractionWrapper.cc
@$(ECHO) Compiling G4HadronicInteractionWrapper.cc ...
@$(CXX) $(CXXFLAGS_WITHOUT_O) $(CPPFLAGS) -g -c -o $@ \
src/G4HadronicInteractionWrapper.cc
endif
@@ -14,6 +14,37 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
08 November 2018 V. Ivanchenko (hadr-man-V10-04-12)
07 November 2018 V. Ivanchenko (hadr-man-V10-04-10)
06 November 2018 V. Ivanchenko (hadr-man-V10-04-09)
---------------------------------------------------
- G4HadronicProcess - added check if secondary particle is on the mass
shell, if its mass differ from the PDG mass more for 1.5 MeV then mass
is forced to the mass shell, energy concerved, but momentum is changed
20 August 2018 V. Ivanchenko (hadr-man-V10-04-08)
---------------------------------------------------
- G4HadronicInteractionWrapper - removed as obsolete class
10 August 2018 A. Ribon (hadr-man-V10-04-07)
---------------------------------------------------
- sources.cmake, G4HadronicParameters : moved away class G4HadronicParameters
in hadronic/util/ 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).
6 August 2018 A. Ribon (hadr-man-V10-04-06)
---------------------------------------------------
- G4HadronicParameters : created new singleton to keep global hadronic
parameters. For the time being, it has only the high-energy limit of
hadronic physics (instead of spreading this value in many different
files, as done up to now). The default value is set to 100 TeV.
14 July 2018 M.Maire (hadr-man-V10-04-05)
---------------------------------------------------
- add function G4HadronicProcess::GetHadronicModel(modelName)
which return a G4HadronicInteraction*
8 June 2018 J. Yarba (hadr-man-V10-04-04)
---------------------------------------------------
- G4HadronicProcess - use correct return type when calling CheckResult
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4EnergyRangeManager.hh 98067 2016-07-01 16:33:54Z gcosmo $
//
// Hadronic Process: Energy Range Manager
// original by H.P. Wellisch
@@ -1,43 +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. *
// ********************************************************************
//
#ifndef G4HadronicInteractionWrapper_h
#define G4HadronicInteractionWrapper_h 1
#include "G4HadronicWhiteBoard.hh"
#include "G4HadFinalState.hh"
#include "G4HadronicInteraction.hh"
class G4HadronicInteractionWrapper
{
public:
G4HadFinalState * ApplyInteraction(G4HadProjectile& thePro,
G4Nucleus& targetNucleus,
G4HadronicInteraction* theInteraction,
const G4String& theProcessName,
const G4String& theModelName);
};
#endif
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4HadronicProcess.hh 110586 2018-05-31 12:01:42Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -111,7 +110,10 @@ public:
// access to the list of hadronic interactions
std::vector<G4HadronicInteraction*>& GetHadronicInteractionList();
// access to an hadronic interaction by name
G4HadronicInteraction* GetHadronicModel(const G4String&);
// get inverse cross section per volume
G4double GetMeanFreePath(const G4Track &aTrack, G4double,
G4ForceCondition *) override;
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4HadronicProcessStore.hh 110586 2018-05-31 12:01:42Z gcosmo $
//
//
// -------------------------------------------------------------------
@@ -24,7 +24,6 @@
// ********************************************************************
//
//
// $Id: G4HadronicProcessType.hh 106150 2017-09-14 06:41:57Z gcosmo $
//
//
//---------------------------------------------------------------
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4VLeadingParticleBiasing.hh 110579 2018-05-30 15:03:30Z gcosmo $
//
// --------------------------------------------------------------------
#ifndef G4VLeadingParticleBiasing_h
@@ -11,7 +11,6 @@
#
# Generated on : 24/9/2010
#
# $Id: sources.cmake 66892 2013-01-17 10:57:59Z gunter $
#
#------------------------------------------------------------------------------
@@ -49,7 +48,6 @@ GEANT4_DEFINE_MODULE(NAME G4hadronic_mgt
G4HadLeadBias.hh
G4HadronInelasticProcess.hh
G4HadronicEPTestMessenger.hh
G4HadronicInteractionWrapper.hh
G4HadronicProcess.hh
G4HadronicProcessStore.hh
G4HadronicProcessType.hh
@@ -60,7 +58,6 @@ GEANT4_DEFINE_MODULE(NAME G4hadronic_mgt
G4HadLeadBias.cc
G4HadronInelasticProcess.cc
G4HadronicEPTestMessenger.cc
G4HadronicInteractionWrapper.cc
G4HadronicProcess.cc
G4HadronicProcessStore.cc
GRANULAR_DEPENDENCIES
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4EnergyRangeManager.cc 98067 2016-07-01 16:33:54Z gcosmo $
//
// Hadronic Process: Energy Range Manager
// original by H.P. Wellisch
@@ -1,41 +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 "G4HadronicInteractionWrapper.hh"
G4HadFinalState* G4HadronicInteractionWrapper::
ApplyInteraction(G4HadProjectile& thePro,
G4Nucleus& targetNucleus,
G4HadronicInteraction* theInteraction,
const G4String& theProcessName,
const G4String& theModelName)
{
static G4ThreadLocal G4HadronicWhiteBoard *theBoard_G4MT_TLS_ = 0 ; if (!theBoard_G4MT_TLS_) theBoard_G4MT_TLS_ = & G4HadronicWhiteBoard::Instance();G4HadronicWhiteBoard &theBoard = *theBoard_G4MT_TLS_;
theBoard.SetProjectile(thePro);
theBoard.SetTargetNucleus(targetNucleus);
theBoard.SetProcessName(theProcessName);
theBoard.SetModelName(theModelName);
return theInteraction->ApplyYourself( thePro, targetNucleus);
}
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4HadronicProcess.cc 110727 2018-06-11 06:08:11Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -387,20 +386,15 @@ G4HadronicProcess::PostStepDoIt(const G4Track& aTrack, const G4Step&)
const G4ParticleDefinition* particleDefinition = dynamicParticle->GetParticleDefinition();
if ( particleDefinition == G4KaonZero::Definition() ||
particleDefinition == G4AntiKaonZero::Definition() ) {
G4ParticleDefinition* newParticleDefinition = G4KaonZeroShort::Definition();
if ( G4UniformRand() > 0.5 ) newParticleDefinition = G4KaonZeroLong::Definition();
G4double dynamicMass = dynamicParticle->GetMass();
dynamicParticle->SetDefinition( newParticleDefinition );
dynamicParticle->SetMass( dynamicMass );
G4ParticleDefinition* newPart;
if( G4UniformRand() > 0.5 ) { newPart = G4KaonZeroShort::Definition(); }
else { newPart = G4KaonZeroLong::Definition(); }
dynamicParticle->SetDefinition( newPart );
G4ExceptionDescription ed;
ed << " Hadronic model " << theInteraction->GetModelName() << G4endl;
ed << " created " << particleDefinition->GetParticleName() << G4endl;
ed << " -> forced to be " << newParticleDefinition->GetParticleName() << G4endl;
ed << " -> forced to be " << newPart->GetParticleName() << G4endl;
G4Exception( "G4HadronicProcess::PostStepDoIt", "had007", JustWarning, ed );
//if ( std::abs( dynamicMass - particleDefinition->GetPDGMass() ) > 0.1*CLHEP::eV ) {
// G4cout << "\t dynamicMass=" << dynamicMass << " != PDGMass="
// << particleDefinition->GetPDGMass() << G4endl;
//}
}
}
}
@@ -501,13 +495,37 @@ G4HadronicProcess::FillResult(G4HadFinalState * aR, const G4Track & aT)
if (nSec > 0) {
G4double time0 = aT.GetGlobalTime();
for (G4int i = 0; i < nSec; ++i) {
G4LorentzVector theM = aR->GetSecondary(i)->GetParticle()->Get4Momentum();
G4DynamicParticle* dynamicParticle = aR->GetSecondary(i)->GetParticle();
G4LorentzVector theM = dynamicParticle->Get4Momentum();
theM.rotate(rotation, it);
theM *= aR->GetTrafoToLab();
aR->GetSecondary(i)->GetParticle()->Set4Momentum(theM);
const G4ParticleDefinition* part = dynamicParticle->GetDefinition();
G4double mass = part->GetPDGMass();
G4double dmass= theM.mag();
// check if secondary is on the mass shell
if(std::abs(dmass - mass) > 1.5*CLHEP::MeV || theM.e() < mass) {
if(G4HadronicProcess_debug_flag) {
G4ExceptionDescription ed;
ed << "TrackID= "<< aT.GetTrackID()
<< " " << aT.GetParticleDefinition()->GetParticleName()
<< " Target Z= " << targetNucleus.GetZ_asInt() << " A= "
<< targetNucleus.GetA_asInt()
<< " Ekin(GeV)= " << aT.GetKineticEnergy()/CLHEP::GeV
<< "\n Secondary is out of mass shell: " << part->GetParticleName()
<< " Ekin(MeV)= " << theM.e() - mass
<< " DeltaMass(MeV)= " << dmass - mass << G4endl;
G4Exception("G4HadronicProcess::FillResults", "had012", JustWarning, ed);
}
G4double e = std::max(theM.e(), mass);
G4double mom = std::sqrt((e - mass)*(e + mass));
G4ThreeVector v = theM.vect().unit();
theM.set(v.x()*mom,v.y()*mom,v.z()*mom,e);
}
dynamicParticle->Set4Momentum(theM);
dynamicParticle->SetMass(mass);
if(idxIC == aR->GetSecondary(i)->GetCreatorModelType())
{ ++nICelectrons; }
G4int idxModel = aR->GetSecondary(i)->GetCreatorModelType();
if(idxIC == idxModel) { ++nICelectrons; }
// time of interaction starts from zero
G4double time = aR->GetSecondary(i)->GetTime();
@@ -516,20 +534,9 @@ G4HadronicProcess::FillResult(G4HadFinalState * aR, const G4Track & aT)
// take into account global time
time += time0;
G4Track* track = new G4Track(aR->GetSecondary(i)->GetParticle(),
time, aT.GetPosition());
track->SetCreatorModelIndex(aR->GetSecondary(i)->GetCreatorModelType());
G4Track* track = new G4Track(dynamicParticle, time, aT.GetPosition());
track->SetCreatorModelIndex(idxModel);
G4double newWeight = fWeight*aR->GetSecondary(i)->GetWeight();
// G4cout << "#### ParticleDebug "
// <<GetProcessName()<<" "
//<<aR->GetSecondary(i)->GetParticle()->GetDefinition()->GetParticleName()
//<<" "<<aScaleFactor<<" "
// <<XBiasSurvivalProbability()<<" "
// <<XBiasSecondaryWeight()<<" "
// <<aT.GetWeight()<<" "
// <<aR->GetSecondary(i)->GetWeight()<<" "
// <<aR->GetSecondary(i)->GetParticle()->Get4Momentum()<<" "
// <<G4endl;
track->SetWeight(newWeight);
track->SetTouchableHandle(aT.GetTouchableHandle());
theTotalResult->AddSecondary(track);
@@ -538,7 +545,7 @@ G4HadronicProcess::FillResult(G4HadFinalState * aR, const G4Track & aT)
if (e <= 0.0) {
G4ExceptionDescription ed;
DumpState(aT,"Secondary has zero energy",ed);
ed << "Secondary " << track->GetDefinition()->GetParticleName()
ed << "Secondary " << part->GetParticleName()
<< G4endl;
G4Exception("G4HadronicProcess::FillResults", "had011",
JustWarning,ed);
@@ -840,3 +847,14 @@ G4HadronicProcess::GetHadronicInteractionList()
{
return theEnergyRangeManager.GetHadronicInteractionList();
}
G4HadronicInteraction*
G4HadronicProcess::GetHadronicModel(const G4String& modelName)
{
std::vector<G4HadronicInteraction*>& list
= theEnergyRangeManager.GetHadronicInteractionList();
for (size_t li=0; li<list.size(); li++) {
if (list[li]->GetModelName() == modelName) return list[li];
}
return nullptr;
}
@@ -23,7 +23,6 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4HadronicProcessStore.cc 110586 2018-05-31 12:01:42Z gcosmo $
//
// -------------------------------------------------------------------
//