Print

Print


Commit in GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd on MAIN
DiskTracker.java+4-11.15 -> 1.16
LCDDSubdetector.java+68-191.7 -> 1.8
MultiLayerTracker.java+21.14 -> 1.15
+74-20
3 modified files
JM: Add support for LCDD combine_hits to compact description

GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd
DiskTracker.java 1.15 -> 1.16
diff -u -r1.15 -r1.16
--- DiskTracker.java	1 Dec 2005 04:11:10 -0000	1.15
+++ DiskTracker.java	22 Mar 2006 00:29:07 -0000	1.16
@@ -127,9 +127,12 @@
             solids.addContent(tube1);
             structure.addContent(volume1);
         }
+        
+        setCombineHits(node, sens);
     }
+    
     public boolean isTracker()
     {
         return true;
     }
-}
+}
\ No newline at end of file

GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd
LCDDSubdetector.java 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- LCDDSubdetector.java	28 Oct 2005 00:34:20 -0000	1.7
+++ LCDDSubdetector.java	22 Mar 2006 00:29:07 -0000	1.8
@@ -8,41 +8,48 @@
 import org.lcsim.geometry.compact.converter.lcdd.util.Region;
 import org.lcsim.geometry.compact.converter.lcdd.util.SensitiveDetector;
 import org.lcsim.geometry.compact.converter.lcdd.util.Volume;
+import org.lcsim.geometry.compact.converter.lcdd.util.Tracker;
 import org.lcsim.geometry.layer.Layering;
 
 /**
- *
+ * 
  * @author tonyj
  */
 public abstract class LCDDSubdetector extends Subdetector
 {
     protected Element node;
+
     protected Layering layers;
-    
+
     LCDDSubdetector(Element c) throws JDOMException
     {
         super(c);
         node = c;
-        
+
         /* make compact layering descr for thickness calcs in addToLCDD */
-        if ( layers == null )
+        if (layers == null)
         {
             layers = org.lcsim.geometry.layer.Layering.makeLayering(c);
         }
     }
-    
-    abstract void addToLCDD(LCDD lcdd, SensitiveDetector sens) throws JDOMException;
-    
+
+    abstract void addToLCDD(LCDD lcdd, SensitiveDetector sens)
+            throws JDOMException;
+
     public Element getElement()
     {
         return node;
     }
-  
+
     /**
-     * set limits for this volume 
-     * @param lcdd LCDD object currently being processed
-     * @param node Current DOM node (e.g. detector, layer, slice, etc.)
-     * @param volume The volume corresponding to the DOM node
+     * Set limits of an LCDD volume
+     * 
+     * @param lcdd
+     *            LCDD object currently being processed
+     * @param node
+     *            Current DOM node (e.g. detector, layer, slice, etc.)
+     * @param volume
+     *            The volume corresponding to the DOM node
      */
     public void setLimitSet(LCDD lcdd, Element node, Volume volume)
     {
@@ -50,17 +57,30 @@
         {
             String limitref = node.getAttributeValue("limits");
             LimitSet limitset = lcdd.getLimitSet(limitref);
-            if ( limitset != null )
+            if (limitset != null)
             {
                 volume.setLimitSet(limitset);
             }
-            else 
+            else
             {
-                throw new RuntimeException("limitset " + limitref + " does not exist");
+                throw new RuntimeException("limitset " + limitref
+                        + " does not exist");
             }
         }
     }
-    
+
+    /**
+     *
+     * Set the region of an LCDD volume
+     *      
+     * @param lcdd
+     *            LCDD object currently being processed
+     * @param node
+     *            Current DOM node (e.g. detector, layer, slice, etc.)
+     * @param volume
+     *            The volume corresponding to the DOM node 
+     * 
+     */
     public void setRegion(LCDD lcdd, Element node, Volume volume)
     {
         if (node.getAttribute("region") != null)
@@ -69,11 +89,40 @@
             Region region = lcdd.getRegion(regionref);
             if (region != null)
             {
-                volume.setRegion(region);                
+                volume.setRegion(region);
+            }
+            else
+            {
+                throw new RuntimeException("Region " + regionref
+                        + " does not exist");
+            }
+        }
+    }
+
+    /**     
+     * 
+     * Set combine_hits attribute of LCDD sensitive detector
+     * 
+     * @param node detector XML node
+     * @param sens sensitive detector which should be of type Tracker
+     */
+    public void setCombineHits(Element node, SensitiveDetector sens)
+    {
+        if (node.getAttribute("combineHits") != null)
+        {
+            try
+            {
+                if (node.getAttribute("combineHits").getBooleanValue() == true)
+                {
+                    if (sens instanceof Tracker)
+                    {
+                        sens.setAttribute("combine_hits", "true");
+                    }
+                }
             }
-            else 
+            catch (Exception e)
             {
-                throw new RuntimeException("Region " + regionref + " does not exist");
+                throw new RuntimeException(e);
             }
         }
     }

GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd
MultiLayerTracker.java 1.14 -> 1.15
diff -u -r1.14 -r1.15
--- MultiLayerTracker.java	7 Feb 2006 17:09:03 -0000	1.14
+++ MultiLayerTracker.java	22 Mar 2006 00:29:07 -0000	1.15
@@ -93,6 +93,8 @@
          solids.addSolid(tube1);
          structure.addVolume(volume1);
       }
+      
+      setCombineHits(node, sens);
    }
    public boolean isTracker()
    {
CVSspam 0.2.8