Hall-D Software
alpha
|
DMagneticFieldStepper class. More...
#include <DMagneticFieldStepper.h>
Private Member Functions | |
void | CalcDirs (double *Bvals=NULL) |
Private Attributes | |
const DMagneticFieldMap * | bfield |
pointer to magnetic field map More... | |
double | stepsize |
maximum distance(cm) to move particle when Step() is called More... | |
double | last_stepsize |
stepsize (cm) used for last step More... | |
double | q |
electric charge in units of e More... | |
DVector3 | pos |
current position of particle More... | |
DVector3 | mom |
current location of particle More... | |
DVector3 | start_pos |
starting position of track More... | |
DVector3 | start_mom |
starting momentum of track More... | |
DVector3 | B |
double | Ro |
double | Rp |
double | cos_theta |
double | sin_theta |
DVector3 | xdir |
DVector3 | ydir |
DVector3 | zdir |
DMagneticFieldStepper class.
This class will step a particle track through a magnetic field. It has methods to find the point on the track which comes closest to a specified point in space.
Definition at line 22 of file DMagneticFieldStepper.h.
DMagneticFieldStepper::DMagneticFieldStepper | ( | const DMagneticFieldMap * | map, |
double | q = 1.0 |
||
) |
Definition at line 18 of file DMagneticFieldStepper.cc.
DMagneticFieldStepper::DMagneticFieldStepper | ( | const DMagneticFieldMap * | map, |
double | q, | ||
const DVector3 * | x, | ||
const DVector3 * | p | ||
) |
Definition at line 31 of file DMagneticFieldStepper.cc.
References x.
DMagneticFieldStepper::~DMagneticFieldStepper | ( | ) |
Definition at line 44 of file DMagneticFieldStepper.cc.
|
private |
Calculate the directions of the "natural coordinates" (aka reference trajectory coordinate system) in the lab frame using the current momentum and magnetic field at the current position. The results are left in the private member fields, copies of which may be obtained by a subsequent call to the GetDirs(...) and GetRo() methods.
Definition at line 87 of file DMagneticFieldStepper.cc.
References qBr2p.
bool DMagneticFieldStepper::DistToPlane | ( | DVector3 & | pos, |
const DVector3 & | origin, | ||
const DVector3 & | norm | ||
) |
Definition at line 517 of file DMagneticFieldStepper.cc.
bool DMagneticFieldStepper::DistToRadius | ( | DVector3 & | pos, |
double | R | ||
) |
Definition at line 710 of file DMagneticFieldStepper.cc.
double DMagneticFieldStepper::FastStep | ( | double | stepsize = 0.0 | ) |
Definition at line 160 of file DMagneticFieldStepper.cc.
Referenced by DReferenceTrajectory::FastSwim(), and DReferenceTrajectory::FastSwimForHitSelection().
|
inline |
Definition at line 38 of file DMagneticFieldStepper.h.
References B.
Referenced by DReferenceTrajectory::FastSwim(), DReferenceTrajectory::FastSwimForHitSelection(), and DReferenceTrajectory::Swim().
|
inline |
Definition at line 41 of file DMagneticFieldStepper.h.
References q.
Definition at line 348 of file DMagneticFieldStepper.cc.
Referenced by DReferenceTrajectory::FastSwim(), DReferenceTrajectory::FastSwimForHitSelection(), and DReferenceTrajectory::Swim().
|
inline |
|
inline |
Definition at line 39 of file DMagneticFieldStepper.h.
References mom.
Referenced by DReferenceTrajectory::BrentsAlgorithm(), DReferenceTrajectory::FindPOCAtoLine(), and DReferenceTrajectory::IntersectTracks().
|
inline |
Definition at line 40 of file DMagneticFieldStepper.h.
References pos.
Definition at line 42 of file DMagneticFieldStepper.h.
Referenced by DReferenceTrajectory::FastSwim(), DReferenceTrajectory::FastSwimForHitSelection(), and DReferenceTrajectory::Swim().
|
inline |
Definition at line 48 of file DMagneticFieldStepper.h.
References Ro.
Referenced by DReferenceTrajectory::FastSwim(), DReferenceTrajectory::FastSwimForHitSelection(), and DReferenceTrajectory::Swim().
|
inline |
Definition at line 50 of file DMagneticFieldStepper.h.
References stepsize.
|
inline |
Definition at line 33 of file DMagneticFieldStepper.h.
References q.
Referenced by DTrackCandidate_factory_FDCCathodes::GetTrackMatch().
jerror_t DMagneticFieldStepper::SetMagneticFieldMap | ( | const DMagneticFieldMap * | map | ) |
Definition at line 66 of file DMagneticFieldStepper.cc.
jerror_t DMagneticFieldStepper::SetStartingParams | ( | double | q, |
const DVector3 * | x, | ||
const DVector3 * | p | ||
) |
Definition at line 52 of file DMagneticFieldStepper.cc.
References x.
Referenced by DReferenceTrajectory::FastSwim(), DReferenceTrajectory::FastSwimForHitSelection(), and DReferenceTrajectory::Swim().
jerror_t DMagneticFieldStepper::SetStepSize | ( | double | step | ) |
Definition at line 76 of file DMagneticFieldStepper.cc.
Referenced by DTrackCandidate_factory_FDCCathodes::brun(), DReferenceTrajectory::FastSwim(), DReferenceTrajectory::FastSwimForHitSelection(), and DReferenceTrajectory::Swim().
double DMagneticFieldStepper::Step | ( | DVector3 * | newpos = NULL , |
DVector3 * | B = NULL , |
||
double | stepsize = 0.0 |
||
) |
Definition at line 197 of file DMagneticFieldStepper.cc.
References grkuta_().
Referenced by DReferenceTrajectory::BrentsAlgorithm(), DReferenceTrajectory::FastSwim(), DReferenceTrajectory::FindPOCAtoLine(), DReferenceTrajectory::IntersectTracks(), and DReferenceTrajectory::Swim().
bool DMagneticFieldStepper::SwimToPlane | ( | DVector3 & | pos, |
DVector3 & | mom, | ||
const DVector3 & | origin, | ||
const DVector3 & | norm, | ||
double * | pathlen = NULL |
||
) |
Swim the particle from the given position/momentum to the plane defined by origin and norm. "origin" should define a point somewhere in the plane and norm a vector normal to the plane. The charge of the particle is set by the constructor or last call to SetStartingParameters(...).
If a non-NULL value is passed for pathlen then the pathlength of the track from the given starting position to the intersection point is given.
THE FOLLOWING FEATURE IS CURRENTLY DISABLED! Note that a check is made that the particle is initially going toward the plane. If the particle appears to be going away from the plane, then the momentum is temporarily flipped as well as the charge so that the particle is swum backwards.
Particles will only be swum a distance of MAX_SWIM_DIST (currently hardwired to 20 meters) along their trajectory before returning boolean true indicating failure to intersect the plane.
On success, a value of false is returned and the values in pos and mom will be updated with the position and momentum at the point of intersection with the plane.
Definition at line 358 of file DMagneticFieldStepper.cc.
References alpha, MAX_SWIM_DIST, and sqrt().
Referenced by DTrackCandidate_factory_FDCCathodes::GetTrackMatch().
Routine to find the position-of-closest approach of a trajectory to the beam line. Upon entry, q, pos, and mom contain a point on a track pointing away from the beamline. (Beamline is assumed to be along z at x=y=0). At return, the pos and mom vectors will contain the position and momentum at the POCA. Upon success, a boolean "false" is returned. If the routine fails, then a boolean "true" is returned and the values of pos and mom are left to what they were upon entry.
Definition at line 526 of file DMagneticFieldStepper.cc.
bool DMagneticFieldStepper::SwimToRadius | ( | DVector3 & | pos, |
DVector3 & | mom, | ||
double | R, | ||
double * | pathlen = NULL |
||
) |
Swim the particle from the point specified by the given position and momentum until it crosses the specified radius R as measured from the beamline.
If a non-NULL value is passed for pathlen then the pathlength of the track from the given starting position to the intersection point is given.
Particles will only be swum a distance of MAX_SWIM_DIST (currently hardwired to 20 meters) along their trajectory before returning boolean true indicating failure to intersect the radius. This can happen if the particle's momentum is too low to reach the radius.
On success, a value of false is returned and the values in pos and mom will be updated with the position and momentum at the point of intersection with the radius.
Definition at line 626 of file DMagneticFieldStepper.cc.
References alpha, MAX_SWIM_DIST, and sqrt().
|
private |
Definition at line 63 of file DMagneticFieldStepper.h.
Referenced by GetBField().
|
private |
pointer to magnetic field map
Definition at line 55 of file DMagneticFieldStepper.h.
|
private |
Definition at line 65 of file DMagneticFieldStepper.h.
|
private |
stepsize (cm) used for last step
Definition at line 57 of file DMagneticFieldStepper.h.
|
private |
current location of particle
Definition at line 60 of file DMagneticFieldStepper.h.
Referenced by Getdz_dphi(), GetMomentum(), and GetPosMom().
|
private |
current position of particle
Definition at line 59 of file DMagneticFieldStepper.h.
Referenced by GetPosition(), and GetPosMom().
|
private |
electric charge in units of e
Definition at line 58 of file DMagneticFieldStepper.h.
Referenced by GetCharge(), and SetCharge().
|
private |
Definition at line 64 of file DMagneticFieldStepper.h.
Referenced by Getdz_dphi(), and GetRo().
|
private |
Definition at line 64 of file DMagneticFieldStepper.h.
|
private |
Definition at line 65 of file DMagneticFieldStepper.h.
|
private |
starting momentum of track
Definition at line 62 of file DMagneticFieldStepper.h.
|
private |
starting position of track
Definition at line 61 of file DMagneticFieldStepper.h.
|
private |
maximum distance(cm) to move particle when Step() is called
Definition at line 56 of file DMagneticFieldStepper.h.
Referenced by GetStepSize().
|
private |
Definition at line 67 of file DMagneticFieldStepper.h.
|
private |
Definition at line 67 of file DMagneticFieldStepper.h.
Referenced by Getdz_dphi().
|
private |
Definition at line 67 of file DMagneticFieldStepper.h.
Referenced by Getdz_dphi().