Commit in lcsim/src/org/lcsim/recon/tracking/seedtracker on MAIN
ConfirmerExtender.java+6-21.7 -> 1.8
FastCheck.java+35-271.4 -> 1.5
SeedTrackFinder.java+12-31.8 -> 1.9
SeedTracker.java+11.6 -> 1.7
+54-32
4 modified files
Turned off some fast checking of hits that seems to be going astray

lcsim/src/org/lcsim/recon/tracking/seedtracker
ConfirmerExtender.java 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- ConfirmerExtender.java	30 Jan 2009 15:34:42 -0000	1.7
+++ ConfirmerExtender.java	7 Feb 2009 03:56:06 -0000	1.8
@@ -123,6 +123,7 @@
 //                HelicalTrackHit checkhit = seedin.getHits().get(0);
 
 //                System.out.println("Trial seed with "+seedin.getHits().size()+" hits");
+//                System.out.println("Sectors with hits: "+sectorlist.size());
 
                 //  Create a list of hits to check for this layer / seed
                 List<HelicalTrackHit> hitlist = new ArrayList<HelicalTrackHit>();
@@ -130,9 +131,11 @@
                 //  Loop over the sectors with hits
                 for (Sector sector : sectorlist) {
 
+//                    System.out.println("About to check a sector");
                     //  Check that this candidate is compatible with the sector
-                    if (!checker.CheckSector(seedin, sector)) continue;
+//                    if (!checker.CheckSector(seedin, sector)) continue;
 
+//                    System.out.println("Sector checked out OK");
 //                    System.out.println("Found a sector to check: "+
 //                            sector.Identifier()+" with "+sector.Hits().size()+" hits");
 
@@ -140,6 +143,7 @@
                     hitlist.addAll(sector.Hits());
                 }
 
+//                System.out.println("Hits to check: "+hitlist.size());
                 SortHits comp = new SortHits(seedin.getHelix());
                 Collections.sort(hitlist, comp);
 
@@ -152,7 +156,7 @@
 
 //                        System.out.println("Checking a hit for viability");
                     //  Check that this hit is potentially viable
-                    if (!checker.CheckHitSeed(hit, seedin)) continue;
+//                    if (!checker.CheckHitSeed(hit, seedin)) continue;
 
                     SeedCandidate test = new SeedCandidate(seedin);
                     test.addHit(hit);

lcsim/src/org/lcsim/recon/tracking/seedtracker
FastCheck.java 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- FastCheck.java	30 Jan 2009 15:34:42 -0000	1.4
+++ FastCheck.java	7 Feb 2009 03:56:06 -0000	1.5
@@ -70,11 +70,7 @@
         double zmax2 = zmin2 + zlen2;
 
         //  Check the z0 limits using the minimum path lengths
-        boolean zOK;
-        zOK = checkz0(_s1min, _zmin1, _zmax1, smin(r2), zmin2, zmax2);
-
-        //  If we failed, also try checking with the maximum path lengths
-        if (!zOK) zOK = checkz0(_s1max, _zmin1, _zmax1, smax(r2), zmin2, zmax2);
+        boolean zOK = checkz0(_s1min, _s1max, _zmin1, _zmax1, smin(r2), smax(r2), zmin2, zmax2);
 
         return zOK;
     }
@@ -114,7 +110,7 @@
             double dphitrk1 = phidif(dphimxsec1, dphimxhit);
             double dphitrk2 = phidif(dphimxsec2, dphimxhit);
             double dphitrk = Math.max(dphitrk1, dphitrk2);
-
+ 
             //  Calculate the phi dev between the hit and midpoint of the sector
             double dphi = phidif(hit.phi(), midphisec);
 
@@ -136,14 +132,9 @@
             double zmin2 = hit.z() - 0.5 * zlen;
             double zmax2 = zmin2 + zlen;
 
-            //  Check the z0 limits using the minimum path lengths
-            boolean zOK;
-            zOK = checkz0(smin1, zmin, zmax, smin(r), zmin2, zmax2);
-
-            //  If we failed, also try checking with the maximum path lengths
-            if (zOK) continue;
-                zOK = checkz0(smax1, zmin, zmax, smax(r), zmin2, zmax2);
-            
+            //  Check the z0 limits
+            boolean zOK = checkz0(smin1, smax1, zmin, zmax, smin2, smax2, zmin2, zmax2);
+//            System.out.println("zOK: "+zOK);
             if (!zOK) return false;
         }
         return true;
@@ -170,9 +161,11 @@
 
         //  Check that the sectors are compatible in the bend coordinate
         boolean phiOK;
+//        System.out.println("Checking phi");
         phiOK = dmid < dphi1 + wid1 + wid2;
         if (!phiOK) phiOK = dmid < dphi2 + wid1 + wid2;
         if (!phiOK) return false;
+//        System.out.println("Phi OK");
 
         // Get the minimum and maximum path lengths
         double s1min = smin(s1.rmin());
@@ -187,15 +180,17 @@
         double z2max = s2.zmax();
 
         //  Check that the sectors are compatible in the non-bend coordinate
-        boolean zOK;
-        zOK = checkz0(s1min, z1min, z1max, s2min, z2min, z2max);
-        if (!zOK) zOK = checkz0(s1max, z1min, z1max, s2max, z2min, z2max);
+        boolean zOK = checkz0(s1min, s1max, z1min, z1max, s2min, s2max, z2min, z2max);
 
