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:

r3559 - /java/trunk/recon/src/main/java/org/hps/recon/utils/TrackClusterMatcher.java

From:

[log in to unmask]

Reply-To:

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

Date:

Wed, 9 Sep 2015 05:44:17 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (110 lines)

Author: [log in to unmask]
Date: Tue Sep  8 22:44:14 2015
New Revision: 3559

Log:
Use the field map extrapolator instead of the analytic one.

Modified:
    java/trunk/recon/src/main/java/org/hps/recon/utils/TrackClusterMatcher.java

Modified: java/trunk/recon/src/main/java/org/hps/recon/utils/TrackClusterMatcher.java
 =============================================================================
--- java/trunk/recon/src/main/java/org/hps/recon/utils/TrackClusterMatcher.java	(original)
+++ java/trunk/recon/src/main/java/org/hps/recon/utils/TrackClusterMatcher.java	Tue Sep  8 22:44:14 2015
@@ -15,9 +15,8 @@
 
 import org.lcsim.event.Cluster;
 import org.lcsim.event.Track;
+import org.lcsim.event.TrackState;
 import org.lcsim.geometry.FieldMap;
-import org.lcsim.recon.tracking.seedtracker.TrackState;
-import org.hps.conditions.database.DatabaseConditionsManager;
 import org.hps.recon.tracking.CoordinateTransformations;
 import org.hps.recon.tracking.TrackUtils;
 
@@ -40,6 +39,12 @@
     /** Flag used to determine if plots are enabled/disabled */
     boolean enablePlots = false; 
 
+    /** 
+     * Flag used to determine whether the analytic or field map extrapolator
+     * should be used. 
+     */
+    boolean useAnalyticExtrapolator = false; 
+    
     /**
      * These cuts are set at +/- 4 sigma extracted from Gaussian fits to the 
      * track-cluster residual distributions.  The data used to determine these
@@ -60,6 +65,9 @@
    
     /** The extrapolation step size */ 
     double stepSize = 5.; // mm
+   
+    /** Constant denoting the index of the {@link TrackState} at the Ecal */
+    private static final int ECAL_TRACK_STATE_INDEX = 1;  
     
     /** Constructor */
     public TrackClusterMatcher() {};
@@ -68,15 +76,32 @@
      * Enable/disable booking, filling of Ecal cluster and extrapolated track 
      * position plots.
      * 
-     * @param enablePlots : true to enable, false to disable
+     * @param enablePlots true to enable, false to disable
      */
     public void enablePlots(boolean enablePlots) { 
         this.enablePlots = enablePlots;
         if (enablePlots == true) this.bookHistograms();
     }
-   
+  
+    /**
+     * Set the 3D field map to be used by the extrapolator.
+     * 
+     * @param bFieldMap The {@link FieldMap} object containing a mapping to the
+     *                  3D field map.
+     */
     public void setBFieldMap(FieldMap bFieldMap) { 
         this.bFieldMap = bFieldMap; 
+    }
+   
+    /**
+     * Use the analytic track extrapolator i.e. the no fringe extrapolator.
+     * The field map extrapolator is used by default. 
+     * 
+     * @param useAnalyticExtrapolator Set to true to use the analytic 
+     *                                extrapolator, false otherwise. 
+     */
+    public void setUseAnalyticExtrapolator(boolean useAnalyticExtrapolator) { 
+        this.useAnalyticExtrapolator = useAnalyticExtrapolator; 
     }
     
     /**
@@ -153,15 +178,19 @@
         //System.out.println("Cluster Position: " + clusterPosition.toString());
         
         // Extrapolate the track to the Ecal cluster position
-        // TODO: At some point, this needs to use the fringe field
-        Hep3Vector trackPosAtEcal = TrackUtils.extrapolateTrack(track, clusterPosition.z());
-        //Hep3Vector trackPosAtEcal 
-        //    = new BasicHep3Vector(TrackUtils.extrapolateTrackUsingFieldMap(track, this.extStartPos, clusterPosition.z(), this.stepSize, bFieldMap).getReferencePoint());
-        //trackPosAtEcal = CoordinateTransformations.transformVectorToDetector(trackPosAtEcal);
+        Hep3Vector trackPosAtEcal = null;
+        if (this.useAnalyticExtrapolator) {
+            //System.out.println("Using analytic field extrapolator."); 
+            trackPosAtEcal = TrackUtils.extrapolateTrack(track, clusterPosition.z());
+        } else {
+            //System.out.println("Using field map extrapolator"); 
+            TrackState trackStateAtEcal = (TrackState) track.getTrackStates().get(this.ECAL_TRACK_STATE_INDEX);
+            trackPosAtEcal = new BasicHep3Vector(trackStateAtEcal.getReferencePoint()); 
+            trackPosAtEcal = CoordinateTransformations.transformVectorToDetector(trackPosAtEcal);
+        }
         //System.out.println("Track position at Ecal: " + trackPosAtEcal.toString());
        
         
-        //TrackState trackStateAtEcal = (TrackState) track.getTrackStates().get(1);
         
         // Calculate the difference between the cluster position at the Ecal and
         // the track in both the x and y directions

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