Commit in GeomConverter on MAIN
resources/org/lcsim/schemas/compact/1.0/compact.xsd+2-11.9 -> 1.10
resources/org/lcsim/schemas/lcdd/1.0/lcdd_regions.xsd+11.1 -> 1.2
src/org/lcsim/geometry/compact/Region.java+54-741.3 -> 1.4
src/org/lcsim/geometry/compact/converter/lcdd/LCDDDetector.java+11.29 -> 1.30
                                             /PolyconeSupport.java+24-241.9 -> 1.10
src/org/lcsim/geometry/compact/converter/lcdd/util/Region.java+37-351.3 -> 1.4
src/org/lcsim/geometry/subdetector/PolyconeSupport.java+24-391.7 -> 1.8
+143-173
7 modified files
support for killing tracks in regions defined by compact description; setting will be copied to output LCDD files

GeomConverter/resources/org/lcsim/schemas/compact/1.0
compact.xsd 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- compact.xsd	24 Apr 2013 02:00:35 -0000	1.9
+++ compact.xsd	1 May 2013 20:48:35 -0000	1.10
@@ -88,7 +88,8 @@
                 <xs:element name="region" minOccurs="0" maxOccurs="unbounded">
                     <xs:complexType>
                         <xs:attribute name="name" type="xs:string" use="required"/>
-                        <xs:attribute name="store_secondaries" type="xs:boolean" default="false"/>
+                        <xs:attribute name="storeSecondaries" type="xs:boolean" default="false"/>
+                        <xs:attribute name="killTracks" type="xs:boolean" default="false"/>
                         <xs:attribute name="cut" type="xs:double" default="1.0" />
                         <xs:attribute name="lunit" type="xs:string" default="mm"/>
                         <xs:attribute name="threshold" type="xs:double" default="0.0"/>

GeomConverter/resources/org/lcsim/schemas/lcdd/1.0
lcdd_regions.xsd 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- lcdd_regions.xsd	14 Dec 2007 21:46:32 -0000	1.1
+++ lcdd_regions.xsd	1 May 2013 20:48:35 -0000	1.2
@@ -27,6 +27,7 @@
     </xs:sequence>
     <xs:attribute name="name" type="xs:ID" use="required"/>
     <xs:attribute name="store_secondaries" default="false" type="xs:boolean" />
+    <xs:attribute name="kill_tracks" default="false" type="xs:boolean" />
     <xs:attribute name="cut" default="1.0" type="xs:double"/>
     <xs:attribute name="lunit" default="mm" type="xs:string"/>
     <xs:attribute name="threshold" default="1.0" type="xs:double" />

GeomConverter/src/org/lcsim/geometry/compact
Region.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- Region.java	14 Dec 2005 19:56:45 -0000	1.3
+++ Region.java	1 May 2013 20:48:35 -0000	1.4
@@ -4,116 +4,96 @@
 import org.jdom.DataConversionException;
 
 /**
- *
+ * 
  * @author jeremym
  */
