Import Geant4 11.0.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2021-06-25 16:12:29 +02:00
parent c968e26a39
commit 6399a014b6
4200 changed files with 207479 additions and 237366 deletions
@@ -33,7 +33,6 @@
#include "EventAction.hh"
#include "TrackingAction.hh"
#include "SteppingAction.hh"
#include "SteppingVerbose.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -76,10 +75,3 @@ void ActionInitialization::Build() const
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VSteppingVerbose* ActionInitialization::InitializeSteppingVerbose() const
{
return new SteppingVerbose();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -40,6 +40,7 @@
#include "G4ComptonScattering.hh"
#include "G4GammaConversion.hh"
#include "G4PhotoElectricEffect.hh"
#include "G4RayleighScattering.hh"
#include "G4eMultipleScattering.hh"
#include "G4eIonisation.hh"
@@ -72,8 +73,10 @@ ElectromagneticPhysics::ElectromagneticPhysics(const G4String& name)
G4EmParameters* param = G4EmParameters::Instance();
param->SetDefaults();
param->SetVerbose(0);
param->SetStepFunction(1., 1*mm); //default= 0.1, 100*um
param->SetStepFunctionMuHad(1., 1*mm);
param->SetStepFunction(0.2, 1*mm); //default= 0.1, 100*um
param->SetStepFunctionMuHad(0.2, 1*mm);
param->SetStepFunctionLightIons(0.2, 100*um);
param->SetStepFunctionIons(0.2, 50*um);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -96,7 +99,8 @@ void ElectromagneticPhysics::ConstructProcess()
G4String particleName = particle->GetParticleName();
if (particleName == "gamma") {
ph->RegisterProcess(new G4RayleighScattering, particle);
ph->RegisterProcess(new G4PhotoElectricEffect, particle);
ph->RegisterProcess(new G4ComptonScattering, particle);
ph->RegisterProcess(new G4GammaConversion, particle);
@@ -104,13 +108,13 @@ void ElectromagneticPhysics::ConstructProcess()
} else if (particleName == "e-") {
ph->RegisterProcess(new G4eMultipleScattering(), particle);
ph->RegisterProcess(new G4eIonisation(), particle);
ph->RegisterProcess(new G4eIonisation, particle);
ph->RegisterProcess(new G4eBremsstrahlung(), particle);
} else if (particleName == "e+") {
ph->RegisterProcess(new G4eMultipleScattering(), particle);
ph->RegisterProcess(new G4eIonisation(), particle);
ph->RegisterProcess(new G4eIonisation, particle);
ph->RegisterProcess(new G4eBremsstrahlung(), particle);
ph->RegisterProcess(new G4eplusAnnihilation(), particle);
@@ -118,7 +122,7 @@ void ElectromagneticPhysics::ConstructProcess()
particleName == "mu-" ) {
ph->RegisterProcess(new G4MuMultipleScattering(), particle);
ph->RegisterProcess(new G4MuIonisation(), particle);
ph->RegisterProcess(new G4MuIonisation, particle);
ph->RegisterProcess(new G4MuBremsstrahlung(), particle);
ph->RegisterProcess(new G4MuPairProduction(), particle);
@@ -127,13 +131,13 @@ void ElectromagneticPhysics::ConstructProcess()
particleName == "pi+" ) {
ph->RegisterProcess(new G4hMultipleScattering(), particle);
ph->RegisterProcess(new G4hIonisation(), particle);
ph->RegisterProcess(new G4hIonisation, particle);
} else if( particleName == "alpha" ||
particleName == "He3" ) {
ph->RegisterProcess(new G4hMultipleScattering(), particle);
ph->RegisterProcess(new G4ionIonisation(), particle);
ph->RegisterProcess(new G4ionIonisation, particle);
ph->RegisterProcess(new G4NuclearStopping(), particle);
} else if( particleName == "GenericIon" ) {
@@ -37,10 +37,12 @@
// Processes
#include "G4PhotoNuclearProcess.hh"
#include "G4HadronInelasticProcess.hh"
#include "G4LowEGammaNuclearModel.hh"
#include "G4CascadeInterface.hh"
#include "G4PhotoNuclearCrossSection.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -58,7 +60,8 @@ GammaNuclearPhysics::~GammaNuclearPhysics()
void GammaNuclearPhysics::ConstructProcess()
{
G4PhotoNuclearProcess* process = new G4PhotoNuclearProcess();
G4HadronInelasticProcess* process = new G4HadronInelasticProcess( "photonNuclear", G4Gamma::Definition() );
process->AddDataSet( new G4PhotoNuclearCrossSection );
// to not register a model, set Emax=0; eg. Emax1 = 0.
const G4double Emax1 = 200*MeV, Emax2 = 10*GeV;
@@ -0,0 +1,79 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file hadronic/Hadr03/src/GammaNuclearPhysicsLEND.cc
/// \brief Implementation of the GammaNuclearPhysicsLEND class
//
// $Id: GammaNuclearPhysics.cc 66587 2012-12-21 11:06:44Z ihrivnac $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "GammaNuclearPhysicsLEND.hh"
#include "G4ParticleDefinition.hh"
#include "G4ProcessManager.hh"
// Processes
#include "G4HadronInelasticProcess.hh"
#include "G4LENDorBERTModel.hh"
#include "G4LENDCombinedCrossSection.hh"
#include "G4PhotoNuclearCrossSection.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
GammaNuclearPhysicsLEND::GammaNuclearPhysicsLEND(const G4String& name)
: G4VPhysicsConstructor(name)
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
GammaNuclearPhysicsLEND::~GammaNuclearPhysicsLEND()
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void GammaNuclearPhysicsLEND::ConstructProcess()
{
G4ProcessManager* pManager = G4Gamma::Gamma()->GetProcessManager();
//
G4HadronInelasticProcess* process = new G4HadronInelasticProcess( "photonNuclear", G4Gamma::Definition() );
process->AddDataSet( new G4PhotoNuclearCrossSection );
//
G4LENDorBERTModel* lend = new G4LENDorBERTModel(G4Gamma::Gamma());
lend->SetMaxEnergy(20*MeV);
process->RegisterMe(lend);
//
G4LENDCombinedCrossSection* lendXS =
new G4LENDCombinedCrossSection(G4Gamma::Gamma());
process->AddDataSet(lendXS);
//
pManager->AddDiscreteProcess(process);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -49,9 +49,10 @@
#include "G4StoppingPhysics.hh"
#include "GammaNuclearPhysics.hh"
#include "GammaNuclearPhysicsLEND.hh"
#include "ElectromagneticPhysics.hh"
#include "G4EmStandardPhysics.hh"
#include "G4EmStandardPhysics_option3.hh"
#include "G4DecayPhysics.hh"
#include "G4RadioactiveDecayPhysics.hh"
@@ -73,7 +74,6 @@ PhysicsList::PhysicsList()
//add new units
//
new G4UnitDefinition( "millielectronVolt", "meV", "Energy", 1.e-3*eV);
new G4UnitDefinition( "mm2/g", "mm2/g", "Surface/Mass", mm2/g);
new G4UnitDefinition( "um2/mg", "um2/mg","Surface/Mass", um*um/mg);
@@ -104,11 +104,12 @@ PhysicsList::PhysicsList()
// Gamma-Nuclear Physics
fGammaNuclear = new GammaNuclearPhysics("gamma");
////fGammaNuclear = new GammaNuclearPhysicsLEND("gamma");
RegisterPhysics(fGammaNuclear);
// EM physics
fElectromagnetic = new ElectromagneticPhysics();
////fElectromagnetic = new G4EmStandardPhysics();
////fElectromagnetic = new G4EmStandardPhysics_option3();
RegisterPhysics(fElectromagnetic);
// Decay
@@ -77,11 +77,11 @@ void Run::CountProcesses(const G4VProcess* process)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Run::ParticleCount(G4String name, G4double Ekin)
void Run::ParticleCount(G4String name, G4double Ekin, G4double meanLife)
{
std::map<G4String, ParticleData>::iterator it = fParticleDataMap1.find(name);
if ( it == fParticleDataMap1.end()) {
fParticleDataMap1[name] = ParticleData(1, Ekin, Ekin, Ekin);
fParticleDataMap1[name] = ParticleData(1, Ekin, Ekin, Ekin, meanLife);
}
else {
ParticleData& data = it->second;
@@ -91,7 +91,8 @@ void Run::ParticleCount(G4String name, G4double Ekin)
G4double emin = data.fEmin;
if (Ekin < emin) data.fEmin = Ekin;
G4double emax = data.fEmax;
if (Ekin > emax) data.fEmax = Ekin;
if (Ekin > emax) data.fEmax = Ekin;
data.fTmean = meanLife;
}
}
@@ -116,7 +117,7 @@ void Run::ParticleFlux(G4String name, G4double Ekin)
{
std::map<G4String, ParticleData>::iterator it = fParticleDataMap2.find(name);
if ( it == fParticleDataMap2.end()) {
fParticleDataMap2[name] = ParticleData(1, Ekin, Ekin, Ekin);
fParticleDataMap2[name] = ParticleData(1, Ekin, Ekin, Ekin, -1*ns);
}
else {
ParticleData& data = it->second;
@@ -126,7 +127,8 @@ void Run::ParticleFlux(G4String name, G4double Ekin)
G4double emin = data.fEmin;
if (Ekin < emin) data.fEmin = Ekin;
G4double emax = data.fEmax;
if (Ekin > emax) data.fEmax = Ekin;
if (Ekin > emax) data.fEmax = Ekin;
data.fTmean = -1*ns;
}
}
@@ -175,7 +177,8 @@ void Run::Merge(const G4Run* run)
= ParticleData(localData.fCount,
localData.fEmean,
localData.fEmin,
localData.fEmax);
localData.fEmax,
localData.fTmean);
}
else {
ParticleData& data = fParticleDataMap1[name];
@@ -184,7 +187,8 @@ void Run::Merge(const G4Run* run)
G4double emin = localData.fEmin;
if (emin < data.fEmin) data.fEmin = emin;
G4double emax = localData.fEmax;
if (emax > data.fEmax) data.fEmax = emax;
if (emax > data.fEmax) data.fEmax = emax;
data.fTmean = localData.fTmean;
}
}
@@ -200,7 +204,8 @@ void Run::Merge(const G4Run* run)
= ParticleData(localData.fCount,
localData.fEmean,
localData.fEmin,
localData.fEmax);
localData.fEmax,
localData.fTmean);
}
else {
ParticleData& data = fParticleDataMap2[name];
@@ -209,7 +214,8 @@ void Run::Merge(const G4Run* run)
G4double emin = localData.fEmin;
if (emin < data.fEmin) data.fEmin = emin;
G4double emax = localData.fEmax;
if (emax > data.fEmax) data.fEmax = emax;
if (emax > data.fEmax) data.fEmax = emax;
data.fTmean = localData.fTmean;
}
}
@@ -260,13 +266,16 @@ void Run::EndOfRun()
G4int count = data.fCount;
G4double eMean = data.fEmean/count;
G4double eMin = data.fEmin;
G4double eMax = data.fEmax;
G4double eMax = data.fEmax;
G4double meanLife = data.fTmean;
G4cout << " " << std::setw(13) << name << ": " << std::setw(7) << count
<< " Emean = " << std::setw(wid) << G4BestUnit(eMean, "Energy")
<< "\t( " << G4BestUnit(eMin, "Energy")
<< " --> " << G4BestUnit(eMax, "Energy")
<< ")" << G4endl;
<< " --> " << G4BestUnit(eMax, "Energy") << ")";
if (meanLife >= 0.)
G4cout << "\tmean life = " << G4BestUnit(meanLife, "Time") << G4endl;
else G4cout << "\tstable" << G4endl;
}
// compute mean Energy deposited and rms
@@ -1,157 +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. *
// ********************************************************************
//
/// \file SteppingVerbose.cc
/// \brief Implementation of the SteppingVerbose class
//
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "SteppingVerbose.hh"
#include "G4SteppingManager.hh"
#include "G4ParticleTypes.hh"
#include "G4UnitsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
SteppingVerbose::SteppingVerbose()
: G4SteppingVerbose()
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
SteppingVerbose::~SteppingVerbose()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SteppingVerbose::TrackingStarted()
{
CopyState();
G4int prec = G4cout.precision(3);
//Step zero
//
if( verboseLevel > 0 ){
G4cout << std::setw( 5) << "Step#" << " "
<< std::setw( 6) << "X" << " "
<< std::setw( 6) << "Y" << " "
<< std::setw( 6) << "Z" << " "
<< std::setw( 9) << "KineE" << " "
<< std::setw( 9) << "dEStep" << " "
<< std::setw(10) << "StepLeng"
<< std::setw(10) << "TrakLeng"
<< std::setw(10) << "Volume" << " "
<< std::setw(10) << "Process" << G4endl;
G4cout << std::setw(5) << fTrack->GetCurrentStepNumber() << " "
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
<< std::setw(10) << fTrack->GetVolume()->GetName()
<< " initStep" << G4endl;
}
G4cout.precision(prec);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SteppingVerbose::StepInfo()
{
CopyState();
G4int prec = G4cout.precision(3);
if( verboseLevel >= 1 ){
if( verboseLevel >= 4 ) VerboseTrack();
if( verboseLevel >= 3 ){
G4cout << G4endl;
G4cout << std::setw( 5) << "#Step#" << " "
<< std::setw( 6) << "X" << " "
<< std::setw( 6) << "Y" << " "
<< std::setw( 6) << "Z" << " "
<< std::setw( 9) << "KineE" << " "
<< std::setw( 9) << "dEStep" << " "
<< std::setw(10) << "StepLeng"
<< std::setw(10) << "TrakLeng"
<< std::setw(10) << "Volume" << " "
<< std::setw(10) << "Process" << G4endl;
}
G4cout << std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< std::setw(6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< std::setw(6) << G4BestUnit(fTrack->GetTrackLength(),"Length")
<< std::setw(10) << fTrack->GetVolume()->GetName();
const G4VProcess* process
= fStep->GetPostStepPoint()->GetProcessDefinedStep();
G4String procName = " UserLimit";
if (process) procName = process->GetProcessName();
if (fStepStatus == fWorldBoundary) procName = "OutOfWorld";
G4cout << " " << std::setw(10) << procName;
G4cout << G4endl;
if (verboseLevel == 2) {
const std::vector<const G4Track*>* secondary
= fStep->GetSecondaryInCurrentStep();
size_t nbtrk = (*secondary).size();
if (nbtrk) {
G4cout << "\n :----- List of secondaries ----------------" << G4endl;
G4cout.precision(4);
for (size_t lp=0; lp<(*secondary).size(); lp++) {
G4cout << " "
<< std::setw(13)
<< (*secondary)[lp]->GetDefinition()->GetParticleName()
<< ": energy ="
<< std::setw(6)
<< G4BestUnit((*secondary)[lp]->GetKineticEnergy(),"Energy")
<< " time ="
<< std::setw(6)
<< G4BestUnit((*secondary)[lp]->GetGlobalTime(),"Time");
G4cout << G4endl;
}
G4cout << " :------------------------------------------\n" << G4endl;
}
}
}
G4cout.precision(prec);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -55,12 +55,15 @@ TrackingAction::TrackingAction(EventAction* event)
void TrackingAction::PreUserTrackingAction(const G4Track* track)
{
//count secondary particles
if (track->GetTrackID() == 1) return;
G4String name = track->GetDefinition()->GetParticleName();
G4double energy = track->GetKineticEnergy();
if (track->GetTrackID() == 1) return;
Run* run = static_cast<Run*>(
G4RunManager::GetRunManager()->GetNonConstCurrentRun());
run->ParticleCount(name,energy);
G4RunManager::GetRunManager()->GetNonConstCurrentRun());
G4String name = track->GetDefinition()->GetParticleName();
G4double meanLife = track->GetDefinition()->GetPDGLifeTime();
G4double energy = track->GetKineticEnergy();
if (meanLife != 0.) run->ParticleCount(name,energy,meanLife);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......