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