Print

Print


Commit in hps-java/src/main/java/org/lcsim/hps/recon/tracking on MAIN
TrackerReconDriver.java+126-721.1 -> 1.2
TrackerDigiDriver.java+3-11.3 -> 1.4
+129-73
2 modified files
add additional set methods and comments

hps-java/src/main/java/org/lcsim/hps/recon/tracking
TrackerReconDriver.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- TrackerReconDriver.java	19 Jan 2012 01:03:18 -0000	1.1
+++ TrackerReconDriver.java	19 Jan 2012 01:22:15 -0000	1.2
@@ -14,34 +14,87 @@
 import org.lcsim.recon.tracking.seedtracker.StrategyXMLUtils;
 import org.lcsim.util.Driver;
 
+/**
+ * This class runs the Track Reconstruction for the HPS Test Proposal detector.
+ * The tracker digitization must be run in front of it.
+ * It is intended to work with the {@link TrackerDigiDriver} digitization Driver.
+ * 
+ * @author jeremym
+ * @version $Id: TrackerReconDriver.java,v 1.2 2012/01/19 01:22:15 jeremy Exp $
+ */
 public final class TrackerReconDriver extends Driver 
 {
-    // FIXME: Hard-coded B-field value.  
-    //        Can we get this from the Detector object's BoxDipole instead???
-    private final double bfield = 0.5;
-    
-    // Default name of SimTrackerHit input collection.
+	// Debug flag
+	private final static boolean DEBUG = true;
+	
+    // FIXME Hard-coded B-field value.  Get this from the Detector?
+    private double bfield = 0.5;
+            
+    // SimTrackerHit input collection.
     private String simTrackerHitCollectionName = "TrackerHits";
     
-    // Default tracking strategy path. 
+    // Tracking strategy path. 
     private String strategyResource = "HPS-Test-1pt3.xml";
         
-    // Name of Seedtracker's output collection.
-    private final String trackCollectionName = "MatchedTracks";
+    // Seedtracker's output track collection.
+    private String trackCollectionName = "MatchedTracks";
     
-    // Name of Seedtracker's HelicalTrackHit input collection.
-    private final String stInputCollectionName = "RotatedHelicalTrackHits";
+    // Seedtracker's HelicalTrackHit input collection.
+    private String stInputCollectionName = "RotatedHelicalTrackHits";
     
-    // Name of HelicalTrackHitDriver's output hit collection.
-    private final String hthOutputCollectionName = "HelicalTrackHits";
+    // HelicalTrackHitDriver's output hit collection.
+    private String hthOutputCollectionName = "HelicalTrackHits";
     
     // Name of strip hits collection.
-    // FIXME: Hard-coded collection name depends on name of strip clusterer in another Driver.
-    private final String stripHitsCollectionName = "StripClusterer_SiTrackerHitStrip1D";
-    
+    // FIXME This currently depends on name of strip clusterer from in another Driver.  
+    //       Can we change to something generic like "SiStripHits" instead?
+    private String stripHitsCollectionName = "StripClusterer_SiTrackerHitStrip1D";
+    
+    // Hit relations.
+	private String helicalTrackHitRelationsCollectionName = "HelicalTrackHitRelations";
+	
+	// Track to MC relations.
+	private String helicalTrackMCRelationsCollectionName = "HelicalTrackMCRelations";
+	
     public TrackerReconDriver()
-    {}
-        
+    {}            
+    
+	public void setHelicalTrackHitRelationsCollectionName(String helicalTrackHitRelationsCollectionName)
+	{
+		this.helicalTrackHitRelationsCollectionName = helicalTrackHitRelationsCollectionName;				
+	}
+	
+	public void setHelicalTrackMCRelationsCollectionName(String helicalTrackMCRelationsCollectionName)
+	{
+		this.helicalTrackMCRelationsCollectionName = helicalTrackMCRelationsCollectionName;
+	}
+	
+    // FIXME This set method should go away eventually.  Field should be read from Detector in detectorChanged method.
+    public void setBField(double bfield)
+    {
+    	this.bfield = bfield;
+    }
+    
+    public void setInputHitCollectionName(String inputHitCollectionName)
+    {
+    	this.stInputCollectionName = inputHitCollectionName;
+    }
+    
+    public void setOutputHitCollectionName(String outputHitCollectionName)
+    {
+    	this.hthOutputCollectionName = outputHitCollectionName;
+    }
+    
+    public void setStripHitsCollectionName(String stripHitsCollectionName)
+    {
+    	this.stripHitsCollectionName = stripHitsCollectionName;
+    }
+            
+    public void setTrackCollectionName(String trackCollectionName)
+    {
+    	this.trackCollectionName = trackCollectionName;
+    }
+            
     /**
      * Set the tracking strategy resource.
      * @param strategyResource The absolute path to the strategy resource.
@@ -68,26 +121,17 @@
         setup();
         super.detectorChanged(detector);        
     }
-    
-    /**
-     * Call super for child processing at start of data.
-     */
-    public void startOfData()
-    {
-        super.startOfData();
-    }    
-    
+        
     /** 
      * Setup all the child Drivers necessary for track reconstruction.
      */
     private void setup()
     {                
-        //
         // 1) Driver to create HelicalTrackHits expected by Seedtracker.
-        //
         
         // Setup adjacent layer pairings.
-        List<int[]> pairs = new ArrayList();
+    	// TODO Provide a default implementation here that is smart enough to pair adjacent modules by number.
+        List<int[]> pairs = new ArrayList<int[]>();
         int[] p1 = {1, 2};
         int[] p2 = {3, 4};
         int[] p3 = {5, 6};
@@ -99,12 +143,12 @@
         pairs.add(p4);
         pairs.add(p5);
 
-        // Setup the Driver.
+        // Create the Driver.
         HPSHelicalTrackHitDriver hthdriver = new HPSHelicalTrackHitDriver();
         hthdriver.addCollection(stripHitsCollectionName);
         hthdriver.OutputCollection(hthOutputCollectionName);
-        hthdriver.HitRelationName("HelicalTrackHitRelations"); // parameter
-        hthdriver.MCRelationName("HelicalTrackMCRelations"); // parameter       
+        hthdriver.HitRelationName(helicalTrackHitRelationsCollectionName);
+        hthdriver.MCRelationName(helicalTrackMCRelationsCollectionName);
         for (int[] pair : pairs)
         {
             hthdriver.setStereoPair("Tracker", pair[0], pair[1]);
@@ -114,9 +158,8 @@
         hthdriver.setTransformToTracking(true);
         add(hthdriver);
         
-        //
         // 2) Driver to run Seedtracker.
-        //
+
         if (!strategyResource.startsWith("/"))
             strategyResource = "/" + strategyResource; 
         List<SeedStrategy> sFinallist = StrategyXMLUtils.getStrategyListFromInputStream(
@@ -130,58 +173,69 @@
         stFinal.setSectorParams(false);
         add(stFinal);
         
-        //
         // 3) Cleanup the readouts for next event.
-        //
+        // TODO Check if this driver is duplicated elsewhere (in digi?).
+        
         List<String> readoutCleanup = new ArrayList<String>();
         readoutCleanup.add(this.simTrackerHitCollectionName);
         add(new ReadoutCleanupDriver(readoutCleanup));
     }   
     
+    /**
+     * Call super for child processing at start of data.
+     */
+    public void startOfData()
+    {
+        super.startOfData();
+    }    
+    
     /**    
      * This method is used to run the reconstruction and print debug information.
      */
     public void process(EventHeader event)
     {
-        // This runs the track reconstruction.
+        // This runs the track reconstruction using the sub-Drivers.
         super.process(event);
         
-        // Check for digi hits.
-        List<TrackerHit> digi = event.get(TrackerHit.class, "TrackerHits");
-        if (digi.size() == 0)
-        {
-            System.out.println("WARNING: The sisim TrackerHit collection is empty!");
-        }
-        else
-        {
-            System.out.println("The sisim TrackerHit collection has " + digi.size() + " hits.");
-        }
-        
-        // Check for HelicalTrackHits.
-        List<TrackerHit> hth = event.get(TrackerHit.class, hthOutputCollectionName);
-        if (hth.size() == 0)
+        // Check for digi hits and print debug output.
+        if (DEBUG)
         {
-            System.out.println("WARNING: The HelicalTrackHit collection " + hthOutputCollectionName + " is empty!");
-        }
-        else
-        {
-            System.out.println("The HelicalTrackHit collection " + hthOutputCollectionName + " has " + hth.size() + " hits.");
-        }       
-        
-        // Check for Tracks.
-        List<Track> tracks = event.get(Track.class, trackCollectionName);        
-        if (tracks.size() == 0)
-        {
-            System.out.println("WARNING: The Track collection " + trackCollectionName + " is empty!");
-        }
-        else
-        {
-            System.out.println("The Track collection " + trackCollectionName + " has " + tracks.size() + " tracks.");
-        }        
-        // Print out track info.
-        for (Track track : tracks)
-        {
-            System.out.println(track.toString());
+        	List<TrackerHit> digi = event.get(TrackerHit.class, "TrackerHits");
+        	if (digi.size() == 0)
+        	{
+        		System.out.println("WARNING: The sisim TrackerHit collection is empty!");
+        	}
+        	else
+        	{
+        		System.out.println("The sisim TrackerHit collection has " + digi.size() + " hits.");
+        	}
+
+        	// Check for HelicalTrackHits.
+        	List<TrackerHit> hth = event.get(TrackerHit.class, hthOutputCollectionName);
+        	if (hth.size() == 0)
+        	{
+        		System.out.println("WARNING: The HelicalTrackHit collection " + hthOutputCollectionName + " is empty!");
+        	}
+        	else
+        	{
+        		System.out.println("The HelicalTrackHit collection " + hthOutputCollectionName + " has " + hth.size() + " hits.");
+        	}       
+
+        	// Check for Tracks.
+        	List<Track> tracks = event.get(Track.class, trackCollectionName);        
+        	if (tracks.size() == 0)
+        	{
+        		System.out.println("WARNING: The Track collection " + trackCollectionName + " is empty!");
+        	}
+        	else
+        	{
+        		System.out.println("The Track collection " + trackCollectionName + " has " + tracks.size() + " tracks.");
+        	}        
+        	// Print out track info.
+        	for (Track track : tracks)
+        	{
+        		System.out.println(track.toString());
+        	}
         }
     }   
 }
\ No newline at end of file

hps-java/src/main/java/org/lcsim/hps/recon/tracking
TrackerDigiDriver.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- TrackerDigiDriver.java	19 Jan 2012 00:31:46 -0000	1.3
+++ TrackerDigiDriver.java	19 Jan 2012 01:22:15 -0000	1.4
@@ -23,7 +23,9 @@
 import org.lcsim.util.Driver;
 
 /**
- *
+ * This Driver runs the Tracker Digitization, from simulated Test Proposal data,
+ * to produce RawTrackerHits and TrackerHits that can then be used by SeedTracker.
+ * 
  * @author jeremym
  */
 public class TrackerDigiDriver extends Driver 
CVSspam 0.2.12


Use REPLY-ALL to reply to list

To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1