LISTSERV mailing list manager LISTSERV 16.5

Help for HPS-SVN Archives


HPS-SVN Archives

HPS-SVN Archives


HPS-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

HPS-SVN Home

HPS-SVN Home

HPS-SVN  September 2015

HPS-SVN September 2015

Subject:

r3594 - /java/trunk/tracking/src/main/java/org/hps/recon/tracking/TrackUtils.java

From:

[log in to unmask]

Reply-To:

Notification of commits to the hps svn repository <[log in to unmask]>

Date:

Sat, 12 Sep 2015 00:14:34 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (159 lines)

Author: [log in to unmask]
Date: Fri Sep 11 17:14:31 2015
New Revision: 3594

Log:
use TrackState for helper function.

Modified:
    java/trunk/tracking/src/main/java/org/hps/recon/tracking/TrackUtils.java

Modified: java/trunk/tracking/src/main/java/org/hps/recon/tracking/TrackUtils.java
 =============================================================================
--- java/trunk/tracking/src/main/java/org/hps/recon/tracking/TrackUtils.java	(original)
+++ java/trunk/tracking/src/main/java/org/hps/recon/tracking/TrackUtils.java	Fri Sep 11 17:14:31 2015
@@ -100,45 +100,88 @@
 
     // ==========================================================================
     // Helper functions for track parameters and commonly used derived variables
+    
+    // first set are there for backwards comp.
+    
     public static double getPhi(Track track, Hep3Vector position) {
+        return getPhi(track.getTrackStates().get(0), position);
+    }
+
+    public static double getX0(Track track) {
+        return getX0(track.getTrackStates().get(0));
+    }
+
+    public static double getR(Track track) {
+        return getR(track.getTrackStates().get(0));
+    }
+
+    public static double getY0(Track track) {
+        return getY0(track.getTrackStates().get(0));
+    }
+
+    public static double getDoca(Track track) {
+        return getDoca(track.getTrackStates().get(0));
+    }
+
+    public static double getPhi0(Track track) {
+        return getPhi0(track.getTrackStates().get(0));
+    }
+
+    public static double getZ0(Track track) {
+        return getZ0(track.getTrackStates().get(0));
+    }
+
+    public static double getTanLambda(Track track) {
+        return getTanLambda(track.getTrackStates().get(0));
+    }
+
+    public static double getSinTheta(Track track) {
+        return 1 / Math.sqrt(1 + Math.pow(getTanLambda(track), 2));
+    }
+
+    public static double getCosTheta(Track track) {
+        return getTanLambda(track) / Math.sqrt(1 + Math.pow(getTanLambda(track), 2));
+    }
+    
+    public static double getPhi(TrackState track, Hep3Vector position) {
         double x = Math.sin(getPhi0(track)) - (1 / getR(track)) * (position.x() - getX0(track));
         double y = Math.cos(getPhi0(track)) + (1 / getR(track)) * (position.y() - getY0(track));
         return Math.atan2(x, y);
     }
-
-    public static double getX0(Track track) {
+    
+    public static double getX0(TrackState track) {
         return -1 * getDoca(track) * Math.sin(getPhi0(track));
     }
 
-    public static double getR(Track track) {
-        return 1.0 / track.getTrackStates().get(0).getOmega();
-    }
-
-    public static double getY0(Track track) {
+    public static double getR(TrackState track) {
+        return 1.0 / track.getOmega();
+    }
+
+    public static double getY0(TrackState track) {
         return getDoca(track) * Math.cos(getPhi0(track));
     }
 
-    public static double getDoca(Track track) {
-        return track.getTrackStates().get(0).getD0();
-    }
-
-    public static double getPhi0(Track track) {
-        return track.getTrackStates().get(0).getPhi();
-    }
-
-    public static double getZ0(Track track) {
-        return track.getTrackStates().get(0).getZ0();
-    }
-
-    public static double getTanLambda(Track track) {
-        return track.getTrackStates().get(0).getTanLambda();
-    }
-
-    public static double getSinTheta(Track track) {
+    public static double getDoca(TrackState track) {
+        return track.getD0();
+    }
+
+    public static double getPhi0(TrackState track) {
+        return track.getPhi();
+    }
+
+    public static double getZ0(TrackState track) {
+        return track.getZ0();
+    }
+
+    public static double getTanLambda(TrackState track) {
+        return track.getTanLambda();
+    }
+
+    public static double getSinTheta(TrackState track) {
         return 1 / Math.sqrt(1 + Math.pow(getTanLambda(track), 2));
     }
 
-    public static double getCosTheta(Track track) {
+    public static double getCosTheta(TrackState track) {
         return getTanLambda(track) / Math.sqrt(1 + Math.pow(getTanLambda(track), 2));
     }
 
@@ -235,16 +278,24 @@
     }
 
     /**
+     * Extrapolate track to given position. For backwards compatibility.
+     *
+     * @param track - to be extrapolated
+     * @param z
+     * @return
+     */
+    public static Hep3Vector extrapolateTrack(Track track, double z) {
+        return extrapolateTrack(track.getTrackStates().get(0),z);
+    }
+    
+    /**
      * Extrapolate track to given position.
      *
-     * @param helix - to be extrapolated
+     * @param track - to be extrapolated
      * @param z
-     * @param useMap
-     * @param track - position along the x-axis of the helix in lcsim
-     * coordiantes
      * @return
      */
-    public static Hep3Vector extrapolateTrack(Track track, double z) {
+    public static Hep3Vector extrapolateTrack(TrackState track, double z) {
 
         Hep3Vector trackPosition;
         double dz;

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

November 2017
August 2017
July 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use