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  August 2015

HPS-SVN August 2015

Subject:

r3409 - /java/trunk/recon/src/main/java/org/hps/recon/particle/ReconParticleDriver.java

From:

[log in to unmask]

Reply-To:

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

Date:

Wed, 26 Aug 2015 22:16:15 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (198 lines)

Author: [log in to unmask]
Date: Wed Aug 26 15:16:13 2015
New Revision: 3409

Log:
Use the TrackClusterMatcher to determine a 'good' match.  As a result, the isMatch method is no longer needed and was removed.  

Modified:
    java/trunk/recon/src/main/java/org/hps/recon/particle/ReconParticleDriver.java

Modified: java/trunk/recon/src/main/java/org/hps/recon/particle/ReconParticleDriver.java
 =============================================================================
--- java/trunk/recon/src/main/java/org/hps/recon/particle/ReconParticleDriver.java	(original)
+++ java/trunk/recon/src/main/java/org/hps/recon/particle/ReconParticleDriver.java	Wed Aug 26 15:16:13 2015
@@ -12,7 +12,8 @@
 import org.hps.recon.ecal.cluster.ClusterType;
 import org.hps.recon.ecal.cluster.ClusterUtilities;
 import org.hps.recon.tracking.CoordinateTransformations;
-import org.hps.recon.tracking.TrackUtils;
+import org.hps.recon.utils.TrackClusterMatcher;
+
 import org.lcsim.event.Cluster;
 import org.lcsim.event.EventHeader;
 import org.lcsim.event.ReconstructedParticle;
@@ -27,12 +28,14 @@
  * Driver framework for generating reconstructed particles and matching clusters
  * and tracks.
  *
+ * @author Omar Moreno <[log in to unmask]>
  * @author Mathew Graham <[log in to unmask]>
