This commit is contained in:
paraiso 2006-02-23 12:56:23 +00:00
parent 93d0ce2282
commit 6b7cd78467
59 changed files with 0 additions and 9545 deletions

View File

@ -1,629 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4ChordFinder.cc,v 1.45 2003/11/13 19:46:56 japost Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
// 25.02.97 John Apostolakis, design and implimentation
// 05.03.97 V. Grichine , style modification
// -------------------------------------------------------------------
#include "G4ChordFinder.hh"
#include "G4MagneticField.hh"
#include "G4ElectricField.hh"
#include "G4El_UsualEqRhs.hh"
#include "G4Mag_UsualEqRhs.hh"
#include "G4ClassicalRK4.hh"
#include <iomanip>
#include "G4ios.hh"
#include "G4Transform3D.hh"
#include "G4UnitsTable.hh"
// ..........................................................................
G4ChordFinder::G4ChordFinder(G4MagInt_Driver* pIntegrationDriver)
: fDefaultDeltaChord( 0.25 * mm ),
fDeltaChord( fDefaultDeltaChord ),
fAllocatedStepper(false),
fEquation(0),
fDriversStepper(0),
fFirstFraction(0.999), fFractionLast(1.00), fFractionNextEstimate(0.98),
fMultipleRadius(15.0),
fTotalNoTrials_FNC(0), fNoCalls_FNC(0), fmaxTrials_FNC(0),
fStatsVerbose(0)
{
// Simple constructor which does not create equation, ..
// fDeltaChord= fDefaultDeltaChord;
fIntgrDriver= pIntegrationDriver;
fAllocatedStepper= false;
fLastStepEstimate_Unconstrained = DBL_MAX; // Should move q, p to
SetFractions_Last_Next( fFractionLast, fFractionNextEstimate);
// check the values and set the other parameters
}
// ..........................................................................
G4ChordFinder::G4ChordFinder( G4MagneticField* theMagField,
G4double stepMinimum,
G4MagIntegratorStepper* pItsStepper )
: fDefaultDeltaChord( 0.25 * mm ),
fDeltaChord( fDefaultDeltaChord ),
fAllocatedStepper(false),
fEquation(0),
fDriversStepper(0),
fFirstFraction(0.999), fFractionLast(1.00), fFractionNextEstimate(0.98),
fMultipleRadius(15.0),
fTotalNoTrials_FNC(0), fNoCalls_FNC(0), fmaxTrials_FNC(0),
fStatsVerbose(0)
{
// Construct the Chord Finder
// by creating in inverse order the Driver, the Stepper and EqRhs ...
G4Mag_EqRhs *pEquation = new G4Mag_UsualEqRhs(theMagField);
fEquation = pEquation;
fLastStepEstimate_Unconstrained = DBL_MAX; // Should move q, p to
// G4FieldTrack ??
SetFractions_Last_Next( fFractionLast, fFractionNextEstimate);
// check the values and set the other parameters
// --->> Charge Q = 0
// --->> Momentum P = 1 NOMINAL VALUES !!!!!!!!!!!!!!!!!!
if( pItsStepper == 0 )
{
pItsStepper = fDriversStepper = new G4ClassicalRK4(pEquation);
fAllocatedStepper= true;
}
else
{
fAllocatedStepper= false;
}
fIntgrDriver = new G4MagInt_Driver(stepMinimum, pItsStepper,
pItsStepper->GetNumberOfVariables() );
}
// .........................................................................
G4ChordFinder::G4ChordFinder( G4ElectricField* theElField,
G4double stepMinimum,
G4MagIntegratorStepper* pItsStepper )
: fDefaultDeltaChord( 0.25 * mm ),
fDeltaChord( fDefaultDeltaChord ),
fAllocatedStepper(false),
fEquation(0),
fDriversStepper(0),
fFirstFraction(0.999), fFractionLast(1.00), fFractionNextEstimate(0.98),
fMultipleRadius(15.0),
fTotalNoTrials_FNC(0), fNoCalls_FNC(0), fmaxTrials_FNC(0),
fStatsVerbose(0)
{ // Construct the Chord Finder
// by creating in inverse order the Driver, the Stepper and EqRhs ...
G4El_UsualEqRhs *pEquation = new G4El_UsualEqRhs(theElField);
fEquation = pEquation;
fLastStepEstimate_Unconstrained = DBL_MAX; // Should move q, p to
// G4FieldTrack ??
SetFractions_Last_Next( fFractionLast, fFractionNextEstimate);
// check the values and set the other parameters
// --->> Charge Q = 0
// --->> Momentum P = 1 NOMINAL VALUES !!!!!!!!!!!!!!!!!!
if( pItsStepper == 0 )
{
pItsStepper = fDriversStepper = new G4ClassicalRK4(pEquation);
fAllocatedStepper= true;
}
else
{
fAllocatedStepper= false;
}
fIntgrDriver = new G4MagInt_Driver(stepMinimum, pItsStepper,
pItsStepper->GetNumberOfVariables() );
G4cout << " CHORD FINDER :: init..."
<< G4endl;
// tao
mfield=theElField;
}
// ......................................................................
void
G4ChordFinder::SetFractions_Last_Next( G4double fractLast, G4double fractNext )
{
// Use -1.0 as request for Default.
if( fractLast == -1.0 ) fractLast = 1.0; // 0.9;
if( fractNext == -1.0 ) fractNext = 0.98; // 0.9;
// fFirstFraction = 0.999; // Orig 0.999 A safe value, range: ~ 0.95 - 0.999
// fMultipleRadius = 15.0; // For later use, range: ~ 2 - 20
if( fStatsVerbose ) {
G4cout << " ChordFnd> Trying to set fractions: "
<< " first " << fFirstFraction
<< " last " << fractLast
<< " next " << fractNext
<< " and multiple " << fMultipleRadius
<< G4endl;
}
if( (fractLast > 0.0) && (fractLast <=1.0) )
{ fFractionLast= fractLast; }
else
G4cerr << "G4ChordFinder:: SetFractions_Last_Next: Invalid "
<< " fraction Last = " << fractLast
<< " must be 0 < fractionLast <= 1 " << G4endl;
if( (fractNext > 0.0) && (fractNext <1.0) )
{ fFractionNextEstimate = fractNext; }
else
G4cerr << "G4ChordFinder:: SetFractions_Last_Next: Invalid "
<< " fraction Next = " << fractNext
<< " must be 0 < fractionNext < 1 " << G4endl;
}
// ......................................................................
G4ChordFinder::~G4ChordFinder()
{
delete fEquation; // fIntgrDriver->pIntStepper->theEquation_Rhs;
if( fAllocatedStepper)
{
delete fDriversStepper;
} // fIntgrDriver->pIntStepper;}
delete fIntgrDriver;
if( fStatsVerbose ) { PrintStatistics(); }
}
void
G4ChordFinder::PrintStatistics()
{
// Print Statistics
G4cout << "G4ChordFinder statistics report: " << G4endl;
G4cout
<< " No trials: " << fTotalNoTrials_FNC
<< " No Calls: " << fNoCalls_FNC
<< " Max-trial: " << fmaxTrials_FNC
<< G4endl;
G4cout
<< " Parameters: "
<< " fFirstFraction " << fFirstFraction
<< " fFractionLast " << fFractionLast
<< " fFractionNextEstimate " << fFractionNextEstimate
<< G4endl;
}
// ......................................................................
G4double
G4ChordFinder::AdvanceChordLimited( G4FieldTrack& yCurrent,
G4double stepMax,
G4double epsStep,
const G4ThreeVector latestSafetyOrigin,
G4double latestSafetyRadius
)
{
G4double stepPossible;
G4double dyErr;
G4FieldTrack yEnd( yCurrent);
G4double startCurveLen= yCurrent.GetCurveLength();
G4double nextStep;
// *************
stepPossible= FindNextChord(yCurrent, stepMax, yEnd, dyErr, epsStep, &nextStep
, latestSafetyOrigin, latestSafetyRadius
);
// *************
G4bool good_advance;
if ( dyErr < epsStep * stepPossible )
{
// Accept this accuracy.
yCurrent = yEnd;
good_advance = true;
}
else
{
// Advance more accurately to "end of chord"
// ***************
good_advance = fIntgrDriver->AccurateAdvance(yCurrent, stepPossible, epsStep, nextStep);
// ***************
if ( ! good_advance ){
// In this case the driver could not do the full distance
stepPossible= yCurrent.GetCurveLength()-startCurveLen;
}
}
#ifdef G4DEBUG_FIELD
G4cout << "Exiting FindNextChord Limited with:" << G4endl
<< " yCurrent: " << yCurrent<< G4endl
<<" step possible: " << stepPossible <<G4endl;
G4cout << "G4ChordFinder report: final fieldtrack \n" << yCurrent <<"\n"
<< "spin" << yCurrent.GetSpin() <<"\n"
<<"time of flight" <<yCurrent.GetProperTimeOfFlight()/ns <<"\n"
<<G4endl;
#endif
return stepPossible;
}
// #define TEST_CHORD_PRINT 1
// ............................................................................
G4double
G4ChordFinder::FindNextChord( const G4FieldTrack yStart,
G4double stepMax,
G4FieldTrack& yEnd, // Endpoint
G4double& dyErrPos, // Error of endpoint
G4double epsStep,
G4double* pStepForAccuracy,
const G4ThreeVector, // latestSafetyOrigin,
G4double // latestSafetyRadius
)
// Returns Length of Step taken
{
// G4int stepRKnumber=0;
G4FieldTrack yCurrent= yStart;
G4double stepTrial, stepForAccuracy;
G4double dydx[G4FieldTrack::ncompSVEC];
// 1.) Try to "leap" to end of interval
// 2.) Evaluate if resulting chord gives d_chord that is good enough.
// 2a.) If d_chord is not good enough, find one that is.
G4bool validEndPoint= false;
G4double dChordStep, lastStepLength; // stepOfLastGoodChord;
#ifdef DEBUG_FIELD
G4cout <<"\n---------- G4ChordFinder :: init FieldTrack : " << yCurrent << "\n------------";
#endif
fIntgrDriver-> GetDerivatives( yCurrent, dydx ) ;
#ifdef DEBUG_FIELD
G4cout <<"\n---------- G4ChordFinder :: derivative got, entering loop : dydx "
<< dydx[0] <<" " << dydx[1] <<" "<< dydx[2] <<" "<<"\n"
<< dydx[3] <<" " << dydx[4] <<" "<< dydx[5] <<" "<<"\n"
<< dydx[6] <<" " << dydx[7] <<" "<< dydx[8] <<" "<<"\n"
<< dydx[9] <<" " << dydx[10] <<" "<< dydx[11] <<" "<<"\n"
<<G4endl;
#endif
G4int noTrials=0;
const G4double safetyFactor= fFirstFraction; // 0.975 or 0.99 ? was 0.999
stepTrial = std::min( stepMax,
safetyFactor * fLastStepEstimate_Unconstrained );
G4double newStepEst_Uncons= 0.0;
do
{
#ifdef DEBUG_FIELD
G4cout <<"\n---------- G4ChordFinder :: quick Advance : " << yCurrent << "\n------------";
#endif
G4double stepForChord;
yCurrent = yStart; // Always start from initial point
// ************
fIntgrDriver->QuickAdvance( yCurrent, dydx, stepTrial,
dChordStep, dyErrPos);
// ************
#ifdef DEBUG_FIELD
G4cout <<"\n---------- G4ChordFinder :: current FieldTrack : " << yCurrent << "\n------------";
#endif
// We check whether the criterion is met here.
validEndPoint = AcceptableMissDist(dChordStep);
// && (dyErrPos < eps) ;
lastStepLength = stepTrial;
// This method estimates to step size for a good chord.
stepForChord = NewStep(stepTrial, dChordStep, newStepEst_Uncons );
if( ! validEndPoint ) {
if( stepTrial<=0.0 )
stepTrial = stepForChord;
else if (stepForChord <= stepTrial)
// Reduce by a fraction, possibly up to 20%
stepTrial = std::min( stepForChord,
fFractionLast * stepTrial);
else
stepTrial *= 0.1;
// if(dbg) G4cerr<<"Dchord too big. Try new hstep="<<stepTrial<<G4endl;
}
// #ifdef TEST_CHORD_PRINT
// TestChordPrint( noTrials, lastStepLength, dChordStep, stepTrial );
// #endif
noTrials++;
}
while( ! validEndPoint ); // End of do-while RKD
if( newStepEst_Uncons > 0.0 ){
fLastStepEstimate_Unconstrained= newStepEst_Uncons;
}
AccumulateStatistics( noTrials );
// stepOfLastGoodChord = stepTrial;
if( pStepForAccuracy ){
// Calculate the step size required for accuracy, if it is needed
G4double dyErr_relative = dyErrPos/(epsStep*lastStepLength);
if( dyErr_relative > 1.0 ) {
stepForAccuracy =
fIntgrDriver->ComputeNewStepSize( dyErr_relative,
lastStepLength );
}else{
stepForAccuracy = 0.0; // Convention to show step was ok
}
*pStepForAccuracy = stepForAccuracy;
}
#ifdef TEST_CHORD_PRINT
// static int dbg=0;
// if( dbg )
G4cout << "ChordF/FindNextChord: NoTrials= " << noTrials
<< " StepForGoodChord=" << std::setw(10) << stepTrial << G4endl;
#endif
yEnd= yCurrent;
return stepTrial;
}
// ----------------------------------------------------------------------------
#if 0
// #ifdef G4VERBOSE
if( dbg ) {
G4cerr << "Returned from QuickAdvance with: yCur=" << yCurrent <<G4endl;
G4cerr << " dChordStep= "<< dChordStep <<" dyErr=" << dyErr << G4endl;
}
#endif
// ----------------------------------------------------------------------------
// ...........................................................................
G4double G4ChordFinder::NewStep(G4double stepTrialOld,
G4double dChordStep, // Curr. dchord achieved
G4double& stepEstimate_Unconstrained )
//
// Is called to estimate the next step size, even for successful steps,
// in order to predict an accurate 'chord-sensitive' first step
// which is likely to assist in more performant 'stepping'.
//
{
G4double stepTrial;
static G4double lastStepTrial = 1., lastDchordStep= 1.;
#if 1
// const G4double threshold = 1.21, multiplier = 0.9;
// 0.9 < 1 / sqrt(1.21)
if (dChordStep > 0.0)
{
stepEstimate_Unconstrained = stepTrialOld*sqrt( fDeltaChord / dChordStep );
// stepTrial = 0.98 * stepEstimate_Unconstrained;
stepTrial = fFractionNextEstimate * stepEstimate_Unconstrained;
}
else
{
// Should not update the Unconstrained Step estimate: incorrect!
stepTrial = stepTrialOld * 2.;
}
// if ( dChordStep < threshold * fDeltaChord ){
// stepTrial= stepTrialOld * multiplier;
// }
if( stepTrial <= 0.001 * stepTrialOld)
{
if ( dChordStep > 1000.0 * fDeltaChord ){
stepTrial= stepTrialOld * 0.03;
}else{
if ( dChordStep > 100. * fDeltaChord ){
stepTrial= stepTrialOld * 0.1;
}else{
// Try halving the length until dChordStep OK
stepTrial= stepTrialOld * 0.5;
}
}
}else if (stepTrial > 1000.0 * stepTrialOld)
{
stepTrial= 1000.0 * stepTrialOld;
}
if( stepTrial == 0.0 ){
stepTrial= 0.000001;
}
lastStepTrial = stepTrialOld;
lastDchordStep= dChordStep;
#else
if ( dChordStep > 1000. * fDeltaChord ){
stepTrial= stepTrialOld * 0.03;
}else{
if ( dChordStep > 100. * fDeltaChord ){
stepTrial= stepTrialOld * 0.1;
}else{
// Keep halving the length until dChordStep OK
stepTrial= stepTrialOld * 0.5;
}
}
#endif
// A more sophisticated chord-finder could figure out a better
// stepTrial, from dChordStep and the required d_geometry
// eg
// Calculate R, r_helix (eg at orig point)
// if( stepTrial < 2 pi R )
// stepTrial = R arc_cos( 1 - fDeltaChord / r_helix )
// else
// ??
return stepTrial;
}
//
// Given a starting curve point A (CurveA_PointVelocity), a later
// curve point B (CurveB_PointVelocity) and a point E which is (generally)
// not on the curve, find and return a point F which is on the curve and
// which is close to E. While advancing towards F utilise eps_step
// as a measure of the relative accuracy of each Step.
G4FieldTrack
G4ChordFinder::ApproxCurvePointV( const G4FieldTrack& CurveA_PointVelocity,
const G4FieldTrack& CurveB_PointVelocity,
const G4ThreeVector& CurrentE_Point,
G4double eps_step)
{
// 1st implementation:
// if r=|AE|/|AB|, and s=true path lenght (AB)
// return the point that is r*s along the curve!
G4FieldTrack Current_PointVelocity= CurveA_PointVelocity;
G4ThreeVector CurveA_Point= CurveA_PointVelocity.GetPosition();
G4ThreeVector CurveB_Point= CurveB_PointVelocity.GetPosition();
G4ThreeVector ChordAB_Vector= CurveB_Point - CurveA_Point;
G4ThreeVector ChordAE_Vector= CurrentE_Point - CurveA_Point;
G4double ABdist= ChordAB_Vector.mag();
G4double curve_length; // A curve length of AB
G4double AE_fraction;
curve_length= CurveB_PointVelocity.GetCurveLength()
- CurveA_PointVelocity.GetCurveLength();
// const
G4double integrationInaccuracyLimit= std::max( perMillion, 0.5*eps_step );
if( curve_length < ABdist * (1. - integrationInaccuracyLimit) ){
#ifdef G4DEBUG_FIELD
G4cerr << " Warning in G4ChordFinder::ApproxCurvePoint: "
<< G4endl
<< " The two points are further apart than the curve length "
<< G4endl
<< " Dist = " << ABdist
<< " curve length = " << curve_length
<< " relativeDiff = " << (curve_length-ABdist)/ABdist
<< G4endl;
if( curve_length < ABdist * (1. - 10*eps_step) ) {
G4cerr << " ERROR: the size of the above difference"
<< " exceeds allowed limits. Aborting." << G4endl;
G4Exception("G4ChordFinder::ApproxCurvePointV()", "PrecisionError",
FatalException, "Unphysical curve length.");
}
#endif
// Take default corrective action:
// --> adjust the maximum curve length.
// NOTE: this case only happens for relatively straight paths.
curve_length = ABdist;
}
G4double new_st_length;
if ( ABdist > 0.0 ){
AE_fraction = ChordAE_Vector.mag() / ABdist;
}else{
AE_fraction = 0.5; // Guess .. ?;
#ifdef G4DEBUG_FIELD
G4cout << "Warning in G4ChordFinder::ApproxCurvePoint:"
<< " A and B are the same point!" << G4endl
<< " Chord AB length = " << ChordAE_Vector.mag() << G4endl
<< G4endl;
#endif
}
if( (AE_fraction> 1.0 + perMillion) || (AE_fraction< 0.) ){
#ifdef G4DEBUG_FIELD
G4cerr << " G4ChordFinder::ApproxCurvePointV - Warning:"
<< " Anomalous condition:AE > AB or AE/AB <= 0 " << G4endl
<< " AE_fraction = " << AE_fraction << G4endl
<< " Chord AE length = " << ChordAE_Vector.mag() << G4endl
<< " Chord AB length = " << ABdist << G4endl << G4endl;
G4cerr << " OK if this condition occurs after a recalculation of 'B'"
<< G4endl << " Otherwise it is an error. " << G4endl ;
#endif
// This course can now result if B has been re-evaluated,
// without E being recomputed (1 July 99)
// In this case this is not a "real error" - but it undesired
// and we cope with it by a default corrective action ...
AE_fraction = 0.5; // Default value
}
new_st_length= AE_fraction * curve_length;
G4bool good_advance;
if ( AE_fraction > 0.0 ) {
good_advance =
fIntgrDriver->AccurateAdvance(Current_PointVelocity,
new_st_length,
eps_step ); // Relative accuracy
// In this case it does not matter if it cannot advance the full distance
}
// If there was a memory of the step_length actually require at the start
// of the integration Step, this could be re-used ...
return Current_PointVelocity;
}
void
G4ChordFinder::TestChordPrint( G4int noTrials,
G4int lastStepTrial,
G4double dChordStep,
G4double nextStepTrial )
{
G4int oldprec= G4cout.precision(5);
G4cout << " ChF/fnc: notrial " << std::setw( 3) << noTrials
<< " this_step= " << std::setw(10) << lastStepTrial;
if( fabs( (dChordStep / fDeltaChord) - 1.0 ) < 0.001 ){
G4cout.precision(8);
}else{ G4cout.precision(6); }
G4cout << " dChordStep= " << std::setw(12) << dChordStep;
if( dChordStep > fDeltaChord ) { G4cout << " d+"; }
else { G4cout << " d-"; }
G4cout.precision(5);
G4cout << " new_step= " << std::setw(10)
<< fLastStepEstimate_Unconstrained
<< " new_step_constr= " << std::setw(10)
<< lastStepTrial << G4endl;
G4cout << " nextStepTrial = " << std::setw(10) << nextStepTrial << G4endl;
G4cout.precision(oldprec);
}

View File

@ -1,198 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4ChordFinder.hh,v 1.16 2003/11/13 17:53:47 japost Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
// class G4ChordFinder
//
// Class description:
//
// A class that provides RK integration of motion ODE (as does g4magtr)
// and also has a method that returns an Approximate point on the curve
// near to a (chord) point.
// History:
// - 25.02.97 John Apostolakis, design and implementation
// - 05.03.97 V. Grichine , makeup to G4 'standard'
// -------------------------------------------------------------------
#ifndef G4CHORDFINDER_HH
#define G4CHORDFINDER_HH
#include "G4MagIntegratorDriver.hh"
#include "G4FieldTrack.hh"
class G4MagneticField;
class G4ElectricField;
class G4ChordFinder
{
public: // with description
G4ChordFinder( G4MagInt_Driver* pIntegrationDriver );
G4ChordFinder( G4MagneticField* itsMagField,
G4double stepMinimum = 1.0e-2 * mm,
G4MagIntegratorStepper* pItsStepper = 0 );
// A constructor that creates defaults for all "children" classes.
G4ChordFinder( G4ElectricField* itsElField,
G4double stepMinimum = 1.0e-2 * mm,
G4MagIntegratorStepper* pItsStepper = 0 );
virtual ~G4ChordFinder();
G4double AdvanceChordLimited( G4FieldTrack& yCurrent,
G4double stepInitial,
G4double epsStep_Relative,
const G4ThreeVector latestSafetyOrigin,
G4double lasestSafetyRadius);
// Uses ODE solver's driver to find the endpoint that satisfies
// the chord criterion: that d_chord < delta_chord
// -> Returns Length of Step taken.
G4FieldTrack ApproxCurvePointV(const G4FieldTrack& curveAPointVelocity,
const G4FieldTrack& curveBPointVelocity,
const G4ThreeVector& currentEPoint,
G4double epsStep);
inline G4double GetDeltaChord() const;
inline void SetDeltaChord(G4double newval);
inline void SetChargeMomentumMass(G4double pCharge, // in e+ units
G4double pMomentum,
G4double pMass );
// Function to inform integration driver of charge, speed.
inline void SetIntegrationDriver(G4MagInt_Driver* IntegrationDriver);
inline G4MagInt_Driver* GetIntegrationDriver();
// Access and set Driver.
inline void ResetStepEstimate();
// Clear internal state (last step estimate)
inline G4int GetNoCalls();
inline G4int GetNoTrials(); // Total number of trials
inline G4int GetNoMaxTrials(); // Maximum # of trials for one call
// Get statistics about number of calls & trials in FindNextChord
virtual void PrintStatistics();
// A report with the above -- and possibly other stats
inline G4int SetVerbose( G4int newvalue=1);
// Set verbosity and return old value
protected: // .........................................................
inline void AccumulateStatistics( G4int noTrials );
// Accumulate the basic statistics
// - other specialised ones must be kept by derived classes
inline G4bool AcceptableMissDist(G4double dChordStep) const;
G4double NewStep( G4double stepTrialOld,
G4double dChordStep, // Current dchord estimate
G4double& stepEstimate_Unconstrained ) ;
virtual G4double FindNextChord( const G4FieldTrack yStart,
G4double stepMax,
G4FieldTrack& yEnd,
G4double& dyErr, // Error of endpoint
G4double epsStep,
G4double* pNextStepForAccuracy, // = 0,
const G4ThreeVector latestSafetyOrigin,
G4double latestSafetyRadius
);
void PrintDchordTrial(G4int noTrials,
G4double stepTrial,
G4double oldStepTrial,
G4double dChordStep);
public: // no description
void TestChordPrint( G4int noTrials,
G4int lastStepTrial,
G4double dChordStep,
G4double nextStepTrial );
// Printing for monitoring ...
inline G4double GetFirstFraction(); // Originally 0.999
inline G4double GetFractionLast(); // Originally 1.000
inline G4double GetFractionNextEstimate(); // Originally 0.980
inline G4double GetMultipleRadius(); // No original value
// Parameters for adapting performance ... use with great care
public: // with description
void SetFractions_Last_Next( G4double fractLast= 0.90,
G4double fractNext= 0.95 );
// Parameters for performance ... change with great care
inline void SetFirstFraction(G4double fractFirst);
// Parameter for performance ... change with great care
protected:
inline G4double GetLastStepEstimateUnc();
inline void SetLastStepEstimateUnc( G4double stepEst );
private: // ............................................................
G4ChordFinder(const G4ChordFinder&);
G4ChordFinder& operator=(const G4ChordFinder&);
// Private copy constructor and assignment operator.
private: // ............................................................
// G4int nOK, nBAD;
G4MagInt_Driver* fIntgrDriver;
const G4double fDefaultDeltaChord; // SET in G4ChordFinder.cc = 0.25 mm
G4double fDeltaChord; // Maximum miss distance
G4double fLastStepEstimate_Unconstrained; // State information for efficiency
// Variables used in construction/destruction
G4bool fAllocatedStepper;
G4EquationOfMotion* fEquation;
G4MagIntegratorStepper* fDriversStepper;
// Parameters
G4double fFirstFraction, fFractionLast, fFractionNextEstimate;
G4double fMultipleRadius;
// For Statistics
// -- G4int fNoTrials, fNoCalls;
G4int fTotalNoTrials_FNC, fNoCalls_FNC, fmaxTrials_FNC; // fnoTimesMaxTrFNC;
G4int fStatsVerbose; // if > 0, print Statistics in destructor
G4double itime, ftime;
G4ElectricField* mfield;
G4int firstChord;
};
// Inline function implementation:
#include "G4ChordFinder.icc"
#endif // G4CHORDFINDER_HH

View File

@ -1,80 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4El_EqRhs.cc,v 1.10 2003/11/05 16:33:55 japost Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
// This is the standard right-hand side for equation of motion
// in a pure Electric Field .
//
// Other that might be required are:
// i) is when using a moving reference frame ... or
// ii) extending for other forces, eg an electric field
//
// J. Apostolakis, January 13th, 1997
//
// --------------------------------------------------------------------
#include "G4ElectricField.hh"
#include "G4El_EqRhs.hh"
#include "globals.hh"
//const G4double G4El_EqRhs::fUnitConstant = 0.299792458 * (GeV/(tesla*m));
// Constructor Implementation
//
G4El_EqRhs::G4El_EqRhs( G4ElectricField *elField )
: G4EquationOfMotion(elField)
{
}
G4El_EqRhs::~G4El_EqRhs() { }
void G4El_EqRhs::RightHandSide( const G4double y[],
G4double dydx[] ) const
{
G4double Field[3];
G4double PositionAndTime[4];
// Position
PositionAndTime[0] = y[0];
PositionAndTime[1] = y[1];
PositionAndTime[2] = y[2];
// Global Time
PositionAndTime[3] = y[7]; // See G4FieldTrack::LoadFromArray
G4cout <<"EL_EQ RIGHT HAND SIDE!"<<G4endl;
GetFieldValue(PositionAndTime, Field) ;
EvaluateRhsGivenB( y, Field, dydx );
}
void
G4El_EqRhs::SetChargeMomentumMass( G4double particleCharge, // e+ units
G4double , // MomentumXc
G4double ) // particleMass
{
fCof_val = particleCharge*eplus*c_light ;
}

View File

@ -1,87 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4El_EqRhs.hh,v 1.8 2003/11/05 12:54:13 japost Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
// class G4El_EqRhs
//
// Class description:
//
// The "standard" equation of motion of a particle in a pure electric field.
// History:
// - Created. J.Apostolakis, January 13th 1997
// --------------------------------------------------------------------
#ifndef G4_EL_EQRHS_DEF
#define G4_EL_EQRHS_DEF
#include "G4Types.hh"
#include "G4EquationOfMotion.hh"
class G4ElectricField;
class G4El_EqRhs : public G4EquationOfMotion
{
public: // with description
G4El_EqRhs( G4ElectricField *elField );
virtual ~G4El_EqRhs();
// Constructor and destructor. No actions.
virtual void EvaluateRhsGivenB( const G4double y[],
const G4double E[3],
G4double dydx[] ) const = 0;
// Given the value of the field "B", this function
// calculates the value of the derivative dydx.
// This is the _only_ function a subclass must define.
// The other two functions use Rhs_givenB.
inline G4double FCof() const;
void RightHandSide( const G4double y[], G4double dydx[] ) const;
virtual void SetChargeMomentumMass( G4double particleCharge, // in e+ units
G4double MomentumXc,
G4double mass);
private:
G4double fCof_val;
static const G4double fUnitConstant; // Set in G4El_EqRhs.cc
// to 0.299792458
// Coefficient in the Lorentz motion equation (Lorentz force), if the
// electric field B is in Tesla, the particle charge in units of the
// elementary (positron?) charge, the momentum P in MeV/c, and the
// space coordinates and path along the trajectory in mm .
};
inline
G4double G4El_EqRhs::FCof() const
{
return fCof_val;
}
#endif /* G4_EL_EQRHS_DEF */

View File

@ -1,110 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4El_UsualEqRhs.cc,v 1.10 2003/11/05 17:31:31 japost Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
// This is the 'standard' right-hand side for the equation of motion
// of a charged particle in a magnetic field.
//
// Initial version: J. Apostolakis, January 13th, 1997
//
// --------------------------------------------------------------------
#include "G4UnitsTable.hh"
#include "G4El_UsualEqRhs.hh"
#include "G4ElectricField.hh"
#include "G4ios.hh"
G4El_UsualEqRhs::G4El_UsualEqRhs( G4ElectricField* ElField )
: G4El_EqRhs( ElField ) {}
G4El_UsualEqRhs::~G4El_UsualEqRhs() {}
void
G4El_UsualEqRhs::EvaluateRhsGivenB( const G4double y[],
const G4double E[3],
G4double dydx[] ) const
{
G4double momentum_square = y[3]*y[3] + y[4]*y[4] + y[5]*y[5];
G4double inv_momentum_magnitude = 1.0 / sqrt( momentum_square );
G4double cof = cst*inv_momentum_magnitude;
dydx[0] = y[3]*inv_momentum_magnitude; // (d/ds)x = Vx/V
dydx[1] = y[4]*inv_momentum_magnitude; // (d/ds)y = Vy/V
dydx[2] = y[5]*inv_momentum_magnitude; // (d/ds)z = Vz/V
dydx[3] = cof*(E[0]) ; // Ax = a*(Ex)
dydx[4] = cof*(E[1]) ; // Ay = a*(Ey)
dydx[5] = cof*(E[2]) ; // Az = a*(Ez)
#ifdef DEBUG_FIELD
G4cout<<"LEMuSREl_UsualEqRhs :: posmomE \n"
<< y[0]/100 <<" " << y[1]/100 <<" "<< y[2]/100+5.67 <<" "<<"\n"
<< y[3] <<" " << y[4] <<" "<< y[5] <<" "<<"\n"
<< E[0]/volt*meter <<" " << E[1]/volt*meter <<" "<< E[2]/volt*meter <<" "<<"\n"
<<G4endl;
G4cout<<"LEMuSREl_UsualEqRhs :: dydx \n"
<< dydx[0] <<" " << dydx[1] <<" "<< dydx[2] <<" "<<"\n"
<< dydx[3] <<" " << dydx[4] <<" "<< dydx[5] <<" "<<"\n"
<< dydx[6] <<" " << dydx[7] <<" "<< dydx[8] <<" "<<"\n"
<< dydx[9] <<" " << dydx[10] <<" "<< dydx[11] <<" "<<"\n"
<<G4endl;
// getchar();
#endif
return ;
}
void
G4El_UsualEqRhs:: SetChargeMomentumMass( G4double particleCharge, // in e+ units
G4double MomentumXc,
G4double mass )//mass
{
fInvCurrentMomentumXc= 1.0 / MomentumXc;
cst = particleCharge*eplus*mass;//*c_light;
}
void G4El_UsualEqRhs::RightHandSide( const G4double y[],
G4double dydx[] ) const
{
G4double Field[3];
G4double PositionAndTime[4];
// Position
PositionAndTime[0] = y[0];
PositionAndTime[1] = y[1];
PositionAndTime[2] = y[2];
// Global Time
PositionAndTime[3] = y[7]; // See G4FieldTrack::LoadFromArray
#ifdef DEBUG_FIELD
G4cout <<"EL_USUALEQ RIGHT HAND SIDE!"<<G4endl;
#endif
GetFieldValue(PositionAndTime, Field) ;
EvaluateRhsGivenB( y, Field, dydx );
}

