Import Geant4 10.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-12-09 12:35:28 +01:00
parent 4ec577e5c4
commit a3452e42ac
3514 changed files with 210500 additions and 89628 deletions
@@ -14,6 +14,15 @@ code and to keep track of all tags.
* Please list in reverse chronological order (last date on top)
---------------------------------------------------------------
16 November 2016 V. Ivantchenko (hadr-stopping-V10-02-02)
--------------------------------------------------------------------
- G4EmCaptureCascade - added C++11 keywords, an attempt to remove
bound check warning
11 October 2016 K.L. Genser (hadr-stopping-V10-02-01)
--------------------------------------------------------------------
- added G4MuonMinusAtomicCapture
12 November 2015 V. Ivantchenko (hadr-stopping-V10-01-05)
--------------------------------------------------------------------
- G4HadronStoppingProcess - removed call to DeRegistration to avoid
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4EmCaptureCascade.hh 66367 2012-12-18 09:18:08Z gcosmo $
// $Id: G4EmCaptureCascade.hh 101422 2016-11-17 10:41:23Z gcosmo $
//
//-----------------------------------------------------------------------------
//
@@ -68,14 +68,14 @@ class G4EmCaptureCascade : public G4HadronicInteraction
{
public:
G4EmCaptureCascade();
explicit G4EmCaptureCascade();
~G4EmCaptureCascade();
virtual ~G4EmCaptureCascade();
G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack,
G4Nucleus & targetNucleus );
virtual G4HadFinalState* ApplyYourself(const G4HadProjectile &aTrack,
G4Nucleus & targetNucleus );
void ModelDescription(std::ostream& outFile) const;
virtual void ModelDescription(std::ostream& outFile) const;
private:
@@ -83,8 +83,8 @@ private:
G4double kinEnergy);
// hide assignment operator as private
G4EmCaptureCascade& operator=(const G4EmCaptureCascade &right);
G4EmCaptureCascade(const G4EmCaptureCascade& );
G4EmCaptureCascade& operator=(const G4EmCaptureCascade &right) = delete;
G4EmCaptureCascade(const G4EmCaptureCascade& ) = delete;
G4HadFinalState result;
G4ParticleDefinition* theElectron;
@@ -0,0 +1,116 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4MuonMinusAtomicCapture.hh 66367 2012-12-18 09:18:08Z gcosmo $
//
//---------------------------------------------------------------------
//
// GEANT4 Class header file
//
// File name: G4MuonMinusAtomicCapture
//
// 20160701 K.L. Genser - New process using G4MuonicAtom
//
// Class Description:
//
// Stopping of mu-
//
// Modifications:
// 20160701
//
//------------------------------------------------------------------------
#ifndef G4MuonMinusAtomicCapture_h
#define G4MuonMinusAtomicCapture_h 1
#include "globals.hh"
#include "G4HadronicProcess.hh"
#include "G4ParticleDefinition.hh"
#include "G4ElementSelector.hh"
#include "G4HadronicInteraction.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4ForceCondition.hh"
#include "G4HadronicProcessType.hh"
#include "G4HadFinalState.hh"
class G4HadronicInteraction;
class G4MuonMinusAtomicCapture : public G4HadronicProcess
{
public:
explicit G4MuonMinusAtomicCapture(const G4String& name = "muMinusAtomicCaptureAtRest" );
~G4MuonMinusAtomicCapture();
G4bool IsApplicable(const G4ParticleDefinition&);
virtual void PreparePhysicsTable(const G4ParticleDefinition&);
virtual void BuildPhysicsTable(const G4ParticleDefinition&);
virtual G4double
AtRestGetPhysicalInteractionLength(const G4Track& track,
G4ForceCondition* condition);
virtual G4double
PostStepGetPhysicalInteractionLength(const G4Track& track,
G4double previousStepSize,
G4ForceCondition* condition);
virtual G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&);
void ProcessDescription(std::ostream& outFile) const;
inline void SetElementSelector(G4ElementSelector* ptr);
inline void SetEmCascade(G4HadronicInteraction* ptr);
protected:
// set effective lifetime for at-rest process (default is forced action)
// FIXME: This should be computed by subprocesses via cross-section analogue
G4double GetMeanLifeTime(const G4Track& /*aTrack*/,
G4ForceCondition* /*condition*/) { return -1.0; }
private:
// hide assignment operator as private
G4MuonMinusAtomicCapture& operator=(const G4MuonMinusAtomicCapture &right);
G4MuonMinusAtomicCapture(const G4MuonMinusAtomicCapture& );
G4ElementSelector* fElementSelector;
G4HadronicInteraction* fEmCascade;
};
#endif
@@ -11,7 +11,7 @@
#
# Generated on : 24/9/2010
#
# $Id: sources.cmake 85517 2014-10-30 15:53:26Z gcosmo $
# $Id: sources.cmake 99936 2016-10-12 07:59:09Z gcosmo $
#
#------------------------------------------------------------------------------
@@ -75,6 +75,7 @@ GEANT4_DEFINE_MODULE(NAME G4hadronic_stop
G4PiMinusAbsorptionBertini.hh
G4KaonMinusAbsorptionBertini.hh
G4SigmaMinusAbsorptionBertini.hh
G4MuonMinusAtomicCapture.hh
SOURCES
G4AntiNeutronAnnihilationAtRest.cc
G4ElementSelector.cc
@@ -85,6 +86,7 @@ GEANT4_DEFINE_MODULE(NAME G4hadronic_stop
G4MuonMinusBoundDecay.cc
G4MuonMinusCapture.cc
G4HadronicAbsorptionBertini.cc
G4MuonMinusAtomicCapture.cc
GRANULAR_DEPENDENCIES
G4baryons
G4bosons
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4EmCaptureCascade.cc 91836 2015-08-07 07:25:54Z gcosmo $
// $Id: G4EmCaptureCascade.cc 101422 2016-11-17 10:41:23Z gcosmo $
//
//-----------------------------------------------------------------------------
//
@@ -64,12 +64,12 @@ G4EmCaptureCascade::G4EmCaptureCascade()
// Calculate the Energy of K Mesoatom Level for this Element using
// the Energy of Hydrogen Atom taken into account finite size of the
// nucleus
const G4int nlevels = 28;
const G4int listK[nlevels] = {
static const G4int nlevels = 28;
static const G4int listK[nlevels] = {
1, 2, 4, 6, 8, 11, 14, 17, 18, 21, 24,
26, 29, 32, 38, 40, 41, 44, 49, 53, 55,
60, 65, 70, 75, 81, 85, 92};
const G4double listKEnergy[nlevels] = {
static const G4double listKEnergy[nlevels] = {
0.00275, 0.011, 0.043, 0.098, 0.173, 0.326,
0.524, 0.765, 0.853, 1.146, 1.472,
1.708, 2.081, 2.475, 3.323, 3.627,
@@ -94,7 +94,7 @@ G4EmCaptureCascade::G4EmCaptureCascade()
fKLevelEnergy[z2] = listKEnergy[i];
idx = i;
}
for( G4int i = 0; i<14; ++i) { fLevelEnergy[i] = 0.0; }
for(G4int i = 0; i<14; ++i) { fLevelEnergy[i] = 0.0; }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -116,18 +116,18 @@ G4EmCaptureCascade::ApplyYourself(const G4HadProjectile& projectile,
G4int A = targetNucleus.GetA_asInt();
G4double massA = G4NucleiProperties::GetNuclearMass(A, Z);
G4double mass = fMuMass * massA / (fMuMass + massA) ;
G4double e = 13.6 * eV * Z * Z * mass/ electron_mass_c2;
G4double e = 13.6 * eV * (Z * Z) * mass/ electron_mass_c2;
// precise corrections of energy only for K-shell
fLevelEnergy[0] = fKLevelEnergy[Z];
for( G4int i = 2; i < 15; ++i) {
fLevelEnergy[i-1] = e/G4double(i*i);
fLevelEnergy[0] = fKLevelEnergy[std::min(Z, 92)];
for(G4int i=1; i<14; ++i) {
fLevelEnergy[i] = e/(G4double)((i+1)*(i+1));
}
G4int nElec = G4int(Z);
G4int nElec = Z;
G4int nAuger = 1;
G4int nLevel = 13;
G4double pGamma = Z*Z*Z*Z;
G4double pGamma = (Z*Z*Z*Z);
// Capture on 14-th level
G4double edep = fLevelEnergy[13];
@@ -0,0 +1,218 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// $Id: G4MuonMinusAtomicCapture.cc $
//
//---------------------------------------------------------------------
//
// GEANT4 Class
//
// GEANT4 Class header file
//
// File name: G4MuonMinusAtomicCapture
//
// 20160701 K.L. Genser - New process using G4MuonicAtom somewhat based on G4HadronStoppingProcess
//
// Class Description:
//
// Stopping of mu-
//
// G4VParticleChange will contain gammas from G4EmCaptureCascade and
// resulting G4MuonicAtom
//
//
//------------------------------------------------------------------------
#include "G4MuonMinusAtomicCapture.hh"
#include "G4ParticleDefinition.hh"
#include "G4HadronicProcessType.hh"
#include "G4MuonMinusBoundDecay.hh"
#include "G4HadronicInteraction.hh"
#include "G4HadronicProcessStore.hh"
#include "G4EmCaptureCascade.hh"
#include "G4MuonMinus.hh"
#include "G4IonTable.hh"
#include "G4RandomDirection.hh"
#include "G4HadSecondary.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4MuonMinusAtomicCapture::G4MuonMinusAtomicCapture(const G4String& name)
: G4HadronicProcess(name, fHadronAtRest),// name, process type
fElementSelector(new G4ElementSelector()),
fEmCascade(new G4EmCaptureCascade()) // Owned by InteractionRegistry
{
// Modify G4VProcess flags to emulate G4VRest instead of G4VDiscrete
enableAtRestDoIt = true;
enablePostStepDoIt = false;
G4HadronicProcessStore::Instance()->RegisterExtraProcess(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4MuonMinusAtomicCapture::~G4MuonMinusAtomicCapture()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4bool G4MuonMinusAtomicCapture::IsApplicable(const G4ParticleDefinition& p)
{
return (&p == G4MuonMinus::MuonMinus());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void
G4MuonMinusAtomicCapture::PreparePhysicsTable(const G4ParticleDefinition& p)
{
G4HadronicProcessStore::Instance()->RegisterParticleForExtraProcess(this,&p);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4MuonMinusAtomicCapture::BuildPhysicsTable(const G4ParticleDefinition& p)
{
G4HadronicProcessStore::Instance()->PrintInfo(&p);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4MuonMinusAtomicCapture::AtRestGetPhysicalInteractionLength(
const G4Track&, G4ForceCondition* condition)
{
*condition = NotForced;
return 0.0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4double G4MuonMinusAtomicCapture::PostStepGetPhysicalInteractionLength(
const G4Track&, G4double, G4ForceCondition* condition)
{
*condition = NotForced;
return DBL_MAX;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4VParticleChange* G4MuonMinusAtomicCapture::AtRestDoIt(const G4Track& track,
const G4Step&)
{
// if primary is not Alive then do nothing (how?)
theTotalResult->Initialize(track);
G4Nucleus* nucleus = GetTargetNucleusPointer();
// the call below actually sets the nucleus params;
// G4Nucleus targetNucleus; is a member of G4HadronicProcess
// G4Element* elm =
fElementSelector->SelectZandA(track, nucleus);
G4HadFinalState* result = 0;
thePro.Initialise(track); // thePro is G4HadProjectile from G4HadronicProcess
// save track time an dstart capture from zero time
thePro.SetGlobalTime(0.0);
G4double time0 = track.GetGlobalTime();
// Do the electromagnetic cascade in the nuclear field.
// EM cascade should keep G4HadFinalState object,
// because it will not be deleted at the end of this method
//
result = fEmCascade->ApplyYourself(thePro, *nucleus);
G4double ebound = result->GetLocalEnergyDeposit(); // may need to carry this over; review
G4double edep = 0.0;
G4int nSecondaries = result->GetNumberOfSecondaries();
thePro.SetBoundEnergy(ebound);
// creating the muonic atom
++nSecondaries;
G4IonTable* itp = G4IonTable::GetIonTable();
G4ParticleDefinition* muonicAtom = itp->GetMuonicAtom(nucleus->GetZ_asInt(),
nucleus->GetA_asInt());
G4DynamicParticle* dp = new G4DynamicParticle(muonicAtom,G4RandomDirection(),0.);
G4HadSecondary hadSec(dp);
hadSec.SetTime(time0);
result->AddSecondary(hadSec);
// Fill results
//
theTotalResult->ProposeTrackStatus(fStopAndKill);
theTotalResult->ProposeLocalEnergyDeposit(edep);
theTotalResult->SetNumberOfSecondaries(nSecondaries);
G4double w = track.GetWeight();
theTotalResult->ProposeWeight(w);
G4cout << __func__
<< " nSecondaries "
<< nSecondaries
<< G4endl;
for(G4int i=0; i<nSecondaries; ++i) {
G4HadSecondary* sec = result->GetSecondary(i);
// add track global time to the reaction time
G4double time = sec->GetTime();
if(time < 0.0) { time = 0.0; }
time += time0;
G4cout << __func__
<< " "
<< i
<< " Resulting secondary "
<< sec->GetParticle()->GetPDGcode()
<< " "
<< sec->GetParticle()->GetDefinition()->GetParticleName()
<< G4endl;
// create secondary track
G4Track* t = new G4Track(sec->GetParticle(),
time,
track.GetPosition());
t->SetWeight(w*sec->GetWeight());
t->SetTouchableHandle(track.GetTouchableHandle());
theTotalResult->AddSecondary(t);
}
result->Clear();
// fixme: needs to be done at the MuonicAtom level
// if (epReportLevel != 0) { // G4HadronicProcess::
// CheckEnergyMomentumConservation(track, *nucleus);
// }
return theTotalResult;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void G4MuonMinusAtomicCapture::ProcessDescription(std::ostream& outFile) const
{
outFile << "Stopping of mu- using default element selector, EM cascade"
<< " sampling and bound decay sampling.\n"
<< "Bertini model is used for nuclear capture\n"
<< "G4MuonicAtom is created\n";
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....