Commit in hps-java/src/main/java/org/lcsim/hps/recon/tracking on MAIN
HPSHelicalTrackHitDriver.java+29-271.12 -> 1.13
Fix the stereo hit pairing...this just worked by accident before.

hps-java/src/main/java/org/lcsim/hps/recon/tracking
HPSHelicalTrackHitDriver.java 1.12 -> 1.13
diff -u -r1.12 -r1.13
--- HPSHelicalTrackHitDriver.java	6 Aug 2012 21:43:05 -0000	1.12
+++ HPSHelicalTrackHitDriver.java	6 Sep 2012 18:08:08 -0000	1.13
@@ -43,21 +43,20 @@
 import org.lcsim.util.Driver;
 
 /**
- * Create the appropriate HelicalTrackHits for the specified TrackerHit
- * collections. The resulting HelicalTrackHits encapsulate the information
- * needed to perform a helical track hit for either a segmented strip detector,
- * a pixel detector, or cross hits from a stereo detector.
- *
- * This driver was developed for the Dark Forces silicon tracker, where
- * digitized hits are in either axial or stereo layers. The pairs of layers to
- * be used in forming stereo hits can be specified using the setStereoPairs
- * method.
- *
- * The list of hit collections to be converted must be specified before the
- * process method is executed.
- *
- * @author Richard Partridge
- * @version 1.0
+ Create the appropriate HelicalTrackHits for the specified TrackerHit
+ collections. The resulting HelicalTrackHits encapsulate the information needed
+ to perform a helical track hit for either a segmented strip detector, a pixel
+ detector, or cross hits from a stereo detector.
+
+ This driver was developed for the Dark Forces silicon tracker, where digitized
+ hits are in either axial or stereo layers. The pairs of layers to be used in
+ forming stereo hits can be specified using the setStereoPairs method.
+
+ The list of hit collections to be converted must be specified before the process
+ method is executed.
+
+ @author Richard Partridge
+ @version 1.0
  */
 public class HPSHelicalTrackHitDriver extends Driver {
 //    private StereoHitMaker _crosser = new StereoHitMaker(2., 10.);
@@ -76,7 +75,7 @@
     String subdetectorName = "Tracker";
 
     /**
-     Creates a new instance of HelicalTrackHitDriver
+     Creates a new instance of HelicalTrackHitDriver
      */
     public HPSHelicalTrackHitDriver() {
 //        setDetToTrkMatrix();
@@ -96,16 +95,17 @@
         if (modules.isEmpty()) {
             throw new RuntimeException("No SiTrackerModules found in detector.");
         }
-        int nmodules = modules.size();
-        if (nmodules % 2 != 0) {
+        if (_debug)
+            System.out.println("Number of layers = " + detector.getSubdetector(subdetectorName).getLayering().getLayers().getNumberOfLayers());
+        int nlayers = detector.getSubdetector(subdetectorName).getLayering().getLayers().getNumberOfLayers();
+        if (nlayers % 2 != 0) {
             throw new RuntimeException("Don't know how to do stereo pairing for odd number of modules.");
         }
         List<int[]> pairs = new ArrayList<int[]>();
-        for (int i = 1; i <= (nmodules / 2) - 1; i += 2) {
+        for (int i = 1; i <= (nlayers) - 1; i += 2) {
             int[] pair = {i, i + 1};
-            if (_debug) {
+            if (_debug)
                 System.out.println("Adding stereo pair: " + pair[0] + ", " + pair[1]);
-            }
             pairs.add(pair);
         }
         for (int[] pair : pairs) {
@@ -114,9 +114,9 @@
     }
 
     /**
-     * Create the HelicalTrackHits for the specified hit collections.
-     *
-     * @param event EventHeader of the event to be processed
+     Create the HelicalTrackHits for the specified hit collections.
+
+     @param event EventHeader of the event to be processed
      */
     @Override
     public void process(EventHeader event) {
@@ -230,6 +230,8 @@
                 for (HelicalTrackStrip strip : cross.getStrips()) {
                     hitrelations.add(new MyLCRelation(cross, stripmap.get(strip)));
                 }
+                if (_debug)
+                    System.out.println("Found HTC in Layer :  " + cross.Layer());
             }
         }
 
@@ -269,9 +271,9 @@
     }
 
     /**
-     * Name of the HelicalTrackHit collection to be put back in the event.
-     *
-     * @param outname Name to use for the HelicalTrackHit collection
+     Name of the HelicalTrackHit collection to be put back in the event.
+
+     @param outname Name to use for the HelicalTrackHit collection
      */
     public void setOutputCollectionName(String outname) {
         _outname = outname;
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