Import Geant4 11.4.1 source tree

This commit is contained in:
Gabriele Cosmo
2026-03-19 16:51:22 +01:00
parent b4a16de652
commit 41f2dd7996
352 changed files with 26342 additions and 24532 deletions
@@ -6,6 +6,11 @@ It must **not** be used as a substitute for writing good git commit messages!
-------------------------------------------------------------------------------
## 2026-02-24 Vladimir Ivanchenko (phys-ctor-em-V11-03-16)
- G4EmStandardPhysics_option4 - added a possibility to use external dEdx tables
for ions (problem #2703). It is done by substitution of the
G4LindhardSorencenIonModel model class by G4IonParameterisedModel.
## 2025-10-29 Vladimir Ivanchenko (phys-ctor-em-V11-03-15)
- G4OpticalPhysics - instantiate a process only if it is activated,
added option to instantiate a new G4GeneralCerenkov.
@@ -41,8 +41,8 @@
// and intermediate energies
//
#ifndef G4EmStandardPhysics_option4_h
#define G4EmStandardPhysics_option4_h 1
#ifndef G4EMSTANDARDPHYSICS_OPTION4_HH
#define G4EMSTANDARDPHYSICS_OPTION4_HH
#include "G4VPhysicsConstructor.hh"
#include "globals.hh"
@@ -55,10 +55,13 @@ public:
explicit G4EmStandardPhysics_option4(G4int ver=1, const G4String& name="");
~G4EmStandardPhysics_option4() override;
~G4EmStandardPhysics_option4() override = default;
void ConstructParticle() override;
void ConstructProcess() override;
private:
G4bool fUseExternalDEDX{false};
};
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -106,7 +106,7 @@ G4_DECLARE_PHYSCONSTR_FACTORY(G4EmStandardPhysics_option4);
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4EmStandardPhysics_option4::G4EmStandardPhysics_option4(G4int ver,
const G4String&)
const G4String& nam)
: G4VPhysicsConstructor("G4EmStandard_opt4")
{
SetVerboseLevel(ver);
@@ -134,14 +134,11 @@ G4EmStandardPhysics_option4::G4EmStandardPhysics_option4(G4int ver,
param->SetMaxNIELEnergy(1*CLHEP::MeV);
param->SetPositronAtRestModelType(fAllisonPositronium);
SetPhysicsType(bElectromagnetic);
if (!nam.empty()) { fUseExternalDEDX = true; }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4EmStandardPhysics_option4::~G4EmStandardPhysics_option4() = default;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4EmStandardPhysics_option4::ConstructParticle()
{
// minimal set of particles for EM physics
@@ -318,7 +315,11 @@ void G4EmStandardPhysics_option4::ConstructProcess()
// generic ion
particle = G4GenericIon::GenericIon();
G4ionIonisation* ionIoni = new G4ionIonisation();
ionIoni->SetEmModel(new G4LindhardSorensenIonModel());
if (fUseExternalDEDX) {
ionIoni->SetEmModel(new G4IonParametrisedLossModel());
} else {
ionIoni->SetEmModel(new G4LindhardSorensenIonModel());
}
ph->RegisterProcess(hmsc, particle);
ph->RegisterProcess(ionIoni, particle);
if(nullptr != pnuc) { ph->RegisterProcess(pnuc, particle); }
@@ -6,6 +6,10 @@ It must **not** be used as a substitute for writing good git commit messages!
-------------------------------------------------------------------------------
## 2026-01-21 Vladimir Ivanchenko (phys-ctor-helastic-V11-03-01)
- G4ChargeExchangePhysics, G4ChargeExchangemessenger - added two
different biasing factors for pions and kaons (urgent request of NA64).
## 2025-04-15 Vladimir Ivanchenko (phys-ctor-helastic-V11-03-00)
- G4ChargeExchangePhysics - fixed usage of the messenger
@@ -35,8 +35,8 @@
//----------------------------------------------------------------------------
//
#ifndef G4ChargeExchangeMessenger_h
#define G4ChargeExchangeMessenger_h 1
#ifndef G4CHARGEEXCHANGEMESSENGER_HH
#define G4CHARGEEXCHANGEMESSENGER_HH
#include "G4UImessenger.hh"
#include "G4UIdirectory.hh"
@@ -62,6 +62,7 @@ private:
G4ChargeExchangePhysics* theB;
G4UIcmdWithADouble* fCmd;
G4UIcmdWithADouble* fCmd1;
G4UIcmdWithADoubleAndUnit* lCmd;
G4UIdirectory* aDir;
};
@@ -35,8 +35,8 @@
//----------------------------------------------------------------------------
//
#ifndef G4ChargeExchangePhysics_h
#define G4ChargeExchangePhysics_h 1
#ifndef G4CHARGEEXCHANGEPHYSICS_HH
#define G4CHARGEEXCHANGEPHYSICS_HH
#include "globals.hh"
#include "G4VPhysicsConstructor.hh"
@@ -55,8 +55,10 @@ public:
void SetLowEnergyLimit(G4double val) { fLowEnergyLimit = val; }
void SetCrossSectionFactor(G4double val) { fXSFactor = val; }
void SetPionCrossSectionFactor(G4double val) { fXSFactorPi = val; }
void SetKaonCrossSectionFactor(G4double val) { fXSFactorK = val; }
G4ChargeExchangePhysics& operator=
(const G4ChargeExchangePhysics& right) = delete;
G4ChargeExchangePhysics(const G4ChargeExchangePhysics&) = delete;
@@ -66,10 +68,10 @@ private:
G4ChargeExchangeMessenger* theMessenger;
G4double fLowEnergyLimit;
G4double fXSFactor{1.0};
G4double fXSFactorPi{1.0};
G4double fXSFactorK{1.0};
};
#endif
@@ -77,5 +79,3 @@ private:
@@ -45,11 +45,16 @@ G4ChargeExchangeMessenger::G4ChargeExchangeMessenger(G4ChargeExchangePhysics* a)
aDir = new G4UIdirectory("/physics_lists/cex/", false);
aDir->SetGuidance("tailoring the hadronic charge exchange processes.");
fCmd = new G4UIcmdWithADouble("/physics_lists/cex/BiasFactor",this);
fCmd->SetGuidance("Charge exchange cross section factor");
fCmd = new G4UIcmdWithADouble("/physics_lists/cex/PionBiasFactor",this);
fCmd->SetGuidance("Pion charge exchange cross section factor");
fCmd->AvailableForStates(G4State_PreInit);
fCmd->SetToBeBroadcasted(false);
fCmd1 = new G4UIcmdWithADouble("/physics_lists/cex/KaonBiasFactor",this);
fCmd1->SetGuidance("Kaon charge exchange cross section factor");
fCmd1->AvailableForStates(G4State_PreInit);
fCmd1->SetToBeBroadcasted(false);
lCmd = new G4UIcmdWithADoubleAndUnit("/process/cex/LowEnergyLimit",this);
lCmd->SetGuidance("Low-energy energy limit for charge exchange process");
lCmd->SetParameterName("cexLowE",true);
@@ -61,14 +66,18 @@ G4ChargeExchangeMessenger::G4ChargeExchangeMessenger(G4ChargeExchangePhysics* a)
G4ChargeExchangeMessenger::~G4ChargeExchangeMessenger()
{
delete fCmd;
delete fCmd1;
delete lCmd;
delete aDir;
}
void G4ChargeExchangeMessenger::SetNewValue(G4UIcommand* aComm, G4String aS)
{
if (aComm == fCmd)
theB->SetCrossSectionFactor(fCmd->GetNewDoubleValue(aS));
else if (aComm == lCmd)
if (aComm == fCmd) {
theB->SetPionCrossSectionFactor(fCmd->GetNewDoubleValue(aS));
} else if (aComm == fCmd1) {
theB->SetKaonCrossSectionFactor(fCmd1->GetNewDoubleValue(aS));
} else if (aComm == lCmd) {
theB->SetLowEnergyLimit(lCmd->GetNewDoubleValue(aS));
}
}
@@ -96,14 +96,15 @@ void G4ChargeExchangePhysics::ConstructProcess()
{
auto xs = new G4ChargeExchangeXS();
xs->SetEnergyLimit(fLowEnergyLimit);
xs->SetCrossSectionFactor(fXSFactor);
xs->SetPionCrossSectionFactor(fXSFactorPi);
xs->SetKaonCrossSectionFactor(fXSFactorK);
auto model = new G4ChargeExchange(xs);
if (G4HadronicParameters::Instance()->GetVerboseLevel() > 1) {
G4cout << "### ChargeExchangePhysics Construct Processes with the model <"
<< model->GetModelName() << "> and x-section <"
<< xs->GetName() << "> XSFactor=" << fXSFactor
<< xs->GetName() << "> XSFactorPi=" << fXSFactorPi << ", XSFactorK=" << fXSFactorK
<< G4endl;
}
@@ -6,6 +6,16 @@ It must **not** be used as a substitute for writing good git commit messages!
-------------------------------------------------------------------------------
## 2026-01-27 Vladimir Ivanchenko (phys-ctor-hinelastic-V11-03-07)
- G4HadronInelasticQBBC - return back cross section G4ParticleInelasticXS
for protons, as it was in 11.3.
## 2026-01-23 Ben Morgan
- Fix segfault on gcc15/Debug/CXX23 build caused by destruction of G4NeutronPHPBuilder
instance used by G4NeutronBuilder in G4HadronPhysicsShielding.
- Triaged and fix proposed by Gunter Folger.
- See Issue #270
## 2025-11-19 Vladimir Ivanchenko (phys-ctor-hinelastic-V11-03-06)
- G4HadronPhysicsQGSP_BERT. G4HadronInelasticQBBC - return back cross section
G4BGGNucleonInelasticXS for protons, as it was in 11.3. There are problems
@@ -152,7 +152,7 @@ void G4HadronInelasticQBBC::ConstructProcess()
G4ParticleDefinition* particle = G4Proton::Proton();
G4HadronicProcess* hp =
new G4HadronInelasticProcess( particle->GetParticleName()+"Inelastic", particle );
hp->AddDataSet( new G4BGGNucleonInelasticXS(particle) );
hp->AddDataSet( new G4ParticleInelasticXS(particle) );
hp->RegisterMe(theFTFP);
hp->RegisterMe(theBERT);
hp->RegisterMe(theBIC);
@@ -126,8 +126,8 @@ void G4HadronPhysicsShielding::Neutron()
bertneu.SetMinEnergy( minBERT_neutron );
neu.RegisterMe( &bertneu );
G4NeutronPHPBuilder hpneu;
if ( !useLEND_) {
G4NeutronPHPBuilder hpneu;
neu.RegisterMe( &hpneu );
}
neu.Build();