Import Geant4 9.5.0 source tree
This commit is contained in:
@@ -235,7 +235,7 @@ void G4AntiNeutronAnnihilationAtRest::GenerateSecondaries()
|
||||
static G4int l;
|
||||
static G4int nopt;
|
||||
static G4int i;
|
||||
static G4ParticleDefinition* jnd;
|
||||
// DHW 15 May 2011: unused: static G4ParticleDefinition* jnd;
|
||||
|
||||
for (i = 1; i <= MAX_SECONDARIES; ++i) {
|
||||
pv[i].SetZero();
|
||||
@@ -273,7 +273,7 @@ void G4AntiNeutronAnnihilationAtRest::GenerateSecondaries()
|
||||
// --- ONE OR MORE SECONDARIES HAVE BEEN GENERATED ---
|
||||
for (l = 1; l <= ntot; ++l) {
|
||||
index = l - 1;
|
||||
jnd = eve[index].GetParticleDef();
|
||||
// DHW 15 May 2011: unused: jnd = eve[index].GetParticleDef();
|
||||
|
||||
// --- ADD PARTICLE TO THE STACK IF STACK NOT YET FULL ---
|
||||
if (ngkine < MAX_SECONDARIES) {
|
||||
|
||||
@@ -236,7 +236,7 @@ void G4AntiProtonAnnihilationAtRest::GenerateSecondaries()
|
||||
static G4int l;
|
||||
static G4int nopt;
|
||||
static G4int i;
|
||||
static G4ParticleDefinition* jnd;
|
||||
// DHW 15 May 2011: unused: static G4ParticleDefinition* jnd;
|
||||
|
||||
for (i = 1; i <= MAX_SECONDARIES; ++i) {
|
||||
pv[i].SetZero();
|
||||
@@ -271,7 +271,7 @@ void G4AntiProtonAnnihilationAtRest::GenerateSecondaries()
|
||||
// --- ONE OR MORE SECONDARIES HAVE BEEN GENERATED ---
|
||||
for (l = 1; l <= ntot; ++l) {
|
||||
index = l - 1;
|
||||
jnd = eve[index].GetParticleDef();
|
||||
// DHW 15 May 2011: unused: jnd = eve[index].GetParticleDef();
|
||||
|
||||
// --- ADD PARTICLE TO THE STACK IF STACK NOT YET FULL ---
|
||||
if (ngkine < MAX_SECONDARIES) {
|
||||
|
||||
@@ -0,0 +1,255 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4FTFCaptureAtRest
|
||||
//
|
||||
// Author: Alberto Ribon
|
||||
//
|
||||
// Date: 18 October 2011
|
||||
//
|
||||
// Modified:
|
||||
// 02 November 2011, A. Ribon : migration to the new exceptions.
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
//
|
||||
|
||||
#include "G4FTFCaptureAtRest.hh"
|
||||
|
||||
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4HadProjectile.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4Nucleus.hh"
|
||||
#include "G4HadFinalState.hh"
|
||||
#include "G4NucleiProperties.hh"
|
||||
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4ExcitationHandler.hh"
|
||||
#include "G4PreCompoundModel.hh"
|
||||
#include "G4GeneratorPrecompoundInterface.hh"
|
||||
#include "G4FTFModel.hh"
|
||||
#include "G4LundStringFragmentation.hh"
|
||||
#include "G4ExcitedStringDecay.hh"
|
||||
#include "G4TheoFSGenerator.hh"
|
||||
|
||||
|
||||
G4FTFCaptureAtRest::G4FTFCaptureAtRest( const G4String& processName )
|
||||
: G4VRestProcess( processName, fHadronic ) {
|
||||
|
||||
// Create the FTFP final-state model.
|
||||
// (We follow what it is done in the class G4FTFPAntiBarionBuilder
|
||||
// except quasi-elastic which is not needed at rest.)
|
||||
|
||||
theMin = 0.0*GeV;
|
||||
theMax = 100.0*TeV;
|
||||
theModel = new G4TheoFSGenerator( "FTFP" );
|
||||
|
||||
theStringModel = new G4FTFModel;
|
||||
theStringDecay = new G4ExcitedStringDecay( theLund = new G4LundStringFragmentation );
|
||||
theStringModel->SetFragmentationModel( theStringDecay );
|
||||
|
||||
theCascade = new G4GeneratorPrecompoundInterface; // Not a cascade - goes straight to Preco
|
||||
thePreEquilib = new G4PreCompoundModel( theHandler = new G4ExcitationHandler );
|
||||
theCascade->SetDeExcitation( thePreEquilib );
|
||||
|
||||
theModel->SetHighEnergyGenerator( theStringModel );
|
||||
theModel->SetTransport( theCascade );
|
||||
theModel->SetMinEnergy( theMin );
|
||||
theModel->SetMaxEnergy( 100*TeV );
|
||||
}
|
||||
|
||||
|
||||
G4FTFCaptureAtRest::~G4FTFCaptureAtRest() {
|
||||
delete theCascade;
|
||||
delete theStringDecay;
|
||||
delete theStringModel;
|
||||
delete theModel;
|
||||
delete thePreEquilib;
|
||||
delete theHandler;
|
||||
delete theLund;
|
||||
}
|
||||
|
||||
|
||||
G4bool G4FTFCaptureAtRest::IsApplicable( const G4ParticleDefinition& particle ) {
|
||||
// For the time being, we use Fritiof annihilation at rest only for
|
||||
// anti-protons, but it could apply as well for anti-Sigma+ .
|
||||
// For the other anti-baryons that Fritiof is able to annihilate on a
|
||||
// nucleus, i.e. anti-neutron, anti-Lambda0, anti-Sigma-, anti-Sigma0,
|
||||
// anti-Csi-, anti-Csi0, and anti-Omega-, they cannot have "at rest"
|
||||
// capture in a nucleus because either they are neutrals and therefore
|
||||
// never at rest, or they are positively charged and therefore cannot
|
||||
// be captured in a nucleus.
|
||||
if ( particle == *( G4AntiProton::AntiProton() ) ) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
G4VParticleChange* G4FTFCaptureAtRest::AtRestDoIt( const G4Track& track, const G4Step& step ) {
|
||||
|
||||
// Check applicability
|
||||
if ( ! IsApplicable( *(track.GetDynamicParticle()->GetDefinition()) ) ) {
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Error: particle is: " << track.GetDynamicParticle()->GetDefinition()->GetParticleName()
|
||||
<< "\t ; it must be an anti-proton ! " << G4endl;
|
||||
G4Exception( "G4FTFCaptureAtRest::AtRestDoIt()", "HAD_FTF_0000",
|
||||
FatalException, ed );
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Select the target nucleus
|
||||
G4Material * material = track.GetMaterial();
|
||||
G4Nucleus * targetNucleus = 0;
|
||||
do {
|
||||
targetNucleus = new G4Nucleus( material );
|
||||
if ( targetNucleus->GetA_asInt() < 1 ) {
|
||||
delete targetNucleus;
|
||||
targetNucleus = 0;
|
||||
}
|
||||
} while ( targetNucleus == 0 );
|
||||
G4int targetNucleusZ = targetNucleus->GetZ_asInt();
|
||||
G4int targetNucleusA = targetNucleus->GetA_asInt();
|
||||
//G4cout << " targetNucleus Z=" << targetNucleusZ << " A=" << targetNucleusA << G4endl;
|
||||
|
||||
// Prepare to call the interaction
|
||||
G4HadProjectile projectile( track );
|
||||
G4HadFinalState* result = 0;
|
||||
G4int reentryCount = 0;
|
||||
do {
|
||||
try {
|
||||
// Call the interaction
|
||||
result = theModel->ApplyYourself( projectile, *targetNucleus );
|
||||
++reentryCount;
|
||||
}
|
||||
catch( G4HadronicException aR ) {
|
||||
DumpState( track, "G4FTFCaptureAtRest::AtRestDoIt()" );
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Call for " << theModel->GetModelName() << G4endl
|
||||
<< "Target nucleus Z=" << targetNucleusZ
|
||||
<< " A=" << targetNucleusA;
|
||||
G4Exception( "G4FTFCaptureAtRest::AtRestDoIt()", "HAD_FTF_0001",
|
||||
FatalException, ed );
|
||||
}
|
||||
if ( reentryCount > 100 ) {
|
||||
DumpState( track, "G4FTFCaptureAtRest::AtRestDoIt()" );
|
||||
G4ExceptionDescription ed;
|
||||
ed << "Reentering AtRestDoIt too often." << G4endl
|
||||
<< "Call for " << theModel->GetModelName() << G4endl
|
||||
<< "Target nucleus Z=" << targetNucleusZ
|
||||
<< " A=" << targetNucleusA;
|
||||
G4Exception( "G4FTFCaptureAtRest::AtRestDoIt()", "HAD_FTF_0002",
|
||||
FatalException, ed );
|
||||
}
|
||||
} while ( !result );
|
||||
|
||||
// Transform from G4HadFinalState to G4ParticleChange .
|
||||
// (We follow the (private) method G4HadronicProcess::FillResult
|
||||
// used by the method G4HadronicProcess::PostStepDoIt .)
|
||||
|
||||
aParticleChange.Clear();
|
||||
aParticleChange.Initialize( track );
|
||||
aParticleChange.ProposeLocalEnergyDeposit( result->GetLocalEnergyDeposit() );
|
||||
// Check status of primary: it should have been killed
|
||||
if( result->GetStatusChange() == stopAndKill ) {
|
||||
aParticleChange.ProposeTrackStatus( fStopAndKill );
|
||||
aParticleChange.ProposeEnergy( 0.0 );
|
||||
} else {
|
||||
DumpState( track, "G4FTFCaptureAtRest::AtRestDoIt()" );
|
||||
G4ExceptionDescription ed;
|
||||
ed << "AtRestDoIt did not kill the absorbed particle." << G4endl
|
||||
<< "Call for " << theModel->GetModelName() << G4endl
|
||||
<< "Target nucleus Z=" << targetNucleusZ
|
||||
<< " A=" << targetNucleusA;
|
||||
G4Exception( "G4FTFCaptureAtRest::AtRestDoIt()", "HAD_FTF_0003",
|
||||
FatalException, ed );
|
||||
}
|
||||
|
||||
G4int nSec = result->GetNumberOfSecondaries();
|
||||
//G4cout << "#### ParticleDebug : number of secondaries = " << nSec
|
||||
// << " ; local energy deposit = " << result->GetLocalEnergyDeposit()
|
||||
// << " MeV" << G4endl;
|
||||
aParticleChange.SetNumberOfSecondaries( nSec );
|
||||
G4LorentzVector final4mom;
|
||||
if ( nSec > 0 ) {
|
||||
G4double time0 = track.GetGlobalTime();
|
||||
// Loop over the secondaries (which include the remnant nucleus)
|
||||
for ( G4int i=0; i < nSec; i++ ) {
|
||||
final4mom += result->GetSecondary(i)->GetParticle()->Get4Momentum();
|
||||
G4double time = result->GetSecondary(i)->GetTime();
|
||||
if ( time < time0) time = time0;
|
||||
G4Track* secTrack = new G4Track( result->GetSecondary(i)->GetParticle(),
|
||||
time, track.GetPosition() );
|
||||
G4double newWeight = track.GetWeight() * result->GetSecondary(i)->GetWeight();
|
||||
//G4cout << "#### ParticleDebug "
|
||||
// << result->GetSecondary(i)->GetParticle()->GetDefinition()->GetParticleName()
|
||||
// << " ; weight=" << result->GetSecondary(i)->GetWeight()
|
||||
// << " ; 4-momentum=" << result->GetSecondary(i)->GetParticle()->Get4Momentum()
|
||||
// << G4endl;
|
||||
secTrack->SetWeight( newWeight );
|
||||
secTrack->SetTouchableHandle( track.GetTouchableHandle() );
|
||||
aParticleChange.AddSecondary( secTrack );
|
||||
}
|
||||
}
|
||||
|
||||
// Check energy-momentum conservation
|
||||
G4LorentzVector projectile4mom = track.GetDynamicParticle()->Get4Momentum();
|
||||
G4double targetMass = G4NucleiProperties::GetNuclearMass( targetNucleusA, targetNucleusZ );
|
||||
G4LorentzVector target4mom( 0, 0, 0, targetMass ); // Neglect thermal motion
|
||||
G4LorentzVector initial4mom = projectile4mom + target4mom;
|
||||
G4LorentzVector diff = initial4mom - final4mom;
|
||||
const G4double threshold = 1.0*MeV;
|
||||
//G4cout << "===ANTI-PROTON CAPTURE AT REST=== : Ekin = "
|
||||
// << ( projectile4mom.e() - projectile4mom.mag() ) / MeV << G4endl; // Debug
|
||||
if ( std::abs( diff.e() ) > threshold ||
|
||||
std::abs( diff.px() ) > threshold ||
|
||||
std::abs( diff.py() ) > threshold ||
|
||||
std::abs( diff.pz() ) > threshold ) {
|
||||
//G4cout << "*** G4FTFCaptureAtRest::AtRestDoIt : 4-momentum non conservation "
|
||||
// << diff << G4endl
|
||||
// << " initial4mom = " << initial4mom << " ; final4mom = " << final4mom
|
||||
// << G4endl;
|
||||
}
|
||||
|
||||
result->Clear();
|
||||
|
||||
//return &aParticleChange; // This is not enough
|
||||
return G4VRestProcess::AtRestDoIt( track, step );
|
||||
}
|
||||
|
||||
|
||||
void G4FTFCaptureAtRest::DumpState( const G4Track& aTrack , const G4String& method ) {
|
||||
G4cout << "Unrecoverable error in method " << method << G4endl
|
||||
<< "TrackID= " << aTrack.GetTrackID() << " ParentID= " << aTrack.GetParentID()
|
||||
<< " " << aTrack.GetParticleDefinition()->GetParticleName() << G4endl
|
||||
<< "Ekin(GeV)= " << aTrack.GetKineticEnergy()/CLHEP::GeV
|
||||
<< "; direction= " << aTrack.GetMomentumDirection() << G4endl
|
||||
<< "Position(mm)= " << aTrack.GetPosition()/CLHEP::mm << ";";
|
||||
if ( aTrack.GetMaterial() ) G4cout << " material " << aTrack.GetMaterial()->GetName();
|
||||
G4cout << G4endl;
|
||||
if ( aTrack.GetVolume() )
|
||||
G4cout << "PhysicalVolume <" << aTrack.GetVolume()->GetName() << ">" << G4endl;
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ void G4KaonMinusAbsorption::GenerateSecondaries()
|
||||
static G4int l;
|
||||
static G4int nopt;
|
||||
static G4int i;
|
||||
static G4ParticleDefinition* jnd;
|
||||
// DHW 15 May 2011: unused: static G4ParticleDefinition* jnd;
|
||||
|
||||
for (i = 1; i <= MAX_SECONDARIES; ++i) {
|
||||
pv[i].SetZero();
|
||||
@@ -269,7 +269,7 @@ void G4KaonMinusAbsorption::GenerateSecondaries()
|
||||
// --- ONE OR MORE SECONDARIES HAVE BEEN GENERATED ---
|
||||
for (l = 1; l <= ntot; ++l) {
|
||||
index = l - 1;
|
||||
jnd = eve[index].GetParticleDef();
|
||||
// DHW 15 May 2011: unused: jnd = eve[index].GetParticleDef();
|
||||
|
||||
// --- ADD PARTICLE TO THE STACK IF STACK NOT YET FULL ---
|
||||
if (ngkine < MAX_SECONDARIES) {
|
||||
|
||||
@@ -120,15 +120,15 @@ G4VParticleChange* G4KaonMinusAbsorptionAtRest::AtRestDoIt
|
||||
{
|
||||
// Select the nucleus, get nucleon
|
||||
nucleus = new G4Nucleus(material);
|
||||
if (nucleus->GetN() < 1.5)
|
||||
if (nucleus->GetA_asInt() < 1.5)
|
||||
{
|
||||
delete nucleus;
|
||||
nucleus = 0;
|
||||
}
|
||||
} while(nucleus == 0);
|
||||
|
||||
G4double Z = nucleus->GetZ();
|
||||
G4double A = nucleus->GetN();
|
||||
G4double Z = nucleus->GetZ_asInt();
|
||||
G4double A = nucleus->GetA_asInt();
|
||||
|
||||
// Do the interaction with the nucleon
|
||||
G4DynamicParticleVector* absorptionProducts = KaonNucleonReaction();
|
||||
@@ -193,8 +193,8 @@ G4VParticleChange* G4KaonMinusAbsorptionAtRest::AtRestDoIt
|
||||
productEnergy += (*absorptionProducts)[i]->GetKineticEnergy();
|
||||
}
|
||||
|
||||
G4double newZ = nucleus->GetZ();
|
||||
G4double newA = nucleus->GetN();
|
||||
G4double newZ = nucleus->GetZ_asInt();
|
||||
G4double newA = nucleus->GetA_asInt();
|
||||
|
||||
G4double bDiff = G4NucleiProperties::GetBindingEnergy(static_cast<G4int>(A),static_cast<G4int>(Z)) -
|
||||
G4NucleiProperties::GetBindingEnergy(static_cast<G4int>(newA), static_cast<G4int>(newZ));
|
||||
@@ -223,11 +223,9 @@ G4VParticleChange* G4KaonMinusAbsorptionAtRest::AtRestDoIt
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
if (energyDeposit < 0.)
|
||||
{
|
||||
G4Exception("G4KaonMinusAbsorptionAtRest", "007", FatalException,
|
||||
"AtRestDoIt -- excitation energy < 0");
|
||||
}
|
||||
if (energyDeposit < 0.)
|
||||
G4Exception("G4KaonMinusAbsorptionAtRest::AtRestDoIt()", "HAD_STOP_0001",
|
||||
FatalException, "Excitation energy < 0");
|
||||
delete nucleus;
|
||||
|
||||
G4ReactionProductVector* fragmentationProducts = stopDeexcitation.DoBreakUp(newA,newZ,energyDeposit,pProducts);
|
||||
@@ -289,8 +287,8 @@ G4ParticleDefinition* G4KaonMinusAbsorptionAtRest::SelectAbsorbingNucleon()
|
||||
|
||||
G4double ranflat = G4UniformRand();
|
||||
|
||||
G4double myZ = nucleus->GetZ(); // number of protons
|
||||
G4double myN = nucleus->GetN(); // number of nucleons (not neutrons!!)
|
||||
G4double myZ = nucleus->GetZ_asInt(); // number of protons
|
||||
G4double myN = nucleus->GetA_asInt(); // number of nucleons (not neutrons!!)
|
||||
|
||||
// See VanderVelde-Wilquet et al, Nuov.Cim.39A(1978)538;
|
||||
G4double carbonRatioNP = 0.18; // (Rn/Rp)c, see page 544
|
||||
@@ -338,16 +336,16 @@ G4DynamicParticleVector* G4KaonMinusAbsorptionAtRest::KaonNucleonReaction()
|
||||
G4ParticleDefinition* producedBaryonDef;
|
||||
G4ParticleDefinition* producedMesonDef;
|
||||
|
||||
G4double iniZ = nucleus->GetZ();
|
||||
G4double iniA = nucleus->GetN();
|
||||
G4double iniZ = nucleus->GetZ_asInt();
|
||||
G4double iniA = nucleus->GetA_asInt();
|
||||
|
||||
G4DynamicParticle aNucleon = GetAbsorbingNucleon();
|
||||
|
||||
G4double nucleonMass;
|
||||
// DHW 15 may 2011: unused: G4double nucleonMass;
|
||||
|
||||
if (aNucleon.GetDefinition() == G4Proton::Proton())
|
||||
{
|
||||
nucleonMass = proton_mass_c2+electron_mass_c2;
|
||||
// DHW 15 May 2011: unused: nucleonMass = proton_mass_c2+electron_mass_c2;
|
||||
if ( (prob += rateLambdaZeroPiZero) > ranflat)
|
||||
{ // lambda pi0
|
||||
producedBaryonDef = G4Lambda::Lambda();
|
||||
@@ -371,7 +369,7 @@ G4DynamicParticleVector* G4KaonMinusAbsorptionAtRest::KaonNucleonReaction()
|
||||
}
|
||||
else if (aNucleon.GetDefinition() == G4Neutron::Neutron())
|
||||
{
|
||||
nucleonMass = neutron_mass_c2;
|
||||
// DHW 15 May 2011: unused: nucleonMass = neutron_mass_c2;
|
||||
if ((prob += rateLambdaZeroPiMinus) > ranflat)
|
||||
{ // lambda pi-
|
||||
producedBaryonDef = G4Lambda::Lambda();
|
||||
@@ -401,8 +399,8 @@ G4DynamicParticleVector* G4KaonMinusAbsorptionAtRest::KaonNucleonReaction()
|
||||
return 0;
|
||||
}
|
||||
|
||||
G4double newZ = nucleus->GetZ();
|
||||
G4double newA = nucleus->GetN();
|
||||
G4double newZ = nucleus->GetZ_asInt();
|
||||
G4double newA = nucleus->GetA_asInt();
|
||||
|
||||
// Modify the Kaon mass to take nuclear binding energy into account
|
||||
// .. using mas formula ..
|
||||
@@ -462,11 +460,11 @@ G4DynamicParticle* G4KaonMinusAbsorptionAtRest::SigmaLambdaConversion(G4DynamicP
|
||||
G4double ranflat = G4UniformRand();
|
||||
G4double sigmaLambdaConversionRate;
|
||||
|
||||
G4double A = nucleus->GetN();
|
||||
G4double Z = nucleus->GetZ();
|
||||
G4double A = nucleus->GetA_asInt();
|
||||
G4double Z = nucleus->GetZ_asInt();
|
||||
|
||||
G4double newZ = Z;
|
||||
G4double nucleonMassDifference = 0;
|
||||
// DHW 15 May 2011: unused: G4double nucleonMassDifference = 0;
|
||||
|
||||
G4ParticleDefinition* inNucleonDef=NULL;
|
||||
G4ParticleDefinition* outNucleonDef=NULL;
|
||||
@@ -479,7 +477,7 @@ G4DynamicParticle* G4KaonMinusAbsorptionAtRest::SigmaLambdaConversion(G4DynamicP
|
||||
inNucleonDef = G4Neutron::Neutron();
|
||||
outNucleonDef = G4Proton::Proton();
|
||||
newZ = Z+1;
|
||||
nucleonMassDifference = neutron_mass_c2 - proton_mass_c2-electron_mass_c2;
|
||||
// DHW 15 May 2011: unused: nucleonMassDifference = neutron_mass_c2 - proton_mass_c2-electron_mass_c2;
|
||||
break;
|
||||
|
||||
case -1:
|
||||
@@ -487,7 +485,7 @@ G4DynamicParticle* G4KaonMinusAbsorptionAtRest::SigmaLambdaConversion(G4DynamicP
|
||||
inNucleonDef = G4Proton::Proton();
|
||||
outNucleonDef = G4Neutron::Neutron();
|
||||
newZ = Z-1;
|
||||
nucleonMassDifference = proton_mass_c2+electron_mass_c2 - neutron_mass_c2;
|
||||
// DHW 15 May 2011: unused: nucleonMassDifference = proton_mass_c2+electron_mass_c2 - neutron_mass_c2;
|
||||
break;
|
||||
|
||||
case 0:
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4MuMinusCaptureCascade.cc,v 1.16 2008/05/05 09:09:06 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4MuMinusCaptureCascade.cc,v 1.16 2008-05-05 09:09:06 vnivanch Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
// G4MuonMinusCaptureAtRest physics process
|
||||
//
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4MuonMinusCaptureAtRest.cc,v 1.56 2010/11/12 06:52:01 dennis Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04 $
|
||||
// $Id: G4MuonMinusCaptureAtRest.cc,v 1.56 2010-11-12 06:52:01 dennis Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
// G4MuonMinusCaptureAtRest physics process
|
||||
// Larry Felawka (TRIUMF) and Art Olin (TRIUMF)
|
||||
|
||||
@@ -227,7 +227,7 @@ void G4NeutronCaptureAtRest::GenerateSecondaries()
|
||||
static G4int l;
|
||||
static G4int nopt;
|
||||
static G4int i;
|
||||
static G4ParticleDefinition* jnd;
|
||||
// DHW 15 May 2011: unused: static G4ParticleDefinition* jnd;
|
||||
|
||||
for (i = 1; i <= MAX_SECONDARIES; ++i) {
|
||||
pv[i].SetZero();
|
||||
@@ -262,7 +262,7 @@ void G4NeutronCaptureAtRest::GenerateSecondaries()
|
||||
// --- ONE OR MORE SECONDARIES HAVE BEEN GENERATED ---
|
||||
for (l = 1; l <= ntot; ++l) {
|
||||
index = l - 1;
|
||||
jnd = eve[index].GetParticleDef();
|
||||
// DHW 15 May 2011: unused: jnd = eve[index].GetParticleDef();
|
||||
|
||||
// --- ADD PARTICLE TO THE STACK IF STACK NOT YET FULL ---
|
||||
if (ngkine < MAX_SECONDARIES) {
|
||||
|
||||
@@ -142,8 +142,8 @@ G4VParticleChange* G4PiMinusAbsorptionAtRest::AtRestDoIt(const G4Track& track, c
|
||||
G4double excitation = pionEnergy - stopAbsorption.Energy();
|
||||
if (excitation < 0.)
|
||||
{
|
||||
G4Exception("G4PiMinusAbsorptionAtRest", "007", FatalException,
|
||||
"AtRestDoIt -- excitation energy < 0");
|
||||
G4Exception("G4PiMinusAbsorptionAtRest::AtRestDoIt()", "HAD_STOP_0000",
|
||||
FatalException, "Excitation energy < 0");
|
||||
}
|
||||
if (verboseLevel>0) { G4cout << " excitation " << excitation << G4endl; }
|
||||
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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 "G4PiMinusAbsorptionBertini.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4HadronicProcessStore.hh"
|
||||
#include <string.h>
|
||||
#include <cmath>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
// constructor
|
||||
|
||||
G4PiMinusAbsorptionBertini::G4PiMinusAbsorptionBertini(const G4String& processName,
|
||||
G4ProcessType aType ) :
|
||||
G4VRestProcess (processName, aType),
|
||||
pdefPionMinus(G4PionMinus::PionMinus())
|
||||
|
||||
{
|
||||
if (verboseLevel>0) {
|
||||
G4cout << GetProcessName() << " is created "<< G4endl;
|
||||
}
|
||||
SetProcessSubType(fHadronAtRest);
|
||||
|
||||
cascade = new G4CascadeInterface;
|
||||
cascade->usePreCompoundDeexcitation();
|
||||
|
||||
G4HadronicProcessStore::Instance()->RegisterExtraProcess(this);
|
||||
}
|
||||
|
||||
// destructor
|
||||
|
||||
G4PiMinusAbsorptionBertini::~G4PiMinusAbsorptionBertini()
|
||||
{
|
||||
G4HadronicProcessStore::Instance()->DeRegisterExtraProcess(this);
|
||||
}
|
||||
|
||||
void G4PiMinusAbsorptionBertini::PreparePhysicsTable(const G4ParticleDefinition& p)
|
||||
{
|
||||
G4HadronicProcessStore::Instance()->RegisterParticleForExtraProcess(this, &p);
|
||||
}
|
||||
|
||||
void G4PiMinusAbsorptionBertini::BuildPhysicsTable(const G4ParticleDefinition& p)
|
||||
{
|
||||
G4HadronicProcessStore::Instance()->PrintInfo(&p);
|
||||
}
|
||||
|
||||
// methods.............................................................................
|
||||
|
||||
G4bool G4PiMinusAbsorptionBertini::IsApplicable(const G4ParticleDefinition& particle)
|
||||
{
|
||||
return ( &particle == pdefPionMinus );
|
||||
}
|
||||
|
||||
|
||||
G4VParticleChange* G4PiMinusAbsorptionBertini::AtRestDoIt(const G4Track& track,
|
||||
const G4Step&)
|
||||
//
|
||||
// Handles PionMinuss at rest
|
||||
//
|
||||
{
|
||||
// We construct a fake track and we set the kinetic energy to 1keV in order to be able to use Bertini+PrecompoundDeexciation
|
||||
|
||||
G4Track faketrack(track);
|
||||
faketrack.SetStep(track.GetStep());
|
||||
faketrack.SetKineticEnergy(1*keV);
|
||||
|
||||
|
||||
// Initialize ParticleChange
|
||||
// all members of G4VParticleChange are set to equal to
|
||||
// corresponding member in G4Track
|
||||
|
||||
aParticleChange.Initialize(track);
|
||||
|
||||
// Store some global quantities that depend on current material and particle
|
||||
|
||||
G4Material * aMaterial = track.GetMaterial();
|
||||
|
||||
const G4int numberOfElements = aMaterial->GetNumberOfElements();
|
||||
const G4ElementVector* theElementVector = aMaterial->GetElementVector();
|
||||
|
||||
const G4double* theAtomicNumberDensity = aMaterial->GetAtomicNumDensityVector();
|
||||
G4double normalization = 0;
|
||||
for ( G4int i1=0; i1 < numberOfElements; i1++ )
|
||||
{
|
||||
normalization += theAtomicNumberDensity[i1] ; // change when nucleon specific
|
||||
// probabilities are included.
|
||||
}
|
||||
G4double runningSum= 0.;
|
||||
G4double random = G4UniformRand()*normalization;
|
||||
for ( G4int i2=0; i2 < numberOfElements; i2++ )
|
||||
{
|
||||
runningSum += theAtomicNumberDensity[i2]; // change when nucleon specific
|
||||
// probabilities are included.
|
||||
if (random<=runningSum)
|
||||
{
|
||||
targetZ = G4double((*theElementVector)[i2]->GetZ());
|
||||
currentN = (*theElementVector)[i2]->GetN();
|
||||
}
|
||||
}
|
||||
if (random>runningSum)
|
||||
{
|
||||
targetZ = G4double((*theElementVector)[numberOfElements-1]->GetZ());
|
||||
currentN = (*theElementVector)[numberOfElements-1]->GetN();
|
||||
|
||||
}
|
||||
|
||||
targetNucleus.SetParameters(currentN, targetZ);
|
||||
|
||||
if (verboseLevel>1) {
|
||||
G4cout << "G4PiMinusAbsorptionBertini::AtRestDoIt is invoked " <<G4endl;
|
||||
}
|
||||
|
||||
G4HadFinalState* result = cascade->ApplyYourself(faketrack, targetNucleus);
|
||||
|
||||
ClearNumberOfInteractionLengthLeft();
|
||||
|
||||
|
||||
G4int ns = result->GetNumberOfSecondaries();
|
||||
G4int nb = ns;
|
||||
if(result->GetStatusChange() == isAlive) nb++;
|
||||
|
||||
aParticleChange.ProposeTrackStatus(fStopAndKill);
|
||||
aParticleChange.SetNumberOfSecondaries(nb);
|
||||
|
||||
for(G4int i=0; i<ns; i++) {
|
||||
G4Track* tr = new G4Track(result->GetSecondary(i)->GetParticle(),
|
||||
track.GetGlobalTime(),
|
||||
track.GetPosition());
|
||||
aParticleChange.AddSecondary(tr);
|
||||
}
|
||||
|
||||
if(result->GetStatusChange() == isAlive) {
|
||||
G4DynamicParticle* dp = new G4DynamicParticle(*(track.GetDynamicParticle()));
|
||||
G4Track* tr = new G4Track(dp,track.GetGlobalTime(),track.GetPosition());
|
||||
tr->SetKineticEnergy(result->GetEnergyChange());
|
||||
tr->SetMomentumDirection(result->GetMomentumChange());
|
||||
aParticleChange.AddSecondary(tr);
|
||||
}
|
||||
result->Clear();
|
||||
|
||||
|
||||
return &aParticleChange;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -229,7 +229,7 @@ void G4PionMinusAbsorptionAtRest::GenerateSecondaries()
|
||||
static G4int l;
|
||||
static G4int nopt;
|
||||
static G4int i;
|
||||
static G4ParticleDefinition* jnd;
|
||||
// DHW 15 May 2011: unused: static G4ParticleDefinition* jnd;
|
||||
|
||||
for (i = 1; i <= MAX_SECONDARIES; ++i) {
|
||||
pv[i].SetZero();
|
||||
@@ -264,7 +264,7 @@ void G4PionMinusAbsorptionAtRest::GenerateSecondaries()
|
||||
// --- ONE OR MORE SECONDARIES HAVE BEEN GENERATED ---
|
||||
for (l = 1; l <= ntot; ++l) {
|
||||
index = l - 1;
|
||||
jnd = eve[index].GetParticleDef();
|
||||
// DHW 15 May 2011: unused: jnd = eve[index].GetParticleDef();
|
||||
|
||||
// --- ADD PARTICLE TO THE STACK IF STACK NOT YET FULL ---
|
||||
if (ngkine < MAX_SECONDARIES) {
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4StopElementSelector.cc,v 1.16 2007/10/02 18:27:43 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
// $Id: G4StopElementSelector.cc,v 1.16 2007-10-02 18:27:43 vnivanch Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
// File: G4StopElementSelector
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user