Import Geant4 5.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:57:27 +02:00
parent 330b82b769
commit 37fff30d2e
5733 changed files with 263867 additions and 74574 deletions
@@ -1,4 +1,4 @@
# $Id: GNUmakefile,v 1.3 2000/10/19 15:49:15 brunengo Exp $
# $Id: GNUmakefile,v 1.4 2002/07/11 13:02:55 jwellisc Exp $
# -----------------------------------------------------------
# GNUmakefile for hadronic library. Gabriele Cosmo, 18/9/96.
# -----------------------------------------------------------
@@ -32,6 +32,7 @@ CPPFLAGS += -I$(G4BASE)/global/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)/particles/management/include \
-I$(G4BASE)/particles/leptons/include \
-I$(G4BASE)/particles/bosons/include \
@@ -0,0 +1,68 @@
//
// ********************************************************************
// * 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 G4Absorber_hh
#define G4Absorber_hh
#include "globals.hh"
#include "G4KineticTrackVector.hh"
class G4KineticTrack;
class G4Absorber
{
public:
G4Absorber(G4double cutOnP);
~G4Absorber();
G4bool WillBeAbsorbed(const G4KineticTrack & kt);
G4bool Absorb(G4KineticTrack & kt, G4KineticTrackVector & tgt);
G4KineticTrackVector * GetAbsorbers();
G4KineticTrackVector * GetProducts();
G4bool FindAbsorbers(G4KineticTrack & kt, G4KineticTrackVector & tgt);
G4bool FindProducts(G4KineticTrack & kt);
private:
G4double theCutOnP;
G4KineticTrackVector * theAbsorbers;
G4KineticTrackVector * theProducts;
G4ThreeVector GetRandomDirection();
};
inline G4KineticTrackVector * G4Absorber::GetAbsorbers()
{
return theAbsorbers;
}
inline G4KineticTrackVector * G4Absorber::GetProducts()
{
return theProducts;
}
#endif
@@ -0,0 +1,67 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class header file
//
// CERN, Geneva, Switzerland
//
// File name: G4AntiProtonField.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#ifndef G4AntiProtonField_h
#define G4AntiProtonField_h 1
//#include "globals.hh"
#include "G4VNuclearField.hh"
#include "G4V3DNucleus.hh"
class G4AntiProtonField: public G4VNuclearField
{
public:
G4AntiProtonField(G4V3DNucleus * nucleus, G4double coeff = 1.53*fermi);
virtual ~G4AntiProtonField();
private:
G4AntiProtonField(const G4AntiProtonField &right);
const G4AntiProtonField & operator=(const G4AntiProtonField & right);
int operator==(const G4AntiProtonField & right) const;
int operator!=(const G4AntiProtonField & right) const;
public:
virtual G4double GetField(const G4ThreeVector & aPosition);
virtual G4double GetBarrier();
virtual G4double GetCoeff() { return theCoeff; }
private:
G4double theCoeff;
};
#endif
@@ -0,0 +1,131 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
// -------------------------------------------------------------------
// GEANT4 Class file
//
//
// File name: G4BinaryCascade.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 8 June 2000
// -----------------------------------------------------------------------------
#ifndef G4BinaryCascade_hh
#define G4BinaryCascade_hh
#include "G4VIntraNuclearTransportModel.hh"
#include "G4ReactionProductVector.hh"
#include "G4KineticTrackVector.hh"
#include "G4ListOfCollisions.hh"
#include "G4V3DNucleus.hh"
#include "G4Fancy3DNucleus.hh"
#include "G4Fragment.hh"
#include "G4VFieldPropagation.hh"
#include "G4VScatterer.hh"
#include "G4LorentzVector.hh"
#include "G4LorentzRotation.hh"
class G4CollisionManager;
class G4Track;
class G4KineticTrack;
class G43DNucleus;
class G4BinaryCascade : public G4VIntraNuclearTransportModel
{
public:
G4BinaryCascade();
G4BinaryCascade(const G4BinaryCascade & right);
~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,
G4V3DNucleus * nucleus);
private:
void PrintWelcomeMessage();
void BuildTargetList();
void FindCollisions(G4KineticTrackVector * secondaries);
G4bool ApplyCollision(G4CollisionInitialState * collision);
G4bool Capture();
G4bool Absorb();
G4bool CheckPauliPrinciple(G4KineticTrackVector * products);
G4double GetExcitationEnergy();
G4bool CheckDecay(G4KineticTrackVector * products);
void CorrectFinalPandE();
void UpdateTracksAndCollisions(G4KineticTrackVector * oldSecondaries,
G4KineticTrackVector * oldTarget,
G4KineticTrackVector * newSecondaries);
G4bool DoTimeStep(G4double timeStep);
G4Fragment * FindFragments();
G4LorentzVector GetFinal4Momentum();
G4LorentzVector GetFinalNucleusMomentum();
// utility methods
G4ThreeVector GetSpherePoint(G4double r, const G4LorentzVector & momentumdirection);
void ClearAndDestroy(G4KineticTrackVector * ktv);
void ClearAndDestroy(G4ReactionProductVector * rpv);
// for debugging purpose
void PrintKTVector(G4KineticTrackVector * ktv, G4std::string comment=G4std::string(""));
private:
G4KineticTrackVector theProjectileList;
G4KineticTrackVector theTargetList;
G4KineticTrackVector theSecondaryList;
G4KineticTrackVector theCapturedList;
G4KineticTrackVector theFinalState;
G4ExcitationHandler * theExcitationHandler;
G4CollisionManager * theCollisionMgr;
G4VScatterer * theScatterer;
G4VFieldPropagation * thePropagator;
G4double theCurrentTime;
G4double theCutOnP;
G4double theCutOnPAbsorb;
G4LorentzVector theInitial4Mom;
G4int currentA, currentZ;
G4double massInNucleus;
G4LorentzRotation precompoundLorentzboost;
G4double theOuterRadius;
G4bool thePrimaryEscape;
G4ParticleDefinition * thePrimaryType;
};
#endif
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * 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 G4FieldPropagation_h
#define G4FieldPropagation_h 1
#include "G4KineticTrackVector.hh"
class G4FieldPropagation
{
public:
G4FieldPropagation() {}
G4FieldPropagation(const G4FieldPropagation &right) {}
virtual ~G4FieldPropagation() {}
// Operators
const G4FieldPropagation & operator=(const G4FieldPropagation &right);
int operator==(const G4FieldPropagation &right) const;
int operator!=(const G4FieldPropagation &right) const;
// Methods
// only theActive are propagated, nothing else
// only theSpectators define the field, nothing else
virtual void Transport(G4KineticTrackVector &theActive, const G4KineticTrackVector &theSpectators, G4double theTimeStep) = 0;
virtual G4double GetExcitationEnergy(G4int nHit, const G4KineticTrackVector &theParticles) = 0;
// methods for calculating potentials for different types of particles
virtual void Init(G4int z, G4int a) = 0; // prepare potentials' functions
// aPosition is relative to the nucleus center
virtual G4double GetNeutronPotential(G4double radius) = 0;
virtual G4double GetNeutronPotential(G4ThreeVector &aPosition) = 0;
virtual G4double GetProtonPotential(G4double radius) = 0;
virtual G4double GetProtonPotential(G4ThreeVector &aPosition) = 0;
virtual G4double GetAntiprotonPotential(G4double radius) = 0;
virtual G4double GetAntiprotonPotential(G4ThreeVector &aPosition) = 0;
virtual G4double GetKaonPotential(G4double radius) = 0;
virtual G4double GetKaonPotential(G4ThreeVector &aPosition) = 0;
virtual G4double GetPionPotential(G4double radius) = 0;
virtual G4double GetPionPotential(G4ThreeVector &aPosition) = 0;
};
#endif // G4FieldPropagation_h
@@ -14,7 +14,7 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * authors in the GEANT4 collaboration. *
// * 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. *
@@ -0,0 +1,56 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
//
// -------------------------------------------------------------------
// GEANT 4 class header file
//
// CERN, Geneva, Switzerland
//
// File name: G4KM_DummyField.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#ifndef G4KM_DummyField_hh
#define G4KM_DummyField_hh
#include "globals.hh"
#include "G4MagneticField.hh"
class G4KM_DummyField : public G4MagneticField
{
public:
G4KM_DummyField() { }
~G4KM_DummyField() { }
virtual void GetFieldValue(const G4double p[3], G4double *field ) const { }
};
#endif
@@ -0,0 +1,91 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class header file
//
// CERN, Geneva, Switzerland
//
// File name: G4KM_NucleonEqRhs.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#ifndef G4KM_NucleonEqRhs_hh
#define G4KM_NucleonEqRhs_hh
#include "globals.hh"
//#include "G4EquationOfMotion.hh"
#include "G4Mag_EqRhs.hh"
#include "G4KM_DummyField.hh" // needed by G4Mag_EqRhs constructor.
#include "G4V3DNucleus.hh"
//class G4KM_NucleonEqRhs : public G4EquationOfMotion // I'd like
class G4KM_NucleonEqRhs : public G4Mag_EqRhs
{
public:
G4KM_NucleonEqRhs(G4KM_DummyField *field, G4V3DNucleus * nucleus);
~G4KM_NucleonEqRhs();
virtual void EvaluateRhsGivenB(const G4double y[], const G4double B[3],
G4double dydx[]) const;
virtual void SetChargeMomentumMass(G4double particleCharge,
G4double MomentumXc,
G4double MassXc2);
void SetMass(G4double aMass);
private:
// use G4VKM_NuclearDensity as it needs a GetDeriv() method.
G4V3DNucleus * theNucleus;
G4double factor;
G4int A;
G4double theMass;
};
inline void G4KM_NucleonEqRhs::SetMass(G4double aMass)
{
theMass = aMass;
}
inline G4KM_NucleonEqRhs::~G4KM_NucleonEqRhs()
{ }
// Here by design, but it is unnecessary for nuclear fields
inline void
G4KM_NucleonEqRhs::SetChargeMomentumMass(G4double particleCharge,
G4double MomentumXc,
G4double MassXc2)
{ }
#endif
@@ -0,0 +1,82 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class header file
//
// CERN, Geneva, Switzerland
//
// File name: G4KM_OpticalEqRhs.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#ifndef G4KM_OpticalEqRhs_hh
#define G4KM_OpticalEqRhs_hh
#include "globals.hh"
//#include "G4EquationOfMotion.hh"
#include "G4Mag_EqRhs.hh"
#include "G4KM_DummyField.hh" // needed by G4Mag_EqRhs constructor.
#include "G4V3DNucleus.hh"
//class G4KM_OpticalEqRhs : public G4EquationOfMotion
class G4KM_OpticalEqRhs : public G4Mag_EqRhs
{
public:
G4KM_OpticalEqRhs(G4KM_DummyField *field, G4V3DNucleus * nucleus);
~G4KM_OpticalEqRhs();
virtual void EvaluateRhsGivenB(const G4double y[], const G4double B[3],
G4double dydx[]) const;
virtual void SetChargeMomentumMass(G4double particleCharge,
G4double MomentumXc,
G4double MassXc2);
void SetFactor(G4double mass, G4double opticalParameter);
private:
G4V3DNucleus * theNucleus;
G4double theFactor;
G4double theMass;
};
inline G4KM_OpticalEqRhs::~G4KM_OpticalEqRhs()
{ }
// Here by design, but it is unnecessary for nuclear fields
inline void G4KM_OpticalEqRhs::SetChargeMomentumMass(G4double particleCharge,
G4double MomentumXc,
G4double MassXc2)
{ }
#endif
@@ -0,0 +1,66 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class header file
//
// CERN, Geneva, Switzerland
//
// File name: G4KaonMinusField.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#ifndef G4KaonMinusField_h
#define G4KaonMinusField_h 1
#include "G4VNuclearField.hh"
#include "G4V3DNucleus.hh"
class G4KaonMinusField: public G4VNuclearField
{
public:
G4KaonMinusField(G4V3DNucleus * nucleus, G4double coeff = 0.35*fermi);
virtual ~G4KaonMinusField();
private:
G4KaonMinusField(const G4KaonMinusField &right);
const G4KaonMinusField & operator=(const G4KaonMinusField & right);
int operator==(const G4KaonMinusField & right) const;
int operator!=(const G4KaonMinusField & right) const;
public:
virtual G4double GetField(const G4ThreeVector & aPosition);
virtual G4double GetBarrier();
virtual G4double GetCoeff() { return theCoeff; }
private:
G4double theCoeff;
};
#endif
@@ -0,0 +1,66 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class header file
//
// CERN, Geneva, Switzerland
//
// File name: G4KaonPlusField.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#ifndef G4KaonPlusField_h
#define G4KaonPlusField_h 1
#include "G4VNuclearField.hh"
#include "G4V3DNucleus.hh"
class G4KaonPlusField: public G4VNuclearField
{
public:
G4KaonPlusField(G4V3DNucleus * nucleus, G4double coeff = 0.35*fermi);
virtual ~G4KaonPlusField();
private:
G4KaonPlusField(const G4KaonPlusField &right);
const G4KaonPlusField & operator=(const G4KaonPlusField & right);
int operator==(const G4KaonPlusField & right) const;
int operator!=(const G4KaonPlusField & right) const;
public:
virtual G4double GetField(const G4ThreeVector & aPosition);
virtual G4double GetBarrier();
virtual G4double GetCoeff() { return theCoeff; }
private:
G4double theCoeff;
};
#endif
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class header file
//
// CERN, Geneva, Switzerland
//
// File name: G4KaonZeroField.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#ifndef G4KaonZeroField_h
#define G4KaonZeroField_h 1
#include "G4VNuclearField.hh"
class G4KaonZeroField: public G4VNuclearField
{
public:
G4KaonZeroField(G4V3DNucleus * nucleus, G4double coeff = 0.35*fermi);
virtual ~G4KaonZeroField();
private:
G4KaonZeroField(const G4KaonZeroField &right);
const G4KaonZeroField & operator=(const G4KaonZeroField & right);
int operator==(const G4KaonZeroField & right) const;
int operator!=(const G4KaonZeroField & right) const;
public:
virtual G4double GetField(const G4ThreeVector & aPosition);
virtual G4double GetBarrier();
virtual G4double GetCoeff() { return theCoeff; }
private:
G4double theCoeff;
};
#endif
@@ -0,0 +1,86 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class header file
//
// CERN, Geneva, Switzerland
//
// File name: G4NeutronField.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#ifndef G4NeutronField_h
#define G4NeutronField_h 1
#include "G4VNuclearField.hh"
#include "G4V3DNucleus.hh"
#include "G4FermiMomentum.hh"
#include "G4VNuclearDensity.hh"
#include "g4std/vector"
class G4NeutronField: public G4VNuclearField
{
public:
G4NeutronField(G4V3DNucleus * nucleus);
virtual ~G4NeutronField();
private:
G4NeutronField(const G4NeutronField &right);
const G4NeutronField & operator=(const G4NeutronField & right);
int operator==(const G4NeutronField & right) const;
int operator!=(const G4NeutronField & right) const;
public:
virtual G4double GetField(const G4ThreeVector & aPosition);
virtual G4double GetBarrier();
private:
G4double GetDensity(const G4ThreeVector & aPosition)
{
return theDensity->GetDensity(aPosition);
}
G4double GetFermiMomentum(const G4double aDensity)
{
return theFermi.GetFermiMomentum(aDensity);
}
G4FermiMomentum theFermi;
G4double theA;
G4double theZ;
const G4VNuclearDensity * theDensity;
G4double theR;
G4std::vector<G4double> theFermiMomBuffer;
};
#endif
@@ -0,0 +1,68 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class header file
//
// CERN, Geneva, Switzerland
//
// File name: G4PionMinusField.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#ifndef G4PionMinusField_h
#define G4PionMinusField_h 1
#include "G4VNuclearField.hh"
#include "G4V3DNucleus.hh"
class G4PionMinusField: public G4VNuclearField
{
public:
G4PionMinusField(G4V3DNucleus * nucleus, G4double coeff = 0.042*fermi);
virtual ~G4PionMinusField();
private:
G4PionMinusField(const G4PionMinusField &right);
const G4PionMinusField & operator=(const G4PionMinusField & right);
int operator==(const G4PionMinusField & right) const;
int operator!=(const G4PionMinusField & right) const;
public:
virtual G4double GetField(const G4ThreeVector & aPosition);
virtual G4double GetBarrier();
virtual G4double GetCoeff() { return theCoeff; }
private:
G4double theCoeff;
};
#endif
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class header file
//
// CERN, Geneva, Switzerland
//
// File name: G4PionPlusField.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#ifndef G4PionPlusField_hh
#define G4PionPlusField_hh
#include "G4VNuclearField.hh"
#include "G4V3DNucleus.hh"
class G4PionPlusField: public G4VNuclearField
{
public:
G4PionPlusField(G4V3DNucleus * nucleus, G4double coeff = 0.042*fermi);
virtual ~G4PionPlusField();
private:
G4PionPlusField(const G4PionPlusField &right);
const G4PionPlusField & operator=(const G4PionPlusField & right);
int operator==(const G4PionPlusField & right) const;
int operator!=(const G4PionPlusField & right) const;
public:
virtual G4double GetField(const G4ThreeVector & aPosition);
virtual G4double GetBarrier();
virtual G4double GetCoeff() { return theCoeff; }
private:
G4double theCoeff;
};
#endif
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class header file
//
// CERN, Geneva, Switzerland
//
// File name: G4PionZeroField.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#ifndef G4PionZeroField_h
#define G4PionZeroField_h 1
#include "G4VNuclearField.hh"
#include "G4V3DNucleus.hh"
class G4PionZeroField: public G4VNuclearField
{
public:
G4PionZeroField(G4V3DNucleus * nucleus, G4double coeff = 0.042*fermi);
virtual ~G4PionZeroField();
private:
G4PionZeroField(const G4PionZeroField &right);
const G4PionZeroField & operator=(const G4PionZeroField & right);
int operator==(const G4PionZeroField & right) const;
int operator!=(const G4PionZeroField & right) const;
public:
virtual G4double GetField(const G4ThreeVector & aPosition);
virtual G4double GetBarrier();
virtual G4double GetCoeff() { return theCoeff; }
private:
G4double theCoeff;
};
#endif
@@ -0,0 +1,87 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class header file
//
// CERN, Geneva, Switzerland
//
// File name: G4ProtonField.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#ifndef G4ProtonField_h
#define G4ProtonField_h 1
#include "G4VNuclearField.hh"
#include "G4V3DNucleus.hh"
#include "G4FermiMomentum.hh"
#include "G4VNuclearDensity.hh"
#include "g4std/vector"
class G4ProtonField: public G4VNuclearField
{
public:
G4ProtonField(G4V3DNucleus * nucleus);
virtual ~G4ProtonField();
private:
G4ProtonField(const G4ProtonField &right);
const G4ProtonField & operator=(const G4ProtonField & right);
int operator==(const G4ProtonField & right) const;
int operator!=(const G4ProtonField & right) const;
public:
virtual G4double GetField(const G4ThreeVector & aPosition);
virtual G4double GetBarrier();
private:
G4double GetDensity(const G4ThreeVector & aPosition)
{
return theDensity->GetDensity(aPosition);
}
G4double GetFermiMomentum(const G4double aDensity)
{
return theFermi.GetFermiMomentum(aDensity);
}
G4double theA;
G4double theZ;
G4double theBarrier;
G4double theRadius;
G4FermiMomentum theFermi;
const G4VNuclearDensity * theDensity;
G4std::vector<G4double> theFermiMomBuffer;
};
#endif
@@ -0,0 +1,85 @@
//
// ********************************************************************
// * 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 G4RKFieldIntegrator_h
#define G4RKFieldIntegrator_h 1
#include "G4FieldPropagation.hh"
class G4RKFieldIntegrator : public G4FieldPropagation
{
public:
G4RKFieldIntegrator() {}
G4RKFieldIntegrator(const G4RKFieldIntegrator &right) {}
~G4RKFieldIntegrator() {}
//Operators
const G4RKFieldIntegrator & operator=(const G4RKFieldIntegrator &right) {return *this;}
int operator==(const G4RKFieldIntegrator &right) const {return 1;}
int operator!=(const G4RKFieldIntegrator &right) const {return 1;}
// only theActive are propagated, nothing else
// only theSpectators define the field, nothing else
void Transport(G4KineticTrackVector &theActive, const G4KineticTrackVector &theSpectators, G4double theTimeStep);
G4double GetExcitationEnergy(G4int nHitNucleons, const G4KineticTrackVector &theParticles);
// methods for calculating potentials for different types of particles
void Init(G4int z, G4int a) {theZ = z; theA = a;} // prepare potentials' functions
// aPosition is relative to the nucleus center
G4double GetNeutronPotential(G4double radius);
G4double GetNeutronPotential(G4ThreeVector &aPosition) {return GetNeutronPotential(aPosition.mag());}
G4double GetProtonPotential(G4double radius);
G4double GetProtonPotential(G4ThreeVector &aPosition) {return GetProtonPotential(aPosition.mag());}
G4double GetAntiprotonPotential(G4double radius);
G4double GetAntiprotonPotential(G4ThreeVector &aPosition) {return GetAntiprotonPotential(aPosition.mag());};
G4double GetKaonPotential(G4double radius);
G4double GetKaonPotential(G4ThreeVector &aPosition) {return GetKaonPotential(aPosition.mag());}
G4double GetPionPotential(G4double radius);
G4double GetPionPotential(G4ThreeVector &aPosition) {return GetPionPotential(aPosition.mag());}
private:
void Integrate(const G4KineticTrackVector & theActive, G4double theTimeStep);
G4double CalculateTotalEnergy(const G4KineticTrackVector& Barions);
G4double Erf(G4double X);
// parameters to calculate potentials
G4int theA;
G4int theZ;
// Vc(A, Z) = 1.44 * Z /(r0*(1 + pow(A, 1/3)))
// = colomb * Z / (1 + pow(A, 1/3))
static const G4double coulomb; // coulomb barier constant
static const G4double a_kaon; // kaon's potential constant
static const G4double a_pion; // pion's potential constant
static const G4double a_antiproton; // antiproton's potential constant
};
#endif // G4RKFieldIntegrator_h
@@ -0,0 +1,125 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// 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
#include "G4VFieldPropagation.hh"
#include "G4VNuclearField.hh"
#include "G4V3DNucleus.hh"
#include "G4KM_DummyField.hh"
#include "G4Mag_EqRhs.hh"
#include "g4std/map"
class G4RKPropagation: public G4VFieldPropagation
{
public:
G4RKPropagation();
virtual ~G4RKPropagation();
private:
G4RKPropagation(const G4RKPropagation &right);
const G4RKPropagation & operator=(const G4RKPropagation & right);
G4int operator==(const G4RKPropagation & right) const;
G4int operator!=(const G4RKPropagation & right) const;
public:
virtual void Init(G4V3DNucleus * nucleus);
virtual void Transport(G4KineticTrackVector &theActive,
const G4KineticTrackVector &theSpectators,
G4double theTimeStep);
G4bool GetSphereIntersectionTimes(const G4KineticTrack * track,
G4double & t1, G4double & t2);
private:
G4double theOuterRadius;
G4V3DNucleus * theNucleus;
G4std::map <G4int, G4VNuclearField *, G4std::less<G4int> > * theFieldMap;
G4std::map <G4int, G4Mag_EqRhs *, G4std::less<G4int> > * theEquationMap;
G4KM_DummyField * theField;
G4bool GetSphereIntersectionTimes(const G4double radius,
const G4ThreeVector & currentPos,
const G4LorentzVector & momentum,
G4double & t1, G4double & t2);
// implementation
G4bool FieldTransport(G4KineticTrack * track, const G4double timestep);
G4bool FreeTransport(G4KineticTrack * track, const G4double timestep);
void delete_FieldsAndMap(
G4std::map <G4int, G4VNuclearField *, G4std::less<G4int> > * aMap);
void delete_EquationsAndMap(
G4std::map <G4int, G4Mag_EqRhs *, G4std::less<G4int> > * aMap);
public:
inline G4double GetBarrier(G4int encoding)
{
G4std::map <G4int, G4VNuclearField *, G4std::less<G4int> >::iterator iter;
iter = theFieldMap->find(encoding);
if(iter == theFieldMap->end()) return 0;
return (*theFieldMap)[encoding]->GetBarrier();
}
inline G4double GetField(G4int encoding,G4ThreeVector pos)
{
G4std::map <G4int, G4VNuclearField *, G4std::less<G4int> >::iterator iter;
iter = theFieldMap->find(encoding);
if(iter == theFieldMap->end()) return 0;
return (*theFieldMap)[encoding]->GetField(pos);
}
};
#endif
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class header file
//
// CERN, Geneva, Switzerland
//
// File name: G4SigmaMinusField.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#ifndef G4SigmaMinusField_h
#define G4SigmaMinusField_h 1
#include "G4VNuclearField.hh"
class G4SigmaMinusField: public G4VNuclearField
{
public:
G4SigmaMinusField(G4V3DNucleus * nucleus, G4double coeff = 0.36*fermi);
virtual ~G4SigmaMinusField();
private:
G4SigmaMinusField(const G4SigmaMinusField &right);
const G4SigmaMinusField & operator=(const G4SigmaMinusField & right);
int operator==(const G4SigmaMinusField & right) const;
int operator!=(const G4SigmaMinusField & right) const;
public:
virtual G4double GetField(const G4ThreeVector & aPosition);
virtual G4double GetBarrier();
virtual G4double GetCoeff() { return theCoeff; }
private:
G4double theCoeff;
};
#endif
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// 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
#include "G4VNuclearField.hh"
class G4SigmaPlusField: public G4VNuclearField
{
public:
G4SigmaPlusField(G4V3DNucleus * nucleus, G4double coeff = 0.36*fermi);
virtual ~G4SigmaPlusField();
private:
G4SigmaPlusField(const G4SigmaPlusField &right);
const G4SigmaPlusField & operator=(const G4SigmaPlusField & right);
int operator==(const G4SigmaPlusField & right) const;
int operator!=(const G4SigmaPlusField & right) const;
public:
virtual G4double GetField(const G4ThreeVector & aPosition);
virtual G4double GetBarrier();
virtual G4double GetCoeff() { return theCoeff; }
private:
G4double theCoeff;
};
#endif
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class header file
//
// CERN, Geneva, Switzerland
//
// File name: G4SigmaZeroField.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#ifndef G4SigmaZeroField_h
#define G4SigmaZeroField_h 1
#include "G4VNuclearField.hh"
class G4SigmaZeroField: public G4VNuclearField
{
public:
G4SigmaZeroField(G4V3DNucleus * nucleus, G4double coeff = 0.36*fermi);
virtual ~G4SigmaZeroField();
private:
G4SigmaZeroField(const G4SigmaZeroField &right);
const G4SigmaZeroField & operator=(const G4SigmaZeroField & right);
int operator==(const G4SigmaZeroField & right) const;
int operator!=(const G4SigmaZeroField & right) const;
public:
virtual G4double GetField(const G4ThreeVector & aPosition);
virtual G4double GetBarrier();
virtual G4double GetCoeff() { return theCoeff; }
private:
G4double theCoeff;
};
#endif
@@ -0,0 +1,66 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// 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
#include "G4KineticTrackVector.hh"
#include "G4V3DNucleus.hh"
class G4VFieldPropagation
{
public:
G4VFieldPropagation();
virtual ~G4VFieldPropagation();
private:
G4VFieldPropagation(const G4VFieldPropagation &right);
const G4VFieldPropagation & operator=(const G4VFieldPropagation & right);
G4int operator==(const G4VFieldPropagation & right) const;
G4int operator!=(const G4VFieldPropagation & right) const;
public:
virtual void Init(G4V3DNucleus * theNucleus) = 0;
virtual void Transport(G4KineticTrackVector &theActive,
const G4KineticTrackVector &theSpectators,
G4double theTimeStep) = 0;
};
#endif
@@ -0,0 +1,59 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class header file
//
// CERN, Geneva, Switzerland
//
// File name: G4VKM_NuclearDensity.hh
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#ifndef G4VKM_NuclearDensity_hh
#define G4VKM_NuclearDensity_hh
#include "globals.hh"
#include "G4ThreeVector.hh"
class G4VKM_NuclearDensity
{
public:
G4VKM_NuclearDensity();
virtual ~G4VKM_NuclearDensity();
virtual G4double GetDensity(const G4ThreeVector & point) = 0;
virtual G4double GetDeriv(const G4ThreeVector & point) = 0;
};
inline G4VKM_NuclearDensity::G4VKM_NuclearDensity()
{ }
inline G4VKM_NuclearDensity::~G4VKM_NuclearDensity()
{ }
#endif
@@ -0,0 +1,76 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// 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
#include "globals.hh"
#include "G4ThreeVector.hh"
#include "G4V3DNucleus.hh"
class G4VNuclearField
{
public:
G4VNuclearField(G4V3DNucleus * aNucleus = 0);
virtual ~G4VNuclearField();
void SetNucleus(G4V3DNucleus * aNucleus);
virtual G4double GetField(const G4ThreeVector & aPosition) = 0;
virtual G4double GetBarrier() = 0;
virtual G4double GetCoeff() { return 0; }
protected:
G4V3DNucleus * theNucleus;
const G4double radius;
private:
G4VNuclearField(const G4VNuclearField &right);
const G4VNuclearField & operator=(const G4VNuclearField & right);
G4int operator==(const G4VNuclearField & right) const;
G4int operator!=(const G4VNuclearField & right) const;
};
inline void G4VNuclearField::SetNucleus(G4V3DNucleus * aNucleus)
{
theNucleus = aNucleus;
}
#endif
@@ -0,0 +1,289 @@
//
// ********************************************************************
// * 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 "G4Absorber.hh"
#include "G4KineticTrack.hh"
#include "G4PionPlus.hh"
#include "G4PionMinus.hh"
#include "G4PionZero.hh"
#include "G4Proton.hh"
#include "G4Neutron.hh"
#include "G4LorentzRotation.hh"
G4Absorber::G4Absorber(G4double cutOnP)
{
theCutOnP = cutOnP;
theAbsorbers = new G4KineticTrackVector;
theProducts = new G4KineticTrackVector;
}
G4Absorber::~G4Absorber()
{
delete theAbsorbers;
delete theProducts;
}
bool G4Absorber::WillBeAbsorbed(const G4KineticTrack & kt)
{
// FixMe: actually only for pions
// if(kt.Get4Momentum().vect().mag() < theCutOnP)
// Cut on kinetic Energy...
if (kt.Get4Momentum().e() - kt.GetActualMass() < theCutOnP)
{
if(kt.GetDefinition() == G4PionPlus::PionPlus() ||
kt.GetDefinition() == G4PionZero::PionZero() ||
kt.GetDefinition() == G4PionMinus::PionMinus())
{
return true;
}
}
return false;
}
G4bool G4Absorber::Absorb(G4KineticTrack & kt, G4KineticTrackVector & tgt)
{
if(!FindAbsorbers(kt, tgt))
return false;
return FindProducts(kt);
}
G4bool G4Absorber::FindAbsorbers(G4KineticTrack & kt,
G4KineticTrackVector & tgt)
{
G4KineticTrack * kt1 = NULL;
G4KineticTrack * kt2 = NULL;
G4double dist1 = DBL_MAX;
G4double dist2 = DBL_MAX;
G4double charge1 = 0;
G4double charge2 = 0;
G4double charge0 = kt.GetDefinition()->GetPDGCharge();
G4ThreeVector pos = kt.GetPosition();
G4std::vector<G4KineticTrack *>::iterator iter;
for(iter = tgt.begin(); iter != tgt.end(); ++iter)
{
G4KineticTrack * curr = *iter;
G4double dist = (pos-curr->GetPosition()).mag();
if(dist >= dist2)
continue;
if(dist < dist1)
{
if(dist1 == DBL_MAX) // accept the candidate
{
kt1 = curr;
charge1 = kt1->GetDefinition()->GetPDGCharge();
dist1 = dist;
continue;
}
if(dist2 == DBL_MAX) // accept the candidate put kt1 in kt2
{
kt2 = kt1;
charge2 = charge1;
dist2 = dist1;
kt1 = curr;
charge1 = kt1->GetDefinition()->GetPDGCharge();
dist1 = dist;
continue;
}
// test the compatibility with charge conservation
G4double charge = curr->GetDefinition()->GetPDGCharge();
if((charge0+charge1+charge < 0.) ||
(charge0+charge1+charge) > 2*eplus)
{ // incomatible: change kt1 with curr.
kt1 = curr;
charge1 = charge;
dist1 = dist;
}
else
{ // compatible: change kt1 with curr and kt2 with kt1
kt2 = kt1;
charge2 = charge1;
dist2 = dist1;
kt1 = curr;
charge1 = charge;
dist1 = dist;
}
continue;
}
// here if dist1 < dist < dist2
if(dist2 == DBL_MAX) // accept the candidate
{
kt2 = curr;
charge2 = kt2->GetDefinition()->GetPDGCharge();
dist2 = dist;
continue;
}
// test the compatibility with charge conservation
G4double charge = curr->GetDefinition()->GetPDGCharge();
if((charge0+charge1+charge < 0.) ||
(charge0+charge1+charge) > 2*eplus)
continue; // incomatible: do nothing
// compatible: change kt2 with curr
kt2 = curr;
charge2 = charge;
dist2 = dist;
}
theAbsorbers->clear(); // do not delete tracks in theAbsorbers vector!
if((kt1 == NULL) || (kt2 == NULL))
return false;
theAbsorbers->push_back(kt1);
theAbsorbers->push_back(kt2);
return true;
}
G4bool G4Absorber::FindProducts(G4KineticTrack & kt)
{
// Choose the products type
G4ParticleDefinition * prod1;
G4ParticleDefinition * prod2;
G4KineticTrack * abs1 = (*theAbsorbers)[0];
G4KineticTrack * abs2 = (*theAbsorbers)[1];
G4double charge = kt.GetDefinition()->GetPDGCharge();
if(charge == eplus)
{ // a neutron become proton
prod1 = G4Proton::Proton();
if(abs1->GetDefinition() == G4Neutron::Neutron())
prod2 = abs2->GetDefinition();
else
prod2 = G4Proton::Proton();
}
else if(charge == -eplus)
{ // a proton become neutron
prod1 = G4Neutron::Neutron();
if(abs1->GetDefinition() == G4Proton::Proton())
prod2 = abs2->GetDefinition();
else
prod2 = G4Neutron::Neutron();
}
else // charge = 0: leave particle types unchenged
{
prod1 = abs1->GetDefinition();
prod2 = abs2->GetDefinition();
}
// Translate to the CMS frame
G4LorentzVector momLab = kt.Get4Momentum()+abs1->Get4Momentum()+
abs2->Get4Momentum();
G4LorentzRotation toCMSFrame((-1)*momLab.boostVector());
G4LorentzRotation toLabFrame(momLab.boostVector());
G4LorentzVector momCMS = toCMSFrame*momLab;
// Evaluate the final momentum of products
G4double m1 = prod1->GetPDGMass();
G4double m2 = prod2->GetPDGMass();
G4double e0 = momCMS.e();
G4double squareP = (e0*e0*e0*e0-2*e0*e0*(m1*m1+m2*m2)+
(m2*m2-m1*m1)*(m2*m2-m1*m1))/(4*e0*e0);
// if(squareP < 0) // should never happen
// squareP = 0;
G4ThreeVector mom1CMS = GetRandomDirection();
mom1CMS = sqrt(squareP)*mom1CMS;
G4LorentzVector final4Mom1CMS(mom1CMS, sqrt(squareP+m1*m1));
G4LorentzVector final4Mom2CMS((-1)*mom1CMS, sqrt(squareP+m2*m2));
// Go back to the lab frame
G4LorentzVector mom1 = toLabFrame*final4Mom1CMS;
G4LorentzVector mom2 = toLabFrame*final4Mom2CMS;
// ------ debug
/*
G4LorentzVector temp = mom1+mom2;
cout << (1/MeV)*momLab.x() << " " << (1/MeV)*momLab.y() << " "
<< (1/MeV)*momLab.z() << " " << (1/MeV)*momLab.t() << " "
<< (1/MeV)*momLab.vect().mag() << " " << (1/MeV)*momLab.mag() << " "
<< (1/MeV)*temp.x() << " " << (1/MeV)*temp.y() << " "
<< (1/MeV)*temp.z() << " " << (1/MeV)*temp.t() << " "
<< (1/MeV)*temp.vect().mag() << " " << (1/MeV)*temp.mag() << " "
<< (1/MeV)*sqrt(squareP) << endl;
*/
// ------ end debug
// Build two new kinetic tracks and add to products
G4KineticTrack * kt1 = new G4KineticTrack(prod1, 0., abs1->GetPosition(),
mom1);
G4KineticTrack * kt2 = new G4KineticTrack(prod2, 0., abs2->GetPosition(),
mom2);
// ------ debug
/*
G4LorentzVector initialMom1 = abs1->Get4Momentum();
G4LorentzVector initialMom2 = abs2->Get4Momentum();
G4LorentzVector pion4MomCMS = toCMSFrame*kt.Get4Momentum();
cout << (1/MeV)*initialMom1.x() << " " << (1/MeV)*initialMom1.y() << " "
<< (1/MeV)*initialMom1.z() << " " << (1/MeV)*initialMom1.e() << " "
<< (1/MeV)*initialMom1.vect().mag() << " "
<< (1/MeV)*initialMom2.x() << " " << (1/MeV)*initialMom2.y() << " "
<< (1/MeV)*initialMom2.z() << " " << (1/MeV)*initialMom2.e() << " "
<< (1/MeV)*initialMom2.vect().mag() << " "
<< (1/MeV)*mom1.x() << " " << (1/MeV)*mom1.y() << " "
<< (1/MeV)*mom1.z() << " " << (1/MeV)*mom1.e() << " "
<< (1/MeV)*mom1.vect().mag() << " "
<< (1/MeV)*mom2.x() << " " << (1/MeV)*mom2.y() << " "
<< (1/MeV)*mom2.z() << " " << (1/MeV)*mom2.e() << " "
<< (1/MeV)*mom2.vect().mag() << " "
<< (1/MeV)*pion4MomCMS.x() << " " << (1/MeV)*pion4MomCMS.y() << " "
<< (1/MeV)*pion4MomCMS.z() << " " << (1/MeV)*pion4MomCMS.e() << " "
<< (1/MeV)*pion4MomCMS.vect().mag() << " "
<< (1/MeV)*final4Mom1CMS.x() << " " << (1/MeV)*final4Mom1CMS.y() << " "
<< (1/MeV)*final4Mom1CMS.z() << " " << (1/MeV)*final4Mom1CMS.e() << " "
<< (1/MeV)*final4Mom1CMS.vect().mag() << " "
<< (1/MeV)*final4Mom2CMS.x() << " " << (1/MeV)*final4Mom2CMS.y() << " "
<< (1/MeV)*final4Mom2CMS.z() << " " << (1/MeV)*final4Mom2CMS.e() << " "
<< (1/MeV)*final4Mom2CMS.vect().mag() << endl;
*/
// ------ end debug
theProducts->clear();
theProducts->push_back(kt1);
theProducts->push_back(kt2);
return true;
}
G4ThreeVector G4Absorber::GetRandomDirection()
{
G4double theta = 2.0*G4UniformRand()-1.0;
theta = acos(theta);
G4double phi = G4UniformRand()*2*pi;
G4ThreeVector direction(sin(theta)*cos(phi), sin(theta)*sin(phi), cos(theta));
return direction;
}
@@ -0,0 +1,108 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
//
// CERN, Geneva, Switzerland
//
// File name: G4AntiProtonField.cc
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#include "G4AntiProtonField.hh"
#include "G4NucleiPropertiesTable.hh"
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4ParticleDefinition.hh"
#include "G4AntiProton.hh"
G4AntiProtonField::G4AntiProtonField(G4V3DNucleus * nucleus, G4double coeff)
: G4VNuclearField(nucleus)
{
theCoeff = coeff;
}
G4AntiProtonField::~G4AntiProtonField()
{ }
const G4AntiProtonField & G4AntiProtonField::operator=(const G4AntiProtonField & right)
{
G4Exception("G4AntiProtonField::operator= meant not to be accessible");
return *this;
}
G4int G4AntiProtonField::operator==(const G4AntiProtonField & right) const
{
G4Exception("G4AntiProtonField::operator== meant not to be accessible");
return 0;
}
G4int G4AntiProtonField::operator!=(const G4AntiProtonField & right) const
{
G4Exception("G4AntiProtonField::operator!= meant not to be accessible");
return 1;
}
G4double G4AntiProtonField::GetField(const G4ThreeVector & aPosition)
{
// Field is 0 out of the nucleus!
if(aPosition.mag() >= radius) return 0.0;
G4ParticleDefinition *anAntiProton = G4AntiProton::AntiProtonDefinition();
G4double antiProtonMass = anAntiProton->GetPDGMass();
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = antiProtonMass*nucleusMass/(antiProtonMass+nucleusMass);
G4double density = theNucleus->GetNuclearDensity()->GetDensity(aPosition);
return -2.*pi*hbarc*hbarc/reducedMass*(2.0)*theCoeff*density+GetBarrier();
}
G4double G4AntiProtonField::GetBarrier()
{
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double coulombBarrier = (1.44/1.14) * MeV * Z / (1.0 + pow(A,1./3.));
return -coulombBarrier;
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,39 @@
//
// ********************************************************************
// * 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 "G4FieldPropagation.hh"
const G4FieldPropagation & G4FieldPropagation::operator=(const G4FieldPropagation &right)
{
G4Exception("G4FieldPropagation::operator= meant to be private");
return *this;
}
int G4FieldPropagation::operator==(const G4FieldPropagation &right) const
{
return 1;
}
int G4FieldPropagation::operator!=(const G4FieldPropagation &right) const
{
return 0;
}
@@ -14,7 +14,7 @@
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * authors in the GEANT4 collaboration. *
// * 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. *
@@ -0,0 +1,107 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
//
// CERN, Geneva, Switzerland
//
// File name: G4KM_NucleonEqRhs.cc
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#include "G4KM_NucleonEqRhs.hh"
#include "G4NucleiPropertiesTable.hh"
#include "G4VNuclearDensity.hh"
G4KM_NucleonEqRhs::G4KM_NucleonEqRhs(G4KM_DummyField *field,
G4V3DNucleus * nucleus) :
G4Mag_EqRhs(field), theNucleus(nucleus)
{
theMass = 0.;
A = theNucleus->GetMassNumber();
factor = hbarc*hbarc*pow(3.*pi2*A,2./3.)/3.;
}
void G4KM_NucleonEqRhs::EvaluateRhsGivenB(const G4double y[],
const G4double B[3],
G4double dydx[]) const
{
G4double yMod = sqrt(y[0]*y[0]+y[1]*y[1]+y[2]*y[2]);
G4double e = sqrt(theMass*theMass+y[3]*y[3]+y[4]*y[4]+y[5]*y[5]);
// y[0..2] is position
// y[3..5] is momentum (and not mom.direction)
dydx[0] = c_light*y[3]/e; //
dydx[1] = c_light*y[4]/e; // dq/dt=dH/dp = c*p/e
dydx[2] = c_light*y[5]/e; //
/*
* // debug
* G4cout << " Nucleon RHS : 0..2(dpos/dt) " <<
* dydx[0] << " " <<
* dydx[1] << " " <<
* dydx[2] << " " << G4endl;
*/
// V=K*rho(r) ==> dydx[3] = -dV/dr*dr/dx = -K*d(rho)/dr*dr/dx.
// GF should be V=K*rho(r) ==> dydx[3] = -dV/dr*dr/dx = -K*d(rho)/dr*dr/dt
// GF and dV/dt = dE/dt ==> dp/dt = dE/dt * dp/dE = dE/dt *e/p
// Idem for dydx[4] and dydx[5]
G4ThreeVector pos(y[0],y[1],y[2]);
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);
// dydx[3] = yMod == 0 ? 0 : -deriv*y[0]/yMod;
// dydx[4] = yMod == 0 ? 0 : -deriv*y[1]/yMod;
// dydx[5] = yMod == 0 ? 0 : -deriv*y[2]/yMod;
dydx[3] = yMod == 0 ? 0 : deriv*y[0]/yMod*c_light;
dydx[4] = yMod == 0 ? 0 : deriv*y[1]/yMod*c_light;
dydx[5] = yMod == 0 ? 0 : deriv*y[2]/yMod*c_light;
/*
* // debug
* G4cout << " Nucleon RHS : 3..5(dE/dt) " <<
* dydx[3] << " " <<
* dydx[4] << " " <<
* dydx[5] << " " << G4endl;
*/
}
@@ -0,0 +1,91 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
//
// CERN, Geneva, Switzerland
//
// File name: G4KM_OpticalEqRhs.cc
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#include "G4KM_OpticalEqRhs.hh"
#include "G4NucleiPropertiesTable.hh"
#include "G4VNuclearDensity.hh"
G4KM_OpticalEqRhs::G4KM_OpticalEqRhs(G4KM_DummyField *field,
G4V3DNucleus * nucleus) :
G4Mag_EqRhs(field), theNucleus(nucleus)
{
theFactor = 0;
theMass = 0;
}
void G4KM_OpticalEqRhs::SetFactor(G4double mass, G4double opticalParameter)
{
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = mass*nucleusMass/(mass+nucleusMass);
G4double nucleonMass = (proton_mass_c2+neutron_mass_c2)/2;
// _factor in (MeV*fermi)*fermi/MeV = fermi*fermi -- need to have A as density normalized to 1
theFactor = 2*pi*hbarc*hbarc*(1+mass/nucleonMass)* opticalParameter/reducedMass * A;
theMass = mass;
}
void G4KM_OpticalEqRhs::EvaluateRhsGivenB(const G4double y[], const G4double B[3],
G4double dydx[]) const
{
G4double yMod = sqrt(y[0]*y[0]+y[1]*y[1]+y[2]*y[2]);
G4double e = sqrt(theMass*theMass+y[3]*y[3]+y[4]*y[4]+y[5]*y[5]);
dydx[0] = c_light*y[3]/e; //
dydx[1] = c_light*y[4]/e; // dq/dt=dH/dp = c*p/e
dydx[2] = c_light*y[5]/e; //
// V=K*rho(r) ==> dydx[3] = -dV/dr*dr/dx = -K*d(rho)/dr*dr/dx.
// Idem for dydx[4] and dydx[5]
const G4VNuclearDensity * nuclearDensity=theNucleus->GetNuclearDensity();
G4ThreeVector pos(y[0],y[1],y[2]);
G4double deriv = theFactor*nuclearDensity->GetDeriv(pos);
dydx[3] = yMod == 0 ? 0 : -deriv*y[0]/yMod*c_light;
dydx[4] = yMod == 0 ? 0 : -deriv*y[1]/yMod*c_light;
dydx[5] = yMod == 0 ? 0 : -deriv*y[2]/yMod*c_light;
}
@@ -0,0 +1,100 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
//
// CERN, Geneva, Switzerland
//
// File name: G4KaonMinusField.cc
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#include "G4KaonMinusField.hh"
#include "G4NucleiPropertiesTable.hh"
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4KaonMinus.hh"
G4KaonMinusField::G4KaonMinusField(G4V3DNucleus * nucleus, G4double coeff)
: G4VNuclearField(nucleus)
{
theCoeff = coeff;
}
G4KaonMinusField::~G4KaonMinusField()
{ }
const G4KaonMinusField & G4KaonMinusField::operator=(const G4KaonMinusField & right)
{
G4Exception("G4KaonMinusField::operator= meant not to be accessible");
return *this;
}
G4int G4KaonMinusField::operator==(const G4KaonMinusField & right) const
{
G4Exception("G4KaonMinusField::operator== meant not to be accessible");
return 0;
}
G4int G4KaonMinusField::operator!=(const G4KaonMinusField & right) const
{
G4Exception("G4KaonMinusField::operator!= meant not to be accessible");
return 1;
}
G4double G4KaonMinusField::GetField(const G4ThreeVector & aPosition)
{
// Field is 0 out of the nucleus!
if(aPosition.mag() >= radius) return 0.0;
G4double kaonMass = G4KaonMinus::KaonMinus()->GetPDGMass();
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = kaonMass*nucleusMass/(kaonMass+nucleusMass);
G4double density = theNucleus->GetNuclearDensity()->GetDensity(aPosition);
return -2.*pi*hbarc*hbarc/reducedMass*(2.0)*theCoeff*density+GetBarrier();
}
G4double G4KaonMinusField::GetBarrier()
{
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double coulombBarrier = (1.44/1.14) * MeV * Z / (1.0 + pow(A,1./3.));
return -coulombBarrier;
}
@@ -0,0 +1,100 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
//
// CERN, Geneva, Switzerland
//
// File name: G4KaonPlusField.cc
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#include "G4KaonPlusField.hh"
#include "G4NucleiPropertiesTable.hh"
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4KaonPlus.hh"
G4KaonPlusField::G4KaonPlusField(G4V3DNucleus * nucleus, G4double coeff)
: G4VNuclearField(nucleus)
{
theCoeff = coeff;
}
G4KaonPlusField::~G4KaonPlusField()
{ }
const G4KaonPlusField & G4KaonPlusField::operator=(const G4KaonPlusField & right)
{
G4Exception("G4KaonPlusField::operator= meant not to be accessible");
return *this;
}
G4int G4KaonPlusField::operator==(const G4KaonPlusField & right) const
{
G4Exception("G4KaonPlusField::operator== meant not to be accessible");
return 0;
}
G4int G4KaonPlusField::operator!=(const G4KaonPlusField & right) const
{
G4Exception("G4KaonPlusField::operator!= meant not to be accessible");
return 1;
}
G4double G4KaonPlusField::GetField(const G4ThreeVector & aPosition)
{
// Field is 0 out of the nucleus!
if(aPosition.mag() >= radius) return 0.0;
G4double kaonMass = G4KaonPlus::KaonPlus()->GetPDGMass();
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = kaonMass*nucleusMass/(kaonMass+nucleusMass);
G4double density = theNucleus->GetNuclearDensity()->GetDensity(aPosition);
return -2.*pi*hbarc*hbarc/reducedMass*(2.0)*theCoeff*density+GetBarrier();
}
G4double G4KaonPlusField::GetBarrier()
{
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double coulombBarrier = (1.44/1.14) * MeV * Z / (1.0 + pow(A,1./3.));
return coulombBarrier;
}
@@ -0,0 +1,100 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
//
// CERN, Geneva, Switzerland
//
// File name: G4KaonZeroField.cc
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#include "G4KaonZeroField.hh"
#include "G4NucleiPropertiesTable.hh"
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4KaonZero.hh"
G4KaonZeroField::G4KaonZeroField(G4V3DNucleus * nucleus, G4double coeff)
: G4VNuclearField(nucleus)
{
theCoeff = coeff;
}
G4KaonZeroField::~G4KaonZeroField()
{ }
const G4KaonZeroField & G4KaonZeroField::operator=(const G4KaonZeroField & right)
{
G4Exception("G4KaonZeroField::operator= meant not to be accessible");
return *this;
}
G4int G4KaonZeroField::operator==(const G4KaonZeroField & right) const
{
G4Exception("G4KaonZeroField::operator== meant not to be accessible");
return 0;
}
G4int G4KaonZeroField::operator!=(const G4KaonZeroField & right) const
{
G4Exception("G4KaonZeroField::operator!= meant not to be accessible");
return 1;
}
G4double G4KaonZeroField::GetField(const G4ThreeVector & aPosition)
{
// Field is 0 out of the nucleus!
if(aPosition.mag() >= radius) return 0.0;
G4double kaonMass = G4KaonZero::KaonZero()->GetPDGMass();
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = kaonMass*nucleusMass/(kaonMass+nucleusMass);
G4double density = theNucleus->GetNuclearDensity()->GetDensity(aPosition);
return -2.*pi*hbarc*hbarc/reducedMass*(2.0)*theCoeff*density;
}
G4double G4KaonZeroField::GetBarrier()
{
return 0;
}
@@ -0,0 +1,128 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
//
// CERN, Geneva, Switzerland
//
// File name: G4NeutronField.cc
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#include "G4NeutronField.hh"
#include "G4NucleiPropertiesTable.hh"
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
G4NeutronField::G4NeutronField(G4V3DNucleus * aNucleus) :
G4VNuclearField(aNucleus), theDensity(theNucleus->GetNuclearDensity())
{
theA = theNucleus->GetMassNumber();
theZ = theNucleus->GetCharge();
theFermi.Init(theA, theZ);
theR = 2.*theNucleus->GetOuterRadius();
G4double aR=0;
while(aR<theR)
{
G4ThreeVector aPosition(0,0,aR);
G4double density = GetDensity(aPosition);
G4double fermiMom = GetFermiMomentum(density);
theFermiMomBuffer.push_back(fermiMom);
aR+=0.3*fermi;
}
{
G4ThreeVector aPosition(0,0,theR);
G4double density = GetDensity(aPosition);
G4double fermiMom = GetFermiMomentum(density);
theFermiMomBuffer.push_back(fermiMom);
}
{
G4ThreeVector aPosition(0,0,theR+0.001*fermi);
theFermiMomBuffer.push_back(0);
}
{
G4ThreeVector aPosition(0,0,1.*m);
theFermiMomBuffer.push_back(0);
}
}
G4NeutronField::~G4NeutronField()
{ }
const G4NeutronField & G4NeutronField::operator=(const G4NeutronField & right)
{
G4Exception("G4NeutronField::operator= meant not to be accessible");
return *this;
}
G4int G4NeutronField::operator==(const G4NeutronField & right) const
{
G4Exception("G4NeutronField::operator== meant not to be accessible");
return 0;
}
G4int G4NeutronField::operator!=(const G4NeutronField & right) const
{
G4Exception("G4NeutronField::operator!= meant not to be accessible");
return 1;
}
G4double G4NeutronField::GetField(const G4ThreeVector & aPosition)
{
G4double x = aPosition.mag();
G4int index = static_cast<G4int>(x/(0.3*fermi) );
if(index+2>theFermiMomBuffer.size()) return theFermiMomBuffer.back();
G4double y1 = theFermiMomBuffer[index];
G4double y2 = theFermiMomBuffer[index+1];
G4double x1 = (0.3*fermi)*index;
G4double x2 = (0.3*fermi)*(index+1);
G4double fermiMom = y1 + (x-x1)*(y2-y1)/(x2-x1);
return -1*(fermiMom*fermiMom)/(2*neutron_mass_c2);
}
G4double G4NeutronField::GetBarrier()
{
/*
* G4double A = theNucleus->GetMassNumber();
* G4double Z = theNucleus->GetCharge();
*
* return G4NucleiPropertiesTable::GetBindingEnergy(Z, A)/A;
*/
return 0.;
}
@@ -0,0 +1,114 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
//
// CERN, Geneva, Switzerland
//
// File name: G4PionMinusField.cc
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#include "G4PionMinusField.hh"
#include "G4NucleiPropertiesTable.hh"
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4PionMinus.hh"
G4PionMinusField::G4PionMinusField(G4V3DNucleus * nucleus, G4double coeff)
: G4VNuclearField(nucleus)
{
theCoeff = coeff;
}
G4PionMinusField::~G4PionMinusField()
{ }
const G4PionMinusField & G4PionMinusField::operator=(const G4PionMinusField & right)
{
G4Exception("G4PionMinusField::operator= meant not to be accessible");
return *this;
}
G4int G4PionMinusField::operator==(const G4PionMinusField & right) const
{
G4Exception("G4PionMinusField::operator== meant not to be accessible");
return 0;
}
G4int G4PionMinusField::operator!=(const G4PionMinusField & right) const
{
G4Exception("G4PionMinusField::operator!= meant not to be accessible");
return 1;
}
G4double G4PionMinusField::GetField(const G4ThreeVector & aPosition)
{
// Field is 0 out of the nucleus!
if(aPosition.mag() >= radius) return 0.0;
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double pionMinusMass = G4PionMinus::PionMinus()->GetPDGMass();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = pionMinusMass*nucleusMass/(pionMinusMass+nucleusMass);
G4double density = A*theNucleus->GetNuclearDensity()->GetDensity(aPosition);
G4double nucleonMass = (proton_mass_c2+neutron_mass_c2)/2;
return 2.*pi*hbarc*hbarc/reducedMass*(1+pionMinusMass/nucleonMass)*theCoeff*density + GetBarrier();
}
G4double G4PionMinusField::GetBarrier()
{
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double coulombBarrier = (1.44/1.14) * MeV * Z / (1.0 + pow(A,1./3.));
return -coulombBarrier;
}
@@ -0,0 +1,100 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
//
// CERN, Geneva, Switzerland
//
// File name: G4PionPlusField.cc
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#include "G4PionPlusField.hh"
#include "G4NucleiPropertiesTable.hh"
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4PionPlus.hh"
G4PionPlusField::G4PionPlusField(G4V3DNucleus * nucleus, G4double coeff)
: G4VNuclearField(nucleus)
{
theCoeff = coeff;
}
G4PionPlusField::~G4PionPlusField()
{ }
const G4PionPlusField & G4PionPlusField::operator=(const G4PionPlusField & right)
{
G4Exception("G4PionPlusField::operator= meant not to be accessible");
return *this;
}
G4int G4PionPlusField::operator==(const G4PionPlusField & right) const
{
G4Exception("G4PionPlusField::operator== meant not to be accessible");
return 0;
}
G4int G4PionPlusField::operator!=(const G4PionPlusField & right) const
{
G4Exception("G4PionPlusField::operator!= meant not to be accessible");
return 1;
}
G4double G4PionPlusField::GetField(const G4ThreeVector & aPosition)
{
// Field is 0 out of the nucleus!
if(aPosition.mag() >= radius) return 0.0;
G4double pionPlusMass = G4PionPlus::PionPlus()->GetPDGMass();
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = pionPlusMass*nucleusMass/(pionPlusMass+nucleusMass);
G4double density = A*theNucleus->GetNuclearDensity()->GetDensity(aPosition);
G4double nucleonMass = (proton_mass_c2+neutron_mass_c2)/2;
return 2.*pi*hbarc*hbarc/reducedMass*(1+pionPlusMass/nucleonMass)*theCoeff*density + GetBarrier();
}
G4double G4PionPlusField::GetBarrier()
{
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double coulombBarrier = (1.44/1.14) * MeV * Z / (1.0 + pow(A,1./3.));
return coulombBarrier;
}
@@ -0,0 +1,97 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
//
// CERN, Geneva, Switzerland
//
// File name: G4PionZeroField.cc
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#include "G4PionZeroField.hh"
#include "G4NucleiPropertiesTable.hh"
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4PionZero.hh"
G4PionZeroField::G4PionZeroField(G4V3DNucleus * nucleus, G4double coeff)
: G4VNuclearField(nucleus)
{
theCoeff = coeff;
}
G4PionZeroField::~G4PionZeroField()
{ }
const G4PionZeroField & G4PionZeroField::operator=(const G4PionZeroField & right)
{
G4Exception("G4PionZeroField::operator= meant not to be accessible");
return *this;
}
G4int G4PionZeroField::operator==(const G4PionZeroField & right) const
{
G4Exception("G4PionZeroField::operator== meant not to be accessible");
return 0;
}
G4int G4PionZeroField::operator!=(const G4PionZeroField & right) const
{
G4Exception("G4PionZeroField::operator!= meant not to be accessible");
return 1;
}
G4double G4PionZeroField::GetField(const G4ThreeVector & aPosition)
{
// Field is 0 out of the nucleus!
if(aPosition.mag() >= radius) return 0.0;
G4double pionZeroMass = G4PionZero::PionZero()->GetPDGMass();
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = pionZeroMass*nucleusMass/(pionZeroMass+nucleusMass);
G4double density = A*theNucleus->GetNuclearDensity()->GetDensity(aPosition);
G4double nucleonMass = (proton_mass_c2+neutron_mass_c2)/2;
return 2.*pi*hbarc*hbarc/reducedMass*(1+pionZeroMass/nucleonMass)*theCoeff*density;
}
G4double G4PionZeroField::GetBarrier()
{
return 0;
}
@@ -0,0 +1,130 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
//
// CERN, Geneva, Switzerland
//
// File name: G4ProtonField.cc
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#include "G4ProtonField.hh"
#include "G4NucleiPropertiesTable.hh"
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4V3DNucleus.hh"
G4ProtonField::G4ProtonField(G4V3DNucleus * aNucleus) :
G4VNuclearField(aNucleus), theDensity(theNucleus->GetNuclearDensity())
{
theA = theNucleus->GetMassNumber();
theZ = theNucleus->GetCharge();
theBarrier = GetBarrier();
theRadius = 2.*theNucleus->GetOuterRadius();
theFermi.Init(theA, theZ);
G4double aR=0;
while(aR<theRadius)
{
G4ThreeVector aPosition(0,0,aR);
G4double density = GetDensity(aPosition);
G4double fermiMom = GetFermiMomentum(density);
theFermiMomBuffer.push_back(fermiMom);
aR+=0.3*fermi;
}
{
G4ThreeVector aPosition(0,0,theRadius);
G4double density = GetDensity(aPosition);
G4double fermiMom = GetFermiMomentum(density);
theFermiMomBuffer.push_back(fermiMom);
}
{
G4ThreeVector aPosition(0,0,theRadius+0.001*fermi);
theFermiMomBuffer.push_back(0);
}
{
G4ThreeVector aPosition(0,0,1.*m);
theFermiMomBuffer.push_back(0);
}
}
G4ProtonField::~G4ProtonField()
{ }
const G4ProtonField & G4ProtonField::operator=(const G4ProtonField & right)
{
G4Exception("G4ProtonField::operator= meant not to be accessible");
return *this;
}
G4int G4ProtonField::operator==(const G4ProtonField & right) const
{
G4Exception("G4ProtonField::operator== meant not to be accessible");
return 0;
}
G4int G4ProtonField::operator!=(const G4ProtonField & right) const
{
G4Exception("G4ProtonField::operator!= meant not to be accessible");
return 1;
}
G4double G4ProtonField::GetField(const G4ThreeVector & aPosition)
{
//G4cout << " Fermi Potential " << (fermiMom*fermiMom)/(2*proton_mass_c2) <<G4endl;
G4double x = aPosition.mag();
G4int index = static_cast<G4int>(x/(0.3*fermi) );
if(index+2>theFermiMomBuffer.size()) return theFermiMomBuffer.back();
G4double y1 = theFermiMomBuffer[index];
G4double y2 = theFermiMomBuffer[index+1];
G4double x1 = (0.3*fermi)*index;
G4double x2 = (0.3*fermi)*(index+1);
G4double fermiMom = y1 + (x-x1)*(y2-y1)/(x2-x1);
G4double y = -1*(fermiMom*fermiMom)/(2*proton_mass_c2)+theBarrier;
// G4cout <<" Protonfield test "<<index<<" "<< x1<<" "<<y1<<" "<<x2<<" "<<y2<<" "<<x<<" "<<y<<" "<<theBarrier<<G4endl;
return y;
}
G4double G4ProtonField::GetBarrier()
{
G4double coulombBarrier = (1.44/1.14) * MeV * theZ / (1.0 + pow(theA,1./3.));
//GF G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double bindingEnergy =0;
/*
* G4cout << " coulombBarrier/bindingEnergy : "
* << coulombBarrier << " /" << bindingEnergy << G4endl;
*/
return bindingEnergy/theA+coulombBarrier;
}
@@ -0,0 +1,376 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
// G4RKFieldIntegrator
#include "G4RKFieldIntegrator.hh"
#include "G4NucleiProperties.hh"
#include "G4FermiMomentum.hh"
#include "G4NuclearFermiDensity.hh"
#include "G4NuclearShellModelDensity.hh"
#include "G4Nucleon.hh"
// Class G4RKFieldIntegrator
//*************************************************************************************************************************************
// only theActive are propagated, nothing else
// only theSpectators define the field, nothing else
void G4RKFieldIntegrator::Transport(G4KineticTrackVector &theActive, const G4KineticTrackVector &theSpectators, G4double theTimeStep)
{
(void)theActive;
(void)theSpectators;
(void)theTimeStep;
}
G4double G4RKFieldIntegrator::CalculateTotalEnergy(const G4KineticTrackVector& Barions)
{
const G4double Alpha = 0.25/fermi/fermi;
const G4double t1 = -7264.04*fermi*fermi*fermi;
const G4double tGamma = 87.65*fermi*fermi*fermi*fermi*fermi*fermi;
// const G4double Gamma = 1.676;
const G4double Vo = -0.498*fermi;
const G4double GammaY = 1.4*fermi;
G4double Etot = 0;
G4int nBarion = Barions.size();
for(G4int c1 = 0; c1 < nBarion; c1++)
{
G4KineticTrack* p1 = Barions.operator[](c1);
// Ekin
Etot += p1->Get4Momentum().e();
for(G4int c2 = c1 + 1; c2 < nBarion; c2++)
{
G4KineticTrack* p2 = Barions.operator[](c2);
G4ThreeVector rv = p1->GetPosition() - p2->GetPosition();
G4double r12 = sqrt(rv*rv)*fermi;
// Esk2
Etot += t1*pow(Alpha/pi, 3/2)*exp(-Alpha*r12*r12);
// Eyuk
Etot += Vo*0.5/r12*exp(1/(4*Alpha*GammaY*GammaY))*
(exp(-r12/GammaY)*(1 - Erf(0.5/GammaY/sqrt(Alpha) - sqrt(Alpha)*r12)) -
exp( r12/GammaY)*(1 - Erf(0.5/GammaY/sqrt(Alpha) + sqrt(Alpha)*r12)));
// Ecoul
Etot += 1.44*p1->GetDefinition()->GetPDGCharge()*p2->GetDefinition()->GetPDGCharge()/r12*Erf(sqrt(Alpha)*r12);
// Epaul
Etot = 0;
for(G4int c3 = c2 + 1; c3 < nBarion; c3++)
{
G4KineticTrack* p3 = Barions.operator[](c3);
G4ThreeVector rv = p1->GetPosition() - p3->GetPosition();
G4double r13 = sqrt(rv*rv)*fermi;
// Esk3
Etot = tGamma*pow(4*Alpha*Alpha/3/pi/pi, 1.5)*exp(-Alpha*(r12*r12 + r13*r13));
}
}
}
return Etot;
}
//************************************************************************************************
// originated from the Numerical recipes error function
G4double G4RKFieldIntegrator::Erf(G4double X)
{
const G4double Z1 = 1;
const G4double HF = Z1/2;
const G4double C1 = 0.56418958;
const G4double P10 = +3.6767877;
const G4double Q10 = +3.2584593;
const G4double P11 = -9.7970465E-2;
static G4double P2[5] = { 7.3738883, 6.8650185, 3.0317993, 0.56316962, 4.3187787e-5 };
static G4double Q2[5] = { 7.3739609, 15.184908, 12.79553, 5.3542168, 1. };
const G4double P30 = -1.2436854E-1;
const G4double Q30 = +4.4091706E-1;
const G4double P31 = -9.6821036E-2;
G4double V = abs(X);
G4double H;
G4double Y;
G4int c1;
if(V < HF)
{
Y = V*V;
H = X*(P10 + P11*Y)/(Q10+Y);
}
else
{
if(V < 4)
{
G4double AP = P2[4];
G4double AQ = Q2[4];
for(c1 = 3; c1 >= 0; c1--)
{
AP = P2[c1] + V*AP;
AQ = Q2[c1] + V*AQ;
}
H = 1 - exp(-V*V)*AP/AQ;
}
else
{
Y = 1./V*V;
H = 1 - exp(-V*V)*(C1+Y*(P30 + P31*Y)/(Q30 + Y))/V;
}
if (X < 0)
H =- H;
}
return H;
}
//************************************************************************************************
//This is a QMD version to calculate excitation energy of a fragment,
//which consists from G4KTV &the Particles
/*
G4double G4RKFieldIntegrator::GetExcitationEnergy(const G4KineticTrackVector &theParticles)
{
// Excitation energy of a fragment consisting from A nucleons and Z protons
// is Etot - Z*Mp - (A - Z)*Mn - B(A, Z), where B(A,Z) is the binding energy of fragment
// and Mp, Mn are proton and neutron mass, respectively.
G4int NZ = 0;
G4int NA = 0;
G4double Etot = CalculateTotalEnergy(theParticles);
for(G4int cParticle = 0; cParticle < theParticles.length(); cParticle++)
{
G4KineticTrack* pKineticTrack = theParticles.at(cParticle);
G4int Encoding = abs(pKineticTrack->GetDefinition()->GetPDGEncoding());
if (Encoding == 2212)
NZ++, NA++;
if (Encoding == 2112)
NA++;
Etot -= pKineticTrack->GetDefinition()->GetPDGMass();
}
return Etot - G4NucleiProperties::GetBindingEnergy(NZ, NA);
}
*/
//*************************************************************************************************************************************
//This is a simplified method to get excitation energy of a residual
// nucleus with nHitNucleons.
G4double G4RKFieldIntegrator::GetExcitationEnergy(G4int nHitNucleons, const G4KineticTrackVector &theParticles)
{
const G4double MeanE = 50;
G4double Sum = 0;
for(G4int c1 = 0; c1 < nHitNucleons; c1++)
{
Sum += -MeanE*log(G4UniformRand());
}
return Sum;
}
//*************************************************************************************************************************************
/*
//This is free propagation of particles for CASCADE mode. Target nucleons should be frozen
void G4RKFieldIntegrator::Integrate(G4KineticTrackVector& theParticles)
{
for(G4int cParticle = 0; cParticle < theParticles.length(); cParticle++)
{
G4KineticTrack* pKineticTrack = theParticles.at(cParticle);
pKineticTrack->SetPosition(pKineticTrack->GetPosition() + theTimeStep*pKineticTrack->Get4Momentum().boostVector());
}
}
*/
//*************************************************************************************************************************************
void G4RKFieldIntegrator::Integrate(const G4KineticTrackVector& theBarions, G4double theTimeStep)
{
for(size_t cParticle = 0; cParticle < theBarions.size(); cParticle++)
{
G4KineticTrack* pKineticTrack = theBarions[cParticle];
pKineticTrack->SetPosition(pKineticTrack->GetPosition() + theTimeStep*pKineticTrack->Get4Momentum().boostVector());
}
}
//*************************************************************************************************************************************
// constant to calculate theCoulomb barrier
const G4double G4RKFieldIntegrator::coulomb = 1.44 / 1.14 * MeV;
// kaon's potential constant (real part only)
// 0.35 + i0.82 or 0.63 + i0.89 fermi
const G4double G4RKFieldIntegrator::a_kaon = 0.35;
// pion's potential constant (real part only)
//!! for pions it has todiffer from kaons
// 0.35 + i0.82 or 0.63 + i0.89 fermi
const G4double G4RKFieldIntegrator::a_pion = 0.35;
// antiproton's potential constant (real part only)
// 1.53 + i2.50 fermi
const G4double G4RKFieldIntegrator::a_antiproton = 1.53;
// methods for calculating potentials for different types of particles
// aPosition is relative to the nucleus center
G4double G4RKFieldIntegrator::GetNeutronPotential(G4double radius)
{
/*
const G4double Mn = 939.56563 * MeV; // mass of nuetron
G4VNuclearDensity *theDencity;
if(theA < 17) theDencity = new G4NuclearShellModelDensity(theA, theZ);
else theDencity = new G4NuclearFermiDensity(theA, theZ);
// GetDencity() accepts only G4ThreeVector so build it:
G4ThreeVector aPosition(0.0, 0.0, radius);
G4double density = theDencity->GetDensity(aPosition);
delete theDencity;
G4FermiMomentum *fm = new G4FermiMomentum();
fm->Init(theA, theZ);
G4double fermiMomentum = fm->GetFermiMomentum(density);
delete fm;
return sqr(fermiMomentum)/(2 * Mn)
+ G4CreateNucleus::GetBindingEnergy(theZ, theA)/theA;
//+ G4NucleiProperties::GetBindingEnergy(theZ, theA)/theA;
*/
return 0.0;
}
G4double G4RKFieldIntegrator::GetProtonPotential(G4double radius)
{
/*
// calculate Coulomb barrier value
G4double theCoulombBarrier = coulomb * theZ/(1. + pow(theA, 1./3.));
const G4double Mp = 938.27231 * MeV; // mass of proton
G4VNuclearDensity *theDencity;
if(theA < 17) theDencity = new G4NuclearShellModelDensity(theA, theZ);
else theDencity = new G4NuclearFermiDensity(theA, theZ);
// GetDencity() accepts only G4ThreeVector so build it:
G4ThreeVector aPosition(0.0, 0.0, radius);
G4double density = theDencity->GetDensity(aPosition);
delete theDencity;
G4FermiMomentum *fm = new G4FermiMomentum();
fm->Init(theA, theZ);
G4double fermiMomentum = fm->GetFermiMomentum(density);
delete fm;
return sqr(fermiMomentum)/ (2 * Mp)
+ G4CreateNucleus::GetBindingEnergy(theZ, theA)/theA;
//+ G4NucleiProperties::GetBindingEnergy(theZ, theA)/theA
+ theCoulombBarrier;
*/
return 0.0;
}
G4double G4RKFieldIntegrator::GetAntiprotonPotential(G4double radius)
{
/*
//G4double theM = G4NucleiProperties::GetAtomicMass(theA, theZ);
G4double theM = theZ * G4Proton::Proton()->GetPDGMass()
+ (theA - theZ) * G4Neutron::Neutron()->GetPDGMass()
+ G4CreateNucleus::GetBindingEnergy(theZ, theA);
const G4double Mp = 938.27231 * MeV; // mass of proton
G4double mu = (theM * Mp)/(theM + Mp);
// antiproton's potential coefficient
// V = coeff_antiproton * nucleus_density
G4double coeff_antiproton = -2.*pi/mu * (1. + Mp) * a_antiproton;
G4VNuclearDensity *theDencity;
if(theA < 17) theDencity = new G4NuclearShellModelDensity(theA, theZ);
else theDencity = new G4NuclearFermiDensity(theA, theZ);
// GetDencity() accepts only G4ThreeVector so build it:
G4ThreeVector aPosition(0.0, 0.0, radius);
G4double density = theDencity->GetDensity(aPosition);
delete theDencity;
return coeff_antiproton * density;
*/
return 0.0;
}
G4double G4RKFieldIntegrator::GetKaonPotential(G4double radius)
{
/*
//G4double theM = G4NucleiProperties::GetAtomicMass(theA, theZ);
G4double theM = theZ * G4Proton::Proton()->GetPDGMass()
+ (theA - theZ) * G4Neutron::Neutron()->GetPDGMass()
+ G4CreateNucleus::GetBindingEnergy(theZ, theA);
const G4double Mk = 496. * MeV; // mass of "kaon"
G4double mu = (theM * Mk)/(theM + Mk);
// kaon's potential coefficient
// V = coeff_kaon * nucleus_density
G4double coeff_kaon = -2.*pi/mu * (1. + Mk/theM) * a_kaon;
G4VNuclearDensity *theDencity;
if(theA < 17) theDencity = new G4NuclearShellModelDensity(theA, theZ);
else theDencity = new G4NuclearFermiDensity(theA, theZ);
// GetDencity() accepts only G4ThreeVector so build it:
G4ThreeVector aPosition(0.0, 0.0, radius);
G4double density = theDencity->GetDensity(aPosition);
delete theDencity;
return coeff_kaon * density;
*/
return 0.0;
}
G4double G4RKFieldIntegrator::GetPionPotential(G4double radius)
{
/*
//G4double theM = G4NucleiProperties::GetAtomicMass(theA, theZ);
G4double theM = theZ * G4Proton::Proton()->GetPDGMass()
+ (theA - theZ) * G4Neutron::Neutron()->GetPDGMass()
+ G4CreateNucleus::GetBindingEnergy(theZ, theA);
const G4double Mpi = 139. * MeV; // mass of "pion"
G4double mu = (theM * Mpi)/(theM + Mpi);
// pion's potential coefficient
// V = coeff_pion * nucleus_density
G4double coeff_pion = -2.*pi/mu * (1. + Mpi) * a_pion;
G4VNuclearDensity *theDencity;
if(theA < 17) theDencity = new G4NuclearShellModelDensity(theA, theZ);
else theDencity = new G4NuclearFermiDensity(theA, theZ);
// GetDencity() accepts only G4ThreeVector so build it:
G4ThreeVector aPosition(0.0, 0.0, radius);
G4double density = theDencity->GetDensity(aPosition);
delete theDencity;
return coeff_pion * density;
*/
return 0.0;
}
@@ -0,0 +1,608 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
//
// CERN, Geneva, Switzerland
//
// File name: G4RKPropagation.cc
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 6 June 2000
// -------------------------------------------------------------------
#include "G4RKPropagation.hh"
// nuclear fields
#include "G4VNuclearField.hh"
#include "G4ProtonField.hh"
#include "G4NeutronField.hh"
#include "G4AntiProtonField.hh"
#include "G4KaonPlusField.hh"
#include "G4KaonMinusField.hh"
#include "G4KaonZeroField.hh"
#include "G4PionPlusField.hh"
#include "G4PionMinusField.hh"
#include "G4PionZeroField.hh"
#include "G4SigmaPlusField.hh"
#include "G4SigmaMinusField.hh"
#include "G4SigmaZeroField.hh"
// particles properties
#include "G4Proton.hh"
#include "G4Neutron.hh"
#include "G4AntiProton.hh"
#include "G4KaonPlus.hh"
#include "G4KaonMinus.hh"
#include "G4KaonZero.hh"
#include "G4PionPlus.hh"
#include "G4PionMinus.hh"
#include "G4PionZero.hh"
#include "G4SigmaPlus.hh"
#include "G4SigmaMinus.hh"
#include "G4SigmaZero.hh"
#include "globals.hh"
#include "G4KM_OpticalEqRhs.hh"
#include "G4KM_NucleonEqRhs.hh"
#include "G4ClassicalRK4.hh"
#include "G4MagIntegratorDriver.hh"
// unsigned EncodingHashFun(const G4int& aEncoding);
G4RKPropagation::G4RKPropagation() : theNucleus(0),
theFieldMap(0), theEquationMap(0),
theField(0)
{ }
G4RKPropagation::G4RKPropagation(const G4RKPropagation &right)
{ }
G4RKPropagation::~G4RKPropagation()
{
// free theFieldMap memory
if(theFieldMap) delete_FieldsAndMap(theFieldMap);
// free theEquationMap memory
if(theEquationMap) delete_EquationsAndMap(theEquationMap);
if (theField) delete theField;
}
const G4RKPropagation & G4RKPropagation::operator=(const G4RKPropagation & right)
{
G4Exception("G4RKPropagation::operator= meant not to be accessible");
return *this;
}
G4int G4RKPropagation::operator==(const G4RKPropagation & right) const
{
G4Exception("G4RKPropagation::operator== meant not to be accessible");
return 0;
}
G4int G4RKPropagation::operator!=(const G4RKPropagation & right) const
{
G4Exception("G4RKPropagation::operator!= meant not to be accessible");
return 1;
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
void G4RKPropagation::Init(G4V3DNucleus * nucleus)
//----------------------------------------------------------------------------
{
// free theFieldMap memory
if(theFieldMap) delete_FieldsAndMap(theFieldMap);
// free theEquationMap memory
if(theEquationMap) delete_EquationsAndMap(theEquationMap);
if (theField) delete theField;
// Initialize the nuclear field map.
theNucleus = nucleus;
theOuterRadius = theNucleus->GetOuterRadius();
theFieldMap = new G4std::map <G4int, G4VNuclearField*, G4std::less<G4int> >;
(*theFieldMap)[G4Proton::Proton()->GetPDGEncoding()] = new G4ProtonField(theNucleus);
(*theFieldMap)[G4Neutron::Neutron()->GetPDGEncoding()] = new G4NeutronField(theNucleus);
(*theFieldMap)[G4AntiProton::AntiProton()->GetPDGEncoding()] = new G4AntiProtonField(theNucleus);
(*theFieldMap)[G4KaonPlus::KaonPlus()->GetPDGEncoding()] = new G4KaonPlusField(theNucleus);
(*theFieldMap)[G4KaonMinus::KaonMinus()->GetPDGEncoding()] = new G4KaonMinusField(theNucleus);
(*theFieldMap)[G4KaonZero::KaonZero()->GetPDGEncoding()] = new G4KaonZeroField(theNucleus);
(*theFieldMap)[G4PionPlus::PionPlus()->GetPDGEncoding()] = new G4PionPlusField(theNucleus);
(*theFieldMap)[G4PionMinus::PionMinus()->GetPDGEncoding()] = new G4PionMinusField(theNucleus);
(*theFieldMap)[G4PionZero::PionZero()->GetPDGEncoding()] = new G4PionZeroField(theNucleus);
(*theFieldMap)[G4SigmaPlus::SigmaPlus()->GetPDGEncoding()] = new G4SigmaPlusField(theNucleus);
(*theFieldMap)[G4SigmaMinus::SigmaMinus()->GetPDGEncoding()] = new G4SigmaMinusField(theNucleus);
(*theFieldMap)[G4SigmaZero::SigmaZero()->GetPDGEncoding()] = new G4SigmaZeroField(theNucleus);
theEquationMap = new G4std::map <G4int, G4Mag_EqRhs*, G4std::less<G4int> >;
// theField needed by the design of G4Mag_eqRhs
theField = new G4KM_DummyField; //Field not needed for integration
G4KM_OpticalEqRhs * opticalEq;
G4KM_NucleonEqRhs * nucleonEq;
G4double mass;
G4double opticalCoeff;
nucleonEq = new G4KM_NucleonEqRhs(theField, theNucleus);
mass = G4Proton::Proton()->GetPDGMass();
nucleonEq->SetMass(mass);
(*theEquationMap)[G4Proton::Proton()->GetPDGEncoding()] = nucleonEq;
nucleonEq = new G4KM_NucleonEqRhs(theField, theNucleus);
mass = G4Neutron::Neutron()->GetPDGMass();
nucleonEq->SetMass(mass);
(*theEquationMap)[G4Neutron::Neutron()->GetPDGEncoding()] = nucleonEq;
opticalEq = new G4KM_OpticalEqRhs(theField, theNucleus);
mass = G4AntiProton::AntiProton()->GetPDGMass();
opticalCoeff =
(*theFieldMap)[G4AntiProton::AntiProton()->GetPDGEncoding()]->GetCoeff();
opticalEq->SetFactor(mass,opticalCoeff);
(*theEquationMap)[G4AntiProton::AntiProton()->GetPDGEncoding()] = opticalEq;
opticalEq = new G4KM_OpticalEqRhs(theField, theNucleus);
mass = G4KaonPlus::KaonPlus()->GetPDGMass();
opticalCoeff =
(*theFieldMap)[G4KaonPlus::KaonPlus()->GetPDGEncoding()]->GetCoeff();
opticalEq->SetFactor(mass,opticalCoeff);
(*theEquationMap)[G4KaonPlus::KaonPlus()->GetPDGEncoding()] = opticalEq;
opticalEq = new G4KM_OpticalEqRhs(theField, theNucleus);
mass = G4KaonMinus::KaonMinus()->GetPDGMass();
opticalCoeff =
(*theFieldMap)[G4KaonMinus::KaonMinus()->GetPDGEncoding()]->GetCoeff();
opticalEq->SetFactor(mass,opticalCoeff);
(*theEquationMap)[G4KaonMinus::KaonMinus()->GetPDGEncoding()] = opticalEq;
opticalEq = new G4KM_OpticalEqRhs(theField, theNucleus);
mass = G4KaonZero::KaonZero()->GetPDGMass();
opticalCoeff =
(*theFieldMap)[G4KaonZero::KaonZero()->GetPDGEncoding()]->GetCoeff();
opticalEq->SetFactor(mass,opticalCoeff);
(*theEquationMap)[G4KaonZero::KaonZero()->GetPDGEncoding()] = opticalEq;
opticalEq = new G4KM_OpticalEqRhs(theField, theNucleus);
mass = G4PionPlus::PionPlus()->GetPDGMass();
opticalCoeff =
(*theFieldMap)[G4PionPlus::PionPlus()->GetPDGEncoding()]->GetCoeff();
opticalEq->SetFactor(mass,opticalCoeff);
(*theEquationMap)[G4PionPlus::PionPlus()->GetPDGEncoding()] = opticalEq;
opticalEq = new G4KM_OpticalEqRhs(theField, theNucleus);
mass = G4PionMinus::PionMinus()->GetPDGMass();
opticalCoeff =
(*theFieldMap)[G4PionMinus::PionMinus()->GetPDGEncoding()]->GetCoeff();
opticalEq->SetFactor(mass,opticalCoeff);
(*theEquationMap)[G4PionMinus::PionMinus()->GetPDGEncoding()] = opticalEq;
opticalEq = new G4KM_OpticalEqRhs(theField, theNucleus);
mass = G4PionZero::PionZero()->GetPDGMass();
opticalCoeff =
(*theFieldMap)[G4PionZero::PionZero()->GetPDGEncoding()]->GetCoeff();
opticalEq->SetFactor(mass,opticalCoeff);
(*theEquationMap)[G4PionZero::PionZero()->GetPDGEncoding()] = opticalEq;
opticalEq = new G4KM_OpticalEqRhs(theField, theNucleus);
mass = G4SigmaPlus::SigmaPlus()->GetPDGMass();
opticalCoeff =
(*theFieldMap)[G4SigmaPlus::SigmaPlus()->GetPDGEncoding()]->GetCoeff();
opticalEq->SetFactor(mass,opticalCoeff);
(*theEquationMap)[G4SigmaPlus::SigmaPlus()->GetPDGEncoding()] = opticalEq;
opticalEq = new G4KM_OpticalEqRhs(theField, theNucleus);
mass = G4SigmaMinus::SigmaMinus()->GetPDGMass();
opticalCoeff =
(*theFieldMap)[G4SigmaMinus::SigmaMinus()->GetPDGEncoding()]->GetCoeff();
opticalEq->SetFactor(mass,opticalCoeff);
(*theEquationMap)[G4SigmaMinus::SigmaMinus()->GetPDGEncoding()] = opticalEq;
opticalEq = new G4KM_OpticalEqRhs(theField, theNucleus);
mass = G4SigmaZero::SigmaZero()->GetPDGMass();
opticalCoeff =
(*theFieldMap)[G4SigmaZero::SigmaZero()->GetPDGEncoding()]->GetCoeff();
opticalEq->SetFactor(mass,opticalCoeff);
(*theEquationMap)[G4SigmaZero::SigmaZero()->GetPDGEncoding()] = opticalEq;
}
//----------------------------------------------------------------------------
void G4RKPropagation::Transport(G4KineticTrackVector & active,
//----------------------------------------------------------------------------
const G4KineticTrackVector & spectators,
G4double timeStep)
{
// Loop over tracks
G4std::vector<G4KineticTrack *>::iterator i;
for(i = active.begin(); i != active.end(); ++i)
{
G4double currTimeStep = timeStep;
G4KineticTrack * kt = *i;
G4int encoding = kt->GetDefinition()->GetPDGEncoding();
G4std::map <G4int, G4VNuclearField*, G4std::less<G4int> >::iterator fieldIter= theFieldMap->find(encoding);
G4VNuclearField* currentField=0;
if ( fieldIter != theFieldMap->end() ) currentField=fieldIter->second;
// debug
// 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;
/*
* G4cout <<" timeStep, Intersection times tenter, tleave "
* << currTimeStep << " / " << t_enter << " / " << t_leave <<G4endl;
*/
// if the particle is already outside nucleus go to next
if(t_leave < 0)
continue;
// Apply a straight line propagation for particle types
// not included in the model
if( ! currentField )
{
if(currTimeStep == DBL_MAX)currTimeStep = t_leave;
FreeTransport(kt, currTimeStep);
// G4cout << " Particle not in model : " << kt->GetDefinition()->GetParticleName() << G4endl;
continue;
}
if(t_enter > 0) // the particle is out. Transport free to the surface
{
if(t_enter > currTimeStep) // the particle won't enter the nucleus
{
FreeTransport(kt, currTimeStep);
continue;
}
else
{
FreeTransport(kt, t_enter); // go to surface
currTimeStep -= t_enter;
t_leave -= t_enter; // time left to leave nucleus
// 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;
// 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
{
// 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
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() << " / "
// << (*theFieldMap)[encoding]->GetField(kt->GetPosition()) << " / "
// << kt->Get4Momentum().e()-currentField->GetField(kt->GetPosition())
// << G4endl
// << " Barrier / field just inside nucleus (0.9999*kt->GetPosition())"
// << (*theFieldMap)[encoding]->GetBarrier() << " / "
// << (*theFieldMap)[encoding]->GetField(0.9999*kt->GetPosition())
// << G4endl;
}
}
// FixMe: should I add a control on theCutOnP here?
// Transport the particle into the nucleus
// G4cerr << "RKPropagation t_leave, curTimeStep " <<t_leave << " " <<currTimeStep<<G4endl;
G4bool is_exiting=false;
if(currTimeStep > t_leave) // particle will exit from the nucleus
{
currTimeStep = t_leave;
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() << " "
<< kt->GetPosition()<<" "
<< currentField->GetField(kt->GetPosition())<< G4endl
<< kt->Get4Momentum()
<< G4endl;
#endif
G4LorentzVector momold=kt->Get4Momentum();
G4ThreeVector posold=kt->GetPosition();
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
<< "del pos " << posold-kt->GetPosition()
<< G4endl;
*/
// 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
{
// 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=G4std::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.
{
G4ThreeVector savePos = kt->GetPosition();
FreeTransport(kt, 1.1*t_out);
// and evaluate the right the energy
G4double newE=kt->Get4Momentum().e();
// G4cout << " V pos/savePos << "
// << (*theFieldMap)[encoding]->GetField(kt->GetPosition())<< " / "
// << (*theFieldMap)[encoding]->GetField(savePos)
// << G4endl;
if ( abs(currentField->GetField(savePos)) > 0. &&
abs(currentField->GetField(kt->GetPosition())) > 0.)
{ // FixMe GF: savePos/pos may be out of nucleus, where GetField(..)=0
// This wrongly adds or subtracts the Barrier here while
// this is done later.
newE += currentField->GetField(savePos)
- currentField->GetField(kt->GetPosition());
}
// G4cout << " go border nucleus, E in/border: " << kt->Get4Momentum() << " / " << newE <<G4endl;
if(newE < kt->GetActualMass())
{
// G4cout << "RKPropagation-Transport: problem with particle exiting - ignored" << G4endl;
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;
}
} 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->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);
}
}
}
//----------------------------------------------------------------------------
G4bool G4RKPropagation::FieldTransport(G4KineticTrack * kt, const G4double timeStep)
//----------------------------------------------------------------------------
{
// G4cout <<"Stepper input"<<kt->Get4Momentum()<<G4endl;
// create the integrator stepper
// G4Mag_EqRhs * equation = mapIter->second;
G4Mag_EqRhs * equation = (*theEquationMap)[kt->GetDefinition()->GetPDGEncoding()];
G4MagIntegratorStepper * stepper = new G4ClassicalRK4(equation);
// create the integrator driver
G4double hMin = 1.0e-25*second; // arbitrary choice. Means 0.03 fm at c
G4MagInt_Driver * driver = new G4MagInt_Driver(hMin, stepper);
// Temporary: use driver->AccurateAdvance()
// create the G4FieldTrack needed by AccurateAdvance
G4double curveLength = 0;
G4FieldTrack track(kt->GetPosition(),
kt->Get4Momentum().vect().unit(), // momentum direction
curveLength, // curvelength
kt->Get4Momentum().e()-kt->GetActualMass(), // kinetic energy
kt->GetActualMass(), // restmass
kt->Get4Momentum().beta()*c_light); // velocity
// integrate
G4double eps = 0.01;
// G4cout << "currTimeStep = " << currTimeStep << G4endl;
if(!driver->AccurateAdvance(track, timeStep, eps))
{ // cannot track this particle
G4std::cerr << "G4RKPropagation::FieldTransport() warning: integration error."
<< G4endl << "position " << kt->GetPosition() << " 4mom " <<kt->Get4Momentum()
<<G4endl << " timestep " <<timeStep
<< G4endl;
delete driver;
delete stepper;
return false;
}
/*
* G4cout <<" E/Field/Sum be4 : " <<mom.e() << " / "
* << (*theFieldMap)[encoding]->GetField(pos) << " / "
* << mom.e()+(*theFieldMap)[encoding]->GetField(pos)
* << G4endl;
*/
// 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;
/*
* G4cout <<" E/Field/Sum aft : " <<mom.e() << " / "
* << " / " << (*theFieldMap)[encoding]->GetField(pos)<< " / "
* << mom.e()+(*theFieldMap)[encoding]->GetField(pos)
* << G4endl;
*/
delete driver;
delete stepper;
return true;
}
//----------------------------------------------------------------------------
G4bool G4RKPropagation::FreeTransport(G4KineticTrack * kt, const G4double timeStep)
//----------------------------------------------------------------------------
{
G4ThreeVector newpos = kt->GetPosition() +
timeStep*c_light/kt->Get4Momentum().e() * kt->Get4Momentum().vect();
kt->SetPosition(newpos);
return true;
}
/*
G4bool G4RKPropagation::WillBeCaptured(const G4KineticTrack * kt)
{
G4double radius = theOuterRadius;
// evaluate the final energy. Il will be captured if newE or newP < 0
G4ParticleDefinition * definition = kt->GetDefinition();
G4double mass = definition->GetPDGMass();
G4ThreeVector pos = kt->GetPosition();
G4LorentzVector mom = kt->Get4Momentum();
G4VNuclearField * field = (*theFieldMap)[definition->GetPDGEncoding()];
G4ThreeVector newPos(0, 0, radius); // to get the field on the surface
G4double newE = mom.e()+field->GetField(pos)-field->GetField(newPos);
return ((newE < mass) ? false : true);
}
*/
//----------------------------------------------------------------------------
G4bool G4RKPropagation::GetSphereIntersectionTimes(const G4double radius,
//----------------------------------------------------------------------------
const G4ThreeVector & currentPos,
const G4LorentzVector & momentum,
G4double & t1, G4double & t2)
{
G4ThreeVector speed = momentum.vect()/momentum.e(); // boost vector
G4double scalarProd = currentPos.dot(speed);
G4double speedMag = speed.mag();
G4double sqrtArg = scalarProd*scalarProd -
speedMag*speedMag*(currentPos.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;
t2 = (-scalarProd + sqrt(sqrtArg))/speedMag/speedMag/c_light;
return true;
}
//----------------------------------------------------------------------------
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
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;
t2 = (-scalarProd + sqrt(sqrtArg))/speedMag/speedMag/c_light;
return true;
}
// Implementation methods
//----------------------------------------------------------------------------
void G4RKPropagation::delete_FieldsAndMap(
//----------------------------------------------------------------------------
G4std::map <G4int, G4VNuclearField *, G4std::less<G4int> > * aMap)
{
if(aMap)
{
G4std::map <G4int, G4VNuclearField *, G4std::less<G4int> >::iterator cur;
for(cur = aMap->begin(); cur != aMap->end(); ++cur)
delete (*cur).second;
aMap->clear();
delete aMap;
}
}
//----------------------------------------------------------------------------
void G4RKPropagation::delete_EquationsAndMap(
//----------------------------------------------------------------------------
G4std::map <G4int, G4Mag_EqRhs *, G4std::less<G4int> > * aMap)
{
if(aMap)
{
G4std::map <G4int, G4Mag_EqRhs *, G4std::less<G4int> >::iterator cur;
for(cur = aMap->begin(); cur != aMap->end(); ++cur)
delete (*cur).second;
aMap->clear();
delete aMap;
}
}
@@ -0,0 +1,100 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
//
// CERN, Geneva, Switzerland
//
// File name: G4SigmaMinusField.cc
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#include "G4SigmaMinusField.hh"
#include "G4NucleiPropertiesTable.hh"
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4SigmaMinus.hh"
G4SigmaMinusField::G4SigmaMinusField(G4V3DNucleus * nucleus, G4double coeff)
: G4VNuclearField(nucleus)
{
theCoeff = coeff;
}
G4SigmaMinusField::~G4SigmaMinusField()
{ }
const G4SigmaMinusField & G4SigmaMinusField::operator=(const G4SigmaMinusField & right)
{
G4Exception("G4SigmaMinusField::operator= meant not to be accessible");
return *this;
}
G4int G4SigmaMinusField::operator==(const G4SigmaMinusField & right) const
{
G4Exception("G4SigmaMinusField::operator== meant not to be accessible");
return 0;
}
G4int G4SigmaMinusField::operator!=(const G4SigmaMinusField & right) const
{
G4Exception("G4SigmaMinusField::operator!= meant not to be accessible");
return 1;
}
G4double G4SigmaMinusField::GetField(const G4ThreeVector & aPosition)
{
// Field is 0 out of the nucleus!
if(aPosition.mag() >= radius) return 0.0;
G4double sigmaMinusMass = G4SigmaMinus::SigmaMinus()->GetPDGMass();
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = sigmaMinusMass*nucleusMass/(sigmaMinusMass+nucleusMass);
const G4VNuclearDensity * nuclearDensity=theNucleus->GetNuclearDensity();
G4double density = nuclearDensity->GetDensity(aPosition);
return -2.*pi*hbarc*hbarc/reducedMass*(2.0)*theCoeff*density+GetBarrier();
}
G4double G4SigmaMinusField::GetBarrier()
{
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double coulombBarrier = (1.44/1.14) * MeV * Z / (1.0 + pow(A,1./3.));
return -coulombBarrier;
}
@@ -0,0 +1,104 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
//
// CERN, Geneva, Switzerland
//
// File name: G4SigmaPlusField.cc
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#include "G4SigmaPlusField.hh"
#include "G4NucleiPropertiesTable.hh"
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4SigmaPlus.hh"
G4SigmaPlusField::G4SigmaPlusField(G4V3DNucleus * nucleus, G4double coeff)
: G4VNuclearField(nucleus)
{
theCoeff = coeff;
}
G4SigmaPlusField::~G4SigmaPlusField()
{ }
const G4SigmaPlusField & G4SigmaPlusField::operator=(const G4SigmaPlusField & right)
{
G4Exception("G4SigmaPlusField::operator= meant not to be accessible");
return *this;
}
G4int G4SigmaPlusField::operator==(const G4SigmaPlusField & right) const
{
G4Exception("G4SigmaPlusField::operator== meant not to be accessible");
return 0;
}
G4int G4SigmaPlusField::operator!=(const G4SigmaPlusField & right) const
{
G4Exception("G4SigmaPlusField::operator!= meant not to be accessible");
return 1;
}
G4double G4SigmaPlusField::GetField(const G4ThreeVector & aPosition)
{
// Field is 0 out of the nucleus!
if(aPosition.mag() >= radius) return 0.0;
G4double sigmaPlusMass = G4SigmaPlus::SigmaPlus()->GetPDGMass();
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = sigmaPlusMass*nucleusMass/(sigmaPlusMass+nucleusMass);
const G4VNuclearDensity * nuclearDensity=theNucleus->GetNuclearDensity();
G4double density = nuclearDensity->GetDensity(aPosition);
return -2.*pi*hbarc*hbarc/reducedMass*(2.0)*theCoeff*density+GetBarrier();
}
G4double G4SigmaPlusField::GetBarrier()
{
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double coulombBarrier = (1.44/1.14) * MeV * Z / (1.0 + pow(A,1./3.));
return coulombBarrier;
}
@@ -0,0 +1,98 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
//
// CERN, Geneva, Switzerland
//
// File name: G4SigmaZeroField.cc
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#include "G4SigmaZeroField.hh"
#include "G4NucleiPropertiesTable.hh"
#include "G4VNuclearDensity.hh"
#include "G4FermiMomentum.hh"
#include "G4SigmaZero.hh"
G4SigmaZeroField::G4SigmaZeroField(G4V3DNucleus * nucleus, G4double coeff)
: G4VNuclearField(nucleus)
{
theCoeff = coeff;
}
G4SigmaZeroField::~G4SigmaZeroField()
{ }
const G4SigmaZeroField & G4SigmaZeroField::operator=(const G4SigmaZeroField & right)
{
G4Exception("G4SigmaZeroField::operator= meant not to be accessible");
return *this;
}
G4int G4SigmaZeroField::operator==(const G4SigmaZeroField & right) const
{
G4Exception("G4SigmaZeroField::operator== meant not to be accessible");
return 0;
}
G4int G4SigmaZeroField::operator!=(const G4SigmaZeroField & right) const
{
G4Exception("G4SigmaZeroField::operator!= meant not to be accessible");
return 1;
}
G4double G4SigmaZeroField::GetField(const G4ThreeVector & aPosition)
{
// Field is 0 out of the nucleus!
if(aPosition.mag() >= radius) return 0.0;
G4double sigmaZeroMass = G4SigmaZero::SigmaZero()->GetPDGMass();
G4double A = theNucleus->GetMassNumber();
G4double Z = theNucleus->GetCharge();
G4double bindingEnergy = G4NucleiPropertiesTable::GetBindingEnergy(Z, A);
G4double nucleusMass = Z*proton_mass_c2+(A-Z)*neutron_mass_c2+bindingEnergy;
G4double reducedMass = sigmaZeroMass*nucleusMass/(sigmaZeroMass+nucleusMass);
const G4VNuclearDensity * nuclearDensity=theNucleus->GetNuclearDensity();
G4double density = nuclearDensity->GetDensity(aPosition);
return -2.*pi*hbarc*hbarc/reducedMass*(2.0)*theCoeff*density;
}
G4double G4SigmaZeroField::GetBarrier()
{
return 0.;
}
@@ -0,0 +1,72 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
//
// CERN, Geneva, Switzerland
//
// File name: G4VFieldPropagation.cc
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 6 June 2000
// -------------------------------------------------------------------
#include "G4VFieldPropagation.hh"
#include "globals.hh"
G4VFieldPropagation::G4VFieldPropagation()
{ }
G4VFieldPropagation::G4VFieldPropagation(const G4VFieldPropagation &right)
{ }
G4VFieldPropagation::~G4VFieldPropagation()
{ }
const G4VFieldPropagation & G4VFieldPropagation::operator=(const G4VFieldPropagation & right)
{
G4Exception("G4VFieldPropagation::operator= meant not to be accessible");
return *this;
}
G4int G4VFieldPropagation::operator==(const G4VFieldPropagation & right) const
{
G4Exception("G4VFieldPropagation::operator== meant not to be accessible");
return 0;
}
G4int G4VFieldPropagation::operator!=(const G4VFieldPropagation & right) const
{
G4Exception("G4VFieldPropagation::operator!= meant not to be accessible");
return 1;
}
@@ -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. *
// ********************************************************************
//
//
// -------------------------------------------------------------------
// GEANT 4 class implementation file
//
// CERN, Geneva, Switzerland
//
// File name: G4VNuclearField.cc
//
// Author: Alessandro Brunengo (Alessandro.Brunengo@ge.infn.it)
//
// Creation date: 5 June 2000
// -------------------------------------------------------------------
#include "G4VNuclearField.hh"
#include "globals.hh"
G4VNuclearField::G4VNuclearField(G4V3DNucleus * aNucleus) :
theNucleus(aNucleus),
radius(aNucleus->GetOuterRadius() + 4*fermi)
{
}
G4VNuclearField::G4VNuclearField(const G4VNuclearField &right) :
theNucleus(right.theNucleus),
radius(right.radius)
{
}
G4VNuclearField::~G4VNuclearField()
{
}
const G4VNuclearField & G4VNuclearField::operator=(const G4VNuclearField & right)
{
G4Exception("G4VNuclearField::operator= meant not to be accessible");
return *this;
}
G4int G4VNuclearField::operator==(const G4VNuclearField & right) const
{
G4Exception("G4VNuclearField::operator== meant not to be accessible");
return 0;
}
G4int G4VNuclearField::operator!=(const G4VNuclearField & right) const
{
G4Exception("G4VNuclearField::operator!= meant not to be accessible");
return 1;
}