Import Geant4 6.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:41:53 +02:00
parent 4aea781e80
commit 96686e0c8f
6560 changed files with 153347 additions and 238155 deletions
+61 -43
View File
@@ -1,57 +1,75 @@
# $Id: GNUmakefile,v 1.10 2002/11/16 17:07:21 hpw Exp $
# $Id: GNUmakefile,v 1.13 2003/11/24 12:54:22 gcosmo Exp $
# --------------------------------------------------------------
# GNUmakefile for hadronic models library. G.Folger 10-Dec-97
# --------------------------------------------------------------
name := G4hadronic_models
SUBDIRS = low_energy
SUBDIRS += high_energy
SUBDIRS += neutron_hp
SUBDIRS += isotope_production
SUBDIRS += generator/de_excitation
SUBDIRS += generator/diffractive_string
SUBDIRS += generator/high_energy
SUBDIRS += generator/kinetic_model
SUBDIRS += generator/management
SUBDIRS += generator/pre_equilibrium
SUBDIRS += generator/quark_gluon_string
SUBDIRS += generator/scattering
SUBDIRS += generator/string_common
SUBDIRS += generator/string_fragmentation
SUBDIRS += generator/util
SUBDIRS += radiative_decay
SUBDIRS += chiral_inv_phase_space/body
SUBDIRS += chiral_inv_phase_space/interface
SUBDIRS += coherent_elastic
SUBDIRS = binary_cascade
SUBDIRS += cascade/evaporation
SUBDIRS += cascade/utils
SUBDIRS += cascade/cascade
SUBDIRS += chiral_inv_phase_space/body
SUBDIRS += chiral_inv_phase_space/interface
SUBDIRS += coherent_elastic
SUBDIRS += de_excitation/evaporation
SUBDIRS += de_excitation/fermi_breakup
SUBDIRS += de_excitation/fission
SUBDIRS += de_excitation/gem_evaporation
SUBDIRS += de_excitation/handler
SUBDIRS += de_excitation/management
SUBDIRS += de_excitation/multifragmentation
SUBDIRS += de_excitation/photon_evaporation
SUBDIRS += de_excitation/util
SUBDIRS += high_energy
SUBDIRS += im_r_matrix
SUBDIRS += isotope_production
SUBDIRS += leading_particle
SUBDIRS += low_energy
SUBDIRS += management
SUBDIRS += neutron_hp
SUBDIRS += photolepton_hadron/muon_nuclear
SUBDIRS += parton_string/diffraction
SUBDIRS += parton_string/hadronization
SUBDIRS += parton_string/management
SUBDIRS += parton_string/qgsm
SUBDIRS += pre_equilibrium/exciton_model
SUBDIRS += radioactive_decay
SUBDIRS += theo_high_energy
SUBDIRS += util
SUBLIBS = G4hadronic_HE
SUBLIBS += G4hadronic_LE
SUBLIBS += G4hadronic_neu
SUBLIBS += G4hadronic_iso
SUBLIBS += G4hadronic_deex
SUBLIBS += G4hadronic_diffstring
SUBLIBS += G4hadronic_HE_gen
SUBLIBS += G4hadronic_kinetic
SUBLIBS += G4hadronic_man_gen
SUBLIBS += G4hadronic_preequ
SUBLIBS += G4hadronic_radioactivedecay
SUBLIBS += G4hadronic_qgstring
SUBLIBS += G4hadronic_scattering
SUBLIBS += G4hadronic_string_common
SUBLIBS += G4hadronic_stringfrag
SUBLIBS += G4hadronic_util_gen
SUBLIBS += G4hadronic_body_ci
SUBLIBS += G4hadronic_interface_ci
SUBLIBS += G4hadronic_coherent_elastic
SUBLIBS += G4hadronic_hetcpp_evaporation
SUBLIBS += G4hadronic_hetcpp_utils
SUBLIBS += G4hadronic_bert_cascade
SUBLIBS += G4hadronic_leading_particle
SUBLIBS = G4hadronic_binary
SUBLIBS += G4hadronic_coherent_elastic
SUBLIBS += G4hadronic_HE
SUBLIBS += G4had_im_r_matrix
SUBLIBS += G4hadronic_iso
SUBLIBS += G4hadronic_leading_particle
SUBLIBS += G4hadronic_LE
SUBLIBS += G4had_mod_man
SUBLIBS += G4had_neu_hp
SUBLIBS += G4hadronic_radioactivedecay
SUBLIBS += G4had_theo_max
SUBLIBS += G4had_mod_util
SUBLIBS += G4hadronic_bert_cascade
SUBLIBS += G4hadronic_hetcpp_evaporation
SUBLIBS += G4hadronic_hetcpp_utils
SUBLIBS += G4hadronic_body_ci
SUBLIBS += G4hadronic_interface_ci
SUBLIBS += G4hadronic_deex_evaporation
SUBLIBS += G4hadronic_deex_fermi_breakup
SUBLIBS += G4hadronic_deex_fission
SUBLIBS += G4hadronic_deex_gem_evaporation
SUBLIBS += G4hadronic_deex_handler
SUBLIBS += G4hadronic_deex_management
SUBLIBS += G4hadronic_deex_multifragmentation
SUBLIBS += G4hadronic_deex_photon_evaporation
SUBLIBS += G4hadronic_deex_util
SUBLIBS += G4had_preequ_exciton
SUBLIBS += G4had_muon_nuclear
SUBLIBS += G4had_string_diff
SUBLIBS += G4had_string_frag
SUBLIBS += G4had_string_man
SUBLIBS += G4hadronic_qgstring
ifndef G4INSTALL
G4INSTALL = ../../../..
@@ -1,18 +1,17 @@
# $Id: GNUmakefile,v 1.5 2003/06/18 13:26:22 gcosmo Exp $
# $Id: GNUmakefile,v 1.4 2003/11/26 09:19:20 gcosmo Exp $
# -----------------------------------------------------------
# GNUmakefile for hadronic library. Gabriele Cosmo, 18/9/96.
# -----------------------------------------------------------
name := G4hadronic_kinetic
name := G4hadronic_binary
ifndef G4INSTALL
G4INSTALL = ../../../../../..
G4INSTALL = ../../../../..
endif
include $(G4INSTALL)/config/architecture.gmk
CPPFLAGS += -I$(G4BASE)/global/management/include \
-I$(G4BASE)/global/STLInterface/g4rw \
-I$(G4BASE)/global/HEPRandom/include \
-I$(G4BASE)/global/HEPNumerics/include \
-I$(G4BASE)/global/HEPGeometry/include \
@@ -25,12 +24,17 @@ CPPFLAGS += -I$(G4BASE)/global/management/include \
-I$(G4BASE)/processes/hadronic/util/include \
-I$(G4BASE)/processes/hadronic/processes/include \
-I$(G4BASE)/processes/hadronic/cross_sections/include \
-I$(G4BASE)/processes/hadronic/models/generator/de_excitation/include \
-I$(G4BASE)/processes/hadronic/models/generator/management/include \
-I$(G4BASE)/processes/hadronic/models/generator/util/include \
-I$(G4BASE)/processes/hadronic/models/generator/pre_equilibrium/include \
-I$(G4BASE)/processes/hadronic/models/generator/diffractive_string/include \
-I$(G4BASE)/processes/hadronic/models/generator/scattering/include \
-I$(G4BASE)/processes/hadronic/models/management/include \
-I$(G4BASE)/processes/hadronic/models/util/include \
-I$(G4BASE)/processes/hadronic/models/im_r_matrix/include \
-I$(G4BASE)/processes/hadronic/models/de_excitation/util/include \
-I$(G4BASE)/processes/hadronic/models/de_excitation/evaporation/include \
-I$(G4BASE)/processes/hadronic/models/de_excitation/fermi_breakup/include \
-I$(G4BASE)/processes/hadronic/models/de_excitation/photon_evaporation/include \
-I$(G4BASE)/processes/hadronic/models/de_excitation/multifragmentation/include \
-I$(G4BASE)/processes/hadronic/models/de_excitation/handler/include \
-I$(G4BASE)/processes/hadronic/models/de_excitation/management/include \
-I$(G4BASE)/processes/hadronic/models/pre_equilibrium/exciton_model/include \
-I$(G4BASE)/particles/management/include \
-I$(G4BASE)/particles/leptons/include \
-I$(G4BASE)/particles/bosons/include \
@@ -0,0 +1,7 @@
13-june-03: Gunter
Tag: binary_cascade_ion_baseline_01
Can run >= 10k light ions, spectator peak clear. Requires generator/util with
this tag.
@@ -48,6 +48,9 @@
#include "G4LorentzVector.hh"
#include "G4LorentzRotation.hh"
#include "G4BCDecay.hh"
#include "G4BCAction.hh"
class G4CollisionManager;
class G4Track;
@@ -61,24 +64,37 @@ public:
G4BinaryCascade();
G4BinaryCascade(const G4BinaryCascade & right);
~G4BinaryCascade();
virtual ~G4BinaryCascade();
const G4BinaryCascade& operator=(G4BinaryCascade & right);
G4int operator==(G4BinaryCascade& right) {return (this == &right);}
G4int operator!=(G4BinaryCascade& right) {return (this != &right);}
G4VParticleChange* ApplyYourself(const G4Track & track,
G4Nucleus & nucleus);
G4ReactionProductVector * Propagate(G4KineticTrackVector * secondaries,
G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
G4Nucleus& theNucleus);
virtual G4ReactionProductVector * Propagate(G4KineticTrackVector * secondaries,
G4V3DNucleus * nucleus);
private:
G4int GetTotalCharge(std::vector<G4KineticTrack *> & aV)
{
G4int result = 0;
std::vector<G4KineticTrack *>::iterator i;
for(i = aV.begin(); i != aV.end(); ++i)
{
if((*i)->GetDefinition() == G4Proton::Proton())
{
++result;
}
}
return result;
}
void PrintWelcomeMessage();
void BuildTargetList();
void FindCollisions(G4KineticTrackVector * secondaries);
G4bool ApplyCollision(G4CollisionInitialState * collision);
G4bool Capture();
G4bool Capture(G4bool verbose=false);
G4bool Absorb();
G4bool CheckPauliPrinciple(G4KineticTrackVector * products);
G4double GetExcitationEnergy();
@@ -88,9 +104,16 @@ private:
G4KineticTrackVector * oldTarget,
G4KineticTrackVector * newSecondaries);
G4bool DoTimeStep(G4double timeStep);
G4KineticTrackVector* CorrectBarionsOnBoundary(G4KineticTrackVector *in,
G4KineticTrackVector *out);
G4Fragment * FindFragments();
void StepParticlesOut();
G4LorentzVector GetFinal4Momentum();
G4LorentzVector GetFinalNucleusMomentum();
G4ReactionProductVector * Propagate1H1(G4KineticTrackVector * secondaries,
G4V3DNucleus * nucleus);
G4double GetIonMass(G4int Z, G4int A);
// utility methods
G4ThreeVector GetSpherePoint(G4double r, const G4LorentzVector & momentumdirection);
void ClearAndDestroy(G4KineticTrackVector * ktv);
@@ -108,7 +131,8 @@ private:
G4ExcitationHandler * theExcitationHandler;
G4CollisionManager * theCollisionMgr;
G4VScatterer * theScatterer;
std::vector<G4BCAction *> theImR;
G4VFieldPropagation * thePropagator;
G4double theCurrentTime;
G4double theCutOnP;
@@ -120,7 +144,9 @@ private:
G4double theOuterRadius;
G4bool thePrimaryEscape;
G4ParticleDefinition * thePrimaryType;
G4ThreeVector theMomentumTransfer;
};
@@ -0,0 +1,48 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4BinaryLightIonReaction_h
#define G4BinaryLightIonReaction_h
#include "G4BinaryCascade.hh"
#include "G4PreCompoundModel.hh"
#include "G4HadFinalState.hh"
#include "G4ExcitationHandler.hh"
class G4BinaryLightIonReaction : public G4HadronicInteraction
{
public:
G4BinaryLightIonReaction();
virtual ~G4BinaryLightIonReaction(){}
G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
G4Nucleus& theNucleus);
private:
G4BinaryCascade theModel;
G4ExcitationHandler theHandler;
G4PreCompoundModel theProjectileFragmentation;
G4HadFinalState theResult;
G4bool EnergyAndMomentumCorrector(G4ReactionProductVector* products,
G4LorentzVector& TotalCollisionMom);
};
#endif
@@ -29,7 +29,7 @@ class G4FieldPropagation
{
public:
G4FieldPropagation() {}
G4FieldPropagation(const G4FieldPropagation &right) {}
G4FieldPropagation(const G4FieldPropagation &) {}
virtual ~G4FieldPropagation() {}
@@ -30,7 +30,6 @@
#include "G4VIntraNuclearTransportModel.hh"
#include "G4KineticTrackVector.hh"
#include "G4FragmentVector.hh"
#include "G4ParticleChange.hh"
#include "G4ReactionProductVector.hh"
#include "G4ReactionProduct.hh"
@@ -51,7 +50,7 @@ private:
G4int operator!=(G4GeneratorPrecompoundInterface& right) {return (this != &right);}
public:
G4VParticleChange* ApplyYourself(const G4Track& aTrack, G4Nucleus& theNucleus);
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &targetNucleus );
G4ReactionProductVector* Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus);
@@ -47,7 +47,7 @@ public:
G4KM_DummyField() { }
~G4KM_DummyField() { }
virtual void GetFieldValue(const G4double[4], G4double *) const { }
virtual void GetFieldValue(const G4double [], G4double * ) const { }
};
#endif
@@ -81,9 +81,7 @@ inline G4KM_NucleonEqRhs::~G4KM_NucleonEqRhs()
// Here by design, but it is unnecessary for nuclear fields
inline void
G4KM_NucleonEqRhs::SetChargeMomentumMass(G4double ,
G4double ,
G4double )
G4KM_NucleonEqRhs::SetChargeMomentumMass(G4double ,G4double ,G4double )
{ }
#endif
@@ -71,9 +71,7 @@ inline G4KM_OpticalEqRhs::~G4KM_OpticalEqRhs()
// Here by design, but it is unnecessary for nuclear fields
inline void G4KM_OpticalEqRhs::SetChargeMomentumMass(G4double ,
G4double ,
G4double )
inline void G4KM_OpticalEqRhs::SetChargeMomentumMass(G4double ,G4double ,G4double )
{ }
#endif
@@ -29,7 +29,7 @@ class G4RKFieldIntegrator : public G4FieldPropagation
{
public:
G4RKFieldIntegrator() {}
G4RKFieldIntegrator(const G4RKFieldIntegrator &) : G4FieldPropagation (){}
G4RKFieldIntegrator(const G4RKFieldIntegrator &):G4FieldPropagation() {}
~G4RKFieldIntegrator() {}
@@ -20,19 +20,6 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class header file
//
// CERN, Geneva, Switzerland
//
// File name: G4RKPropagation.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 6 June 2000
//
// -------------------------------------------------------------------
#ifndef G4RKPropagation_h
#define G4RKPropagation_h 1
@@ -66,7 +53,7 @@ public:
G4double theTimeStep);
G4bool GetSphereIntersectionTimes(const G4KineticTrack * track,
G4double & t1, G4double & t2);
G4ThreeVector GetMomentumTransfer() const;
private:
G4double theOuterRadius;
G4V3DNucleus * theNucleus;
@@ -74,6 +61,8 @@ private:
std::map <G4int, G4Mag_EqRhs *, std::less<G4int> > * theEquationMap;
G4KM_DummyField * theField;
G4ThreeVector theMomentumTranfer;
G4bool GetSphereIntersectionTimes(const G4double radius,
const G4ThreeVector & currentPos,
const G4LorentzVector & momentum,
@@ -97,8 +86,8 @@ private:
return (*theFieldMap)[encoding]->GetBarrier();
}
inline G4double GetField(G4int encoding,G4ThreeVector pos)
{
inline G4double GetField(G4int encoding,G4ThreeVector pos)
{
std::map <G4int, G4VNuclearField *, std::less<G4int> >::iterator iter;
iter = theFieldMap->find(encoding);
if(iter == theFieldMap->end()) return 0;
@@ -21,17 +21,6 @@
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class header file
//
// CERN, Geneva, Switzerland
//
// File name: G4SigmaPlusField.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#ifndef G4SigmaPlusField_h
#define G4SigmaPlusField_h 1
@@ -21,21 +21,6 @@
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class header file
//
// CERN, Geneva, Switzerland
//
// File name: G4VFieldPropagation.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 6 Jun 2000
//
// Modifications: 25 Oct 2000: removed GetExcitationEnergy() method
// from the interface (A. Brunengo)
//
// -------------------------------------------------------------------
#ifndef G4VFieldPropagation_h
#define G4VFieldPropagation_h 1
@@ -60,6 +45,7 @@ public:
virtual void Transport(G4KineticTrackVector &theActive,
const G4KineticTrackVector &theSpectators,
G4double theTimeStep) = 0;
virtual G4ThreeVector GetMomentumTransfer() const =0;
};
#endif
@@ -20,18 +20,6 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class header file
//
// CERN, Geneva, Switzerland
//
// File name: G4VNuclearField.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#ifndef G4VNuclearField_h
#define G4VNuclearField_h 1
@@ -39,6 +27,7 @@
#include "globals.hh"
#include "G4ThreeVector.hh"
#include "G4V3DNucleus.hh"
#include "G4HadronicException.hh"
class G4VNuclearField
{
@@ -38,6 +38,7 @@
#include "G4FermiMomentum.hh"
#include "G4ParticleDefinition.hh"
#include "G4AntiProton.hh"
#include "G4HadTmpUtil.hh"
G4AntiProtonField::G4AntiProtonField(G4V3DNucleus * nucleus, G4double coeff)
: G4VNuclearField(nucleus)
@@ -52,21 +53,21 @@ G4AntiProtonField::~G4AntiProtonField()
const G4AntiProtonField & G4AntiProtonField::operator=(const G4AntiProtonField & )
{
G4Exception("G4AntiProtonField::operator= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4AntiProtonField::operator= meant not to be accessible");
return *this;
}
G4int G4AntiProtonField::operator==(const G4AntiProtonField & ) const
{
G4Exception("G4AntiProtonField::operator== meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4AntiProtonField::operator== meant not to be accessible");
return 0;
}
G4int G4AntiProtonField::operator!=(const G4AntiProtonField & ) const
{
G4Exception("G4AntiProtonField::operator!= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4AntiProtonField::operator!= meant not to be accessible");
return 1;
}
@@ -80,9 +81,9 @@ G4double G4AntiProtonField::GetField(const G4ThreeVector & aPosition)
G4ParticleDefinition *anAntiProton = G4AntiProton::AntiProtonDefinition();
G4double antiProtonMass = anAntiProton->GetPDGMass();
G4int A = static_cast<G4int>(theNucleus->GetMassNumber()+.1);
G4int Z = static_cast<G4int>(theNucleus->GetCharge()+.1);
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(G4int(Z), G4int(A));
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(G4lrint(Z), G4lrint(A));
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = antiProtonMass*nucleusMass/(antiProtonMass+nucleusMass);
@@ -0,0 +1,575 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#include "G4BinaryLightIonReaction.hh"
#include "G4LorentzVector.hh"
#include "G4LorentzRotation.hh"
#include <algorithm>
#include "G4ReactionProductVector.hh"
#include <vector>
#include "G4ping.hh"
#include "G4Delete.hh"
#include "G4Neutron.hh"
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4HadTmpUtil.hh"
G4BinaryLightIonReaction::G4BinaryLightIonReaction()
: theModel(), theHandler(), theProjectileFragmentation(&theHandler) {}
G4HadFinalState *G4BinaryLightIonReaction::
ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus & targetNucleus )
{
static G4int eventcounter=0;
eventcounter++;
if(getenv("BLICDEBUG") ) G4cerr << " ######### Binary Light Ion Reaction number starts ######### "<<eventcounter<<G4endl;
G4ping debug("debug_G4BinaryLightIonReaction");
G4double a1=aTrack.GetDefinition()->GetBaryonNumber();
G4double z1=aTrack.GetDefinition()->GetPDGCharge();
G4double a2=targetNucleus.GetN();
G4double z2=targetNucleus.GetZ();
debug.push_back(a1);
debug.push_back(z1);
debug.push_back(a2);
debug.push_back(z2);
// debug.push_back(m2);
G4LorentzVector mom(aTrack.Get4Momentum());
debug.push_back(mom);
debug.dump();
G4LorentzRotation toBreit(mom.boostVector());
G4bool swapped = false;
if(a2<a1)
{
debug.push_back("swapping....");
swapped = true;
G4double tmp(0);
tmp = a2; a2=a1; a1=tmp;
tmp = z2; z2=z1; z1=tmp;
G4double m1=G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(G4lrint(z1),G4lrint(a1));
G4LorentzVector it(m1, G4ThreeVector(0,0,0));
mom = toBreit*it;
}
debug.push_back("After swap");
debug.push_back(a1);
debug.push_back(z1);
debug.push_back(a2);
debug.push_back(z2);
debug.push_back(mom);
debug.dump();
G4ReactionProductVector * result = NULL;
G4ReactionProductVector * cascaders= new G4ReactionProductVector;
G4double m_nucl(0); // to check energy balance
// G4double m1=G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(G4lrint(z1),G4lrint(a1));
// G4cout << "Entering the decision point "
// << (mom.t()-mom.mag())/a1 << " "
// << a1<<" "<< z1<<" "
// << a2<<" "<< z2<<G4endl
// << " "<<mom.t()-mom.mag()<<" "
// << mom.t()- m1<<G4endl;
if( (mom.t()-mom.mag())/a1 < 50*MeV )
{
// G4cout << "Using pre-compound only, E= "<<mom.t()-mom.mag()<<G4endl;
// m_nucl = mom.mag();
G4Fragment aPreFrag;
aPreFrag.SetA(a1+a2);
aPreFrag.SetZ(z1+z2);
aPreFrag.SetNumberOfParticles(G4lrint(a1));
aPreFrag.SetNumberOfCharged(G4lrint(z1));
aPreFrag.SetNumberOfHoles(0);
G4ThreeVector plop(0.,0., mom.vect().mag());
G4double m2=G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(G4lrint(z2),G4lrint(a2));
m_nucl=m2;
G4LorentzVector aL(mom.t()+m2, plop);
aPreFrag.SetMomentum(aL);
G4ParticleDefinition * preFragDef;
preFragDef = G4ParticleTable::GetParticleTable()
->FindIon(G4lrint(z1+z2),G4lrint(a1+a2),0,G4lrint(z1+z2));
aPreFrag.SetParticleDefinition(preFragDef);
// G4cout << "Fragment INFO "<< a1+a2 <<" "<<z1+z2<<" "
// << aL <<" "<<preFragDef->GetParticleName()<<G4endl;
cascaders = theProjectileFragmentation.DeExcite(aPreFrag);
G4double tSum = 0;
for(size_t count = 0; count<cascaders->size(); count++)
{
cascaders->operator[](count)->SetNewlyAdded(true);
tSum += cascaders->operator[](count)->GetKineticEnergy();
}
// G4cout << "Exiting pre-compound only, E= "<<tSum<<G4endl;
}
else
{
G4V3DNucleus * fancyNucleus = NULL;
G4V3DNucleus * projectile = NULL;
G4double m1(0) ,m2(0);
G4LorentzVector it;
G4FermiMomentum theFermi;
while(!result)
{
projectile = new G4Fancy3DNucleus;
projectile->Init(a1, z1);
m1=G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(
projectile->GetCharge(),projectile->GetMassNumber());
it=toBreit * G4LorentzVector(m1,G4ThreeVector(0,0,0));
fancyNucleus = new G4Fancy3DNucleus;
fancyNucleus->Init(a2, z2);
m2=G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(
fancyNucleus->GetCharge(),fancyNucleus->GetMassNumber());
m_nucl = ( swapped ) ? m1 : m2;
// G4cout << " mass table, nucleus, delta : " << m2 <<" "<< fancyNucleus->GetMass()
// <<" "<<m2-fancyNucleus->GetMass() << G4endl;
G4double impactMax = fancyNucleus->GetOuterRadius()+projectile->GetOuterRadius();
G4double aX=(2.*G4UniformRand()-1.)*impactMax;
G4double aY=(2.*G4UniformRand()-1.)*impactMax;
G4ThreeVector pos(aX, aY, -2.*impactMax-5.*fermi);
debug.push_back("Impact parameter");
debug.push_back(aX);
debug.push_back(aY);
debug.push_back(-2.*impactMax);
debug.dump();
G4KineticTrackVector * initalState = new G4KineticTrackVector;
projectile->StartLoop();
G4Nucleon * aNuc;
G4LorentzVector tmpV(0,0,0,0);
G4LorentzVector nucleonMom(1./a1*mom);
nucleonMom.setZ(nucleonMom.vect().mag());
nucleonMom.setX(0);
nucleonMom.setY(0);
debug.push_back(" projectile nucleon momentum");
debug.push_back(nucleonMom);
debug.dump();
theFermi.Init(a1,z1);
while( (aNuc=projectile->GetNextNucleon()) )
{
G4LorentzVector p4 = aNuc->GetMomentum();
tmpV+=p4;
G4ThreeVector nucleonPosition(aNuc->GetPosition());
G4double density=(projectile->GetNuclearDensity())->GetDensity(nucleonPosition);
nucleonPosition += pos;
G4KineticTrack * it = new G4KineticTrack(aNuc, nucleonPosition, nucleonMom );
it->SetState(G4KineticTrack::outside);
G4double pfermi= theFermi.GetFermiMomentum(density);
G4double mass = aNuc->GetDefinition()->GetPDGMass();
G4double Efermi= sqrt( sqr(mass) + sqr(pfermi)) - mass;
it->SetProjectilePotential(-Efermi);
initalState->push_back(it);
}
debug.push_back(tmpV);
debug.dump();
result=theModel.Propagate(initalState, fancyNucleus);
debug.push_back("################# Result size");
debug.push_back(result->size());
debug.dump();
std::for_each(initalState->begin(), initalState->end(), Delete<G4KineticTrack>());
delete initalState;
if(result->size()==0)
{
delete result; result=0;
delete fancyNucleus;
delete projectile;
}
else
{
break;
}
}
debug.push_back("################# Through the loop ? "); debug.dump();
//inverse transformation in case we swapped.
G4int resA(0), resZ(0);
G4Nucleon * aNuc;
// fancyNucleus->StartLoop();
// while( (aNuc=fancyNucleus->GetNextNucleon()) )
// {
// G4cout << " tgt Nucleon : " << aNuc->GetDefinition()->GetParticleName() <<" "<< aNuc->AreYouHit() <<" "<<aNuc->GetMomentum()<<G4endl;
// }
G4ReactionProductVector * spectators= new G4ReactionProductVector;
debug.push_back("getting at the hits"); debug.dump();
// the projectile excitation energy estimate...
G4double theStatisticalExEnergy = 0;
projectile->StartLoop();
while( (aNuc=projectile->GetNextNucleon()) )
{
// G4cout << " Nucleon : " << aNuc->GetDefinition()->GetParticleName() <<" "<< aNuc->AreYouHit() <<" "<<aNuc->GetMomentum()<<G4endl;
debug.push_back("getting the hits"); debug.dump();
if(!aNuc->AreYouHit())
{
resA++;
resZ+=G4lrint(aNuc->GetDefinition()->GetPDGCharge());
}
else
{
debug.push_back(" ##### a hit ##### "); debug.dump();
G4ThreeVector aPosition(aNuc->GetPosition());
G4double localDensity = projectile->GetNuclearDensity()->GetDensity(aPosition);
G4double localPfermi = theFermi.GetFermiMomentum(localDensity);
G4double nucMass = aNuc->GetDefinition()->GetPDGMass();
G4double localFermiEnergy = sqrt(nucMass*nucMass + localPfermi*localPfermi) - nucMass;
G4double deltaE = localFermiEnergy - (aNuc->GetMomentum().t()-aNuc->GetMomentum().mag());
theStatisticalExEnergy += deltaE;
}
debug.push_back("collected a hit"); debug.dump();
}
delete fancyNucleus;
delete projectile;
G4ping debug("debug_G4BinaryLightIonReaction_1");
debug.push_back("have the hits. A,Z, excitE");
debug.push_back(resA);
debug.push_back(resZ);
debug.push_back(theStatisticalExEnergy);
debug.dump();
// Calculate excitation energy
G4LorentzVector iState = mom;
iState.setT(iState.getT()+m2);
G4LorentzVector fState(0,0,0,0);
G4LorentzVector pspectators(0,0,0,0);
unsigned int i(0);
for(i=0; i<result->size(); i++)
{
if( (*result)[i]->GetNewlyAdded() )
{
fState += G4LorentzVector( (*result)[i]->GetMomentum(), (*result)[i]->GetTotalEnergy() );
cascaders->push_back((*result)[i]);
// G4cout <<" secondary ... ";
}
else {
// G4cout <<" spectator ... ";
pspectators += G4LorentzVector( (*result)[i]->GetMomentum(), (*result)[i]->GetTotalEnergy() );
spectators->push_back((*result)[i]);
}
// G4cout << (*result)[i]<< " "
// << (*result)[i]->GetDefinition()->GetParticleName() << " "
// << (*result)[i]->GetMomentum()<< " "
// << (*result)[i]->GetTotalEnergy() << G4endl;
}
delete result;
debug.push_back(" iState - (fState+pspectators) ");
debug.push_back(iState-fState-pspectators);
debug.dump();
G4LorentzVector momentum(iState-fState);
G4int loopcount(0);
while (abs(momentum-pspectators.e()) > 10*MeV)
{
debug.push_back("the momentum balance");
debug.push_back(iState);
debug.push_back(fState);
debug.push_back(momentum-pspectators);
debug.push_back(momentum);
debug.dump();
G4LorentzVector pCorrect(iState-pspectators);
G4bool EnergyIsCorrect=EnergyAndMomentumCorrector(cascaders, pCorrect);
if ( ! EnergyIsCorrect && getenv("debug_G4BinaryLightIonReactionResults"))
{
G4cout << "Warning - G4BinaryLightIonReaction E/P correction for cascaders failed" << G4endl;
}
fState=G4LorentzVector();
for(i=0; i<cascaders->size(); i++)
{
fState += G4LorentzVector( (*cascaders)[i]->GetMomentum(), (*cascaders)[i]->GetTotalEnergy() );
}
momentum=iState-fState;
debug.push_back("the momentum balance after correction");
debug.push_back(iState);
debug.push_back(fState);
debug.push_back(momentum-pspectators);
debug.push_back(momentum);
debug.dump();
if (++loopcount > 10 )
{
if ( momentum.vect().mag() > momentum.e() )
{
G4cerr << "G4BinaryLightIonReaction.cc: Cannot correct 4-momentum of cascade particles" << G4endl;
throw G4HadronicException(__FILE__, __LINE__, "G4BinaryCasacde::ApplyCollision()");
} else {
break;
}
}
}
// call precompound model
G4ReactionProductVector * proFrag = NULL;
G4LorentzVector pFragment;
// G4cout << " == pre boost 1 "<< momentum.e()<< " "<< momentum.mag()<<G4endl;
G4LorentzRotation boost_fragments;
// G4cout << " == post boost 1 "<< momentum.e()<< " "<< momentum.mag()<<G4endl;
// G4LorentzRotation boost_spectator_mom(-momentum.boostVector());
// G4cout << "- momentum " << boost_spectator_mom * momentum << G4endl;
if(resZ>0 && resA>1)
{
// Make the fragment
G4Fragment aProRes;
aProRes.SetA(resA);
aProRes.SetZ(resZ);
aProRes.SetNumberOfParticles(0);
aProRes.SetNumberOfCharged(0);
aProRes.SetNumberOfHoles(G4lrint(a1)-resA);
G4double mFragment=G4ParticleTable::GetParticleTable()->GetIonTable()->GetIonMass(resZ,resA);
G4LorentzVector pFragment(0,0,0,mFragment+std::max(0.,theStatisticalExEnergy) );
aProRes.SetMomentum(pFragment);
G4ParticleDefinition * resDef;
resDef = G4ParticleTable::GetParticleTable()->FindIon(resZ,resA,0,resZ);
aProRes.SetParticleDefinition(resDef);
proFrag = theHandler.BreakItUp(aProRes);
if ( momentum.vect().mag() > momentum.e() )
{
G4cout << "mom check: " << momentum
<< " 3.mag "<< momentum.vect().mag() << G4endl
<< " .. iState/fState/spectators " << iState <<" "
<< fState << " " << pspectators << G4endl
<< " .. A,Z " << resA <<" "<< resZ << G4endl;
}
G4LorentzRotation boost_fragments_here(momentum.boostVector());
boost_fragments = boost_fragments_here;
// G4cout << " Fragment a,z, Mass Fragment, mass spect-mom, exitationE "
// << resA <<" "<< resZ <<" "<< mFragment <<" "
// << momentum.mag() <<" "<< momentum.mag() - mFragment
// << " "<<theStatisticalExEnergy
// << " "<< boost_fragments*pFragment<< G4endl;
}
else if(resA!=0)
{
G4ReactionProductVector::iterator ispectator;
for (ispectator=spectators->begin();ispectator!=spectators->end();ispectator++)
{
(*ispectator)->SetNewlyAdded(true);
// G4cout << "from spectator "
// << (*ispectator)->GetDefinition()->GetParticleName() << " "
// << (*ispectator)->GetMomentum()<< " "
// << (*ispectator)->GetTotalEnergy() << G4endl;
}
}
if (spectators) delete spectators;
// collect the evaporation part
debug.push_back("the nucleon count balance");
debug.push_back(resA);
debug.push_back(resZ);
if(proFrag) debug.push_back(proFrag->size());
debug.dump();
G4ReactionProductVector::iterator ii;
G4LorentzVector pFragments(0);
if(proFrag) for(ii=proFrag->begin(); ii!=proFrag->end(); ii++)
{
(*ii)->SetNewlyAdded(true);
G4LorentzVector tmp((*ii)->GetMomentum(),(*ii)->GetTotalEnergy());
tmp *= boost_fragments;
(*ii)->SetMomentum(tmp.vect());
(*ii)->SetTotalEnergy(tmp.e());
// result->push_back(*ii);
pFragments += tmp;
}
// G4cout << "Fragmented p, momentum, delta " << pFragments <<" "<<momentum
// <<" "<< pFragments-momentum << G4endl;
debug.push_back("################# done with evaporation"); debug.dump();
// correct p/E of Cascade secondaries
G4LorentzVector pCas=iState - pFragments;
// G4cout <<" Going to correct from " << fState << " to " << pCas << G4endl;
G4bool EnergyIsCorrect=EnergyAndMomentumCorrector(cascaders, pCas);
if ( ! EnergyIsCorrect )
{
if(getenv("debug_G4BinaryLightIonReactionResults"))
G4cout << "G4BinaryLightIonReaction E/P correction for nucleus failed, will try to correct overall" << G4endl;
}
// Add deexcitation secondaries
if(proFrag) for(ii=proFrag->begin(); ii!=proFrag->end(); ii++)
{
cascaders->push_back(*ii);
}
if ( ! EnergyIsCorrect )
{
if (! EnergyAndMomentumCorrector(cascaders,iState))
{
if(getenv("debug_G4BinaryLightIonReactionResults"))
G4cout << "G4BinaryLightIonReaction E/P corrections failed" << G4endl;
}
}
}
// Rotate to lab
G4LorentzRotation toZ;
toZ.rotateZ(-1*mom.phi());
toZ.rotateY(-1*mom.theta());
G4LorentzRotation toLab(toZ.inverse());
// Fill the particle change, while rotating. Boost from projectile breit-frame in case we swapped.
// theResult.Clear();
theResult.Clear();
theResult.SetStatusChange(stopAndKill);
G4double Etot(0);
size_t i=0;
for(i=0; i<cascaders->size(); i++)
{
if((*cascaders)[i]->GetNewlyAdded())
{
G4DynamicParticle * aNew =
new G4DynamicParticle((*cascaders)[i]->GetDefinition(),
(*cascaders)[i]->GetTotalEnergy(),
(*cascaders)[i]->GetMomentum() );
G4LorentzVector tmp = aNew->Get4Momentum();
if(swapped)
{
tmp*=toBreit.inverse();
}
tmp *= toLab;
aNew->Set4Momentum(tmp);
theResult.AddSecondary(aNew);
Etot += tmp.e();
// G4cout << "LIBIC: Secondary " << aNew->GetDefinition()->GetParticleName()
// <<" "<< aNew->GetMomentum()
// <<" "<< aNew->GetTotalEnergy()
// << G4endl;
}
}
if(cascaders) delete cascaders;
G4ping debug1("debug_G4BinaryLightIonReactionResults");
debug1.push_back("Result analysis, secondaries");
debug1.push_back(theResult.GetNumberOfSecondaries());
debug1.dump();
debug1.push_back(" Energy conservation initial/final/delta(init-final) ");
debug1.push_back(aTrack.GetTotalEnergy() + m_nucl);
debug1.push_back(aTrack.GetTotalEnergy());
debug1.push_back(m_nucl);
debug1.push_back(Etot);
debug1.push_back(aTrack.GetTotalEnergy() + m_nucl - Etot);
debug1.dump();
if(getenv("BLICDEBUG") ) G4cerr << " ######### Binary Light Ion Reaction number ends ######### "<<eventcounter<<G4endl;
return &theResult;
}
//****************************************************************************
G4bool G4BinaryLightIonReaction::EnergyAndMomentumCorrector(
G4ReactionProductVector* Output, G4LorentzVector& TotalCollisionMom)
//****************************************************************************
{
const int nAttemptScale = 2500;
const double ErrLimit = 1.E-6;
if (Output->empty())
return TRUE;
G4LorentzVector SumMom(0);
G4double SumMass = 0;
G4double TotalCollisionMass = TotalCollisionMom.m();
size_t i = 0;
// Calculate sum hadron 4-momenta and summing hadron mass
for(i = 0; i < Output->size(); i++)
{
SumMom += G4LorentzVector((*Output)[i]->GetMomentum(),(*Output)[i]->GetTotalEnergy());
SumMass += (*Output)[i]->GetDefinition()->GetPDGMass();
}
// G4cout << " E/P corrector, SumMass, SumMom.m2, TotalMass "
// << SumMass <<" "<< SumMom.m2() <<" "<<TotalCollisionMass<< G4endl;
if (SumMass > TotalCollisionMass) return FALSE;
SumMass = SumMom.m2();
if (SumMass < 0) return FALSE;
SumMass = sqrt(SumMass);
// Compute c.m.s. hadron velocity and boost KTV to hadron c.m.s.
G4ThreeVector Beta = -SumMom.boostVector();
// G4cout << " == pre boost 2 "<< SumMom.e()<< " "<< SumMom.mag()<<" "<< Beta <<G4endl;
//--old Output->Boost(Beta);
for(i = 0; i < Output->size(); i++)
{
G4LorentzVector mom = G4LorentzVector((*Output)[i]->GetMomentum(),(*Output)[i]->GetTotalEnergy());
mom *= Beta;
(*Output)[i]->SetMomentum(mom.vect());
(*Output)[i]->SetTotalEnergy(mom.e());
}
// Scale total c.m.s. hadron energy (hadron system mass).
// It should be equal interaction mass
G4double Scale = 0,OldScale=0;
G4double factor = 1.;
G4int cAttempt = 0;
G4double Sum = 0;
G4bool success = false;
for(cAttempt = 0; cAttempt < nAttemptScale; cAttempt++)
{
Sum = 0;
for(i = 0; i < Output->size(); i++)
{
G4LorentzVector HadronMom = G4LorentzVector((*Output)[i]->GetMomentum(),(*Output)[i]->GetTotalEnergy());
HadronMom.setVect(HadronMom.vect()+ factor*Scale*HadronMom.vect());
G4double E = sqrt(HadronMom.vect().mag2() + sqr((*Output)[i]->GetDefinition()->GetPDGMass()));
HadronMom.setE(E);
(*Output)[i]->SetMomentum(HadronMom.vect());
(*Output)[i]->SetTotalEnergy(HadronMom.e());
Sum += E;
}
OldScale=Scale;
Scale = TotalCollisionMass/Sum - 1;
if ( cAttempt > 10 )
{
// G4cout << " speed it up? " << abs(OldScale/(OldScale-Scale)) << G4endl;
factor=std::max(1.,log(abs(OldScale/(OldScale-Scale))));
// G4cout << " ? factor ? " << factor << G4endl;
}
// G4cout << "E/P corr - " << cAttempt << " " << Scale << G4endl;
if (abs(Scale) <= ErrLimit)
{
if (getenv("debug_G4BinaryLightIonReactionResults")) G4cout << "E/p corrector: " << cAttempt << G4endl;
success = true;
break;
}
}
if( (!success) && getenv("debug_G4BinaryLightIonReactionResults"))
{
G4cout << "G4G4BinaryLightIonReaction::EnergyAndMomentumCorrector - Warning"<<G4endl;
G4cout << " Scale not unity at end of iteration loop: "<<TotalCollisionMass<<" "<<Sum<<" "<<Scale<<G4endl;
G4cout << " Increase number of attempts or increase ERRLIMIT"<<G4endl;
}
// Compute c.m.s. interaction velocity and KTV back boost
Beta = TotalCollisionMom.boostVector();
//--old Output->Boost(Beta);
for(i = 0; i < Output->size(); i++)
{
G4LorentzVector mom = G4LorentzVector((*Output)[i]->GetMomentum(),(*Output)[i]->GetTotalEnergy());
mom *= Beta;
(*Output)[i]->SetMomentum(mom.vect());
(*Output)[i]->SetTotalEnergy(mom.e());
}
return TRUE;
}
@@ -21,10 +21,11 @@
// ********************************************************************
//
#include "G4FieldPropagation.hh"
#include "G4HadronicException.hh"
const G4FieldPropagation & G4FieldPropagation::operator=(const G4FieldPropagation &)
{
G4Exception("G4FieldPropagation::operator= meant to be private");
throw G4HadronicException(__FILE__, __LINE__, "G4FieldPropagation::operator= meant to be private");
return *this;
}
@@ -28,14 +28,14 @@
// HPW, 10DEC 98, the decay part originally written by Gunter Folger in his FTF-test-program.
//
G4VParticleChange* G4GeneratorPrecompoundInterface::
ApplyYourself(const G4Track& , G4Nucleus& )
G4HadFinalState* G4GeneratorPrecompoundInterface::
ApplyYourself(const G4HadProjectile &, G4Nucleus & )
{
std::cout << "G4GeneratorPrecompoundInterface: ApplyYourself interface called stand-allone."<< G4endl;
std::cout << "This class is only a mediator between generator and precompound"<<G4endl;
std::cout << "Please remove from your physics list."<<G4endl;
G4Exception("SEVERE: G4GeneratorPrecompoundInterface model interface called stand-allone.");
return new G4ParticleChange;
throw G4HadronicException(__FILE__, __LINE__, "SEVERE: G4GeneratorPrecompoundInterface model interface called stand-allone.");
return new G4HadFinalState;
}
G4ReactionProductVector* G4GeneratorPrecompoundInterface::
@@ -142,7 +142,7 @@
if(!theDeExcitation)
{
// G4Exception("Please register an evaporation phase with G4GeneratorPrecompoundInterface.");
// throw G4HadronicException(__FILE__, __LINE__, "Please register an evaporation phase with G4GeneratorPrecompoundInterface.");
}
else if(0!=anA && 0!=aZ)
{
@@ -173,7 +173,7 @@
}
else
{
// G4Exception("Please register an evaporation phase with G4GeneratorPrecompoundInterface.");
// throw G4HadronicException(__FILE__, __LINE__, "Please register an evaporation phase with G4GeneratorPrecompoundInterface.");
}
// now return
@@ -49,7 +49,7 @@ G4KM_NucleonEqRhs::G4KM_NucleonEqRhs(G4KM_DummyField *field,
void G4KM_NucleonEqRhs::EvaluateRhsGivenB(const G4double y[],
const G4double * ,
const G4double *,
G4double dydx[]) const
{
G4double yMod = sqrt(y[0]*y[0]+y[1]*y[1]+y[2]*y[2]);
@@ -81,9 +81,11 @@ void G4KM_NucleonEqRhs::EvaluateRhsGivenB(const G4double y[],
const G4VNuclearDensity * nuclearDensity=theNucleus->GetNuclearDensity();
// do not check for theMass != 0 : it is an error and core dump will signal it
G4double deriv = (factor/theMass)*
pow(nuclearDensity->GetDensity(pos), -1./3.)*nuclearDensity->GetDeriv(pos);
G4double density= nuclearDensity->GetDensity(pos);
G4double deriv(0);
if (density > 0 ) deriv = (factor/theMass)*
pow(density, -1./3.)*nuclearDensity->GetDeriv(pos);
// dydx[3] = yMod == 0 ? 0 : -deriv*y[0]/yMod;
// dydx[4] = yMod == 0 ? 0 : -deriv*y[1]/yMod;
@@ -36,6 +36,7 @@
#include "G4KM_OpticalEqRhs.hh"
#include "G4NucleiPropertiesTable.hh"
#include "G4VNuclearDensity.hh"
#include "G4HadTmpUtil.hh"
G4KM_OpticalEqRhs::G4KM_OpticalEqRhs(G4KM_DummyField *field,
@@ -49,9 +50,9 @@ G4KM_OpticalEqRhs::G4KM_OpticalEqRhs(G4KM_DummyField *field,
void G4KM_OpticalEqRhs::SetFactor(G4double mass, G4double opticalParameter)
{
G4int A = static_cast<G4int>(theNucleus->GetMassNumber()+.1);
G4int Z = static_cast<G4int>(theNucleus->GetCharge()+.1);
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(G4lrint(Z), G4lrint(A));
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = mass*nucleusMass/(mass+nucleusMass);
@@ -37,6 +37,7 @@
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4KaonMinus.hh"
#include "G4HadTmpUtil.hh"
G4KaonMinusField::G4KaonMinusField(G4V3DNucleus * nucleus, G4double coeff)
: G4VNuclearField(nucleus)
@@ -49,23 +50,23 @@ G4KaonMinusField::~G4KaonMinusField()
{ }
const G4KaonMinusField & G4KaonMinusField::operator=(const G4KaonMinusField & )
const G4KaonMinusField & G4KaonMinusField::operator=(const G4KaonMinusField &)
{
G4Exception("G4KaonMinusField::operator= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4KaonMinusField::operator= meant not to be accessible");
return *this;
}
G4int G4KaonMinusField::operator==(const G4KaonMinusField & ) const
G4int G4KaonMinusField::operator==(const G4KaonMinusField &) const
{
G4Exception("G4KaonMinusField::operator== meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4KaonMinusField::operator== meant not to be accessible");
return 0;
}
G4int G4KaonMinusField::operator!=(const G4KaonMinusField & ) const
G4int G4KaonMinusField::operator!=(const G4KaonMinusField &) const
{
G4Exception("G4KaonMinusField::operator!= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4KaonMinusField::operator!= meant not to be accessible");
return 1;
}
@@ -78,9 +79,9 @@ G4double G4KaonMinusField::GetField(const G4ThreeVector & aPosition)
G4double kaonMass = G4KaonMinus::KaonMinus()->GetPDGMass();
G4int A = static_cast<G4int>(theNucleus->GetMassNumber()+.1);
G4int Z = static_cast<G4int>(theNucleus->GetCharge()+.1);
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(G4lrint(Z), G4lrint(A));
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = kaonMass*nucleusMass/(kaonMass+nucleusMass);
@@ -37,6 +37,7 @@
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4KaonPlus.hh"
#include "G4HadTmpUtil.hh"
G4KaonPlusField::G4KaonPlusField(G4V3DNucleus * nucleus, G4double coeff)
: G4VNuclearField(nucleus)
@@ -49,23 +50,23 @@ G4KaonPlusField::~G4KaonPlusField()
{ }
const G4KaonPlusField & G4KaonPlusField::operator=(const G4KaonPlusField & )
const G4KaonPlusField & G4KaonPlusField::operator=(const G4KaonPlusField &)
{
G4Exception("G4KaonPlusField::operator= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4KaonPlusField::operator= meant not to be accessible");
return *this;
}
G4int G4KaonPlusField::operator==(const G4KaonPlusField & ) const
G4int G4KaonPlusField::operator==(const G4KaonPlusField &) const
{
G4Exception("G4KaonPlusField::operator== meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4KaonPlusField::operator== meant not to be accessible");
return 0;
}
G4int G4KaonPlusField::operator!=(const G4KaonPlusField & ) const
G4int G4KaonPlusField::operator!=(const G4KaonPlusField &) const
{
G4Exception("G4KaonPlusField::operator!= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4KaonPlusField::operator!= meant not to be accessible");
return 1;
}
@@ -78,9 +79,9 @@ G4double G4KaonPlusField::GetField(const G4ThreeVector & aPosition)
G4double kaonMass = G4KaonPlus::KaonPlus()->GetPDGMass();
G4int A = static_cast<G4int>(theNucleus->GetMassNumber()+.1);
G4int Z = static_cast<G4int>(theNucleus->GetCharge()+.1);
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(G4lrint(Z), G4lrint(A));
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = kaonMass*nucleusMass/(kaonMass+nucleusMass);
@@ -37,6 +37,7 @@
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4KaonZero.hh"
#include "G4HadTmpUtil.hh"
G4KaonZeroField::G4KaonZeroField(G4V3DNucleus * nucleus, G4double coeff)
: G4VNuclearField(nucleus)
@@ -49,23 +50,23 @@ G4KaonZeroField::~G4KaonZeroField()
{ }
const G4KaonZeroField & G4KaonZeroField::operator=(const G4KaonZeroField & )
const G4KaonZeroField & G4KaonZeroField::operator=(const G4KaonZeroField &)
{
G4Exception("G4KaonZeroField::operator= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4KaonZeroField::operator= meant not to be accessible");
return *this;
}
G4int G4KaonZeroField::operator==(const G4KaonZeroField & ) const
G4int G4KaonZeroField::operator==(const G4KaonZeroField &) const
{
G4Exception("G4KaonZeroField::operator== meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4KaonZeroField::operator== meant not to be accessible");
return 0;
}
G4int G4KaonZeroField::operator!=(const G4KaonZeroField & ) const
G4int G4KaonZeroField::operator!=(const G4KaonZeroField &) const
{
G4Exception("G4KaonZeroField::operator!= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4KaonZeroField::operator!= meant not to be accessible");
return 1;
}
@@ -78,9 +79,9 @@ G4double G4KaonZeroField::GetField(const G4ThreeVector & aPosition)
G4double kaonMass = G4KaonZero::KaonZero()->GetPDGMass();
G4int A = static_cast<G4int>(theNucleus->GetMassNumber()+.1);
G4int Z = static_cast<G4int>(theNucleus->GetCharge()+.1);
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(G4lrint(Z), G4lrint(A));
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = kaonMass*nucleusMass/(kaonMass+nucleusMass);
@@ -74,23 +74,23 @@ G4NeutronField::~G4NeutronField()
{ }
const G4NeutronField & G4NeutronField::operator=(const G4NeutronField & )
const G4NeutronField & G4NeutronField::operator=(const G4NeutronField &)
{
G4Exception("G4NeutronField::operator= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4NeutronField::operator= meant not to be accessible");
return *this;
}
G4int G4NeutronField::operator==(const G4NeutronField & ) const
G4int G4NeutronField::operator==(const G4NeutronField &) const
{
G4Exception("G4NeutronField::operator== meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4NeutronField::operator== meant not to be accessible");
return 0;
}
G4int G4NeutronField::operator!=(const G4NeutronField & ) const
G4int G4NeutronField::operator!=(const G4NeutronField &) const
{
G4Exception("G4NeutronField::operator!= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4NeutronField::operator!= meant not to be accessible");
return 1;
}
@@ -98,8 +98,8 @@ G4int G4NeutronField::operator!=(const G4NeutronField & ) const
G4double G4NeutronField::GetField(const G4ThreeVector & aPosition)
{
G4double x = aPosition.mag();
size_t index = static_cast<size_t>(x/(0.3*fermi) );
if(index+2>theFermiMomBuffer.size()) return theFermiMomBuffer.back();
G4int index = static_cast<G4int>(x/(0.3*fermi) );
if(index+2> static_cast<G4int>(theFermiMomBuffer.size())) return theFermiMomBuffer.back();
G4double y1 = theFermiMomBuffer[index];
G4double y2 = theFermiMomBuffer[index+1];
G4double x1 = (0.3*fermi)*index;
@@ -37,6 +37,7 @@
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4PionMinus.hh"
#include "G4HadTmpUtil.hh"
G4PionMinusField::G4PionMinusField(G4V3DNucleus * nucleus, G4double coeff)
: G4VNuclearField(nucleus)
@@ -49,23 +50,23 @@ G4PionMinusField::~G4PionMinusField()
{ }
const G4PionMinusField & G4PionMinusField::operator=(const G4PionMinusField & )
const G4PionMinusField & G4PionMinusField::operator=(const G4PionMinusField &)
{
G4Exception("G4PionMinusField::operator= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4PionMinusField::operator= meant not to be accessible");
return *this;
}
G4int G4PionMinusField::operator==(const G4PionMinusField & ) const
G4int G4PionMinusField::operator==(const G4PionMinusField &) const
{
G4Exception("G4PionMinusField::operator== meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4PionMinusField::operator== meant not to be accessible");
return 0;
}
G4int G4PionMinusField::operator!=(const G4PionMinusField & ) const
G4int G4PionMinusField::operator!=(const G4PionMinusField &) const
{
G4Exception("G4PionMinusField::operator!= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4PionMinusField::operator!= meant not to be accessible");
return 1;
}
@@ -75,10 +76,10 @@ G4double G4PionMinusField::GetField(const G4ThreeVector & aPosition)
// Field is 0 out of the nucleus!
if(aPosition.mag() >= radius) return 0.0;
G4int A = static_cast<G4int>(theNucleus->GetMassNumber()+.1);
G4int Z = static_cast<G4int>(theNucleus->GetCharge()+.1);
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double pionMinusMass = G4PionMinus::PionMinus()->GetPDGMass();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(G4lrint(Z), G4lrint(A));
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = pionMinusMass*nucleusMass/(pionMinusMass+nucleusMass);
@@ -37,6 +37,7 @@
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4PionPlus.hh"
#include "G4HadTmpUtil.hh"
G4PionPlusField::G4PionPlusField(G4V3DNucleus * nucleus, G4double coeff)
@@ -50,23 +51,23 @@ G4PionPlusField::~G4PionPlusField()
{ }
const G4PionPlusField & G4PionPlusField::operator=(const G4PionPlusField & )
const G4PionPlusField & G4PionPlusField::operator=(const G4PionPlusField &)
{
G4Exception("G4PionPlusField::operator= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4PionPlusField::operator= meant not to be accessible");
return *this;
}
G4int G4PionPlusField::operator==(const G4PionPlusField & ) const
G4int G4PionPlusField::operator==(const G4PionPlusField &) const
{
G4Exception("G4PionPlusField::operator== meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4PionPlusField::operator== meant not to be accessible");
return 0;
}
G4int G4PionPlusField::operator!=(const G4PionPlusField & ) const
G4int G4PionPlusField::operator!=(const G4PionPlusField &) const
{
G4Exception("G4PionPlusField::operator!= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4PionPlusField::operator!= meant not to be accessible");
return 1;
}
@@ -77,9 +78,10 @@ G4double G4PionPlusField::GetField(const G4ThreeVector & aPosition)
if(aPosition.mag() >= radius) return 0.0;
G4double pionPlusMass = G4PionPlus::PionPlus()->GetPDGMass();
G4int A = static_cast<G4int>(theNucleus->GetMassNumber()+.1);
G4int Z = static_cast<G4int>(theNucleus->GetCharge()+.1);
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(G4lrint(Z), G4lrint(A));
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = pionPlusMass*nucleusMass/(pionPlusMass+nucleusMass);
@@ -37,6 +37,7 @@
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4PionZero.hh"
#include "G4HadTmpUtil.hh"
G4PionZeroField::G4PionZeroField(G4V3DNucleus * nucleus, G4double coeff)
@@ -50,23 +51,23 @@ G4PionZeroField::~G4PionZeroField()
{ }
const G4PionZeroField & G4PionZeroField::operator=(const G4PionZeroField & )
const G4PionZeroField & G4PionZeroField::operator=(const G4PionZeroField &)
{
G4Exception("G4PionZeroField::operator= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4PionZeroField::operator= meant not to be accessible");
return *this;
}
G4int G4PionZeroField::operator==(const G4PionZeroField & ) const
G4int G4PionZeroField::operator==(const G4PionZeroField &) const
{
G4Exception("G4PionZeroField::operator== meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4PionZeroField::operator== meant not to be accessible");
return 0;
}
G4int G4PionZeroField::operator!=(const G4PionZeroField & ) const
G4int G4PionZeroField::operator!=(const G4PionZeroField &) const
{
G4Exception("G4PionZeroField::operator!= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4PionZeroField::operator!= meant not to be accessible");
return 1;
}
@@ -77,10 +78,10 @@ G4double G4PionZeroField::GetField(const G4ThreeVector & aPosition)
if(aPosition.mag() >= radius) return 0.0;
G4double pionZeroMass = G4PionZero::PionZero()->GetPDGMass();
G4int A = static_cast<G4int>(theNucleus->GetMassNumber()+.1);
G4int Z = static_cast<G4int>(theNucleus->GetCharge()+.1);
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(G4lrint(Z), G4lrint(A));
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = pionZeroMass*nucleusMass/(pionZeroMass+nucleusMass);
@@ -76,23 +76,23 @@ G4ProtonField::~G4ProtonField()
{ }
const G4ProtonField & G4ProtonField::operator=(const G4ProtonField & )
const G4ProtonField & G4ProtonField::operator=(const G4ProtonField &)
{
G4Exception("G4ProtonField::operator= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4ProtonField::operator= meant not to be accessible");
return *this;
}
G4int G4ProtonField::operator==(const G4ProtonField & ) const
G4int G4ProtonField::operator==(const G4ProtonField &) const
{
G4Exception("G4ProtonField::operator== meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4ProtonField::operator== meant not to be accessible");
return 0;
}
G4int G4ProtonField::operator!=(const G4ProtonField & ) const
G4int G4ProtonField::operator!=(const G4ProtonField &) const
{
G4Exception("G4ProtonField::operator!= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4ProtonField::operator!= meant not to be accessible");
return 1;
}
@@ -101,8 +101,8 @@ G4double G4ProtonField::GetField(const G4ThreeVector & aPosition)
{
//G4cout << " Fermi Potential " << (fermiMom*fermiMom)/(2*proton_mass_c2) <<G4endl;
G4double x = aPosition.mag();
size_t index = static_cast<size_t>(x/(0.3*fermi) );
if(index+2>theFermiMomBuffer.size()) return theFermiMomBuffer.back();
G4int index = static_cast<G4int>(x/(0.3*fermi) );
if(index+2>static_cast<G4int>(theFermiMomBuffer.size())) return theFermiMomBuffer.back();
G4double y1 = theFermiMomBuffer[index];
G4double y2 = theFermiMomBuffer[index+1];
G4double x1 = (0.3*fermi)*index;
@@ -22,7 +22,7 @@
//
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
// GEANT 4 class implementation file
//
// CERN, Geneva, Switzerland
//
@@ -68,15 +68,18 @@
#include "G4ClassicalRK4.hh"
#include "G4MagIntegratorDriver.hh"
#include "G4LorentzRotation.hh"
// unsigned EncodingHashFun(const G4int& aEncoding);
G4RKPropagation::G4RKPropagation() : theNucleus(0),
G4RKPropagation::G4RKPropagation() : theNucleus(0),
theFieldMap(0), theEquationMap(0),
theField(0)
{ }
G4RKPropagation::G4RKPropagation(const G4RKPropagation &right)
G4RKPropagation::G4RKPropagation(const G4RKPropagation &) :
G4VFieldPropagation()
{ }
@@ -93,21 +96,21 @@ G4RKPropagation::~G4RKPropagation()
const G4RKPropagation & G4RKPropagation::operator=(const G4RKPropagation & right)
const G4RKPropagation & G4RKPropagation::operator=(const G4RKPropagation &)
{
G4Exception("G4RKPropagation::operator= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4RKPropagation::operator= meant not to be accessible");
return *this;
}
G4int G4RKPropagation::operator==(const G4RKPropagation & right) const
G4int G4RKPropagation::operator==(const G4RKPropagation &) const
{
G4Exception("G4RKPropagation::operator== meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4RKPropagation::operator== meant not to be accessible");
return 0;
}
G4int G4RKPropagation::operator!=(const G4RKPropagation & right) const
G4int G4RKPropagation::operator!=(const G4RKPropagation &) const
{
G4Exception("G4RKPropagation::operator!= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4RKPropagation::operator!= meant not to be accessible");
return 1;
}
@@ -241,9 +244,11 @@ void G4RKPropagation::Init(G4V3DNucleus * nucleus)
//----------------------------------------------------------------------------
void G4RKPropagation::Transport(G4KineticTrackVector & active,
//----------------------------------------------------------------------------
const G4KineticTrackVector & spectators,
const G4KineticTrackVector &,
G4double timeStep)
{
// reset momentum transfer to field
theMomentumTranfer=0;
// Loop over tracks
@@ -262,34 +267,43 @@ void G4RKPropagation::Transport(G4KineticTrackVector & active,
// if ( timeStep > 1e30 ) {
// G4cout << " Name :" << kt->GetDefinition()->GetParticleName() << G4endl;
// }
// @hpw@ debugging: free transport..... @@@@@@@@@@@@@@@
//gf pos = pos+(currTimeStep*c_light/mom.e())*mom.vect();
//gf kt->SetPosition(pos);
//gf continue;
// @hpw@ debugging: free transport.....
// Get the time of intersections with the nucleus surface.
G4double t_enter, t_leave;
// if the particle does not intersecate with the nucleus go to next particle
if(!GetSphereIntersectionTimes(kt, t_enter, t_leave))
continue;
{
kt->SetState(G4KineticTrack::miss_nucleus);
continue;
}
/*
* G4cout <<" timeStep, Intersection times tenter, tleave "
* << currTimeStep << " / " << t_enter << " / " << t_leave <<G4endl;
*/
// if the particle is already outside nucleus go to next
#ifdef debug_1_RKPropagation
G4cout <<" kt,timeStep, Intersection times tenter, tleave "
<<kt<<" "<< currTimeStep << " / " << t_enter << " / " << t_leave <<G4endl;
#endif
// if the particle is already outside nucleus go to next @@GF should never happen? check!
if(t_leave < 0)
continue;
{
throw G4HadronicException(__FILE__, __LINE__, "G4RKPropagation:: Attempt to track particle past a nucleus");
continue;
}
// Apply a straight line propagation for particle types
// not included in the model
if( ! currentField )
{
if(currTimeStep == DBL_MAX)currTimeStep = t_leave;
if(currTimeStep == DBL_MAX)currTimeStep = t_leave*1.05;
FreeTransport(kt, currTimeStep);
// G4cout << " Particle not in model : " << kt->GetDefinition()->GetParticleName() << G4endl;
continue;
if ( currTimeStep >= t_leave )
{
if ( kt->GetState() == G4KineticTrack::inside )
{ kt->SetState(G4KineticTrack::gone_out); }
else
{ kt->SetState(G4KineticTrack::miss_nucleus);}
}
continue;
}
if(t_enter > 0) // the particle is out. Transport free to the surface
@@ -307,8 +321,8 @@ void G4RKPropagation::Transport(G4KineticTrackVector & active,
// on the surface the particle loose the barrier energy
// G4double newE = mom.e()-(*theFieldMap)[encoding]->GetBarrier();
// GetField = Barrier + FermiPotential
G4double newE = kt->Get4Momentum().e()-currentField->GetField(kt->GetPosition());
// G4cout << " enter nucleus, E out/in: " << kt->Get4Momentum().e() << " / " << newE <<G4endl;
G4double newE = kt->GetTrackingMomentum().e()-currentField->GetField(kt->GetPosition());
// G4cout << " enter nucleus, E out/in: " << kt->GetTrackingMomentum().e() << " / " << newE <<G4endl;
// G4cout << " the Field "<< currentField->GetField(kt->GetPosition()) << " "<< kt->GetPosition()<<G4endl;
// G4cout << " the particle "<<kt->GetDefinition()->GetParticleName()<<G4endl;
if(newE <= kt->GetActualMass()) // the particle cannot enter the nucleus
@@ -316,15 +330,20 @@ void G4RKPropagation::Transport(G4KineticTrackVector & active,
// FixMe: should be "pushed back?"
// for the moment take it past teh nucleus, so we'll not worry next time..
FreeTransport(kt, 1.1*t_leave); // take past nucleus
kt->SetState(G4KineticTrack::miss_nucleus);
continue;
}
//
G4double newP = sqrt(newE*newE- sqr(kt->GetActualMass()));
G4LorentzVector new4Mom(newP*kt->Get4Momentum().vect().unit(), newE);
kt->Set4Momentum(new4Mom);
// G4cout <<" Enter Nucleus - E/Field/Sum: " <<kt->Get4Momentum().e() << " / "
G4LorentzVector new4Mom(newP*kt->GetTrackingMomentum().vect().unit(), newE);
G4ThreeVector transfer(kt->GetTrackingMomentum().vect()-new4Mom.vect());
G4ThreeVector boost= transfer / sqrt(transfer.mag2() + sqr(theNucleus->GetMass()));
new4Mom*=G4LorentzRotation(boost);
kt->SetTrackingMomentum(new4Mom);
kt->SetState(G4KineticTrack::inside);
// G4cout <<" Enter Nucleus - E/Field/Sum: " <<kt->GetTrackingMomentum().e() << " / "
// << (*theFieldMap)[encoding]->GetField(kt->GetPosition()) << " / "
// << kt->Get4Momentum().e()-currentField->GetField(kt->GetPosition())
// << kt->GetTrackingMomentum().e()-currentField->GetField(kt->GetPosition())
// << G4endl
// << " Barrier / field just inside nucleus (0.9999*kt->GetPosition())"
// << (*theFieldMap)[encoding]->GetBarrier() << " / "
@@ -343,52 +362,54 @@ void G4RKPropagation::Transport(G4KineticTrackVector & active,
is_exiting=true;
}
// G4cerr << "RKPropagation t_leave, curTimeStep " <<t_leave << " " <<currTimeStep<<G4endl;
#ifdef debug_1_RKPropagation
G4cout << "RKPropagation Ekin, field, p "
<< kt->Get4Momentum().e() - kt->Get4Momentum().mag() << " "
G4cerr << "RKPropagation is_exiting?, t_leave, curTimeStep " <<is_exiting<<" "<<t_leave << " " <<currTimeStep<<G4endl;
G4cout << "RKPropagation Ekin, field, projectile potential, p "
<< kt->GetTrackingMomentum().e() - kt->GetTrackingMomentum().mag() << " "
<< kt->GetPosition()<<" "
<< currentField->GetField(kt->GetPosition())<< G4endl
<< kt->Get4Momentum()
<< G4endl << currentField->GetField(kt->GetPosition()) << " "
<< kt->GetProjectilePotential()<< G4endl
<< kt->GetTrackingMomentum()
<< G4endl;
#endif
G4LorentzVector momold=kt->Get4Momentum();
G4LorentzVector momold=kt->GetTrackingMomentum();
G4ThreeVector posold=kt->GetPosition();
// if (currentField->GetField(kt->GetPosition()) > kt->GetProjectilePotential() ||
if (! FieldTransport(kt, currTimeStep)) {
FreeTransport(kt,currTimeStep);
}
// G4cout << "RKPropagation Ekin, field, p "
// << kt->Get4Momentum().e() - kt->Get4Momentum().mag() << " "
// << currentField->GetField(kt->GetPosition())<< G4endl
// << kt->Get4Momentum()
// << G4endl;
/* << "delta p " << momold-kt->Get4Momentum() << G4endl
#ifdef debug_1_RKPropagation
G4cout << "RKPropagation Ekin, field, p "
<< kt->GetTrackingMomentum().e() - kt->GetTrackingMomentum().mag() << " "
<< G4endl << currentField->GetField(kt->GetPosition())<< G4endl
<< kt->GetTrackingMomentum()
// << G4endl;
<< "delta p " << momold-kt->GetTrackingMomentum() << G4endl
<< "del pos " << posold-kt->GetPosition()
<< G4endl;
*/
#endif
// complete the transport
// FixMe: in some cases there could be a significant
// part to do still in the nucleus, or we stepped to far... depending on
// slope of potential
if(is_exiting) // particle is exiting
G4double t_in=-1, t_out=0; // set onto boundary.
// should go out, or are already out by a too long step..
if(is_exiting ||
(GetSphereIntersectionTimes(kt, t_in, t_out) &&t_in<0 && t_out<=0 )) // particle is exiting
{
// transport free to a position that is surely out of the nucleus, to avoid
// a new transportation and a new adding the barrier next loop.
G4double t_in, t_out;
if(GetSphereIntersectionTimes(kt, t_in, t_out))
{
G4double velocity=kt->Get4Momentum().vect().mag()/kt->Get4Momentum().e()*c_light;
G4double t_min=0.1*fermi/velocity;
t_out=std::max(abs(t_out),t_min); // avoid transport by 0 step not taking it out..
if(t_in < 0 && t_out >= 0) //still inside, transport safely out.
{
// transport free to a position that is surely out of the nucleus, to avoid
// a new transportation and a new adding the barrier next loop.
G4ThreeVector savePos = kt->GetPosition();
FreeTransport(kt, 1.1*t_out);
FreeTransport(kt, t_out);
// and evaluate the right the energy
G4double newE=kt->Get4Momentum().e();
G4double newE=kt->GetTrackingMomentum().e();
// G4cout << " V pos/savePos << "
// << (*theFieldMap)[encoding]->GetField(kt->GetPosition())<< " / "
@@ -404,46 +425,75 @@ void G4RKPropagation::Transport(G4KineticTrackVector & active,
- currentField->GetField(kt->GetPosition());
}
// G4cout << " go border nucleus, E in/border: " << kt->Get4Momentum() << " / " << newE <<G4endl;
// G4cout << " go border nucleus, E in/border: " << kt->GetTrackingMomentum() << " / " << newE <<G4endl;
if(newE < kt->GetActualMass())
{
// G4cout << "RKPropagation-Transport: problem with particle exiting - ignored" << G4endl;
#ifdef debug_1_RKPropagation
G4cout << "RKPropagation-Transport: problem with particle exiting - ignored" << G4endl;
G4cout << " cannot leave nucleus, E in/out: " << kt->GetTrackingMomentum() << " / " << newE <<G4endl;
#endif
if (kt->GetDefinition() == G4Proton::Proton() ||
kt->GetDefinition() == G4Neutron::Neutron() ) {
kt->SetState(G4KineticTrack::captured);
} else {
kt->SetState(G4KineticTrack::gone_out); //@@GF tofix
}
continue; // the particle cannot exit the nucleus
}
// G4cout << "%%%% before update %%%% "<< kt->Get4Momentum()<<G4endl;
kt->Update4Momentum(newE);
// G4cout << "%%%% beyond update %%%% "<< kt->Get4Momentum()<<G4endl;
// G4cout << "Field values: "<<currentField->GetField(savePos)<<" "
// <<currentField->GetField(kt->GetPosition())<<" "<<kt->GetDefinition()->GetParticleName()<<G4endl;
G4double newP = sqrt(newE*newE- sqr(kt->GetActualMass()));
G4LorentzVector new4Mom(newP*kt->GetTrackingMomentum().vect().unit(), newE);
G4ThreeVector transfer(kt->GetTrackingMomentum().vect()-new4Mom.vect());
G4ThreeVector boost= transfer / sqrt(transfer.mag2() + sqr(theNucleus->GetMass()));
new4Mom*=G4LorentzRotation(boost);
kt->SetTrackingMomentum(new4Mom);
}
} else
{
G4cerr << "KineticModel-G4RKPropagation: Positioning problem(ignored)"<< G4endl;
// add the potential barrier
// FixMe the Coulomb field is not parallel to mom, this is simple approximation
G4double newE = kt->GetTrackingMomentum().e()+currentField->GetField(kt->GetPosition());
if(newE < kt->GetActualMass())
{ // the particle cannot exit the nucleus @@@ GF check.
#ifdef debug_1_RKPropagation
G4cout << " cannot leave nucleus, E in/out: " << kt->GetTrackingMomentum() << " / " << newE <<G4endl;
#endif
if (kt->GetDefinition() == G4Proton::Proton() ||
kt->GetDefinition() == G4Neutron::Neutron() ) {
kt->SetState(G4KineticTrack::captured);
} else {
kt->SetState(G4KineticTrack::gone_out); //@@GF tofix
}
continue;
}
G4double newP = sqrt(newE*newE- sqr(kt->GetActualMass()));
G4LorentzVector new4Mom(newP*kt->GetTrackingMomentum().vect().unit(), newE);
G4ThreeVector transfer(kt->GetTrackingMomentum().vect()-new4Mom.vect());
G4ThreeVector boost= transfer / sqrt(transfer.mag2() + sqr(theNucleus->GetMass()));
new4Mom*=G4LorentzRotation(boost);
kt->SetTrackingMomentum(new4Mom);
kt->SetState(G4KineticTrack::gone_out);
}
// add the potential barrier
// FixMe the Coulomb field is not parallel to mom, this is simple approximation
G4double newE = kt->Get4Momentum().e()+currentField->GetField(kt->GetPosition());
// G4cout << " leave nucleus, E in/out: " << kt->Get4Momentum() << " / " << newE <<G4endl;
if(newE < kt->GetActualMass())
{ // the particle cannot exit the nucleus
// G4cout << "HadronKineticModel:RKPropagation: ignoring problem with particle E on exit of nucleus" << G4endl;
continue;
}
kt->Update4Momentum(newE);
}
}
}
//----------------------------------------------------------------------------
G4ThreeVector G4RKPropagation::GetMomentumTransfer() const
//----------------------------------------------------------------------------
{
return theMomentumTranfer;
}
//----------------------------------------------------------------------------
G4bool G4RKPropagation::FieldTransport(G4KineticTrack * kt, const G4double timeStep)
//----------------------------------------------------------------------------
{
// G4cout <<"Stepper input"<<kt->Get4Momentum()<<G4endl;
theMomentumTranfer=0;
// G4cout <<"Stepper input"<<kt->GetTrackingMomentum()<<G4endl;
// create the integrator stepper
// G4Mag_EqRhs * equation = mapIter->second;
G4Mag_EqRhs * equation = (*theEquationMap)[kt->GetDefinition()->GetPDGEncoding()];
@@ -457,19 +507,19 @@ G4bool G4RKPropagation::FieldTransport(G4KineticTrack * kt, const G4double timeS
// create the G4FieldTrack needed by AccurateAdvance
G4double curveLength = 0;
G4FieldTrack track(kt->GetPosition(),
kt->Get4Momentum().vect().unit(), // momentum direction
kt->GetTrackingMomentum().vect().unit(), // momentum direction
curveLength, // curvelength
kt->Get4Momentum().e()-kt->GetActualMass(), // kinetic energy
kt->GetTrackingMomentum().e()-kt->GetActualMass(), // kinetic energy
kt->GetActualMass(), // restmass
kt->Get4Momentum().beta()*c_light); // velocity
kt->GetTrackingMomentum().beta()*c_light); // velocity
// integrate
G4double eps = 0.01;
// G4cout << "currTimeStep = " << currTimeStep << G4endl;
if(!driver->AccurateAdvance(track, timeStep, eps))
{ // cannot track this particle
std::cerr << "G4RKPropagation::FieldTransport() warning: integration error."
<< G4endl << "position " << kt->GetPosition() << " 4mom " <<kt->Get4Momentum()
<<G4endl << " timestep " <<timeStep
<< G4endl << "position " << kt->GetPosition() << " 4mom " <<kt->GetTrackingMomentum()
<<G4endl << " timestep " <<timeStep
<< G4endl;
delete driver;
delete stepper;
@@ -482,12 +532,24 @@ G4bool G4RKPropagation::FieldTransport(G4KineticTrack * kt, const G4double timeS
* << G4endl;
*/
// Correct for momentum ( thus energy) transfered to nucleus, boost particle into moving nuclues frame.
G4ThreeVector MomentumTranfer = kt->GetTrackingMomentum().vect() - track.GetMomentum();
G4ThreeVector boost= MomentumTranfer / sqrt (MomentumTranfer.mag2() +sqr(theNucleus->GetMass()));
// update the kt
kt->SetPosition(track.GetPosition());
G4LorentzVector mom(track.GetMomentum(),sqrt(track.GetMomentum().mag2() + sqr(kt->GetActualMass())));
kt->Set4Momentum(mom);
// G4cout <<"Stepper output"<<kt<<" "<<kt->Get4Momentum()<<" "<<kt->GetPosition()<<G4endl;
mom *= G4LorentzRotation( boost );
theMomentumTranfer += ( kt->GetTrackingMomentum() - mom ).vect();
kt->SetTrackingMomentum(mom);
// G4cout <<"Stepper output"<<kt<<" "<<kt->GetTrackingMomentum()<<" "<<kt->GetPosition()<<G4endl;
/*
* G4ThreeVector MomentumTranfer2=kt->GetTrackingMomentum().vect() - mom.vect();
* G4cout << " MomentumTransfer/corrected" << MomentumTranfer << " " << MomentumTranfer.mag()
* << " " << MomentumTranfer2 << " " << MomentumTranfer2.mag() << " "
* << MomentumTranfer-MomentumTranfer2 << " "<<
* MomentumTranfer-MomentumTranfer2.mag() << " " << G4endl;
* G4cout <<" E/Field/Sum aft : " <<mom.e() << " / "
* << " / " << (*theFieldMap)[encoding]->GetField(pos)<< " / "
* << mom.e()+(*theFieldMap)[encoding]->GetField(pos)
@@ -504,7 +566,7 @@ G4bool G4RKPropagation::FreeTransport(G4KineticTrack * kt, const G4double timeSt
//----------------------------------------------------------------------------
{
G4ThreeVector newpos = kt->GetPosition() +
timeStep*c_light/kt->Get4Momentum().e() * kt->Get4Momentum().vect();
timeStep*c_light/kt->GetTrackingMomentum().e() * kt->GetTrackingMomentum().vect();
kt->SetPosition(newpos);
return true;
}
@@ -518,7 +580,7 @@ G4bool G4RKPropagation::WillBeCaptured(const G4KineticTrack * kt)
G4ParticleDefinition * definition = kt->GetDefinition();
G4double mass = definition->GetPDGMass();
G4ThreeVector pos = kt->GetPosition();
G4LorentzVector mom = kt->Get4Momentum();
G4LorentzVector mom = kt->GetTrackingMomentum();
G4VNuclearField * field = (*theFieldMap)[definition->GetPDGEncoding()];
G4ThreeVector newPos(0, 0, radius); // to get the field on the surface
@@ -557,14 +619,13 @@ G4bool G4RKPropagation::GetSphereIntersectionTimes(const G4KineticTrack * kt,
G4double & t1, G4double & t2)
{
G4double radius = theOuterRadius + 3*fermi; // "safety" of 3 fermi
G4ThreeVector speed = kt->Get4Momentum().vect()/kt->Get4Momentum().e(); // bost vector
G4ThreeVector speed = kt->GetTrackingMomentum().vect()/kt->GetTrackingMomentum().e(); // bost vector
G4double scalarProd = kt->GetPosition().dot(speed);
G4double speedMag = speed.mag();
G4double sqrtArg = scalarProd*scalarProd -
speedMag*speedMag*(kt->GetPosition().mag2()-radius*radius);
if(sqrtArg <= 0.) // particle will not intersect the sphere
{
// G4cout << " GetSphereIntersectionTimes sqrtArg negative: " << sqrtArg << G4endl;
return false;
}
t1 = (-scalarProd - sqrt(sqrtArg))/speedMag/speedMag/c_light;
@@ -37,6 +37,7 @@
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4SigmaMinus.hh"
#include "G4HadTmpUtil.hh"
G4SigmaMinusField::G4SigmaMinusField(G4V3DNucleus * nucleus, G4double coeff)
: G4VNuclearField(nucleus)
@@ -48,23 +49,23 @@ G4SigmaMinusField::~G4SigmaMinusField()
{ }
const G4SigmaMinusField & G4SigmaMinusField::operator=(const G4SigmaMinusField & )
const G4SigmaMinusField & G4SigmaMinusField::operator=(const G4SigmaMinusField &)
{
G4Exception("G4SigmaMinusField::operator= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4SigmaMinusField::operator= meant not to be accessible");
return *this;
}
G4int G4SigmaMinusField::operator==(const G4SigmaMinusField & ) const
G4int G4SigmaMinusField::operator==(const G4SigmaMinusField &) const
{
G4Exception("G4SigmaMinusField::operator== meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4SigmaMinusField::operator== meant not to be accessible");
return 0;
}
G4int G4SigmaMinusField::operator!=(const G4SigmaMinusField & ) const
G4int G4SigmaMinusField::operator!=(const G4SigmaMinusField &) const
{
G4Exception("G4SigmaMinusField::operator!= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4SigmaMinusField::operator!= meant not to be accessible");
return 1;
}
@@ -77,9 +78,9 @@ G4double G4SigmaMinusField::GetField(const G4ThreeVector & aPosition)
G4double sigmaMinusMass = G4SigmaMinus::SigmaMinus()->GetPDGMass();
G4int A = static_cast<G4int>(theNucleus->GetMassNumber()+.1);
G4int Z = static_cast<G4int>(theNucleus->GetCharge()+.1);
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(G4lrint(Z), G4lrint(A));
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = sigmaMinusMass*nucleusMass/(sigmaMinusMass+nucleusMass);
@@ -37,6 +37,7 @@
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4SigmaPlus.hh"
#include "G4HadTmpUtil.hh"
G4SigmaPlusField::G4SigmaPlusField(G4V3DNucleus * nucleus, G4double coeff)
: G4VNuclearField(nucleus)
@@ -49,23 +50,23 @@ G4SigmaPlusField::~G4SigmaPlusField()
{ }
const G4SigmaPlusField & G4SigmaPlusField::operator=(const G4SigmaPlusField & )
const G4SigmaPlusField & G4SigmaPlusField::operator=(const G4SigmaPlusField &)
{
G4Exception("G4SigmaPlusField::operator= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4SigmaPlusField::operator= meant not to be accessible");
return *this;
}
G4int G4SigmaPlusField::operator==(const G4SigmaPlusField & ) const
G4int G4SigmaPlusField::operator==(const G4SigmaPlusField &) const
{
G4Exception("G4SigmaPlusField::operator== meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4SigmaPlusField::operator== meant not to be accessible");
return 0;
}
G4int G4SigmaPlusField::operator!=(const G4SigmaPlusField & ) const
G4int G4SigmaPlusField::operator!=(const G4SigmaPlusField &) const
{
G4Exception("G4SigmaPlusField::operator!= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4SigmaPlusField::operator!= meant not to be accessible");
return 1;
}
@@ -78,9 +79,9 @@ G4double G4SigmaPlusField::GetField(const G4ThreeVector & aPosition)
G4double sigmaPlusMass = G4SigmaPlus::SigmaPlus()->GetPDGMass();
G4int A = static_cast<G4int>(theNucleus->GetMassNumber()+.1);
G4int Z = static_cast<G4int>(theNucleus->GetCharge()+.1);
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(G4lrint(Z), G4lrint(A));
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = sigmaPlusMass*nucleusMass/(sigmaPlusMass+nucleusMass);
@@ -37,6 +37,7 @@
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4SigmaZero.hh"
#include "G4HadTmpUtil.hh"
G4SigmaZeroField::G4SigmaZeroField(G4V3DNucleus * nucleus, G4double coeff)
: G4VNuclearField(nucleus)
@@ -49,23 +50,23 @@ G4SigmaZeroField::~G4SigmaZeroField()
{ }
const G4SigmaZeroField & G4SigmaZeroField::operator=(const G4SigmaZeroField & )
const G4SigmaZeroField & G4SigmaZeroField::operator=(const G4SigmaZeroField &)
{
G4Exception("G4SigmaZeroField::operator= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4SigmaZeroField::operator= meant not to be accessible");
return *this;
}
G4int G4SigmaZeroField::operator==(const G4SigmaZeroField & ) const
G4int G4SigmaZeroField::operator==(const G4SigmaZeroField &) const
{
G4Exception("G4SigmaZeroField::operator== meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4SigmaZeroField::operator== meant not to be accessible");
return 0;
}
G4int G4SigmaZeroField::operator!=(const G4SigmaZeroField & ) const
G4int G4SigmaZeroField::operator!=(const G4SigmaZeroField &) const
{
G4Exception("G4SigmaZeroField::operator!= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4SigmaZeroField::operator!= meant not to be accessible");
return 1;
}
@@ -78,9 +79,9 @@ G4double G4SigmaZeroField::GetField(const G4ThreeVector & aPosition)
G4double sigmaZeroMass = G4SigmaZero::SigmaZero()->GetPDGMass();
G4int A = static_cast<G4int>(theNucleus->GetMassNumber()+.1);
G4int Z = static_cast<G4int>(theNucleus->GetCharge()+.1);
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(G4lrint(Z), G4lrint(A));
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = sigmaZeroMass*nucleusMass/(sigmaZeroMass+nucleusMass);
@@ -34,6 +34,7 @@
// -------------------------------------------------------------------
#include "G4VFieldPropagation.hh"
#include "globals.hh"
#include "G4HadronicException.hh"
G4VFieldPropagation::G4VFieldPropagation()
{ }
@@ -44,21 +45,21 @@ G4VFieldPropagation::G4VFieldPropagation(const G4VFieldPropagation &)
G4VFieldPropagation::~G4VFieldPropagation()
{ }
const G4VFieldPropagation & G4VFieldPropagation::operator=(const G4VFieldPropagation & )
const G4VFieldPropagation & G4VFieldPropagation::operator=(const G4VFieldPropagation &)
{
G4Exception("G4VFieldPropagation::operator= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4VFieldPropagation::operator= meant not to be accessible");
return *this;
}
G4int G4VFieldPropagation::operator==(const G4VFieldPropagation & ) const
G4int G4VFieldPropagation::operator==(const G4VFieldPropagation &) const
{
G4Exception("G4VFieldPropagation::operator== meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4VFieldPropagation::operator== meant not to be accessible");
return 0;
}
G4int G4VFieldPropagation::operator!=(const G4VFieldPropagation & ) const
G4int G4VFieldPropagation::operator!=(const G4VFieldPropagation &) const
{
G4Exception("G4VFieldPropagation::operator!= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4VFieldPropagation::operator!= meant not to be accessible");
return 1;
}
@@ -51,21 +51,21 @@ G4VNuclearField::~G4VNuclearField()
{
}
const G4VNuclearField & G4VNuclearField::operator=(const G4VNuclearField & )
const G4VNuclearField & G4VNuclearField::operator=(const G4VNuclearField &)
{
G4Exception("G4VNuclearField::operator= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4VNuclearField::operator= meant not to be accessible");
return *this;
}
G4int G4VNuclearField::operator==(const G4VNuclearField & ) const
G4int G4VNuclearField::operator==(const G4VNuclearField &) const
{
G4Exception("G4VNuclearField::operator== meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4VNuclearField::operator== meant not to be accessible");
return 0;
}
G4int G4VNuclearField::operator!=(const G4VNuclearField & ) const
G4int G4VNuclearField::operator!=(const G4VNuclearField &) const
{
G4Exception("G4VNuclearField::operator!= meant not to be accessible");
throw G4HadronicException(__FILE__, __LINE__, "G4VNuclearField::operator!= meant not to be accessible");
return 1;
}
@@ -2,7 +2,7 @@
# GNUmakefile for chips library. HPW 20-Nov-99
# --------------------------------------------------------------
name := G4hadronic_hetcpp
name := G4had_hetcpp
SUBDIRS = evaporation
SUBDIRS += utils
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.7 2002/12/03 11:33:52 gcosmo Exp $
# $Id: GNUmakefile,v 1.8 2003/10/08 14:53:20 hpw Exp $
# -----------------------------------------------------------
# GNUmakefile for hadronic library. Gabriele Cosmo, 18/9/96.
# -----------------------------------------------------------
@@ -23,11 +23,8 @@ CPPFLAGS += -I$(G4BASE)/global/management/include \
-I$(G4BASE)/processes/hadronic/util/include \
-I$(G4BASE)/processes/hadronic/processes/include \
-I$(G4BASE)/processes/hadronic/cross_sections/include \
-I$(G4BASE)/processes/hadronic/models/generator/de_excitation/include \
-I$(G4BASE)/processes/hadronic/models/generator/management/include \
-I$(G4BASE)/processes/hadronic/models/generator/util/include \
-I$(G4BASE)/processes/hadronic/models/generator/pre_equilibrium/include \
-I$(G4BASE)/processes/hadronic/models/generator/diffractive_string/include \
-I$(G4BASE)/processes/hadronic/models/management/include \
-I$(G4BASE)/processes/hadronic/models/util/include \
-I$(G4BASE)/processes/hadronic/models/cascade/cascade/include \
-I$(G4BASE)/processes/hadronic/models/cascade/utils/include \
-I$(G4BASE)/particles/management/include \
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4ANALYSER_HH
#define G4ANALYSER_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4BertiniData_h
#define G4BertiniData_h 1
@@ -19,19 +19,21 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4BertiniElasticCollision_h
#define G4BertiniElasticCollision_h 1
#include "G4BertiniModel.hh"
class G4BertiniElasticCollision : public G4BertiniModel {
public:
G4BertiniElasticCollision();
~G4BertiniElasticCollision();
void interpolateElasticNeutronData(G4int medium, G4int kdd, G4double e);
void geti(G4double es, G4int npts, G4double e, G4int i);
void scatteringWithHydrogen();
private:
G4double pt[16];
G4double col[23];
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4BertiniHydrogenCollision_h
#define G4BertiniHydrogenCollision_h 1
@@ -29,6 +30,7 @@ class G4BertiniHydrogenCollision : public G4BertiniModel {
public:
G4BertiniHydrogenCollision();
~G4BertiniHydrogenCollision();
private:
};
@@ -19,12 +19,14 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4BERTININUCLEI_MODEL_HH
#define G4BERTININUCLEI_MODEL_HH
#ifndef G4INUCL_ELEMENTARY_PARTICLE_HH
#include "G4InuclElementaryParticle.hh"
#endif
#include "G4CascadParticle.hh"
#include "G4InuclSpecialFunctions.hh"
#include "G4CascadSpecialFunctions.hh"
@@ -42,63 +44,38 @@ typedef std::vector<partner> partners;
class G4BertiniNucleiModel {
/// 7 MeV potential
/// Testing Doxygen properties (http://www.stack.nl/~dimitri/doxygen/)
/// The distance between \f$(x_1,y_1)\f$ and \f$(x_2,y_2)\f$ is \f$\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\f$.
/*! \class G4BertiniNucleiModel
* \brief Implements HETC nuclei model
* \author Aatos Heikkinen
* \brief Implements HETC nuclei model in Geant4
* \author Aatos Heikkinen and
* \author Original HETC authors
* \version 0.0
* \date 16.11.2002
* \bug None know
* \date 25.11.2002
* \bug
* \warning Wery preliminary
*/
public:
G4BertiniNucleiModel(); /// Initialize
/**
* a normal member taking two arguments and returning an integer value.
* @param a an integer argument.
* @param s a constant character pointer.
* @see Test()
* @see ~Test()
* @see testMeToo()
* @see publicVar()
* @return The test results
*/
/// a normal member taking two arguments and returning an integer value.
/// @param a an integer argument.
/// @param s a constant character pointer.
/// @see Test()
/// @see ~Test()
/// @see testMeToo()
/// @see publicVar()
/// @return The test results
G4BertiniNucleiModel();
G4BertiniNucleiModel(G4InuclNuclei* nuclei) {
generateModel(nuclei->getA(), nuclei->getZ());
};
void generateModel(G4double a,
G4double z); //!< a member function.
G4double z); /// create nuclei model
/// @param a is atom mumber (number of protons and neutron in nuclei)
/// @param z in number of protons in nuclei
/// @see
/// @return void
void reset() {
neutronNumberCurrent = neutronNumber;
protonNumberCurrent = protonNumber;
};
void printModel() const; /// a member function.
void printModel() const;
G4double getDensity(G4int ip,
G4int izone) const {
@@ -114,13 +91,11 @@ public:
G4double getFermiKinetic(G4int ip,
G4int izone) const {
G4double ekin = 0.0;
if(ip < 3 && izone < number_of_zones) {
if (ip < 3 && izone < number_of_zones) {
G4double pf = fermi_momenta[ip - 1][izone];
G4double mass = ip == 1 ? 0.93827 : 0.93957;
ekin = sqrt(pf * pf + mass * mass) - mass;
};
@@ -129,7 +104,6 @@ public:
G4double getPotential(G4int ip,
G4int izone) const {
G4int ip0 = ip < 3 ? ip - 1 : 2;
return izone < number_of_zones ? zone_potentials[ip0][izone] : 0.0;
@@ -149,13 +123,14 @@ public:
return protonNumberCurrent;
};
G4bool empty() const {
G4bool empty() const { /*!< See if there is no nucleon. */
/// @return TRUE if no current nucleons.
return neutronNumberCurrent < 1.0 && protonNumberCurrent < 1.0;
};
G4bool stillInside(const G4CascadParticle& cparticle) {
G4bool stillInside(const G4CascadParticle& cparticle) { /*!< Check if the cascade particle is still inside the nuclei. */
/// @return TRUE if no current nucleons.
return cparticle.getCurrentZone() < number_of_zones;
};
@@ -164,12 +139,14 @@ public:
std::pair<std::vector<G4CascadParticle>, std::vector<G4InuclElementaryParticle> > initializeCascad(G4InuclNuclei* bullet, G4InuclNuclei* target);
std::pair<G4int, G4int> getTypesOfNucleonsInvolved() const {
return std::pair<G4int, G4int>(current_nucl1, current_nucl2);
};
G4bool worthToPropagate(const G4CascadParticle& cparticle) const;
G4bool worthToPropagate(const G4CascadParticle& cparticle) const; /*!< Check if cascade particle will continue. */
private:
G4int verboseLevel; /*!< Each class has a verbosity level of its own. */
G4int verboseLevel; /*!< Each cascade class has a verbosity level of its own. */
G4bool passFermi(const std::vector<G4InuclElementaryParticle>& particles,
G4int zone);
@@ -187,44 +164,29 @@ private:
G4double volNumInt(G4double r1,
G4double r2,
G4double cu,
G4double d1) const;
G4double d1) const; /// :::
G4double volNumInt1(G4double r1,
G4double r2,
G4double cu2) const;
G4double cu2) const; /// :::
G4double getRatio(G4int ip) const;
std::vector<std::vector<G4double> > nucleon_densities;
std::vector<std::vector<G4double> > zone_potentials;
std::vector<std::vector<G4double> > fermi_momenta;
std::vector<G4double> zone_radii;
std::vector<G4double> binding_energies;
G4double nuclei_radius;
G4int number_of_zones;
G4double A;
G4int number_of_zones; /*!< Usually = 3, but number of zones is free parameter. */
G4double A;
G4double Z;
G4double neutronNumber;
G4double protonNumber;
G4double neutronNumberCurrent;
G4double protonNumberCurrent;
G4int current_nucl1;
G4int current_nucl2;
};
#endif // G4NUCLEI_MODEL_HH
#endif
@@ -0,0 +1,80 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4BERTINIREGIONMODEL
#define G4BERTINIREGIONMODEL
#include "G4ios.hh"
#include <vector>
#include <math.h>
#include "globals.hh"
#include "G4Proton.hh"
#include "G4Neutron.hh"
typedef std::vector<G4double>::const_iterator my_iterator;
class G4BertiniRegionModel {
/*! \class G4BertiniRegionModel
* \brief Implements HETC nucleus regions
* \author Aatos Heikkinen
* \author Original HETC authors
* \version 0.0
* \date 25.11.2002
* \bug
* \warning Wery preliminary
*/
public:
G4BertiniRegionModel(const G4int numberOfLayers, const G4int A, const G4int Z);
~G4BertiniRegionModel();
G4double GetDensity(G4double radius);
G4double GetPotentialEnergy(G4double r, G4int particle);
G4double GetMaximumNucleonMomentum(G4double radius, G4int nucleon);
private:
std::vector<G4double> radius; /*!< contains the outer radiuses of the shells */
std::vector<G4double> density;
std::vector<G4double> protonFermiEnergy;
std::vector<G4double> neutronFermiEnergy;
std::vector<G4double> protonFermiMomentum;
std::vector<G4double> neutronFermiMomentum;
std::vector<G4double> protonPotentialEnergy;
std::vector<G4double> neutronPotentialEnergy;
G4int massNumber;
G4int protonNumber;
static const G4double radius0;
static const G4double BE;
G4double GetFermiMomentum(G4double density, G4double mass);
G4double GetFermiEnergy(G4double density, G4double mass);
};
#endif
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4BIG_BANGER_HH
#define G4BIG_BANGER_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4CASCAD_PARTICLE_HH
#define G4CASCAD_PARTICLE_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4CASCAD_SPECIAL_FUNC_HH
#define G4CASCAD_SPECIAL_FUNC_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// CLASS DESCRIPTION
// G4CascadeInterface defines an interface to HETC and INUCL
// models of an medium energy (~ 0.5 - 5 GeV) intra-nuclear transport.
@@ -48,7 +49,7 @@ public:
G4ReactionProductVector* Propagate(G4KineticTrackVector* theSecondaries, G4V3DNucleus* theNucleus);
G4VParticleChange* ApplyYourself(const G4Track& aTrack,
G4HadFinalState* ApplyYourself(const G4HadProjectile& aTrack,
G4Nucleus& theNucleus);
private:
@@ -63,7 +64,7 @@ private:
G4int verboseLevel;
private:
G4ParticleChange theResult;
G4HadFinalState theResult;
};
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4COLLIDER_HH
#define G4COLLIDER_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4COLLISION_OUTPUT_HH
#define G4COLLISION_OUTPUT_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4ELEMENTARY_PARTICLE_COLLIDER_HH
#define G4ELEMENTARY_PARTICLE_COLLIDER_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4EQUILIBRIUM_EVAPORATOR_HH
#define G4EQUILIBRIUM_EVAPORATOR_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4EXITON_CONFIGURATION_HH
#define G4EXITON_CONFIGURATION_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4FISSION_CONFIGURATION_HH
#define G4FISSION_CONFIGURATION_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4FISSION_STORE_HH
#define G4FISSION_STORE_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4FISSIONER_HH
#define G4FISSIONER_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4INTERACTION_CASE_HH
#define G4INTERACTION_CASE_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4INTRA_NUCLEI_CASCADER_HH
#define G4INTRA_NUCLEI_CASCADER_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4INUCL_COLLIDER_HH
#define G4INUCL_COLLIDER_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4INUCL_ELEMENTARY_PARTICLE_HH
#define G4INUCL_ELEMENTARY_PARTICLE_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4INUCL_NUCLEI_HH
#define G4INUCL_NUCLEI_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4INUCL_PARTICLE_HH
#define G4INUCL_PARTICLE_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4INUCL_SPECIAL_FUNC_HH
#define G4INUCL_SPECIAL_FUNC_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4LORENTZ_CONVERTOR_HH
#define G4LORENTZ_CONVERTOR_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4NON_EQUILIBRIUM_EVAPORATOR_HH
#define G4NON_EQUILIBRIUM_EVAPORATOR_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4NUCL_WATCHER_HH
#define G4NUCL_WATCHER_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4NUCLEI_MODEL_HH
#define G4NUCLEI_MODEL_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4PARTICLE_LARGER_EKIN_HH
#define G4PARTICLE_LARGER_EKIN_HH
@@ -0,0 +1,79 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4REGIONMODEL
#define G4REGIONMODEL
#include "G4ios.hh"
#include <vector>
#include <math.h>
#include "globals.hh"
#include "G4Proton.hh"
#include "G4Neutron.hh"
//#include "G4NucleusModel.hh"
typedef std::vector<G4double>::const_iterator my_iterator;
class G4RegionModel //:public G4VRegionModel
{
public:
G4RegionModel(const G4int numberOfLayers, const G4int A, const G4int Z);
~G4RegionModel();
//instead of A and Z outer radius of the nucleus?
//void Init(const G4int numberOfLayers, const G4int A, const G4int Z);
G4double GetDensity(G4double radius);
G4double GetPotentialEnergy(G4double r, G4int particle);
G4double GetMaximumNucleonMomentum(G4double radius, G4int nucleon);
// G4double NumberOfRegions();
private:
G4int massNumber;
G4int protonNumber;
std::vector<G4double> radius; //contains the outer radiuses of the shells
std::vector<G4double> density;
std::vector<G4double> protonFermiEnergy;
std::vector<G4double> neutronFermiEnergy;
std::vector<G4double> protonFermiMomentum;
std::vector<G4double> neutronFermiMomentum;
std::vector<G4double> protonPotentialEnergy;
std::vector<G4double> neutronPotentialEnergy;
static const G4double radius0;
static const G4double BE;
//static const G4double pi = 3.141592;
G4double GetFermiMomentum(G4double density, G4double mass);
G4double GetFermiEnergy(G4double density, G4double mass);
};
#endif
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#ifndef G4WATCHER_GUN_HH
#define G4WATCHER_GUN_HH
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#include "G4Analyser.hh"
#include <math.h>
@@ -108,7 +109,8 @@ void G4Analyser::analyse(const G4CollisionOutput& output) {
if (withNuclei) {
std::vector<G4InuclNuclei> nucleus = output.getNucleiFragments();
if (nucleus.size() >= 0) {
// if (nucleus.size() >= 0) {
if (nucleus.size() > 0) {
G4int nbig = 0;
averageNucleiFragments += nucleus.size();
@@ -207,7 +209,7 @@ void G4Analyser::printResultsSimple() {
G4cout << " >>> G4Analyser::printResultsSimple" << G4endl;
}
G4cout << " Number of events " << int(eventNumber + 0.1) << G4endl
G4cout << " Number of events " << G4int(eventNumber + 0.1) << G4endl
<< " average multiplicity " << averageMultiplicity / eventNumber << G4endl
<< " average proton number " << averageProtonNumber / eventNumber << G4endl
<< " average neutron number " << averageNeutronNumber / eventNumber << G4endl
@@ -236,7 +238,7 @@ void G4Analyser::printResults() {
G4cout << " >>> G4Analyser::printResults" << G4endl;
}
G4cout << " Number of events " << int(eventNumber + 0.1) << G4endl
G4cout << " Number of events " << G4int(eventNumber + 0.1) << G4endl
<< " average multiplicity " << averageMultiplicity / eventNumber << G4endl
<< " average proton number " << averageProtonNumber / eventNumber << G4endl
<< " average neutron number " << averageNeutronNumber / eventNumber << G4endl
@@ -254,7 +256,6 @@ void G4Analyser::printResults() {
<< " average pi0 " << averagePion0 / eventNumber << G4endl;
if (withNuclei) {
G4cout
<< " average A " << averageA / eventNumber << G4endl
<< " average Z " << averageZ / eventNumber << G4endl
@@ -290,7 +291,7 @@ void G4Analyser::handleWatcherStatistics() {
G4double checked = 0.0;
for (G4int iw = 0; iw < G4int(ana_watchers.size()); iw++) {
ana_watchers[iw].setInuclCs(inel_csec, eventNumber);
ana_watchers[iw].setInuclCs(inel_csec, G4int(eventNumber));
ana_watchers[iw].print();
if (ana_watchers[iw].to_check()) {
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#include "globals.hh"
#include "G4BertiniData.hh"
@@ -19,7 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#include "G4BertiniNucleiModel.hh"
#include "G4LorentzConvertor.hh"
#include "G4CollisionOutput.hh"
@@ -91,7 +91,6 @@ void G4BertiniNucleiModel::generateModel(G4double a,
};
} else {
number_of_zones = 3;
icase = 1;
ur.push_back(0.0);
@@ -117,14 +116,13 @@ void G4BertiniNucleiModel::generateModel(G4double a,
v0 = volNumInt(ur[i], ur[i + 1], CU, D1);
} else {
v0 = volNumInt1(ur[i], ur[i + 1], CU2);
};
v.push_back(v0);
tot_vol += v0;
v0 = (i == 0 ? pow(zone_radii[i], 3) : pow(zone_radii[i], 3) -
pow(zone_radii[i - 1], 3));
v0 = (i == 0 ? pow(zone_radii[i], G4double(3)) : pow(zone_radii[i], G4double(3)) -
pow(zone_radii[i - 1], G4double(3)));
v1.push_back(v0);
};
@@ -168,10 +166,9 @@ void G4BertiniNucleiModel::generateModel(G4double a,
zone_potentials.push_back(vp);
} else { /// a < 4
number_of_zones = 1;
zone_radii.push_back(radForSmall);
G4double vol = 1.0 / piTimes4thirds / pow(zone_radii[0], 3);
G4double vol = 1.0 / piTimes4thirds / pow(zone_radii[0], G4double(3));
std::vector<G4double> rod;
std::vector<G4double> pf;
std::vector<G4double> vz;
@@ -216,7 +213,7 @@ void G4BertiniNucleiModel::generateModel(G4double a,
G4double G4BertiniNucleiModel::volNumInt(G4double r1,
G4double r2,
G4double cu,
G4double /*cu*/,
G4double d1) const {
if (verboseLevel > 3) {
@@ -240,7 +237,7 @@ G4double G4BertiniNucleiModel::volNumInt(G4double r1,
itry++;
G4double r = r1 - dr;
fi = 0.0;
G4int jc1 = G4int(pow(2.0, jc - 1) + 0.1);
G4int jc1 = G4int(pow(G4double(2.0), jc - 1) + 0.1);
for (G4int i = 0; i < jc1; i++) {
r += dr1;
@@ -314,12 +311,11 @@ G4double G4BertiniNucleiModel::volNumInt1(G4double r1,
};
if (verboseLevel > 2){
if (itry == itry_max) G4cout << " volNumInt1-> n iter " << itry_max << G4endl;
}
return pow(cu2, 3) * fun;
return pow(cu2, G4double(3)) * fun;
}
void G4BertiniNucleiModel::printModel() const {
@@ -431,12 +427,10 @@ partners G4BertiniNucleiModel::generateInteractionPartners(G4CascadParticle& cpa
r_out = 0.0;
} else if (zone == 0) { /// particle is outside core
r_in = 0.0;
r_out = zone_radii[0];
} else {
r_in = zone_radii[zone - 1];
r_out = zone_radii[zone];
};
@@ -451,7 +445,6 @@ partners G4BertiniNucleiModel::generateInteractionPartners(G4CascadParticle& cpa
return thePartners;
} else if(fabs(path) < small) { /// just on the bounday
path = 0.0;
G4InuclElementaryParticle particle;
@@ -459,7 +452,6 @@ partners G4BertiniNucleiModel::generateInteractionPartners(G4CascadParticle& cpa
thePartners.push_back(partner(particle, path));
} else { /// normal case
std::vector<G4InuclElementaryParticle> particles;
G4LorentzConvertor dummy_convertor;
@@ -513,7 +505,7 @@ partners G4BertiniNucleiModel::generateInteractionPartners(G4CascadParticle& cpa
std::vector<G4double> acsecs;
G4double tot_abs_csec = 0.0;
G4double abs_sec;
G4double vol = pow(zone_radii[zone], 3);
G4double vol = pow(zone_radii[zone], G4double(3) );
if(zone > 0) vol -= pow(zone_radii[zone - 1], 3);
vol *= pi4by3;
@@ -532,7 +524,6 @@ partners G4BertiniNucleiModel::generateInteractionPartners(G4CascadParticle& cpa
rat * rat * vol;
} else {
abs_sec = 0.0;
};
@@ -666,7 +657,6 @@ std::vector<G4CascadParticle> G4BertiniNucleiModel::generateParticleFate(G4Casca
G4cout << " generateParticleFate-> can not be here " << G4endl;
} else {
G4int npart = thePartners.size();
if (npart == 1) { /// cparticle is on the next zone entry
@@ -681,7 +671,6 @@ std::vector<G4CascadParticle> G4BertiniNucleiModel::generateParticleFate(G4Casca
}
} else { /// there are possible interactions
std::vector<G4double> old_position = cparticle.getPosition();
G4InuclElementaryParticle bullet = cparticle.getParticle();
G4bool no_interaction = true;
@@ -754,7 +743,6 @@ std::vector<G4CascadParticle> G4BertiniNucleiModel::generateParticleFate(G4Casca
protonNumberCurrent -= 1.0;
} else {
neutronNumberCurrent -= 1.0;
};
@@ -762,7 +750,6 @@ std::vector<G4CascadParticle> G4BertiniNucleiModel::generateParticleFate(G4Casca
protonNumberCurrent -= 1.0;
} else if(current_nucl2 == 2) {
neutronNumberCurrent -= 1.0;
};
@@ -898,7 +885,6 @@ G4double G4BertiniNucleiModel::getRatio(G4int ip) const {
G4double rat;
if (ip == 1) {
if (verboseLevel > 2){
G4cout << " current " << protonNumberCurrent << " inp " << protonNumber << G4endl;
}
@@ -1048,7 +1034,6 @@ G4BertiniNucleiModel::initializeCascad(G4InuclNuclei* bullet,
if (ab < 4.0) { /// a == 3
while (badco && itry < itry_max) {
if (itry > 0) coordinates.resize(0);
itry++;
G4int i(0);
@@ -1108,11 +1093,10 @@ G4BertiniNucleiModel::initializeCascad(G4InuclNuclei* bullet,
G4bool large_dist = false;
for (i = 0; i < 2; i++) {
for (G4int j = i+1; j < 3; j++) {
G4double r2 = pow(coordinates[i][0] - coordinates[j][0], 2) +
pow(coordinates[i][1] - coordinates[j][1], 2) +
pow(coordinates[i][2] - coordinates[j][2], 2);
G4double r2 = pow(coordinates[i][0] - coordinates[j][0], G4double(2)) +
pow(coordinates[i][1] - coordinates[j][1], G4double(2)) +
pow(coordinates[i][2] - coordinates[j][2], G4double(2));
if (verboseLevel > 2) {
G4cout << " i " << i << " j " << j << " r2 " << r2 << G4endl;
@@ -1169,7 +1153,6 @@ G4BertiniNucleiModel::initializeCascad(G4InuclNuclei* bullet,
coord1[1] * coord1[1] +
coord1[2] * coord1[2]) << G4endl;
}
break;
};
};
@@ -1201,9 +1184,9 @@ G4BertiniNucleiModel::initializeCascad(G4InuclNuclei* bullet,
for (i = 0; i < ia-1; i++) {
for (G4int j = i+1; j < ia; j++) {
G4double r2 = pow(coordinates[i][0] - coordinates[j][0], 2) +
pow(coordinates[i][1]-coordinates[j][1], 2) +
pow(coordinates[i][2] - coordinates[j][2], 2);
G4double r2 = pow(coordinates[i][0] - coordinates[j][0], G4double(2)) +
pow(coordinates[i][1]-coordinates[j][1], G4double(2)) +
pow(coordinates[i][2] - coordinates[j][2], G4double(2));
if (verboseLevel > 2){
G4cout << " i " << i << " j " << j << " r2 " << r2 << G4endl;
@@ -1235,7 +1218,7 @@ G4BertiniNucleiModel::initializeCascad(G4InuclNuclei* bullet,
G4double u;
G4double x;
std::vector<G4double> mom(4);
/// G4bool badp = True;
/// G4bool badp = True;
G4int i(0);
for (i = 0; i < ia - 1; i++) {
@@ -0,0 +1,144 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * 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. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#include "G4BertiniRegionModel.hh"
#include "G4HadronicException.hh"
const G4double G4BertiniRegionModel::radius0 = 1.0E-15;
const G4double G4BertiniRegionModel::BE = 7;
G4BertiniRegionModel::G4BertiniRegionModel(const G4int numberOfLayers, const G4int A, const G4int Z)
{
//count the radiuses, densities and fermi momenta with A and Z
G4double oneThird = 1.0/3.0;
G4double r = radius0*pow(G4double(A), G4double(oneThird) );
if(numberOfLayers==1){
radius.push_back(r);
G4double rho = G4double(A) / (4.0/3.0*pi*pow(r,3));
density.push_back(rho);
G4double protonMass = G4Proton::Proton()->GetPDGMass();
G4double neutronMass = G4Neutron::Neutron()->GetPDGMass();
G4double protonDensity = G4double(Z) / (4.0/3.0*pi*pow(r,3));
G4double neutronDensity = G4double(A-Z) / (4.0/3.0*pi*pow(r,3));
protonFermiEnergy.push_back(GetFermiEnergy(protonDensity, protonMass));
neutronFermiEnergy.push_back(GetFermiEnergy(neutronDensity, neutronMass));
protonFermiMomentum.push_back(GetFermiMomentum(protonDensity, protonMass));
neutronFermiMomentum.push_back(GetFermiMomentum(neutronDensity, neutronMass));
G4double fermiEP = *protonFermiEnergy.begin();
G4double fermiEN = *neutronFermiEnergy.begin();
protonPotentialEnergy.push_back(-(fermiEP + BE));
neutronPotentialEnergy.push_back(-(fermiEN + BE));
}
else{
if(numberOfLayers==3){
radius.push_back(0.1*r);
radius.push_back(0.2*r);
radius.push_back(0.9*r);
}
}
}
G4BertiniRegionModel::~G4BertiniRegionModel(){}
G4double G4BertiniRegionModel::GetDensity(G4double r){
my_iterator j=density.begin();
for(my_iterator i=radius.begin(); i<radius.end(); i++){
if(r <= *i) return *j;
j++;
}
return 0;
}
G4double G4BertiniRegionModel::GetPotentialEnergy(G4double r, G4int particle){
if(particle == 0){ //proton
my_iterator j=protonPotentialEnergy.begin();
for(my_iterator i=radius.begin(); i<radius.end(); i++){
if(r <= *i) return *j;
j++;
}
return 0;
}
if(particle == 1){ //neutron
my_iterator j=neutronPotentialEnergy.begin();
for(my_iterator i=radius.begin(); i<radius.end(); i++){
if(r <= *i) return *j;
j++;
}
return 0;
}
return 0;
}
G4double G4BertiniRegionModel::GetMaximumNucleonMomentum(G4double r,
G4int nucleon){
if(nucleon == 0){
my_iterator j=protonFermiMomentum.begin();
for(my_iterator i=radius.begin(); i<radius.end(); i++){
if(r <= *i) return *j;
j++;
}
}
if(nucleon==1){
my_iterator j=neutronFermiMomentum.begin();
for(my_iterator i=radius.begin(); i<radius.end(); i++){
if(r <= *i) return *j;
j++;
}
}
throw G4HadronicException(__FILE__, __LINE__, "G4BertiniRegionModel::GetMaximumNucleonMomentum - return value undefined");
return 0;
}
G4double G4BertiniRegionModel::GetFermiMomentum(G4double aDensity,
G4double aMass){
return sqrt(2*aMass*GetFermiEnergy(aDensity, aMass));
}
G4double G4BertiniRegionModel::GetFermiEnergy(G4double aDensity,
G4double aMass){
G4double twoThirds = 2.0/3.0;
return (pow(hbar_Planck,2)/(2.0*aMass)*pow((3.0*pi2*aDensity), twoThirds));
}
@@ -19,7 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#include "G4BigBanger.hh"
#include "G4InuclNuclei.hh"
#include "G4ParticleLargerEkin.hh"
@@ -35,7 +35,7 @@ G4BigBanger::G4BigBanger()
}
}
G4CollisionOutput G4BigBanger::collide(G4InuclParticle* bullet,
G4CollisionOutput G4BigBanger::collide(G4InuclParticle* /*bullet*/,
G4InuclParticle* target) {
if (verboseLevel > 3) {
@@ -313,10 +313,10 @@ G4double G4BigBanger::xProbability(G4double x,
ekpr = x * x;
if(2 * ihalf == ia) { // even A
ekpr *= sqrt(1.0 - x) * pow((1.0 - x), int((3 * ia - 6) / 2));
ekpr *= sqrt(1.0 - x) * pow((1.0 - x), G4int(G4double(3 * ia - 6) / 2.0));
}
else {
ekpr *= pow((1.0 - x), int((3 * ia - 5) / 2));
ekpr *= pow((1.0 - x), G4int(G4double(3 * ia - 5) / 2.0));
};
};
@@ -329,7 +329,7 @@ G4double G4BigBanger::maxProbability(G4double a) const {
G4cout << " >>> G4BigBanger::maxProbability" << G4endl;
}
return xProbability(1.0 / (a - 1.0) / 1.5, int(a + 0.1));
return xProbability(1.0 / (a - 1.0) / 1.5, G4int(a + 0.1));
}
G4double G4BigBanger::generateX(G4int ia,
@@ -19,7 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#include "G4CascadParticle.hh"
G4CascadParticle::G4CascadParticle()
@@ -19,7 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#include "G4CascadSpecialFunctions.hh"
std::pair<G4int, G4double> G4CascadSpecialFunctions::getPositionInEnergyScale2(G4double e) {
@@ -100,7 +100,7 @@ G4double G4CascadSpecialFunctions::absorptionCrosSection(G4double e,
G4int verboseLevel = 2;
if (verboseLevel > 3) {
G4cout << " >>> G4CascadSpecialFunctions::absorptionCrosSection" << G4endl;
G4cout << " >>> G4CascadSpecialFunctions::absorptionCrosSection type:" << type <<G4endl;
}
const G4double corr_fac = 0.2;
@@ -19,7 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#include "G4CascadeInterface.hh"
#include "globals.hh"
#include "G4DynamicParticleVector.hh"
@@ -53,14 +53,14 @@ G4CascadeInterface::G4CascadeInterface()
}
};
G4ReactionProductVector* G4CascadeInterface::Propagate(G4KineticTrackVector* theSecondaries,
G4V3DNucleus* theNucleus) {
G4ReactionProductVector* G4CascadeInterface::Propagate(G4KineticTrackVector* ,
G4V3DNucleus* ) {
return NULL;
};
// #define debug_G4CascadeInterface
G4VParticleChange* G4CascadeInterface::ApplyYourself(const G4Track& aTrack,
G4HadFinalState* G4CascadeInterface::ApplyYourself(const G4HadProjectile& aTrack,
G4Nucleus& theNucleus) {
#ifdef debug_G4CascadeInterface
static G4int counter(0);
@@ -68,12 +68,12 @@ G4VParticleChange* G4CascadeInterface::ApplyYourself(const G4Track& aTrack,
G4cerr << "Reaction number "<< counter << " "<<aTrack.GetDynamicParticle()->GetDefinition()->GetParticleName()<<" "<< aTrack.GetDynamicParticle()->GetKineticEnergy()<<G4endl;
#endif
theResult.Clear();
if (verboseLevel > 3) {
G4cout << " >>> G4CascadeInterface::ApplyYourself" << G4endl;
};
theResult.Initialize(aTrack);
G4double eInit = 0.0;
G4double eTot = 0.0;
G4double sumBaryon = 0.0;
@@ -96,11 +96,11 @@ G4VParticleChange* G4CascadeInterface::ApplyYourself(const G4Track& aTrack,
// Code momentum and energy.
G4double px,py,pz;
px=aTrack.GetDynamicParticle()->Get4Momentum().px() / GeV;
py=aTrack.GetDynamicParticle()->Get4Momentum().py() / GeV;
pz=aTrack.GetDynamicParticle()->Get4Momentum().pz() / GeV;
G4LorentzVector projectileMomentum = aTrack.GetDynamicParticle()->Get4Momentum();
px=aTrack.Get4Momentum().px() / GeV;
py=aTrack.Get4Momentum().py() / GeV;
pz=aTrack.Get4Momentum().pz() / GeV;
G4LorentzVector projectileMomentum = aTrack.Get4Momentum();
G4LorentzRotation toZ;
toZ.rotateZ(-projectileMomentum.phi());
toZ.rotateY(-projectileMomentum.theta());
@@ -127,8 +127,6 @@ G4VParticleChange* G4CascadeInterface::ApplyYourself(const G4Track& aTrack,
G4double theNucleusA = theNucleus.GetN();
if ( !(G4int(theNucleusA) == 1) ) {
target = new G4InuclNuclei(targetMomentum,
theNucleusA,
@@ -165,39 +163,64 @@ G4VParticleChange* G4CascadeInterface::ApplyYourself(const G4Track& aTrack,
G4BigBanger* bigb = new G4BigBanger;
G4InuclCollider* collider = new G4InuclCollider(colep, inc, noneq, eqil, fiss, bigb);
if (G4int(theNucleusA) == 1)
{
do
{
targetH = new G4InuclElementaryParticle(targetMomentum, 1);
G4int maxTries = 10; // maximum tries for inelastic collision to avoid infinite loop
G4int nTries = 0; // try counter
output = collider->collide(bullet, targetH);
}
while(output.getOutgoingParticles().size()+output.getNucleiFragments().size() < 2.5);
if (G4int(theNucleusA) == 1) { // special treatment for target H(1,1) (proton)
sumBaryon += 1;
targetH = new G4InuclElementaryParticle(targetMomentum, 1);
std::vector<G4double> bmom = bullet->getMomentum();
eInit = sqrt(bmom[0] * bmom[0]);
std::vector<G4double> tmom = targetH->getMomentum();
eInit += sqrt(tmom[0] * tmom[0]);
G4float cutElastic[8];
cutElastic[proton ] = 1.0; // GeV
cutElastic[neutron ] = 1.0;
cutElastic[pionPlus ] = 0.6;
cutElastic[pionMinus] = 0.2;
cutElastic[pionZero ] = 0.2;
if (momentumBullet[3] > cutElastic[bulletType]) { // inelastic collision possible
do { // we try to create inelastic interaction
output = collider->collide(bullet, targetH);
nTries++;
} while(
(nTries < maxTries) &&
(output.getOutgoingParticles().size() == 2 && // elastic: bullet + p = H(1,1) coming out
(output.getOutgoingParticles().begin()->type() == bulletType ||
output.getOutgoingParticles().begin()->type() == proton)
)
);
} else { // only elastic collision is energetically possible
output = collider->collide(bullet, targetH);
}
sumBaryon += 1;
std::vector<G4double> bmom = bullet->getMomentum();
eInit = sqrt(bmom[0] * bmom[0]);
std::vector<G4double> tmom = targetH->getMomentum();
eInit += sqrt(tmom[0] * tmom[0]);
if (verboseLevel > 2) {
G4cout << "Target: " << G4endl;
targetH->printParticle();
}
} else { // treat all other targets excepet H(1,1)
do // we try to create inelastic interaction
{
output = collider->collide(bullet, target );
nTries++;
} while(
(nTries < maxTries) &&
(output.getOutgoingParticles().size() + output.getNucleiFragments().size() < 2.5) &&
(output.getOutgoingParticles().size()!=0) &&
(output.getOutgoingParticles().begin()->type()==bullet->type())
);
if (verboseLevel > 2) {
G4cout << "Target: " << G4endl;
targetH->printParticle();
}
}
else
{
do
{
output = collider->collide(bullet, target );
}
while( output.getOutgoingParticles().size()+output.getNucleiFragments().size() < 2.5
&& output.getOutgoingParticles().begin()->type()==bullet->type() );
}
if (verboseLevel > 1)
{
G4cout << " Cascade output: " << G4endl;
@@ -205,13 +228,10 @@ G4VParticleChange* G4CascadeInterface::ApplyYourself(const G4Track& aTrack,
}
// Convert cascade data to use hadronics interface
std::vector<G4InuclNuclei> nucleiFragments = output.getNucleiFragments();
std::vector<G4InuclElementaryParticle> particles = output.getOutgoingParticles();
G4int numSecondaries = nucleiFragments.size()+particles.size();
theResult.SetStatusChange(fStopAndKill);
theResult.SetNumberOfSecondaries(numSecondaries);
theResult.SetStatusChange(stopAndKill);
if (!particles.empty()) {
particleIterator ipart;
@@ -245,6 +265,7 @@ G4VParticleChange* G4CascadeInterface::ApplyYourself(const G4Track& aTrack,
break;
case neutron:
#ifdef debug_G4CascadeInterface
G4cerr << "neutron "<< counter<<" "<<aMom<<" "<< ekin<<G4endl;
#endif
@@ -255,6 +276,7 @@ G4VParticleChange* G4CascadeInterface::ApplyYourself(const G4Track& aTrack,
case pionPlus:
cascadeParticle =
new G4DynamicParticle(G4PionPlus::PionPlusDefinition(), aMom, ekin);
#ifdef debug_G4CascadeInterface
G4cerr << "pionPlus "<< counter<<" "<<aMom<<" "<< ekin<<G4endl;
#endif
@@ -263,6 +285,7 @@ G4VParticleChange* G4CascadeInterface::ApplyYourself(const G4Track& aTrack,
case pionMinus:
cascadeParticle =
new G4DynamicParticle(G4PionMinus::PionMinusDefinition(), aMom, ekin);
#ifdef debug_G4CascadeInterface
G4cerr << "pionMinus "<< counter<<" "<<aMom<<" "<< ekin<<G4endl;
#endif
@@ -271,6 +294,7 @@ G4VParticleChange* G4CascadeInterface::ApplyYourself(const G4Track& aTrack,
case pionZero:
cascadeParticle =
new G4DynamicParticle(G4PionZero::PionZeroDefinition(), aMom, ekin);
#ifdef debug_G4CascadeInterface
G4cerr << "pionZero "<< counter<<" "<<aMom<<" "<< ekin<<G4endl;
#endif
@@ -279,6 +303,7 @@ G4VParticleChange* G4CascadeInterface::ApplyYourself(const G4Track& aTrack,
case photon:
cascadeParticle =
new G4DynamicParticle(G4Gamma::Gamma(), aMom, ekin);
#ifdef debug_G4CascadeInterface
G4cerr << "photon "<< counter<<" "<<aMom<<" "<< ekin<<G4endl;
#endif
@@ -294,7 +319,7 @@ G4VParticleChange* G4CascadeInterface::ApplyYourself(const G4Track& aTrack,
}
}
// Get nuclei fragments
// get nuclei fragments
G4DynamicParticle * aFragment = 0;
G4ParticleDefinition * aIonDef = 0;
G4ParticleTable *theTableOfParticles = G4ParticleTable::GetParticleTable();
@@ -320,7 +345,7 @@ G4VParticleChange* G4CascadeInterface::ApplyYourself(const G4Track& aTrack,
G4int A = G4int(ifrag->getA());
G4int Z = G4int(ifrag->getZ());
aIonDef = theTableOfParticles->FindIon(Z,A,0,Z);
aIonDef = theTableOfParticles->FindIon(Z, A, 0, Z);
aFragment = new G4DynamicParticle(aIonDef, aMom, eKin);
@@ -333,27 +358,24 @@ G4VParticleChange* G4CascadeInterface::ApplyYourself(const G4Track& aTrack,
}
if (verboseLevel > 2) {
if (sumBaryon != 0) {
G4cout << "ERROR: no baryon number conservation, sum of baryons = "
<< sumBaryon << G4endl;
}
if (verboseLevel > 2) {
if (sumEnergy > 0.01 ) {
G4cout << "Kinetic energy conservation violated by "
<< sumEnergy << " GeV" << G4endl;
}
G4cout << "Total energy conservation at level ~"
<< (eInit - eTot) * GeV << " MeV" << G4endl;
if (sumEnergy > 0.01 ) {
G4cout << "Kinetic energy conservation violated by "
<< sumEnergy << " GeV" << G4endl;
}
G4cout << "Total energy conservation at level ~"
<< (eInit - eTot) * GeV << " MeV" << G4endl;
if (sumEnergy < -5.0e-5 ) { // 0.05 MeV
G4cout << "FATAL ERROR: energy created "
<< sumEnergy * GeV << " MeV" << G4endl;
}
}
return &theResult;
}
@@ -19,7 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#include "G4CollisionOutput.hh"
#include "G4ParticleLargerEkin.hh"
#include <algorithm>
@@ -19,7 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#include "G4Collider.hh"
#include "G4ElementaryParticleCollider.hh"
#include "G4ParticleLargerEkin.hh"
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#define RUN
#include "G4EquilibriumEvaporator.hh"
@@ -33,7 +34,7 @@ G4EquilibriumEvaporator::G4EquilibriumEvaporator()
}
}
G4CollisionOutput G4EquilibriumEvaporator::collide(G4InuclParticle* bullet,
G4CollisionOutput G4EquilibriumEvaporator::collide(G4InuclParticle* /*bullet*/,
G4InuclParticle* target) {
if (verboseLevel > 3) {
@@ -267,7 +268,7 @@ G4CollisionOutput G4EquilibriumEvaporator::collide(G4InuclParticle* bullet,
FMAX = pow(EEXS, 4);
};
G4double S;
G4double S(0);
while (itry < itry_max) {
itry++;
@@ -594,8 +595,8 @@ G4bool G4EquilibriumEvaporator::goodRemnant(G4double a,
G4double G4EquilibriumEvaporator::getQF(G4double x,
G4double x2,
G4double a,
G4double z,
G4double e) const {
G4double ,
G4double ) const {
if (verboseLevel > 3) {
G4cout << " >>> G4EquilibriumEvaporator::getQF" << G4endl;
}
@@ -682,9 +683,9 @@ G4double G4EquilibriumEvaporator::getQF(G4double x,
return QFF;
}
G4double G4EquilibriumEvaporator::getAF(G4double x,
G4double a,
G4double z,
G4double G4EquilibriumEvaporator::getAF(G4double ,
G4double ,
G4double ,
G4double e) const {
if (verboseLevel > 3) {
@@ -700,8 +701,8 @@ G4double G4EquilibriumEvaporator::getAF(G4double x,
return AF;
}
G4double G4EquilibriumEvaporator::getPARLEVDEN(G4double A,
G4double Z) const {
G4double G4EquilibriumEvaporator::getPARLEVDEN(G4double ,
G4double ) const {
if (verboseLevel > 3) {
G4cout << " >>> G4EquilibriumEvaporator::getPARLEVDEN" << G4endl;
@@ -712,7 +713,7 @@ G4double G4EquilibriumEvaporator::getPARLEVDEN(G4double A,
return par;
}
G4double G4EquilibriumEvaporator::getE0(G4double A) const {
G4double G4EquilibriumEvaporator::getE0(G4double ) const {
if (verboseLevel > 3) {
G4cout << " >>> G4EquilibriumEvaporator::getE0" << G4endl;
@@ -19,7 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#include "G4FissionStore.hh"
#include <math.h>
@@ -19,7 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#include "G4Fissioner.hh"
#include "G4InuclNuclei.hh"
#include "G4FissionStore.hh"
@@ -33,7 +33,7 @@ G4Fissioner::G4Fissioner()
}
}
G4CollisionOutput G4Fissioner::collide(G4InuclParticle* bullet,
G4CollisionOutput G4Fissioner::collide(G4InuclParticle* /*bullet*/,
G4InuclParticle* target) {
if (verboseLevel > 3) {
@@ -280,7 +280,7 @@ void G4Fissioner::potentialMinimization(G4double& VP,
itry++;
G4double S = 0.0;
for (G4int i = 0; i < 2; i++) {
for (i = 0; i < 2; i++) {
S += R[i] * (1.0 + AL1[i] + BET1[i] - 0.257 * AL1[i] * BET1[i]);
};
R12 = 0.0;
@@ -385,10 +385,13 @@ void G4Fissioner::potentialMinimization(G4double& VP,
if (DSOL < DSOL1) break;
};
if (verboseLevel > 3) {
if (itry == itry_max)
G4cout << " maximal number of iterations in potentialMinimization " << G4endl
<< " A1 " << AF << " Z1 " << ZF << G4endl;
};
for (i = 0; i < 2; i++) ED[i] = F[i] * BET1[i] * BET1[i] + C[i] * AL1[i] * AL1[i];
VC = D / R12;
@@ -19,6 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#define RUN
#include "G4IntraNucleiCascader.hh"
@@ -113,8 +114,8 @@ G4CollisionOutput G4IntraNucleiCascader::collide(G4InuclParticle* bullet,
output_particles.push_back(all_particles.second[ip]);
if (cascad_particles.size() == 0) { // compound nuclei
G4int ia = int(ab + 0.5);
G4int iz = int(zb + 0.5);
G4int ia = G4int(ab + 0.5);
G4int iz = G4int(zb + 0.5);
G4int i;
for (i = 0; i < ia; i++) {
@@ -122,8 +123,8 @@ G4CollisionOutput G4IntraNucleiCascader::collide(G4InuclParticle* bullet,
theExitonConfiguration.incrementQP(knd);
};
G4int ihn = int(2.0 * (ab - zb) * inuclRndm() + 0.5);
G4int ihz = int(2.0 * zb * inuclRndm() + 0.5);
G4int ihn = G4int(2.0 * (ab - zb) * inuclRndm() + 0.5);
G4int ihz = G4int(2.0 * zb * inuclRndm() + 0.5);
for (i = 0; i < ihn; i++) theExitonConfiguration.incrementHoles(2);
@@ -214,7 +215,6 @@ G4CollisionOutput G4IntraNucleiCascader::collide(G4InuclParticle* bullet,
particleIterator ipart;
for (ipart = output_particles.begin(); ipart != output_particles.end(); ipart++) {
std::vector<G4double> mom = ipart->getMomentum();
for (G4int j = 0; j < 4; j++) momentum_out[j] += mom[j];
@@ -230,7 +230,6 @@ G4CollisionOutput G4IntraNucleiCascader::collide(G4InuclParticle* bullet,
}
if (afin > 1.0) {
G4InuclNuclei outgoing_nuclei(afin, zfin);
G4double mass = outgoing_nuclei.getMass();
momentum_out[0] += mass;
@@ -277,7 +276,6 @@ G4CollisionOutput G4IntraNucleiCascader::collide(G4InuclParticle* bullet,
last_particle.setType(1);
} else { // neutron
last_particle.setType(2);
};
@@ -19,7 +19,7 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
#include "G4InuclCollider.hh"
#include "G4InuclElementaryParticle.hh"
#include "G4LorentzConvertor.hh"
@@ -30,7 +30,7 @@ typedef std::vector<G4InuclElementaryParticle>::iterator particleIterator;
typedef std::vector<G4InuclNuclei>::iterator nucleiIterator;
G4InuclCollider::G4InuclCollider()
: verboseLevel(2) {
: verboseLevel(0) {
if (verboseLevel > 3) {
G4cout << " >>> G4InuclCollider::G4InuclCollider" << G4endl;
@@ -40,7 +40,7 @@ G4InuclCollider::G4InuclCollider()
G4CollisionOutput G4InuclCollider::collide(G4InuclParticle* bullet,
G4InuclParticle* target) {
verboseLevel = 2;
verboseLevel = 0;
if (verboseLevel > 3) {
G4cout << " >>> G4InuclCollider::collide" << G4endl;
}
@@ -53,40 +53,36 @@ G4CollisionOutput G4InuclCollider::collide(G4InuclParticle* bullet,
G4InuclElementaryParticle* particle2 =
dynamic_cast<G4InuclElementaryParticle*>(target);
if(particle1 && particle2) { // particle + particle
if (particle1 && particle2) { // particle + particle (NOTE: also the h + H(1,1) treated here)
if (verboseLevel > 2) {
particle1->printParticle();
particle2->printParticle();
}
globalOutput = theElementaryParticleCollider->collide(bullet, target);
}
else { // needs to call all machinery
globalOutput = theElementaryParticleCollider->collide(bullet, target);
} else { // needs to call all machinery
G4LorentzConvertor convertToTargetRestFrame;
G4InteractionCase interCase = bulletTargetSetter(bullet, target);
G4int intcase = interCase.getInterCase();
if(intcase > 0) { // ok
if (intcase > 0) { // ok
G4InuclNuclei* ntarget =
dynamic_cast<G4InuclNuclei*>(interCase.getTarget());
convertToTargetRestFrame.setTarget(ntarget->getMomentum(),
ntarget->getMass());
G4int btype = 0;
G4double ab = 0.0;
G4double zb = 0.0;
G4double at = ntarget->getA();
G4double zt = ntarget->getZ();
if(intcase == 1) { // particle with nuclei
if (intcase == 1) { // particle with nuclei
G4InuclElementaryParticle* pbullet =
dynamic_cast<G4InuclElementaryParticle*>(interCase.getBullet());
if(pbullet->photon()) {
if (pbullet->photon()) {
G4cout << " InuclCollider -> can not collide with photon " << G4endl;
globalOutput.trivialise(bullet, target);
@@ -97,9 +93,8 @@ G4CollisionOutput G4InuclCollider::collide(G4InuclParticle* bullet,
pbullet->getMass());
btype = pbullet->type();
};
}
else { // nuclei with nuclei
} else { // nuclei with nuclei
G4InuclNuclei* nbullet =
dynamic_cast<G4InuclNuclei*>(interCase.getBullet());
@@ -115,7 +110,7 @@ G4CollisionOutput G4InuclCollider::collide(G4InuclParticle* bullet,
G4cout << " ekin in trs " << ekin << G4endl;
}
if(inelasticInteractionPossible(bullet, target, ekin)) {
if (inelasticInteractionPossible(bullet, target, ekin)) {
convertToTargetRestFrame.toTheTargetRestFrame();
if (verboseLevel > 3) {
@@ -137,21 +132,16 @@ G4CollisionOutput G4InuclCollider::collide(G4InuclParticle* bullet,
G4int itry = 0;
while (bad && itry < itry_max) {
G4CollisionOutput TRFoutput;
G4CollisionOutput output;
itry++;
if(intcase == 1) {
if (intcase == 1) {
G4InuclElementaryParticle pbullet(bmom, btype);
output = theIntraNucleiCascader->collide(&pbullet, &ntarget);
}
else {
} else {
G4InuclNuclei nbullet(ab, zb);
nbullet.setMomentum(bmom);
nbullet.setEnergy();
output = theIntraNucleiCascader->collide(&nbullet, &ntarget);
@@ -166,32 +156,25 @@ G4CollisionOutput G4InuclCollider::collide(G4InuclParticle* bullet,
// the rest, if any
TRFoutput.addOutgoingParticles(output.getOutgoingParticles());
if(output.numberOfNucleiFragments() == 1) { // there is smth. after
if (output.numberOfNucleiFragments() == 1) { // there is smth. after
G4InuclNuclei cascad_rec_nuclei = output.getNucleiFragments()[0];
if(explosion(&cascad_rec_nuclei)) {
if (explosion(&cascad_rec_nuclei)) {
if (verboseLevel > 3) {
G4cout << " big bang after cascade " << G4endl;
};
output = theBigBanger->collide(0,&cascad_rec_nuclei);
TRFoutput.addOutgoingParticles(output.getOutgoingParticles());
}
else {
} else {
output = theNonEquilibriumEvaporator->collide(0, &cascad_rec_nuclei);
if (verboseLevel > 3) {
G4cout << " After NonEquilibriumEvaporator " << G4endl;
output.printCollisionOutput();
};
TRFoutput.addOutgoingParticles(output.getOutgoingParticles());
G4InuclNuclei exiton_rec_nuclei = output.getNucleiFragments()[0];
output = theEquilibriumEvaporator->collide(0, &exiton_rec_nuclei);
if (verboseLevel > 3) {
@@ -204,20 +187,18 @@ G4CollisionOutput G4InuclCollider::collide(G4InuclParticle* bullet,
TRFoutput.addTargetFragments(output.getNucleiFragments());
};
};
// convert to the LAB
G4bool withReflection = convertToTargetRestFrame.reflectionNeeded();
std::vector<G4InuclElementaryParticle> particles =
TRFoutput.getOutgoingParticles();
if(!particles.empty()) {
if (!particles.empty()) {
particleIterator ipart;
for(ipart = particles.begin(); ipart != particles.end(); ipart++) {
std::vector<G4double> mom = ipart->getMomentum();
if(withReflection) mom[3] = -mom[3];
if (withReflection) mom[3] = -mom[3];
mom = convertToTargetRestFrame.rotate(mom);
ipart->setMomentum(mom);
mom = convertToTargetRestFrame.backToTheLab(ipart->getMomentum());
@@ -228,11 +209,13 @@ G4CollisionOutput G4InuclCollider::collide(G4InuclParticle* bullet,
std::vector<G4InuclNuclei> nucleus = TRFoutput.getNucleiFragments();
if(!nucleus.empty()) {
if (!nucleus.empty()) {
nucleiIterator inuc;
for(inuc = nucleus.begin(); inuc != nucleus.end(); inuc++) {
for (inuc = nucleus.begin(); inuc != nucleus.end(); inuc++) {
std::vector<G4double> mom = inuc->getMomentum();
if(withReflection) mom[3] = -mom[3];
if (withReflection) mom[3] = -mom[3];
mom = convertToTargetRestFrame.rotate(mom);
inuc->setMomentum(mom);
inuc->setEnergy();
@@ -247,8 +230,7 @@ G4CollisionOutput G4InuclCollider::collide(G4InuclParticle* bullet,
if(globalOutput.acceptable()) {
return globalOutput;
}
else {
} else {
globalOutput.reset();
};
};
@@ -261,8 +243,7 @@ G4CollisionOutput G4InuclCollider::collide(G4InuclParticle* bullet,
globalOutput.trivialise(bullet, target);
return globalOutput;
}
else {
} else {
if (verboseLevel > 3) {
G4cout << " InuclCollider -> inelastic interaction is impossible " << G4endl
@@ -272,9 +253,9 @@ G4CollisionOutput G4InuclCollider::collide(G4InuclParticle* bullet,
globalOutput.trivialise(bullet, target);
return globalOutput;
};
}
else {
};
} else {
if (verboseLevel > 3) {
G4cout << " InuclCollider -> inter case " << intcase << G4endl;
@@ -302,23 +283,20 @@ G4bool G4InuclCollider::inelasticInteractionPossible(G4InuclParticle* bullet,
G4double ab;
G4double zb;
if(G4InuclNuclei* nuclei_target = dynamic_cast<G4InuclNuclei*>(target)) {
if (G4InuclNuclei* nuclei_target = dynamic_cast<G4InuclNuclei*>(target)) {
at = nuclei_target->getA();
zt = nuclei_target->getZ();
if(G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet)) {
if (G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet)) {
ab = nuclei_bullet->getA();
zb = nuclei_bullet->getZ();
}
else {
} else {
G4InuclElementaryParticle* particle =
dynamic_cast<G4InuclElementaryParticle*>(bullet);
ab = 1;
zb = particle->getCharge();
};
}
else {
} else {
if(G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet)) {
ab = nuclei_bullet->getA();
zb = nuclei_bullet->getZ();
@@ -328,16 +306,22 @@ G4bool G4InuclCollider::inelasticInteractionPossible(G4InuclParticle* bullet,
at = 1;
zt = particle->getCharge();
}
else {
} else {
return possible;
};
};
G4double VCOL = coeff * zt * zb / (pow(at, one_third) + pow(ab, one_third));
// VCOL used for testing if elastic collision possible
G4double VCOL = coeff * zt * zb / (pow(at, one_third) + pow(ab, one_third));
possible = VCOL < ekin;
// possible = VCOL < ekin; // NOTE: inelastic collision if not true
possible = true; // we force elastic
if (verboseLevel > 3) {
G4cout << " >>> G4InuclCollider::inelasticInteractionPossible" << G4endl;
G4cout << " VCOL: " << VCOL << " ekin: " << ekin << " inelastic possible: " << possible << G4endl;
}
return possible;
@@ -352,29 +336,28 @@ G4InteractionCase G4InuclCollider::bulletTargetSetter(G4InuclParticle* bullet,
G4InteractionCase interCase;
if(G4InuclNuclei* nuclei_target = dynamic_cast<G4InuclNuclei*>(target)) {
if(G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet)) { // A + A
if (G4InuclNuclei* nuclei_target = dynamic_cast<G4InuclNuclei*>(target)) {
if (G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet)) { // A + A
interCase.setInterCase(2);
if(nuclei_target->getA() >= nuclei_bullet->getA()) {
if (nuclei_target->getA() >= nuclei_bullet->getA()) {
interCase.setBulletTarget(bullet, target);
}
else {
} else {
interCase.setBulletTarget(target, bullet);
};
}
else {
} else {
interCase.setInterCase(1);
interCase.setBulletTarget(bullet, target);
};
}
else {
if(G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet)) {
if(G4InuclElementaryParticle* part =
dynamic_cast<G4InuclElementaryParticle*>(target)) {
} else {
G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet);
if (nuclei_bullet) {
G4InuclElementaryParticle* part =
dynamic_cast<G4InuclElementaryParticle*>(target);
if (part) {
interCase.setInterCase(1);
interCase.setBulletTarget(target, bullet);
};
};
};
};
return interCase;
@@ -394,11 +377,10 @@ G4bool G4InuclCollider::explosion(G4InuclNuclei* target) const {
G4double eexs = target->getExitationEnergy();
G4bool explo = true;
if(a > a_cut) {
if (a > a_cut) {
explo = false;
}
else {
if(eexs < be_cut * bindingEnergy(a, z)) explo = false;
} else {
if (eexs < be_cut * bindingEnergy(a, z)) explo = false;
};
return explo;

Some files were not shown because too many files have changed in this diff Show More