Commit in lcsim/src/org/lcsim/contrib/seedtracker on MAIN
DefaultStrategy.java+3-31.4 -> 1.5
MaterialManager.java+40-11.2 -> 1.3
MultipleScattering.java+28-141.2 -> 1.3
+71-18
3 modified files
Minor update

lcsim/src/org/lcsim/contrib/seedtracker
DefaultStrategy.java 1.4 -> 1.5
diff -u -r1.4 -r1.5
--- DefaultStrategy.java	11 Aug 2007 01:27:14 -0000	1.4
+++ DefaultStrategy.java	5 Feb 2008 17:08:47 -0000	1.5
@@ -27,9 +27,9 @@
         _strategylist = new ArrayList();
         // Barrel only strategies
         List<SeedLayer> tb012layers = new ArrayList();
-        tb012layers.add(new SeedLayer("TrackerBarrel", 0, BarrelEndcapFlag.BARREL, SeedType.Seed));
-        tb012layers.add(new SeedLayer("TrackerBarrel", 1, BarrelEndcapFlag.BARREL, SeedType.Seed));
-        tb012layers.add(new SeedLayer("TrackerBarrel", 2, BarrelEndcapFlag.BARREL, SeedType.Seed));
+        tb012layers.add(new SeedLayer("VertexBarrel", 0, BarrelEndcapFlag.BARREL, SeedType.Seed));
+        tb012layers.add(new SeedLayer("VertexBarrel", 1, BarrelEndcapFlag.BARREL, SeedType.Seed));
+        tb012layers.add(new SeedLayer("VertexBarrel", 2, BarrelEndcapFlag.BARREL, SeedType.Seed));
         _strategylist.add(new SeedStrategy("TB012",tb012layers));
         
         List<BarrelEndcapFlag> belist = new ArrayList();

lcsim/src/org/lcsim/contrib/seedtracker
MaterialManager.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- MaterialManager.java	4 Feb 2008 20:51:32 -0000	1.2
+++ MaterialManager.java	5 Feb 2008 17:08:47 -0000	1.3
@@ -14,6 +14,10 @@
 import java.util.List;
 
 import org.lcsim.event.EventHeader;
+import org.lcsim.detector.DetectorIdentifierHelper;
+import org.lcsim.detector.IDetectorElement;
+import org.lcsim.detector.identifier.IIdentifier;
+import org.lcsim.detector.identifier.IIdentifierHelper;
 import org.lcsim.detector.ILogicalVolume;
 import org.lcsim.detector.IPhysicalVolume;
 import org.lcsim.detector.material.IMaterial;
@@ -29,6 +33,7 @@
 public class MaterialManager {
     List<MaterialCylinder> _matcyl = new ArrayList<MaterialCylinder>();
     List<MaterialDisk> _matdsk = new ArrayList<MaterialDisk>();
+    double _rmax;
     
     /** Creates a new instance of MaterialManager */
     public MaterialManager() {
@@ -70,8 +75,38 @@
                 }
             }
         }
+        
+        //  Find the outer radius of the tracking volume
+        //  First loop over all the subdetector elements
+        IDetectorElement de = det.getDetectorElement();
+        for (IDetectorElement child : de.getChildren()) {
+            
+            //  Get the identifier for this subdetector
+            IIdentifierHelper helper = child.getIdentifierHelper();
+            if (helper instanceof DetectorIdentifierHelper) {
+                DetectorIdentifierHelper dehelper = (DetectorIdentifierHelper) helper;
+                IIdentifier id = child.getIdentifier();
+                
+                //  Check if this is the ECalBarrel
+                if (dehelper.isEcalBarrel(id)) {
+                    
+                    //  Check for geometry info to make sure we don't have an ECal endcap
+                    if (child.hasGeometryInfo()) {
+                        
+                        //  Get the solid and make sure its a tube
+                        ISolid solid = child.getGeometry().getLogicalVolume().getSolid();
+                        if (solid instanceof Tube) {
+                            Tube tube = (Tube) solid;
+                            
+                            //  Take the inner ECal radius was the outer tracker radius
+                            _rmax = tube.getInnerRadius();
+                        }
+                    }
+                }
+            }
+        }
     }
-
+    
     public List<MaterialCylinder> getMaterialCylinders() {
         return _matcyl;
     }
@@ -80,6 +115,10 @@
         return _matdsk;
     }
     
