[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Track Swimming methods
Hi All,
For those who are interested, I just committed some changes to the
DMagneticFieldStepper class. I have filled in the SwimToRadius method
which until now, was an empty place holder (thanks to Matt B. for
motivating this). At the same time, I added an additional, optional
argument to both SwimToPlane and SwimToRadius so that one can obtain the
path length of the track on return.
Both of these methods are not exact, but should be good to better
than 1-2 mm.
Below is an example of using the SwimToRadius method. Let me know if
you have any questions or problems.
Regards,
-David
// Instantiate DApplication object (if in a DEventProcessor, use
loop->GetDApplication())
DApplication app(narg, argv);
// Create stepper object using the standard field map
DMagneticFieldStepper *stepper = new
DMagneticFieldStepper(app.GetBfield());
// Set starting position/momentum
DVector3 pos(0.0, 0.0, 65.0); // center of target
DVector3 mom;
mom.SetMagThetaPhi(0.6, 60.0/57.3, 0.0); // 600MeV/c at 60 degrees
// Swim to a radius
double pathlength;
stepper->SwimToRadius(pos, mom, 65.0, &pathlength);
pos.Print();
cout<<"pathlength="<<pathlength<<" r="<<pos.Perp()<<"
z="<<pos.Z()<<endl;
--
------------------------------------------------------------------------
David Lawrence Ph.D.
Staff Scientist Office: (757)269-5567 [[[ [ [ [
Jefferson Lab Pager: (757)584-5567 [ [ [ [ [ [
http://www.jlab.org/~davidl davidl@jlab.org [[[ [[ [[ [[[
------------------------------------------------------------------------