Import Geant4 4.1.0 source tree
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4CashKarpRKF45.cc,v 1.10 2001/11/21 17:56:18 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// The Cash-Karp Runge-Kutta-Fehlberg 4/5 method is an embedded fourth
|
||||
// order method (giving fifth-order accuracy) for the solution
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ChordFinder.cc,v 1.24 2001/11/30 17:36:18 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// $Id: G4ChordFinder.cc,v 1.27 2002/06/01 02:37:14 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// 25.02.97 John Apostolakis, design and implimentation
|
||||
@@ -184,7 +184,10 @@ G4ChordFinder::FindNextChord( const G4FieldTrack yStart,
|
||||
stepForChord = NewStep(stepTrial, dChordStep, fLastStepEstimate_Unconstrained );
|
||||
|
||||
if( ! validEndPoint ) {
|
||||
stepTrial = stepForChord;
|
||||
if( stepForChord <= oldStepTrial )
|
||||
stepTrial = stepForChord;
|
||||
else
|
||||
stepTrial *= 0.1;
|
||||
#if 0
|
||||
// Possible complementary approach:
|
||||
// Get the driver to calculate the new step size, if it is needed
|
||||
@@ -250,14 +253,27 @@ G4double G4ChordFinder::NewStep(G4double stepTrialOld,
|
||||
static G4double lastStepTrial = 1., lastDchordStep= 1.;
|
||||
|
||||
#if 1
|
||||
const G4double threshold = 1.21, multiplier = 0.9; // 0.9 < 1 / sqrt(1.21)
|
||||
|
||||
// const G4double threshold = 1.21, multiplier = 0.9; // 0.9 < 1 / sqrt(1.21)
|
||||
|
||||
stepEstimate_Unconstrained = stepTrialOld * sqrt( fDeltaChord / dChordStep );
|
||||
stepTrial = 0.98 * stepEstimate_Unconstrained;
|
||||
|
||||
if ( dChordStep < threshold * fDeltaChord ){
|
||||
stepTrial= stepTrialOld * multiplier;
|
||||
// if ( dChordStep < threshold * fDeltaChord ){
|
||||
// stepTrial= stepTrialOld * multiplier;
|
||||
// }
|
||||
if( (stepTrial < 0.001 * stepTrialOld)
|
||||
|| (stepTrial > 1000.0 * 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lastStepTrial = stepTrialOld;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ClassicalRK4.cc,v 1.4 2001/07/11 09:59:10 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
#include "G4ClassicalRK4.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4EquationOfMotion.cc,v 1.5 2001/11/09 20:39:07 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
#include "G4EquationOfMotion.hh"
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ExplicitEuler.cc,v 1.4 2001/07/11 09:59:11 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// Explicit Euler: x_1 = x_0 + h * dx_0
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FieldManager.cc,v 1.6 2001/11/28 18:44:43 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
#include "G4FieldManager.hh"
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4FieldTrack.cc,v 1.4 2001/07/11 09:59:11 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
#include "G4FieldTrack.hh"
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4HelixExplicitEuler.cc,v 1.4 2001/07/11 09:59:11 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
#include "G4HelixExplicitEuler.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4HelixHeum.cc,v 1.4 2001/07/11 09:59:12 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
#include "G4HelixHeum.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4HelixImplicitEuler.cc,v 1.4 2001/07/11 09:59:12 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
#include "G4HelixImplicitEuler.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4HelixSimpleRunge.cc,v 1.5 2001/07/11 09:59:12 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
#include "G4HelixSimpleRunge.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ImplicitEuler.cc,v 1.4 2001/07/11 09:59:12 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// Implicit Euler:
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4LineSection.cc,v 1.6 2001/12/04 15:10:01 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// typedef double G4double;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4MagErrorStepper.cc,v 1.9 2001/07/11 09:59:12 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
#include "G4MagErrorStepper.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MagHelicalStepper.cc,v 1.8 2001/07/11 09:59:12 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// $Id: G4MagHelicalStepper.cc,v 1.11 2002/01/17 08:12:03 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
#include "G4MagHelicalStepper.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
@@ -67,13 +67,13 @@ G4MagHelicalStepper::AdvanceHelix( const G4double yIn[],
|
||||
|
||||
G4double Bmag = Bfld.mag();
|
||||
const G4double *pIn = yIn+3;
|
||||
G4ThreeVector initMomentum= G4ThreeVector( pIn[0], pIn[1], pIn[2]);
|
||||
G4double momentumVal = initMomentum.mag();
|
||||
G4ThreeVector initTangent = (1.0/momentumVal) * initMomentum; // .unit();
|
||||
G4ThreeVector initVelocity= G4ThreeVector( pIn[0], pIn[1], pIn[2]);
|
||||
G4double velocityVal = initVelocity.mag();
|
||||
G4ThreeVector initTangent = (1.0/velocityVal) * initVelocity; // .unit();
|
||||
|
||||
// fCof = fUnitConstant*particleCharge/MomentumXc;
|
||||
G4double particleCharge = fPtrMagEqOfMot->FCof() / (eplus*c_light);
|
||||
G4double fCoefficient = (fUnitConstant / momentumVal) * particleCharge;
|
||||
G4double fCoefficient = (fUnitConstant / velocityVal) * particleCharge;
|
||||
|
||||
// for too small magnetic fields there is no curvature
|
||||
// (include momentum here) FIXME
|
||||
@@ -140,9 +140,9 @@ G4MagHelicalStepper::AdvanceHelix( const G4double yIn[],
|
||||
yHelix[1] = yIn[1] + positionMove.y();
|
||||
yHelix[2] = yIn[2] + positionMove.z();
|
||||
|
||||
yHelix[3] = momentumVal * endTangent.x();
|
||||
yHelix[4] = momentumVal * endTangent.y();
|
||||
yHelix[5] = momentumVal * endTangent.z();
|
||||
yHelix[3] = velocityVal * endTangent.x();
|
||||
yHelix[4] = velocityVal * endTangent.y();
|
||||
yHelix[5] = velocityVal * endTangent.z();
|
||||
|
||||
// Store and/or calculate parameters for chord distance.
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MagIntegratorDriver.cc,v 1.20 2001/11/21 16:43:16 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// $Id: G4MagIntegratorDriver.cc,v 1.25 2002/05/07 17:18:49 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
//
|
||||
@@ -30,16 +30,17 @@
|
||||
// Tracking in space dependent magnetic field
|
||||
//
|
||||
// History of major changes:
|
||||
// 7 Oct 96 V. Grichine First version
|
||||
// 28 Jan 98 W. Wander: Added ability for low order integrators
|
||||
// 30 Jan 98 J. Apostolakis: Made method parameters into instance variables
|
||||
// 8 Nov 01 J. Apostolakis: Respect minimum step in AccurateAdvance
|
||||
// 27 Jul 99 J. Apostolakis: Ensured that AccurateAdvance does not loop
|
||||
// due to very small eps & step size (precision)
|
||||
// 28 Jan 98 W. Wander: Added ability for low order integrators
|
||||
// 7 Oct 96 V. Grichine First version
|
||||
#include <math.h>
|
||||
#include "G4ios.hh"
|
||||
#include "G4MagIntegratorDriver.hh"
|
||||
#include "G4FieldTrack.hh"
|
||||
#include "geomdefs.hh" // for kCarTolerance
|
||||
#include "g4std/iomanip"
|
||||
|
||||
// Stepsize can increase by no more than 5.0
|
||||
// and decrease by no more than 1/10. = 0.1
|
||||
@@ -49,7 +50,7 @@ const G4double G4MagInt_Driver::max_stepping_decrease = 0.1;
|
||||
|
||||
// The (default) maximum number of steps is Base divided by the order of Stepper
|
||||
//
|
||||
const G4int G4MagInt_Driver::fMaxStepBase = 500; // Was 5000
|
||||
const G4int G4MagInt_Driver::fMaxStepBase = 250; // Was 5000
|
||||
|
||||
// Constructor
|
||||
//
|
||||
@@ -62,6 +63,9 @@ G4MagInt_Driver::G4MagInt_Driver( G4double hminimum,
|
||||
RenewStepperAndAdjust( pItsStepper );
|
||||
hminimum_val= hminimum;
|
||||
fMaxNoSteps = fMaxStepBase / pIntStepper->IntegratorOrder();
|
||||
#ifdef G4DEBUG_FIELD
|
||||
fVerboseLevel=2;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Destructor
|
||||
@@ -92,9 +96,9 @@ G4MagInt_Driver::AccurateAdvance(G4FieldTrack& y_current,
|
||||
|
||||
G4int no_warnings=0;
|
||||
#ifdef G4DEBUG_FIELD
|
||||
static G4int dbg=0;
|
||||
dbg=1;
|
||||
fVerboseLevel=2;
|
||||
static G4int dbg=1;
|
||||
G4double ySubStepStart[G4FieldTrack::ncompSVEC];
|
||||
G4FieldTrack yFldTrkStart(y_current);
|
||||
#endif
|
||||
|
||||
// G4double yscal[ncompSVEC];
|
||||
@@ -129,19 +133,24 @@ G4MagInt_Driver::AccurateAdvance(G4FieldTrack& y_current,
|
||||
|
||||
do{
|
||||
G4ThreeVector StartPos( y[0], y[1], y[2] );
|
||||
# ifdef G4DEBUG_FIELD
|
||||
for(i=0;i<nvar;i++) ySubStepStart[i] = y[i] ;
|
||||
yFldTrkStart.LoadFromArray(y);
|
||||
yFldTrkStart.SetCurveLength(x);
|
||||
# endif
|
||||
|
||||
pIntStepper->RightHandSide( y, dydx );
|
||||
|
||||
if( x+h > x2 ) {
|
||||
h = x2 - x ; // When stepsize overshoots, decrease it!
|
||||
}
|
||||
if( h < eps * hstep) {
|
||||
lastStep = true; // Ensure that this must be the last step
|
||||
// because otherwise numerical (im)precision
|
||||
// could otherwise force lots of small last steps.
|
||||
h = x2 - x ; // When stepsize overshoots, decrease it!
|
||||
if( h < eps * hstep) {
|
||||
lastStep = true; // Ensure that this must be the last step
|
||||
// - since otherwise numerical (im)precision
|
||||
// could force lots of small last steps
|
||||
}
|
||||
}
|
||||
|
||||
// static G4int nStpPr=50; // For debug printing of integrations with many steps
|
||||
static G4int nStpPr=50; // For debug printing of integrations with many steps
|
||||
|
||||
// Perform the Integration
|
||||
//
|
||||
@@ -150,41 +159,44 @@ G4MagInt_Driver::AccurateAdvance(G4FieldTrack& y_current,
|
||||
OneGoodStep(y,dydx,x,h,eps,hdid,hnext) ;
|
||||
//--------------------------------------
|
||||
lastStepSucceeded= (hdid == h);
|
||||
# ifdef G4DEBUG_FIELD
|
||||
if(dbg>2) PrintStatus( ySubStepStart, x1, y, x, h, nstp); // Only
|
||||
# endif
|
||||
}else{
|
||||
#if 0
|
||||
OneGoodStep(y,dydx,x,h,2*eps,hdid,hnext) ;
|
||||
//--------------------------------------
|
||||
lastStepSucceeded= (hdid == h);
|
||||
#else
|
||||
G4FieldTrack yFldTrk( G4ThreeVector(0,0,0),
|
||||
G4ThreeVector(0,0,0), 0., 0., 0., 0. );
|
||||
G4double dchord_step, dyerr, dyerr_len; // Must figure what to do with these
|
||||
yFldTrk.LoadFromArray(y);
|
||||
yFldTrk.SetCurveLength( x );
|
||||
// G4double s_start = yFldTrk.GetCurveLength();
|
||||
|
||||
QuickAdvance( yFldTrk, dydx, h, dchord_step, dyerr_len );
|
||||
//-----------------------------------------------------
|
||||
|
||||
# ifdef G4DEBUG_FIELD
|
||||
if(dbg>1) OneGoodStep(y,dydx,x,h,2*eps,hdid,hnext) ;
|
||||
if(dbg>1) PrintStatus( ystart, x1, y, x, h, -nstp);
|
||||
// if(dbg>1) OneGoodStep(y,dydx,x,h,2*eps,hdid,hnext) ;
|
||||
// if(dbg>1) PrintStatus( ystart, x1, y, x, h, -nstp);
|
||||
# endif
|
||||
yFldTrk.DumpToArray(y);
|
||||
if(dbg>1) PrintStatus( ystart, x1, y, x, h, nstp); // Only this
|
||||
# ifdef G4DEBUG_FIELD
|
||||
if(dbg>1) PrintStatus( ySubStepStart, x1, y, x, h, nstp); // Only this
|
||||
# endif
|
||||
dyerr = dyerr_len / hstep;
|
||||
dyerr = dyerr_len / h; // was dyerr_len / hstep;
|
||||
hdid= h;
|
||||
x += hdid;
|
||||
// Compute suggested new step
|
||||
hnext= ComputeNewStepSize( dyerr/eps, h);
|
||||
// .. hnext= ComputeNewStepSize_WithinLimits( dyerr/eps, h);
|
||||
lastStepSucceeded= (dyerr<= eps);
|
||||
#endif
|
||||
}
|
||||
// #ifdef G4DEBUG_FIELD
|
||||
|
||||
if(lastStepSucceeded) noFullIntegr++ ; else noSmallIntegr++ ;
|
||||
G4ThreeVector EndPos( y[0], y[1], y[2] );
|
||||
|
||||
#ifdef G4DEBUG_FIELD
|
||||
if(nstp>nStpPr) {
|
||||
G4cout << "hdid=" << hdid << "hnext =" << hnext << " " << endl;
|
||||
PrintStatus( ystart, x1, y, x, h, nstp==nStpPr ? -nstp: nstp);
|
||||
G4cout << "hdid=" << G4std::setw(12) << hdid << " "
|
||||
<< "hnext=" << G4std::setw(12) << hnext << " " << endl;
|
||||
PrintStatus( ystart, x1, y, x, h, (nstp==nStpPr) ? -nstp: nstp);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -199,7 +211,7 @@ G4MagInt_Driver::AccurateAdvance(G4FieldTrack& y_current,
|
||||
WarnEndPointTooFar ( endPointDist, hdid, eps, dbg );
|
||||
G4cerr << " Total steps: bad" << noBadSteps << " good " << noGoodSteps << endl;
|
||||
// G4cerr << "Mid:EndPtFar> ";
|
||||
PrintStatus( ystart, x1, y, x, hstep, no_warnings?nstp:-nstp);
|
||||
if(dbg>1) PrintStatus( ystart, x1, y, x, hstep, no_warnings?nstp:-nstp);
|
||||
// Potentially add as arguments: <dydx> - as Initial Force
|
||||
#endif
|
||||
no_warnings++;
|
||||
@@ -221,7 +233,7 @@ G4MagInt_Driver::AccurateAdvance(G4FieldTrack& y_current,
|
||||
// Issue WARNING
|
||||
WarnSmallStepSize( hnext, hstep, h, x-x1, nstp );
|
||||
// G4cerr << "Mid:SmallStep> ";
|
||||
PrintStatus( ystart, x1, y, x, hstep, no_warnings?nstp:-nstp);
|
||||
if(dbg>1) PrintStatus( ystart, x1, y, x, hstep, no_warnings?nstp:-nstp);
|
||||
no_warnings++;
|
||||
}
|
||||
#endif
|
||||
@@ -255,7 +267,7 @@ G4MagInt_Driver::AccurateAdvance(G4FieldTrack& y_current,
|
||||
succeeded = false;
|
||||
#ifdef G4DEBUG_FIELD
|
||||
WarnTooManyStep( x1, x2, x ); // Issue WARNING
|
||||
PrintStatus( yEnd, x1, y, x, hstep, -nstp);
|
||||
if( dbg>1) PrintStatus( yEnd, x1, y, x, hstep, -nstp);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -596,7 +608,7 @@ void G4MagInt_Driver::PrintStatus( const G4double* StartArr,
|
||||
PrintStatus(StartFT, CurrentFT, requestStep, subStepNo );
|
||||
}
|
||||
|
||||
#include "g4std/iomanip"
|
||||
|
||||
|
||||
void G4MagInt_Driver::PrintStatus(
|
||||
const G4FieldTrack& StartFT,
|
||||
@@ -615,9 +627,12 @@ void G4MagInt_Driver::PrintStatus(
|
||||
const G4ThreeVector CurrentPosition= CurrentFT.GetPosition();
|
||||
const G4ThreeVector CurrentUnitVelocity= CurrentFT.GetMomentumDir();
|
||||
|
||||
G4double DotStartCurrentVeloc= StartUnitVelocity.dot(CurrentUnitVelocity);
|
||||
|
||||
G4double step_len= CurrentFT.GetCurveLength()
|
||||
- StartFT.GetCurveLength();
|
||||
|
||||
G4double subStepSize = step_len;
|
||||
|
||||
if( (subStepNo <= 0) && (verboseLevel <= 3) )
|
||||
{
|
||||
subStepNo = - subStepNo; // To allow printing banner
|
||||
@@ -630,22 +645,28 @@ void G4MagInt_Driver::PrintStatus(
|
||||
<< G4std::setw( 9) << "X(mm)" << " "
|
||||
<< G4std::setw( 9) << "Y(mm)" << " "
|
||||
<< G4std::setw( 9) << "Z(mm)" << " "
|
||||
<< G4std::setw( 7) << " N_x " << " "
|
||||
<< G4std::setw( 7) << " N_y " << " "
|
||||
<< G4std::setw( 7) << " N_z " << " "
|
||||
<< G4std::setw( 8) << " N_x " << " "
|
||||
<< G4std::setw( 8) << " N_y " << " "
|
||||
<< G4std::setw( 8) << " N_z " << " "
|
||||
<< G4std::setw( 7) << " N^2-1 " << " "
|
||||
<< G4std::setw(10) << " N(0).N " << " "
|
||||
<< G4std::setw( 7) << "KinEner " << " "
|
||||
<< G4std::setw( 9) << "StepLen" << " " // Add the Sub-step ??
|
||||
<< G4std::setw(12) << "Track-l" << " " // Add the Sub-step ??
|
||||
<< G4std::setw(12) << "Step-len" << " "
|
||||
<< G4std::setw(12) << "Step-len" << " "
|
||||
<< G4std::setw( 9) << "ReqStep" << " "
|
||||
<< G4endl;
|
||||
|
||||
PrintStat_Aux( StartFT, requestStep, 0., 0);
|
||||
PrintStat_Aux( StartFT, requestStep, 0.,
|
||||
0, 0.0, 1.0);
|
||||
//*************
|
||||
}
|
||||
|
||||
if( verboseLevel <= 3 )
|
||||
{
|
||||
G4cout.precision(noPrecision);
|
||||
PrintStat_Aux( CurrentFT, requestStep, step_len, subStepNo);
|
||||
PrintStat_Aux( CurrentFT, requestStep, step_len,
|
||||
subStepNo, subStepSize, DotStartCurrentVeloc );
|
||||
//*************
|
||||
}
|
||||
|
||||
@@ -669,7 +690,9 @@ void G4MagInt_Driver::PrintStat_Aux(
|
||||
const G4FieldTrack& aFieldTrack,
|
||||
G4double requestStep,
|
||||
G4double step_len,
|
||||
G4int subStepNo)
|
||||
G4int subStepNo,
|
||||
G4double subStepSize,
|
||||
G4double dotVeloc_StartCurr)
|
||||
{
|
||||
const G4ThreeVector Position= aFieldTrack.GetPosition();
|
||||
const G4ThreeVector UnitVelocity= aFieldTrack.GetMomentumDir();
|
||||
@@ -678,15 +701,37 @@ void G4MagInt_Driver::PrintStat_Aux(
|
||||
G4cout << G4std::setw( 5) << subStepNo << " ";
|
||||
else
|
||||
G4cout << G4std::setw( 5) << "Start" << " ";
|
||||
G4cout << G4std::setw( 7) << aFieldTrack.GetCurveLength();
|
||||
G4double curveLen= aFieldTrack.GetCurveLength();
|
||||
G4cout << G4std::setw( 7) << curveLen;
|
||||
G4cout << G4std::setw( 9) << Position.x() << " "
|
||||
<< G4std::setw( 9) << Position.y() << " "
|
||||
<< G4std::setw( 9) << Position.z() << " "
|
||||
<< G4std::setw( 7) << UnitVelocity.x() << " "
|
||||
<< G4std::setw( 7) << UnitVelocity.y() << " "
|
||||
<< G4std::setw( 7) << UnitVelocity.z() << " ";
|
||||
<< G4std::setw( 8) << UnitVelocity.x() << " "
|
||||
<< G4std::setw( 8) << UnitVelocity.y() << " "
|
||||
<< G4std::setw( 8) << UnitVelocity.z() << " ";
|
||||
G4int oldprec= G4cout.precision(3);
|
||||
G4cout << G4std::setw( 7) << UnitVelocity.mag2()-1.0 << " ";
|
||||
G4cout.precision(6);
|
||||
G4cout << G4std::setw(10) << dotVeloc_StartCurr << " ";
|
||||
G4cout.precision(oldprec);
|
||||
G4cout << G4std::setw( 7) << aFieldTrack.GetKineticEnergy();
|
||||
G4cout << G4std::setw( 9) << step_len << " ";
|
||||
G4cout << G4std::setw(12) << step_len << " ";
|
||||
|
||||
static G4double oldCurveLength= 0.0;
|
||||
static G4double oldSubStepLength= 0.0;
|
||||
static int oldSubStepNo= -1;
|
||||
|
||||
G4double subStep_len=0.0;
|
||||
if( curveLen > oldCurveLength )
|
||||
subStep_len= curveLen - oldCurveLength;
|
||||
else if (subStepNo == oldSubStepNo)
|
||||
subStep_len= oldSubStepLength;
|
||||
// else subStepLen_NotAvail;
|
||||
oldCurveLength= curveLen;
|
||||
oldSubStepLength= subStep_len;
|
||||
|
||||
G4cout << G4std::setw(12) << subStep_len << " ";
|
||||
G4cout << G4std::setw(12) << subStepSize << " ";
|
||||
if( requestStep != -1.0 )
|
||||
G4cout << G4std::setw( 9) << requestStep << " ";
|
||||
else
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4MagIntegratorStepper.cc,v 1.6 2001/07/11 09:59:12 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// $Id: G4MagIntegratorStepper.cc,v 1.7 2002/05/07 16:11:59 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
#include "G4MagIntegratorStepper.hh"
|
||||
|
||||
@@ -40,7 +40,3 @@ G4MagIntegratorStepper::~G4MagIntegratorStepper()
|
||||
{
|
||||
}
|
||||
|
||||
void G4MagIntegratorStepper::RightHandSide( const double y[], double dydx[] )
|
||||
{
|
||||
fEquation_Rhs-> RightHandSide(y, dydx);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Mag_EqRhs.cc,v 1.7 2001/07/11 09:59:12 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// This is the standard right-hand side for equation of motion
|
||||
// in a pure Magnetic Field .
|
||||
|
||||
@@ -57,20 +57,19 @@ G4Mag_SpinEqRhs::EvaluateRhsGivenB( const G4double y[],
|
||||
const G4double B[3],
|
||||
G4double dydx[] ) const
|
||||
{
|
||||
G4double velocity_mag_square = sqr(y[3]) + sqr(y[4]) + sqr(y[5]);
|
||||
G4double inv_velocity_magnitude = 1.0 / sqrt( velocity_mag_square );
|
||||
G4double momentum_mag_square = sqr(y[3]) + sqr(y[4]) + sqr(y[5]);
|
||||
G4double inv_momentum_magnitude = 1.0 / sqrt( momentum_mag_square );
|
||||
G4double cof = FCof()*inv_momentum_magnitude;
|
||||
|
||||
dydx[0] = y[3] * inv_velocity_magnitude; // (d/ds)x = Vx/V
|
||||
dydx[1] = y[4] * inv_velocity_magnitude; // (d/ds)y = Vy/V
|
||||
dydx[2] = y[5] * inv_velocity_magnitude; // (d/ds)z = Vz/V
|
||||
dydx[3] = FCof()*(y[4]*B[2] - y[5]*B[1]) ; // Ax = a*(Vy*Bz - Vz*By)
|
||||
dydx[4] = FCof()*(y[5]*B[0] - y[3]*B[2]) ; // Ay = a*(Vz*Bx - Vx*Bz)
|
||||
dydx[5] = FCof()*(y[3]*B[1] - y[4]*B[0]) ; // Az = a*(Vx*By - Vy*Bx)
|
||||
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*(y[4]*B[2] - y[5]*B[1]) ; // Ax = a*(Vy*Bz - Vz*By)
|
||||
dydx[4] = cof*(y[5]*B[0] - y[3]*B[2]) ; // Ay = a*(Vz*Bx - Vx*Bz)
|
||||
dydx[5] = cof*(y[3]*B[1] - y[4]*B[0]) ; // Az = a*(Vx*By - Vy*Bx)
|
||||
|
||||
G4ThreeVector u;
|
||||
u.setX(inv_velocity_magnitude*y[3]);
|
||||
u.setY(inv_velocity_magnitude*y[4]);
|
||||
u.setZ(inv_velocity_magnitude*y[5]);
|
||||
G4ThreeVector u(y[3], y[4], y[5]);
|
||||
u *= inv_momentum_magnitude;
|
||||
|
||||
G4ThreeVector BField(B[0],B[1],B[2]);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Mag_UsualEqRhs.cc,v 1.4 2001/07/11 09:59:13 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
// This is the standard right-hand side for equation of motion.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4RKG3_Stepper.cc,v 1.6 2001/07/11 09:59:13 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
#include "G4RKG3_Stepper.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4SimpleHeum.cc,v 1.5 2001/07/11 09:59:13 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// Simple Heum:
|
||||
// x_1 = x_0 + h *
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4SimpleRunge.cc,v 1.4 2001/07/11 09:59:13 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
// Simple Runge:
|
||||
//
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UniformElectricField.cc,v 1.6 2001/12/04 17:35:54 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UniformMagField.cc,v 1.5 2001/11/08 17:32:21 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-04-00 $
|
||||
// GEANT4 tag $Name: geant4-04-01 $
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user