+    public double getRMax() {
+        return _rmax;
+    }
+    
     private List<IPhysicalVolume> Flatten(IPhysicalVolume xmlvol) {
         //  Flatten the geometry tree to find all the physical volumes for
         //  this tracker element that have no daughters

lcsim/src/org/lcsim/contrib/seedtracker
MultipleScattering.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- MultipleScattering.java	4 Feb 2008 22:00:41 -0000	1.2
+++ MultipleScattering.java	5 Feb 2008 17:08:47 -0000	1.3
@@ -29,6 +29,7 @@
     private HelixUtils _hutil = new HelixUtils();
     private MaterialManager _materialmanager;
     private double _bfield;
+    private int _mxint = 10;
     
     /**
      * Creates a new instance of MultipleScattering
@@ -62,6 +63,7 @@
         //  Loop over the hits on the helix and calculate the multiple scattering errors
         for (Map.Entry<HelicalTrackHit, Double> hitentry : pathmap.entrySet()) {
             double hitpath = hitentry.getValue();
+            HelicalTrackHit hit = hitentry.getKey();
             
             //  Loop over scattering points and sum in quadrature ms errors for this hit.
             //  It is assumed that we can ignore ms correlations during the track-finding stage.
@@ -77,6 +79,7 @@
                     
                     //  Get the multiple scattering plane angle for this scatter
                     double angle = scat.Angle();
+                    System.out.println(" s: "+scatpath+" angle "+angle);
                     
                     //  Sum in quadrature the r-phi ms errors.  It is assumed that we
                     //  can ignore track curvature in calculating these errors during
@@ -94,6 +97,7 @@
             
             //  Create a new MultipleScatter object and store it in the map of ms errors
             MultipleScatter ms = new MultipleScatter(Math.sqrt(rphi_ms2), Math.sqrt(z_ms2));
+            System.out.println(" r: "+hit.r()+" z "+hit.z()+" r-phi ms: "+ms.drphi()+" s-z ms: "+ms.dz());
             msmap.put(hitentry.getKey(), ms);
         }
         
@@ -115,9 +119,24 @@
         List<MaterialCylinder> matcyl = _materialmanager.getMaterialCylinders();
         List<MaterialDisk> matdsk = _materialmanager.getMaterialDisks();
         
+        //  Find the largest path length to a hit
+        double smax = 0.;
+        for (Map.Entry<HelicalTrackHit, Double> mapentry : helix.pathmap().entrySet()) {
+            smax = Math.max(smax, mapentry.getValue());
+        }
+        
+        //  We can't go further than the ECal, however
+        double rmax = _materialmanager.getRMax();
+        List<Double> slist = _hutil.PathToCylinder(helix, rmax, smax, 1);
+        for (Double s : slist) {
+            smax = Math.min(smax, s);
+        }
+        
+        System.out.println(" smax: "+smax);
+        
         for (MaterialDisk disk : matdsk) {
             double s = _hutil.PathToZPlane(helix, disk.z());
-            if (s > 0.) {
+            if (s > 0. && s < smax) {
                 Hep3Vector pos = _hutil.PointOnHelix(helix, s);
                 double r = Math.sqrt(Math.pow(pos.x(), 2) + Math.pow(pos.y(),2));
                 if (r >= disk.rmin() && r <= disk.rmax()) {
@@ -125,33 +144,28 @@
                     double radlen = disk.ThicknessInRL() / Math.max(cth, .001);
                     double angle = msangle(helix.p(_bfield), radlen);
                     scatters.add(new ScatterAngle(s, angle));
-                    System.out.println(" Found disk material at s = "+s+" r = "+r+" z = "+disk.z());
-                    System.out.println("Disk location: "+disk.z()+" Helix z: "+pos.z());
                 }
             }
         }
         
         for (MaterialCylinder cyl : matcyl) {
             double r = cyl.radius();
-            double smin = _hutil.PathToZPlane(helix, cyl.zmin());
-            double smax = _hutil.PathToZPlane(helix, cyl.zmax());
-            if (smin > smax) {
-                double temp = smin;
-                smin = smax;
-                smax = temp;
+            double scmin = _hutil.PathToZPlane(helix, cyl.zmin());
+            double scmax = _hutil.PathToZPlane(helix, cyl.zmax());
+            if (scmin > scmax) {
+                double temp = scmin;
+                scmin = scmax;
+                scmax = temp;
             }
-            List<Double> pathlist = _hutil.PathToCylinder(helix, r, smax);
+            List<Double> pathlist = _hutil.PathToCylinder(helix, r, smax, _mxint);
             for (Double s : pathlist) {
-                if (s > smin && s < smax) {
+                if (s > scmin && s < scmax) {
                     Hep3Vector dir = _hutil.Direction(helix, s);
                     Hep3Vector pos = _hutil.PointOnHelix(helix, s);
                     double cth = ( pos.x() * dir.x() + pos.y() * dir.y() ) / r;
                     double radlen = cyl.ThicknessInRL() / Math.max(cth, 0.001);
                     double angle = msangle(helix.p(_bfield), radlen);
                     scatters.add(new ScatterAngle(s, angle));
-                    System.out.println(" Found cyl material at s = "+s+" r = "+r+" z = "+pos.z());
-                    double rh = Math.sqrt(Math.pow(pos.x(),2)+Math.pow(pos.y(),2));
-                    System.out.println("Cylinder radius: "+r+" Helix r: "+rh);
                 }
             }
         }
CVSspam 0.2.8