cnuphys.swim
Class Swimmer

java.lang.Object
  extended by cnuphys.swim.Swimmer
All Implemented Interfaces:
ISwimmer

public class Swimmer
extends java.lang.Object
implements ISwimmer

Handles the swimming of a particle.

Author:
heddle

Constructor Summary
Swimmer(cnuphys.magfield.IField field)
          Swimmer constructor
 
Method Summary
 void clearAllTrajectoriesNoViewRefresh()
          Clears all trajectories and wont cause all event views to be refreshed.
 java.util.Vector<SwimTrajectory> getTrajectories()
          Get all generated trajectories
 boolean isZeroMagneticField()
           
 void setZeroMagneticField(boolean zeroMagneticField)
           
 boolean stopSwim(double t, double[] u)
          Given the current value of the integration, should we stop? This allows the integration to stop, for example, if some distance from the origin has been exceeded.
 SwimTrajectory swim(LundId lundId, double xo, double yo, double zo, double momentum, double theta, double phi, double rmax, double pathmax)
          Swims a Lund particle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Swimmer

public Swimmer(cnuphys.magfield.IField field)
Swimmer constructor

Parameters:
field - interface into a magnetic field
Method Detail

swim

public SwimTrajectory swim(LundId lundId,
                           double xo,
                           double yo,
                           double zo,
                           double momentum,
                           double theta,
                           double phi,
                           double rmax,
                           double pathmax)
Swims a Lund particle

Specified by:
swim in interface ISwimmer
Parameters:
lundId - the particle to swim
xo - the x vertex position in cm
yo - the y vertex position in cm
zo - the z vertex position in cm
momentum - initial momentum in GeV/c
theta - initial polar angle in degrees
phi - initial azimuthal angle in degrees
rmax - max radial coordinate (then integration stops) in meters
pathmax - max pathlength (then integration stops) in meters
Returns:
the trajectory of the particle

stopSwim

public boolean stopSwim(double t,
                        double[] u)
Given the current value of the integration, should we stop? This allows the integration to stop, for example, if some distance from the origin has been exceeded. It won't be precise, because the check may not happen on every step, but it should be close.

Specified by:
stopSwim in interface ISwimmer
Parameters:
t - the current value of the independent variable
u - the current state vector
Returns:
true if we should stop now (prematurely).

getTrajectories

public java.util.Vector<SwimTrajectory> getTrajectories()
Get all generated trajectories

Returns:
the generated trajectories

clearAllTrajectoriesNoViewRefresh

public void clearAllTrajectoriesNoViewRefresh()
Clears all trajectories and wont cause all event views to be refreshed.


isZeroMagneticField

public boolean isZeroMagneticField()
Returns:
the zeroMagneticField

setZeroMagneticField

public void setZeroMagneticField(boolean zeroMagneticField)
Parameters:
zeroMagneticField - the zeroMagneticField to set