Print

Print


Commit in GeomConverter/src/org/lcsim/geometry on MAIN
Calorimeter.java+25-181.16 -> 1.17
compact/converter/pandora/Main.java+5-51.24 -> 1.25
subdetector/AbstractCalorimeter.java+4-1061.9 -> 1.10
           /AbstractLayeredSubdetector.java+100-31.6 -> 1.7
           /AbstractPolyhedraCalorimeter.java+1-231.12 -> 1.13
           /AbstractTestBeam.java+4-191.7 -> 1.8
           /CylindricalBarrelCalorimeter.java+1-11.10 -> 1.11
           /CylindricalCalorimeter.java+5-151.16 -> 1.17
           /TestBeamCalorimeter.java+51.10 -> 1.11
+150-190
9 modified files
more updates to new Calorimeter API; remove unneeded methods

GeomConverter/src/org/lcsim/geometry
Calorimeter.java 1.16 -> 1.17
diff -u -r1.16 -r1.17
--- Calorimeter.java	17 Nov 2010 00:13:43 -0000	1.16
+++ Calorimeter.java	22 Nov 2010 23:25:31 -0000	1.17
@@ -10,7 +10,7 @@
  * @author tonyj
  * @author jeremym
  * 
- * @version $Id: Calorimeter.java,v 1.16 2010/11/17 00:13:43 jeremy Exp $
+ * @version $Id: Calorimeter.java,v 1.17 2010/11/22 23:25:31 jeremy Exp $
  */
 public interface Calorimeter extends Subdetector
 {	   
@@ -101,27 +101,13 @@
      * Get the inner phi angle subtended by one calorimeter section or 0 if NA.
      * @return The phi angle of one section.
      */
-    public double getInnerPhi();
+    public double getSectionPhi();
     
     /**
-     * Get the outer phi angle subtended by one calorimeter section or 0 if NA.
-     * Typically this is the same as {@link #getInnerPhi()}.
-     * @return The outer phi angle of one section.
-     */
-    public double getOuterPhi();
-    
-    /**
-     * Get the inner number of sides of this calorimeter or 0 if NA.
+     * Get the number of sides of this calorimeter or 0 if NA.
      * @return The inner number of sides.
      */
-    public int getInnerNumberOfSides();
-    
-    /**
-     * Get the outer number of sides of this calorimeter or 0 if NA.
-     * Typically this is the same as {@link #getInnerNumberOfSides()}.
-     * @return The outer number of sides.
-     */
-    public int getOuterNumberOfSides();
+    public int getNumberOfSides();   
     
     /**
      * Get the number of layers in the Calorimeter.
@@ -156,6 +142,27 @@
     public double getSensorThickness(int layern);
     
     /**
+     * Get the number of interaction lengths in the layer.
+     * @param layern The layer number.
+     * @return The number of interaction lengths.
+     */
+    public double getNumberOfInteractionLengths( int layern );
+
+    /**
+     * Get the number of radiation lengths in the layer.
+     * @param layern The layer number.
+     * @return The number of radiation lengths.
+     */
+    public double getNumberOfRadiationLengths( int layern );
+    
+    /**
+     * Get MIP energy loss in GeV in this layer.
+     * @param layern The layer number.
+     * @return MIP energy loss.
+     */
+    public double getDe( int layern );
+    
+    /**
      * Get the cell U dimension.
      * @return The cell U dimension.
      */

GeomConverter/src/org/lcsim/geometry/compact/converter/pandora
Main.java 1.24 -> 1.25
diff -u -r1.24 -r1.25
--- Main.java	8 Nov 2010 18:13:48 -0000	1.24
+++ Main.java	22 Nov 2010 23:25:31 -0000	1.25
@@ -53,7 +53,7 @@
  * geometry input format.
  * 
  * @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: Main.java,v 1.24 2010/11/08 18:13:48 jeremy Exp $
+ * @version $Id: Main.java,v 1.25 2010/11/22 23:25:31 jeremy Exp $
  */
 public class Main implements Converter
 {
@@ -429,12 +429,12 @@
                     calorimeter.setAttribute("type", Calorimeter.CalorimeterType.toString(calType));
                     calorimeter.setAttribute("innerR", Double.toString(polycal.getInnerR()));
                     calorimeter.setAttribute("innerZ", Double.toString(polycal.getInnerZ()));
-                    calorimeter.setAttribute("innerPhi", Double.toString(polycal.getInnerPhi()));
-                    calorimeter.setAttribute("innerSymmetryOrder", Double.toString(polycal.getInnerNumberOfSides()));
+                    calorimeter.setAttribute("innerPhi", Double.toString(polycal.getSectionPhi()));
+                    calorimeter.setAttribute("innerSymmetryOrder", Double.toString(polycal.getNumberOfSides()));
                     calorimeter.setAttribute("outerR", Double.toString(polycal.getOuterR()));
                     calorimeter.setAttribute("outerZ", Double.toString(polycal.getOuterZ()));
-                    calorimeter.setAttribute("outerPhi", Double.toString(polycal.getOuterPhi()));
-                    calorimeter.setAttribute("outerSymmetryOrder", Double.toString(polycal.getOuterNumberOfSides()));
+                    calorimeter.setAttribute("outerPhi", Double.toString(polycal.getSectionPhi()));
+                    calorimeter.setAttribute("outerSymmetryOrder", Double.toString(polycal.getNumberOfSides()));
                     calorimeter.setAttribute("collection", subdetector.getReadout().getName());
 
                     // Get the cell sizes from the segmentation.

GeomConverter/src/org/lcsim/geometry/subdetector
AbstractCalorimeter.java 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- AbstractCalorimeter.java	17 Nov 2010 00:13:44 -0000	1.9
+++ AbstractCalorimeter.java	22 Nov 2010 23:25:31 -0000	1.10
@@ -18,8 +18,6 @@
 import org.jdom.JDOMException;
 import org.lcsim.detector.material.BetheBlochCalculator;
 import org.lcsim.detector.material.IMaterial;
-import org.lcsim.detector.material.IMaterialStore;
-import org.lcsim.detector.material.MaterialStore;
 import org.lcsim.geometry.Calorimeter;
 import org.lcsim.geometry.compact.Segmentation;
 import org.lcsim.geometry.layer.Layer;
@@ -30,18 +28,13 @@
 /**
  *
  * @author Jeremy McCormick
- * @version $Id: AbstractCalorimeter.java,v 1.9 2010/11/17 00:13:44 jeremy Exp $
+ * @version $Id: AbstractCalorimeter.java,v 1.10 2010/11/22 23:25:31 jeremy Exp $
  */
 abstract class AbstractCalorimeter
         extends AbstractLayeredSubdetector implements Calorimeter
 {    
     Calorimeter.CalorimeterType calorimeterType = CalorimeterType.UNKNOWN;
-    
-    private List<Double> nrad;
-    private List<Double> nlam;
-    private List<Double> de;
-    private Map<String, Double> dedxmap = new HashMap<String, Double>();
-    
+        
     public AbstractCalorimeter(Element node) throws JDOMException
     {
         super(node);                
@@ -52,17 +45,7 @@
         if (node.getAttribute("calorimeterType") != null)
         {
             calorimeterType = CalorimeterType.fromString( node.getAttributeValue( "calorimeterType" ) );
-        }
-        
-        // Initialize parameter arrays using layer count.
-        //System.out.println("nlayers = " + this.getLayering().getNumberOfLayers());
-        nrad = new ArrayList<Double>( this.getLayering().getNumberOfLayers() );
-        //System.out.println("nrad_size = " + nrad.size());
-        de = new ArrayList<Double>( this.getLayering().getNumberOfLayers() );
-        nlam = new ArrayList<Double>( this.getLayering().getNumberOfLayers() );
-        
-        // Compute layer derived quantities.
-        computeLayerParameters();
+        }        
     }
     
     public CalorimeterType getCalorimeterType()
@@ -83,90 +66,5 @@
     public double getCellSizeV()
     {
         return ((Segmentation)this.getIDDecoder()).getCellSizeV();
-    }
-    
-    /**
-     * Compute the radiation and interaction lengths for each layer of this subdetector.
-     * FIXME Access to the dedx information by material name should be moved into IMaterial 
-     *       interface because map is duplicated across subdetectors.  The map could also be
-     *       made static.
-     */
-    private void computeLayerParameters()
-    {
-        //System.out.println("nlayers = " + this.getLayering().getNumberOfLayers());
-        
-        //IMaterialStore ms = MaterialStore.getInstance();
-        int nlayers = this.getNumberOfLayers();
-        Hep3Vector p = new BasicHep3Vector( 0., 0., 100. );
-        for (int j = 0; j < nlayers; j++)
-        {
-            //System.out.println("computing layer = " + j);
-            Layer layer = getLayering().getLayer( j );
-            double xrad = 0.;
-            double xlam = 0.;
-            double xde = 0.;
-            for (LayerSlice slice : layer.getSlices())
-            {
-                Material m = slice.getMaterial();
-                String materialName = m.getName(); 
-                //String materialName = slice.getMaterial().getName();
-                //Material m = ms.get( materialName );
-                //if (m == null)
-                //    throw new RuntimeException( "Material <" + materialName + "> not found.");
-                double dedx;
-                if (dedxmap.containsKey( materialName ))
-                    dedx = dedxmap.get( materialName ).doubleValue();
-                else
-                {
-                    //dedx = BetheBlochCalculator.computeBetheBloch( m, p, 105., 1., .01 ) / 10000.;
-                    //BetheBlochCalculator.computeBetheBloch( material, p, mass, charge, distance )
-                    
-                    // Kludge to get material state to avoid using IMaterial objects that are not
-                    // instantiated yet.
-                    MaterialState state = m.getState();
-                    IMaterial.State istate = null;
-                    if (state == MaterialState.GAS)
-                    {
-                        istate = IMaterial.Gas;
-                    }
-                    else if (state == MaterialState.LIQUID)
-                    {
-                        istate = IMaterial.Liquid;
-                    }
-                    else if (state == MaterialState.SOLID)
-                    {
-                        istate = IMaterial.Solid;
-                    }
-                    else if (state == MaterialState.UNKNOWN)
-                    {
-                        istate = IMaterial.Unknown;
-                    }
-                    dedx = BetheBlochCalculator.computeBetheBloch(m.getZeff(), m.getAeff(), m.getDensity(), istate, m.getPressure(), m.getTemperature(), p, 105., 1., .01 ) / 10000;
-                    dedxmap.put( materialName, new Double( dedx ) );
-                }
-                double dx = slice.getThickness();
-                xrad += dx / m.getRadiationLengthWithDensity();
-                xlam += dx / m.getNuclearInteractionLengthWithDensity();
-                xde += dx * dedx;
-            }
-            nrad.add( j, new Double( xrad / 10. ) );
-            nlam.add( j, new Double( xlam / 10. ) );
-            de.add( j, new Double( xde ) );
-        }
-    }
-    
-    public double getNumberOfInteractionLengths( int layern )
-    {
-        return nlam.get( layern );
-    }
-    
-    public double getNumberOfRadiationLengths( int layern )
-    {
-        return nrad.get( layern );
-    }
-    
-    public double getDe( int layern )
-    {
-        return de.get(  layern );
-    }
+    }    
 }