View File

@ -1,76 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4El_UsualEqRhs.hh,v 1.6 2003/10/31 14:35:52 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-patch-01 $
//
//
// class G4El_UsualEqRhs
//
// Class description:
//
// This is the standard right-hand side for equation of motion.
// The only case another is required is when using a moving reference
// frame ... or extending the class to include additional Forces,
// eg an electric field
// History:
// - Created: J. Apostolakis, January 13th 1997.
// --------------------------------------------------------------------
#ifndef G4EL_USUAL_EQRHS
#define G4EL_USUAL_EQRHS
#include "G4El_EqRhs.hh"
class G4ElectricField;
class G4El_UsualEqRhs : public G4El_EqRhs
{
public: // with description
G4El_UsualEqRhs( G4ElectricField* ElField );
~G4El_UsualEqRhs();
// Constructor and destructor. No actions.
void EvaluateRhsGivenB( const G4double y[],
const G4double E[3],
G4double dydx[] ) const;
// Given the value of the electric field E, this function
// calculates the value of the derivative dydx.
virtual void SetChargeMomentumMass( G4double particleCharge, // in e+ units
G4double MomentumXc,
G4double mass);
void RightHandSide( const G4double y[], G4double dydx[] ) const;
private:
G4double cst;
G4double fInvCurrentMomentumXc; // This extra state enables us
// to save a square root in a
// critical method.
};
#endif /* G4EL_USUAL_EQRHS */

View File

