Import Geant4 11.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2023-12-08 10:43:34 +01:00
parent dd1f179cda
commit 860a2b92bf
3962 changed files with 139318 additions and 164259 deletions
@@ -6,6 +6,31 @@ It must **not** be used as a substitute for writing good git commit messages!
-------------------------------------------------------------------------------
## 2023-10-31 Vladimir Ivanchenko (phys-ctor-helastic-V11-01-06)
- G4ChargeExchangePhysics, G4ChargeExchangeMessenger - added UI commands
## 2023-10-25 Vladimir Ivanchenko (phys-ctor-helastic-V11-01-05)
- G4ChargeExchangePhysics - added Set method for the factor multiplying
the cross section (NA64 request).
## 2023-10-23 Vladimir Ivanchenko (phys-ctor-helastic-V11-01-04)
- G4ChargeExchangePhysics - added low energy limit to cross section of the
charge exchange process allowing use of it on top of any physics without
any cross section correction
## 2023-10-15 Vladimir Ivanchenko (phys-ctor-helastic-V11-01-03)
- G4HadronElasticPhysics, G4HadronElasticPhysicsXS, G4HadronElasticPhysicsHP,
G4HadronElasticPhysicsPHP - more accurate instantiation of models, cross
sections, and the neutron general process
- G4HadronElasticPhysicsVI - used alternative HP model and cross section
## 2023-08-25 Vladimir Ivanchenko (phys-ctor-helastic-V11-01-02)
- G4ChargeExchangePhysics - do not use G4PhysicsListHelper, because
charge exchange process is an addition to the main hadron process
## 2023-07-21 Vladimir Ivanchenko (phys-ctor-helastic-V11-01-01)
- G4ChargeExchangePhysics - updated constructor according to a new conception
## 2023-04-13 Alberto Ribon (phys-ctor-helastic-V11-01-00)
- Created new class G4HadronElasticPhysicsHPT, which inherits from
G4HadronElasticPhysicsHP and activates the special treatment of elastic
@@ -0,0 +1,69 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//---------------------------------------------------------------------------
//
// ClassName: G4ChargeExchangeMessenger
//
// Author: 2023 V. Ivanchenko created using G4EmMessenger
//
// Modified:
//
//----------------------------------------------------------------------------
//
#ifndef G4ChargeExchangeMessenger_h
#define G4ChargeExchangeMessenger_h 1
#include "G4UImessenger.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithADouble.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
class G4ChargeExchangePhysics;
class G4ChargeExchangeMessenger: public G4UImessenger
{
public:
explicit G4ChargeExchangeMessenger(G4ChargeExchangePhysics* af);
~G4ChargeExchangeMessenger() override;
void SetNewValue(G4UIcommand* aComm, G4String aS) override;
G4ChargeExchangeMessenger& operator=
(const G4ChargeExchangeMessenger& right) = delete;
G4ChargeExchangeMessenger(const G4ChargeExchangeMessenger&) = delete;
private:
G4ChargeExchangePhysics* theB;
G4UIcmdWithADouble* fCmd;
G4UIcmdWithADoubleAndUnit* lCmd;
G4UIdirectory* aDir;
};
#endif
@@ -45,12 +45,24 @@ class G4ChargeExchangePhysics : public G4VPhysicsConstructor
{
public:
explicit G4ChargeExchangePhysics(G4int ver = 1);
virtual ~G4ChargeExchangePhysics();
~G4ChargeExchangePhysics() override = default;
void ConstructParticle() override;
void ConstructProcess() override;
void SetLowEnergyLimit(G4double val) { fLowEnergyLimit = val; }
void SetCrossSectionFactor(G4double val) { fXSFactor = val; }
G4ChargeExchangePhysics& operator=
(const G4ChargeExchangePhysics& right) = delete;
G4ChargeExchangePhysics(const G4ChargeExchangePhysics&) = delete;
private:
G4double fLowEnergyLimit;
G4double fXSFactor{1.0};
};
@@ -58,7 +58,7 @@ public:
explicit G4HadronElasticPhysics(G4int ver = 1,
const G4String& nam = "hElasticWEL_CHIPS_XS");
virtual ~G4HadronElasticPhysics();
~G4HadronElasticPhysics() override = default;
// This method will be invoked in the Construct() method.
// each particle type will be instantiated
@@ -46,7 +46,7 @@ public:
explicit G4HadronElasticPhysicsHP(G4int ver = 1);
virtual ~G4HadronElasticPhysicsHP();
~G4HadronElasticPhysicsHP() override = default;
// This method will be invoked in the Construct() method.
// each physics process will be instantiated and
@@ -29,7 +29,8 @@
//
// Author: 2013, P. Arce
//
// Modified:
// Modified: 12.10.2023 V.Ivanchenko use this class to define alternative
// HP physics
//
//----------------------------------------------------------------------------
//
@@ -45,7 +46,7 @@ public:
explicit G4HadronElasticPhysicsPHP(G4int ver = 1);
virtual ~G4HadronElasticPhysicsPHP();
~G4HadronElasticPhysicsPHP() override = default;
// This method will be invoked in the Construct() method.
// each physics process will be instantiated and
@@ -0,0 +1,57 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//---------------------------------------------------------------------------
//
// ClassName: G4HadronElasticPhysicsVI
//
// Author: 17.10.2023 V.Ivanchenko
//
//----------------------------------------------------------------------------
//
#ifndef G4HadronElasticPhysicsVI_h
#define G4HadronElasticPhysicsVI_h 1
#include "G4HadronElasticPhysics.hh"
class G4HadronElasticPhysicsVI : public G4HadronElasticPhysics
{
public:
explicit G4HadronElasticPhysicsVI(G4int ver = 1);
~G4HadronElasticPhysicsVI() override = default;
// This method will be invoked in the Construct() method.
// each physics process will be instantiated and
// registered to the process manager of each particle type
void ConstructProcess() final;
G4HadronElasticPhysicsVI(const G4HadronElasticPhysicsVI&) = delete;
G4HadronElasticPhysicsVI& operator=(const G4HadronElasticPhysicsVI&) = delete;
};
#endif
@@ -46,12 +46,7 @@ public:
explicit G4HadronElasticPhysicsXS(G4int ver = 1);
virtual ~G4HadronElasticPhysicsXS();
// This method will be invoked in the Construct() method.
// each physics process will be instantiated and
// registered to the process manager of each particle type
void ConstructProcess() final;
~G4HadronElasticPhysicsXS() override = default;
G4HadronElasticPhysicsXS(G4HadronElasticPhysicsXS &) = delete;
G4HadronElasticPhysicsXS & operator=(const G4HadronElasticPhysicsXS &right) = delete;
@@ -3,6 +3,7 @@
# Define the Geant4 Module.
geant4_add_module(G4phys_ctor_helastic
PUBLIC_HEADERS
G4ChargeExchangeMessenger.hh
G4ChargeExchangePhysics.hh
G4HadronDElasticPhysics.hh
G4HadronElasticPhysics.hh
@@ -13,8 +14,10 @@ geant4_add_module(G4phys_ctor_helastic
G4HadronHElasticPhysics.hh
G4IonElasticPhysics.hh
G4HadronElasticPhysicsPHP.hh
G4HadronElasticPhysicsVI.hh
G4ThermalNeutrons.hh
SOURCES
G4ChargeExchangeMessenger.cc
G4ChargeExchangePhysics.cc
G4HadronDElasticPhysics.cc
G4HadronElasticPhysics.cc
@@ -25,6 +28,7 @@ geant4_add_module(G4phys_ctor_helastic
G4HadronHElasticPhysics.cc
G4IonElasticPhysics.cc
G4HadronElasticPhysicsPHP.cc
G4HadronElasticPhysicsVI.cc
G4ThermalNeutrons.cc)
geant4_module_link_libraries(G4phys_ctor_helastic
@@ -32,6 +36,7 @@ geant4_module_link_libraries(G4phys_ctor_helastic
G4globman
G4hadronic_coherent_elastic
G4hadronic_mgt
G4intercoms
G4phys_ctor_hinelastic
G4run
PRIVATE
@@ -48,4 +53,5 @@ geant4_module_link_libraries(G4phys_ctor_helastic
G4phys_ctor_factory
G4physlist_util
G4procman
G4shortlived
)
@@ -0,0 +1,74 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//---------------------------------------------------------------------------
//
// ClassName: G4ChargeExchangeMessenger
//
// Author: 2023 V. Ivanchenko
//
// Modified:
//
//----------------------------------------------------------------------------
//
#include "G4ChargeExchangeMessenger.hh"
#include "G4ChargeExchangePhysics.hh"
G4ChargeExchangeMessenger::G4ChargeExchangeMessenger(G4ChargeExchangePhysics* a)
: theB(a)
{
// general stuff.
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->AvailableForStates(G4State_PreInit);
fCmd->SetToBeBroadcasted(false);
lCmd = new G4UIcmdWithADoubleAndUnit("/process/cex/LowEnergyLimit",this);
lCmd->SetGuidance("Low-energy energy limit for charge exchange process");
lCmd->SetParameterName("cexLowE",true);
lCmd->SetUnitCategory("Energy");
lCmd->AvailableForStates(G4State_PreInit);
lCmd->SetToBeBroadcasted(false);
}
G4ChargeExchangeMessenger::~G4ChargeExchangeMessenger()
{
delete fCmd;
delete lCmd;
delete aDir;
}
void G4ChargeExchangeMessenger::SetNewValue(G4UIcommand* aComm, G4String aS)
{
if (aComm == fCmd)
theB->SetCrossSectionFactor(fCmd->GetNewDoubleValue(aS));
else if (aComm == lCmd)
theB->SetLowEnergyLimit(lCmd->GetNewDoubleValue(aS));
}
@@ -37,20 +37,24 @@
#include "G4ChargeExchangePhysics.hh"
#include "G4ChargeExchangeProcess.hh"
#include "G4ChargeExchangeXS.hh"
#include "G4ChargeExchange.hh"
#include "G4ParticleDefinition.hh"
#include "G4PhysicsListHelper.hh"
#include "G4ProcessManager.hh"
#include "G4MesonConstructor.hh"
#include "G4BaryonConstructor.hh"
#include "G4Neutron.hh"
#include "G4BGGPionElasticXS.hh"
#include "G4BGGNucleonElasticXS.hh"
#include "G4NeutronElasticXS.hh"
#include "G4ShortLivedConstructor.hh"
#include "G4PionPlus.hh"
#include "G4PionMinus.hh"
#include "G4KaonPlus.hh"
#include "G4KaonMinus.hh"
#include "G4KaonZeroLong.hh"
#include "G4HadronicParameters.hh"
#include "G4HadronInelasticProcess.hh"
#include "G4SystemOfUnits.hh"
// factory
#include "G4PhysicsConstructorFactory.hh"
@@ -58,65 +62,83 @@
G4_DECLARE_PHYSCONSTR_FACTORY(G4ChargeExchangePhysics);
G4ChargeExchangePhysics::G4ChargeExchangePhysics(G4int ver)
: G4VPhysicsConstructor("chargeExchange")
: G4VPhysicsConstructor("chargeExchange"),
fLowEnergyLimit(12*CLHEP::GeV)
{
// because it is an addition, the type of this constructor is 0
G4HadronicParameters::Instance()->SetVerboseLevel(ver);
if(ver > 1) G4cout << "### ChargeExchangePhysics" << G4endl;
if (ver > 1) {
G4cout << "### ChargeExchangePhysics above "
<< fLowEnergyLimit/CLHEP::GeV << " GeV." << G4endl;
}
}
G4ChargeExchangePhysics::~G4ChargeExchangePhysics()
{}
void G4ChargeExchangePhysics::ConstructParticle()
{
// G4cout << "G4ChargeExchangePhysics::ConstructParticle" << G4endl;
G4MesonConstructor pMesonConstructor;
pMesonConstructor.ConstructParticle();
G4BaryonConstructor pBaryonConstructor;
pBaryonConstructor.ConstructParticle();
G4ShortLivedConstructor pShortLivedConstructor;
pShortLivedConstructor.ConstructParticle();
}
void G4ChargeExchangePhysics::ConstructProcess()
{
G4ChargeExchange* model = new G4ChargeExchange();
auto xs = new G4ChargeExchangeXS();
xs->SetEnergyLimit(fLowEnergyLimit);
xs->SetCrossSectionFactor(fXSFactor);
if(G4HadronicParameters::Instance()->GetVerboseLevel() > 1) {
auto model = new G4ChargeExchange(xs);
if (G4HadronicParameters::Instance()->GetVerboseLevel() > 1) {
G4cout << "### ChargeExchangePhysics Construct Processes with the model <"
<< model->GetModelName() << ">" << G4endl;
<< model->GetModelName() << "> and x-section <"
<< xs->GetName() << "> XSFactor=" << fXSFactor
<< G4endl;
}
auto myParticleIterator=GetParticleIterator();
myParticleIterator->reset();
while( (*myParticleIterator)() )
{
G4ParticleDefinition* particle = myParticleIterator->value();
if( particle == G4Neutron::Definition() ||
particle == G4PionMinus::Definition() ||
particle == G4PionPlus::Definition() ||
particle == G4Proton::Definition()
) {
G4ProcessManager* pmanager = particle->GetProcessManager();
G4ChargeExchangeProcess* p = new G4ChargeExchangeProcess();
p->RegisterMe(model);
if( particle == G4PionMinus::Definition() || particle == G4PionPlus::Definition() ) {
p->AddDataSet( new G4BGGPionElasticXS( particle ) );
} else if( particle == G4Proton::Definition() ) {
p->AddDataSet( new G4BGGNucleonElasticXS( particle ) );
} else if( particle == G4Neutron::Definition() ) {
p->AddDataSet( new G4NeutronElasticXS );
}
pmanager->AddDiscreteProcess(p);
// pi-
G4ParticleDefinition* part = G4PionMinus::PionMinus();
auto proc =
new G4HadronInelasticProcess(part->GetParticleName()+"ChargeEx", part);
proc->AddDataSet( xs );
proc->RegisterMe( model );
G4ProcessManager* pman = part->GetProcessManager();
pman->AddDiscreteProcess(proc);
if(G4HadronicParameters::Instance()->GetVerboseLevel() > 1)
G4cout << "### ChargeExchangePhysics added for "
<< particle->GetParticleName() << G4endl;
}
}
// pi+
part = G4PionPlus::PionPlus();
proc = new G4HadronInelasticProcess(part->GetParticleName()+"ChargeEx", part);
proc->AddDataSet( xs );
proc->RegisterMe( model );
pman = part->GetProcessManager();
pman->AddDiscreteProcess(proc);
// kaon-
part = G4KaonMinus::KaonMinus();
proc = new G4HadronInelasticProcess(part->GetParticleName()+"ChargeEx", part);
proc->AddDataSet( xs );
proc->RegisterMe( model );
pman = part->GetProcessManager();
pman->AddDiscreteProcess(proc);
// kaon+
part = G4KaonPlus::KaonPlus();
proc = new G4HadronInelasticProcess(part->GetParticleName()+"ChargeEx", part);
proc->AddDataSet( xs );
proc->RegisterMe( model );
pman = part->GetProcessManager();
pman->AddDiscreteProcess(proc);
// KL
part = G4KaonZeroLong::KaonZeroLong();
proc = new G4HadronInelasticProcess(part->GetParticleName()+"ChargeEx", part);
proc->AddDataSet( xs );
proc->RegisterMe( model );
pman = part->GetProcessManager();
pman->AddDiscreteProcess(proc);
}
@@ -87,12 +87,8 @@ G4HadronElasticPhysics::G4HadronElasticPhysics(G4int ver, const G4String& nam)
SetPhysicsType(bHadronElastic);
}
G4HadronElasticPhysics::~G4HadronElasticPhysics()
{}
void G4HadronElasticPhysics::ConstructParticle()
{
// G4cout << "G4HadronElasticPhysics::ConstructParticle" << G4endl;
G4MesonConstructor pMesonConstructor;
pMesonConstructor.ConstructParticle();
@@ -113,7 +109,7 @@ void G4HadronElasticPhysics::ConstructProcess()
const G4double elimitAntiNuc = 100.*MeV;
const G4double delta = 0.1*MeV;
G4double emax = std::max(param->GetMaxEnergy(), elimitAntiNuc+delta);
if(param->GetVerboseLevel() > 1) {
if ( param->GetVerboseLevel() > 1 ) {
G4cout << "### HadronElasticPhysics::ConstructProcess: "
<< "Elimit for for anti-neuclei " << elimitAntiNuc/CLHEP::GeV << " GeV"
<< " for all hadrons Emax(GeV)= " << emax/CLHEP::GeV
@@ -140,7 +136,7 @@ void G4HadronElasticPhysics::ConstructProcess()
G4HadronElasticProcess* hel = new G4HadronElasticProcess();
hel->AddDataSet(new G4BGGNucleonElasticXS(particle));
hel->RegisterMe(new G4ChipsElasticModel());
if( useFactorXS ) hel->MultiplyCrossSectionBy( param->XSFactorNucleonElastic() );
if ( useFactorXS ) hel->MultiplyCrossSectionBy( param->XSFactorNucleonElastic() );
ph->RegisterProcess(hel, particle);
// n
@@ -153,7 +149,7 @@ void G4HadronElasticPhysics::ConstructProcess()
hel = new G4HadronElasticProcess();
hel->AddDataSet(new G4BGGPionElasticXS(particle));
hel->RegisterMe(he);
if( useFactorXS ) hel->MultiplyCrossSectionBy( param->XSFactorPionElastic() );
if ( useFactorXS ) hel->MultiplyCrossSectionBy( param->XSFactorPionElastic() );
ph->RegisterProcess(hel, particle);
// pi-
@@ -161,14 +157,14 @@ void G4HadronElasticPhysics::ConstructProcess()
hel = new G4HadronElasticProcess();
hel->AddDataSet(new G4BGGPionElasticXS(particle));
hel->RegisterMe(he);
if( useFactorXS ) hel->MultiplyCrossSectionBy( param->XSFactorPionElastic() );
if ( useFactorXS ) hel->MultiplyCrossSectionBy( param->XSFactorPionElastic() );
ph->RegisterProcess(hel, particle);
// kaons
G4HadronicBuilder::BuildElastic( G4HadParticles::GetKaons() );
// d, t, He3, alpha
for( auto & pdg : G4HadParticles::GetLightIons() ) {
for ( auto & pdg : G4HadParticles::GetLightIons() ) {
particle = table->FindParticle( pdg );
if ( particle == nullptr ) { continue; }
@@ -233,9 +229,17 @@ G4HadronElasticPhysics::GetElasticModel(const G4ParticleDefinition* part) const
{
G4HadronElastic* mod = nullptr;
G4HadronicProcess* hel = GetElasticProcess(part);
if(hel) {
std::vector<G4HadronicInteraction*>& hi = hel->GetHadronicInteractionList();
if( !hi.empty() ) { mod = static_cast<G4HadronElastic*>(hi[0]); }
if ( nullptr != hel ) {
const std::vector<G4HadronicInteraction*>& hi = hel->GetHadronicInteractionList();
if ( !hi.empty() ) {
for (auto const & p : hi) {
auto ptr = dynamic_cast<G4HadronElastic*>(p);
if ( nullptr != ptr ) {
mod = ptr;
break;
}
}
}
}
return mod;
}
@@ -254,7 +258,7 @@ void G4HadronElasticPhysics::AddXSection(const G4ParticleDefinition* part,
G4VCrossSectionDataSet* cross) const
{
G4HadronicProcess* hel = GetElasticProcess(part);
if(hel) { hel->AddDataSet(cross); }
if ( nullptr != hel ) { hel->AddDataSet(cross); }
}
@@ -55,15 +55,15 @@ G4_DECLARE_PHYSCONSTR_FACTORY(G4HadronElasticPhysicsHP);
G4HadronElasticPhysicsHP::G4HadronElasticPhysicsHP(G4int ver)
: G4HadronElasticPhysics(ver, "hElasticWEL_CHIPS_HP")
{
if(ver > 1) {
if ( ver > 1 ) {
G4cout << "### G4HadronElasticPhysicsHP: " << GetPhysicsName()
<< G4endl;
}
auto param = G4HadronicParameters::Instance();
// HP is inconsistent with the neutron general process
param->SetEnableNeutronGeneralProcess(false);
}
G4HadronElasticPhysicsHP::~G4HadronElasticPhysicsHP()
{}
void G4HadronElasticPhysicsHP::ConstructProcess()
{
G4HadronElasticPhysics::ConstructProcess();
@@ -71,13 +71,13 @@ void G4HadronElasticPhysicsHP::ConstructProcess()
const G4ParticleDefinition* neutron = G4Neutron::Neutron();
G4HadronElastic* he = GetElasticModel(neutron);
G4HadronicProcess* hel = GetElasticProcess(neutron);
if(he && hel) {
he->SetMinEnergy(19.5*MeV);
if ( nullptr != he && nullptr != hel ) {
he->SetMinEnergy(19.5*CLHEP::MeV);
hel->RegisterMe(new G4ParticleHPElastic());
hel->AddDataSet(new G4ParticleHPElasticData());
}
if(G4HadronicParameters::Instance()->GetVerboseLevel() > 1) {
if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 1 ) {
G4cout << "### HadronElasticPhysicsHP is constructed "
<< G4endl;
}
@@ -29,18 +29,23 @@
//
// Author: 2012, P. Arce
//
// Modified: 12.10.2023 V.Ivanchenko added usage of alternative neutron
// HP model and cross section
//
//----------------------------------------------------------------------------
//
// particle HP model for n with E < 20 MeV
// neutron HP model for E < 20 MeV
#include "G4HadronElasticPhysicsPHP.hh"
#include "G4Neutron.hh"
#include "G4HadronicProcess.hh"
#include "G4ProcessManager.hh"
#include "G4HadronElastic.hh"
#include "G4ParticleHPElastic.hh"
#include "G4ParticleHPElasticData.hh"
#include "G4SystemOfUnits.hh"
#include "G4HadronicParameters.hh"
#include "G4PhysListUtil.hh"
// factory
#include "G4PhysicsConstructorFactory.hh"
@@ -55,26 +60,34 @@ G4HadronElasticPhysicsPHP::G4HadronElasticPhysicsPHP(G4int ver)
G4cout << "### G4HadronElasticPhysicsPHP: " << GetPhysicsName()
<< G4endl;
}
auto param = G4HadronicParameters::Instance();
// HP is inconsistent with the neutron general process
param->SetEnableNeutronGeneralProcess(false);
}
G4HadronElasticPhysicsPHP::~G4HadronElasticPhysicsPHP()
{}
void G4HadronElasticPhysicsPHP::ConstructProcess()
{
G4HadronElasticPhysics::ConstructProcess();
const G4ParticleDefinition* neutron = G4Neutron::Neutron();
G4HadronElastic* he = GetElasticModel(neutron);
G4HadronicProcess* hel = GetElasticProcess(neutron);
if(he && hel) {
he->SetMinEnergy(19.5*MeV);
hel->RegisterMe(new G4ParticleHPElastic());
hel->AddDataSet(new G4ParticleHPElasticData());
G4HadronicProcess* hel = G4PhysListUtil::FindElasticProcess( neutron );
if ( nullptr == hel ) {
hel = new G4HadronicProcess();
neutron->GetProcessManager()->AddDiscreteProcess(hel);
} else {
G4HadronElastic* he = GetElasticModel(neutron);
he->SetMinEnergy(19.5*CLHEP::MeV);
}
// apply alternative cross section
hel->AddDataSet( new G4ParticleHPElasticData() );
if(G4HadronicParameters::Instance()->GetVerboseLevel() > 1) {
G4cout << "### HadronElasticPhysicsHP is constructed "
// add HP elastic
auto he = new G4ParticleHPElastic();
he->SetMaxEnergy(20*CLHEP::MeV);
hel->RegisterMe( he );
if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 1 ) {
G4cout << "### HadronElasticPhysicsPHP is constructed "
<< G4endl;
}
}
@@ -0,0 +1,93 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//---------------------------------------------------------------------------
//
// ClassName: G4HadronElasticPhysicsVI
//
// Author: 17.10.2023 V.Ivanchenko
//
//----------------------------------------------------------------------------
//
// neutron HP model for E < 20 MeV
#include "G4HadronElasticPhysicsVI.hh"
#include "G4Neutron.hh"
#include "G4HadronicProcess.hh"
#include "G4ProcessManager.hh"
#include "G4HadronElastic.hh"
#include "G4NeutronHPElasticVI.hh"
#include "G4ParticleHPElastic.hh"
#include "G4NeutronHPElasticXS.hh"
#include "G4SystemOfUnits.hh"
#include "G4HadronicParameters.hh"
#include "G4PhysListUtil.hh"
// factory
#include "G4PhysicsConstructorFactory.hh"
//
G4_DECLARE_PHYSCONSTR_FACTORY(G4HadronElasticPhysicsVI);
//
G4HadronElasticPhysicsVI::G4HadronElasticPhysicsVI(G4int ver)
: G4HadronElasticPhysics(ver, "nElasticPhysics_HP")
{
if(ver > 1) {
G4cout << "### G4HadronElasticPhysicsVI: " << GetPhysicsName()
<< G4endl;
}
auto param = G4HadronicParameters::Instance();
// HP is inconsistent with the neutron general process
param->SetEnableNeutronGeneralProcess(false);
}
void G4HadronElasticPhysicsVI::ConstructProcess()
{
G4HadronElasticPhysics::ConstructProcess();
const G4ParticleDefinition* neutron = G4Neutron::Neutron();
G4HadronicProcess* hel = G4PhysListUtil::FindElasticProcess( neutron );
if ( nullptr == hel ) {
hel = new G4HadronicProcess();
neutron->GetProcessManager()->AddDiscreteProcess(hel);
} else {
G4HadronElastic* he = GetElasticModel(neutron);
he->SetMinEnergy(19.5*CLHEP::MeV);
}
// apply alternative cross section
hel->AddDataSet( new G4NeutronHPElasticXS() );
// add HP elastic
auto he = new G4NeutronHPElasticVI();
he->SetMaxEnergy(20*CLHEP::MeV);
hel->RegisterMe( he );
if ( G4HadronicParameters::Instance()->GetVerboseLevel() > 1 ) {
G4cout << "### HadronElasticPhysicsVI is constructed "
<< G4endl;
}
}
@@ -38,14 +38,6 @@
// XS cross sections for neutrons
#include "G4HadronElasticPhysicsXS.hh"
#include "G4VCrossSectionDataSet.hh"
#include "G4Neutron.hh"
#include "G4Proton.hh"
#include "G4PionPlus.hh"
#include "G4PionMinus.hh"
#include "G4BGGNucleonElasticXS.hh"
#include "G4BGGPionElasticXS.hh"
#include "G4NeutronElasticXS.hh"
// factory
#include "G4PhysicsConstructorFactory.hh"
@@ -56,16 +48,8 @@ G4HadronElasticPhysicsXS::G4HadronElasticPhysicsXS(G4int ver)
: G4HadronElasticPhysics(ver, "hElasticWEL_CHIPS_XS")
{
if(ver > 1) {
G4cout << "### G4HadronElasticPhysicsHP: " << GetPhysicsName()
G4cout << "### G4HadronElasticPhysicsXS: " << GetPhysicsName()
<< G4endl;
}
}
G4HadronElasticPhysicsXS::~G4HadronElasticPhysicsXS()
{}
void G4HadronElasticPhysicsXS::ConstructProcess()
{
G4HadronElasticPhysics::ConstructProcess();
}