\ No newline at end of file

GeomConverter/src/org/lcsim/geometry/subdetector
AbstractLayeredSubdetector.java 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- AbstractLayeredSubdetector.java	17 Nov 2010 00:13:44 -0000	1.6
+++ AbstractLayeredSubdetector.java	22 Nov 2010 23:25:31 -0000	1.7
@@ -19,13 +19,12 @@
 import org.jdom.JDOMException;
 import org.lcsim.detector.material.BetheBlochCalculator;
 import org.lcsim.detector.material.IMaterial;
-import org.lcsim.detector.material.IMaterialStore;
-import org.lcsim.detector.material.MaterialStore;
-import org.lcsim.geometry.Calorimeter;
 import org.lcsim.geometry.Layered;
 import org.lcsim.geometry.layer.Layer;
 import org.lcsim.geometry.layer.LayerSlice;
 import org.lcsim.geometry.layer.Layering;
+import org.lcsim.material.Material;
+import org.lcsim.material.MaterialState;
 
 /**
  * 
@@ -34,6 +33,11 @@
 abstract class AbstractLayeredSubdetector extends AbstractSubdetector implements Layered
 {
     protected Layering layering;
+    
+    private List<Double> nrad;
+    private List<Double> nlam;
+    private List<Double> de;
+    private Map<String, Double> dedxmap = new HashMap<String, Double>();
 
     /**
      * Creates a new instance of a LayeredSubdetector
@@ -42,6 +46,14 @@
     {
         super( node );
         build( node );
+        
+        // Initialize parameter arrays using layer count.
+        nrad = new ArrayList<Double>( this.getLayering().getNumberOfLayers() );
+        de = new ArrayList<Double>( this.getLayering().getNumberOfLayers() );
+        nlam = new ArrayList<Double>( this.getLayering().getNumberOfLayers() );
+        
+        // Compute layer derived quantities.
+        computeLayerParameters();
     }
 
     private void build( Element node ) throws JDOMException
@@ -101,4 +113,89 @@
     {
         return this.layering.getLayer( layern ).getSensorThickness();
     }
+    
+    /**
+     * Compute the radiation and interaction lengths for each layer of this subdetector.
+     * FIXME Access to the dedx information by material name should be moved into IMaterial 
+     *       interface because map is duplicated across subdetectors.  The map could also be
+     *       made static.
+     */
+    private void computeLayerParameters()
+    {
+        //System.out.println("nlayers = " + this.getLayering().getNumberOfLayers());
+        
+        //IMaterialStore ms = MaterialStore.getInstance();
+        int nlayers = this.getNumberOfLayers();
+        Hep3Vector p = new BasicHep3Vector( 0., 0., 100. );
+        for (int j = 0; j < nlayers; j++)
+        {
+            //System.out.println("computing layer = " + j);
+            Layer layer = getLayering().getLayer( j );
+            double xrad = 0.;
+            double xlam = 0.;
+            double xde = 0.;
+            for (LayerSlice slice : layer.getSlices())
+            {
+                Material m = slice.getMaterial();
+                String materialName = m.getName(); 
+                //String materialName = slice.getMaterial().getName();
+                //Material m = ms.get( materialName );
+                //if (m == null)
+                //    throw new RuntimeException( "Material <" + materialName + "> not found.");
+                double dedx;
+                if (dedxmap.containsKey( materialName ))
+                    dedx = dedxmap.get( materialName ).doubleValue();
+                else
+                {
+                    //dedx = BetheBlochCalculator.computeBetheBloch( m, p, 105., 1., .01 ) / 10000.;
+                    //BetheBlochCalculator.computeBetheBloch( material, p, mass, charge, distance )
+                    
+                    // Kludge to get material state to avoid using IMaterial objects that are not
+                    // instantiated yet.
+                    MaterialState state = m.getState();
+                    IMaterial.State istate = null;
+                    if (state == MaterialState.GAS)
+                    {
+                        istate = IMaterial.Gas;
+                    }
+                    else if (state == MaterialState.LIQUID)
+                    {
+                        istate = IMaterial.Liquid;
+                    }
+                    else if (state == MaterialState.SOLID)
+                    {
+                        istate = IMaterial.Solid;
+                    }
+                    else if (state == MaterialState.UNKNOWN)
+                    {
+                        istate = IMaterial.Unknown;
+                    }
+                    dedx = BetheBlochCalculator.computeBetheBloch(m.getZeff(), m.getAeff(), m.getDensity(), istate, m.getPressure(), m.getTemperature(), p, 105., 1., .01 ) / 10000;
+                    dedxmap.put( materialName, new Double( dedx ) );
+                }
+                double dx = slice.getThickness();
+                xrad += dx / m.getRadiationLengthWithDensity();
+                xlam += dx / m.getNuclearInteractionLengthWithDensity();
+                xde += dx * dedx;
+            }
+            nrad.add( j, new Double( xrad / 10. ) );
+            nlam.add( j, new Double( xlam / 10. ) );
+            de.add( j, new Double( xde ) );
+        }
+    }
+    
+    public double getNumberOfInteractionLengths( int layern )
+    {
+        return nlam.get( layern );
+    }
+    
+    public double getNumberOfRadiationLengths( int layern )
+    {
+        return nrad.get( layern );
+    }
+    
+    public double getDe( int layern )
+    {
+        return de.get(  layern );
+    }
 }
