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