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   * @author jeremym
12   */
13  public class NonprojectiveCylinder extends LCDDSegmentation
14  {
15      private double gridSizePhi;
16      private double gridSizeZ;
17  
18      NonprojectiveCylinder(Element node) throws DataConversionException, JDOMException
19      {
20          super(node);
21  
22          Attribute attrib = node.getAttribute("gridSizePhi");
23          if ( attrib == null )
24          {
25              throw new JDOMException("Required attribute gridSizePhi was not found.");
26          }
27          gridSizePhi = attrib.getDoubleValue();
28  
29          attrib = node.getAttribute("gridSizeZ");
30  
31          if ( attrib == null )
32          {
33              throw new JDOMException("Required attribute gridSizeZ was not found.");
34          }
35  
36          gridSizeZ = attrib.getDoubleValue();
37      }
38  
39      void setSegmentation(Calorimeter cal)
40      {
41          org.lcsim.geometry.compact.converter.lcdd.util.NonprojectiveCylinder npcyl = new org.lcsim.geometry.compact.converter.lcdd.util.NonprojectiveCylinder();
42          npcyl.setGridSizePhi(gridSizePhi);
43          npcyl.setGridSizeZ(gridSizeZ);
44          cal.setSegmentation(npcyl);
45      }
46  }