- * @author Omar Moreno <[log in to unmask]>
- * @version $Id$
  */
 public abstract class ReconParticleDriver extends Driver {
 
+    /** Utility used to determine if a track and cluster are matched */
+    TrackClusterMatcher matcher = new TrackClusterMatcher(); 
+    
     /**
      * Sets the name of the LCIO collection for beam spot constrained V0
      * candidate particles.
@@ -85,26 +88,6 @@
     }
 
     /**
-     * Sets the maximum allowed separation distance between a matched cluster
-     * and track pair.
-     *
-     * @param dxCut - The maximum separation distance in the x-direction.
-     */
-    public void setDxCut(double dxCut) {
-        this.dxCut = dxCut;
-    }
-
-    /**
-     * Sets the maximum allowed separation distance between a matched cluster
-     * and track pair.
-     *
-     * @param dyCut - The maximum separation distance in the y-direction.
-     */
-    public void setDyCut(double dyCut) {
-        this.dyCut = dyCut;
-    }
-
-    /**
      * Sets the LCIO collection name for calorimeter cluster data.
      *
      * @param ecalClustersCollectionName - The LCIO collection name.
@@ -177,6 +160,8 @@
      */
     @Override
     protected void detectorChanged(Detector detector) {
+        //matcher.enablePlots(true);
+        
         // Set the magnetic field parameters to the appropriate values.
         Hep3Vector ip = new BasicHep3Vector(0., 0., 1.);
         bField = detector.getFieldMap().getField(ip).y();
@@ -254,7 +239,7 @@
             clusterLoop:
             for (Cluster cluster : unmatchedClusters) {
                 // Check if the cluster and track are a valid match.
-                if (isMatch(cluster, track)) {
+                if (matcher.isMatch(cluster, track)) {
                     // Store the matched cluster.
                     matchedCluster = cluster;
 
@@ -492,105 +477,21 @@
         }
     }
 
-    /**
-     * Determines if a cluster is a potential match for a given track. If it is,
-     * returns the distance between the extrapolation of the track to the
-     * z-position of the cluster and the cluster position. Otherwise, returns
-     * <code>null</code> to indicate that the pair is not a valid match.
-     *
-     * @param cluster - The cluster to check.
-     * @param track - The track to check.
-     * @return Returns the distance between the cluster and extrapolated track
-     * position in millimeters as a <code>Double</code> if the pair is a
-     * potential match. Returns <code>null</code> otherwise.
-     */
-    private boolean isMatch(Cluster cluster, Track track) {
-        // Get the position of the cluster and extrapolate the position
-        // of the track at the z-position of the cluster.
-
-        // Removed reading of "corrected" position from HPSEcalClusterIC here.  --JM 
-        Hep3Vector clusterPosition = new BasicHep3Vector(cluster.getPosition());
-        Hep3Vector trackPosAtEcal = TrackUtils.extrapolateTrack(track, clusterPosition.z());
-
-        // TODO: There are some track whose extrapolated coordinates
-        //       are NaN. The problem seems to be that the y-coordinate
-        //       of the extrapolated helix is found to be non-real. This
-        //       needs to be fixed.
-        // There is an issue with track extrapolation that sometimes
-        // yields NaN for extrapolated track parameters. Tracks with
-        // this issue are not usable and thusly the check should be
-        // skipped.
-        if (Double.isNaN(trackPosAtEcal.x()) || Double.isNaN(trackPosAtEcal.y())) {
-            // VERBOSE :: Indicate the reason for the match failing.
-            printDebug("\tFailure :: Track extrapolation error.");
-
-            // Return false to indicate that the pair do not match.
-            return false;
-        }
-
-        // VERBOSE :: Output the position of the extrapolated track
-        //            and the cluster.
-        printDebug("\tCluster Position :: " + clusterPosition.toString());
-        printDebug("\tTrack Position   :: " + trackPosAtEcal.toString());
-
-        // If one of either the cluster or extrapolated track fall on
-        // one volume of the detector and the other is in the other
-        // volume, then they can not be a match. (i.e. both parts of
-        // the pair must be on the top or bottom of the detector.)
-        if (clusterPosition.y() * trackPosAtEcal.y() < 0) {
-            // VERBOSE :: Indicate the reason for the match failing.
-            printDebug("\tFailure :: Cluster/Track pair in opposite volumes.");
-
-            // Return false to indicate that the pair do not match.
-            return false;
-        }
-
-        // Check to make sure that the x and y displacements between
-        // the extrapolated track position and cluster position are
-        // within the allowed bounds. If they are not, this pair is
-        // not a match.
-        if (Math.abs(trackPosAtEcal.x() - clusterPosition.x()) > dxCut) {
-            // VERBOSE :: Indicate the reason for the match failing.
-            printDebug("\tFailure :: Pair x-displacement exceeds allowed threshold.");
-
-            // Return false to indicate that the pair do not match.
-            return false;
-        }
-
-        if (Math.abs(trackPosAtEcal.y() - clusterPosition.y()) > dyCut) {
-            // VERBOSE :: Indicate the reason for the match failing.
-            printDebug("\tFailure :: Pair y-displacement exceeds allowed threshold.");
-
-            // Return false to indicate that the pair do not match.
-            return false;
-        }
-
-        // VERBOSE :: Indicate the reason for the match failing.
-        printDebug("\tSuccess :: Cluster/track pair match!.");
-
-        // A pair that has reached this point is a potential match.
-        // Return true to indicate a match.
-        return true;
+    @Override
+    protected void endOfData() { 
+        //matcher.saveHistograms();
     }
 
     // ==============================================================
     // ==== Class Variables =========================================
     // ==============================================================
     // Local variables.
-    /**
-     * The maximum separation distance in the x-direction beyond which a cluster
-     * and track will be rejected for pairing.
-     */
-    private double dxCut = 20.0;
-    /**
-     * The maximum separation distance in the y-direction beyond which a cluster
-     * and track will be rejected for pairing.
-     */
-    private double dyCut = 20.0;
+    
     /**
      * Indicates whether debug text should be output or not.
      */
     private boolean debug = false;
+    
     /**
      * The simple name of the class used for debug print statements.
      */

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