\ No newline at end of file

GeomConverter/src/org/lcsim/geometry/subdetector
AbstractPolyhedraCalorimeter.java 1.12 -> 1.13
diff -u -r1.12 -r1.13
--- AbstractPolyhedraCalorimeter.java	17 Nov 2010 00:13:44 -0000	1.12
+++ AbstractPolyhedraCalorimeter.java	22 Nov 2010 23:25:31 -0000	1.13
@@ -80,19 +80,7 @@
     {
         return getSectionPhi() / 2;
     }
-    
-    // Parameters for Pandora.
-    
-    public int getInnerNumberOfSides() 
-    {    
-        return this.getNumberOfSides();
-    }
-
-    public double getInnerPhi() 
-    {
-        return getSectionPhi();
-    }
-
+            
     public double getInnerRadius() 
     {
         return this.getInnerR();
@@ -103,16 +91,6 @@
         return this.getZMin();
     }
 
-    public int getOuterNumberOfSides() 
-    { 
-        return this.getNumberOfSides();
-    }
-
-    public double getOuterPhi() 
-    {
-        return getSectionPhi();
-    }
-
     public double getOuterRadius() 
     {
         return getInnerRadius() + getLayering().getThickness();

GeomConverter/src/org/lcsim/geometry/subdetector
AbstractTestBeam.java 1.7 -> 1.8
diff -u -r1.7 -r1.8
--- AbstractTestBeam.java	17 Nov 2010 00:13:44 -0000	1.7
+++ AbstractTestBeam.java	22 Nov 2010 23:25:31 -0000	1.8
@@ -149,27 +149,12 @@
     {
         return 4;
     }
-    
-    public int getInnerNumberOfSides()
-    {
-        return 4;
-    }
-    
-    public int getOuterNumberOfSides()
-    {
-        return 4;
-    }
-    
-    public double getInnerPhi()
-    {
-        return (Math.PI) / 2;
-    }
-    
-    public double getOuterPhi()
+        
+    public double getsectionPhi()
     {
-        return (Math.PI) / 2;
+        return 0;
     }
-    
+        
     /**
      * FIXME Not adjusted for position.
      * @return

GeomConverter/src/org/lcsim/geometry/subdetector
CylindricalBarrelCalorimeter.java 1.10 -> 1.11
diff -u -r1.10 -r1.11
--- CylindricalBarrelCalorimeter.java	17 Nov 2010 00:13:44 -0000	1.10
+++ CylindricalBarrelCalorimeter.java	22 Nov 2010 23:25:31 -0000	1.11
@@ -69,5 +69,5 @@
     public double getZLength()
     {
         return this.maxZ * 2;
-    }
+    }   
 }

GeomConverter/src/org/lcsim/geometry/subdetector
CylindricalCalorimeter.java 1.16 -> 1.17
diff -u -r1.16 -r1.17
--- CylindricalCalorimeter.java	17 Nov 2010 00:13:44 -0000	1.16
+++ CylindricalCalorimeter.java	22 Nov 2010 23:25:31 -0000	1.17
@@ -63,23 +63,13 @@
         return innerR;
     }   
     
-    public int getInnerNumberOfSides()
+    public int getNumberOfSides()
     {
         return 0;
     }
-    
-    public int getOuterNumberOfSides()
+        
+    public double getSectionPhi()
     {
-        return 0;
-    }
-    
-    public double getInnerPhi()
-    {
-        return Math.PI/2;
-    }
-    
-    public double getOuterPhi()
-    {
-        return Math.PI/2;
-    }
+        return Math.PI*2;
+    }    
 }
\ No newline at end of file

GeomConverter/src/org/lcsim/geometry/subdetector
TestBeamCalorimeter.java 1.10 -> 1.11
diff -u -r1.10 -r1.11
--- TestBeamCalorimeter.java	17 Nov 2010 00:13:44 -0000	1.10
+++ TestBeamCalorimeter.java	22 Nov 2010 23:25:31 -0000	1.11
@@ -45,4 +45,9 @@
     {
         return ((Segmentation)this.getIDDecoder()).getCellSizeV();
     }
+
+    public double getSectionPhi()
+    {
+        return 0;
+    }
 }
\ No newline at end of file
CVSspam 0.2.8