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