View Javadoc

1   package org.lcsim.geometry.compact.converter.lcdd;
2   
3   import org.jdom.DataConversionException;
4   import org.jdom.Element;
5   import org.jdom.Attribute;
6   import org.jdom.JDOMException;
7   import org.lcsim.geometry.compact.converter.lcdd.util.Calorimeter;
8   
9   /**
10   *
11   * LCDD binding for CartesianGridXZ segmentation.
12   *
13   * @author cassell
14   */
15  public class RegularNgonCartesianGridXZ extends LCDDSegmentation
16  {
17  
18      private double gridSizeX;
19      private double gridSizeZ;
20  
21      RegularNgonCartesianGridXZ(Element node) throws DataConversionException, JDOMException
22      {
23          super(node);
24  
25          Attribute attrib = node.getAttribute("gridSizeX");
26          if (attrib == null)
27          {
28              throw new JDOMException("Required attribute gridSizePhi was not found.");
29          }
30          gridSizeX = attrib.getDoubleValue();
31  
32          attrib = node.getAttribute("gridSizeZ");
33  
34          if (attrib == null)
35          {
36              throw new JDOMException("Required attribute gridSizeZ was not found.");
37          }
38          gridSizeZ = attrib.getDoubleValue();
39      }
40  
41      void setSegmentation(Calorimeter cal)
42      {
43          org.lcsim.geometry.compact.converter.lcdd.util.GridXYZ seg =
44                  new org.lcsim.geometry.compact.converter.lcdd.util.GridXYZ();
45          seg.setGridSizeX(gridSizeX);
46          seg.setGridSizeZ(gridSizeZ);
47          cal.setSegmentation(seg);
48      }
49  }