Import Geant4 0.0.0 source tree
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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.
|
||||
//
|
||||
// $Id: G4DynamicParticleVector.hh,v 2.1 1998/07/13 17:27:20 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// History: first implementation, alternative to G4FastVector
|
||||
// less fast, but it has variable array length and checks boundaries
|
||||
// 26th September, Chr. Voelcker
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#ifndef G4DynamicParticleVector_h
|
||||
#define G4DynamicParticleVector_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
class G4DynamicParticle;
|
||||
#include <rw/tpordvec.h>
|
||||
|
||||
// #ifdef STL
|
||||
// //in future use STL vector as container of dynamic particles ...
|
||||
// typedef Vector<G4DynamicParticle> G4DynamicParticleVector;
|
||||
// #elseifdef RWT
|
||||
|
||||
typedef RWTPtrOrderedVector<G4DynamicParticle> G4DynamicParticleVector;
|
||||
|
||||
// #endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,675 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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.
|
||||
//
|
||||
// $Id: G4GHEKinematicsVector.hh,v 2.3 1998/07/13 21:44:25 jwellisc Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file --- Copyright CERN 1998
|
||||
// CERN Geneva Switzerland
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// History: first implementation, based on object model of
|
||||
// 2nd December 1995, G.Cosmo
|
||||
// ------------ G4GHEKinematicsVector utility class ------
|
||||
// by Larry Felawka (TRIUMF), March 1997
|
||||
// E-mail: felawka@alph04.triumf.ca
|
||||
// ************************************************************
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
// Store, Retrieve and manipulate particle data.
|
||||
// Based on "G4GHEVector" class of H. Fesefeldt.
|
||||
|
||||
#ifndef G4GHEKinematicsVector_h
|
||||
#define G4GHEKinematicsVector_h 1
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
class G4GHEKinematicsVector
|
||||
{
|
||||
public:
|
||||
inline
|
||||
G4GHEKinematicsVector()
|
||||
{
|
||||
momentum.setX( 0.0 );
|
||||
momentum.setY( 0.0 );
|
||||
momentum.setZ( 0.0 );
|
||||
energy = 0.0;
|
||||
kineticEnergy = 0.0;
|
||||
mass = 0.0;
|
||||
charge = 0.0;
|
||||
timeOfFlight = 0.0;
|
||||
side = 0;
|
||||
flag = false;
|
||||
code = 0;
|
||||
particleDef = NULL;
|
||||
}
|
||||
|
||||
~G4GHEKinematicsVector() {}
|
||||
|
||||
inline
|
||||
G4GHEKinematicsVector( const G4GHEKinematicsVector & p )
|
||||
{
|
||||
momentum.setX( p.momentum.x() );
|
||||
momentum.setY( p.momentum.y() );
|
||||
momentum.setZ( p.momentum.z() );
|
||||
energy = p.energy;
|
||||
kineticEnergy = p.kineticEnergy;
|
||||
mass = p.mass;
|
||||
charge = p.charge;
|
||||
timeOfFlight = p.timeOfFlight;
|
||||
side = p.side;
|
||||
flag = p.flag;
|
||||
code = p.code;
|
||||
particleDef = p.particleDef;
|
||||
}
|
||||
|
||||
inline
|
||||
G4GHEKinematicsVector & operator = ( const G4GHEKinematicsVector & p )
|
||||
{
|
||||
momentum.setX( p.momentum.x() );
|
||||
momentum.setY( p.momentum.y() );
|
||||
momentum.setZ( p.momentum.z() );
|
||||
energy = p.energy;
|
||||
kineticEnergy = p.kineticEnergy;
|
||||
mass = p.mass;
|
||||
charge = p.charge;
|
||||
timeOfFlight = p.timeOfFlight;
|
||||
side = p.side;
|
||||
flag = p.flag;
|
||||
code = p.code;
|
||||
particleDef = p.particleDef;
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
void SetMomentum( G4ParticleMomentum mom ) { momentum = mom; return; };
|
||||
|
||||
inline
|
||||
void SetMomentumAndUpdate( G4ParticleMomentum mom )
|
||||
{
|
||||
momentum = mom;
|
||||
energy = sqrt(mass*mass + momentum.mag2());
|
||||
kineticEnergy = max(0.,energy - mass);
|
||||
return;
|
||||
}
|
||||
|
||||
inline const
|
||||
G4ParticleMomentum GetMomentum() const { return momentum; }
|
||||
|
||||
inline
|
||||
void SetMomentum( G4double x, G4double y, G4double z)
|
||||
{
|
||||
momentum.setX( x );
|
||||
momentum.setY( y );
|
||||
momentum.setZ( z );
|
||||
return;
|
||||
}
|
||||
|
||||
inline
|
||||
void SetMomentumAndUpdate( G4double x, G4double y, G4double z )
|
||||
{
|
||||
momentum.setX( x );
|
||||
momentum.setY( y );
|
||||
momentum.setZ( z );
|
||||
energy = sqrt(mass*mass + momentum.mag2());
|
||||
kineticEnergy = max(0.,energy-mass);
|
||||
return;
|
||||
}
|
||||
|
||||
inline
|
||||
void SetMomentum( G4double x, G4double y )
|
||||
{
|
||||
momentum.setX( x );
|
||||
momentum.setY( y );
|
||||
return;
|
||||
}
|
||||
|
||||
inline
|
||||
void SetMomentumAndUpdate( G4double x, G4double y )
|
||||
{
|
||||
momentum.setX( x );
|
||||
momentum.setY( y );
|
||||
energy = sqrt(mass*mass + momentum.mag2());
|
||||
kineticEnergy = max(0.,energy-mass);
|
||||
return;
|
||||
}
|
||||
|
||||
inline
|
||||
void SetMomentum( G4double z )
|
||||
{
|
||||
momentum.setZ( z );
|
||||
return;
|
||||
}
|
||||
|
||||
inline
|
||||
void SetMomentumAndUpdate( G4double z )
|
||||
{
|
||||
momentum.setZ( z );
|
||||
energy = sqrt(mass*mass + momentum.mag2());
|
||||
kineticEnergy = max(0.,energy-mass);
|
||||
return;
|
||||
}
|
||||
|
||||
inline
|
||||
void SetEnergy( G4double e ) { energy = e; return; }
|
||||
|
||||
inline
|
||||
void SetEnergyAndUpdate( G4double e )
|
||||
{
|
||||
if (e <= mass)
|
||||
{
|
||||
energy = mass;
|
||||
kineticEnergy = 0.;
|
||||
momentum.setX( 0.);
|
||||
momentum.setY( 0.);
|
||||
momentum.setZ( 0.);
|
||||
}
|
||||
else
|
||||
{
|
||||
energy = e;
|
||||
kineticEnergy = energy - mass;
|
||||
G4double momold = momentum.mag();
|
||||
G4double momnew = sqrt(energy*energy - mass*mass);
|
||||
if (momold == 0.)
|
||||
{
|
||||
G4double cost = 1.0- 2.0*G4UniformRand();
|
||||
G4double sint = sqrt(1. - cost*cost);
|
||||
G4double phi = M_2PI* G4UniformRand();
|
||||
momentum.setX( momnew * sint * cos(phi));
|
||||
momentum.setY( momnew * sint * sin(phi));
|
||||
momentum.setZ( momnew * cost);
|
||||
}
|
||||
else
|
||||
{
|
||||
momnew /= momold;
|
||||
momentum.setX(momentum.x()*momnew);
|
||||
momentum.setY(momentum.y()*momnew);
|
||||
momentum.setZ(momentum.z()*momnew);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
inline
|
||||
void SetKineticEnergy( G4double ekin ) { kineticEnergy = ekin; return; }
|
||||
|
||||
inline
|
||||
void SetKineticEnergyAndUpdate(G4double ekin)
|
||||
{
|
||||
if (ekin <= 0.)
|
||||
{
|
||||
energy = mass;
|
||||
kineticEnergy = 0.;
|
||||
momentum.setX( 0.);
|
||||
momentum.setY( 0.);
|
||||
momentum.setZ( 0.);
|
||||
}
|
||||
else
|
||||
{
|
||||
energy = ekin + mass;
|
||||
kineticEnergy = ekin;
|
||||
G4double momold = momentum.mag();
|
||||
G4double momnew = sqrt(energy*energy - mass*mass);
|
||||
if (momold == 0.)
|
||||
{
|
||||
G4double cost = 1.0-2.0*G4UniformRand();
|
||||
G4double sint = sqrt(1. - cost*cost);
|
||||
G4double phi = M_2PI* G4UniformRand();
|
||||
momentum.setX( momnew * sint * cos(phi));
|
||||
momentum.setY( momnew * sint * sin(phi));
|
||||
momentum.setZ( momnew * cost);
|
||||
}
|
||||
else
|
||||
{
|
||||
momnew /= momold;
|
||||
momentum.setX(momentum.x()*momnew);
|
||||
momentum.setY(momentum.y()*momnew);
|
||||
momentum.setZ(momentum.z()*momnew);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double GetEnergy() {return energy;}
|
||||
|
||||
inline
|
||||
G4double GetKineticEnergy() {return kineticEnergy;}
|
||||
|
||||
inline
|
||||
void SetMass( G4double m ) { mass = m; return; }
|
||||
|
||||
inline
|
||||
void SetMassAndUpdate( G4double m )
|
||||
{
|
||||
kineticEnergy = max(0., energy - m);
|
||||
mass = m;
|
||||
energy = kineticEnergy + mass;
|
||||
G4double momnew = sqrt(max(0., energy*energy - mass*mass));
|
||||
if ( momnew == 0.0)
|
||||
{
|
||||
momentum.setX( 0.0 );
|
||||
momentum.setY( 0.0 );
|
||||
momentum.setZ( 0.0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
G4double momold = momentum.mag();
|
||||
if (momold == 0.)
|
||||
{
|
||||
G4double cost = 1.-2.*G4UniformRand();
|
||||
G4double sint = sqrt(1.-cost*cost);
|
||||
G4double phi = M_2PI*G4UniformRand();
|
||||
momentum.setX( momnew*sint*cos(phi));
|
||||
momentum.setY( momnew*sint*sin(phi));
|
||||
momentum.setZ( momnew*cost);
|
||||
}
|
||||
else
|
||||
{
|
||||
momnew /= momold;
|
||||
momentum.setX( momentum.x()*momnew );
|
||||
momentum.setY( momentum.y()*momnew );
|
||||
momentum.setZ( momentum.z()*momnew );
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double GetMass() { return mass; }
|
||||
|
||||
inline
|
||||
void SetCharge( G4double c ) { charge = c; return; }
|
||||
|
||||
inline
|
||||
G4double GetCharge() {return charge; }
|
||||
|
||||
inline
|
||||
void SetTOF( G4double t ) { timeOfFlight = t; return; }
|
||||
|
||||
inline
|
||||
G4double GetTOF() { return timeOfFlight; }
|
||||
|
||||
inline
|
||||
void SetSide( G4int s ) { side = s; return; }
|
||||
|
||||
inline
|
||||
G4int GetSide() { return side; }
|
||||
|
||||
inline
|
||||
void setFlag( G4bool f ) { flag = f; return; }
|
||||
|
||||
inline
|
||||
G4bool getFlag() { return flag; }
|
||||
|
||||
inline
|
||||
void SetCode( G4int c ) { code = c; return; }
|
||||
|
||||
inline
|
||||
void SetParticleDef( G4ParticleDefinition * c ) { particleDef = c; return; }
|
||||
|
||||
inline
|
||||
G4int GetCode() { return code; }
|
||||
|
||||
inline
|
||||
G4ParticleDefinition * GetParticleDef() { return particleDef; }
|
||||
|
||||
inline
|
||||
void SetZero()
|
||||
{
|
||||
momentum.setX( 0.0 );
|
||||
momentum.setY( 0.0 );
|
||||
momentum.setZ( 0.0 );
|
||||
energy = 0.0;
|
||||
kineticEnergy = 0.0;
|
||||
mass = 0.0;
|
||||
charge = 0.0;
|
||||
timeOfFlight = 0.0;
|
||||
side = 0;
|
||||
flag = false;
|
||||
code = 0;
|
||||
particleDef = NULL;
|
||||
}
|
||||
|
||||
inline
|
||||
void Add( const G4GHEKinematicsVector & p1, const G4GHEKinematicsVector & p2 )
|
||||
{
|
||||
momentum = p1.momentum + p2.momentum;
|
||||
energy = p1.energy + p2.energy;
|
||||
G4double b = energy*energy - momentum.mag2();
|
||||
if( b < 0 )
|
||||
mass = -1. * sqrt( -b );
|
||||
else
|
||||
mass = sqrt( b );
|
||||
kineticEnergy = max(0.,energy - mass);
|
||||
charge = p1.charge + p2.charge;
|
||||
code = p1.code + p2.code;
|
||||
particleDef = p1.particleDef;
|
||||
}
|
||||
|
||||
inline
|
||||
void Sub( const G4GHEKinematicsVector & p1, const G4GHEKinematicsVector & p2 )
|
||||
{
|
||||
momentum = p1.momentum - p2.momentum;
|
||||
energy = p1.energy - p2.energy;
|
||||
G4double b = energy*energy - momentum.mag2();
|
||||
if( b < 0 )
|
||||
mass = -1. * sqrt( -b );
|
||||
else
|
||||
mass = sqrt( b );
|
||||
kineticEnergy = max(0.,energy - mass);
|
||||
charge = p1.charge - p2.charge;
|
||||
code = p1.code - p2.code;
|
||||
particleDef = p1.particleDef;
|
||||
}
|
||||
|
||||
inline
|
||||
void Lor( const G4GHEKinematicsVector & p1, const G4GHEKinematicsVector & p2 )
|
||||
{
|
||||
G4double a;
|
||||
a = ( p1.momentum.dot(p2.momentum)/(p2.energy+p2.mass) - p1.energy ) / p2.mass;
|
||||
momentum.setX( p1.momentum.x()+a*p2.momentum.x() );
|
||||
momentum.setY( p1.momentum.y()+a*p2.momentum.y() );
|
||||
momentum.setZ( p1.momentum.z()+a*p2.momentum.z() );
|
||||
energy = sqrt( sqr(p1.mass) + momentum.mag2() );
|
||||
mass = p1.mass;
|
||||
kineticEnergy = max(0.,energy - mass);
|
||||
timeOfFlight = p1.timeOfFlight;
|
||||
side = p1.side;
|
||||
flag = p1.flag;
|
||||
code = p1.code;
|
||||
particleDef = p1.particleDef;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double CosAng( const G4GHEKinematicsVector & p )
|
||||
{
|
||||
G4double a = sqrt( momentum.mag2() * p.momentum.mag2() );
|
||||
if( a != 0.0 )
|
||||
{
|
||||
a = (momentum.x()*p.momentum.x() +
|
||||
momentum.y()*p.momentum.y() +
|
||||
momentum.z()*p.momentum.z()) / a;
|
||||
if( fabs(a) > 1.0 ) a<0.0 ? a=-1.0 : a=1.0;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
inline
|
||||
G4double Ang(const G4GHEKinematicsVector & p )
|
||||
{
|
||||
G4double a = sqrt( momentum.mag2() * p.momentum.mag2() );
|
||||
if( a != 0.0 )
|
||||
{
|
||||
a = (momentum.x()*p.momentum.x() +
|
||||
momentum.y()*p.momentum.y() +
|
||||
momentum.z()*p.momentum.z()) / a;
|
||||
if( fabs(a) > 1.0 ) a<0.0 ? a=-1.0 : a=1.0;
|
||||
}
|
||||
return acos(a);
|
||||
}
|
||||
|
||||
inline
|
||||
G4double Dot4( const G4GHEKinematicsVector & p1, const G4GHEKinematicsVector & p2)
|
||||
{
|
||||
return ( p1.energy * p2.energy
|
||||
- p1.momentum.x() * p2.momentum.x()
|
||||
- p1.momentum.y() * p2.momentum.y()
|
||||
- p1.momentum.z() * p2.momentum.z() );
|
||||
}
|
||||
|
||||
inline
|
||||
G4double Impu( const G4GHEKinematicsVector & p1, const G4GHEKinematicsVector & p2)
|
||||
{
|
||||
return ( - sqr( p1.energy - p2.energy)
|
||||
+ sqr(p1.momentum.x() - p2.momentum.x())
|
||||
+ sqr(p1.momentum.y() - p2.momentum.y())
|
||||
+ sqr(p1.momentum.z() - p2.momentum.z()) );
|
||||
}
|
||||
|
||||
inline
|
||||
void Add3( const G4GHEKinematicsVector & p1, const G4GHEKinematicsVector & p2)
|
||||
{
|
||||
momentum.setX( p1.momentum.x() + p2.momentum.x());
|
||||
momentum.setY( p1.momentum.y() + p2.momentum.y());
|
||||
momentum.setZ( p1.momentum.z() + p2.momentum.z());
|
||||
return;
|
||||
}
|
||||
|
||||
inline
|
||||
void Sub3( const G4GHEKinematicsVector & p1, const G4GHEKinematicsVector & p2)
|
||||
{
|
||||
momentum.setX( p1.momentum.x() - p2.momentum.x());
|
||||
momentum.setY( p1.momentum.y() - p2.momentum.y());
|
||||
momentum.setZ( p1.momentum.z() - p2.momentum.z());
|
||||
return;
|
||||
}
|
||||
|
||||
inline
|
||||
void Cross( const G4GHEKinematicsVector & p1, const G4GHEKinematicsVector & p2)
|
||||
{
|
||||
G4double px, py, pz;
|
||||
px = p1.momentum.y() * p2.momentum.z() - p1.momentum.z() * p2.momentum.y();
|
||||
py = p1.momentum.z() * p2.momentum.x() - p1.momentum.x() * p2.momentum.z();
|
||||
pz = p1.momentum.x() * p2.momentum.y() - p1.momentum.y() * p2.momentum.x();
|
||||
momentum.setX( px );
|
||||
momentum.setY( py );
|
||||
momentum.setZ( pz );
|
||||
return;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double Dot( const G4GHEKinematicsVector & p1, const G4GHEKinematicsVector & p2)
|
||||
{
|
||||
return ( p1.momentum.x() * p2.momentum.x()
|
||||
+ p1.momentum.y() * p2.momentum.y()
|
||||
+ p1.momentum.z() * p2.momentum.z() );
|
||||
}
|
||||
|
||||
inline
|
||||
void Smul( const G4GHEKinematicsVector & p, G4double h)
|
||||
{
|
||||
momentum.setX( h * p.momentum.x());
|
||||
momentum.setY( h * p.momentum.y());
|
||||
momentum.setZ( h * p.momentum.z());
|
||||
return;
|
||||
}
|
||||
|
||||
inline
|
||||
void SmulAndUpdate( const G4GHEKinematicsVector & p, G4double h)
|
||||
{
|
||||
momentum.setX( h * p.momentum.x());
|
||||
momentum.setY( h * p.momentum.y());
|
||||
momentum.setZ( h * p.momentum.z());
|
||||
mass = p.mass;
|
||||
energy = sqrt(momentum.mag2() + mass*mass);
|
||||
kineticEnergy = energy - mass;
|
||||
charge = p.charge;
|
||||
timeOfFlight = p.timeOfFlight;
|
||||
side = p.side;
|
||||
flag = p.flag;
|
||||
code = p.code;
|
||||
particleDef = p.particleDef;
|
||||
return;
|
||||
}
|
||||
|
||||
inline
|
||||
void Norz( const G4GHEKinematicsVector & p )
|
||||
{
|
||||
G4double a = p.momentum.mag2();
|
||||
if (a > 0.0) a = 1./sqrt(a);
|
||||
momentum.setX( a * p.momentum.x() );
|
||||
momentum.setY( a * p.momentum.y() );
|
||||
momentum.setZ( a * p.momentum.z() );
|
||||
mass = p.mass;
|
||||
energy = sqrt(momentum.mag2() + mass*mass);
|
||||
kineticEnergy = energy - mass;
|
||||
charge = p.charge;
|
||||
timeOfFlight = p.timeOfFlight;
|
||||
side = p.side;
|
||||
flag = p.flag;
|
||||
code = p.code;
|
||||
particleDef = p.particleDef;
|
||||
return;
|
||||
}
|
||||
|
||||
inline
|
||||
G4double Length()
|
||||
{
|
||||
return momentum.mag() ;
|
||||
}
|
||||
|
||||
inline
|
||||
void Exch( G4GHEKinematicsVector & p1)
|
||||
{
|
||||
G4GHEKinematicsVector mx = *this;
|
||||
// mx.momentum.SetX( momentum.x());
|
||||
// mx.momentum.SetY( momentum.y());
|
||||
// mx.momentum.SetZ( momentum.z());
|
||||
// mx.energy = energy;
|
||||
// mx.kineticEnergy = kineticEnergy;
|
||||
// mx.mass = mass;
|
||||
// mx.charge = charge;
|
||||
// mx.timeOfFlight = timeOfFlight;
|
||||
// mx.side = side;
|
||||
// mx.flag = flag;
|
||||
// mx.code = code;
|
||||
// momentum.setX( p1.momentum.x());
|
||||
// momentum.setY( p1.momentum.y());
|
||||
// momentum.setZ( p1.momentum.z());
|
||||
// energy = p1.energy;
|
||||
// kineticEnergy = p1.kineticEnergy;
|
||||
// mass = p1.mass;
|
||||
// charge = p1.charge;
|
||||
// timeOfFlight = p1.timeOfFlight;
|
||||
// side = p1.side
|
||||
// flag = p1.flag;
|
||||
// code = p1.code;
|
||||
*this = p1;
|
||||
p1 = mx;
|
||||
return;
|
||||
}
|
||||
|
||||
inline
|
||||
void Defs1( const G4GHEKinematicsVector & p1, const G4GHEKinematicsVector & p2)
|
||||
{
|
||||
G4double pt2 = sqr(p1.momentum.x()) + sqr(p1.momentum.y());
|
||||
if (pt2 > 0.0)
|
||||
{
|
||||
G4double ph, px, py, pz;
|
||||
G4double cost = p2.momentum.z()/p2.momentum.mag();
|
||||
G4double sint = 0.5 * ( sqrt(fabs((1.-cost)*(1.+cost)))
|
||||
+ sqrt(pt2)/p2.momentum.mag());
|
||||
(p2.momentum.y() < 0.) ? ph = 1.5*M_PI : ph = 0.5*M_PI;
|
||||
if( p2.momentum.x() != 0.0)
|
||||
ph = atan2(p2.momentum.y(),p2.momentum.x());
|
||||
px = cost*cos(ph)*p1.momentum.x() - sin(ph)*p1.momentum.y()
|
||||
+ sint*cos(ph)*p1.momentum.z();
|
||||
py = cost*sin(ph)*p1.momentum.x() + cos(ph)*p1.momentum.y()
|
||||
+ sint*sin(ph)*p1.momentum.z();
|
||||
pz = - sint *p1.momentum.x()
|
||||
+ cost *p1.momentum.z();
|
||||
momentum.setX( px );
|
||||
momentum.setY( py );
|
||||
momentum.setZ( pz );
|
||||
}
|
||||
else
|
||||
{
|
||||
momentum = p1.momentum;
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
void Defs( const G4GHEKinematicsVector & p1, const G4GHEKinematicsVector & p2,
|
||||
G4GHEKinematicsVector & my, G4GHEKinematicsVector & mz )
|
||||
{
|
||||
my = p1;
|
||||
mz = p2;
|
||||
momentum.setX( my.momentum.y()*mz.momentum.z()
|
||||
- my.momentum.z()*mz.momentum.y());
|
||||
momentum.setY( my.momentum.z()*mz.momentum.x()
|
||||
- my.momentum.x()*mz.momentum.z());
|
||||
momentum.setZ( my.momentum.x()*mz.momentum.y()
|
||||
- my.momentum.y()*mz.momentum.x());
|
||||
my.momentum.setX( mz.momentum.y()*momentum.z()
|
||||
- mz.momentum.z()*momentum.y());
|
||||
my.momentum.setY( mz.momentum.z()*momentum.x()
|
||||
- mz.momentum.x()*momentum.z());
|
||||
my.momentum.setZ( mz.momentum.x()*momentum.y()
|
||||
- mz.momentum.y()*momentum.x());
|
||||
G4double pp;
|
||||
pp = momentum.mag();
|
||||
if (pp > 0.)
|
||||
{
|
||||
pp = 1./pp;
|
||||
momentum.setX( momentum.x()*pp );
|
||||
momentum.setY( momentum.y()*pp );
|
||||
momentum.setZ( momentum.z()*pp );
|
||||
}
|
||||
pp = my.momentum.mag();
|
||||
if (pp > 0.)
|
||||
{
|
||||
pp = 1./pp;
|
||||
my.momentum.setX( my.momentum.x()*pp );
|
||||
my.momentum.setY( my.momentum.y()*pp );
|
||||
my.momentum.setZ( my.momentum.z()*pp );
|
||||
}
|
||||
pp = mz.momentum.mag();
|
||||
if (pp > 0.)
|
||||
{
|
||||
pp = 1./pp;
|
||||
mz.momentum.setX( mz.momentum.x()*pp );
|
||||
mz.momentum.setY( mz.momentum.y()*pp );
|
||||
mz.momentum.setZ( mz.momentum.z()*pp );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
inline
|
||||
void Trac( const G4GHEKinematicsVector & p1, const G4GHEKinematicsVector & mx,
|
||||
const G4GHEKinematicsVector & my, const G4GHEKinematicsVector & mz)
|
||||
{
|
||||
double px, py, pz;
|
||||
px = mx.momentum.x()*p1.momentum.x()
|
||||
+ mx.momentum.y()*p1.momentum.y()
|
||||
+ mx.momentum.z()*p1.momentum.z();
|
||||
py = my.momentum.x()*p1.momentum.x()
|
||||
+ my.momentum.y()*p1.momentum.y()
|
||||
+ my.momentum.z()*p1.momentum.z();
|
||||
pz = mz.momentum.x()*p1.momentum.x()
|
||||
+ mz.momentum.y()*p1.momentum.y()
|
||||
+ mz.momentum.z()*p1.momentum.z();
|
||||
momentum.setX( px );
|
||||
momentum.setY( py );
|
||||
momentum.setZ( pz );
|
||||
return;
|
||||
}
|
||||
|
||||
inline
|
||||
void Print( G4int L)
|
||||
{
|
||||
G4cout << "G4GHEKinematicsVector: "
|
||||
<< L << " " << momentum.x() << " " << momentum.y() << " " << momentum.z() << " "
|
||||
<< energy << " " << kineticEnergy << " " << mass << " " << charge << " "
|
||||
<< timeOfFlight << " " << side << " " << flag << " " << code << particleDef << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
G4ParticleMomentum momentum;
|
||||
G4double energy;
|
||||
G4double kineticEnergy;
|
||||
G4double mass;
|
||||
G4double charge;
|
||||
G4double timeOfFlight;
|
||||
G4int side;
|
||||
G4bool flag;
|
||||
G4int code;
|
||||
G4ParticleDefinition * particleDef;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,136 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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.
|
||||
//
|
||||
// $Id: G4LightMedia.hh,v 2.0 1998/07/02 16:38:35 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// Hadronic Process: Light Media Charge and/or Strangeness Exchange
|
||||
// J.L. Chuma, TRIUMF, 21-Feb-1997
|
||||
// Last modified: 21-Feb-1997
|
||||
|
||||
#ifndef G4LightMedia_h
|
||||
#define G4LightMedia_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4Nucleus.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
|
||||
class G4LightMedia
|
||||
{
|
||||
public:
|
||||
|
||||
G4LightMedia() { }
|
||||
|
||||
G4LightMedia( const G4LightMedia &right )
|
||||
{ *this = right; }
|
||||
|
||||
~G4LightMedia() { }
|
||||
|
||||
G4LightMedia & operator=( const G4LightMedia &right )
|
||||
{ return *this; }
|
||||
|
||||
G4bool operator==( const G4LightMedia &right ) const
|
||||
{ return ( this == (G4LightMedia *) &right ); }
|
||||
|
||||
G4bool operator!=( const G4LightMedia &right ) const
|
||||
{ return ( this != (G4LightMedia *) &right ); }
|
||||
|
||||
G4DynamicParticle * PionPlusExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * PionMinusExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * KaonPlusExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * KaonZeroShortExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * KaonZeroLongExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * KaonMinusExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * ProtonExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * AntiProtonExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * NeutronExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * AntiNeutronExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * LambdaExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * AntiLambdaExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * SigmaPlusExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * SigmaMinusExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * AntiSigmaPlusExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * AntiSigmaMinusExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * XiZeroExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * XiMinusExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * AntiXiZeroExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * AntiXiMinusExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * OmegaMinusExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
G4DynamicParticle * AntiOmegaMinusExchange(
|
||||
const G4DynamicParticle *incidentParticle,
|
||||
const G4Nucleus &aNucleus );
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,172 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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.
|
||||
//
|
||||
// $Id: G4Nucleus.hh,v 2.4 1998/10/05 09:12:03 pia Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// original by H.P. Wellisch
|
||||
// modified by J.L. Chuma, TRIUMF, 19-Nov-1996
|
||||
// last modified: 27-Mar-1997
|
||||
// Chr. Volcker, 10-Nov-1997: new methods and class variables.
|
||||
// M.G. Pia, 2 Oct 1998: modified GetFermiMomentum (original design was
|
||||
// the source of memory leaks)
|
||||
|
||||
#ifndef G4Nucleus_h
|
||||
#define G4Nucleus_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4ReactionProduct.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4ReactionProductVector.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
class G4Nucleus
|
||||
{
|
||||
public:
|
||||
|
||||
G4Nucleus() { pnBlackTrackEnergy = dtaBlackTrackEnergy = 0.0;
|
||||
excitationEnergy = 0.0;
|
||||
momentum = G4ThreeVector(0.,0.,0.);
|
||||
fermiMomentum = 1.52*hbarc/fermi;
|
||||
theTemp = 293.16*kelvin;
|
||||
}
|
||||
|
||||
G4Nucleus( const G4double A, const G4double Z )
|
||||
{
|
||||
SetParameters( A, Z );
|
||||
pnBlackTrackEnergy = dtaBlackTrackEnergy = 0.0;
|
||||
excitationEnergy = 0.0;
|
||||
momentum = G4ThreeVector(0.,0.,0.);
|
||||
fermiMomentum = 1.52*hbarc/fermi;
|
||||
theTemp = 293.16*kelvin;
|
||||
}
|
||||
|
||||
G4Nucleus( const G4Material *aMaterial )
|
||||
{
|
||||
ChooseParameters( aMaterial );
|
||||
pnBlackTrackEnergy = dtaBlackTrackEnergy = 0.0;
|
||||
excitationEnergy = 0.0;
|
||||
momentum = G4ThreeVector(0.,0.,0.);
|
||||
fermiMomentum = 1.52*hbarc/fermi;
|
||||
theTemp = aMaterial->GetTemperature();
|
||||
}
|
||||
|
||||
~G4Nucleus() {}
|
||||
|
||||
inline G4Nucleus( const G4Nucleus &right )
|
||||
{ *this = right; }
|
||||
|
||||
inline G4Nucleus & operator=( const G4Nucleus &right )
|
||||
{
|
||||
if( this != &right )
|
||||
{
|
||||
aEff=right.aEff;
|
||||
zEff=right.zEff;
|
||||
pnBlackTrackEnergy=right.pnBlackTrackEnergy;
|
||||
dtaBlackTrackEnergy=right.dtaBlackTrackEnergy;
|
||||
theTemp = right.theTemp;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline G4bool operator==( const G4Nucleus &right ) const
|
||||
{ return ( this == (G4Nucleus *) &right ); }
|
||||
|
||||
inline G4bool operator!=( const G4Nucleus &right ) const
|
||||
{ return ( this != (G4Nucleus *) &right ); }
|
||||
|
||||
void ChooseParameters( const G4Material *aMaterial );
|
||||
|
||||
void SetParameters( const G4double A, const G4double Z );
|
||||
|
||||
inline G4double GetN() const
|
||||
{ return aEff; }
|
||||
|
||||
inline G4double GetZ() const
|
||||
{ return zEff; }
|
||||
|
||||
G4DynamicParticle *ReturnTargetParticle() const;
|
||||
|
||||
G4double AtomicMass( const G4double A, const G4double Z ) const;
|
||||
|
||||
G4double GetThermalPz( const G4double mass, const G4double temp ) const;
|
||||
|
||||
G4ReactionProduct GetThermalNucleus(G4double aMass) const;
|
||||
|
||||
G4double Cinema( G4double kineticEnergy );
|
||||
|
||||
G4double EvaporationEffects( G4double kineticEnergy );
|
||||
|
||||
inline G4double GetPNBlackTrackEnergy() const
|
||||
{ return pnBlackTrackEnergy; }
|
||||
|
||||
inline G4double GetDTABlackTrackEnergy() const
|
||||
{ return dtaBlackTrackEnergy; }
|
||||
|
||||
// ****************** methods introduced by ChV ***********************
|
||||
// return fermi momentum
|
||||
G4ThreeVector GetFermiMomentum();
|
||||
|
||||
/*
|
||||
// return particle to be absorbed.
|
||||
G4DynamicParticle* ReturnAbsorbingParticle(G4double weight);
|
||||
*/
|
||||
|
||||
// final nucleus fragmentation. Return List of particles
|
||||
// which should be used for further tracking.
|
||||
G4ReactionProductVector* Fragmentate();
|
||||
|
||||
|
||||
// excitation Energy...
|
||||
void AddExcitationEnergy(G4double anEnergy);
|
||||
|
||||
|
||||
// momentum of absorbed Particles ..
|
||||
void AddMomentum(const G4ThreeVector aMomentum);
|
||||
|
||||
// return excitation Energy
|
||||
G4double GetEnergyDeposit() {return excitationEnergy; }
|
||||
|
||||
|
||||
|
||||
// ****************************** end ChV ******************************
|
||||
|
||||
|
||||
private:
|
||||
|
||||
G4double aEff; // effective atomic weight
|
||||
G4double zEff; // effective atomic number
|
||||
|
||||
G4double pnBlackTrackEnergy; // the kinetic energy available for
|
||||
// proton/neutron black track particles
|
||||
G4double dtaBlackTrackEnergy; // the kinetic energy available for
|
||||
// deuteron/triton/alpha particles
|
||||
|
||||
|
||||
// ************************** member variables by ChV *******************
|
||||
// Excitation Energy leading to evaporation or deexcitation.
|
||||
G4double excitationEnergy;
|
||||
|
||||
// Momentum, accumulated by absorbing Particles
|
||||
G4ThreeVector momentum;
|
||||
|
||||
// Fermi Gas model: at present, we assume constant nucleon density for all
|
||||
// nuclei. The radius of a nucleon is taken to be 1 fm.
|
||||
// see for example S.Fl"ugge, Encyclopedia of Physics, Vol XXXIX,
|
||||
// Structure of Atomic Nuclei (Berlin-Gottingen-Heidelberg, 1957) page 426.
|
||||
|
||||
// maximum momentum possible from fermi gas model:
|
||||
G4double fermiMomentum;
|
||||
G4double theTemp; // temperature
|
||||
// ****************************** end ChV ******************************
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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.
|
||||
//
|
||||
// $Id: G4ParticleVector.hh,v 2.1 1998/07/13 17:27:23 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// HPW decoupling theo models from RW (Mon Mar 16 1998)
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#ifndef G4ParticleVector_h
|
||||
#define G4ParticleVector_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include <rw/tpordvec.h>
|
||||
|
||||
// #ifdef STL
|
||||
// for future use STL vector as container
|
||||
// typedef Vector<G4DynamicParticle> G4ParticleVector;
|
||||
// #elseifdef RWT
|
||||
|
||||
typedef RWTPtrOrderedVector<G4DynamicParticle> G4ParticleVector;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,162 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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.
|
||||
//
|
||||
// $Id: G4ReactionDynamics.hh,v 2.0 1998/07/02 16:38:40 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// Hadronic Process: Reaction Dynamics
|
||||
// original by H.P. Wellisch
|
||||
// Modified by J.L.Chuma 19-Nov-96
|
||||
// Modified by J.L.Chuma 27-Mar-97
|
||||
// Modified by J.L.Chuma 30-Apr-97
|
||||
// Modified by J.L.Chuma 06-Aug-97 to include the original incident particle
|
||||
// before Fermi motion and evaporation effects
|
||||
|
||||
#ifndef G4ReactionDynamics_h
|
||||
#define G4ReactionDynamics_h 1
|
||||
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4ReactionProduct.hh"
|
||||
#include "G4Nucleus.hh"
|
||||
#include "G4FastVector.hh"
|
||||
|
||||
class G4ReactionDynamics
|
||||
{
|
||||
public:
|
||||
|
||||
G4ReactionDynamics() {}
|
||||
|
||||
~G4ReactionDynamics() {}
|
||||
|
||||
virtual G4double FindInelasticity()
|
||||
{ return 0.0; }
|
||||
|
||||
virtual G4double FindTimeDelay()
|
||||
{ return 0.0; }
|
||||
|
||||
G4bool GenerateXandPt( // derived from GENXPT
|
||||
G4FastVector<G4ReactionProduct,128> &vec,
|
||||
G4int &vecLen,
|
||||
G4ReactionProduct &modifiedOriginal, // Fermi motion & evap. effect included
|
||||
const G4DynamicParticle *originalIncident,
|
||||
G4ReactionProduct ¤tParticle,
|
||||
G4ReactionProduct &targetParticle,
|
||||
const G4Nucleus &targetNucleus,
|
||||
G4bool &incidentHasChanged,
|
||||
G4bool &targetHasChanged,
|
||||
G4bool leadFlag,
|
||||
G4ReactionProduct &leadingStrangeParticle );
|
||||
|
||||
void SuppressChargedPions(
|
||||
G4FastVector<G4ReactionProduct,128> &vec,
|
||||
G4int &vecLen,
|
||||
const G4ReactionProduct &modifiedOriginal,
|
||||
G4ReactionProduct ¤tParticle,
|
||||
G4ReactionProduct &targetParticle,
|
||||
const G4Nucleus &targetNucleus,
|
||||
G4bool &incidentHasChanged,
|
||||
G4bool &targetHasChanged );
|
||||
|
||||
G4bool TwoCluster( // derived from TWOCLU
|
||||
G4FastVector<G4ReactionProduct,128> &vec,
|
||||
G4int &vecLen,
|
||||
G4ReactionProduct &modifiedOriginal, // Fermi motion & evap. effect included
|
||||
const G4DynamicParticle *originalIncident,
|
||||
G4ReactionProduct ¤tParticle,
|
||||
G4ReactionProduct &targetParticle,
|
||||
const G4Nucleus &targetNucleus,
|
||||
G4bool &incidentHasChanged,
|
||||
G4bool &targetHasChanged,
|
||||
G4bool leadFlag,
|
||||
G4ReactionProduct &leadingStrangeParticle );
|
||||
|
||||
void TwoBody( // derived from TWOB
|
||||
G4FastVector<G4ReactionProduct,128> &vec,
|
||||
G4int &vecLen,
|
||||
G4ReactionProduct &modifiedOriginal,
|
||||
const G4DynamicParticle *originalTarget,
|
||||
G4ReactionProduct ¤tParticle,
|
||||
G4ReactionProduct &targetParticle,
|
||||
const G4Nucleus &targetNucleus,
|
||||
G4bool &targetHasChanged );
|
||||
|
||||
G4int Factorial( G4int n );
|
||||
|
||||
G4double GenerateNBodyEvent( // derived from PHASP
|
||||
const G4double totalEnergy,
|
||||
const G4bool constantCrossSection,
|
||||
G4FastVector<G4ReactionProduct,128> &vec,
|
||||
G4int &vecLen );
|
||||
|
||||
void ProduceStrangeParticlePairs(
|
||||
G4FastVector<G4ReactionProduct,128> &vec,
|
||||
G4int &vecLen,
|
||||
const G4ReactionProduct &modifiedOriginal,
|
||||
const G4DynamicParticle *originalTarget,
|
||||
G4ReactionProduct ¤tParticle,
|
||||
G4ReactionProduct &targetParticle,
|
||||
G4bool &incidentHasChanged,
|
||||
G4bool &targetHasChanged );
|
||||
|
||||
void NuclearReaction( // derived from NUCREC
|
||||
G4FastVector<G4ReactionProduct,3> &vec,
|
||||
G4int &vecLen,
|
||||
const G4DynamicParticle *originalIncident,
|
||||
const G4Nucleus &aNucleus,
|
||||
const G4double theAtomicMass,
|
||||
const G4double *massVec );
|
||||
|
||||
private:
|
||||
|
||||
void Rotate(
|
||||
const G4double numberofFinalStateNucleons,
|
||||
const G4ThreeVector &temp,
|
||||
const G4ReactionProduct &modifiedOriginal, // Fermi motion & evap. effect included
|
||||
const G4DynamicParticle *originalIncident,
|
||||
const G4Nucleus &targetNucleus,
|
||||
G4ReactionProduct ¤tParticle,
|
||||
G4ReactionProduct &targetParticle,
|
||||
G4FastVector<G4ReactionProduct,128> &vec,
|
||||
G4int &vecLen );
|
||||
|
||||
void Defs1(
|
||||
const G4ReactionProduct &modifiedOriginal,
|
||||
G4ReactionProduct ¤tParticle,
|
||||
G4ReactionProduct &targetParticle,
|
||||
G4FastVector<G4ReactionProduct,128> &vec,
|
||||
G4int &vecLen );
|
||||
|
||||
void AddBlackTrackParticles(
|
||||
const G4double epnb,
|
||||
const G4int npnb,
|
||||
const G4double edta,
|
||||
const G4int ndta,
|
||||
const G4double sprob,
|
||||
const G4double kineticMinimum,
|
||||
const G4double kineticFactor,
|
||||
const G4ReactionProduct &modifiedOriginal,
|
||||
G4double spall,
|
||||
const G4Nucleus &aNucleus,
|
||||
G4FastVector<G4ReactionProduct,128> &vec,
|
||||
G4int &vecLen );
|
||||
|
||||
void MomentumCheck(
|
||||
const G4ReactionProduct &modifiedOriginal,
|
||||
G4ReactionProduct ¤tParticle,
|
||||
G4ReactionProduct &targetParticle,
|
||||
G4FastVector<G4ReactionProduct,128> &vec,
|
||||
G4int &vecLen );
|
||||
|
||||
G4double normal();
|
||||
|
||||
G4int Poisson( G4double x );
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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.
|
||||
//
|
||||
// $Id: G4ReactionKinematics.hh,v 2.1 1998/07/12 03:07:47 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// GEANT 4 class header file --- Copyright CERN 1995
|
||||
// CERN Geneva Switzerland
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// ------------ G4ReactionDynamics::TwoBody ------
|
||||
// new inline method BreakupMomentum
|
||||
// new method TwoBodyScattering
|
||||
// by Christian V"olcker (CERN-Munich), August 1997
|
||||
// E-mail: Christian.Volcker@cern.ch
|
||||
// ************************************************************
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef G4ReactionKinematics_h
|
||||
#define G4ReactionKinematics_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4VRestProcess.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
|
||||
class G4ReactionKinematics {
|
||||
public:
|
||||
void TwoBodyScattering( const G4DynamicParticle* pIn1, const G4DynamicParticle* pIn2,
|
||||
G4DynamicParticle* pOut1, G4DynamicParticle* pOut2);
|
||||
|
||||
inline G4double BreakupMomentum( G4double totalMass, G4double m1, G4double m2);
|
||||
|
||||
};
|
||||
|
||||
inline G4double G4ReactionKinematics::BreakupMomentum(
|
||||
G4double totalMass, G4double massA, G4double massB){
|
||||
|
||||
// is aequivalent to G4double G4PhaseSpaceDecayChannel::Pmx !!
|
||||
|
||||
G4double m0squared=totalMass*totalMass;
|
||||
G4double breakupMomentumSquared=
|
||||
(m0squared-(massA+massB)*(massA+massB))*
|
||||
(m0squared-(massA-massB)*(massA-massB))/
|
||||
(4*m0squared);
|
||||
if (breakupMomentumSquared>0) return sqrt(breakupMomentumSquared);
|
||||
else return -1.;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,187 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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.
|
||||
//
|
||||
// $Id: G4ReactionProduct.hh,v 2.0 1998/07/02 16:38:42 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
// J.L. Chuma, TRIUMF, 31-Oct-1996
|
||||
// last modified: 19-Dec-1996
|
||||
// modified by J.L.Chuma, 24-Jul-1997 to include total momentum
|
||||
// inluded operator *, and some minor modifications.
|
||||
// modified by H.P.Wellisch to add functionality needed by string models,
|
||||
// cascade and Nucleus. (Mon Mar 16 1998)
|
||||
|
||||
#ifndef G4ReactionProduct_h
|
||||
#define G4ReactionProduct_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
|
||||
class G4ReactionProduct
|
||||
{
|
||||
friend G4ReactionProduct operator+(
|
||||
const G4ReactionProduct & p1, const G4ReactionProduct &p2 );
|
||||
|
||||
friend G4ReactionProduct operator-(
|
||||
const G4ReactionProduct & p1, const G4ReactionProduct &p2 );
|
||||
|
||||
friend G4ReactionProduct operator*(
|
||||
const G4double aDouble, const G4ReactionProduct &p2 )
|
||||
{
|
||||
G4ReactionProduct result;
|
||||
result.SetMomentum(aDouble*p2.GetMomentum());
|
||||
result.SetMass(p2.GetMass());
|
||||
result.SetTotalEnergy(sqrt(result.GetMass()*result.GetMass()+
|
||||
result.GetMomentum()*result.GetMomentum()));
|
||||
return result;
|
||||
}
|
||||
|
||||
public:
|
||||
G4ReactionProduct();
|
||||
|
||||
G4ReactionProduct( G4ParticleDefinition *aParticleDefinition );
|
||||
|
||||
~G4ReactionProduct() {}
|
||||
|
||||
G4ReactionProduct( const G4ReactionProduct &right );
|
||||
|
||||
G4ReactionProduct &operator= ( const G4ReactionProduct &right );
|
||||
|
||||
G4ReactionProduct &operator= ( const G4DynamicParticle &right );
|
||||
|
||||
inline G4bool operator== ( const G4ReactionProduct &right ) const
|
||||
{ return ( this == (G4ReactionProduct*) &right ); }
|
||||
|
||||
inline G4bool operator!= ( const G4ReactionProduct &right ) const
|
||||
{ return ( this != (G4ReactionProduct*) &right ); }
|
||||
|
||||
inline G4ParticleDefinition *GetDefinition() const
|
||||
{ return theParticleDefinition; }
|
||||
|
||||
void SetDefinition( G4ParticleDefinition *aParticleDefinition );
|
||||
|
||||
void SetDefinitionAndUpdateE( G4ParticleDefinition *aParticleDefinition );
|
||||
|
||||
void SetMomentum( const G4double x, const G4double y, const G4double z );
|
||||
|
||||
void SetMomentum( const G4double x, const G4double y );
|
||||
|
||||
void SetMomentum( const G4double z );
|
||||
|
||||
inline void SetMomentum( const G4ThreeVector &m )
|
||||
{ momentum = m; }
|
||||
|
||||
inline G4ThreeVector GetMomentum() const
|
||||
{ return momentum; }
|
||||
|
||||
inline G4double GetTotalMomentum() const
|
||||
{ return sqrt(abs(kineticEnergy*(totalEnergy+mass))); }
|
||||
|
||||
inline G4double GetTotalEnergy() const
|
||||
{ return totalEnergy; }
|
||||
|
||||
inline void SetKineticEnergy( const G4double e )
|
||||
{
|
||||
kineticEnergy = e;
|
||||
totalEnergy = kineticEnergy + mass;
|
||||
}
|
||||
|
||||
inline G4double GetKineticEnergy() const
|
||||
{ return kineticEnergy; }
|
||||
|
||||
inline void SetTotalEnergy( const G4double e )
|
||||
{
|
||||
totalEnergy = e;
|
||||
kineticEnergy = totalEnergy - mass;
|
||||
}
|
||||
|
||||
inline void SetMass( const G4double m )
|
||||
{ mass = m; }
|
||||
|
||||
inline G4double GetMass() const
|
||||
{ return mass; }
|
||||
|
||||
inline void SetTOF( const G4double t )
|
||||
{ timeOfFlight = t; }
|
||||
|
||||
inline G4double GetTOF() const
|
||||
{ return timeOfFlight; }
|
||||
|
||||
inline void SetSide( const G4int s )
|
||||
{ side = s; }
|
||||
|
||||
inline G4int GetSide() const
|
||||
{ return side; }
|
||||
|
||||
inline void SetNewlyAdded( const G4bool f )
|
||||
{ NewlyAdded = f; }
|
||||
|
||||
inline G4bool GetNewlyAdded() const
|
||||
{ return NewlyAdded; }
|
||||
|
||||
void SetZero();
|
||||
|
||||
void Lorentz( const G4ReactionProduct &p1, const G4ReactionProduct &p2 );
|
||||
|
||||
G4double Angle( const G4ReactionProduct &p ) const;
|
||||
|
||||
inline void SetPositionInNucleus(G4double x, G4double y, G4double z)
|
||||
{
|
||||
positionInNucleus.setX(x);
|
||||
positionInNucleus.setY(y);
|
||||
positionInNucleus.setZ(z);
|
||||
}
|
||||
|
||||
inline void SetPositionInNucleus( G4ThreeVector & aPosition )
|
||||
{
|
||||
positionInNucleus = aPosition;
|
||||
}
|
||||
|
||||
inline G4ThreeVector GetPositionInNucleus() const {return positionInNucleus; }
|
||||
inline G4double GetXPositionInNucleus() const { return positionInNucleus.x(); }
|
||||
inline G4double GetYPositionInNucleus() const { return positionInNucleus.y(); }
|
||||
inline G4double GetZPositionInNucleus() const { return positionInNucleus.z(); }
|
||||
|
||||
inline void SetFormationTime(G4double aTime) { formationTime = aTime; }
|
||||
|
||||
inline G4double GetFormationTime() const { return formationTime; }
|
||||
|
||||
inline void HasInitialStateParton(G4bool aFlag) { hasInitialStateParton = aFlag; }
|
||||
|
||||
inline G4bool HasInitialStateParton() const { return hasInitialStateParton; }
|
||||
|
||||
private:
|
||||
|
||||
G4ParticleDefinition *theParticleDefinition;
|
||||
|
||||
// for use with string models and cascade.
|
||||
G4ThreeVector positionInNucleus;
|
||||
G4double formationTime;
|
||||
G4bool hasInitialStateParton;
|
||||
|
||||
// mass is included here, since pseudo-particles are created with masses different
|
||||
// than the standard particle masses, and we are not allowed to create particles
|
||||
G4double mass;
|
||||
|
||||
G4ThreeVector momentum;
|
||||
|
||||
G4double totalEnergy;
|
||||
G4double kineticEnergy;
|
||||
|
||||
G4double timeOfFlight;
|
||||
|
||||
// side refers to how the particles are distributed in the
|
||||
// forward (+) and backward (-) hemispheres in the center of mass system
|
||||
G4int side;
|
||||
|
||||
// NewlyAdded refers to particles added by "nuclear excitation", or as
|
||||
// "black track" particles, or as deuterons, tritons, and alphas
|
||||
G4bool NewlyAdded;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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.
|
||||
//
|
||||
// $Id: G4ReactionProductVector.hh,v 2.1 1998/07/13 17:27:24 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD group
|
||||
// History: first implementation, alternative to G4FastVector
|
||||
// less fast, but it has variable array length and checks boundaries
|
||||
// 26th September, Chr. Voelcker
|
||||
// ------------------------------------------------------------
|
||||
|
||||
#ifndef G4ReactionProductVector_h
|
||||
#define G4ReactionProductVector_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
class G4ReactionProduct;
|
||||
#include <rw/tpordvec.h>
|
||||
|
||||
// #ifdef STL
|
||||
// //in future use STL vector as container of reaction products ...
|
||||
// typedef Vector<G4ReactionProduct> G4ReactionProductVector;
|
||||
// #elseifdef RWT
|
||||
|
||||
typedef RWTPtrOrderedVector<G4ReactionProduct> G4ReactionProductVector;
|
||||
|
||||
// #endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,49 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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.
|
||||
//
|
||||
// $Id: G4StableIsotopes.hh,v 2.0 1998/07/02 16:38:46 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
//
|
||||
#ifndef G4StableIsotopes_h
|
||||
#define G4StableIsotopes_h 1
|
||||
|
||||
// class, that knows the stable isotopes for all elements.
|
||||
// H.P. Wellisch, 21. Nov. 1997
|
||||
// Accessable by name, and Z
|
||||
//
|
||||
// To loop over all isotopes for element with protonount Z
|
||||
// G4StableIsotopes theIso;
|
||||
// for (G4int i=0; i<theIso.GetNumberOfIsotopes(); i++)
|
||||
// {
|
||||
// G4double fracInPercent=theIso.GetAbundance(theIso.GetFirstIsotope(Z)+i);
|
||||
// }
|
||||
//
|
||||
#include "globals.hh"
|
||||
|
||||
class G4StableIsotopes
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
G4String GetName(G4int Z) {return elementName[Z-1];}
|
||||
G4int GetNumberOfIsotopes(G4int Z) {return nIsotopes[Z-1];}
|
||||
G4int GetFirstIsotope(G4int Z) {return start[Z-1];}
|
||||
G4int GetIsotopeNucleonCount(G4int number) {return nucleonCount[number];}
|
||||
G4double GetAbundance(G4int number) {return abundance[number];}
|
||||
G4int GetProtonCount(G4int Z) {return protonCount[Z-1];}
|
||||
|
||||
public:
|
||||
|
||||
static const G4int protonCount[92];
|
||||
static const G4String elementName[92];
|
||||
static const G4int nIsotopes[92];
|
||||
static const G4int start[92];
|
||||
static const G4int nucleonCount[287];
|
||||
static const G4double abundance[287];
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user