-public class Region
-{
+public class Region {
+
     private String name;
-    private boolean storeSecondaries;
+    private boolean storeSecondaries = false;
+    private boolean killTracks = false;
     private double rangeCut;
     private String lunit;
     private double energyThreshold;
     private String eunit;
-    
-    protected Region(Element node)
-    {
+
+    protected Region(Element node) {
         name = node.getAttributeValue("name");
-        
-        try
-        {
-            if (node.getAttribute("store_secondaries") != null)
-            {
-                storeSecondaries = node.getAttribute("store_secondaries").getBooleanValue();
-            }
-            else
-            {
-                storeSecondaries = false;
+
+        try {
+            if (node.getAttribute("storeSecondaries") != null) {
+                storeSecondaries = node.getAttribute("storeSecondaries").getBooleanValue();
             }
-        }
-        catch (DataConversionException dce)
-        {
-            throw new RuntimeException("Problem converting "+node.getAttributeValue("store_secondaries") + " to boolean", dce);
+        } catch (DataConversionException dce) {
+            throw new RuntimeException("Problem converting " + node.getAttributeValue("storeSecondaries") + " to boolean", dce);
         }
         
-        try
-        {
-            if (node.getAttribute("cut") != null)
-            {
+        try {
+            if (node.getAttribute("killTracks") != null) {
+                killTracks = node.getAttribute("killTracks").getBooleanValue();
+            }
+        } catch (DataConversionException dce) {
+            throw new RuntimeException("Problem converting to boolean: " + node.getAttributeValue("killTracks"));
+        }
+
+        try {
+            if (node.getAttribute("cut") != null) {
                 rangeCut = node.getAttribute("cut").getDoubleValue();
-            }
-            else
-            {
+            } else {
                 rangeCut = 1.0;
             }
+        } catch (DataConversionException dce) {
+            throw new RuntimeException("Problem converting " + node.getAttributeValue("cut") + " to double", dce);
         }
-        catch (DataConversionException dce)
-        {
-            throw new RuntimeException("Problem converting "+node.getAttributeValue("cut") + " to double", dce);
-        }
-        
-        if (node.getAttribute("lunit") != null)
-        {
+
+        if (node.getAttribute("lunit") != null) {
             lunit = node.getAttributeValue("lunit");
-        }
-        else
-        {
+        } else {
             lunit = "mm";
         }
-        
-        try
-        {
-            if (node.getAttribute("threshold") != null)
-            {
+
+        try {
+            if (node.getAttribute("threshold") != null) {
                 energyThreshold = node.getAttribute("threshold").getDoubleValue();
-            }
-            else
-            {
+            } else {
                 energyThreshold = 0.0;
             }
+        } catch (DataConversionException dce) {
+            throw new RuntimeException("Problem converting " + node.getAttributeValue("threshold") + " to double", dce);
         }
-        catch (DataConversionException dce)
-        {
-            throw new RuntimeException("Problem converting "+node.getAttributeValue("threshold") + " to double", dce);
-        }
-        
-        if (node.getAttribute("eunit") != null)
-        {
+
+        if (node.getAttribute("eunit") != null) {
             eunit = node.getAttributeValue("eunit");
-        }
-        else
-        {
+        } else {
             eunit = "MeV";
-        }        
+        }
     }
-    
-    public String getName()
-    {
+
+    public String getName() {
         return name;
     }
-    
-    public boolean getStoreSecondaries()
-    {
+
+    public boolean getStoreSecondaries() {
         return storeSecondaries;
     }
     
-    public double getRangeCut()
-    {
+    public boolean getKillTracks() {
+        return killTracks;
+    }
+
+    public double getRangeCut() {
         return rangeCut;
     }
-    
-    public String getLengthUnit()
-    {
+
+    public String getLengthUnit() {
         return lunit;
     }
-    
-    public double getEnergyThreshold()
-    {
+
+    public double getEnergyThreshold() {
         return energyThreshold;
     }
-    
-    public String getEnergyUnit()
-    {
+
+    public String getEnergyUnit() {
         return eunit;
     }
 }
\ No newline at end of file

GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd
LCDDDetector.java 1.29 -> 1.30
diff -u -r1.29 -r1.30
--- LCDDDetector.java	24 Apr 2013 20:07:40 -0000	1.29
+++ LCDDDetector.java	1 May 2013 20:48:35 -0000	1.30
@@ -239,6 +239,7 @@
         for (org.lcsim.geometry.compact.Region region : getRegions().values()) {
             Region lcddRegion = new Region(region.getName());
             lcddRegion.setStoreSecondaries(region.getStoreSecondaries());
+            lcddRegion.setKillTracks(region.getKillTracks());
             lcddRegion.setThreshold(region.getEnergyThreshold());
             lcddRegion.setEnergyUnit(region.getEnergyUnit());
             lcddRegion.setLengthUnit(region.getLengthUnit());

GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd
PolyconeSupport.java 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- PolyconeSupport.java	20 Feb 2009 22:19:42 -0000	1.9
+++ PolyconeSupport.java	1 May 2013 20:48:35 -0000	1.10
@@ -19,63 +19,63 @@
 
 /**
  * -reorganize and rename 090220 JM
+ * 
  * @author jeremym
  */
-public class PolyconeSupport extends LCDDSubdetector
-{
-    
+public class PolyconeSupport extends LCDDSubdetector {
+
     private Element node;
-    
+
     /** Creates a new instance of PolyconeSupport */
-    public PolyconeSupport(Element node) throws JDOMException
-    {
+    public PolyconeSupport(Element node) throws JDOMException {
         super(node);
         this.node = node;
     }
-    
-    public void addToLCDD(LCDD lcdd, SensitiveDetector sens) throws JDOMException
-    {                     
+
+    public void addToLCDD(LCDD lcdd, SensitiveDetector sens) throws JDOMException {
+        
         // Get the lcdd data structures.
         Solids solids = lcdd.getSolids();
         Structure structure = lcdd.getStructure();
-             
+
         // Name of support structure.
         String supportName = node.getAttributeValue("name");
-        
+
         // polycone solid
-        Polycone pc = new Polycone(supportName + "_envelope_polycone", 0, 2.*Math.PI, node);
+        Polycone pc = new Polycone(supportName + "_envelope_polycone", 0, 2. * Math.PI, node);
         solids.addSolid(pc);
-        
+
         // Material is required.
         Element matElem = node.getChild("material");
-        if ( matElem == null )
-        {
+        if (matElem == null) {
             throw new JDOMException("Required material element not found.");
         }
         Material mat = lcdd.getMaterial(matElem.getAttributeValue("name"));
-        
+
         // Material was not found.
-        if ( mat == null )
-        {
+        if (mat == null) {
             throw new JDOMException("Material not found in compact file.");
         }
-        
+
         // Create the volume.
         Volume vol = new Volume(supportName + "_envelope_volume");
         vol.setMaterial(mat);
         vol.setSolid(pc);
         
+        // Set region.
+        setRegion(lcdd, mat, vol);
+
         // Set the volume display.
-        this.setVisAttributes(lcdd, node, vol);
-        
+        setVisAttributes(lcdd, node, vol);
+
         // Add the volume to lcdd.
         structure.addVolume(vol);
-        
+
         // Let lcdd pick the mother volume.
         Volume motherVolume = lcdd.pickMotherVolume(this);
-        
+
         // Finally, make the physical volume. (supports have no id)
         PhysVol physvol = new PhysVol(vol);
-        motherVolume.addPhysVol(physvol);       
+        motherVolume.addPhysVol(physvol);
     }
 }
\ No newline at end of file

GeomConverter/src/org/lcsim/geometry/compact/converter/lcdd/util
Region.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- Region.java	28 Oct 2005 00:34:22 -0000	1.3
+++ Region.java	1 May 2013 20:48:35 -0000	1.4
@@ -1,41 +1,43 @@
 package org.lcsim.geometry.compact.converter.lcdd.util;
 
 /**
- *
+ * 
  * @author tonyj
  */
-public class Region extends RefElement
-{
-   public Region(String name)
-   {
-      super("region",name);
-      setAttribute("store_secondaries","false");
-      setAttribute("cut","10.0");
-      setAttribute("lunit","mm");
-      setAttribute("threshold","0.0");
-      setAttribute("eunit","MeV");
-   }
-   public void setStoreSecondaries(boolean store)
-   {
-      setAttribute("store_secondaries",String.valueOf(store));      
-   }
-   public void setThreshold(double mev)
-   {
-      setAttribute("threshold",String.valueOf(mev));      
-   }
-   
-   public void setEnergyUnit(String eunit)
-   {
-       setAttribute("eunit", eunit);
-   }
-   
-   public void setLengthUnit(String lunit)
-   {
-       setAttribute("lunit", lunit);
-   }
-   
-   public void setCut(double cut)
-   {
-       setAttribute("cut", String.valueOf(cut));
-   }
+public class Region extends RefElement {
+
+    public Region(String name) {
+        super("region", name);
+        setAttribute("store_secondaries", "false");
+        setAttribute("kill_tracks", "false");
+        setAttribute("cut", "10.0");
+        setAttribute("lunit", "mm");
+        setAttribute("threshold", "0.0");
+        setAttribute("eunit", "MeV");
+
+    }
+
+    public void setStoreSecondaries(boolean store) {
+        setAttribute("store_secondaries", String.valueOf(store));
+    }
+    
+    public void setKillTracks(boolean killTracks) {
+        setAttribute("kill_tracks", String.valueOf(killTracks));
+    }
+
+    public void setThreshold(double mev) {
+        setAttribute("threshold", String.valueOf(mev));
+    }
+
+    public void setEnergyUnit(String eunit) {
+        setAttribute("eunit", eunit);
+    }
+
+    public void setLengthUnit(String lunit) {
+        setAttribute("lunit", lunit);
+    }
+
+    public void setCut(double cut) {
+        setAttribute("cut", String.valueOf(cut));
+    }
 }

GeomConverter/src/org/lcsim/geometry/subdetector
PolyconeSupport.java 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- PolyconeSupport.java	11 Mar 2011 19:22:20 -0000	1.7
+++ PolyconeSupport.java	1 May 2013 20:48:35 -0000	1.8
@@ -17,76 +17,61 @@
 
 /**
  * @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: PolyconeSupport.java,v 1.7 2011/03/11 19:22:20 jeremy Exp $
+ * @version $Id: PolyconeSupport.java,v 1.8 2013/05/01 20:48:35 jeremy Exp $
  */
-public class PolyconeSupport extends AbstractSubdetector
-{
-    List< ZPlane > zplanes = new ArrayList< ZPlane >();
+public class PolyconeSupport extends AbstractSubdetector {
+
+    List<ZPlane> zplanes = new ArrayList<ZPlane>();
     Material material;
 
-    public PolyconeSupport( Element node ) throws JDOMException
-    {
-        super( node );
-        material = MaterialManager.instance().getMaterial( node.getChild( "material" ).getAttributeValue(
-                "name" ) );
-        for ( Iterator i = node.getChildren( "zplane" ).iterator(); i.hasNext(); )
-        {
-            try
-            {
-                Element zplane = ( Element ) i.next();
-                zplanes.add( new ZPlane( zplane.getAttribute( "rmin" ).getDoubleValue(), zplane.getAttribute( "rmax" )
-                        .getDoubleValue(), zplane.getAttribute( "z" ).getDoubleValue() ) );
-            }
-            catch ( DataConversionException dce )
-            {
-                throw new RuntimeException( "bad values to zplane", dce );
+    public PolyconeSupport(Element node) throws JDOMException {
+        super(node);
+        material = MaterialManager.instance().getMaterial(node.getChild("material").getAttributeValue("name"));
+        for (Iterator i = node.getChildren("zplane").iterator(); i.hasNext();) {
+            try {
+                Element zplane = (Element) i.next();
+                zplanes.add(new ZPlane(zplane.getAttribute("rmin").getDoubleValue(), zplane.getAttribute("rmax").getDoubleValue(), zplane.getAttribute("z").getDoubleValue()));
+            } catch (DataConversionException dce) {
+                throw new RuntimeException("bad values to zplane", dce);
             }
         }
     }
 
-    public Material getMaterial()
-    {
+    public Material getMaterial() {
         return material;
     }
 
-    public List< ZPlane > getZPlanes()
-    {
+    public List<ZPlane> getZPlanes() {
         return zplanes;
     }
 
-    public int getNumberOfZPlanes()
-    {
+    public int getNumberOfZPlanes() {
         return zplanes.size();
     }
 
-    public ZPlane getZPlane( int idx )
-    {
-        return zplanes.get( idx );
+    public ZPlane getZPlane(int idx) {
+        return zplanes.get(idx);
     }
 
-    public static class ZPlane
-    {
+    public static class ZPlane {
+
         double rmin, rmax, z;
 
-        public ZPlane( double rmin, double rmax, double z )
-        {
+        public ZPlane(double rmin, double rmax, double z) {
             this.rmin = rmin;
             this.rmax = rmax;
             this.z = z;
         }
 
-        public double getRMin()
-        {
+        public double getRMin() {
             return rmin;
         }
 
-        public double getRMax()
-        {
+        public double getRMax() {
             return rmax;
         }
 
-        public double getZ()
-        {
+        public double getZ() {
             return z;
         }
     }
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