+//        System.out.println("sector pair check OK: "+zOK);
+        
         return zOK;
     }
 
     private double dphimx(double r) {
-        return Math.asin((2 * _RMin * _dMax - _dMax * _dMax - r * r) / (2 * r * (_RMin - _dMax)));
+        double R = _RMin;
+        if (r > _RMin) R = r;
+        return Math.asin((2 * R * _dMax - _dMax * _dMax - r * r) / (2 * r * (R - _dMax)));
     }
 
     private double smin(double r) {
@@ -206,18 +201,31 @@
         return 2.0 * _RMin * Math.asin((r + _dMax) / (2.0 * _RMin));
     }
 
-    private boolean checkz0(double s1, double zmin1, double zmax1, double s2, double zmin2, double zmax2) {
+    private boolean checkz0(double s1min, double s1max, double zmin1, double zmax1,
+            double s2min, double s2max, double zmin2, double zmax2) {
 
-        //  Check the minimum and maximum value for z0
-        double zlim1 = (zmin1 * s2 - zmax2 * s1) / (s2 - s1);
-        double zlim2 = (zmax1 * s2 - zmin2 * s1) / (s2 - s1);
-        boolean checkz0;
-        if (s2 > s1) {
-            checkz0 = (zlim1 <= _z0Max) && (zlim2 >= -_z0Max);
-        } else {
-            checkz0 = (zlim2 <= _z0Max) && (zlim1 >= -_z0Max);
+        //  Find the limits on z0 for smin and smax
+        double zlim[] = new double[4];
+        zlim[0] = (zmin1 * s2min - zmax2 * s1min) / (s2min - s1min);
+        zlim[1] = (zmax1 * s2min - zmin2 * s1min) / (s2min - s1min);
+        zlim[2] = (zmin1 * s2max - zmax2 * s1max) / (s2max - s1max);
+        zlim[3] = (zmax1 * s2max - zmin2 * s1max) / (s2max - s1max);
+
+        //  Find the largest and smallest z0 limits
+        double zmax = -99999.;
+        double zmin =  99999.;
+        for (int i = 0; i<4; i++) {
+            if (zlim[i]>zmax) zmax = zlim[i];
+            if (zlim[i]<zmin) zmin = zlim[i];
         }
 
+//        System.out.println("s1min: "+s1min+" s2: "+s2min+" zmin1: "+zmin1+
+//                " zmax1: "+zmax1+" zmin2: "+zmin2+" zmax2: "+zmax2);
+//        System.out.println("zmin: "+zmin+" zmax: "+zmax+" z0Max: "+_z0Max);
+
+        //  Check to see if the range zmin - zmax is consistent with the z0 limit
+        boolean checkz0 = zmax >= -_z0Max && zmin <= _z0Max;
+
         return checkz0;
     }
 

lcsim/src/org/lcsim/recon/tracking/seedtracker
SeedTrackFinder.java 1.8 -> 1.9
diff -u -r1.8 -r1.9
--- SeedTrackFinder.java	7 Feb 2009 00:46:46 -0000	1.8
+++ SeedTrackFinder.java	7 Feb 2009 03:56:06 -0000	1.9
@@ -69,9 +69,13 @@
         int nseed = 0;
         int nconfirm = 0;
         int nextend = 0;
-        int maxseeds = _hitmanager.getTrackerHits(seedlayerlist.get(0)).size() *
-                _hitmanager.getTrackerHits(seedlayerlist.get(1)).size() *
-                _hitmanager.getTrackerHits(seedlayerlist.get(2)).size();
+        int nhit0 = _hitmanager.getTrackerHits(seedlayerlist.get(0)).size();
+        int nhit1 = _hitmanager.getTrackerHits(seedlayerlist.get(1)).size();
+        int nhit2 = _hitmanager.getTrackerHits(seedlayerlist.get(2)).size();
+        int maxseeds = nhit0 * nhit1 * nhit2;
+
+//        if (maxseeds>0) System.out.println("Number of seed sectors: "+sslist.size()+" Max Seeds: "+maxseeds);
+
         int npairs = 0;
         int ngdpairs = 0;
         int ntrip = 0;
@@ -94,6 +98,7 @@
                         if (!checker.CheckHitPair(hit1, hit3)) continue;
                         if (!checker.CheckHitPair(hit2, hit3)) continue;
 
+//                        System.out.println("Found a new seed candidate");
                         //  Create a seed candidate from this 3-hit seed
                         SeedCandidate seed = new SeedCandidate(strategy);
                         seed.addHit(hit1);
@@ -105,6 +110,8 @@
                         boolean success = _helixfitter.FitCandidate(seed, strategy);
                         if (!success) continue;
 
+//                        System.out.println("Fit a seed candidate");
+
                         //  Save the helix fit
                         seed.setHelix(_helixfitter.getHelix());
                         nfit++;
@@ -114,6 +121,7 @@
                         if (!success) continue;
                         nconfirm++;
 
+//                        System.out.println("Confirmed a seed candidate");
                         //  Try to extend each confirmed seed candidates to make a track candidate
                         List<SeedCandidate> confirmedlist = _confirmer.getResult();
                         nconseeds += confirmedlist.size();
@@ -124,6 +132,7 @@
                             if (!success) continue;
                             nextend++;
 
+//                            System.out.println("Extended a seed candidate");
                             //  Found a track candidate - merge it into the list of track candidates
                             List<SeedCandidate> extendedlist = _confirmer.getResult();
                             nextseeds += extendedlist.size();

lcsim/src/org/lcsim/recon/tracking/seedtracker
SeedTracker.java 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- SeedTracker.java	30 Jan 2009 15:34:42 -0000	1.6
+++ SeedTracker.java	7 Feb 2009 03:56:06 -0000	1.7
@@ -73,6 +73,7 @@
     @Override
     protected void process(EventHeader event) {
 
+//        System.out.println("New event");
         //  Pass the event to the diagnostics package
         if (_diag != null) _diag.setEvent(event);
 
CVSspam 0.2.8