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:

r3591 - /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:

Fri, 11 Sep 2015 23:18:31 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (89 lines)

Author: [log in to unmask]
Date: Fri Sep 11 16:18:28 2015
New Revision: 3591

Log:
Use TrackState in extrapolation

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 16:18:28 2015
@@ -48,7 +48,6 @@
 import org.lcsim.util.swim.Helix;
 import org.lcsim.util.swim.Line;
 import org.lcsim.util.swim.Trajectory;
-
 import org.hps.recon.tracking.EventQuality.Quality;
 import org.hps.recon.tracking.gbl.HelicalTrackStripGbl;
 
@@ -81,6 +80,11 @@
     public static Hep3Vector extrapolateHelixToXPlane(Track track, double x) {
         return extrapolateHelixToXPlane(getHTF(track), x);
     }
+    
+    public static Hep3Vector extrapolateHelixToXPlane(TrackState track, double x) {
+        return extrapolateHelixToXPlane(getHTF(track), x);
+    }
+    
 
     /**
      * Extrapolate helix to a position along the x-axis. Re-use HelixUtils.
@@ -1043,6 +1047,24 @@
         return isolations;
     }
    
+    
+    
+    /**
+     * Backward compatibility function for {@code extrapolateTrackUsingFieldMap}.
+     */
+    public static TrackState extrapolateTrackUsingFieldMap(Track track, double startPositionX, double endPositionX, double stepSize, FieldMap fieldMap) { 
+        TrackState stateAtIP = null;
+        for( TrackState state: track.getTrackStates()) {
+            if( state.getLocation() == TrackState.AtIP )
+                stateAtIP = state;
+        }
+        if( stateAtIP == null )
+            throw new RuntimeException("No track state at IP was found so this function shouldn't be used.");
+        
+        // Extrapolate this track state
+        return extrapolateTrackUsingFieldMap(stateAtIP, startPositionX, endPositionX, stepSize, fieldMap);
+    }
+    
     /**
      * Iteratively extrapolates a track to a specified value of x 
      * (z in detector frame) using the full 3D field map.
@@ -1059,7 +1081,7 @@
      *         that the "Tracking" frame is used for the reference point 
      *         coordinate system.
      */
-    public static TrackState extrapolateTrackUsingFieldMap(Track track, double startPositionX, double endPositionX, double stepSize, FieldMap fieldMap) { 
+    public static TrackState extrapolateTrackUsingFieldMap(TrackState track, double startPositionX, double endPositionX, double stepSize, FieldMap fieldMap) { 
 
         // Start by extrapolating the track to the approximate point where the
         // fringe field begins.
@@ -1090,7 +1112,7 @@
         //System.out.println("Track momentum vector: " + currentMomentum.toString());
 
         // Get the charge of the track.
-        double q = Math.signum(track.getTrackStates().get(0).getOmega());
+        double q = Math.signum(track.getOmega());
         // HACK: LCSim doesn't deal well with negative fields so they are 
         //       turned to positive for tracking purposes.  As a result, 
         //       the charge calculated using the B-field, will be wrong
@@ -1153,8 +1175,8 @@
        // Create a track state at the extrapolation point
        TrackState trackState = new BaseTrackState(trackParameters, 
                currentPosition.v(), 
-               track.getTrackStates().get(0).getCovMatrix(), 
-               TrackState.AtOther, 
+               track.getCovMatrix(), 
+               TrackState.AtCalorimeter, 
                bFieldY);
        
        return trackState;

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