@ -1,951 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4MultipleScattering52.cc,v 1.2 2004/12/01 19:37:14 vnivanch Exp $
// GEANT4 tag $Name: geant4-07-00-cand-03 $
//
// -----------------------------------------------------------------------------
// 16/05/01 value of cparm changed , L.Urban
// 18/05/01 V.Ivanchenko Clean up against Linux ANSI compilation
// 07/08/01 new methods Store/Retrieve PhysicsTable (mma)
// 23-08-01 new angle and z distribution,energy dependence reduced,
// Store,Retrieve methods commented out temporarily, L.Urban
// 27-08-01 in BuildPhysicsTable:aParticleType.GetParticleName()=="mu+" (mma)
// 28-08-01 GetContinuousStepLimit and AlongStepDoIt moved from .icc file (mma)
// 03-09-01 value of data member factlim changed, L.Urban
// 10-09-01 small change in GetContinuousStepLimit, L.Urban
// 11-09-01 G4MultipleScatteringx put as default G4MultipleScattering
// store/retrieve physics table reactivated (mma)
// 13-09-01 corr. in ComputeTransportCrossSection, L.Urban
// 14-09-01 protection in GetContinuousStepLimit, L.Urban
// 17-09-01 migration of Materials to pure STL (mma)
// 27-09-01 value of data member factlim changed, L.Urban
// 31-10-01 big fixed in PostStepDoIt,L.Urban
// 24-04-02 some minor changes in boundary algorithm, L.Urban
// 06-05-02 bug fixed in GetContinuousStepLimit, L.Urban
// 24-05-02 changes in angle distribution and boundary algorithm, L.Urban
// 11-06-02 bug fixed in ComputeTransportCrossSection, L.Urban
// 12-08-02 bug fixed in PostStepDoIt (lateral displacement), L.Urban
// 15-08-02 new angle distribution, L.Urban
// 26-09-02 angle distribution + boundary algorithm modified, L.Urban
// 15-10-02 temporary fix for proton scattering
// 30-10-02 modified angle distribution,mods in boundary algorithm,
// changes in data members, L.Urban
// 30-10-02 rename variable cm - Ecm, V.Ivanchenko
// 11-12-02 precision problem in ComputeTransportCrossSection
// for small Tkin/for heavy particles cured, L.Urban
// 05-02-03 changes in data members, new sampling for geom.
// path length, step dependence reduced with new
// method
// 17-03-03 cut per region, V.Ivanchenko
// 13-04-03 add initialisation in GetContinuesStepLimit
// + change table size (V.Ivanchenko)
// 26-04-03 fix problems of retrieve tables (M.Asai)
// 23-05-03 important change in angle distribution for muons/hadrons
// the central part now is similar to the Highland parametrization +
// minor correction in angle sampling algorithm (for all particles)
// (L.Urban)
// 24-05-03 bug in nuclear size corr.computation fixed thanks to Vladimir(L.Urban)
// 30-05-03 misprint in PostStepDoIt corrected(L.Urban)
// 08-08-03 This class is frozen at the release 5.2 (V.Ivanchenko)
// 08-11-04 Remove Store/Retrieve tables (V.Ivantchenko)
// -----------------------------------------------------------------------------
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4MultipleScattering52.hh"
#include "G4StepStatus.hh"
#include "G4Navigator.hh"
#include "G4TransportationManager.hh"
#include "Randomize.hh"
#include "G4ProductionCutsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
using namespace std;
G4MultipleScattering52::G4MultipleScattering52(const G4String& processName)
: G4VContinuousDiscreteProcess(processName),
theTransportMeanFreePathTable(0),
taubig(8.0),tausmall(1.e-14),taulim(1.e-5),
LowestKineticEnergy(0.1*keV),
HighestKineticEnergy(100.*TeV),
TotBin(100),
materialIndex(0),
tLast (0.0),
zLast (0.0),
boundary(true),
facrange(0.199),tlimit(1.e10*mm),tlimitmin(1.e-7*mm),
cf(1.001),
stepno(0),stepnolastmsc(-1000000),nsmallstep(5),
laststep(0.),
valueGPILSelectionMSC(NotCandidateForSelection),
zmean(0.),samplez(true),
range(1.),T0(1.),T1(1.),lambda0(1.),lambda1(-1.),
Tlow(0.),alam(1.),blam(1.),dtrl(0.15),
lambdam(-1.),clam(1.),zm(1.),cthm(1.),
fLatDisplFlag(true),
NuclCorrPar (0.0615),
FactPar(0.40),
facxsi(1.)
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4MultipleScattering52::~G4MultipleScattering52()
{
if(theTransportMeanFreePathTable)
{
theTransportMeanFreePathTable->clearAndDestroy();
delete theTransportMeanFreePathTable;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4MultipleScattering52::BuildPhysicsTable(
const G4ParticleDefinition& aParticleType)
{
// set values of some data members
if((aParticleType.GetParticleName() == "e-") ||
(aParticleType.GetParticleName() == "e+"))
{
// parameters for e+/e-
alfa1 = 1.45 ;
alfa2 = 0.60 ;
alfa3 = 0.30 ;
b = 1. ;
xsi = facxsi*2.22 ;
c0 = 2.30 ;
}
else
{
// parameters for heavy particles
alfa1 = 1.10 ;
alfa2 = 0.14 ;
alfa3 = 0.07 ;
b = 1. ;
xsi = facxsi*2.70 ;
c0 = 1.40 ;
}
// ..............................
Tlow = aParticleType.GetPDGMass();
// tables are built for MATERIALS
const G4double sigmafactor = twopi*classic_electr_radius*
classic_electr_radius;
G4double KineticEnergy,AtomicNumber,AtomicWeight,sigma,lambda;
G4double density;
// destroy old tables if any
if (theTransportMeanFreePathTable)
{
theTransportMeanFreePathTable->clearAndDestroy();
delete theTransportMeanFreePathTable;
}
// create table
const G4ProductionCutsTable* theCoupleTable=
G4ProductionCutsTable::GetProductionCutsTable();
size_t numOfCouples = theCoupleTable->GetTableSize();
theTransportMeanFreePathTable = new G4PhysicsTable(numOfCouples);
// loop for materials
for (size_t i=0; i<numOfCouples; i++)
{
// create physics vector and fill it
G4PhysicsLogVector* aVector = new G4PhysicsLogVector(
LowestKineticEnergy,HighestKineticEnergy,TotBin);
// get elements in the material
const G4MaterialCutsCouple* couple = theCoupleTable->
GetMaterialCutsCouple(i);
const G4Material* material = couple->GetMaterial();
const G4ElementVector* theElementVector = material->GetElementVector();
const G4double* NbOfAtomsPerVolume =
material->GetVecNbOfAtomsPerVolume();
const G4int NumberOfElements = material->GetNumberOfElements();
density = material->GetDensity();
// loop for kinetic energy values
for (G4int i=0; i<TotBin; i++)
{
KineticEnergy = aVector->GetLowEdgeEnergy(i);
sigma = 0.;
// loop for element in the material
for (G4int iel=0; iel<NumberOfElements; iel++)
{
AtomicNumber = (*theElementVector)[iel]->GetZ();
AtomicWeight = (*theElementVector)[iel]->GetA();
sigma += NbOfAtomsPerVolume[iel]*
ComputeTransportCrossSection(aParticleType,KineticEnergy,
AtomicNumber,AtomicWeight);
}
sigma *= sigmafactor;
lambda = 1./sigma;
aVector->PutValue(i,lambda);
}
theTransportMeanFreePathTable->insert(aVector);
}
if((aParticleType.GetParticleName() == "e-" ) ||
(aParticleType.GetParticleName() == "mu+" ) ||
(aParticleType.GetParticleName() == "Mu" ) ||
(aParticleType.GetParticleName() == "proton") ) PrintInfoDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4MultipleScattering52::ComputeTransportCrossSection(
const G4ParticleDefinition& aParticleType,
G4double KineticEnergy,
G4double AtomicNumber,G4double AtomicWeight)
{
const G4double epsfactor = 2.*electron_mass_c2*electron_mass_c2*
Bohr_radius*Bohr_radius/(hbarc*hbarc);
const G4double epsmin = 1.e-4 , epsmax = 1.e10;
const G4double Zdat[15] = { 4., 6.,13.,20.,26.,29.,32.,38.,47.,
50.,56.,64.,74.,79.,82. };
const G4double Tdat[23] = {0.0001*MeV,0.0002*MeV,0.0004*MeV,0.0007*MeV,
0.001*MeV,0.002*MeV,0.004*MeV,0.007*MeV,
0.01*MeV,0.02*MeV,0.04*MeV,0.07*MeV,
0.1*MeV,0.2*MeV,0.4*MeV,0.7*MeV,
1.*MeV,2.*MeV,4.*MeV,7.*MeV,10.*MeV,20.*MeV,
10000.0*MeV};
// corr. factors for e-/e+ lambda
G4double celectron[15][23] =
{{1.125,1.072,1.051,1.047,1.047,1.050,1.052,1.054,
1.054,1.057,1.062,1.069,1.075,1.090,1.105,1.111,
1.112,1.108,1.100,1.093,1.089,1.087,0.7235 },
{1.408,1.246,1.143,1.096,1.077,1.059,1.053,1.051,
1.052,1.053,1.058,1.065,1.072,1.087,1.101,1.108,
1.109,1.105,1.097,1.090,1.086,1.082,0.7925 },
{2.833,2.268,1.861,1.612,1.486,1.309,1.204,1.156,
1.136,1.114,1.106,1.106,1.109,1.119,1.129,1.132,
1.131,1.124,1.113,1.104,1.099,1.098,0.9147 },
{3.879,3.016,2.380,2.007,1.818,1.535,1.340,1.236,
1.190,1.133,1.107,1.099,1.098,1.103,1.110,1.113,
1.112,1.105,1.096,1.089,1.085,1.098,0.9700 },
{6.937,4.330,2.886,2.256,1.987,1.628,1.395,1.265,
1.203,1.122,1.080,1.065,1.061,1.063,1.070,1.073,
1.073,1.070,1.064,1.059,1.056,1.056,1.0022 },
{9.616,5.708,3.424,2.551,2.204,1.762,1.485,1.330,
1.256,1.155,1.099,1.077,1.070,1.068,1.072,1.074,
1.074,1.070,1.063,1.059,1.056,1.052,1.0158 },
{11.72,6.364,3.811,2.806,2.401,1.884,1.564,1.386,
1.300,1.180,1.112,1.082,1.073,1.066,1.068,1.069,
1.068,1.064,1.059,1.054,1.051,1.050,1.0284 },
{18.08,8.601,4.569,3.183,2.662,2.025,1.646,1.439,
1.339,1.195,1.108,1.068,1.053,1.040,1.039,1.039,
1.039,1.037,1.034,1.031,1.030,1.036,1.0515 },
{18.22,10.48,5.333,3.713,3.115,2.367,1.898,1.631,
1.498,1.301,1.171,1.105,1.077,1.048,1.036,1.033,
1.031,1.028,1.024,1.022,1.021,1.024,1.0834 },
{14.14,10.65,5.710,3.929,3.266,2.453,1.951,1.669,
1.528,1.319,1.178,1.106,1.075,1.040,1.027,1.022,
1.020,1.017,1.015,1.013,1.013,1.020,1.0937 },
{14.11,11.73,6.312,4.240,3.478,2.566,2.022,1.720,
1.569,1.342,1.186,1.102,1.065,1.022,1.003,0.997,
0.995,0.993,0.993,0.993,0.993,1.011,1.1140 },
{22.76,20.01,8.835,5.287,4.144,2.901,2.219,1.855,
1.677,1.410,1.224,1.121,1.073,1.014,0.986,0.976,
0.974,0.972,0.973,0.974,0.975,0.987,1.1410 },
{50.77,40.85,14.13,7.184,5.284,3.435,2.520,2.059,
1.837,1.512,1.283,1.153,1.091,1.010,0.969,0.954,
0.950,0.947,0.949,0.952,0.954,0.963,1.1750 },
{65.87,59.06,15.87,7.570,5.567,3.650,2.682,2.182,
1.939,1.579,1.325,1.178,1.108,1.014,0.965,0.947,
0.941,0.938,0.940,0.944,0.946,0.954,1.1922 },
// {45.60,47.34,15.92,7.810,5.755,3.767,2.760,2.239, // paper.....
{55.60,47.34,15.92,7.810,5.755,3.767,2.760,2.239,
1.985,1.609,1.343,1.188,1.113,1.013,0.960,0.939,
0.933,0.930,0.933,0.936,0.939,0.949,1.2026 }};
G4double cpositron[15][23] = {
{2.589,2.044,1.658,1.446,1.347,1.217,1.144,1.110,
1.097,1.083,1.080,1.086,1.092,1.108,1.123,1.131,
1.131,1.126,1.117,1.108,1.103,1.100,0.7235 },
{3.904,2.794,2.079,1.710,1.543,1.325,1.202,1.145,
1.122,1.096,1.089,1.092,1.098,1.114,1.130,1.137,
1.138,1.132,1.122,1.113,1.108,1.102,0.7925 },
{7.970,6.080,4.442,3.398,2.872,2.127,1.672,1.451,
1.357,1.246,1.194,1.179,1.178,1.188,1.201,1.205,
1.203,1.190,1.173,1.159,1.151,1.145,0.9147 },
{9.714,7.607,5.747,4.493,3.815,2.777,2.079,1.715,
1.553,1.353,1.253,1.219,1.211,1.214,1.225,1.228,
1.225,1.210,1.191,1.175,1.166,1.174,0.9700 },
{17.97,12.95,8.628,6.065,4.849,3.222,2.275,1.820,
1.624,1.382,1.259,1.214,1.202,1.202,1.214,1.219,
1.217,1.203,1.184,1.169,1.160,1.151,1.0022 },
{24.83,17.06,10.84,7.355,5.767,3.707,2.546,1.996,
1.759,1.465,1.311,1.252,1.234,1.228,1.238,1.241,
1.237,1.222,1.201,1.184,1.174,1.159,1.0158 },
{23.26,17.15,11.52,8.049,6.375,4.114,2.792,2.155,
1.880,1.535,1.353,1.281,1.258,1.247,1.254,1.256,
1.252,1.234,1.212,1.194,1.183,1.170,1.0284 },
{22.33,18.01,12.86,9.212,7.336,4.702,3.117,2.348,
2.015,1.602,1.385,1.297,1.268,1.251,1.256,1.258,
1.254,1.237,1.214,1.195,1.185,1.179,1.0515 },
{33.91,24.13,15.71,10.80,8.507,5.467,3.692,2.808,
2.407,1.873,1.564,1.425,1.374,1.330,1.324,1.320,
1.312,1.288,1.258,1.235,1.221,1.205,1.0834 },
{32.14,24.11,16.30,11.40,9.015,5.782,3.868,2.917,
2.490,1.925,1.596,1.447,1.391,1.342,1.332,1.327,
1.320,1.294,1.264,1.240,1.226,1.214,1.0937 },
{29.51,24.07,17.19,12.28,9.766,6.238,4.112,3.066,
2.602,1.995,1.641,1.477,1.414,1.356,1.342,1.336,
1.328,1.302,1.270,1.245,1.231,1.233,1.1140 },
{38.19,30.85,21.76,15.35,12.07,7.521,4.812,3.498,
2.926,2.188,1.763,1.563,1.484,1.405,1.382,1.371,
1.361,1.330,1.294,1.267,1.251,1.239,1.1410 },
{49.71,39.80,27.96,19.63,15.36,9.407,5.863,4.155,
3.417,2.478,1.944,1.692,1.589,1.480,1.441,1.423,
1.409,1.372,1.330,1.298,1.280,1.258,1.1750 },
{59.25,45.08,30.36,20.83,16.15,9.834,6.166,4.407,
3.641,2.648,2.064,1.779,1.661,1.531,1.482,1.459,
1.442,1.400,1.354,1.319,1.299,1.272,1.1922 },
{56.38,44.29,30.50,21.18,16.51,10.11,6.354,4.542,
3.752,2.724,2.116,1.817,1.692,1.554,1.499,1.474,
1.456,1.412,1.364,1.328,1.307,1.282,1.2026 }};
G4double sigma;
G4double Z23 = 2.*log(AtomicNumber)/3.; Z23 = exp(Z23);
G4double ParticleMass = aParticleType.GetPDGMass();
G4double ParticleKineticEnergy = KineticEnergy ;
// correction if particle .ne. e-/e+
// compute equivalent kinetic energy
// lambda depends on p*beta ....
G4double Mass = ParticleMass ;
if((aParticleType.GetParticleName() != "e-") &&
(aParticleType.GetParticleName() != "e+") )
{
G4double TAU = KineticEnergy/Mass ;
G4double c = Mass*TAU*(TAU+2.)/(electron_mass_c2*(TAU+1.)) ;
G4double w = c-2. ;
G4double tau = 0.5*(w+sqrt(w*w+4.*c)) ;
KineticEnergy = electron_mass_c2*tau ;
Mass = electron_mass_c2 ;
}
G4double Charge = aParticleType.GetPDGCharge();
G4double ChargeSquare = Charge*Charge/(eplus*eplus);
G4double TotalEnergy = KineticEnergy + Mass ;
G4double beta2 = KineticEnergy*(TotalEnergy+Mass)
/(TotalEnergy*TotalEnergy);
G4double bg2 = KineticEnergy*(TotalEnergy+Mass)
/(Mass*Mass);
G4double eps = epsfactor*bg2/Z23;
if (eps<epsmin) sigma = 2.*eps*eps;
else if(eps<epsmax) sigma = log(1.+2.*eps)-2.*eps/(1.+2.*eps);
else sigma = log(2.*eps)-1.+1./eps;
sigma *= ChargeSquare*AtomicNumber*AtomicNumber/(beta2*bg2);
// nuclear size effect correction for high energy
// ( a simple approximation at present)
G4double corrnuclsize,a,x0,w1,w2,w;
x0 = 1. - NuclCorrPar*ParticleMass/(ParticleKineticEnergy*
exp(log(AtomicWeight/(g/mole))/3.));
if ( (x0 < -1.) || (ParticleKineticEnergy <= 10.*MeV))
{ x0 = -1.; corrnuclsize = 1.;}
else
{ a = 1.+1./eps;
if (eps > epsmax) w1=log(2.*eps)+1./eps-3./(8.*eps*eps);
else w1=log((a+1.)/(a-1.))-2./(a+1.);
w = 1./((1.-x0)*eps);
if (w < epsmin) w2=-log(w)-1.+2.*w-1.5*w*w;
else w2 = log((a-x0)/(a-1.))-(1.-x0)/(a-x0);
corrnuclsize = w1/w2;
corrnuclsize = exp(-FactPar*ParticleMass/ParticleKineticEnergy)*
(corrnuclsize-1.)+1.;
}
// interpolate in AtomicNumber and beta2
// get bin number in Z
G4int iZ = 14;
while ((iZ>=0)&&(Zdat[iZ]>=AtomicNumber)) iZ -= 1;
if (iZ==14) iZ = 13;
if (iZ==-1) iZ = 0 ;
G4double Z1 = Zdat[iZ];
G4double Z2 = Zdat[iZ+1];
G4double ratZ = (AtomicNumber-Z1)/(Z2-Z1);
// get bin number in T (beta2)
G4int iT = 22;
while ((iT>=0)&&(Tdat[iT]>=KineticEnergy)) iT -= 1;
if(iT==22) iT = 21;
if(iT==-1) iT = 0 ;
// calculate betasquare values
G4double T = Tdat[iT], E = T + electron_mass_c2;
G4double b2small = T*(E+electron_mass_c2)/(E*E);
T = Tdat[iT+1]; E = T + electron_mass_c2;
G4double b2big = T*(E+electron_mass_c2)/(E*E);
G4double ratb2 = (beta2-b2small)/(b2big-b2small);
G4double c1,c2,cc1,cc2,corr;
if (Charge < 0.)
{
c1 = celectron[iZ][iT];
c2 = celectron[iZ+1][iT];
cc1 = c1+ratZ*(c2-c1);
c1 = celectron[iZ][iT+1];
c2 = celectron[iZ+1][iT+1];
cc2 = c1+ratZ*(c2-c1);
corr = cc1+ratb2*(cc2-cc1);
sigma /= corr;
}
if (Charge > 0.)
{
c1 = cpositron[iZ][iT];
c2 = cpositron[iZ+1][iT];
cc1 = c1+ratZ*(c2-c1);
c1 = cpositron[iZ][iT+1];
c2 = cpositron[iZ+1][iT+1];
cc2 = c1+ratZ*(c2-c1);
corr = cc1+ratb2*(cc2-cc1);
sigma /= corr;
}
// nucl. size correction for particles other than e+/e- only at present !!!!
if((aParticleType.GetParticleName() != "e-") &&
(aParticleType.GetParticleName() != "e+") )
sigma /= corrnuclsize;
return sigma;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4MultipleScattering52::GetContinuousStepLimit(
const G4Track& track,
G4double,
G4double currentMinimumStep,
G4double&)
{
G4double zPathLength,tPathLength;
const G4DynamicParticle* aParticle;
G4double tau,zt,cz,cz1,grej,grej0;
const G4double expmax = 100., ztmax = (2.*expmax+1.)/(2.*expmax+3.) ;
const G4double tmax = 1.e20*mm ;
G4bool isOut;
// this process is not a candidate for selection by default
valueGPILSelectionMSC = NotCandidateForSelection;
tPathLength = currentMinimumStep;
const G4MaterialCutsCouple* couple = track.GetMaterialCutsCouple();
materialIndex = couple->GetIndex();
aParticle = track.GetDynamicParticle();
T0 = aParticle->GetKineticEnergy();
lambda0 = (*theTransportMeanFreePathTable)
(materialIndex)->GetValue(T0,isOut);
range = G4EnergyLossTables::GetRange(aParticle->GetDefinition(),
T0,couple);
//VI Initialisation at the beginning of the step
cthm = 1.;
lambda1 = -1.;
lambdam = -1.;
alam = range;
blam = 1.+alam/lambda0 ;
zm = 1.;
// special treatment near boundaries ?
if (boundary && range >= currentMinimumStep)
{
// step limitation at boundary ?
stepno = track.GetCurrentStepNumber() ;
if(stepno == 1)
{
stepnolastmsc = -1000000 ;
tlimit = 1.e10 ;
}
if(stepno > 1)
{
if(track.GetStep()->GetPreStepPoint()->GetStepStatus() == fGeomBoundary)
{
stepnolastmsc = stepno ;
// if : diff.treatment for small/not small Z
if(range > lambda0)
tlimit = facrange*range ;
else
tlimit = facrange*lambda0 ;
if(tlimit < tlimitmin) tlimit = tlimitmin ;
laststep = tlimit ;
if(tPathLength > tlimit)
{
tPathLength = tlimit ;
valueGPILSelectionMSC = CandidateForSelection;
}
}
else if(stepno > stepnolastmsc)
{
if((stepno - stepnolastmsc) < nsmallstep)
{
if(tPathLength > tlimit)
{
laststep *= cf ;
tPathLength = laststep ;
valueGPILSelectionMSC = CandidateForSelection;
}
}
}
}
}
// do the true -> geom transformation
zmean = tPathLength;
tau = tPathLength/lambda0 ;
if (tau < tausmall || range < currentMinimumStep) zPathLength = tPathLength;
else
{
if(tPathLength/range < dtrl) zmean = lambda0*(1.-exp(-tau));
else
{
T1 = G4EnergyLossTables::GetPreciseEnergyFromRange(
aParticle->GetDefinition(),range-tPathLength,couple);
lambda1 = (*theTransportMeanFreePathTable)
(materialIndex)->GetValue(T1,isOut);
if(T0 < Tlow)
alam = range ;
else
alam = lambda0*tPathLength/(lambda0-lambda1) ;
blam = 1.+alam/lambda0 ;
if(tPathLength/range < 2.*dtrl)
{
zmean = alam*(1.-exp(blam*log(1.-tPathLength/alam)))/blam ;
lambdam = -1. ;
}
else
{
G4double w = 1.-0.5*tPathLength/alam ;
lambdam = lambda0*w ;
clam = 1.+alam/lambdam ;
cthm = exp(alam*log(w)/lambda0) ;
zm = alam*(1.-exp(blam*log(w)))/blam ;
zmean = zm + alam*(1.-exp(clam*log(w)))*cthm/clam ;
}
}
// sample z
zt = zmean/tPathLength ;
if (samplez && (zt < ztmax) && (zt > 0.5))
{
cz = 0.5*(3.*zt-1.)/(1.-zt) ;
if(tPathLength < exp(log(tmax)/(2.*cz)))
{
cz1 = 1.+cz ;
grej0 = exp(cz1*log(cz*tPathLength/cz1))/cz ;
do
{
zPathLength = tPathLength*exp(log(G4UniformRand())/cz1) ;
grej = exp(cz*log(zPathLength))*(tPathLength-zPathLength)/grej0 ;
} while (grej < G4UniformRand()) ;
}
else zPathLength = zmean;
}
else zPathLength = zmean;
}
// protection against z > lambda
if(zPathLength > lambda0)
zPathLength = lambda0 ;
tLast = tPathLength;
zLast = zPathLength;
return zPathLength;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VParticleChange* G4MultipleScattering52::AlongStepDoIt(
const G4Track& track,const G4Step& step)
{
// only a geom path->true path transformation is performed
fParticleChange.Initialize(track);
G4double geomPathLength = step.GetStepLength();
G4double truePathLength = 0. ;
//VI change order of if operators
if(geomPathLength == zLast) truePathLength = tLast;
else if(geomPathLength/lambda0 < tausmall) truePathLength = geomPathLength;
else
{
if(lambda1 < 0.) truePathLength = -lambda0*log(1.-geomPathLength/lambda0) ;
else if(lambdam < 0.)
{
if(blam*geomPathLength/alam < 1.)
truePathLength = alam*(1.-exp(log(1.-blam*geomPathLength/alam)/
blam)) ;
else
truePathLength = tLast;
}
else
{
if(geomPathLength <= zm)
{
if(blam*geomPathLength/alam < 1.)
truePathLength = alam*(1.-exp(log(1.-blam*geomPathLength/alam)/
blam)) ;
else
truePathLength = 0.5*tLast;
lambdam = -1. ;
}
else
{
if(clam*(geomPathLength-zm)/(alam*cthm) < 1.)
truePathLength = 0.5*tLast + alam*(1.-
exp(log(1.-clam*(geomPathLength-zm)/(alam*cthm)))/clam) ;
else
truePathLength = tLast ;
}
}
// protection ....
if(truePathLength > tLast)
truePathLength = tLast ;
}
//VI truePath length cannot be smaller than geomPathLength
if (truePathLength < geomPathLength) truePathLength = geomPathLength;
fParticleChange.ProposeTrueStepLength(truePathLength);
return &fParticleChange;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VParticleChange* G4MultipleScattering52::PostStepDoIt(
const G4Track& trackData,
const G4Step& stepData)
{
// angle distribution parameters
const G4double kappa = 2.5, kappapl1 = kappa+1., kappami1 = kappa-1. ;
fParticleChange.Initialize(trackData);
G4double truestep = stepData.GetStepLength();
const G4DynamicParticle* aParticle = trackData.GetDynamicParticle();
G4double KineticEnergy = aParticle->GetKineticEnergy();
G4double Mass = aParticle->GetDefinition()->GetPDGMass() ;
// do nothing for stopped particles !
if(KineticEnergy > 0.)
{
// change direction first ( scattering )
G4double cth = 1.0 ;
G4double tau = truestep/lambda0 ;
if (tau < tausmall) cth = 1.;
else if(tau > taubig) cth = -1.+2.*G4UniformRand();
else
{
if(lambda1 > 0.)
{
if(lambdam < 0.)
tau = -alam*log(1.-truestep/alam)/lambda0 ;
else
tau = -log(cthm)-alam*log(1.-(truestep-0.5*tLast)/alam)/lambdam ;
}
if(tau > taubig) cth = -1.+2.*G4UniformRand();
else
{
const G4double amax=25. ;
const G4double tau0 = 0.02 ;
const G4double c_highland = 13.6*MeV, corr_highland=0.038 ;
const G4double x1fac1 = exp(-xsi) ;
const G4double x1fac2 = (1.-(1.+xsi)*x1fac1)/(1.-x1fac1) ;
const G4double x1fac3 = 1.3 ; // x1fac3 >= 1. !!!!!!!!!
G4double a,x0,c,xmean1,xmean2,
xmeanth,prob,qprob ;
G4double ea,eaa,b1,bx,eb1,ebx,cnorm1,cnorm2,f1x0,f2x0,w ;
// for heavy particles take the width of the cetral part
// from the Highland formula
// (Particle Physics Booklet, July 2002, eq. 26.10)
if(Mass > electron_mass_c2) // + other conditions (beta, x/X0,...?)
{
G4double Q = fabs(aParticle->GetDefinition()->GetPDGCharge()) ;
G4double X0 = trackData.GetMaterialCutsCouple()->
GetMaterial()->GetRadlen() ;
G4double xx0 = truestep/X0 ;
G4double betacp = KineticEnergy*(KineticEnergy+2.*Mass)/
(KineticEnergy+Mass) ;
G4double theta0=c_highland*Q*sqrt(xx0)*
(1.+corr_highland*log(xx0))/betacp ;
if(theta0 > tausmall)
a = 0.5/(1.-cos(theta0)) ;
else
a = 1./(theta0*theta0) ;
}
else
{
w = log(tau/tau0) ;
if(tau < tau0)
a = (alfa1-alfa2*w)/tau ;
else
a = (alfa1+alfa3*w)/tau ;
}
xmeanth = exp(-tau) ;
x0 = 1.-xsi/a ;
if(x0 < -1.) x0 = -1. ;
if(x0 == -1.)
{
// 1 model fuction only
// in order to have xmean1 > xmeanth -> qprob < 1
if((1.-1./a) < xmeanth)
a = 1./(1.-xmeanth) ;
if(a*(1.-x0) < amax)
ea = exp(-a*(1.-x0)) ;
else
ea = 0. ;
eaa = 1.-ea ;
xmean1 = 1.-1./a+(1.-x0)*ea/eaa ;
c = 2. ;
b1 = b+1. ;
bx = b1 ;
eb1 = b1 ;
ebx = b1 ;
xmean2 = 0. ;
prob = 1. ;
qprob = xmeanth/xmean1 ;
}
else
{
// 2 model fuctions
// in order to have xmean1 > xmeanth
if((1.-x1fac2/a) < xmeanth)
{
a = x1fac3*x1fac2/(1.-xmeanth) ;
if(a*(1.-x0) < amax)
ea = exp(-a*(1.-x0)) ;
else
ea = 0. ;
eaa = 1.-ea ;
xmean1 = 1.-1./a+(1.-x0)*ea/eaa ;
}
else
{
ea = x1fac1 ;
eaa = 1.-x1fac1 ;
xmean1 = 1.-x1fac2/a ;
}
// from continuity of the 1st derivatives
c = a*(b-x0) ;
if(a*tau < c0)
c = c0*(b-x0)/tau ;
if(c == 1.) c=1.000001 ;
if(c == 2.) c=2.000001 ;
if(c == 3.) c=3.000001 ;
b1 = b+1. ;
bx=b-x0 ;
eb1=exp((c-1.)*log(b1)) ;
ebx=exp((c-1.)*log(bx)) ;
xmean2 = (x0*eb1+ebx+(eb1*bx-b1*ebx)/(2.-c))/(eb1-ebx) ;
cnorm1 = a/eaa ;
f1x0 = cnorm1*exp(-a*(1.-x0)) ;
cnorm2 = (c-1.)*eb1*ebx/(eb1-ebx) ;
f2x0 = cnorm2/exp(c*log(b-x0)) ;
// from continuity at x=x0
prob = f2x0/(f1x0+f2x0) ;
// from xmean = xmeanth
qprob = (f1x0+f2x0)*xmeanth/(f2x0*xmean1+f1x0*xmean2) ;
}
// protection against prob or qprob > 1 and
// prob or qprob < 0
// ***************************************************************
if((qprob > 1.) || (qprob < 0.) || (prob > 1.) || (prob < 0.))
{
// this print possibility has been left intentionally
// for debugging purposes ..........................
G4bool pr = false ;
// pr = true ;
if(pr)
{
const G4double prlim = 0.10 ;
if((fabs((xmeanth-xmean2)/(xmean1-xmean2)-prob)/prob > prlim) ||
((xmeanth-xmean2)/(xmean1-xmean2) > 1.) ||
((xmeanth-xmean2)/(xmean1-xmean2) < 0.) )
{
G4cout.precision(5) ;
G4cout << "\nparticle=" << aParticle->GetDefinition()->
GetParticleName() << " in material "
<< trackData.GetMaterialCutsCouple()->
GetMaterial()->GetName() << " with kinetic energy "
<< KineticEnergy << " MeV," << G4endl ;
G4cout << " step length="
<< truestep << " mm" << G4endl ;
G4cout << "p=" << prob << " q=" << qprob << " -----> "
<< "p=" << (xmeanth-xmean2)/(xmean1-xmean2)
<< " q=" << 1. << G4endl ;
}
}
qprob = 1. ;
prob = (xmeanth-xmean2)/(xmean1-xmean2) ;
}
// **************************************************************
// sampling of costheta
if(G4UniformRand() < qprob)
{
if(G4UniformRand() < prob)
cth = 1.+log(ea+G4UniformRand()*eaa)/a ;
else
cth = b-b1*bx/exp(log(ebx-G4UniformRand()*(ebx-eb1))/(c-1.)) ;
}
else
cth = -1.+2.*G4UniformRand() ;
}
}
G4double sth = sqrt(1.-cth*cth);
G4double phi = twopi*G4UniformRand();
G4double dirx = sth*cos(phi), diry = sth*sin(phi), dirz = cth;
G4ParticleMomentum ParticleDirection = aParticle->GetMomentumDirection();
G4ThreeVector newDirection(dirx,diry,dirz);
newDirection.rotateUz(ParticleDirection);
fParticleChange.ProposeMomentumDirection(newDirection.x(),
newDirection.y(),
newDirection.z());
if (fLatDisplFlag)
{
// compute mean lateral displacement, only for safety > tolerance !
G4double safetyminustolerance = stepData.GetPostStepPoint()->GetSafety();
G4double rmean, etau;
if (safetyminustolerance > 0.)
{
if (tau < tausmall) rmean = 0.;
else if(tau < taulim) rmean = kappa*tau*tau*tau*(1.-kappapl1*tau/4.)/6.;
else
{
if(tau<taubig) etau = exp(-tau);
else etau = 0.;
rmean = -kappa*tau;
rmean = -exp(rmean)/(kappa*kappami1);
rmean += tau-kappapl1/kappa+kappa*etau/kappami1;
}
if (rmean>0.) rmean = 2.*lambda0*sqrt(rmean/3.);
else rmean = 0.;
// for rmean > 0) only
if (rmean > 0.)
{
if (rmean>safetyminustolerance) rmean = safetyminustolerance;
// sample direction of lateral displacement
phi = twopi*G4UniformRand();
dirx = cos(phi); diry = sin(phi); dirz = 0.;
G4ThreeVector latDirection(dirx,diry,dirz);
latDirection.rotateUz(ParticleDirection);
// compute new endpoint of the Step
G4ThreeVector newPosition = stepData.GetPostStepPoint()->GetPosition()
+ rmean*latDirection;
G4Navigator* navigator =
G4TransportationManager::GetTransportationManager()
->GetNavigatorForTracking();
navigator->LocateGlobalPointWithinVolume(newPosition);
fParticleChange.ProposePosition(newPosition);
}
}
}
}
return &fParticleChange;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4MultipleScattering52::PrintInfoDefinition()
{
G4String comments = " Tables of transport mean free paths.";
comments += "\n New model of MSC , computes the lateral \n";
comments += " displacement of the particle , too.";
G4cout << G4endl << GetProcessName() << ": " << comments
<< "\n PhysicsTables from "
<< G4BestUnit(LowestKineticEnergy ,"Energy")
<< " to " << G4BestUnit(HighestKineticEnergy,"Energy")
<< " in " << TotBin << " bins. \n";
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

View File

@ -1,190 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4MuonDecayChannel.cc,v 1.11 2004/12/10 18:02:04 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-00-cand-05 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, based on object model of
// 30 May 1997 H.Kurashige
//
// Fix bug in calcuration of electron energy in DecayIt 28 Feb. 01 H.Kurashige
// ------------------------------------------------------------
#include "G4ParticleDefinition.hh"
#include "G4DecayProducts.hh"
#include "G4VDecayChannel.hh"
#include "G4MuonDecayChannel.hh"
#include "Randomize.hh"
#include "G4LorentzVector.hh"
#include "G4LorentzRotation.hh"
G4MuonDecayChannel::G4MuonDecayChannel(const G4String& theParentName,
G4double theBR)
:G4VDecayChannel("Muon Decay",1)
{
// set names for daughter particles
if (theParentName == "mu+") {
SetBR(theBR);
SetParent("mu+");
SetNumberOfDaughters(3);
SetDaughter(0, "e+");
SetDaughter(1, "nu_e");
SetDaughter(2, "anti_nu_mu");
} else if (theParentName == "Mu") {
SetBR(theBR);
SetParent("Mu");
SetNumberOfDaughters(3);
SetDaughter(0, "e+");
SetDaughter(1, "nu_e");
SetDaughter(2, "anti_nu_mu");
} else if (theParentName == "mu-") {
SetBR(theBR);
SetParent("mu-");
SetNumberOfDaughters(3);
SetDaughter(0, "e-");
SetDaughter(1, "anti_nu_e");
SetDaughter(2, "nu_mu");
} else {
#ifdef G4VERBOSE
if (GetVerboseLevel()>0) {
G4cout << "G4MuonDecayChannel:: constructor :";
G4cout << " parent particle is not muon but ";
G4cout << theParentName << G4endl;
}
#endif
}
}
G4MuonDecayChannel::~G4MuonDecayChannel()
{
}
G4DecayProducts *G4MuonDecayChannel::DecayIt(G4double)
{
// this version neglects muon polarization
// assumes the pure V-A coupling
// gives incorrect energy spectrum for neutrinos
#ifdef G4VERBOSE
if (GetVerboseLevel()>1) G4cout << "G4MuonDecayChannel::DecayIt ";
#endif
if (parent == 0) FillParent();
if (daughters == 0) FillDaughters();
// parent mass
G4double parentmass = parent->GetPDGMass();
//daughters'mass
G4double daughtermass[3];
G4double sumofdaughtermass = 0.0;
for (G4int index=0; index<3; index++){
daughtermass[index] = daughters[index]->GetPDGMass();
sumofdaughtermass += daughtermass[index];
}
//create parent G4DynamicParticle at rest
G4ThreeVector dummy;
G4DynamicParticle * parentparticle = new G4DynamicParticle( parent, dummy, 0.0);
//create G4Decayproducts
G4DecayProducts *products = new G4DecayProducts(*parentparticle);
delete parentparticle;
// calculate daughter momentum
G4double daughtermomentum[3];
G4double energy;
// calcurate electron energy
G4double xmax = (1.0+daughtermass[0]*daughtermass[0]/parentmass/parentmass);
G4double x;
G4double r;
do {
do {
r = G4UniformRand();
x = xmax*G4UniformRand();
} while (r > (3.0 - 2.0*x)*x*x);
energy = x*parentmass/2.0 - daughtermass[0];
} while (energy <0.0);
//create daughter G4DynamicParticle
// daughter 0 (electron)
daughtermomentum[0] = std::sqrt(energy*energy + 2.0*energy* daughtermass[0]);
G4double costheta, sintheta, phi, sinphi, cosphi;
costheta = 2.*G4UniformRand()-1.0;
sintheta = std::sqrt((1.0-costheta)*(1.0+costheta));
phi = twopi*G4UniformRand()*rad;
sinphi = std::sin(phi);
cosphi = std::cos(phi);
G4ThreeVector direction0(sintheta*cosphi,sintheta*sinphi,costheta);
G4DynamicParticle * daughterparticle
= new G4DynamicParticle( daughters[0], direction0*daughtermomentum[0]);
products->PushProducts(daughterparticle);
// daughter 1 ,2 (nutrinos)
// create neutrinos in the C.M frame of two neutrinos
G4double energy2 = parentmass*(1.0 - x/2.0);
G4double vmass = std::sqrt((energy2-daughtermomentum[0])*(energy2+daughtermomentum[0]));
G4double beta = -1.0*daughtermomentum[0]/energy2;
G4double costhetan = 2.*G4UniformRand()-1.0;
G4double sinthetan = std::sqrt((1.0-costhetan)*(1.0+costhetan));
G4double phin = twopi*G4UniformRand()*rad;
G4double sinphin = std::sin(phin);
G4double cosphin = std::cos(phin);
G4ThreeVector direction1(sinthetan*cosphin,sinthetan*sinphin,costhetan);
G4DynamicParticle * daughterparticle1
= new G4DynamicParticle( daughters[1], direction1*(vmass/2.));
G4DynamicParticle * daughterparticle2
= new G4DynamicParticle( daughters[2], direction1*(-1.0*vmass/2.));
// boost to the muon rest frame
G4LorentzVector p4;
p4 = daughterparticle1->Get4Momentum();
p4.boost( direction0.x()*beta, direction0.y()*beta, direction0.z()*beta);
daughterparticle1->Set4Momentum(p4);
p4 = daughterparticle2->Get4Momentum();
p4.boost( direction0.x()*beta, direction0.y()*beta, direction0.z()*beta);
daughterparticle2->Set4Momentum(p4);
products->PushProducts(daughterparticle1);
products->PushProducts(daughterparticle2);
daughtermomentum[1] = daughterparticle1->GetTotalMomentum();
daughtermomentum[2] = daughterparticle2->GetTotalMomentum();
// output message
#ifdef G4VERBOSE
if (GetVerboseLevel()>1) {
G4cout << "G4MuonDecayChannel::DecayIt ";
G4cout << " create decay products in rest frame " <<G4endl;
products->DumpInfo();
}
#endif
return products;
}

View File

@ -1,63 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4MuonDecayChannel.hh,v 1.5 2001/07/11 10:01:56 gunter Exp $
// GEANT4 tag $Name: geant4-07-00-cand-01 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, based on object model of
// 30 May 1997 H.Kurashige
// ------------------------------------------------------------
#ifndef G4MuonDecayChannel_h
#define G4MuonDecayChannel_h 1
#include "G4ios.hh"
#include "globals.hh"
#include "G4VDecayChannel.hh"
class G4MuonDecayChannel :public G4VDecayChannel
{
// Class Decription
// This class describes muon decay kinemtics.
// This version neglects muon polarization
// assumes the pure V-A coupling
// gives incorrect energy spectrum for neutrinos
//
public: // With Description
//Constructors
G4MuonDecayChannel(const G4String& theParentName,
G4double theBR);
// Destructor
virtual ~G4MuonDecayChannel();
public: // With Description
virtual G4DecayProducts *DecayIt(G4double);
};
#endif

View File

@ -1,264 +0,0 @@
//
// ********************************************************************
// * 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
//
// History:
// 17 August 2004 P.Gumplinger and T.MacPhail
// samples Michel spectrum including 1st order
// radiative corrections
// Reference: Florian Scheck "Muon Physics", in Physics Reports
// (Review Section of Physics Letters) 44, No. 4 (1978)
// 187-248. North-Holland Publishing Company, Amsterdam
// at page 210 cc.
//
// W.E. Fisher and F. Scheck, Nucl. Phys. B83 (1974) 25.
//
// ------------------------------------------------------------
//
#include "G4MuonDecayChannelWithSpin.hh"
#include "Randomize.hh"
#include "G4DecayProducts.hh"
#include "G4LorentzVector.hh"
G4MuonDecayChannelWithSpin::G4MuonDecayChannelWithSpin(const G4String& theParentName,
G4double theBR)
: G4MuonDecayChannel(theParentName,theBR)
{
}
G4MuonDecayChannelWithSpin::~G4MuonDecayChannelWithSpin()
{
}
G4DecayProducts *G4MuonDecayChannelWithSpin::DecayIt(G4double)
{
// This version assumes V-A coupling with 1st order radiative correctons,
// the standard model Michel parameter values, but
// gives incorrect energy spectrum for neutrinos
#ifdef G4VERBOSE
if (GetVerboseLevel()>1) G4cout << "G4MuonDecayChannelWithSpin::DecayIt ";
#endif
if (parent == 0) FillParent();
if (daughters == 0) FillDaughters();
// parent mass
G4double parentmass = parent->GetPDGMass();
EMMU = parentmass;
//daughters'mass
G4double daughtermass[3];
G4double sumofdaughtermass = 0.0;
for (G4int index=0; index<3; index++){
daughtermass[index] = daughters[index]->GetPDGMass();
sumofdaughtermass += daughtermass[index];
}
EMASS = daughtermass[0];
//create parent G4DynamicParticle at rest
G4ThreeVector dummy;
G4DynamicParticle * parentparticle = new G4DynamicParticle( parent, dummy, 0.0);
//create G4Decayproducts
G4DecayProducts *products = new G4DecayProducts(*parentparticle);
delete parentparticle;
// calcurate electron energy
G4double michel_rho = 0.75; //Standard Model Michel rho
G4double michel_delta = 0.75; //Standard Model Michel delta
G4double michel_xsi = 1.00; //Standard Model Michel xsi
G4double michel_eta = 0.00; //Standard Model eta
G4double rndm, x, ctheta;
G4double FG;
G4double FG_max = 2.00;
G4double W_mue = (EMMU*EMMU+EMASS*EMASS)/(2.*EMMU);
G4double x0 = EMASS/W_mue;
G4double x0_squared = x0*x0;
// ***************************************************
// x0 <= x <= 1. and -1 <= y <= 1
//
// F(x,y) = f(x)*g(x,y); g(x,y) = 1.+g(x)*y
// ***************************************************
// ***** sampling F(x,y) directly (brute force) *****
do{
// Sample the positron energy by sampling from F
rndm = G4UniformRand();
x = x0 + rndm*(1.-x0);
G4double x_squared = x*x;
G4double F_IS, F_AS, G_IS, G_AS;
F_IS = 1./6.*(-2.*x_squared+3.*x-x0_squared);
F_AS = 1./6.*std::sqrt(x_squared-x0_squared)*(2.*x-2.+std::sqrt(1.-x0_squared));
G_IS = 2./9.*(michel_rho-0.75)*(4.*x_squared-3.*x-x0_squared);
G_IS = G_IS + michel_eta*(1.-x)*x0;
G_AS = 3.*(michel_xsi-1.)*(1.-x);
G_AS = G_AS+2.*(michel_xsi*michel_delta-0.75)*(4.*x-4.+std::sqrt(1.-x0_squared));
G_AS = 1./9.*std::sqrt(x_squared-x0_squared)*G_AS;
F_IS = F_IS + G_IS;
F_AS = F_AS + G_AS;
// *** Radiative Corrections ***
G4double R_IS = F_c(x,x0);
G4double F = 6.*F_IS + R_IS/std::sqrt(x_squared-x0_squared);
// *** Radiative Corrections ***
G4double R_AS = F_theta(x,x0);
rndm = G4UniformRand();
ctheta = 2.*rndm-1.;
G4double G = 6.*F_AS - R_AS/std::sqrt(x_squared-x0_squared);
FG = std::sqrt(x_squared-x0_squared)*F*(1.+(G/F)*ctheta);
if(FG>FG_max){
G4cout<<"***Problem in Muon Decay *** : FG > FG_max"<<G4endl;
FG_max = FG;
}
rndm = G4UniformRand();
}while(FG<rndm*FG_max);
G4double energy = x * W_mue;
rndm = G4UniformRand();
G4double phi = twopi * rndm;
if(energy < EMASS) energy = EMASS;
// calculate daughter momentum
G4double daughtermomentum[3];
daughtermomentum[0] = std::sqrt(energy*energy - EMASS*EMASS);
G4double stheta = std::sqrt(1.-ctheta*ctheta);
G4double cphi = std::cos(phi);
G4double sphi = std::sin(phi);
//Coordinates of the decay positron with respect to the muon spin
G4double px = stheta*cphi;
G4double py = stheta*sphi;
G4double pz = ctheta;
G4ThreeVector direction0(px,py,pz);
direction0.rotateUz(parent_polarization);
G4DynamicParticle * daughterparticle0
= new G4DynamicParticle( daughters[0], daughtermomentum[0]*direction0);
products->PushProducts(daughterparticle0);
// daughter 1 ,2 (neutrinos)
// create neutrinos in the C.M frame of two neutrinos
G4double energy2 = parentmass*(1.0 - x/2.0);
G4double vmass = std::sqrt((energy2-daughtermomentum[0])*(energy2+daughtermomentum[0]));
G4double beta = -1.0*daughtermomentum[0]/energy2;
G4double costhetan = 2.*G4UniformRand()-1.0;
G4double sinthetan = std::sqrt((1.0-costhetan)*(1.0+costhetan));
G4double phin = twopi*G4UniformRand()*rad;
G4double sinphin = std::sin(phin);
G4double cosphin = std::cos(phin);
G4ThreeVector direction1(sinthetan*cosphin,sinthetan*sinphin,costhetan);
G4DynamicParticle * daughterparticle1
= new G4DynamicParticle( daughters[1], direction1*(vmass/2.));
G4DynamicParticle * daughterparticle2
= new G4DynamicParticle( daughters[2], direction1*(-1.0*vmass/2.));
// boost to the muon rest frame
G4LorentzVector p4;
p4 = daughterparticle1->Get4Momentum();
p4.boost( direction0.x()*beta, direction0.y()*beta, direction0.z()*beta);
daughterparticle1->Set4Momentum(p4);
p4 = daughterparticle2->Get4Momentum();
p4.boost( direction0.x()*beta, direction0.y()*beta, direction0.z()*beta);
daughterparticle2->Set4Momentum(p4);
products->PushProducts(daughterparticle1);
products->PushProducts(daughterparticle2);
daughtermomentum[1] = daughterparticle1->GetTotalMomentum();
daughtermomentum[2] = daughterparticle2->GetTotalMomentum();
// output message
#ifdef G4VERBOSE
if (GetVerboseLevel()>1) {
G4cout << "G4MuonDecayChannelWithSpin::DecayIt ";
G4cout << " create decay products in rest frame " <<G4endl;
products->DumpInfo();
}
#endif
return products;
}
G4double G4MuonDecayChannelWithSpin::R_c(G4double x){
G4int n_max = (int)(100.*x);
if(n_max<10)n_max=10;
G4double L2 = 0.0;
for(G4int n=1; n<=n_max; n++){
L2 += std::pow(x,n)/(n*n);
}
G4double omega = std::log(EMMU/EMASS);
G4double r_c;
r_c = 2.*L2-(pi*pi/3.)-2.;
r_c = r_c + omega * (1.5+2.*std::log((1.-x)/x));
r_c = r_c - std::log(x)*(2.*std::log(x)-1.);
r_c = r_c + (3.*std::log(x)-1.-1./x)*std::log(1.-x);
return r_c;
}

View File

@ -1,122 +0,0 @@
//
// ********************************************************************
// * 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
//
// History:
// 17 August 2004 P.Gumplinger and T.MacPhail
// samples Michel spectrum including 1st order
// radiative corrections
// Reference: Florian Scheck "Muon Physics", in Physics Reports
// (Review Section of Physics Letters) 44, No. 4 (1978)
// 187-248. North-Holland Publishing Company, Amsterdam
// at page 210 cc.
//
// W.E. Fisher and F. Scheck, Nucl. Phys. B83 (1974) 25.
//
// ------------------------------------------------------------
#ifndef G4MuonDecayChannelWithSpin_hh
#define G4MuonDecayChannelWithSpin_hh 1
#include "globals.hh"
#include "G4ThreeVector.hh"
#include "G4MuonDecayChannel.hh"
class G4MuonDecayChannelWithSpin : public G4MuonDecayChannel
{
// Class Decription
// This class describes muon decay kinemtics.
// This version assumes V-A coupling with 1st order radiative correctons,
// the standard model Michel parameter values, but
// gives incorrect energy spectrum for neutrinos
public: // With Description
//Constructors
G4MuonDecayChannelWithSpin(const G4String& theParentName,
G4double theBR);
// Destructor
virtual ~G4MuonDecayChannelWithSpin();
public: // With Description
virtual G4DecayProducts *DecayIt(G4double);
void SetPolarization(G4ThreeVector);
const G4ThreeVector& GetPolarization() const;
private:
G4ThreeVector parent_polarization;
// Radiative Correction Factors
G4double F_c(G4double x, G4double x0);
G4double F_theta(G4double x, G4double x0);
G4double R_c(G4double x);
G4double EMMU;
G4double EMASS;
};
inline void G4MuonDecayChannelWithSpin::SetPolarization(G4ThreeVector polar)
{
parent_polarization = polar;
}
inline const G4ThreeVector& G4MuonDecayChannelWithSpin::GetPolarization() const
{
return parent_polarization;
}
inline G4double G4MuonDecayChannelWithSpin::F_c(G4double x, G4double x0)
{
G4double omega = std::log(EMMU/EMASS);
G4double f_c;
f_c = (5.+17.*x-34.*x*x)*(omega+std::log(x))-22.*x+34.*x*x;
f_c = (1.-x)/(3.*x*x)*f_c;
f_c = (6.-4.*x)*R_c(x)+(6.-6.*x)*std::log(x) + f_c;
f_c = (fine_structure_const/twopi) * (x*x-x0*x0) * f_c;
return f_c;
}
inline G4double G4MuonDecayChannelWithSpin::F_theta(G4double x, G4double x0)
{
G4double omega = std::log(EMMU/EMASS);
G4double f_theta;
f_theta = (1.+x+34*x*x)*(omega+std::log(x))+3.-7.*x-32.*x*x;
f_theta = f_theta + ((4.*(1.-x)*(1.-x))/x)*std::log(1.-x);
f_theta = (1.-x)/(3.*x*x) * f_theta;
f_theta = (2.-4.*x)*R_c(x)+(2.-6.*x)*std::log(x)-f_theta;
f_theta = (fine_structure_const/twopi) * (x*x-x0*x0) * f_theta;
return f_theta;
}
#endif

View File

@ -1,11 +0,0 @@
Geant4 ElectricField update files:
Copy files in the following directories:
G4El_EqRhs -----> $G4Install/source/geometry/magneticfield /src and /include
G4El_UsualEqRhs -----> $G4Install/source/geometry/magneticfield /src and /include
G4ChordFinder -----> $G4Install/source/geometry/magneticfield /src and /include
G4ParticleGun -----> $G4Install/source/event /src and /include
track/ is the geant4.6.2 version of $G4Install/source/track directory and should be updated

View File

@ -1,4 +0,0 @@
D/include////
D/src////
/GNUmakefile/1.5/Thu Jul 29 19:00:37 2004//Tgeant4-06-02-ref-01
/History/1.70/Thu Jul 29 19:00:37 2004//Tgeant4-06-02-ref-01

View File

@ -1 +0,0 @@
geant4/source/track

View File

@ -1 +0,0 @@
:pserver:gum@g4cvs.cern.ch:/afs/cern.ch/sw/geant4/cvs

View File

@ -1 +0,0 @@
Ngeant4-06-02-ref-01

View File

@ -1,33 +0,0 @@
# $Id: GNUmakefile,v 1.5 2004/06/11 14:28:12 gcosmo Exp $
# ----------------------------------------------------------
# GNUmakefile for track library. Gabriele Cosmo, 3/4/1997.
# ----------------------------------------------------------
name := G4track
ifndef G4INSTALL
G4INSTALL = ../..
endif
GLOBLIBS = libG4particles.lib libG4geometry.lib
GLOBLIBS += libG4materials.lib libG4graphics_reps.lib
GLOBLIBS += libG4intercoms.lib libG4global.lib
include $(G4INSTALL)/config/architecture.gmk
CPPFLAGS += -DG4TRACK_ALLOC_EXPORT
CPPFLAGS += \
-I$(G4BASE)/global/management/include \
-I$(G4BASE)/global/HEPRandom/include \
-I$(G4BASE)/global/HEPGeometry/include \
-I$(G4BASE)/intercoms/include \
-I$(G4BASE)/particles/management/include \
-I$(G4BASE)/materials/include \
-I$(G4BASE)/geometry/management/include
include $(G4INSTALL)/config/common.gmk
.PHONY: global
global: lib

View File

@ -1,348 +0,0 @@
$Id: History,v 1.70 2004/06/15 08:19:02 vnivanch Exp $
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
Category History file
---------------------
This file should be used by G4 developers and category coordinators
to briefly summarize all major modifications introduced in the code
and keep track of all category-tags.
It DOES NOT substitute the CVS log-message one should put at every
committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Jun. 15, 04 V.Ivanchenko (track-V06-01-05)
- G4ParticleChangeForLoss: fix initialization of ParentWeight
Jun. 11, 04 G.Cosmo (track-V06-01-04)
- Use global flag G4TRACK_ALLOC_EXPORT to export extern symbols for DLLs.
Modified GNUmakefile and rearranged usage of extern symbols in G4Track.
Jun. 09, 04 G.Cosmo (track-V06-01-03)
- Adopt G4DLLIMPORT/G4DLLEXPORT technique to handle extern simbols for
allowing support of DLLs on Windows.
- Coworks with "global-V06-01-02b".
Jun. 07, 04 G.Cosmo (track-V06-01-02)
- Export extern symbols for allowing support of DLLs on Windows.
Modified G4Track.icc.
- GNUmakefile: added definition of GLOBLIBS for DLLs support on Windows.
- Coworks with "global-V06-01-02a".
May. 11, 04 V.Ivanchenko (track-V06-01-01)
- G4ParticleChangeForLoss: rename variables according to 00 tag;
fix of minor energy non-conservation in case of more than 1
processes changing the energy
May. 08, 04 H.Kurashige (track-V06-01-00)
- Add new methods of ProposeXXX (and corresponding GetXXX methods)
as replacements of old methods of SetXXXChange and GetXXXChange
Jan. 20, 04 V.Ivanchenko (track-V06-00-01)
- Update G4ParticleChangeForLoss for utilisation in G4VEnergyLossProcess
- Minor update G4ParticleChangeForMSC for utilisation in model design of msc
- Change of volume in G4ParticleChangeForTransportation only if kinEnergy>0
Dec. 12, 03 G.Cosmo (track-V06-00-00)
- G4VParticleChange[.hh.cc]: removed unnecessary 'const' qualifier to
return value in GetAccuracyForWarning() and GetAccuracyForException()
causing noisy warnings on Intel-icc compiler.
Nov. 26, 03 H.Kurashige (track-V05-02-03)
- Fixed problem of setting momentum direction for stoppped particle in G4ParticleChange (Vladimir)
Oct. 4, 03 G.Cosmo (track-V05-02-02)
- Modified GNUmakefile:
o added dependency to new module "geometry/navigation".
- Coworks with "geometry-V05-02-00" and "digits_hits-V05-02-00".
Jun. 11, 03 H.Kurashige (track-V05-02-01)
- Add ExceptionSeverity
- Add G4VParticleChange::CheckSecondary
- Remove inclusion of G4MaterialCutsCouple
Jun. 03, 03 G.Cosmo (track-V05-01-03)
- Fixed warning in G4ParticleChangeForRadDecay.hh.
Mar. 20, 03 M.Asai (track-V05-01-02)
- Fix copy operator of G4Track not to copy the pointer to user information
Mar. 20, 03 H.Kurashige (track-V05-01-01)
- Correct comments
- Fixed unused parameter in G4VParticleChange.cc
Mar. 5, 02 H.Kurashige (track-V05-00-02)
- Fix in G4Step::InitializeStep().
Added initialization of fCharge in StepPoint.
Jan. 24, 02 G.Cosmo (track-V05-00-01)
- Fix in G4ParticleChangeForTransport::UpdateStepForPostStep().
Added call for setting the material-cuts-couple for pPostStepPoint
(V.Ivantchenko).
Dec. 16, 02 G.Cosmo (track-V05-00-00)
- Merged branch "geant4-04-01-ref-02-cuts-branch" to HEAD.
Included development for 'cuts-by-region':
o Updated G4Track, G4Step, G4StepPoint and G4ParticleChangeForTransport
to properly handle new G4MaterialCutsCouple.
Dec. 04, 02 T.Sasaki (track-V04-01-03)
- Initial value for fCharge is given in the constuctor
of G4StepPoint.
Nov. 20, 02 G.Cosmo (track-V04-01-02)
- Patched access to public static data in G4VParticleChange.
Added accessors to be used in the kernel to allow porting on
Windows DLLs.
Nov. 1, 02 J.Generowicz (track-V04-01-01)
- Added accessors to auxiliary point vector, in both
G4Step and G4ParticleChangeForTransport
Oct. 31, 02 T.Sasaki (track-V04-01-00)
- Added StronglyForced flag to G4ForceCondition
- set fUndefined for the StepStatus in PostStepPoint after CopyPostToPre
Feb. 09 ,02 H.Kurashige (track-V04-00-02)
- Modify G4Track::GetVelocity to get better performance for massless particles
Dec. 24 ,01 H.Kurashige (track-V04-00-01)
- Remove event biasing mechanism from track category
( it is moved to hadronic/models )
- Add G4Track::CopyTrackInfo
- Modified G4ParticleChange::AddSecondary to use touchable handle
- Fixed a bug of changing parent weight in G4ParticleChange::UpdateStepForAlongStep
Dec. 12, 01 H.Kurashige (track-V04-00-00)
- Added initialization of fStepLength in constructors.
- Fixed a bug that fStepLength is not copied in assginment operator
Dec. 10, 01 H.Kurashige (track-V03-02-08)
- Modified assignment operator so that fCurrentStepNumber is set to 0
Nov.27, 01 J. Apostolakis (track-V03-02-07) for H. Kurashige
- Modified G4ParticleChange::AddSecondary to use touchable handle - by Hisaya
(only one of the AddSecondary methods has been modified - to date)
Nov.10, 01 (track-V03-02-06)
- Fixed bugs in assignment operators in G4Track
- Added SetParentWeightByProcess
- Added SetSecondaryWeightByProcess
Nov. 08, 01 G.Cosmo (track-V03-02-05)
- Merge changes included in "track-V03-02-02a".
Oct. 22, 01 H.Kurashige (track-V03-02-04)
- Modify to intorduce TouchableHandle (Radovan)
Oct. 20, 01 H.Kurashige (track-V03-02-03)
- Remove "static inline methods"
- Disable EventBiasingMechanism
Oct. 26, 01 G.Cosmo (track-V03-02-02a)
- Added implementation to assignment operator in G4ParticleChangeForRadDecay.hh
(H.Kurasige)
Sep. 20, 01 H.Kurashige (track-V03-02-02)
- Update to G4Mars5GeVMechanism for STL migration of materials
Sep. 20, 01 H.Kurashige (track-V03-02-01)
- Modify G4Mars5GeVMechanism for STL migration of materials
Aug. 16, 01 H.Kurashige (track-V03-02-00)
- Clean up codes
Mar 7, 01 H.Kurashige (track-V03-00-04)
- Add protection for the zero-momentum case
for UpdateStepForAlongStep in ParticleChange (J.A)
Feb 17, 01 H.Kurashige (track-V03-00-03)
- Add Velocity and Setmethod in G4StepPoint
- Add SetVelocity in G4Step.::InitializeStep
- Modify G4StepPoint::GetVelocity to return correct velocity for optical photon
Feb 17, 01 H.Kurashige (track-V03-00-02)
- Fix G4Track::GetVelocity for Gamma
Feb 12, 01 H.Kurashige (track-V03-00-01)
- Remove thePolarizationChange from G4ParticleChangeForTransport.hh
Feb 07, 01 H.Kurashige (track-V03-00-00)
- Add copy constructor to G4Track
Oct 19, 00 H.kurashige (track-V02-00-01)
- Bug fixes in copy constructor of G4ParticleChange
Oct 18, 00 H.Kurashige (track-V02-00-00)
- Add "const" to G4DynamicParticle pointer of returned value of G4Track::GetDynamicParticle
June 2, 2000 M.Asai (track-V01-01-02)
- Add G4VUserTrackInformation class and its pointer data member in G4Track
- Add "const" to pointer to G4Step in G4Track (Hisaya)
June 1 2000 H.Kurashige (track-V01-01-01a)
- Removed "const" from the return value type of G4StepPoint::GetPhysicalVolume()
May 16 2000 H.Kurashige (track-V01-01-01)
- Added thePolarizationChange in G4ParticleChangeForTransportation
May 12 2000 H.Kurashige (track-V01-01-00)
- SetTouchable methods has been changed to get "const" pointer
Feb. 16, 2000 H.Kurashige
- Added cashing mechanism of pointer to material in G4StepPoint
- Added theMaterialChange in G4ParticleChangeForTransportation
- GetTouchable methods has been changed to give "const" pointer
Feb 13, 2000 H.Kurashige (track-V01-00-01)
- Added G4ParticleChangeForRadDecay
- Changed G4VParticleChange::AddSecondary to set secondary track weight equal to the primary's one
- Removed printing pointers of ParticleChange object in CheckIt methods
Jan 18, 2000 H.Kurashige (track-V01-00-00)
- Fixed bugs in treatment of secondary track weight
Nov 7, 1999 H.Kurashige (track-V00-01-01)
- Added comments for "Software Reference Manual"
Oct 5, 1999 H,Kurashige (track-V00-01-00)
- Added mass/charge change in G4ParticleChange
- Modified G4ParticleChange::CheckIt
- Separate implementation of inline functions to G4Track.icc and G4Step.icc
July 14 1999 H.Kurashige (track-01-00-07)
- Fixed bugs in G4Mars5GeVMechanism::CreatePion()
May 6, 1999 H.Kurashige (track-01-00-06)
- Modified CheckIt methods of G4VParticleChange and derived classes
Apr 28, 1999 H.Kurashige (track-01-00-05b)
- Protect proton mass against glanular libraly for G4Mars5Gev...(Makoto)
- Fixed error messages in G4ParticleChange::CheckIt (Hisaya)
- Remove "include/G4VProcess.hh" from G4Step.cc (Hisaya)
Apr 13, 1999 H.Kurashige (track-01-00-04)
- Code polishing according to the messages by CodeWizard
- Added new virtual method of G4bool CheckIt(const G4Track&) in G4VParticleChange
Feb 17, 1999 H.Kurashige (track-01-00-03)
- Removed G4Step::ShowStep() (Takashi)
- Fixed bugs in G4ParticleChange.icc (Hisaya)
Feb 9, 1999 H.Kurashige (track-01-00-02)
- Modified G4TrackFastVector (Hisaya)
- Modified G4ParticleChange::CheckIt (Hisaya)
Feb 6, 1999 H.Kurashige (track-01-00-01)
- Added Get/SetMomentumDirectionChange in G4ParticleChange (Hisaya)
- Removed using G4ParticleMomentum (Hisaya)
December 15, 1998 H.Kurashige (track-00-04-05)
- G4ParticleChange::CheckIt is activated in VERBOSE mode (Hisaya)
December 12, 1998 H.Kurashige (track-00-04-04)
- Fixed bugs in G4Mars5GeVMechanism (Hisaya)
- Added SwOnAllEB/SwOffAllEB in G4ParticleChange (Hisaya)
- Added GetEBMechanis and IsEBActive in G4VParticleChange (Hisaya)
December 11, 1998 H.Kurashige (track-00-04-03)
- Fixed bugs in G4Mars5GeVMechanism (Hisaya)
December 9, 1998 L.Urban (track-00-04-02)
- Added G4ParticleChangeForLoss and G4ParticleChangeForMSC.
November 18, 98 H.Kurashige (track-00-04-01)A
- Added new member of weight in G4Track and removed G4BiasingTag
- Added Event Biasing based on MARS
- Modified argument type in G4Track
( this tag requires particles-00-04-01 tag)
November 9, 98 H.Kurashige (track-00-03-05)
- Added Event Biasing Mechanism in G4VParticleChange
November 8, 98 H.Kurashige (track-00-03-04)
- Added G4BiasingTag as a member of G4Track
- Modified G4Step, and G4StepPoint for managing G4BiasingTag
Octorber 17, 98 H.Kurashige (track-00-03-03)
- Fixed bugs in G4VParticleChange and G4ParticleChange
October 14 19 H.Kurashige (track-00-03-01)
- Modified G4ParticleChangeForTransportation for new relocation algorism.
(J.Apost.)
August 31, 98 G.Cosmo (track-00-02-01)
- Added "global" phony target to GNUmakefile.
- Added comment to G4StepPoint.hh (J.Apostolakis).
July 20,98 H.Kurashige (track-00-01-05)
- Modified G4ParticleChangeForDecay
July 10, 98 P.Urban (track-00-01-02)
- Optimised G4ParticleChangeForTransport. Much less data
is copied -> increased performance.
July 1, 98 H.Kurashige (track-00-07-02)
- Moved UpdateStepForAlongStep into G4ParticleChangeForTransport.cc file
June 30, 98 P. Urban (track-00-07-01)
- Some more tracking optimisation results.
June 22, 98 P. Urban (track-00-06-04)
- Preliminary results of tracking optimisation merged into HEAD.
June 11, 98 G.Cosmo (track-00-06-03)
- Tagged track-00-06-03.
June 11, 98 J.Allison
- Added a missing inline keyword to G4Track.hh:341.
June 8, 98 H.Kurashige
- Add GoodForTracking and BelowThreshold flags in G4Track
for new COHERENT scheme for the Cuts
May 12, 98 H.Kurashige
- Fix bugs in G4Step, G4ParticleChange
Add new class of G4ParticleChangeForTransport
April 12, 98 H.Kuraashige
Implement new scheme of 'Particle Change'. Please see
particle_change.asc in geant4alpha/documents/particles+matter/.
Following files are modified (or added)
G4ParticleChange.hh, .icc, .cc
G4VParticleChange.hh, .icc, .cc
G4ParticleChangeForDecay.hh, .cc
G4Step.hh, G4TrackFastVector.hh
April 9, 98 G.Cosmo
- Porting on DEC-cxx 6.0.
Removed meaningless usage of "const" qualifier from functions
return type for basic types by value. Modified files:
G4ParticleChange.hh, .icc,
G4Step.hh, G4StepPoint.hh, G4Track.hh
March 18, 1998 K. Amako
Add following information to G4Track:
1.Momentum direction at the start point (vertex position) of the track
2.Kinetic energy at the start point (vertex position) of the track
3.Pointer to the process which created the current track
Due to this, the following files have modififed and committed.
1.NewDesignDoc.txt
2.G4Track.hh, G4Track.cc
3.G4SteppingManager.cc
January 29, 97 K. Amako
Following changes have been done and committed/tagged to cvs.
Tag# is track-00-03-01.
- G4Step.cc: Output format has been changed in showStep().
December 19, 97 G. Cosmo - (alpha03)
- Created.

View File

@ -1,25 +0,0 @@
/G4ForceCondition.hh/1.4/Tue Jan 7 20:02:52 2003//Tgeant4-06-02-ref-01
/G4GPILSelection.hh/1.3/Wed Jul 11 10:08:35 2001//Tgeant4-06-02-ref-01
/G4ParticleChangeForMSC.hh/1.7/Thu Jul 29 19:00:43 2004//Tgeant4-06-02-ref-01
/G4ParticleChangeForRadDecay.hh/1.5/Thu Jul 10 20:47:22 2003//Tgeant4-06-02-ref-01
/G4Step.hh/1.10/Thu Jul 10 20:47:22 2003//Tgeant4-06-02-ref-01
/G4Step.icc/1.10/Wed Apr 9 00:20:48 2003//Tgeant4-06-02-ref-01
/G4StepPoint.hh/1.13/Sat Nov 1 03:24:48 2003//Tgeant4-06-02-ref-01
/G4StepPoint.icc/1.8/Fri May 30 19:12:02 2003//Tgeant4-06-02-ref-01
/G4StepStatus.hh/1.3/Wed Jul 11 10:08:37 2001//Tgeant4-06-02-ref-01
/G4SteppingControl.hh/1.3/Wed Jul 11 10:08:37 2001//Tgeant4-06-02-ref-01
/G4Track.hh/1.16/Wed Apr 9 00:20:48 2003//Tgeant4-06-02-ref-01
/G4TrackFastVector.hh/1.4/Wed Jul 11 10:08:37 2001//Tgeant4-06-02-ref-01
/G4TrackStatus.hh/1.3/Wed Jul 11 10:08:37 2001//Tgeant4-06-02-ref-01
/G4VUserTrackInformation.hh/1.4/Fri May 30 19:12:13 2003//Tgeant4-06-02-ref-01
/G4ParticleChange.hh/1.10/Thu Jul 29 19:08:17 2004//Tgeant4-06-02-ref-01
/G4ParticleChange.icc/1.10/Thu Jul 29 19:08:19 2004//Tgeant4-06-02-ref-01
/G4ParticleChangeForDecay.hh/1.6/Thu Jul 29 19:08:21 2004//Tgeant4-06-02-ref-01
/G4ParticleChangeForLoss.hh/1.12/Thu Jul 29 19:08:21 2004//Tgeant4-06-02-ref-01
/G4ParticleChangeForMSC.icc/1.5/Thu Jul 29 19:08:21 2004//Tgeant4-06-02-ref-01
/G4ParticleChangeForTransport.hh/1.13/Thu Jul 29 19:08:22 2004//Tgeant4-06-02-ref-01
/G4ParticleChangeForTransport.icc/1.10/Thu Jul 29 19:08:22 2004//Tgeant4-06-02-ref-01
/G4Track.icc/1.13/Thu Jul 29 19:08:22 2004//Tgeant4-06-02-ref-01
/G4VParticleChange.hh/1.11/Thu Jul 29 19:08:22 2004//Tgeant4-06-02-ref-01
/G4VParticleChange.icc/1.11/Thu Jul 29 19:08:22 2004//Tgeant4-06-02-ref-01
D

View File

@ -1 +0,0 @@
geant4/source/track/include

View File

@ -1 +0,0 @@
:pserver:gum@g4cvs.cern.ch:/afs/cern.ch/sw/geant4/cvs

View File

@ -1 +0,0 @@
Ngeant4-06-02-ref-01

View File

@ -1,68 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4ForceCondition.hh,v 1.4 2002/10/31 23:41:52 tsasaki Exp $
// GEANT4 tag $Name: $
//
//
//---------------------------------------------------------------
//
// G4ForceCondition
//
// Class Description:
// This enumaration specifies possible conditions the three
// types of DoIt can be assinged by physics processes.
//
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
//
//---------------------------------------------------------------
#ifndef G4ForceCondition_h
#define G4ForceCondition_h 1
/////////////////////
enum G4ForceCondition
/////////////////////
{
InActivated,
// This PostStepDoit is inactivated by a user
Forced,
// This PostStepDoIt is forced to invoke if particle is not a state of StopAndKill.
NotForced,
// This PostStepDoIt is not forced to invoke.
Conditionally,
// This PostStepDoIt is forced to invoke only when corresponding
// AlongStepDoIt limits the Step.
ExclusivelyForced,
// Only this PostStepDoIt (or AtRestDoIt) is exclusively forced
// to invoke - all other DoIt including AlongStepDoIts are ignored.
StronglyForced
// This PostStepDoIt is really forced to invoke, anyway.
};
#endif

View File

@ -1,63 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4GPILSelection.hh,v 1.3 2001/07/11 10:08:35 gunter Exp $
// GEANT4 tag $Name: geant4-04-00-ref-03 $
//
//
//---------------------------------------------------------------
//
// G4GPILSelection
//
// Class Description:
// This enumaration is used to control whether a AlongStepProcess
// can be a winner of the GPIL race or not.
//
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
//
//---------------------------------------------------------------
#ifndef G4GPILSelection_h
#define G4GPILSelection_h 1
/////////////////////
enum G4GPILSelection
/////////////////////
{
CandidateForSelection,
// This AlongStep process partecipates in the process selection
// mechanism, i.e. it can be the winner of the GPIL race.
// (this case is default)
NotCandidateForSelection
// This AlongStep process does not partecipate in the
// process selection mechanism even when it limits the Step.
};
#endif

View File

@ -1,294 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4ParticleChange.hh,v 1.10 2004/05/08 15:28:11 kurasige Exp $
// GEANT4 tag $Name: geant4-06-02-ref-01 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
//
// ------------------------------------------------------------
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
//
// Class Description
// This class is a concrete class for ParticleChange which
// has all functionality in old scheme.
//-
// This class contains the results after invocation of a physics process.
// This includes final states of parent particle (momentum, energy,
// etc) and secondary particles generated by the interaction.
// The tracking assumes that all the values of energy and
// momentum are in global reference system, therefore all the
// needed Lorentz transformations must have been already Done
// when filling the data-members of this class.
//-
// ---------------------------------------------------------------
// IMPORTANT NOTE: Although the name of the class and methods are
// "Change", what it stores (and returns in get) are the "FINAL"
// values of the Position, Momentum, etc.
//
// ------------------------------------------------------------
// modify AddSecondary methods for "GoodForTracking" flag
// 8 June 1998 H.Kurashige
// Add Track weight 12 Nov. 1998 H.Kurashige
// Add Get/SetMomentumDirectionChange 6 Feb. 1999 H.Kurashige
// Add get/SetDynamicMass 5 Oct. 1999 H.Kurashige
// Add get/SetDynamicCharge 5 Oct. 1999 H.Kurashige
// -------------------------------------------------------------
#ifndef G4ParticleChange_h
#define G4ParticleChange_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4ThreeVector.hh"
#include "G4ThreeVector.hh"
class G4DynamicParticle;
#include "G4VParticleChange.hh"
class G4ParticleChange: public G4VParticleChange
{
public:
// default constructor
G4ParticleChange();
// G4ParticleChange(G4bool useEB);
// destructor
virtual ~G4ParticleChange();
protected:
// hide copy constructor and assignment operaor as protected
G4ParticleChange(const G4ParticleChange &right);
G4ParticleChange & operator=(const G4ParticleChange &right);
public:
// equal/unequal operator
G4bool operator==(const G4ParticleChange &right) const;
G4bool operator!=(const G4ParticleChange &right) const;
public: // with description
// ----------------------------------------------------
// --- the following methods are for updating G4Step -----
// Return the pointer to the G4Step after updating the Step information
// by using final state information of the track given by a physics
// process
virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
// A physics process gives the final state of the particle
// relative to the initial state at the beginning of the Step,
// i.e., based on information of G4Track (or equivalently
// the PreStepPoint)
// In this method, the differences (delta) between these two states
// are calculated, and are accumulated in PostStepPoint.
// Take note that the return type of GetMomentumChange is a
// pointer to G4ParticleMometum. Also it is a normalized
// momentum vector.
virtual G4Step* UpdateStepForAtRest(G4Step* Step);
virtual G4Step* UpdateStepForPostStep(G4Step* Step);
// A physics process gives the final state of the particle
// based on information of G4Track (or equivalently the PreStepPoint)
virtual void Initialize(const G4Track&);
// Initialize all propoerties by using G4Track information
protected: // with description
G4Step* UpdateStepInfo(G4Step* Step);
// Update the G4Step specific attributes
// (i.e. SteppingControl, LocalEnergyDeposit, and TrueStepLength)
public: // with description
// ----------------------------------------------------
//--- methods to keep information of the final state--
// IMPORTANT NOTE:
// These ProposeXXX methods stores (and returns in GetXXX methods)
// the "FINAL" values of the Position, Momentum, etc.
const G4ThreeVector* GetMomentumDirection() const;
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz);
void ProposeMomentumDirection(const G4ThreeVector& Pfinal);
// Get/Propose the MomentumDirection vector: it is the final momentum direction.
const G4ThreeVector* GetPolarization() const;
void ProposePolarization(G4double Px, G4double Py, G4double Pz);
void ProposePolarization(const G4ThreeVector& finalPoralization);
// Get/Propose the final Polarization vector.
G4double GetEnergy() const;
void ProposeEnergy(G4double finalEnergy);
// Get/Propose the final kinetic energy of the current particle.
G4double GetProperTime() const;
void ProposeProperTime(G4double finalProperTime);
// Get/Propose th final eProperTime
const G4ThreeVector* GetPosition() const;
void ProposePosition(G4double x, G4double y, G4double z);
void ProposePosition(const G4ThreeVector& finalPosition);
// Get/Propose the final position of the current particle.
G4double GetGlobalTime() const;
void ProposeGlobalTime(G4double finalGlobalTime);
// Get/Propose the final GlobalTime
G4double GetMass() const;
void ProposeMass(G4double finalMass);
// Get/Propose the final dynamical Mass in G4DynamicParticle
G4double GetCharge() const;
void ProposeCharge(G4double finalCharge);
// Get/Propose the final dynamical Charge in G4DynamicParticl
G4double GetWeight() const;
void ProposeWeight(G4double finalWeight);
// Get/Propose the final Weight of the current particle
// -- Utility functions --
G4ThreeVector GetGlobalPosition(const G4ThreeVector& displacement) const;
// Convert the position displacement to the global position.
G4double GetGlobalTime(G4double timeDelay) const;
// Convert the time delay to the global time.
G4ThreeVector CalcMomentum(G4double energy,
G4ThreeVector direction,
G4double mass ) const;
// Calculate momentum by using Energy, Momentum Direction, and Mass
// ----------------------------------------------------
// ----------------------------------------------------
// --- methods for adding secondaries
void AddSecondary(G4Track* aSecondary);
// Add a secondary particle to theListOfSecondaries.
void AddSecondary(G4DynamicParticle* aSecondary,
G4bool IsGoodForTracking = false );
// Add a secondary particle to theListOfSecondaries.
// position and time are same as thePositionChange and theTimeChange
void AddSecondary(G4DynamicParticle* aSecondary,
G4ThreeVector position,
G4bool IsGoodForTracking = false );
// Add a secondary particle to theListOfSecondaries.
// global time are same as theTimeChange and theTimeChange
void AddSecondary(G4DynamicParticle* aSecondary,
G4double time,
G4bool IsGoodForTracking = false );
// Add a secondary particle to theListOfSecondaries.
// position and are same as thePositionChange
// ----------------------------------------------------
public:
// Following methods will be removed in release 7.0
// Using ProposeXXXX methods is recommended to setting
// properties in G4ParticleChange
const G4ThreeVector* GetMomentumDirectionChange() const;
void SetMomentumDirectionChange(G4double Px, G4double Py, G4double Pz);
void SetMomentumDirectionChange(const G4ThreeVector& Pfinal);
const G4ThreeVector* GetMomentum() const;
void SetMomentumChange(G4double Px, G4double Py, G4double Pz);
void SetMomentumChange(const G4ThreeVector& Pfinal);
const G4ThreeVector* GetMomentumChange() const;
const G4ThreeVector* GetPolarizationChange() const;
void SetPolarizationChange(G4double Px, G4double Py, G4double Pz);
void SetPolarizationChange(const G4ThreeVector& finalPoralization);
G4double GetEnergyChange() const;
void SetEnergyChange(G4double theEnergyChange);
G4double GetProperTimeChange() const;
void SetProperTimeChange(G4double t);
const G4ThreeVector* GetPositionChange() const;
void SetPositionChange(G4double x, G4double y, G4double z);
void SetPositionChange(const G4ThreeVector& finalPosition);
G4double GetTimeChange() const;
void SetTimeChange(G4double t);
G4double GetMassChange() const;
void SetMassChange(G4double mass);
G4double GetChargeChange() const;
void SetChargeChange(G4double mass);
G4double GetWeightChange() const;
void SetWeightChange(G4double w);
public:
virtual void DumpInfo() const;
protected:
G4ThreeVector theMomentumDirectionChange;
// It is the vector containing the final momentum direction
// after the invoked process. The application of the change
// of the momentum direction of the particle is not Done here.
// The responsibility to apply the change is up the entity
// which invoked the process.
G4ThreeVector thePolarizationChange;
// The changed (final) polarization of a given track
G4double theEnergyChange;
// The final kinetic energy of the current track
G4ThreeVector thePositionChange;
// The changed (final) position of a given track
G4double theTimeChange;
// The changed (final) global time of a given track
G4double theProperTimeChange;
// The changed (final) proper time of a given track
G4double theWeightChange;
// The Changed (final) weight of a given track
G4double theMassChange;
// The Changed (final) mass of a given track
G4double theChargeChange;
// The Changed (final) charge of a given track
const G4Track* theCurrentTrack;
public:
// for Debug
virtual G4bool CheckIt(const G4Track&);
};
#include "G4ParticleChange.icc"
#endif

View File

@ -1,355 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4ParticleChange.icc,v 1.10 2004/05/08 15:28:11 kurasige Exp $
// GEANT4 tag $Name: geant4-06-02-ref-01 $
//
//
inline
G4Step* G4ParticleChange::UpdateStepInfo(G4Step* pStep)
{
return G4VParticleChange::UpdateStepInfo(pStep);
}
inline
G4double G4ParticleChange::GetEnergy() const
{
return theEnergyChange;
}
inline
void G4ParticleChange::ProposeEnergy(G4double finalEnergy)
{
theEnergyChange = finalEnergy;
}
inline
const G4ThreeVector* G4ParticleChange::GetMomentumDirection() const
{
return &theMomentumDirectionChange;
}
inline
void G4ParticleChange::ProposeMomentumDirection(
G4double Px,
G4double Py,
G4double Pz )
{
theMomentumDirectionChange.setX(Px);
theMomentumDirectionChange.setY(Py);
theMomentumDirectionChange.setZ(Pz);
}
inline
void G4ParticleChange::ProposeMomentumDirection(const G4ThreeVector& P)
{
theMomentumDirectionChange = P;
}
inline
const G4ThreeVector* G4ParticleChange::GetPolarization() const
{
return &thePolarizationChange;
}
inline
void G4ParticleChange::ProposePolarization( const G4ThreeVector& finalPoralization)
{
thePolarizationChange = finalPoralization;
}
inline
void G4ParticleChange::ProposePolarization(
G4double Px,
G4double Py,
G4double Pz )
{
thePolarizationChange.setX(Px);
thePolarizationChange.setY(Py);
thePolarizationChange.setZ(Pz);
}
inline
const G4ThreeVector* G4ParticleChange::GetPosition() const
{
return &thePositionChange;
}
inline
void G4ParticleChange::ProposePosition(const G4ThreeVector& finalPosition)
{
thePositionChange= finalPosition;
}
inline
void G4ParticleChange::ProposePosition(G4double x,G4double y, G4double z)
{
thePositionChange.setX(x);
thePositionChange.setY(y);
thePositionChange.setZ(z);
}
inline
G4double G4ParticleChange::GetProperTime() const
{
return theProperTimeChange;
}
inline
void G4ParticleChange::ProposeProperTime(G4double tau)
{
theProperTimeChange = tau;
}
inline
G4ThreeVector G4ParticleChange::GetGlobalPosition(const G4ThreeVector& displacement) const
{
return thePositionChange + displacement;
}
inline
G4double G4ParticleChange::GetGlobalTime(G4double timeDelay) const
{
// Convert the time delay to the global time.
return theTimeChange + timeDelay;
}
inline
G4double G4ParticleChange::GetGlobalTime() const
{
return theTimeChange;
}
inline
void G4ParticleChange::ProposeGlobalTime(G4double t)
{
theTimeChange = t;
}
inline
G4double G4ParticleChange::GetMass() const
{
return theMassChange;
}
inline
void G4ParticleChange::ProposeMass(G4double t)
{
theMassChange = t;
}
inline
G4double G4ParticleChange::GetCharge() const
{
return theChargeChange;
}
inline
void G4ParticleChange::ProposeCharge(G4double t)
{
theChargeChange = t;
}
inline
G4double G4ParticleChange::GetWeight() const
{
return theWeightChange;
}
inline
void G4ParticleChange::ProposeWeight(G4double w)
{
theWeightChange = w;
theParentWeight = w;
}
inline
G4ThreeVector G4ParticleChange::CalcMomentum(G4double energy,
G4ThreeVector direction,
G4double mass
) const
{
G4double tMomentum = sqrt(energy*energy + 2*energy*mass);
return direction*tMomentum;
}
// Following methods will be removed in release 7.0
inline
G4double G4ParticleChange::GetEnergyChange() const
{
return GetEnergy();
}
inline
void G4ParticleChange::SetEnergyChange(G4double energy)
{
ProposeEnergy(energy);
}
inline
const G4ThreeVector* G4ParticleChange::GetMomentumChange() const
{
return GetMomentumDirection();
}
inline
void G4ParticleChange::SetMomentumChange(
G4double Px,
G4double Py,
G4double Pz )
{
ProposeMomentumDirection(Px, Py, Pz);
}
inline
void G4ParticleChange::SetMomentumChange(const G4ThreeVector& P)
{
ProposeMomentumDirection(P);
}
inline
const G4ThreeVector* G4ParticleChange::GetMomentumDirectionChange() const
{
return GetMomentumDirection();
}
inline
void G4ParticleChange::SetMomentumDirectionChange(
G4double Px,
G4double Py,
G4double Pz )
{
ProposeMomentumDirection(Px, Py, Pz);
}
inline
void G4ParticleChange::SetMomentumDirectionChange(const G4ThreeVector& P)
{
ProposeMomentumDirection(P);
}
inline
const G4ThreeVector* G4ParticleChange::GetPolarizationChange() const
{
return GetPolarization();
}
inline
void G4ParticleChange::SetPolarizationChange( const G4ThreeVector& finalPoralization)
{
ProposePolarization(finalPoralization);
}
inline
void G4ParticleChange::SetPolarizationChange(
G4double Px,
G4double Py,
G4double Pz )
{
ProposePolarization(Px, Py, Pz);
}
inline
const G4ThreeVector* G4ParticleChange::GetPositionChange() const
{
return GetPosition();
}
inline
void G4ParticleChange::SetPositionChange(const G4ThreeVector& finalPosition)
{
ProposePosition(finalPosition);
}
inline
void G4ParticleChange::SetPositionChange(G4double x,G4double y, G4double z)
{
ProposePosition(x, y, z);
}
inline
G4double G4ParticleChange::GetProperTimeChange() const
{
return GetProperTime();
}
inline
void G4ParticleChange::SetProperTimeChange(G4double tau)
{
ProposeProperTime(tau);
}
inline
G4double G4ParticleChange::GetTimeChange() const
{
return GetGlobalTime();
}
inline
void G4ParticleChange::SetTimeChange(G4double t)
{
ProposeGlobalTime(t);
}
inline
G4double G4ParticleChange::GetMassChange() const
{
return GetMass();
}
inline
void G4ParticleChange::SetMassChange(G4double t)
{
ProposeMass(t);
}
inline
G4double G4ParticleChange::GetChargeChange() const
{
return GetCharge();
}
inline
void G4ParticleChange::SetChargeChange(G4double t)
{
ProposeCharge(t);
}
inline
G4double G4ParticleChange::GetWeightChange() const
{
return GetWeight();
}
inline
void G4ParticleChange::SetWeightChange(G4double w)
{
ProposeWeight(w);
}

View File

@ -1,191 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4ParticleChangeForDecay.hh,v 1.6 2004/05/08 15:28:11 kurasige Exp $
// GEANT4 tag $Name: geant4-06-02-ref-01 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
//
// ------------------------------------------------------------
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
//
// Class Description
// This class is a concrete class for ParticleChange which
// has functionality for G4Decay.
//
// This class contains the results after invocation of the decay process.
// This includes secondary particles generated by the interaction.
// ------------------------------------------------------------
#ifndef G4ParticleChangeForDecay_h
#define G4ParticleChangeForDecay_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4ThreeVector.hh"
class G4DynamicParticle;
#include "G4VParticleChange.hh"
class G4ParticleChangeForDecay: public G4VParticleChange
{
public:
// default constructor
G4ParticleChangeForDecay();
// destructor
virtual ~G4ParticleChangeForDecay();
protected:
// hide copy constructor and assignment operaor as protected
G4ParticleChangeForDecay(const G4ParticleChangeForDecay &right);
G4ParticleChangeForDecay & operator=(const G4ParticleChangeForDecay &right);
public:
// equal/unequal operator
G4bool operator==(const G4ParticleChangeForDecay &right) const;
G4bool operator!=(const G4ParticleChangeForDecay &right) const;
public: // with description
// ----------------------------------------------------
// --- the following methods are for updating G4Step -----
// Return the pointer to the G4Step after updating the Step information
// by using final state information of the track given by a physics
// process
// !!! No effect for AlongSteyp
// virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
virtual G4Step* UpdateStepForAtRest(G4Step* Step);
virtual G4Step* UpdateStepForPostStep(G4Step* Step);
virtual void Initialize(const G4Track&);
// Initialize all propoerties by using G4Track information
G4double GetGlobalTime() const;
void ProposeGlobalTime(G4double t);
// Get/Propose the final GlobalTime
G4double GetGlobalTime(G4double timeDelay) const;
// Convert the time delay to the global time.
const G4ThreeVector* GetPolarization() const;
void ProposePolarization(G4double Px, G4double Py, G4double Pz);
void ProposePolarization(const G4ThreeVector& finalPoralization);
// Get/Propose the final Polarization vector.
public:
// Following methods will be removed in release 7.0
// Using ProposeXXXX methods is recommended to setting
// properties in G4ParticleChangeForDecay
G4double GetTimeChange() const;
void SetTimeChange(G4double t);
public:
virtual void DumpInfo() const;
protected:
G4double theTimeChange;
// The change of global time of a given particle.
G4ThreeVector thePolarizationChange;
// The changed (final) polarization of a given track
public:
// for Debug
virtual G4bool CheckIt(const G4Track&);
};
inline
G4double G4ParticleChangeForDecay::GetGlobalTime() const
{
return theTimeChange;
}
inline
void G4ParticleChangeForDecay::ProposeGlobalTime(G4double t)
{
theTimeChange = t;
}
inline
G4double G4ParticleChangeForDecay::GetGlobalTime(G4double timeDelay) const
{
// Convert the time delay to the global time.
return theTimeChange + timeDelay;
}
// Following methods will be removed in release 7.0
inline
G4double G4ParticleChangeForDecay::GetTimeChange() const
{
return theTimeChange;
}
inline
void G4ParticleChangeForDecay::SetTimeChange(G4double t)
{
theTimeChange = t;
}
inline
const G4ThreeVector* G4ParticleChangeForDecay::GetPolarization() const
{
return &thePolarizationChange;
}
inline
void G4ParticleChangeForDecay::ProposePolarization(const G4ThreeVector& finalPoralization)
{
thePolarizationChange = finalPoralization;
}
inline
void G4ParticleChangeForDecay::ProposePolarization(
G4double Px,
G4double Py,
G4double Pz )
{
thePolarizationChange.setX(Px);
thePolarizationChange.setY(Py);
thePolarizationChange.setZ(Pz);
}
#endif

View File

@ -1,223 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4ParticleChangeForLoss.hh,v 1.12 2004/06/15 08:17:38 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02-ref-01 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
//
// ------------------------------------------------------------
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
//
// Modified:
// 16.01.04 V.Ivanchenko update for model variant of energy loss
//
// ------------------------------------------------------------
//
// Class Description
// This class is a concrete class for ParticleChange for EnergyLoss
//
#ifndef G4ParticleChangeForLoss_h
#define G4ParticleChangeForLoss_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4VParticleChange.hh"
class G4DynamicParticle;
class G4ParticleChangeForLoss: public G4VParticleChange
{
public:
// default constructor
G4ParticleChangeForLoss();
// destructor
virtual ~G4ParticleChangeForLoss();
// with description
// ----------------------------------------------------
// --- the following methods are for updating G4Step -----
virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
virtual G4Step* UpdateStepForPostStep(G4Step* Step);
// A physics process gives the final state of the particle
// based on information of G4Track
void InitializeForAlongStep(const G4Track&);
void InitializeForPostStep(const G4Track&);
//Initialize all propoerties by using G4Track information
void AddSecondary(G4DynamicParticle* aParticle);
// Add next secondary
G4double GetProposedCharge() const;
void SetProposedCharge(G4double theCharge);
// Get/Set theCharge
G4double GetCharge() const;
void ProposeCharge(G4double finalCharge);
// Get/Propose the final dynamical Charge in G4DynamicParticle
G4double GetProposedKineticEnergy() const;
void SetProposedKineticEnergy(G4double proposedKinEnergy);
// Get/Set the final kinetic energy of the current particle.
// G4double GetEnergy() const;
// void ProposeEnergy(G4double finalEnergy);
// Get/Propose the final kinetic energy of the current particle.
const G4ThreeVector& GetProposedMomentumDirection() const;
void SetProposedMomentumDirection(const G4ThreeVector& dir);
const G4ThreeVector& GetMomentumDirection() const;
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz);
void ProposeMomentumDirection(const G4ThreeVector& Pfinal);
// Get/Propose the MomentumDirection vector: it is the final momentum direction.
virtual void DumpInfo() const;
// for Debug
virtual G4bool CheckIt(const G4Track&);
protected:
// hide copy constructor and assignment operaor as protected
G4ParticleChangeForLoss(const G4ParticleChangeForLoss &right);
G4ParticleChangeForLoss & operator=(const G4ParticleChangeForLoss &right);
private:
const G4Track* currentTrack;
// The pointer to G4Track
G4double proposedKinEnergy;
// The final kinetic energy of the current particle.
G4double currentCharge;
// The final charge of the current particle.
G4ThreeVector proposedMomentumDirection;
// The final momentum direction of the current particle.
};
inline G4double G4ParticleChangeForLoss::GetProposedKineticEnergy() const
{
return proposedKinEnergy;
}
inline void G4ParticleChangeForLoss::SetProposedKineticEnergy(G4double energy)
{
proposedKinEnergy = energy;
}
inline G4double G4ParticleChangeForLoss::GetProposedCharge() const
{
return currentCharge;
}
inline G4double G4ParticleChangeForLoss::GetCharge() const
{
return currentCharge;
}
inline void G4ParticleChangeForLoss::SetProposedCharge(G4double theCharge)
{
currentCharge = theCharge;
}
inline void G4ParticleChangeForLoss::ProposeCharge(G4double theCharge)
{
currentCharge = theCharge;
}
inline
const G4ThreeVector& G4ParticleChangeForLoss::GetProposedMomentumDirection() const
{
return proposedMomentumDirection;
}
inline
const G4ThreeVector& G4ParticleChangeForLoss::GetMomentumDirection() const
{
return proposedMomentumDirection;
}
inline
void G4ParticleChangeForLoss::ProposeMomentumDirection(const G4ThreeVector& dir)
{
proposedMomentumDirection = dir;
}
inline
void G4ParticleChangeForLoss::SetProposedMomentumDirection(const G4ThreeVector& dir)
{
proposedMomentumDirection = dir;
}
inline
void G4ParticleChangeForLoss::ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
{
proposedMomentumDirection.setX(Px);
proposedMomentumDirection.setY(Py);
proposedMomentumDirection.setZ(Pz);
}
inline void G4ParticleChangeForLoss::InitializeForAlongStep(const G4Track& track)
{
theStatusChange = track.GetTrackStatus();
theLocalEnergyDeposit = 0.0;
InitializeSecondaries(track);
theParentWeight = track.GetWeight();
proposedKinEnergy = track.GetKineticEnergy();
currentCharge = track.GetDynamicParticle()->GetCharge();
}
inline void G4ParticleChangeForLoss::InitializeForPostStep(const G4Track& track)
{
theStatusChange = track.GetTrackStatus();
theLocalEnergyDeposit = 0.0;
InitializeSecondaries(track);
theParentWeight = track.GetWeight();
proposedKinEnergy = track.GetKineticEnergy();
currentCharge = track.GetDynamicParticle()->GetCharge();
proposedMomentumDirection = track.GetMomentumDirection();
currentTrack = &track;
}
inline void G4ParticleChangeForLoss::AddSecondary(G4DynamicParticle* aParticle)
{
// create track
G4Track* aTrack = new G4Track(aParticle, currentTrack->GetGlobalTime(),
currentTrack->GetPosition());
// Touchable handle is copied to keep the pointer
aTrack->SetTouchableHandle(currentTrack->GetTouchableHandle());
// add a secondary
G4VParticleChange::AddSecondary(aTrack);
}
#endif

View File

@ -1,128 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4ParticleChangeForMSC.hh,v 1.7 2004/05/08 15:28:11 kurasige Exp $
// GEANT4 tag $ $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
//
// Class Description
// This class is special "Particle Change" for Multiple Scattering process
//
// ------------------------------------------------------------
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
// Add Get/SetMomentumDirectionChange 6 Feb. 1999 H.Kurashige
// Update for model variant of msc 16 Jan 2004 V.Ivanchenko
//
// -------------------------------------------------------------
#ifndef G4ParticleChangeForMSC_h
#define G4ParticleChangeForMSC_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4ThreeVector.hh"
#include "G4ThreeVector.hh"
class G4DynamicParticle;
#include "G4VParticleChange.hh"
class G4ParticleChangeForMSC: public G4VParticleChange
{
public:
// default constructor
G4ParticleChangeForMSC();
// destructor
virtual ~G4ParticleChangeForMSC();
protected:
// hide copy constructor and assignment operaor as protected
G4ParticleChangeForMSC(const G4ParticleChangeForMSC &right);
G4ParticleChangeForMSC & operator=(const G4ParticleChangeForMSC &right);
public: // with description
// ----------------------------------------------------
// --- the following methods are for updating G4Step -----
// Return the pointer to the G4Step after updating the Step information
// by using final state information of the track given by a physics
// process
virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
virtual G4Step* UpdateStepForPostStep(G4Step* Step);
// A physics process gives the final state of the particle
// based on information of G4Track (or equivalently the PreStepPoint)
virtual void Initialize(const G4Track&);
// Initialize all propoerties by using G4Track information
// ----------------------------------------------------
//--- methods to keep information of the final state--
// IMPORTANT NOTE: Although the name of the class and methods are
// "Change", what it stores (and returns in get) are the "FINAL"
// values of the Position, Momentum, etc.
void ProposeMomentumDirection(const G4ThreeVector& Pfinal);
void ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz);
const G4ThreeVector* GetMomentumDirection() const;
const G4ThreeVector* GetProposedMomentumDirection() const;
void SetProposedMomentumDirection(const G4ThreeVector& Pfinal);
// Get/Set theMomentumDirectionChange vector: it is the final momentum direction.
const G4ThreeVector* GetPosition() const;
void ProposePosition(const G4ThreeVector& finalPosition);
const G4ThreeVector* GetProposedPosition() const;
void SetProposedPosition(const G4ThreeVector& finalPosition);
// Get/Set the final position of the current particle.
public:
// Following methods will be removed in release 7.0
// Using ProposeXXXX methods is recommended to setting
// properties in G4ParticleChangeForMSC
void SetMomentumChange(const G4ThreeVector& Pfinal);
void SetMomentumChange(G4double Px, G4double Py, G4double Pz);
const G4ThreeVector* GetPositionChange() const;
void SetPositionChange(const G4ThreeVector& finalPosition);
public:
virtual void DumpInfo() const;
// for Debug
virtual G4bool CheckIt(const G4Track&);
private:
G4ThreeVector theMomentumDirection;
// It is the vector containing the final momentum direction
// after the invoked process. The application of the change
// of the momentum direction of the particle is not Done here.
// The responsibility to apply the change is up the entity
// which invoked the process.
G4ThreeVector thePosition;
// The changed (final) position of a given particle.
};
#include "G4ParticleChangeForMSC.icc"
#endif

View File

@ -1,118 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4ParticleChangeForMSC.icc,v 1.5 2004/05/08 15:28:12 kurasige Exp $
// GEANT4 tag $Name: geant4-06-02-ref-01 $
//
//
inline
void G4ParticleChangeForMSC::ProposeMomentumDirection(const G4ThreeVector& P)
{
theMomentumDirection = P;
}
inline
void G4ParticleChangeForMSC::SetProposedMomentumDirection(const G4ThreeVector& P)
{
theMomentumDirection = P;
}
inline
void G4ParticleChangeForMSC::ProposeMomentumDirection(G4double Px, G4double Py, G4double Pz)
{
theMomentumDirection.setX(Px);
theMomentumDirection.setY(Py);
theMomentumDirection.setZ(Pz);
}
inline
const G4ThreeVector* G4ParticleChangeForMSC::GetMomentumDirection() const
{
return &theMomentumDirection;
}
inline
const G4ThreeVector* G4ParticleChangeForMSC::GetProposedMomentumDirection() const
{
return &theMomentumDirection;
}
inline
void G4ParticleChangeForMSC::SetProposedPosition(const G4ThreeVector& P)
{
thePosition = P;
}
inline
const G4ThreeVector* G4ParticleChangeForMSC::GetPosition() const
{
return &thePosition;
}
inline
const G4ThreeVector* G4ParticleChangeForMSC::GetProposedPosition() const
{
return &thePosition;
}
inline
void G4ParticleChangeForMSC::ProposePosition(const G4ThreeVector& P)
{
thePosition = P;
}
inline void G4ParticleChangeForMSC::Initialize(const G4Track& track)
{
theStatusChange = track.GetTrackStatus();
theMomentumDirection = track.GetMomentumDirection();
thePosition = track.GetPosition();
}
// Following methods will be removed in release 7.0
inline
void G4ParticleChangeForMSC::SetMomentumChange(const G4ThreeVector& P)
{
ProposeMomentumDirection(P);
}
inline
void G4ParticleChangeForMSC::SetMomentumChange(G4double Px, G4double Py, G4double Pz)
{
ProposeMomentumDirection(Px, Py, Pz);
}
inline
void G4ParticleChangeForMSC::SetPositionChange(const G4ThreeVector& P)
{
ProposePosition(P);
}
inline
const G4ThreeVector* G4ParticleChangeForMSC::GetPositionChange() const
{
return GetPosition();
}

View File

@ -1,104 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4ParticleChangeForRadDecay.hh,v 1.5 2003/06/03 08:56:37 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-02-ref-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
//
// ------------------------------------------------------------
// Implemented for the new scheme 25 Jan. 2000 H.Kurahige
//
// Class Description
// This class is a concrete class for ParticleChange for RadDecay
//
#ifndef G4ParticleChangeForRadDecay_h
#define G4ParticleChangeForRadDecay_h 1
#include "globals.hh"
#include "G4ios.hh"
class G4VTouchable;
#include "G4ParticleChange.hh"
class G4ParticleChangeForRadDecay: public G4ParticleChange
{
public:
// default constructor
G4ParticleChangeForRadDecay(){}
// destructor
virtual ~G4ParticleChangeForRadDecay(){}
protected:
// hide copy constructor and assignment operaor as protected
G4ParticleChangeForRadDecay(const G4ParticleChangeForRadDecay &) : G4ParticleChange() {}
G4ParticleChangeForRadDecay & operator=(const G4ParticleChangeForRadDecay &){return *this;}
public: // with description
void AddSecondary(G4Track* aSecondary);
// Add a secondary particle to theListOfSecondaries.
// ------------------------------------------------------
};
inline void G4ParticleChangeForRadDecay::AddSecondary(G4Track *aTrack)
{
// add a secondary after size check
if (theSizeOftheListOfSecondaries > theNumberOfSecondaries) {
theListOfSecondaries->SetElement(theNumberOfSecondaries, aTrack);
theNumberOfSecondaries++;
} else {
#ifdef G4VERBOSE
if (verboseLevel>0) {
G4cerr << "G4VParticleChange::AddSecondary() Warning ";
G4cerr << "theListOfSecondaries is full !! " << G4endl;
G4cerr << " The object will not be added in theListOfSecondaries" << G4endl;
}
#endif
}
}
#endif

View File

@ -1,148 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4ParticleChangeForTransport.hh,v 1.13 2004/05/08 15:28:13 kurasige Exp $
// GEANT4 tag $Name: geant4-06-02-ref-01 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
//
// ------------------------------------------------------------
// Implemented for the new scheme 10 May. 1998 H.Kurahige
// Added theMaterialChange 16 FEb. 2000 H.Kurahige
// Remove thePolarizationChange 12 Feb. 2001 H.Kurashige
// Modification for G4TouchableHandle 22 Oct. 2001 R.Chytracek
// Add MaterialCutsCouple 8 Oct. 2002 H.Kurashige
//
// Class Description
// This class is a concrete class for ParticleChange for transportation
//
#ifndef G4ParticleChangeForTransport_h
#define G4ParticleChangeForTransport_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4TouchableHandle.hh"
#include "G4ParticleChange.hh"
class G4MaterialCutsCouple;
class G4ParticleChangeForTransport: public G4ParticleChange
{
public:
// default constructor
G4ParticleChangeForTransport();
// destructor
virtual ~G4ParticleChangeForTransport();
protected:
// hide copy constructor and assignment operator as protected
G4ParticleChangeForTransport(const G4ParticleChangeForTransport &right);
G4ParticleChangeForTransport & operator=(const G4ParticleChangeForTransport &right);
public: // with description
// ----------------------------------------------------
// --- the following methods are for updating G4Step -----
// Return the pointer to the G4Step after updating the Step information
// by using final state information of the track given by a physics
// process
virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
virtual G4Step* UpdateStepForAtRest(G4Step* Step);
virtual G4Step* UpdateStepForPostStep(G4Step* Step);
// A physics process gives the final state of the particle
// based on information of G4Track (or equivalently the PreStepPoint)
virtual void Initialize(const G4Track&);
// Initialize all propoerties by using G4Track information
// ----------------------------------------------------
//--- methods to keep information of the final state--
// IMPORTANT NOTE: Although the name of the class and methods are
// "Change", what it stores (and returns in get) are the "FINAL"
// values of the Position, Momentum, etc.
const G4TouchableHandle& GetTouchableHandle() const;
void SetTouchableHandle(const G4TouchableHandle& fTouchable);
// Get/Set the touchable of the current particle.
// Note: Touchable in PostStepPoint will be updated only after PostStepDoIt
G4Material* GetMaterialInTouchable() const;
void SetMaterialInTouchable(G4Material* fMaterial);
// Get/Propose the material in the touchable of the current particle.
const G4MaterialCutsCouple* GetMaterialCutsCoupleInTouchable() const;
void SetMaterialCutsCoupleInTouchable(const G4MaterialCutsCouple* fMaterialCutsCouple);
// Get/Set the materialCutsCouple in the touchable of the current particle.
G4bool GetMomentumChanged() const;
void SetMomentumChanged(G4bool b);
public:
// Following methods will be removed in release 7.0
// Using ProposeXXXX methods is recommended to setting
// properties in G4ParticleChangeForDecay
G4Material* GetMaterialChange() const;
void SetMaterialChange(G4Material* fMaterial);
const G4MaterialCutsCouple* GetMaterialCutsCoupleChange() const;
void SetMaterialCutsCoupleChange(const G4MaterialCutsCouple* fMaterialCutsCouple);
public:
virtual void DumpInfo() const;
protected:
G4TouchableHandle theTouchableHandle;
// The changed touchable of a given particle.
public:
// Prototype implementation of smooth representation of curved trajectories.
// Auxiliary points are ThreeVectors for now; change to G4AuxiliaryPoints.
inline void SetPointerToVectorOfAuxiliaryPoints( std::vector<G4ThreeVector>* theNewVectorPointer );
inline std::vector<G4ThreeVector>* GetPointerToVectorOfAuxiliaryPoints() const;
private:
G4bool isMomentumChanged;
// The flag which is set if mometum is changed in this stepi
G4Material* theMaterialChange;
const G4MaterialCutsCouple* theMaterialCutsCoupleChange;
// The material (and MaterialCutsCouple) where given track
// currently locates
private:
std::vector<G4ThreeVector>* fpVectorOfAuxiliaryPointsPointer;
};
#include "G4ParticleChangeForTransport.icc"
#endif

View File

@ -1,163 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4ParticleChangeForTransport.icc,v 1.10 2004/05/08 15:28:13 kurasige Exp $
// GEANT4 tag $Name: geant4-06-02-ref-01 $
//
//
inline
void G4ParticleChangeForTransport::SetTouchableHandle(const G4TouchableHandle&
fTouchable)
{
theTouchableHandle = fTouchable;
}
inline
const G4TouchableHandle& G4ParticleChangeForTransport::GetTouchableHandle() const
{
return theTouchableHandle;
}
inline
void G4ParticleChangeForTransport::SetMaterialInTouchable(G4Material* fMaterial)
{
theMaterialChange = fMaterial;
}
inline
G4Material* G4ParticleChangeForTransport::GetMaterialInTouchable() const
{
return theMaterialChange;
}
inline
void G4ParticleChangeForTransport::SetMaterialCutsCoupleInTouchable(const G4MaterialCutsCouple* fMaterialCutsCouple)
{
theMaterialCutsCoupleChange = fMaterialCutsCouple;
}
inline
const G4MaterialCutsCouple* G4ParticleChangeForTransport::GetMaterialCutsCoupleInTouchable() const
{
return theMaterialCutsCoupleChange;
}
inline
G4bool G4ParticleChangeForTransport::GetMomentumChanged() const
{
return isMomentumChanged;
}
inline
void G4ParticleChangeForTransport::SetMomentumChanged(G4bool b)
{
isMomentumChanged= b;
}
//----------------------------------------------------------------
// functions for Initialization
//
inline void G4ParticleChangeForTransport::Initialize(const G4Track& track)
{
// use base class's method at first
InitializeStatusChange(track);
// InitializeLocalEnergyDeposit(track);
InitializeSteppingControl(track);
// InitializeTrueStepLength(track);
// InitializeSecondaries(track);
// set Energy/Momentum etc. equal to those of the parent particle
const G4DynamicParticle* pParticle = track.GetDynamicParticle();
// theEnergyChange = pParticle->GetKineticEnergy();
// theMomentumChange = pParticle->GetMomentumDirection();
thePolarizationChange = pParticle->GetPolarization();
// theProperTimeChange = pParticle->GetProperTime();
// set Position/Time etc. equal to those of the parent track
// thePositionChange = track.GetPosition();
// theTimeChange = track.GetGlobalTime();
// set touchable equal to the next touchable of the parent track
// not set as for now
//theTouchableChange = track.GetNextTouchable();
// So almost nothing is initialized here.
// theMomentumChange, theProperTimeChange, thePositionChange and theTimeChange
// are set by G4Transportation::AlongStepDoIt;
// the others are not needed.
// Take care when implementing the PostStep related things!
// (P. Urban)
}
// Prototype implementation of smooth representation of curved trajectories.
inline void
G4ParticleChangeForTransport::
SetPointerToVectorOfAuxiliaryPoints( std::vector<G4ThreeVector>*
theNewVectorPointer )
{
fpVectorOfAuxiliaryPointsPointer = theNewVectorPointer;
}
inline std::vector<G4ThreeVector>*
G4ParticleChangeForTransport::GetPointerToVectorOfAuxiliaryPoints() const
{
return fpVectorOfAuxiliaryPointsPointer;
}
// Following methods will be removed in release 7.0
inline
void G4ParticleChangeForTransport::SetMaterialChange(G4Material* fMaterial)
{
theMaterialChange = fMaterial;
}
inline
G4Material* G4ParticleChangeForTransport::GetMaterialChange() const
{
return theMaterialChange;
}
inline
void G4ParticleChangeForTransport::SetMaterialCutsCoupleChange(const G4MaterialCutsCouple* fMaterialCutsCouple)
{
theMaterialCutsCoupleChange = fMaterialCutsCouple;
}
inline
const G4MaterialCutsCouple* G4ParticleChangeForTransport::GetMaterialCutsCoupleChange() const
{
return theMaterialCutsCoupleChange;
}

View File

@ -1,179 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4Step.hh,v 1.10 2003/06/16 17:12:58 gunter Exp $
// GEANT4 tag $Name: geant4-05-02-ref-00 $
//
//
//---------------------------------------------------------------
//
// G4Step.hh
//
// Class Description:
// This class represents the Step of a particle tracked.
// It includes information of
// 1) List of Step points which compose the Step,
// 2) static information of particle which generated the
// Step,
// 3) trackID and parent particle ID of the Step,
// 4) termination condition of the Step,
//
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
//
// ---------------------------------------------------------------
// Modified for the new G4ParticleChange 12 Mar. 1998 H.Kurahige
// Correct treatment of touchable in G4Step::UpdateTrack
// 12 May. 1998 H.Kurashige
// ---------------------------------------------------------------
// Separate implementation of inline functions inti G4Step.icc
// Add updating mass/charge
// 6 Oct. 1999 H.Kurashige
//
#ifndef G4Step_h
#define G4Step_h 1
#include <stdlib.h> // Include from 'system'
#include "G4ios.hh" // Include from 'system'
#include <iomanip> // Include from 'system'
#include "globals.hh" // Include from 'global'
#include "G4ThreeVector.hh" // Include from 'global'
#include "G4VPhysicalVolume.hh" // Include from 'geometry'
#include "G4StepPoint.hh" // Include from 'track'
#include "G4StepStatus.hh" // Include from 'track'
class G4Polyline; // Forward declaration.
class G4Track; // Forward declaration.
////////////
class G4Step
////////////
{
//--------
public:
// Constructor/Destrcutor
G4Step();
~G4Step();
//--------
public: // WIth description
// Get/Set functions
// currnet track
G4Track* GetTrack() const;
void SetTrack(G4Track* value);
// step points
G4StepPoint* GetPreStepPoint() const;
void SetPreStepPoint(G4StepPoint* value);
G4StepPoint* GetPostStepPoint() const;
void SetPostStepPoint(G4StepPoint* value);
// step length
G4double GetStepLength() const;
void SetStepLength(G4double value);
// total energy deposit
G4double GetTotalEnergyDeposit() const;
void SetTotalEnergyDeposit(G4double value);
// cotrole flag for stepping
G4SteppingControl GetControlFlag() const;
void SetControlFlag(G4SteppingControl StepControlFlag);
// difference of position, time, momentum and energy
G4ThreeVector GetDeltaPosition() const;
G4double GetDeltaTime() const;
G4ThreeVector GetDeltaMomentum() const;
G4double GetDeltaEnergy() const;
// manipulation of total energy deposit
void AddTotalEnergyDeposit(G4double value);
void ResetTotalEnergyDeposit();
// Other member functions
void InitializeStep( G4Track* aValue );
// initiaize contents of G4Step
void UpdateTrack( );
// update track by using G4Step information
void CopyPostToPreStepPoint( );
// copy PostStepPoint to PreStepPoint
G4Polyline* CreatePolyline () const;
// for visualization
//-----------
protected:
//-----------
// Member data
G4double fTotalEnergyDeposit;
// Accummulated total energy desposit in the current Step
//---------
private:
//---------
// Member data
G4StepPoint* fpPreStepPoint;
G4StepPoint* fpPostStepPoint;
G4double fStepLength;
// Step length which may be updated at each invocation of
// AlongStepDoIt and PostStepDoIt
G4Track* fpTrack;
//
G4SteppingControl fpSteppingControlFlag;
// A flag to control SteppingManager behavier from process
// Prototyping implementation of smooth representation of curved
// trajectories. (jacek 30/10/2002)
public:
// Auxiliary points are ThreeVectors for now; change to
// G4VAuxiliaryPoints or some such (jacek 30/10/2002)
void SetPointerToVectorOfAuxiliaryPoints( std::vector<G4ThreeVector>* theNewVectorPointer ) {
fpVectorOfAuxiliaryPointsPointer = theNewVectorPointer;
}
std::vector<G4ThreeVector>* GetPointerToVectorOfAuxiliaryPoints() const {
return fpVectorOfAuxiliaryPointsPointer;
}
private:
// Explicity including the word "Pointer" in the name as I keep
// forgetting the * (jacek 30/10/2002)
std::vector<G4ThreeVector>* fpVectorOfAuxiliaryPointsPointer;
};
#include "G4Step.icc"
#endif

View File

@ -1,238 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4Step.icc,v 1.10 2003/03/05 04:42:53 kurasige Exp $
// GEANT4 tag $Name: geant4-05-00-ref-03 $
//
//
//---------------------------------------------------------------
//
//-----------------------------------------------------------------
// In-line definitions
//-----------------------------------------------------------------
// Get/Set functions
inline
G4StepPoint* G4Step::GetPreStepPoint() const
{
return fpPreStepPoint;
}
inline
void G4Step::SetPreStepPoint(G4StepPoint* value)
{
fpPreStepPoint = value;
}
inline
G4StepPoint* G4Step::GetPostStepPoint() const
{
return fpPostStepPoint;
}
inline
void G4Step::SetPostStepPoint(G4StepPoint* value)
{
fpPostStepPoint = value;
}
inline
G4double G4Step::GetStepLength() const
{
return fStepLength;
}
inline
void G4Step::SetStepLength(G4double value)
{
fStepLength = value;
}
inline
G4ThreeVector G4Step::GetDeltaPosition() const
{
return fpPostStepPoint->GetPosition()
- fpPreStepPoint->GetPosition();
}
inline
G4double G4Step::GetDeltaTime() const
{
return fpPostStepPoint->GetLocalTime()
- fpPreStepPoint->GetLocalTime();
}
inline
G4ThreeVector G4Step::GetDeltaMomentum() const
{
return fpPostStepPoint->GetMomentum()
- fpPreStepPoint->GetMomentum();
}
inline
G4double G4Step::GetDeltaEnergy() const
{
return fpPostStepPoint->GetKineticEnergy()
- fpPreStepPoint->GetKineticEnergy();
}
inline
G4double G4Step::GetTotalEnergyDeposit() const
{
return fTotalEnergyDeposit;
}
inline
void G4Step::SetTotalEnergyDeposit(G4double value)
{
fTotalEnergyDeposit = value;
}
inline
void G4Step::AddTotalEnergyDeposit(G4double value)
{
fTotalEnergyDeposit += value;
}
inline
void G4Step::ResetTotalEnergyDeposit()
{
fTotalEnergyDeposit = 0.;
}
inline
void G4Step::SetControlFlag(G4SteppingControl value)
{
fpSteppingControlFlag = value;
}
inline
G4SteppingControl G4Step::GetControlFlag() const
{
return fpSteppingControlFlag;
}
inline
void G4Step::CopyPostToPreStepPoint( )
{
*(fpPreStepPoint) = *(fpPostStepPoint);
fpPostStepPoint->SetStepStatus(fUndefined);
}
//-------------------------------------------------------------
// To implement bi-directional association between G4Step and
// and G4Track, a combined usage of 'forward declaration' and
// 'include' is necessary.
//-------------------------------------------------------------
#include "G4Track.hh"
inline
G4Track* G4Step::GetTrack() const
{
return fpTrack;
}
inline
void G4Step::SetTrack(G4Track* value)
{
fpTrack = value;
}
// Other member functions
inline
void G4Step::InitializeStep( G4Track* aValue )
{
// Initialize G4Step attributes
fStepLength = 0.;
fTotalEnergyDeposit = 0.;
fpTrack = aValue;
fpTrack->SetStepLength(0.);
// Initialize G4StepPoint attributes.
// To avoid the circular dependency between G4Track, G4Step
// and G4StepPoint, G4Step has to manage the copy actions.
fpPreStepPoint->SetPosition(fpTrack->GetPosition());
fpPreStepPoint->SetGlobalTime(fpTrack->GetGlobalTime());
fpPreStepPoint->SetLocalTime(fpTrack->GetLocalTime());
fpPreStepPoint->SetProperTime(fpTrack->GetProperTime());
fpPreStepPoint->SetMomentumDirection(fpTrack->GetMomentumDirection());
fpPreStepPoint->SetKineticEnergy(fpTrack->GetKineticEnergy());
fpPreStepPoint->SetVelocity(fpTrack->GetVelocity());
fpPreStepPoint->SetTouchableHandle(fpTrack->GetTouchableHandle());
fpPreStepPoint->SetMaterial( fpTrack->GetTouchable()->GetVolume()->GetLogicalVolume()->GetMaterial());
fpPreStepPoint->SetMaterialCutsCouple( fpTrack->GetTouchable()->GetVolume()->GetLogicalVolume()->GetMaterialCutsCouple());
fpPreStepPoint->SetPolarization(fpTrack->GetPolarization());
fpPreStepPoint->SetSafety(0.);
fpPreStepPoint->SetStepStatus(fUndefined);
fpPreStepPoint->SetProcessDefinedStep(0);
fpPreStepPoint->SetMass(fpTrack->GetDynamicParticle()->GetMass());
fpPreStepPoint->SetCharge(fpTrack->GetDynamicParticle()->GetCharge());
fpPreStepPoint->SetWeight(fpTrack->GetWeight());
(*fpPostStepPoint) = (*fpPreStepPoint);
}
inline
void G4Step::UpdateTrack( )
{
// To avoid the circular dependency between G4Track, G4Step
// and G4StepPoint, G4Step has to manage the update actions.
// position, time
fpTrack->SetPosition(fpPostStepPoint->GetPosition());
fpTrack->SetGlobalTime(fpPostStepPoint->GetGlobalTime());
fpTrack->SetLocalTime(fpPostStepPoint->GetLocalTime());
fpTrack->SetProperTime(fpPostStepPoint->GetProperTime());
// energy, momentum, polarization
fpTrack->SetMomentumDirection(fpPostStepPoint->GetMomentumDirection());
fpTrack->SetKineticEnergy(fpPostStepPoint->GetKineticEnergy());
fpTrack->SetPolarization(fpPostStepPoint->GetPolarization());
// mass charge
G4DynamicParticle* pParticle = (G4DynamicParticle*)(fpTrack->GetDynamicParticle());
pParticle->SetMass(fpPostStepPoint->GetMass());
pParticle->SetCharge(fpPostStepPoint->GetCharge());
// step length
fpTrack->SetStepLength(fStepLength);
// NextTouchable is updated
// (G4Track::Touchable points touchable of Pre-StepPoint)
fpTrack->SetNextTouchableHandle(fpPostStepPoint->GetTouchableHandle());
fpTrack->SetWeight(fpPostStepPoint->GetWeight());
// set velocity
fpPostStepPoint->SetVelocity(fpTrack->GetVelocity());
}

View File

@ -1,208 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4StepPoint.hh,v 1.13 2003/09/19 19:08:14 kurasige Exp $
// GEANT4 tag $Name: geant4-05-02-ref-05 $
//
//
//---------------------------------------------------------------
//
// G4StepPoint.hh
//
// Class Description:
// This class represents information associated with the
// each end of a Step like the space/time data of the
// particle.
//
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
//
// ---------------------------------------------------------------
// Added fpMaterial 16 FEb. 2000 H.Kurahige
// Added fpMaterialCutsCouple 8 Oct. 2002 H.Kurahige
#ifndef G4StepPoint_h
#define G4StepPoint_h 1
#include "globals.hh" // Include from 'global'
#include "G4Allocator.hh" // Include from 'global'
#include "G4ThreeVector.hh" // Include from 'geometry'
#include "G4VPhysicalVolume.hh" // Include from 'geometry'
class G4VProcess;
#include "G4SteppingControl.hh"
#include "G4StepStatus.hh" // Include from 'track'
#include "G4TouchableHandle.hh" // Include from 'geometry'
#include "G4Material.hh"
#include "G4LogicalVolume.hh"
class G4MaterialCutsCouple;
/////////////////
class G4StepPoint
/////////////////
{
//--------
public:
// Constructor/Destructor
G4StepPoint();
~G4StepPoint(){};
//--------
public: // with description
// Get/Set functions
const G4ThreeVector& GetPosition() const;
void SetPosition(const G4ThreeVector& aValue);
void AddPosition(const G4ThreeVector& aValue);
G4double GetLocalTime() const;
void SetLocalTime(const G4double aValue);
void AddLocalTime(const G4double aValue);
// Time since the track is created.
G4double GetGlobalTime() const;
void SetGlobalTime(const G4double aValue);
void AddGlobalTime(const G4double aValue);
// Time since the event in which the track belongs is created.
G4double GetProperTime() const;
void SetProperTime(const G4double aValue);
void AddProperTime(const G4double aValue);
// Proper time of the particle.
const G4ThreeVector& GetMomentumDirection() const;
void SetMomentumDirection(const G4ThreeVector& aValue);
void AddMomentumDirection(const G4ThreeVector& aValue);
// Direction of momentum (should be an unit vector)
G4ThreeVector GetMomentum() const;
// Total momentum of the track
G4double GetTotalEnergy() const;
// Total energy of the track
G4double GetKineticEnergy() const;
void SetKineticEnergy(const G4double aValue);
void AddKineticEnergy(const G4double aValue);
// Kinetic Energy of the track
G4double GetVelocity() const;
void SetVelocity(G4double v);
//
G4double GetBeta() const;
// Velocity of the track in unit of c(light velocity)
G4double GetGamma() const;
// Gamma factor (1/sqrt[1-beta*beta]) of the track
G4VPhysicalVolume* GetPhysicalVolume() const;
const G4VTouchable* GetTouchable() const;
const G4TouchableHandle& GetTouchableHandle() const;
void SetTouchableHandle(const G4TouchableHandle& apValue);
G4Material* GetMaterial() const;
void SetMaterial(G4Material*);
const G4MaterialCutsCouple* GetMaterialCutsCouple() const;
void SetMaterialCutsCouple(const G4MaterialCutsCouple*);
G4double GetSafety() const;
void SetSafety(const G4double aValue);
const G4ThreeVector& GetPolarization() const;
void SetPolarization(const G4ThreeVector& aValue);
void AddPolarization(const G4ThreeVector& aValue);
G4StepStatus GetStepStatus() const;
void SetStepStatus(const G4StepStatus aValue);
const G4VProcess* GetProcessDefinedStep() const;
// If the pointer is 0, this means the Step is defined
// by the user defined limit in the current volume.
void SetProcessDefinedStep(G4VProcess* aValue);
G4double GetMass() const;
void SetMass(G4double value);
G4double GetCharge() const;
void SetCharge(G4double value);
void SetWeight(G4double aValue);
G4double GetWeight() const;
public:
// copy constructor and assignment operaor as protected
G4StepPoint(const G4StepPoint &right);
G4StepPoint & operator=(const G4StepPoint &right);
//---------
private:
//---------
// Member data
G4ThreeVector fPosition;
G4double fGlobalTime;
// Time since event is created
G4double fLocalTime;
// Time since track is created
G4double fProperTime;
// Time since track is created (in rest frame of particle)
G4ThreeVector fMomentumDirection;
G4double fKineticEnergy;
G4double fVelocity;
// Momentum,energy and velocity
G4TouchableHandle fpTouchable;
// Touchable Handle
G4Material* fpMaterial;
// Material of the volmue
const G4MaterialCutsCouple* fpMaterialCutsCouple;
// MaterialCutsCouple of the volmue
G4double fSafety;
G4ThreeVector fPolarization;
G4StepStatus fStepStatus;
// DoIt type which defined the current Step.
G4VProcess* fpProcessDefinedStep;
// Process which defined the current Step.
G4double fMass;
// Dynamical mass of the particle
G4double fCharge;
// Dynamical Charge of the particle
G4double fWeight;
// Track Weight
};
#include "G4StepPoint.icc"
#endif

View File

@ -1,174 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4StepPoint.icc,v 1.8 2003/05/07 20:08:37 asaim Exp $
// GEANT4 tag $Name: geant4-05-01-ref-02 $
//
//
inline const G4ThreeVector& G4StepPoint::GetPosition() const
{ return fPosition; }
inline void G4StepPoint::SetPosition(const G4ThreeVector& aValue)
{ fPosition = aValue; }
inline void G4StepPoint::AddPosition(const G4ThreeVector& aValue)
{ fPosition += aValue; }
// Position where the track locates
inline G4double G4StepPoint::GetLocalTime() const
{ return fLocalTime; }
inline void G4StepPoint::SetLocalTime(const G4double aValue)
{ fLocalTime = aValue; }
inline void G4StepPoint::AddLocalTime(const G4double aValue)
{ fLocalTime += aValue; }
// Time since the track is created.
inline G4double G4StepPoint::GetGlobalTime() const
{ return fGlobalTime; }
inline void G4StepPoint::SetGlobalTime(const G4double aValue)
{ fGlobalTime = aValue; }
inline void G4StepPoint::AddGlobalTime(const G4double aValue)
{ fGlobalTime += aValue; }
// Time since the event in which the track belongs is created.
inline G4double G4StepPoint::GetProperTime() const
{ return fProperTime; }
inline void G4StepPoint::SetProperTime(const G4double aValue)
{ fProperTime = aValue; }
inline void G4StepPoint::AddProperTime(const G4double aValue)
{ fProperTime += aValue; }
// Proper time of the particle.
inline const G4ThreeVector& G4StepPoint::GetMomentumDirection() const
{ return fMomentumDirection; }
inline void G4StepPoint::SetMomentumDirection(const G4ThreeVector& aValue)
{ fMomentumDirection = aValue;
}
inline void G4StepPoint::AddMomentumDirection(const G4ThreeVector& aValue)
{ fMomentumDirection += aValue;
}
// Direction of momentum (should be an unit vector)
inline G4ThreeVector G4StepPoint::GetMomentum() const
{
G4double tMomentum = sqrt(fKineticEnergy*fKineticEnergy +
2*fKineticEnergy*fMass);
return G4ThreeVector(fMomentumDirection.x()*tMomentum,
fMomentumDirection.y()*tMomentum,
fMomentumDirection.z()*tMomentum);
}
// Total momentum of the track
inline G4double G4StepPoint::GetTotalEnergy() const
{
return fKineticEnergy + fMass;
}
// Total energy of the track
inline G4double G4StepPoint::GetKineticEnergy() const
{ return fKineticEnergy; }
inline void G4StepPoint::SetKineticEnergy(const G4double aValue)
{ fKineticEnergy = aValue; }
inline void G4StepPoint::AddKineticEnergy(const G4double aValue)
{ fKineticEnergy += aValue; }
// Kinetic Energy of the track
inline G4double G4StepPoint::GetVelocity() const
{
return fVelocity;
}
inline void G4StepPoint::SetVelocity(G4double v)
{
fVelocity = v;
}
inline G4double G4StepPoint::GetBeta() const
{
return fVelocity/c_light;
}
// Velocity of the track in unit of c(light velocity)
inline G4double G4StepPoint::GetGamma() const
{ return (fMass==0.) ? DBL_MAX : (fKineticEnergy+fMass)/fMass; }
// Gamma factor (1/sqrt[1-beta*beta]) of the track
inline G4VPhysicalVolume* G4StepPoint::GetPhysicalVolume() const
{ return fpTouchable->GetVolume(); }
inline const G4VTouchable* G4StepPoint::GetTouchable() const
{ return fpTouchable(); }
inline const G4TouchableHandle& G4StepPoint::GetTouchableHandle() const
{ return fpTouchable; }
inline void G4StepPoint::SetTouchableHandle(const G4TouchableHandle& apValue)
{ fpTouchable = apValue; }
inline G4double G4StepPoint::GetSafety() const
{ return fSafety; }
inline void G4StepPoint::SetSafety(const G4double aValue)
{ fSafety = aValue; }
inline const G4ThreeVector& G4StepPoint::GetPolarization() const
{ return fPolarization; }
inline void G4StepPoint::SetPolarization(const G4ThreeVector& aValue)
{ fPolarization = aValue; }
inline void G4StepPoint::AddPolarization(const G4ThreeVector& aValue)
{ fPolarization += aValue; }
inline G4StepStatus G4StepPoint::GetStepStatus() const
{ return fStepStatus; }
inline void G4StepPoint::SetStepStatus(const G4StepStatus aValue)
{ fStepStatus = aValue; }
inline const G4VProcess* G4StepPoint::GetProcessDefinedStep() const
{ return fpProcessDefinedStep; }
// If the pointer is 0, this means the Step is defined
// by the user defined limit in the current volume.
inline void G4StepPoint::SetProcessDefinedStep(G4VProcess* aValue)
{ fpProcessDefinedStep = aValue; }
inline G4double G4StepPoint::GetMass() const
{ return fMass; }
inline void G4StepPoint::SetMass(G4double value)
{ fMass = value; }
inline G4double G4StepPoint::GetCharge() const
{ return fCharge; }
inline void G4StepPoint::SetCharge(G4double value)
{ fCharge = value; }
inline G4Material* G4StepPoint::GetMaterial() const
{ return fpMaterial; }
inline void G4StepPoint::SetMaterial(G4Material* material)
{fpMaterial = material; }
inline
const G4MaterialCutsCouple* G4StepPoint::GetMaterialCutsCouple() const
{ return fpMaterialCutsCouple; }
inline
void G4StepPoint::SetMaterialCutsCouple(const G4MaterialCutsCouple* materialCutsCouple)
{fpMaterialCutsCouple = materialCutsCouple; }
inline void G4StepPoint::SetWeight(G4double aValue)
{ fWeight = aValue; }
inline G4double G4StepPoint::GetWeight() const
{ return fWeight; }

View File

@ -1,70 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4StepStatus.hh,v 1.3 2001/07/11 10:08:37 gunter Exp $
// GEANT4 tag $Name: geant4-04-00-ref-03 $
//
//
//---------------------------------------------------------------
//
// G4StepStatus.hh
//
// Class Description:
// This is an enumerator to define possible sources which
// can define the Step length.
//
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
//
//---------------------------------------------------------------
#ifndef G4StepStatus_h
#define G4StepStatus_h 1
//////////////////
enum G4StepStatus
//////////////////
{
fWorldBoundary,
// Step reached the world boundary
fGeomBoundary,
// Step defined by a geometry boundary
fAtRestDoItProc,
// Step defined by a PreStepDoItVector
fAlongStepDoItProc,
// Step defined by a AlongStepDoItVector
fPostStepDoItProc,
// Step defined by a PostStepDoItVector
fUserDefinedLimit,
// Step defined by the user Step limit in the logical volume
fExclusivelyForcedProc,
// Step defined by an exclusively forced PostStepDoIt process
fUndefined
// Step not defined yet
};
#endif

View File

@ -1,58 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4SteppingControl.hh,v 1.3 2001/07/11 10:08:37 gunter Exp $
// GEANT4 tag $Name: geant4-04-00-ref-03 $
//
//
//---------------------------------------------------------------
//
// G4SteppingControl
//
// Class Description:
// This enumaration specifies possible conditions to control
// the stepping manager behavier.
//
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
//
//---------------------------------------------------------------
#ifndef G4SteppingControl_h
#define G4SteppingControl_h 1
/////////////////////
enum G4SteppingControl
/////////////////////
{
NormalCondition,
AvoidHitInvocation,
// Hit will NOT be called
Debug
};
#endif

View File

@ -1,294 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4Track.hh,v 1.16 2002/12/16 11:59:12 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00-ref-03 $
//
//
//---------------------------------------------------------------
//
// G4Track.hh
//
// Class Description:
// This class represents the partilce under tracking.
// It includes information related to tracking for examples:
// 1) current position/time of the particle,
// 2) static particle information,
// 3) the pointer to the physical volume where currently
// the particle exists
//
//---------------------------------------------------------------
// Modification for G4TouchableHandle 22 Oct. 2001 R.Chytracek
// Add MaterialCutCouple 08 Oct. 2002 H.Kurashige
#ifndef G4Track_h
#define G4Track_h 1
#include "globals.hh" // Include from 'global'
#include "G4ThreeVector.hh" // Include from 'geometry'
#include "G4LogicalVolume.hh" // Include from 'geometry'
#include "G4VPhysicalVolume.hh" // Include from 'geometry'
#include "G4Allocator.hh" // Include from 'particle+matter'
#include "G4DynamicParticle.hh" // Include from 'particle+matter'
#include "G4TrackStatus.hh" // Include from 'tracking'
#include "G4TouchableHandle.hh" // Include from 'geometry'
#include "G4VUserTrackInformation.hh"
#include "G4Material.hh"
class G4Step; // Forward declaration
class G4MaterialCutsCouple;
//////////////
class G4Track
//////////////
{
//--------
public: // With description
// Constructor
G4Track();
G4Track(G4DynamicParticle* apValueDynamicParticle,
G4double aValueTime,
const G4ThreeVector& aValuePosition);
// aValueTime is a global time
G4Track(const G4Track&);
// Copy Constructor copys members other than tracking information
private:
// Hide assignment operator as private
G4Track& operator=(const G4Track&);
//--------
public: // With description
// Destrcutor
~G4Track();
// Operators
inline void *operator new(size_t);
// Override "new" for "G4Allocator".
inline void operator delete(void *aTrack);
// Override "delete" for "G4Allocator".
G4bool operator==( const G4Track& );
//--------
public: // With description
// Copy information of the track (w/o tracking information)
void CopyTrackInfo(const G4Track&);
// Get/Set functions
// track ID
G4int GetTrackID() const;
void SetTrackID(const G4int aValue);
G4int GetParentID() const;
void SetParentID(const G4int aValue);
// dynamic particle
const G4DynamicParticle* GetDynamicParticle() const;
// particle definition
G4ParticleDefinition* GetDefinition() const;
// position, time
const G4ThreeVector& GetPosition() const;
void SetPosition(const G4ThreeVector& aValue);
G4double GetGlobalTime() const;
void SetGlobalTime(const G4double aValue);
// Time since the event in which the track belongs is created.
G4double GetLocalTime() const;
void SetLocalTime(const G4double aValue);
// Time since the current track is created.
G4double GetProperTime() const;
void SetProperTime(const G4double aValue);
// Proper time of the current track
// volume, material, touchable
G4VPhysicalVolume* GetVolume() const;
G4VPhysicalVolume* GetNextVolume() const;
G4Material* GetMaterial() const;
G4Material* GetNextMaterial() const;
const G4MaterialCutsCouple* GetMaterialCutsCouple() const;
const G4MaterialCutsCouple* GetNextMaterialCutsCouple() const;
const G4VTouchable* GetTouchable() const;
const G4TouchableHandle& GetTouchableHandle() const;
void SetTouchableHandle( const G4TouchableHandle& apValue);
const G4VTouchable* GetNextTouchable() const;
const G4TouchableHandle& GetNextTouchableHandle() const;
void SetNextTouchableHandle( const G4TouchableHandle& apValue);
// energy
G4double GetKineticEnergy() const;
void SetKineticEnergy(const G4double aValue);
G4double GetTotalEnergy() const;
// moemtnum
const G4ThreeVector& GetMomentumDirection() const;
void SetMomentumDirection(const G4ThreeVector& aValue);
G4ThreeVector GetMomentum() const;
G4double GetVelocity() const;
// polarization
const G4ThreeVector& GetPolarization() const;
void SetPolarization(const G4ThreeVector& aValue);
// track status, flags for tracking
G4TrackStatus GetTrackStatus() const;
void SetTrackStatus(const G4TrackStatus aTrackStatus);
G4bool IsBelowThreshold() const;
void SetBelowThresholdFlag(G4bool value = true);
// The flag of "BelowThreshold" is set to true
// if this track energy is below threshold energy
// in this material determined by the range cut value
G4bool IsGoodForTracking() const;
void SetGoodForTrackingFlag(G4bool value = true);
// The flag of "GoodForTracking" is set by processes
// if this track should be tracked
// even if the energy is below threshold
// track length
G4double GetTrackLength() const;
void AddTrackLength(const G4double aValue);
// Accumulated the track length
// step information
const G4Step* GetStep() const;
void SetStep(const G4Step* aValue);
G4int GetCurrentStepNumber() const;
void IncrementCurrentStepNumber();
G4double GetStepLength() const;
void SetStepLength(G4double value);
// Before the end of the AlongStepDoIt loop,StepLength keeps
// the initial value which is determined by the shortest geometrical Step
// proposed by a physics process. After finishing the AlongStepDoIt,
// it will be set equal to 'StepLength' in G4Step.
// vertex (,where this track was created) information
const G4ThreeVector& GetVertexPosition() const;
void SetVertexPosition(const G4ThreeVector& aValue);
const G4ThreeVector& GetVertexMomentumDirection() const;
void SetVertexMomentumDirection(const G4ThreeVector& aValue);
G4double GetVertexKineticEnergy() const;
void SetVertexKineticEnergy(const G4double aValue);
G4LogicalVolume* GetLogicalVolumeAtVertex() const;
void SetLogicalVolumeAtVertex(G4LogicalVolume* );
const G4VProcess* GetCreatorProcess() const;
void SetCreatorProcess(G4VProcess* aValue);
// track weight
// These are methods for manipulating a weight for this track.
G4double GetWeight() const;
void SetWeight(G4double aValue);
// User information
G4VUserTrackInformation* GetUserInformation() const;
void SetUserInformation(G4VUserTrackInformation* aValue);
//---------
private:
//---------
// Member data
G4int fCurrentStepNumber; // Total steps number up to now
G4ThreeVector fPosition; // Current positon
G4double fGlobalTime; // Time since the event is created
G4double fLocalTime; // Time since the track is created
G4double fTrackLength; // Accumulated track length
G4int fParentID;
G4int fTrackID;
G4TouchableHandle fpTouchable;
G4TouchableHandle fpNextTouchable;
// Touchable Handle
G4DynamicParticle* fpDynamicParticle;
G4TrackStatus fTrackStatus;
G4bool fBelowThreshold;
// This flag is set to true if this track energy is below
// threshold energy in this material determined by the range cut value
G4bool fGoodForTracking;
// This flag is set by processes if this track should be tracked
// even if the energy is below threshold
G4double fStepLength;
// Before the end of the AlongStepDoIt loop, this keeps the initial
// Step length which is determined by the shortest geometrical Step
// proposed by a physics process. After finishing the AlongStepDoIt,
// this will be set equal to 'StepLength' in G4Step.
G4double fWeight;
// This is a weight for this track
const G4Step* fpStep;
G4ThreeVector fVtxPosition; // (x,y,z) of the vertex
G4ThreeVector fVtxMomentumDirection; // Momentum direction at the vertex
G4double fVtxKineticEnergy; // Kinetic energy at the vertex
G4LogicalVolume* fpLVAtVertex; //Logical Volume at the vertex
G4VProcess* fpCreatorProcess; // Process which created the track
G4VUserTrackInformation* fpUserInformation;
};
#include "G4Step.hh"
#include "G4Track.icc"
#endif

View File

@ -1,298 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4Track.icc,v 1.10 2002/12/16 11:59:12 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-02-patch-01 $
//
//-----------------------------------------------------------------
// Definitions of inline functions
//-----------------------------------------------------------------
// change GetMaterial 16 Feb. 2000 H.Kurashige
// Operators
extern G4Allocator<G4Track> aTrackAllocator;
inline void* G4Track::operator new(size_t)
{ void *aTrack;
aTrack = (void *) aTrackAllocator.MallocSingle();
return aTrack;
}
// Override "new" for "G4Allocator".
inline void G4Track::operator delete(void *aTrack)
{ aTrackAllocator.FreeSingle((G4Track *) aTrack);}
// Override "delete" for "G4Allocator".
inline G4bool G4Track::operator==( const G4Track& s)
{ return (this==&s); }
// Define "==" operator because "G4TrackVector" uses
// "RWPtrOrderdVector" which requires this.
// Get/Set functions
// dynamic particle
inline const G4DynamicParticle* G4Track::GetDynamicParticle() const
{ return fpDynamicParticle; }
// particle definition
inline G4ParticleDefinition* G4Track::GetDefinition() const
{ return fpDynamicParticle->GetDefinition(); }
// parent track ID
inline G4int G4Track::GetParentID() const
{ return fParentID; }
inline void G4Track::SetParentID(const G4int aValue)
{ fParentID = aValue; }
// current track ID
inline G4int G4Track::GetTrackID() const
{ return fTrackID; }
inline void G4Track::SetTrackID(const G4int aValue)
{ fTrackID = aValue; }
// position
inline const G4ThreeVector& G4Track::GetPosition() const
{ return fPosition; }
inline void G4Track::SetPosition(const G4ThreeVector& aValue)
{ fPosition = aValue; }
// global time
inline G4double G4Track::GetGlobalTime() const
{ return fGlobalTime; }
inline void G4Track::SetGlobalTime(const G4double aValue)
{ fGlobalTime = aValue; }
// Time since the event in which the track belongs is created.
// local time
inline G4double G4Track::GetLocalTime() const
{ return fLocalTime; }
inline void G4Track::SetLocalTime(const G4double aValue)
{ fLocalTime = aValue; }
// Time since the current track is created.
// proper time
inline G4double G4Track::GetProperTime() const
{ return fpDynamicParticle->GetProperTime(); }
inline void G4Track::SetProperTime(const G4double aValue)
{ fpDynamicParticle->SetProperTime(aValue); }
// Proper time of the current track
// volume
inline G4VPhysicalVolume* G4Track::GetVolume() const
{ return fpTouchable->GetVolume(); }
inline G4VPhysicalVolume* G4Track::GetNextVolume() const
{ return fpNextTouchable->GetVolume(); }
// material
inline
const G4MaterialCutsCouple* G4Track::GetMaterialCutsCouple() const
{ return fpStep->GetPreStepPoint()->GetMaterialCutsCouple(); }
inline
const G4MaterialCutsCouple* G4Track::GetNextMaterialCutsCouple() const
{ return fpStep->GetPostStepPoint()->GetMaterialCutsCouple(); }
// material
inline G4Material* G4Track::GetMaterial() const
{ return fpStep->GetPreStepPoint()->GetMaterial(); }
inline G4Material* G4Track::GetNextMaterial() const
{ return fpStep->GetPostStepPoint()->GetMaterial(); }
// touchable
inline const G4VTouchable* G4Track::GetTouchable() const
{
return fpTouchable();
}
inline const G4TouchableHandle& G4Track::GetTouchableHandle() const
{
return fpTouchable;
}
inline void G4Track::SetTouchableHandle( const G4TouchableHandle& apValue)
{
fpTouchable = apValue;
}
inline const G4VTouchable* G4Track::GetNextTouchable() const
{
return fpNextTouchable();
}
inline const G4TouchableHandle& G4Track::GetNextTouchableHandle() const
{
return fpNextTouchable;
}
inline void G4Track::SetNextTouchableHandle( const G4TouchableHandle& apValue)
{
fpNextTouchable = apValue;
}
// kinetic energy
inline G4double G4Track::GetKineticEnergy() const
{ return fpDynamicParticle->GetKineticEnergy(); }
inline void G4Track::SetKineticEnergy(const G4double aValue)
{ fpDynamicParticle->SetKineticEnergy(aValue); }
// total energy
inline G4double G4Track::GetTotalEnergy() const
{ return fpDynamicParticle->GetTotalEnergy(); }
// momentum
inline G4ThreeVector G4Track::GetMomentum() const
{ return fpDynamicParticle->GetMomentum(); }
// momentum (direction)
inline const G4ThreeVector& G4Track::GetMomentumDirection() const
{ return fpDynamicParticle->GetMomentumDirection(); }
inline void G4Track::SetMomentumDirection(const G4ThreeVector& aValue)
{ fpDynamicParticle->SetMomentumDirection(aValue) ;}
// polarization
inline const G4ThreeVector& G4Track::GetPolarization() const
{ return fpDynamicParticle->GetPolarization(); }
inline void G4Track::SetPolarization(const G4ThreeVector& aValue)
{ fpDynamicParticle->SetPolarization(aValue.x(),
aValue.y(),
aValue.z()); }
// track status
inline G4TrackStatus G4Track::GetTrackStatus() const
{ return fTrackStatus; }
inline void G4Track::SetTrackStatus(const G4TrackStatus aTrackStatus)
{ fTrackStatus = aTrackStatus; }
// track length
inline G4double G4Track::GetTrackLength() const
{ return fTrackLength; }
inline void G4Track::AddTrackLength(const G4double aValue)
{ fTrackLength += aValue; }
// Accumulated track length
// step number
inline G4int G4Track::GetCurrentStepNumber() const
{ return fCurrentStepNumber; }
inline void G4Track::IncrementCurrentStepNumber()
{ fCurrentStepNumber++; }
// step length
inline G4double G4Track::GetStepLength() const
{ return fStepLength; }
inline void G4Track::SetStepLength(G4double value)
{ fStepLength = value; }
// vertex (where this track was created) information
inline const G4ThreeVector& G4Track::GetVertexPosition() const
{ return fVtxPosition; }
inline void G4Track::SetVertexPosition(const G4ThreeVector& aValue)
{ fVtxPosition = aValue; }
inline const G4ThreeVector& G4Track::GetVertexMomentumDirection() const
{ return fVtxMomentumDirection; }
inline void G4Track::SetVertexMomentumDirection(const G4ThreeVector& aValue)
{ fVtxMomentumDirection = aValue ;}
inline G4double G4Track::GetVertexKineticEnergy() const
{ return fVtxKineticEnergy; }
inline void G4Track::SetVertexKineticEnergy(const G4double aValue)
{ fVtxKineticEnergy = aValue; }
inline G4LogicalVolume* G4Track::GetLogicalVolumeAtVertex() const
{ return fpLVAtVertex; }
inline void G4Track::SetLogicalVolumeAtVertex(G4LogicalVolume* aValue)
{ fpLVAtVertex = aValue; }
inline const G4VProcess* G4Track::GetCreatorProcess() const
{ return fpCreatorProcess; }
// If the pointer is 0, this means the track is created
// by the event generator, i.e. the primary track.If it is not
// 0, it points to the process which created this track.
inline void G4Track::SetCreatorProcess(G4VProcess* aValue)
{ fpCreatorProcess = aValue; }
// flag for "Below Threshold"
inline G4bool G4Track::IsBelowThreshold() const
{ return fBelowThreshold; }
inline void G4Track::SetBelowThresholdFlag(G4bool value)
{ fBelowThreshold = value; }
// flag for " Good for Tracking"
inline G4bool G4Track::IsGoodForTracking() const
{ return fGoodForTracking; }
inline void G4Track::SetGoodForTrackingFlag(G4bool value)
{ fGoodForTracking = value; }
// track weight
inline void G4Track::SetWeight(G4double aValue)
{ fWeight = aValue; }
inline G4double G4Track::GetWeight() const
{ return fWeight; }
// user information
inline G4VUserTrackInformation* G4Track::GetUserInformation() const
{ return fpUserInformation; }
inline void G4Track::SetUserInformation(G4VUserTrackInformation* aValue)
{ fpUserInformation = aValue; }
//-------------------------------------------------------------
// To implement bi-directional association between G4Step and
// and G4Track, a combined usage of 'forward declaration' and
// 'include' is necessary.
//-------------------------------------------------------------
#include "G4Step.hh"
inline const G4Step* G4Track::GetStep() const
{ return fpStep; }
inline void G4Track::SetStep(const G4Step* aValue)
{ fpStep = (aValue); }

View File

@ -1,47 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4TrackFastVector.hh,v 1.4 2001/07/11 10:08:37 gunter Exp $
// GEANT4 tag $Name: geant4-04-00-ref-03 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
// History: first implementation, based on object model of
// 8 Mar 1997, H.Kurashige
// ------------------------------------------------------------
#ifndef G4TrackFastVector_h
#define G4TrackFastVector_h 1
class G4Track;
#include "G4FastVector.hh"
const G4int G4TrackFastVectorSize = 512;
typedef G4FastVector<G4Track,G4TrackFastVectorSize> G4TrackFastVector;
// Contains pointers to G4Track objects which are
// generated by either primary or secondary interaction.
#endif

View File

@ -1,68 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4TrackStatus.hh,v 1.3 2001/07/11 10:08:37 gunter Exp $
// GEANT4 tag $Name: geant4-04-00-ref-03 $
//
//
//---------------------------------------------------------------
//
// G4TrackStatus.hh
//
// Class Description:
// This is an enumerator to define the current status
// of the track which is under the transportation.
//
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
//
//---------------------------------------------------------------
#ifndef G4TrackStatus_h
#define G4TrackStatus_h 1
//////////////////
enum G4TrackStatus
//////////////////
{
fAlive, // Continue the tracking
fStopButAlive, // Invoke active rest physics processes and
// and kill the current track afterward
fStopAndKill, // Kill the current track
fKillTrackAndSecondaries,
// Kill the current track and also associated
// secondaries.
fSuspend, // Suspend the current track
fPostponeToNextEvent
// Postpones the tracking of thecurrent track
// to the next event.
};
#endif

View File

@ -1,283 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4VParticleChange.hh,v 1.11 2004/05/08 15:28:13 kurasige Exp $
// GEANT4 tag $Name: geant4-06-02-ref-01 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
//
// ------------------------------------------------------------
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
//
// Class Description
// This class is the abstract class for ParticleChange.
//-
// The ParticleChange class ontains the results after invocation
// of a physics process. This includes final states of parent
// particle (momentum, energy, etc) and secondary particles generated
// by the interaction.
// The tracking assumes that all the values of energy and
// momentum are in global reference system, therefore all the
// needed Lorentz transformations must have been already Done
// when filling the data-members of this class.
//-
//-
// This abstract class has following four virtual methods
// virtual G4Step* UpdateStepForAtRest(G4Step* Step);
// virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
// virtual G4Step* UpdateStepForPostStep(G4Step* Step);
// virtual void Initialize(const G4Track&);
// The UpdateStep methods return the pointer to the G4Step
// after updating the given Step information by using final state
// information of the track given by a physics process.
// User must add methods to keep the final state information
// in his derived class as well as implement UpdateStep methods
// which he want to use.
//-
// The Initialize methods is provided to refresh the final
// state information and should be called by each process
// at the beginning of DoIt.
//
// ------------------------------------------------------------
// Implement Event Biasing Scheme 9 Nov.,98 H.Kurashige
// add CheckIt 13 Apr.,99 H.Kurashige
// add accuracy leveles 5 May, 99 H.Kurashige
// add check secondaries 11 June, 03 H.Kurashige
// add new methods of ProposeXXX 08 May, 04 H.Kurashige
#ifndef G4VParticleChange_h
#define G4VParticleChange_h 1
#include "globals.hh"
#include "G4ios.hh"
class G4Track;
class G4Step;
#include "G4TrackFastVector.hh"
#include "G4TrackStatus.hh"
#include "G4SteppingControl.hh"
class G4VParticleChange
{
public:
// default constructor
G4VParticleChange();
// destructor
virtual ~G4VParticleChange();
// equal/unequal operator
G4bool operator==(const G4VParticleChange &right) const;
G4bool operator!=(const G4VParticleChange &right) const;
// "equal" means that teo objects have the same pointer.
protected:
// hide copy constructor and assignment operaor as protected
G4VParticleChange(const G4VParticleChange &right);
G4VParticleChange & operator=(const G4VParticleChange &right);
public: // with description
// --- the following methods are for updating G4Step -----
virtual G4Step* UpdateStepForAtRest(G4Step* Step);
virtual G4Step* UpdateStepForAlongStep(G4Step* Step);
virtual G4Step* UpdateStepForPostStep(G4Step* Step);
// Return the pointer to the G4Step after updating the Step information
// by using final state information of the track given by a physics
// process
protected: // with description
G4Step* UpdateStepInfo(G4Step* Step);
// Update the G4Step specific attributes
// (i.e. SteppingControl, LocalEnergyDeposit, and TrueStepLength)
public: // with description
virtual void Initialize(const G4Track&);
// This methods will be called by each process at the beginning of DoIt
// if necessary.
protected:
void InitializeTrueStepLength(const G4Track&);
void InitializeLocalEnergyDeposit(const G4Track&);
void InitializeSteppingControl(const G4Track&);
void InitializeParentWeight(const G4Track&);
void InitializeStatusChange(const G4Track&);
void InitializeSecondaries(const G4Track&);
// ------------------------------------------------------
public: // with description
//---- the following methods are for TruePathLength ----
G4double GetTrueStepLength() const;
void ProposeTrueStepLength(G4double truePathLength);
// Get/Propose theTrueStepLength
//---- the following methods are for LocalEnergyDeposit ----
G4double GetLocalEnergyDeposit() const;
void ProposeLocalEnergyDeposit(G4double anEnergyPart);
// Get/Propose the locally deposited energy
//---- the following methods are for TrackStatus -----
G4TrackStatus GetTrackStatus() const;
void ProposeTrackStatus(G4TrackStatus status);
// Get/Propose the final TrackStatus of the current particle.
// ------------------------------------------------------
//---- the following methods are for managements of SteppingControl --
G4SteppingControl GetSteppingControl() const;
void ProposeSteppingControl(G4SteppingControl StepControlFlag);
// Set/Propose a flag to control stepping manager behavier
// ------------------------------------------------------
//---- the following methods are for managements of secondaries --
void Clear();
// Clear the contents of this objects
// This method should be called after the Tracking(Stepping)
// manager removes all secondaries in theListOfSecondaries
void SetNumberOfSecondaries(G4int totSecondaries);
// SetNumberOfSecondaries must be called just before AddSecondary()
// in order to secure memory space for theListOfSecondaries
// This method resets theNumberOfSecondaries to 0
// (that will be incremented at every AddSecondary() call).
G4int GetNumberOfSecondaries() const;
// Returns the number of secondaries current stored in
// G4TrackFastVector.
G4Track* GetSecondary(G4int anIndex) const;
// Returns the pointer to the generated secondary particle
// which is specified by an Index.
void AddSecondary(G4Track* aSecondary);
// Add a secondary particle to theListOfSecondaries.
// ------------------------------------------------------
G4double GetParentWeight() const ;
// Get weight of the parent (i.e. current) track
void ProposeParentWeight(G4double);
// Propse new weight of the parent (i.e. current) track
void SetParentWeightByProcess(G4bool);
G4bool IsParentWeightSetByProcess() const;
// If fParentWeightByProcess flag is false (true in default),
// G4VParticleChange can change the weight of the parent track,
// in any DoIt by using SetParentWeight(G4double)
void SetSecondaryWeightByProcess(G4bool);
G4bool IsSecondaryWeightSetByProcess() const;
// If fSecondaryWeightByProcess flag is false (false in default),
// G4VParticleChange set the weight of the secondary tracks
// equal to the parent weight when the secondary tracks are added.
virtual void DumpInfo() const;
// Print out information
void SetVerboseLevel(G4int vLevel);
G4int GetVerboseLevel() const;
public:
// Following methods will be removed in release 7.0
// Using ProposeXXXX methods is recommended to setting
// properties in G4VParticleChange
void SetTrueStepLength(G4double truePathLength);
void SetLocalEnergyDeposit(G4double anEnergyPart);
G4TrackStatus GetStatusChange() const;
void SetStatusChange(G4TrackStatus status);
void SetSteppingControl(G4SteppingControl StepControlFlag);
void SetParentWeight(G4double);
protected:
G4TrackFastVector* theListOfSecondaries;
// The vector of secondaries.
G4int theNumberOfSecondaries;
// The total number of secondaries produced by each process.
G4int theSizeOftheListOfSecondaries;
// TheSizeOftheListOfSecondaries;
G4TrackStatus theStatusChange;
// The changed (final) track status of a given particle.
G4SteppingControl theSteppingControlFlag;
// a flag to control stepping manager behavior
G4double theLocalEnergyDeposit;
// It represents the part of the energy lost for discrete
// or semi-continuous processes which is due to secondaries
// not generated because they would have been below their cut
// threshold.
// The sum of the locally deposited energy + the delta-energy
// coming from the continuous processes gives the
// total energy loss localized in the current Step.
G4double theTrueStepLength;
// The value of "True" Step Length
G4int verboseLevel;
// The Verbose level
public: // with description
// CheckIt method is provided for debug
virtual G4bool CheckIt(const G4Track&);
// CheckIt method is activated
// if debug flag is set and 'G4VERBOSE' is defined
void ClearDebugFlag();
void SetDebugFlag();
G4bool GetDebugFlag() const;
protected:
// CheckSecondary method is provided for debug
G4bool CheckSecondary(G4Track&);
G4double GetAccuracyForWarning() const;
G4double GetAccuracyForException() const;
protected:
G4bool debugFlag;
// accuracy levels
static const G4double accuracyForWarning;
static const G4double accuracyForException;
protected:
G4double theParentWeight;
G4bool fSetSecondaryWeightByProcess;
G4bool fSetParentWeightByProcess;
};
#include "G4Step.hh"
#include "G4Track.hh"
#include "G4VParticleChange.icc"
#endif

View File

@ -1,345 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4VParticleChange.icc,v 1.11 2004/05/08 15:28:13 kurasige Exp $
// GEANT4 tag $Name: geant4-06-02-ref-01 $
//
//----------------------------------------------------------------
// Virtual methods for updating G4Step
//
inline G4Step* G4VParticleChange::UpdateStepInfo(G4Step* pStep)
{
// Update the G4Step specific attributes
pStep->SetStepLength( theTrueStepLength );
pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
pStep->SetControlFlag( theSteppingControlFlag );
return pStep;
}
inline
G4Step* G4VParticleChange::UpdateStepForAtRest(G4Step* Step)
{
if (!fSetParentWeightByProcess){
Step->GetPostStepPoint()->SetWeight( theParentWeight );
}
return UpdateStepInfo(Step);
}
inline
G4Step* G4VParticleChange::UpdateStepForAlongStep(G4Step* Step)
{
if (!fSetParentWeightByProcess){
G4double newWeight= theParentWeight/(Step->GetPreStepPoint()->GetWeight())*(Step->GetPostStepPoint()->GetWeight());
Step->GetPostStepPoint()->SetWeight( newWeight );
}
return UpdateStepInfo(Step);
}
inline
G4Step* G4VParticleChange::UpdateStepForPostStep(G4Step* Step)
{
if (!fSetParentWeightByProcess){
Step->GetPostStepPoint()->SetWeight( theParentWeight );
}
return UpdateStepInfo(Step);
}
//----------------------------------------------------------------
// Set/Get inline functions
//
inline
G4Track* G4VParticleChange::GetSecondary(G4int anIndex) const
{
return (*theListOfSecondaries)[anIndex];
}
inline
G4int G4VParticleChange::GetNumberOfSecondaries() const
{
return theNumberOfSecondaries;
}
inline
void G4VParticleChange::ProposeTrackStatus(G4TrackStatus aStatus)
{
theStatusChange = aStatus;
}
inline
G4TrackStatus G4VParticleChange::GetTrackStatus() const
{
return theStatusChange;
}
inline
G4SteppingControl G4VParticleChange::GetSteppingControl() const
{
return theSteppingControlFlag;
}
inline
void G4VParticleChange::ProposeSteppingControl(G4SteppingControl StepControlFlag)
{
theSteppingControlFlag = StepControlFlag;
}
//----------------------------------------------------------------
// Set/Get inline functions
//
inline
G4double G4VParticleChange::GetLocalEnergyDeposit() const
{
return theLocalEnergyDeposit;
}
inline
void G4VParticleChange::ProposeLocalEnergyDeposit(G4double anEnergyPart)
{
theLocalEnergyDeposit = anEnergyPart;
}
inline
G4double G4VParticleChange::GetTrueStepLength() const
{
return theTrueStepLength;
}
inline
void G4VParticleChange::ProposeTrueStepLength(G4double aLength)
{
theTrueStepLength = aLength;
}
inline
void G4VParticleChange::SetVerboseLevel(G4int vLevel)
{
verboseLevel = vLevel;
}
inline
G4int G4VParticleChange::GetVerboseLevel() const
{
return verboseLevel;
}
inline
G4double G4VParticleChange::GetParentWeight() const
{
return theParentWeight;
}
//----------------------------------------------------------------
// inline functions for Initialization
//
inline
void G4VParticleChange::InitializeLocalEnergyDeposit(const G4Track&)
{
// clear theLocalEnergyDeposited
theLocalEnergyDeposit = 0.0;
}
inline
void G4VParticleChange::InitializeSteppingControl(const G4Track& )
{
// SteppingControlFlag
theSteppingControlFlag = NormalCondition;
}
inline
void G4VParticleChange::Clear()
{
theNumberOfSecondaries = 0;
}
//----------------------------------------------------------------
// functions for Initialization
//
inline void G4VParticleChange::InitializeStatusChange(const G4Track& track)
{
// set TrackStatus equal to the parent track's one
theStatusChange = track.GetTrackStatus();
}
inline void G4VParticleChange::InitializeParentWeight(const G4Track& track)
{
// set the parent track's weight
theParentWeight = track.GetWeight();
}
inline void G4VParticleChange::InitializeTrueStepLength(const G4Track& track)
{
// Reset theTrueStepLength
// !! Caution !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
theTrueStepLength = track.GetStep()->GetStepLength();
// !! TrueStepLength should be copied from G4Step not G4Track
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}
inline void G4VParticleChange::InitializeSecondaries(const G4Track&)
{
// clear secondaries
if (theNumberOfSecondaries>0) {
#ifdef G4VERBOSE
if (verboseLevel>0) {
G4cerr << "G4VParticleChange::Initialize() Warning ";
G4cerr << "theListOfSecondaries is not empty " << G4endl;
G4cerr << "All objects in theListOfSecondaries are destroyed!" << G4endl;
}
#endif
for (G4int index= 0; index<theNumberOfSecondaries; index++){
if ( (*theListOfSecondaries)[index] ){
delete (*theListOfSecondaries)[index] ;
}
}
}
theNumberOfSecondaries = 0;
}
//----------------------------------------------------------------
// methods for handling secondaries
//
inline void G4VParticleChange::SetNumberOfSecondaries(G4int totSecondaries)
{
// check if tracks still exist in theListOfSecondaries
if (theNumberOfSecondaries>0) {
#ifdef G4VERBOSE
if (verboseLevel>0) {
G4cerr << "G4VParticleChange::SetNumberOfSecondaries() Warning ";
G4cerr << "theListOfSecondaries is not empty ";
}
#endif
for (G4int index= 0; index<theNumberOfSecondaries; index++){
if ( (*theListOfSecondaries)[index] ){
delete (*theListOfSecondaries)[index] ;
}
}
}
theNumberOfSecondaries = 0;
theSizeOftheListOfSecondaries = totSecondaries;
// Initialize ListOfSecondaries
theListOfSecondaries->Initialize(totSecondaries);
}
inline void G4VParticleChange::Initialize(const G4Track& track)
{
InitializeStatusChange(track);
InitializeLocalEnergyDeposit(track);
InitializeSteppingControl(track);
InitializeTrueStepLength(track);
InitializeSecondaries(track);
InitializeParentWeight(track);
}
inline
void G4VParticleChange::ClearDebugFlag()
{
debugFlag = false;
}
inline
void G4VParticleChange::SetDebugFlag()
{
debugFlag = true;
}
inline
G4bool G4VParticleChange::GetDebugFlag() const
{
return debugFlag;
}
inline
void G4VParticleChange::SetSecondaryWeightByProcess(G4bool flag)
{
fSetSecondaryWeightByProcess = flag;
}
inline
G4bool G4VParticleChange::IsSecondaryWeightSetByProcess() const
{
return fSetSecondaryWeightByProcess;
}
inline
void G4VParticleChange::ProposeParentWeight(G4double w)
{
theParentWeight = w;
}
inline
void G4VParticleChange::SetParentWeightByProcess(G4bool flag)
{
fSetParentWeightByProcess = flag;
}
inline
G4bool G4VParticleChange::IsParentWeightSetByProcess() const
{
return fSetParentWeightByProcess;
}
// Following methods will be removed in release 7.0
inline
void G4VParticleChange::SetStatusChange(G4TrackStatus aStatus)
{
ProposeTrackStatus(aStatus);
}
inline
G4TrackStatus G4VParticleChange::GetStatusChange() const
{
return GetTrackStatus();
}
inline
void G4VParticleChange::SetSteppingControl(G4SteppingControl StepControlFlag)
{
ProposeSteppingControl(StepControlFlag);
}
inline
void G4VParticleChange::SetLocalEnergyDeposit(G4double anEnergyPart)
{
ProposeLocalEnergyDeposit(anEnergyPart);
}
inline
void G4VParticleChange::SetTrueStepLength(G4double aLength)
{
ProposeTrueStepLength(aLength);
}
inline
void G4VParticleChange::SetParentWeight(G4double w)
{
ProposeParentWeight(w);
}

View File

@ -1,67 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4VUserTrackInformation.hh,v 1.4 2003/05/09 20:42:27 asaim Exp $
// GEANT4 tag $Name: geant4-05-01-ref-02 $
//
//
//---------------------------------------------------------------
//
// G4VUserTrackInformation
//
// Class Description:
//
// Abstract class which the user can derive his/her own concrete
// class for toring user's information associating with a G4Track
// class object.
//
// It is user's responsibility
// 1) Construct a concrete class object and set the pointer to
// proper G4Track object
// 2) Concrete class derived from this class is expected to use G4Allocator
// for memory management or something equivarent for performance reason
//
// To set a pointer of a concrete class object to G4Track in
// G4UserTrackingAction concrete implementation, given the G4Track
// object is available only by "pointer to const", SetUserTrackInformation()
// method of G4TrackingManager is available.
//
// The concrete class object is deleted by Geant4 kernel when
// associated G4Track object is deleted.
#ifndef G4VUserTrackInformation_H
#define G4VUserTrackInformation_H 1
class G4VUserTrackInformation
{
public:
G4VUserTrackInformation() {;}
virtual ~G4VUserTrackInformation() {;}
public:
virtual void Print() const = 0;
};
#endif

View File

@ -1,10 +0,0 @@
/G4ParticleChangeForDecay.cc/1.9/Sat Nov 1 03:24:48 2003//Tgeant4-06-02-ref-01
/G4ParticleChangeForMSC.cc/1.11/Sat Jan 31 02:43:51 2004//Tgeant4-06-02-ref-01
/G4ParticleChangeForTransport.cc/1.16/Sat Jan 31 02:43:51 2004//Tgeant4-06-02-ref-01
/G4Step.cc/1.5/Wed Jul 11 10:08:39 2001//Tgeant4-06-02-ref-01
/G4StepPoint.cc/1.9/Wed Apr 9 00:20:49 2003//Tgeant4-06-02-ref-01
/G4VParticleChange.cc/1.16/Sat Jan 31 02:43:51 2004//Tgeant4-06-02-ref-01
/G4ParticleChange.cc/1.26/Thu Jul 29 19:08:22 2004//Tgeant4-06-02-ref-01
/G4ParticleChangeForLoss.cc/1.13/Thu Jul 29 19:08:22 2004//Tgeant4-06-02-ref-01
/G4Track.cc/1.21/Thu Jul 29 19:08:22 2004//Tgeant4-06-02-ref-01
D

View File

@ -1 +0,0 @@
geant4/source/track/src

View File

@ -1 +0,0 @@
:pserver:gum@g4cvs.cern.ch:/afs/cern.ch/sw/geant4/cvs

View File

@ -1 +0,0 @@
Ngeant4-06-02-ref-01

View File

@ -1,517 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4ParticleChange.cc,v 1.26 2004/05/08 15:28:13 kurasige Exp $
// GEANT4 tag $Name: geant4-06-02-ref-01 $
//
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
//
//
// ------------------------------------------------------------
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
// Change default debug flag to false 10 May. 1998 H.Kurahige
// Add Track weight 12 Nov. 1998 H.Kurashige
// Activate CheckIt method for VERBOSE mode 14 Dec. 1998 H.Kurashige
// Modified CheckIt method for time 9 Feb. 1999 H.Kurashige
// --------------------------------------------------------------
#include "G4ParticleChange.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4TrackFastVector.hh"
#include "G4DynamicParticle.hh"
#include "G4ExceptionSeverity.hh"
G4ParticleChange::G4ParticleChange():G4VParticleChange()
{
}
G4ParticleChange::~G4ParticleChange()
{
#ifdef G4VERBOSE
if (verboseLevel>2) {
G4cout << "G4ParticleChange::~G4ParticleChange() " << G4endl;
}
#endif
}
// copy constructor
G4ParticleChange::G4ParticleChange(const G4ParticleChange &right): G4VParticleChange(right)
{
if (verboseLevel>1) {
G4cout << "G4ParticleChange:: copy constructor is called " << G4endl;
}
theMomentumDirectionChange = right.theMomentumDirectionChange;
thePolarizationChange = right.thePolarizationChange;
thePositionChange = right.thePositionChange;
theTimeChange = right.theTimeChange;
theEnergyChange = right.theEnergyChange;
theMassChange = right.theMassChange;
theChargeChange = right.theChargeChange;
theWeightChange = right.theWeightChange;
theProperTimeChange = right.theProperTimeChange;
}
// assignemnt operator
G4ParticleChange & G4ParticleChange::operator=(const G4ParticleChange &right)
{
if (verboseLevel>1) {
G4cout << "G4ParticleChange:: assignment operator is called " << G4endl;
}
if (this != &right)
{
theListOfSecondaries = right.theListOfSecondaries;
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
theNumberOfSecondaries = right.theNumberOfSecondaries;
theStatusChange = right.theStatusChange;
theMomentumDirectionChange = right.theMomentumDirectionChange;
thePolarizationChange = right.thePolarizationChange;
thePositionChange = right.thePositionChange;
theTimeChange = right.theTimeChange;
theEnergyChange = right.theEnergyChange;
theMassChange = right.theMassChange;
theChargeChange = right.theChargeChange;
theWeightChange = right.theWeightChange;
theTrueStepLength = right.theTrueStepLength;
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
theSteppingControlFlag = right.theSteppingControlFlag;
}
return *this;
}
G4bool G4ParticleChange::operator==(const G4ParticleChange &right) const
{
return ((G4VParticleChange *)this == (G4VParticleChange *) &right);
}
G4bool G4ParticleChange::operator!=(const G4ParticleChange &right) const
{
return ((G4VParticleChange *)this != (G4VParticleChange *) &right);
}
//----------------------------------------------------------------
// methods for handling secondaries
//
void G4ParticleChange::AddSecondary(G4DynamicParticle* aParticle,
G4bool IsGoodForTracking )
{
// create track
G4Track* aTrack = new G4Track(aParticle, theTimeChange, thePositionChange);
// set IsGoodGorTrackingFlag
if (IsGoodForTracking) aTrack->SetGoodForTrackingFlag();
// Touchable handle is copied to keep the pointer
aTrack->SetTouchableHandle(theCurrentTrack->GetTouchableHandle());
// add a secondary
G4VParticleChange::AddSecondary(aTrack);
}
void G4ParticleChange::AddSecondary(G4DynamicParticle* aParticle,
G4ThreeVector newPosition,
G4bool IsGoodForTracking )
{
// create track
G4Track* aTrack = new G4Track(aParticle, theTimeChange, newPosition);
// set IsGoodGorTrackingFlag
if (IsGoodForTracking) aTrack->SetGoodForTrackingFlag();
// Touchable is a temporary object, so you cannot keep the pointer
aTrack->SetTouchableHandle((G4VTouchable*)0);
// add a secondary
G4VParticleChange::AddSecondary(aTrack);
}
void G4ParticleChange::AddSecondary(G4DynamicParticle* aParticle,
G4double newTime,
G4bool IsGoodForTracking )
{
// create track
G4Track* aTrack = new G4Track(aParticle, newTime, thePositionChange);
// set IsGoodGorTrackingFlag
if (IsGoodForTracking) aTrack->SetGoodForTrackingFlag();
// Touchable handle is copied to keep the pointer
aTrack->SetTouchableHandle(theCurrentTrack->GetTouchableHandle());
// add a secondary
G4VParticleChange::AddSecondary(aTrack);
}
void G4ParticleChange::AddSecondary(G4Track* aTrack)
{
// add a secondary
G4VParticleChange::AddSecondary(aTrack);
}
//----------------------------------------------------------------
// functions for Initialization
//
void G4ParticleChange::Initialize(const G4Track& track)
{
// use base class's method at first
G4VParticleChange::Initialize(track);
theCurrentTrack= &track;
// set Energy/Momentum etc. equal to those of the parent particle
const G4DynamicParticle* pParticle = track.GetDynamicParticle();
theEnergyChange = pParticle->GetKineticEnergy();
theMomentumDirectionChange = pParticle->GetMomentumDirection();
thePolarizationChange = pParticle->GetPolarization();
theProperTimeChange = pParticle->GetProperTime();
// Set mass/charge of DynamicParticle
theMassChange = pParticle->GetMass();
theChargeChange = pParticle->GetCharge();
// set Position/Time etc. equal to those of the parent track
thePositionChange = track.GetPosition();
theTimeChange = track.GetGlobalTime();
theWeightChange = track.GetWeight();
}
//----------------------------------------------------------------
// methods for updating G4Step
//
G4Step* G4ParticleChange::UpdateStepForAlongStep(G4Step* pStep)
{
// A physics process always calculates the final state of the
// particle relative to the initial state at the beginning
// of the Step, i.e., based on information of G4Track (or
// equivalently the PreStepPoint).
// So, the differences (delta) between these two states have to be
// calculated and be accumulated in PostStepPoint.
// Take note that the return type of GetMomentumDirectionChange is a
// pointer to G4ParticleMometum. Also it is a normalized
// momentum vector.
G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
G4double mass = theMassChange;
// Set Mass/Charge
pPostStepPoint->SetMass(theMassChange);
pPostStepPoint->SetCharge(theChargeChange);
// calculate new kinetic energy
G4double energy = pPostStepPoint->GetKineticEnergy()
+ (theEnergyChange - pPreStepPoint->GetKineticEnergy());
// update kinetic energy and momentum direction
if (energy > 0.0) {
// calculate new momentum
G4ThreeVector pMomentum = pPostStepPoint->GetMomentum()
+ ( CalcMomentum(theEnergyChange, theMomentumDirectionChange, mass)
- pPreStepPoint->GetMomentum());
G4double tMomentum = pMomentum.mag();
G4ThreeVector direction(1.0,0.0,0.0);
if( tMomentum > 0. ){
G4double inv_Momentum= 1.0 / tMomentum;
direction= pMomentum * inv_Momentum;
}
pPostStepPoint->SetMomentumDirection(direction);
pPostStepPoint->SetKineticEnergy( energy );
} else {
// stop case
//pPostStepPoint->SetMomentumDirection(G4ThreeVector(1., 0., 0.));
pPostStepPoint->SetKineticEnergy(0.0);
}
// update polarization
pPostStepPoint->AddPolarization( thePolarizationChange
- pPreStepPoint->GetPolarization());
// update position and time
pPostStepPoint->AddPosition( thePositionChange
- pPreStepPoint->GetPosition() );
pPostStepPoint->AddGlobalTime( theTimeChange
- pPreStepPoint->GetGlobalTime());
pPostStepPoint->AddLocalTime( theTimeChange
- pPreStepPoint->GetGlobalTime());
pPostStepPoint->AddProperTime( theProperTimeChange
- pPreStepPoint->GetProperTime());
// update weight
G4double newWeight= theWeightChange/(pPreStepPoint->GetWeight())*(pPostStepPoint->GetWeight());
pPostStepPoint->SetWeight( newWeight );
#ifdef G4VERBOSE
G4Track* aTrack = pStep->GetTrack();
if (debugFlag) CheckIt(*aTrack);
#endif
// Update the G4Step specific attributes
return UpdateStepInfo(pStep);
}
G4Step* G4ParticleChange::UpdateStepForPostStep(G4Step* pStep)
{
// A physics process always calculates the final state of the particle
// Take note that the return type of GetMomentumChange is a
// pointer to G4ParticleMometum. Also it is a normalized
// momentum vector.
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
G4Track* aTrack = pStep->GetTrack();
// Set Mass/Charge
pPostStepPoint->SetMass(theMassChange);
pPostStepPoint->SetCharge(theChargeChange);
// update kinetic energy and momentum direction
pPostStepPoint->SetMomentumDirection(theMomentumDirectionChange);
pPostStepPoint->SetKineticEnergy( theEnergyChange );
// update polarization
pPostStepPoint->SetPolarization( thePolarizationChange );
// update position and time
pPostStepPoint->SetPosition( thePositionChange );
pPostStepPoint->SetGlobalTime( theTimeChange );
pPostStepPoint->AddLocalTime( theTimeChange
- aTrack->GetGlobalTime());
pPostStepPoint->SetProperTime( theProperTimeChange );
// update weight
pPostStepPoint->SetWeight( theWeightChange );
#ifdef G4VERBOSE
if (debugFlag) CheckIt(*aTrack);
#endif
// Update the G4Step specific attributes
return UpdateStepInfo(pStep);
}
G4Step* G4ParticleChange::UpdateStepForAtRest(G4Step* pStep)
{
// A physics process always calculates the final state of the particle
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
G4Track* aTrack = pStep->GetTrack();
// Set Mass/Charge
pPostStepPoint->SetMass(theMassChange);
pPostStepPoint->SetCharge(theChargeChange);
// update kinetic energy and momentum direction
pPostStepPoint->SetMomentumDirection(theMomentumDirectionChange);
pPostStepPoint->SetKineticEnergy( theEnergyChange );
// update polarization
pPostStepPoint->SetPolarization( thePolarizationChange );
// update position and time
pPostStepPoint->SetPosition( thePositionChange );
pPostStepPoint->SetGlobalTime( theTimeChange );
pPostStepPoint->AddLocalTime( theTimeChange
- aTrack->GetGlobalTime());
pPostStepPoint->SetProperTime( theProperTimeChange );
// update weight
pPostStepPoint->SetWeight( theWeightChange );
#ifdef G4VERBOSE
if (debugFlag) CheckIt(*aTrack);
#endif
// Update the G4Step specific attributes
return UpdateStepInfo(pStep);
}
//----------------------------------------------------------------
// methods for printing messages
//
void G4ParticleChange::DumpInfo() const
{
// use base-class DumpInfo
G4VParticleChange::DumpInfo();
G4cout.precision(3);
G4cout << " Mass (GeV) : "
<< std::setw(20) << theMassChange/GeV
<< G4endl;
G4cout << " Charge (eplus) : "
<< std::setw(20) << theChargeChange/eplus
<< G4endl;
G4cout << " Position - x (mm) : "
<< std::setw(20) << thePositionChange.x()/mm
<< G4endl;
G4cout << " Position - y (mm) : "
<< std::setw(20) << thePositionChange.y()/mm
<< G4endl;
G4cout << " Position - z (mm) : "
<< std::setw(20) << thePositionChange.z()/mm
<< G4endl;
G4cout << " Time (ns) : "
<< std::setw(20) << theTimeChange/ns
<< G4endl;
G4cout << " Proper Time (ns) : "
<< std::setw(20) << theProperTimeChange/ns
<< G4endl;
G4cout << " Momentum Direct - x : "
<< std::setw(20) << theMomentumDirectionChange.x()
<< G4endl;
G4cout << " Momentum Direct - y : "
<< std::setw(20) << theMomentumDirectionChange.y()
<< G4endl;
G4cout << " Momentum Direct - z : "
<< std::setw(20) << theMomentumDirectionChange.z()
<< G4endl;
G4cout << " Kinetic Energy (MeV): "
<< std::setw(20) << theEnergyChange/MeV
<< G4endl;
G4cout << " Polarization - x : "
<< std::setw(20) << thePolarizationChange.x()
<< G4endl;
G4cout << " Polarization - y : "
<< std::setw(20) << thePolarizationChange.y()
<< G4endl;
G4cout << " Polarization - z : "
<< std::setw(20) << thePolarizationChange.z()
<< G4endl;
G4cout << " Track Weight : "
<< std::setw(20) << theWeightChange
<< G4endl;
}
G4bool G4ParticleChange::CheckIt(const G4Track& aTrack)
{
G4bool exitWithError = false;
G4double accuracy;
// No check in case of "fStopAndKill"
if (GetTrackStatus() == fStopAndKill ) {
return G4VParticleChange::CheckIt(aTrack);
}
// MomentumDirection should be unit vector
G4bool itsOKforMomentum = true;
if ( theEnergyChange >0.) {
accuracy = abs(theMomentumDirectionChange.mag2()-1.0);
if (accuracy > accuracyForWarning) {
#ifdef G4VERBOSE
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the Momentum Change is not unit vector !!" << G4endl;
G4cout << " Difference: " << accuracy << G4endl;
#endif
itsOKforMomentum = false;
if (accuracy > accuracyForException) exitWithError = true;
}
}
// Both global and proper time should not go back
G4bool itsOKforGlobalTime = true;
accuracy = (aTrack.GetGlobalTime()- theTimeChange)/ns;
if (accuracy > accuracyForWarning) {
#ifdef G4VERBOSE
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the global time goes back !!" << G4endl;
G4cout << " Difference: " << accuracy << "[ns] " <<G4endl;
#endif
itsOKforGlobalTime = false;
if (accuracy > accuracyForException) exitWithError = true;
}
G4bool itsOKforProperTime = true;
accuracy = (aTrack.GetProperTime() - theProperTimeChange )/ns;
if (accuracy > accuracyForWarning) {
#ifdef G4VERBOSE
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the proper time goes back !!" << G4endl;
G4cout << " Difference: " << accuracy << "[ns] " <<G4endl;
#endif
itsOKforProperTime = false;
if (accuracy > accuracyForException) exitWithError = true;
}
// Kinetic Energy should not be negative
G4bool itsOKforEnergy = true;
accuracy = -1.0*theEnergyChange/MeV;
if (accuracy > accuracyForWarning) {
#ifdef G4VERBOSE
G4cout << " G4ParticleChange::CheckIt : ";
G4cout << "the kinetic energy is negative !!" << G4endl;
G4cout << " Difference: " << accuracy << "[MeV] " <<G4endl;
#endif
itsOKforEnergy = false;
if (accuracy > accuracyForException) exitWithError = true;
}
G4bool itsOK = itsOKforMomentum && itsOKforEnergy && itsOKforProperTime && itsOKforGlobalTime;
// dump out information of this particle change
#ifdef G4VERBOSE
if (!itsOK) {
G4cout << " G4ParticleChange::CheckIt " <<G4endl;
DumpInfo();
}
#endif
// Exit with error
if (exitWithError) {
G4Exception("G4ParticleChange::CheckIt",
"200",
EventMustBeAborted,
"momentum, energy, and/or time was illegal");
}
//correction
if (!itsOKforMomentum) {
G4double vmag = theMomentumDirectionChange.mag();
theMomentumDirectionChange = (1./vmag)*theMomentumDirectionChange;
}
if (!itsOKforGlobalTime) {
theTimeChange = aTrack.GetGlobalTime();
}
if (!itsOKforProperTime) {
theProperTimeChange = aTrack.GetProperTime();
}
if (!itsOKforEnergy) {
theEnergyChange = 0.0;
}
itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
return itsOK;
}

View File

@ -1,211 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4ParticleChangeForDecay.cc,v 1.9 2003/06/19 14:45:07 gunter Exp $
// GEANT4 tag $Name: geant4-05-02-ref-05 $
//
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
//
//
// ------------------------------------------------------------
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
// Remove modification of energy/momentum 20 Jul, 1998 H.Kurashige
// --------------------------------------------------------------
#include "G4ParticleChangeForDecay.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4TrackFastVector.hh"
#include "G4DynamicParticle.hh"
#include "G4ExceptionSeverity.hh"
G4ParticleChangeForDecay::G4ParticleChangeForDecay():G4VParticleChange()
{
#ifdef G4VERBOSE
if (verboseLevel>2) {
G4cout << "G4ParticleChangeForDecay::G4ParticleChangeForDecay() " << G4endl;
}
#endif
}
G4ParticleChangeForDecay::~G4ParticleChangeForDecay()
{
#ifdef G4VERBOSE
if (verboseLevel>2) {
G4cout << "G4ParticleChangeForDecay::~G4ParticleChangeForDecay() " << G4endl;
}
#endif
}
// copy and assignment operators are implemented as "shallow copy"
G4ParticleChangeForDecay::G4ParticleChangeForDecay(const G4ParticleChangeForDecay &right): G4VParticleChange(right)
{
theTimeChange = right.theTimeChange;
thePolarizationChange = right.thePolarizationChange;
}
G4ParticleChangeForDecay & G4ParticleChangeForDecay::operator=(const G4ParticleChangeForDecay &right)
{
if (this != &right){
theListOfSecondaries = right.theListOfSecondaries;
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
theNumberOfSecondaries = right.theNumberOfSecondaries;
theStatusChange = right.theStatusChange;
theTrueStepLength = right.theTrueStepLength;
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
theSteppingControlFlag = right.theSteppingControlFlag;
theTimeChange = right.theTimeChange;
thePolarizationChange = right.thePolarizationChange;
}
return *this;
}
G4bool G4ParticleChangeForDecay::operator==(const G4ParticleChangeForDecay &right) const
{
return ((G4VParticleChange *)this == (G4VParticleChange *) &right);
}
G4bool G4ParticleChangeForDecay::operator!=(const G4ParticleChangeForDecay &right) const
{
return ((G4VParticleChange *)this != (G4VParticleChange *) &right);
}
//----------------------------------------------------------------
// methods for Initialization
//
void G4ParticleChangeForDecay::Initialize(const G4Track& track)
{
// use base class's method at first
G4VParticleChange::Initialize(track);
const G4DynamicParticle* pParticle = track.GetDynamicParticle();
// set Time e equal to those of the parent track
theTimeChange = track.GetGlobalTime();
// set the Polarization equal to those of the parent track
thePolarizationChange = pParticle->GetPolarization();
}
//----------------------------------------------------------------
// methods for updating G4Step
//
G4Step* G4ParticleChangeForDecay::UpdateStepForPostStep(G4Step* pStep)
{
// Update the G4Step specific attributes
return UpdateStepInfo(pStep);
}
G4Step* G4ParticleChangeForDecay::UpdateStepForAtRest(G4Step* pStep)
{
// A physics process always calculates the final state of the particle
G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
// update polarization
pPostStepPoint->SetPolarization( thePolarizationChange );
// update time
pPostStepPoint->SetGlobalTime( theTimeChange );
pPostStepPoint->AddLocalTime( theTimeChange
- pPreStepPoint->GetGlobalTime());
pPostStepPoint->AddProperTime( theTimeChange
- pPreStepPoint->GetGlobalTime());
#ifdef G4VERBOSE
G4Track* aTrack = pStep->GetTrack();
if (debugFlag) CheckIt(*aTrack);
#endif
// Update the G4Step specific attributes
return UpdateStepInfo(pStep);
}
void G4ParticleChangeForDecay::DumpInfo() const
{
// Show header
G4VParticleChange::DumpInfo();
G4cout.precision(3);
G4cout << " Time (ns) : "
<< std::setw(20) << theTimeChange/ns
<< G4endl;
}
G4bool G4ParticleChangeForDecay::CheckIt(const G4Track& aTrack)
{
G4bool exitWithError = false;
G4double accuracy;
// global time should not go back
G4bool itsOK =true;
accuracy = -1.0*(theTimeChange - aTrack.GetGlobalTime())/ns;
if (accuracy > accuracyForWarning) {
#ifdef G4VERBOSE
G4cout << " G4ParticleChangeForDecay::CheckIt : ";
G4cout << "the global time goes back !!" << G4endl;
G4cout << " Difference: " << accuracy << "[ns] " <<G4endl;
#endif
itsOK = false;
if (accuracy > accuracyForException) exitWithError = true;
}
// dump out information of this particle change
#ifdef G4VERBOSE
if (!itsOK) {
G4cout << " G4ParticleChangeForDecay::CheckIt " <<G4endl;
DumpInfo();
}
#endif
// Exit with error
if (exitWithError) {
G4Exception("G4ParticleChangeForDecay::CheckIt",
"500",
EventMustBeAborted,
"time was illegal");
}
// correction
if (!itsOK) {
theTimeChange = aTrack.GetGlobalTime();
}
itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
return itsOK;
}

View File

@ -1,249 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4ParticleChangeForLoss.cc,v 1.13 2004/06/15 08:17:38 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-02-ref-01 $
//
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
// ------------------------------------------------------------
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
// --------------------------------------------------------------
//
// Modified:
// 16.01.04 V.Ivanchenko update for model variant of energy loss
//
// ------------------------------------------------------------
//
#include "G4ParticleChangeForLoss.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4DynamicParticle.hh"
#include "G4ExceptionSeverity.hh"
G4ParticleChangeForLoss::G4ParticleChangeForLoss():G4VParticleChange()
{
theSteppingControlFlag = NormalCondition;
debugFlag = false;
#ifdef G4VERBOSE
if (verboseLevel>2) {
G4cout << "G4ParticleChangeForLoss::G4ParticleChangeForLoss() " << G4endl;
}
#endif
}
G4ParticleChangeForLoss::~G4ParticleChangeForLoss()
{
#ifdef G4VERBOSE
if (verboseLevel>2) {
G4cout << "G4ParticleChangeForLoss::~G4ParticleChangeForLoss() " << G4endl;
}
#endif
}
G4ParticleChangeForLoss::G4ParticleChangeForLoss(
const G4ParticleChangeForLoss &right): G4VParticleChange(right)
{
if (verboseLevel>1) {
G4cout << "G4ParticleChangeForLoss:: copy constructor is called " << G4endl;
}
currentTrack = right.currentTrack;
proposedKinEnergy = right.proposedKinEnergy;
currentCharge = right.currentCharge;
//theProposedWeight = right.theProposedWeight;
proposedMomentumDirection = right.proposedMomentumDirection;
}
// assignment operator
G4ParticleChangeForLoss & G4ParticleChangeForLoss::operator=(
const G4ParticleChangeForLoss &right)
{
if (verboseLevel>1) {
G4cout << "G4ParticleChangeForLoss:: assignment operator is called " << G4endl;
}
if (this != &right)
{
theListOfSecondaries = right.theListOfSecondaries;
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
theNumberOfSecondaries = right.theNumberOfSecondaries;
theStatusChange = right.theStatusChange;
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
theSteppingControlFlag = right.theSteppingControlFlag;
currentTrack = right.currentTrack;
proposedKinEnergy = right.proposedKinEnergy;
currentCharge = right.currentCharge;
//theProposedWeight = right.theProposedWeight;
proposedMomentumDirection = right.proposedMomentumDirection;
}
return *this;
}
//----------------------------------------------------------------
// methods for updating G4Step
//
G4Step* G4ParticleChangeForLoss::UpdateStepForAlongStep(G4Step* pStep)
{
// A physics process always calculates the final state of the
// particle relative to the initial state at the beginning
// of the Step, i.e., based on information of G4Track (or
// equivalently the PreStepPoint).
// So, the differences (delta) between these two states have to be
// calculated and be accumulated in PostStepPoint.
G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
// calculate new kinetic energy
G4double kinEnergy = pPostStepPoint->GetKineticEnergy()
+ (proposedKinEnergy - pPreStepPoint->GetKineticEnergy());
// update kinetic energy and momentum direction
if (kinEnergy < 0.0) {
theLocalEnergyDeposit += kinEnergy;
kinEnergy = 0.0;
}
pPostStepPoint->SetKineticEnergy( kinEnergy );
pPostStepPoint->SetCharge( currentCharge );
// update weight
// this feature is commented out, it should be overwritten in case
// if energy loss processes will use biasing
// G4double newWeight = theProposedWeight/(pPreStepPoint->GetWeight())*(pPostStepPoint->GetWeight());
// pPostStepPoint->SetWeight( newWeight );
// Not necessary to check now
//#ifdef G4VERBOSE
// if (debugFlag) CheckIt(*aTrack);
//#endif
// Update the G4Step specific attributes
pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
return pStep;
}
G4Step* G4ParticleChangeForLoss::UpdateStepForPostStep(G4Step* pStep)
{
// A physics process always calculates the final state of the
// particle relative to the initial state at the beginning
// of the Step, i.e., based on information of G4Track (or
// equivalently the PreStepPoint).
// So, the differences (delta) between these two states have to be
// calculated and be accumulated in PostStepPoint.
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
pPostStepPoint->SetKineticEnergy( proposedKinEnergy );
pPostStepPoint->SetCharge( currentCharge );
pPostStepPoint->SetMomentumDirection( proposedMomentumDirection );
// update weight
// this feature is commented out, it should be overwritten in case
// if energy loss processes will use biasing
// pPostStepPoint->SetWeight( theProposedWeight );
// Not necessary to check now
//#ifdef G4VERBOSE
// if (debugFlag) CheckIt(*aTrack);
//#endif
// Update the G4Step specific attributes
pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
return pStep;
}
//----------------------------------------------------------------
// methods for printing messages
//
void G4ParticleChangeForLoss::DumpInfo() const
{
// use base-class DumpInfo
G4VParticleChange::DumpInfo();
G4cout.precision(3);
G4cout << " Charge (eplus) : "
<< std::setw(20) << currentCharge/eplus
<< G4endl;
G4cout << " Kinetic Energy (MeV): "
<< std::setw(20) << proposedKinEnergy/MeV
<< G4endl;
G4cout << " Momentum Direct - x : "
<< std::setw(20) << proposedMomentumDirection.x()
<< G4endl;
G4cout << " Momentum Direct - y : "
<< std::setw(20) << proposedMomentumDirection.y()
<< G4endl;
G4cout << " Momentum Direct - z : "
<< std::setw(20) << proposedMomentumDirection.z()
<< G4endl;
}
G4bool G4ParticleChangeForLoss::CheckIt(const G4Track& aTrack)
{
G4bool itsOK = true;
G4bool exitWithError = false;
G4double accuracy;
// Energy should not be lager than initial value
accuracy = ( proposedKinEnergy - aTrack.GetKineticEnergy())/MeV;
if (accuracy > accuracyForWarning) {
#ifdef G4VERBOSE
G4cout << "G4ParticleChangeForLoss::CheckIt: ";
G4cout << "KinEnergy become larger than the initial value!" << G4endl;
G4cout << " Difference: " << accuracy << "[MeV] " <<G4endl;
#endif
itsOK = false;
if (accuracy > accuracyForException) exitWithError = true;
}
// dump out information of this particle change
#ifdef G4VERBOSE
if (!itsOK) {
G4cout << "G4ParticleChangeForLoss::CheckIt " << G4endl;
DumpInfo();
}
#endif
// Exit with error
if (exitWithError) {
G4Exception("G4ParticleChangeForLoss::CheckIt",
"400",
EventMustBeAborted,
"energy was illegal");
}
//correction
if (!itsOK) {
proposedKinEnergy = aTrack.GetKineticEnergy();
}
itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
return itsOK;
}

View File

@ -1,202 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4ParticleChangeForMSC.cc,v 1.11 2004/01/20 15:29:41 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-ref-01 $
//
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
//
//
// ------------------------------------------------------------
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
// Update for model variant of msc 16 Jan 2004 V.Ivanchenko
// --------------------------------------------------------------
#include "G4ParticleChangeForMSC.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4DynamicParticle.hh"
#include "G4ExceptionSeverity.hh"
G4ParticleChangeForMSC::G4ParticleChangeForMSC():G4VParticleChange()
{
#ifdef G4VERBOSE
if (verboseLevel>2) {
G4cout << "G4ParticleChangeForMSC::G4ParticleChangeForMSC() " << G4endl;
}
#endif
}
G4ParticleChangeForMSC::~G4ParticleChangeForMSC()
{
#ifdef G4VERBOSE
if (verboseLevel>2) {
G4cout << "G4ParticleChangeForMSC::~G4ParticleChangeForMSC() " << G4endl;
}
#endif
}
G4ParticleChangeForMSC::G4ParticleChangeForMSC(
const G4ParticleChangeForMSC &right): G4VParticleChange(right)
{
if (verboseLevel>1) {
G4cout << "G4ParticleChangeForMSC:: copy constructor is called " << G4endl;
}
theMomentumDirection = right.theMomentumDirection;
thePosition = right.thePosition;
}
// assignment operator
G4ParticleChangeForMSC & G4ParticleChangeForMSC::operator=(
const G4ParticleChangeForMSC &right)
{
if (verboseLevel>1) {
G4cout << "G4ParticleChangeForMSC:: assignment operator is called " << G4endl;
}
if (this != &right)
{
theListOfSecondaries = right.theListOfSecondaries;
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
theNumberOfSecondaries = right.theNumberOfSecondaries;
theStatusChange = right.theStatusChange;
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
theSteppingControlFlag = right.theSteppingControlFlag;
theTrueStepLength = right.theTrueStepLength;
theMomentumDirection = right.theMomentumDirection;
thePosition = right.thePosition;
}
return *this;
}
//----------------------------------------------------------------
// methods for updating G4Step
//
G4Step* G4ParticleChangeForMSC::UpdateStepForAlongStep(G4Step* pStep)
{
// Update the G4Step specific attributes
pStep->SetStepLength(theTrueStepLength);
theStatusChange = pStep->GetTrack()->GetTrackStatus();
return pStep;
}
G4Step* G4ParticleChangeForMSC::UpdateStepForPostStep(G4Step* pStep)
{
// A physics process always calculates the final state of the particle
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
// update momentum direction
pPostStepPoint->SetMomentumDirection(theMomentumDirection);
// update position
pPostStepPoint->SetPosition( thePosition );
// Update the G4Step specific attributes
return pStep;
}
//----------------------------------------------------------------
// methods for printing messages
//
void G4ParticleChangeForMSC::DumpInfo() const
{
// use base-class DumpInfo
G4VParticleChange::DumpInfo();
G4cout.precision(3);
G4cout << " Position - x (mm) : "
<< std::setw(20) << thePosition.x()/mm
<< G4endl;
G4cout << " Position - y (mm) : "
<< std::setw(20) << thePosition.y()/mm
<< G4endl;
G4cout << " Position - z (mm) : "
<< std::setw(20) << thePosition.z()/mm
<< G4endl;
G4cout << " Momentum Direct - x : "
<< std::setw(20) << theMomentumDirection.x()
<< G4endl;
G4cout << " Momentum Direct - y : "
<< std::setw(20) << theMomentumDirection.y()
<< G4endl;
G4cout << " Momentum Direct - z : "
<< std::setw(20) << theMomentumDirection.z()
<< G4endl;
}
G4bool G4ParticleChangeForMSC::CheckIt(const G4Track& aTrack)
{
G4bool itsOK = true;
G4bool exitWithError = false;
G4double accuracy;
// check
// MomentumDirection should be unit vector
accuracy = abs(theMomentumDirection.mag2()-1.0);
if (accuracy > accuracyForWarning) {
#ifdef G4VERBOSE
G4cout << " G4ParticleChangeForMSC::CheckIt : ";
G4cout << "the Momentum Change is not unit vector !!" << G4endl;
G4cout << " Difference: " << accuracy << G4endl;
#endif
itsOK = false;
if (accuracy > accuracyForException) exitWithError = true;
}
// dump out information of this particle change
#ifdef G4VERBOSE
if (!itsOK) {
G4cout << " G4ParticleChangeForMSC::CheckIt " <<G4endl;
DumpInfo();
}
#endif
// Exit with error
if (exitWithError) {
G4Exception("G4ParticleChangeForMSC::CheckIt",
"300",
EventMustBeAborted,
"momentum direction was illegal");
}
//correction
if (!itsOK) {
G4double vmag = theMomentumDirection.mag();
theMomentumDirection = (1./vmag)*theMomentumDirection;
}
itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
return itsOK;
}

View File

@ -1,240 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4ParticleChangeForTransport.cc,v 1.16 2004/01/20 15:29:41 vnivanch Exp $
// GEANT4 tag $Name: geant4-06-00-ref-01 $
//
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
//
//
// ------------------------------------------------------------
// Implemented for the new scheme 10 May. 1998 H.Kurahige
// Correct tratment of fpNextTouchable 12 May. 1998 H.Kurashige
// Change to the next volume only if energy>0 19 Jan. 2004 V.Ivanchenko
// --------------------------------------------------------------
#include "G4ParticleChangeForTransport.hh"
#include "G4TouchableHandle.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4TrackFastVector.hh"
#include "G4DynamicParticle.hh"
G4ParticleChangeForTransport::G4ParticleChangeForTransport():G4ParticleChange()
{
if (verboseLevel>2) {
G4cout << "G4ParticleChangeForTransport::G4ParticleChangeForTransport() " << G4endl;
}
}
G4ParticleChangeForTransport::~G4ParticleChangeForTransport()
{
if (verboseLevel>2) {
G4cout << "G4ParticleChangeForTransport::~G4ParticleChangeForTransport() " << G4endl;
}
}
G4ParticleChangeForTransport::G4ParticleChangeForTransport(const G4ParticleChangeForTransport &right):G4ParticleChange(right)
{
if (verboseLevel>0) {
G4cout << "G4ParticleChangeForTransport:: copy constructor is called " << G4endl;
}
theTouchableHandle = right.theTouchableHandle;
}
// assignemnt operator
G4ParticleChangeForTransport & G4ParticleChangeForTransport::operator=(const G4ParticleChangeForTransport &right)
{
if (verboseLevel>1) {
G4cout << "G4ParticleChangeForTransport:: assignment operator is called " << G4endl;
}
if (this != &right)
{
theListOfSecondaries = right.theListOfSecondaries;
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
theNumberOfSecondaries = right.theNumberOfSecondaries;
theStatusChange = right.theStatusChange;
theTouchableHandle = right.theTouchableHandle;
theMaterialChange = right.theMaterialChange;
theMaterialCutsCoupleChange = right.theMaterialCutsCoupleChange;
theMomentumDirectionChange = right.theMomentumDirectionChange;
thePolarizationChange = right.thePolarizationChange;
thePositionChange = right.thePositionChange;
theTimeChange = right.theTimeChange;
theEnergyChange = right.theEnergyChange;
theTrueStepLength = right.theTrueStepLength;
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
theSteppingControlFlag = right.theSteppingControlFlag;
}
return *this;
}
//----------------------------------------------------------------
// methods for updating G4Step
//
G4Step* G4ParticleChangeForTransport::UpdateStepForAtRest(G4Step* pStep)
{
// Nothing happens for AtRestDoIt
if (verboseLevel>0) {
G4cout << "G4ParticleChangeForTransport::UpdateStepForAtRest() is called" << G4endl;
G4cout << " Nothing happens for this method " << G4endl;
}
// Update the G4Step specific attributes
return UpdateStepInfo(pStep);
}
G4Step* G4ParticleChangeForTransport::UpdateStepForAlongStep(G4Step* pStep)
{
// Smooth curved tajectory representation: let the Step know about
// the auxiliary trajectory points (jacek 30/10/2002)
pStep->SetPointerToVectorOfAuxiliaryPoints(fpVectorOfAuxiliaryPointsPointer);
// copy of G4ParticleChange::UpdateStepForAlongStep
// i.e. no effect for touchable
// A physics process always calculates the final state of the
// particle relative to the initial state at the beginning
// of the Step, i.e., based on information of G4Track (or
// equivalently the PreStepPoint).
// So, the differences (delta) between these two states have to be
// calculated and be accumulated in PostStepPoint.
// Take note that the return type of GetMomentumChange is a
// pointer to G4ThreeVector. Also it is a normalized
// momentum vector.
G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
G4Track* aTrack = pStep->GetTrack();
G4double mass = aTrack->GetDynamicParticle()->GetMass();
// uodate kinetic energy
// now assume that no energy change in transportation
// However it is not true in electric fields
// Case for changing energy will be implemented in future
// update momentum direction and energy
if (isMomentumChanged) {
G4double energy;
energy= pPostStepPoint->GetKineticEnergy()
+ (theEnergyChange - pPreStepPoint->GetKineticEnergy());
// calculate new momentum
G4ThreeVector pMomentum = pPostStepPoint->GetMomentum()
+ ( CalcMomentum(theEnergyChange, theMomentumDirectionChange, mass)
- pPreStepPoint->GetMomentum());
G4double tMomentum = pMomentum.mag();
G4ThreeVector direction(1.0,0.0,0.0);
if( tMomentum > 0. ){
G4double inv_Momentum= 1.0 / tMomentum;
direction= pMomentum * inv_Momentum;
}
pPostStepPoint->SetMomentumDirection(direction);
pPostStepPoint->SetKineticEnergy( energy );
}
// stop case should not occur
//pPostStepPoint->SetMomentumDirection(G4ThreeVector(1., 0., 0.));
// update polarization
pPostStepPoint->AddPolarization( thePolarizationChange
- pPreStepPoint->GetPolarization());
// update position and time
pPostStepPoint->AddPosition( thePositionChange
- pPreStepPoint->GetPosition() );
pPostStepPoint->AddGlobalTime( theTimeChange
- pPreStepPoint->GetGlobalTime());
pPostStepPoint->AddLocalTime( theTimeChange
- pPreStepPoint->GetGlobalTime());
pPostStepPoint->AddProperTime( theProperTimeChange
- pPreStepPoint->GetProperTime());
#ifdef G4VERBOSE
if (debugFlag) CheckIt(*aTrack);
#endif
// Update the G4Step specific attributes
//pStep->SetStepLength( theTrueStepLength );
// pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
pStep->SetControlFlag( theSteppingControlFlag );
return pStep;
// return UpdateStepInfo(pStep);
}
G4Step* G4ParticleChangeForTransport::UpdateStepForPostStep(G4Step* pStep)
{
// A physics process always calculates the final state of the particle
// Change volume if any kinetic energy remanes
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
if(pPostStepPoint->GetKineticEnergy() > 0.0) {
// update next touchable
// (touchable can be changed only at PostStepDoIt)
pPostStepPoint->SetTouchableHandle( theTouchableHandle );
pPostStepPoint->SetMaterial( theMaterialChange );
pPostStepPoint->SetMaterialCutsCouple( theMaterialCutsCoupleChange );
}
// It used to call base class's method
// - but this would copy uninitialised data members
// return G4ParticleChange::UpdateStepForPostStep(pStep);
// Copying what the base class does would instead
// - also not useful
// return G4VParticleChange::UpdateStepInfo(pStep);
return pStep;
}
//----------------------------------------------------------------
// methods for printing messages
//
void G4ParticleChangeForTransport::DumpInfo() const
{
// use base-class DumpInfo
G4ParticleChange::DumpInfo();
G4cout.precision(3);
G4cout << " Touchable (pointer) : "
<< std::setw(20) << theTouchableHandle()
<< G4endl;
}

View File

@ -1,64 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4Step.cc,v 1.5 2001/07/11 10:08:39 gunter Exp $
// GEANT4 tag $Name: geant4-04-00-ref-03 $
//
//
//---------------------------------------------------------------
//
// G4Step.cc
//
// Description:
// This class represents the Step of a particle tracked.
// It includes information of
// 1) List of Step points which compose the Step,
// 2) static information of particle which generated the
// Step,
// 3) trackID and parent particle ID of the Step,
// 4) termination condition of the Step,
//
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
//
// ---------------------------------------------------------------
#include "G4Step.hh"
////////////////
G4Step::G4Step()
////////////////
{
fpPreStepPoint = new G4StepPoint();
fpPostStepPoint = new G4StepPoint();
}
/////////////////
G4Step::~G4Step()
/////////////////
{
delete fpPreStepPoint;
delete fpPostStepPoint;
}

View File

@ -1,101 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4StepPoint.cc,v 1.9 2002/12/16 11:59:12 gcosmo Exp $
// GEANT4 tag $Name: geant4-05-00-ref-03 $
//
//
//---------------------------------------------------------------
//
// G4StepPoint.cc
//
// Description:
// This class represents information associated with the
// each end of a Step like the space/time data of the
// particle.
//
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
//
// ---------------------------------------------------------------
#include "G4StepPoint.hh"
//////////////////////////
G4StepPoint::G4StepPoint():
//////////////////////////
fpTouchable(0), fpMaterial(0), fpMaterialCutsCouple(0),
fpProcessDefinedStep(0), fCharge(0.)
{
}
//////////////////////////
G4StepPoint::G4StepPoint(const G4StepPoint &right):
//////////////////////////
fPosition(right.fPosition),
fGlobalTime(right.fGlobalTime),
fLocalTime(right.fLocalTime),
fProperTime(right.fProperTime),
fMomentumDirection(right.fMomentumDirection),
fKineticEnergy(right.fKineticEnergy),
fVelocity(right.fVelocity),
fpTouchable(right.fpTouchable),
fpMaterial(right.fpMaterial),
fpMaterialCutsCouple(right.fpMaterialCutsCouple),
fSafety(right.fSafety),
fPolarization(right.fPolarization),
fStepStatus(right.fStepStatus),
fpProcessDefinedStep(right.fpProcessDefinedStep),
fMass(right.fMass),
fCharge(right.fCharge),
fWeight(right.fWeight)
{}
//////////////////////////
G4StepPoint & G4StepPoint::operator=(const G4StepPoint &right)
//////////////////////////
{
if (this != &right) {
fPosition = right.fPosition;
fGlobalTime = right.fGlobalTime;
fLocalTime = right.fLocalTime;
fProperTime = right.fProperTime;
fMomentumDirection = right.fMomentumDirection;
fKineticEnergy = right.fKineticEnergy;
fpTouchable = right.fpTouchable;
fpMaterial = right.fpMaterial;
fpMaterialCutsCouple = right.fpMaterialCutsCouple;
fSafety = right.fSafety;
fPolarization = right.fPolarization;
fStepStatus = right.fStepStatus;
fpProcessDefinedStep = right.fpProcessDefinedStep;
fMass = right.fMass;
fCharge = right.fCharge;
fWeight = right.fWeight;
fVelocity = right.fVelocity;
}
return *this;
}

View File

@ -1,191 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4Track.cc,v 1.21 2004/06/11 14:28:14 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-02-ref-01 $
//
//
//---------------------------------------------------------------
//
// G4Track.cc
//
//---------------------------------------------------------------
// Add copy constructor Hisaya Feb. 07 01
// Fix GetVelocity Hisaya Feb. 17 01
// Modification for G4TouchableHandle 22 Oct. 2001 R.Chytracek//
#include "G4Track.hh"
G4Allocator<G4Track> aTrackAllocator;
///////////////////////////////////////////////////////////
G4Track::G4Track(G4DynamicParticle* apValueDynamicParticle,
G4double aValueTime,
const G4ThreeVector& aValuePosition)
///////////////////////////////////////////////////////////
: fCurrentStepNumber(0), fPosition(aValuePosition),
fGlobalTime(aValueTime), fLocalTime(0.),
fTrackLength(0.),
fParentID(0), fTrackID(0),
fpDynamicParticle(apValueDynamicParticle),
fTrackStatus(fAlive),
fBelowThreshold(false), fGoodForTracking(false),
fStepLength(0.0), fWeight(1.0),
fpStep(0),
fVtxKineticEnergy(0.0),
fpLVAtVertex(0), fpCreatorProcess(0),
fpUserInformation(0)
{
}
//////////////////
G4Track::G4Track()
//////////////////
: fCurrentStepNumber(0),
fGlobalTime(0), fLocalTime(0.),
fTrackLength(0.),
fParentID(0), fTrackID(0),
fpDynamicParticle(0),
fTrackStatus(fAlive),
fBelowThreshold(false), fGoodForTracking(false),
fStepLength(0.0), fWeight(1.0),
fpStep(0),
fVtxKineticEnergy(0.0),
fpLVAtVertex(0), fpCreatorProcess(0),
fpUserInformation(0)
{
}
//////////////////
G4Track::G4Track(const G4Track& right)
//////////////////
{
*this = right;
}
///////////////////
G4Track::~G4Track()
///////////////////
{
delete fpDynamicParticle;
delete fpUserInformation;
}
//////////////////
G4Track & G4Track::operator=(const G4Track &right)
//////////////////
{
if (this != &right) {
fPosition = right.fPosition;
fGlobalTime = right.fGlobalTime;
fLocalTime = right.fLocalTime;
fTrackLength = right.fTrackLength;
fWeight = right.fWeight;
fStepLength = right.fStepLength;
// Track ID (and Parent ID) is not copied and set to zero for new track
fTrackID = 0;
fParentID =0;
// CurrentStepNumber is set to be 0
fCurrentStepNumber = 0;
// dynamic particle information
fpDynamicParticle = new G4DynamicParticle(*(right.fpDynamicParticle));
// track status and flags for tracking
fTrackStatus = right.fTrackStatus;
fBelowThreshold = right.fBelowThreshold;
fGoodForTracking = right.fGoodForTracking;
// Step information (Step Length, Step Number, pointer to the Step,)
// are not copied
fpStep=0;
// vertex information
fVtxPosition = right.fVtxPosition;
fpLVAtVertex = right.fpLVAtVertex;
fVtxKineticEnergy = right.fVtxKineticEnergy;
fVtxMomentumDirection = right.fVtxMomentumDirection;
// CreatorProcess and UserInformation are not copied
fpCreatorProcess = 0;
fpUserInformation = 0;
}
return *this;
}
///////////////////
void G4Track::CopyTrackInfo(const G4Track& right)
//////////////////
{
*this = right;
}
#include "G4ParticleTable.hh"
///////////////////
G4double G4Track::GetVelocity() const
///////////////////
{
static G4bool isFirstTime = true;
static G4ParticleDefinition* fOpticalPhoton =0;
if ( isFirstTime ) {
isFirstTime = false;
// set fOpticalPhoton
fOpticalPhoton = G4ParticleTable::GetParticleTable()->FindParticle("opticalphoton");
}
G4double velocity ;
G4double mass = fpDynamicParticle->GetMass();
// mass less particle
if( mass == 0. ){
velocity = c_light ;
// special case for photons
if ( (fOpticalPhoton !=0) &&
(fpDynamicParticle->GetDefinition()==fOpticalPhoton) ){
G4Material*
mat=fpTouchable->GetVolume()->GetLogicalVolume()->GetMaterial();
if(mat->GetMaterialPropertiesTable() != 0){
if(mat->GetMaterialPropertiesTable()->GetProperty("RINDEX") != 0 ){
// light velocity = c/reflection-index
velocity /=
mat->GetMaterialPropertiesTable()->GetProperty("RINDEX")->
GetProperty(fpDynamicParticle->GetTotalMomentum()) ;
}
}
}
} else {
G4double T = fpDynamicParticle->GetKineticEnergy();
velocity = c_light*sqrt(T*(T+2.*mass))/(T+mass) ;
}
return velocity ;
}

View File

@ -1,376 +0,0 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
//
// $Id: G4VParticleChange.cc,v 1.16 2003/12/12 13:12:14 gcosmo Exp $
// GEANT4 tag $Name: geant4-06-00-ref-01 $
//
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
//
// ------------------------------------------------------------
// Implemented for the new scheme 23 Mar. 1998 H.Kurahige
// --------------------------------------------------------------
#include "G4VParticleChange.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4TrackFastVector.hh"
#include "G4ExceptionSeverity.hh"
const G4double G4VParticleChange::accuracyForWarning = 1.0e-9;
const G4double G4VParticleChange::accuracyForException = 0.001;
G4VParticleChange::G4VParticleChange():
theNumberOfSecondaries(0),
theSizeOftheListOfSecondaries(G4TrackFastVectorSize),
theStatusChange(fAlive),
theSteppingControlFlag(NormalCondition),
theLocalEnergyDeposit(0.0),
verboseLevel(1),
theParentWeight(1.0),
fSetSecondaryWeightByProcess(false),
fSetParentWeightByProcess(true)
{
debugFlag = false;
#ifdef G4VERBOSE
// activate CHeckIt if in VERBOSE mode
debugFlag = true;
#endif
theListOfSecondaries = new G4TrackFastVector();
}
G4VParticleChange::~G4VParticleChange() {
// check if tracks still exist in theListOfSecondaries
if (theNumberOfSecondaries>0) {
#ifdef G4VERBOSE
if (verboseLevel>0) {
G4cerr << "G4VParticleChange::~G4VParticleChange() Warning ";
G4cerr << "theListOfSecondaries is not empty ";
}
#endif
for (G4int index= 0; index<theNumberOfSecondaries; index++){
if ( (*theListOfSecondaries)[index] ) delete (*theListOfSecondaries)[index] ;
}
}
delete theListOfSecondaries;
}
// copy and assignment operators are implemented as "shallow copy"
G4VParticleChange::G4VParticleChange(const G4VParticleChange &right):
theNumberOfSecondaries(0),
theSizeOftheListOfSecondaries(G4TrackFastVectorSize),
theStatusChange(fAlive),
theSteppingControlFlag(NormalCondition),
theLocalEnergyDeposit(0.0),
verboseLevel(1),
theParentWeight(1.0),
fSetSecondaryWeightByProcess(false)
{
debugFlag = false;
#ifdef G4VERBOSE
// activate CHeckIt if in VERBOSE mode
debugFlag = true;
#endif
theListOfSecondaries = right.theListOfSecondaries;
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
theNumberOfSecondaries = right.theNumberOfSecondaries;
theStatusChange = right.theStatusChange;
theTrueStepLength = right.theTrueStepLength;
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
theSteppingControlFlag = right.theSteppingControlFlag;
fSetParentWeightByProcess = right.fSetParentWeightByProcess;
}
G4VParticleChange & G4VParticleChange::operator=(const G4VParticleChange &right)
{
debugFlag = false;
#ifdef G4VERBOSE
// activate CHeckIt if in VERBOSE mode
debugFlag = true;
#endif
if (this != &right)
{
theListOfSecondaries = right.theListOfSecondaries;
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
theNumberOfSecondaries = right.theNumberOfSecondaries;
theStatusChange = right.theStatusChange;
theTrueStepLength = right.theTrueStepLength;
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
theSteppingControlFlag = right.theSteppingControlFlag;
fSetParentWeightByProcess = right.fSetParentWeightByProcess;
}
return *this;
}
G4bool G4VParticleChange::operator==(const G4VParticleChange &right) const
{
return (this == (G4VParticleChange *) &right);
}
G4bool G4VParticleChange::operator!=(const G4VParticleChange &right) const
{
return (this != (G4VParticleChange *) &right);
}
//----------------------------------------------------------------
// methods for printing messages
//
void G4VParticleChange::DumpInfo() const
{
// Show header
G4cout.precision(3);
G4cout << " -----------------------------------------------"
<< G4endl;
G4cout << " G4ParticleChange Information " << std::setw(20) << G4endl;
G4cout << " -----------------------------------------------"
<< G4endl;
G4cout << " # of 2ndaries : "
<< std::setw(20) << theNumberOfSecondaries
<< G4endl;
if (theNumberOfSecondaries >0) {
G4cout << " Pointer to 2ndaries : "
<< std::setw(20) << GetSecondary(0)
<< G4endl;
G4cout << " (Showed only 1st one)"
<< G4endl;
}
G4cout << " -----------------------------------------------"
<< G4endl;
G4cout << " Energy Deposit (MeV): "
<< std::setw(20) << theLocalEnergyDeposit/MeV
<< G4endl;
G4cout << " Track Status : "
<< std::setw(20);
if( theStatusChange == fAlive ){
G4cout << " Alive";
} else if( theStatusChange == fStopButAlive ){
G4cout << " StopButAlive";
} else if( theStatusChange == fStopAndKill ){
G4cout << " StopAndKill";
} else if( theStatusChange == fKillTrackAndSecondaries ){
G4cout << " KillTrackAndSecondaries";
} else if( theStatusChange == fSuspend ){
G4cout << " Suspend";
} else if( theStatusChange == fPostponeToNextEvent ){
G4cout << " PostponeToNextEvent";
}
G4cout << G4endl;
G4cout << " True Path Length (mm) : "
<< std::setw(20) << theTrueStepLength/mm
<< G4endl;
G4cout << " Stepping Control : "
<< std::setw(20) << theSteppingControlFlag
<< G4endl;
G4cout << G4endl;
}
G4bool G4VParticleChange::CheckIt(const G4Track& )
{
G4bool exitWithError = false;
G4double accuracy;
// Energy deposit should not be negative
G4bool itsOKforEnergy = true;
accuracy = -1.0*theLocalEnergyDeposit/MeV;
if (accuracy > accuracyForWarning) {
#ifdef G4VERBOSE
G4cout << " G4VParticleChange::CheckIt : ";
G4cout << "the energy deposit is negative !!" << G4endl;
G4cout << " Difference: " << accuracy << "[MeV] " <<G4endl;
#endif
itsOKforEnergy = false;
if (accuracy > accuracyForException) exitWithError = true;
}
// true path length should not be negative
G4bool itsOKforStepLength = true;
accuracy = -1.0*theTrueStepLength/mm;
if (accuracy > accuracyForWarning) {
#ifdef G4VERBOSE
G4cout << " G4VParticleChange::CheckIt : ";
G4cout << "the true step length is negative !!" << G4endl;
G4cout << " Difference: " << accuracy << "[MeV] " <<G4endl;
#endif
itsOKforStepLength = false;
if (accuracy > accuracyForException) exitWithError = true;
}
G4bool itsOK = itsOKforStepLength && itsOKforEnergy ;
// dump out information of this particle change
#ifdef G4VERBOSE
if (! itsOK ){
G4cout << " G4VParticleChange::CheckIt " <<G4endl;
DumpInfo();
}
#endif
// Exit with error
if (exitWithError) {
G4Exception("G4VParticleChange::CheckIt",
"100",
EventMustBeAborted,
"step length and/or energy deposit was illegal");
}
// correction
if ( !itsOKforStepLength ) {
theTrueStepLength = (1.e-12)*mm;
}
if ( !itsOKforEnergy ) {
theLocalEnergyDeposit = 0.0;
}
return itsOK;
}
G4bool G4VParticleChange::CheckSecondary(G4Track& aTrack)
{
G4bool exitWithError = false;
G4double accuracy;
// MomentumDirection should be unit vector
G4bool itsOKforMomentum = true;
accuracy = abs((aTrack.GetMomentumDirection()).mag2()-1.0);
if (accuracy > accuracyForWarning) {
#ifdef G4VERBOSE
G4cout << " G4VParticleChange::CheckSecondary : ";
G4cout << "the Momentum direction is not unit vector !!" << G4endl;
G4cout << " Difference: " << accuracy << G4endl;
#endif
itsOKforMomentum = false;
if (accuracy > accuracyForException) exitWithError = true;
}
// Kinetic Energy should not be negative
G4bool itsOKforEnergy;
accuracy = -1.0*(aTrack.GetKineticEnergy())/MeV;
if (accuracy < accuracyForWarning) {
itsOKforEnergy = true;
} else {
#ifdef G4VERBOSE
G4cout << " G4VParticleChange::CheckSecondary : ";
G4cout << "the kinetic energy is negative !!" << G4endl;
G4cout << " Difference: " << accuracy << "[MeV] " <<G4endl;
#endif
itsOKforEnergy = false;
if (accuracy < accuracyForException) { exitWithError = false;}
else { exitWithError = true; }
}
G4bool itsOKforProperTime = true;
//accuracy = (aTrack.GetProperTime())/ns;
// if (accuracy > accuracyForWarning) {
#ifdef G4VERBOSE
// G4cout << " G4VParticleChange::CheckSecondary : ";
// G4cout << "the proper time goes back !!" << G4endl;
// G4cout << " Difference: " << accuracy << "[ns] " <<G4endl;
#endif
// itsOKforProperTime = false;
// if (accuracy > accuracyForException) exitWithError = true;
//}
// Exit with error
if (exitWithError) {
G4Exception("G4VParticleChange::CheckSecondary",
"10",
EventMustBeAborted,
"momentum, energy and/or proper time was illegal");
}
G4bool itsOK = itsOKforMomentum && itsOKforEnergy && itsOKforProperTime;
//correction
if (!itsOKforMomentum) {
G4double vmag = (aTrack.GetMomentumDirection()).mag();
aTrack.SetMomentumDirection((1./vmag)*aTrack.GetMomentumDirection());
}
//if (!itsOKforProperTime) {
// aTrack.SetProperTime(0.0);
//}
if (!itsOKforEnergy) {
aTrack.SetKineticEnergy(0.0);
}
return itsOK;
}
G4double G4VParticleChange::GetAccuracyForWarning() const
{
return accuracyForWarning;
}
G4double G4VParticleChange::GetAccuracyForException() const
{
return accuracyForException;
}
void G4VParticleChange::AddSecondary(G4Track *aTrack)
{
if (debugFlag) CheckSecondary(*aTrack);
if (!fSetSecondaryWeightByProcess){
// pass the weight of parent track
aTrack->SetWeight(theParentWeight);
}
// add a secondary after size check
if (theSizeOftheListOfSecondaries > theNumberOfSecondaries) {
theListOfSecondaries->SetElement(theNumberOfSecondaries, aTrack);
theNumberOfSecondaries++;
} else {
#ifdef G4VERBOSE
if (verboseLevel>0) {
G4cerr << "G4VParticleChange::AddSecondary() Warning ";
G4cerr << "theListOfSecondaries is full !! " << G4endl;
G4cerr << " The object will not be added in theListOfSecondaries" << G4endl;
}
#endif
}
}