1
2
3
4
5
6
7 package org.lcsim.geometry.subdetector;
8
9 import hep.graphics.heprep.HepRep;
10 import hep.graphics.heprep.HepRepFactory;
11 import org.jdom.DataConversionException;
12 import org.jdom.Element;
13 import org.jdom.JDOMException;
14
15
16
17
18
19 public class ForwardDetector extends CylindricalEndcapCalorimeter
20 {
21 private double crossingAngle;
22 private double outgoingRadius;
23 private double incomingRadius;
24
25
26 public ForwardDetector( Element node ) throws JDOMException, DataConversionException
27 {
28 super( node );
29
30 Element beamElem = node.getChild( "beampipe" );
31
32 if ( beamElem == null )
33 {
34 throw new JDOMException( "ForwardDetector - Missing required beampipe element." );
35 }
36
37 if ( beamElem.getAttribute( "crossing_angle" ) != null )
38 {
39 crossingAngle = beamElem.getAttribute( "crossing_angle" ).getDoubleValue();
40 }
41 else
42 {
43 throw new JDOMException( "ForwardDetector - Missing required crossing_angle attribute." );
44 }
45
46 if ( beamElem.getAttribute( "outgoing_r" ) != null )
47 {
48 outgoingRadius = beamElem.getAttribute( "outgoing_r" ).getDoubleValue();
49 }
50 else
51 {
52 throw new JDOMException( "ForwardDetector - Missing required outgoing_r attribute." );
53 }
54
55 if ( beamElem.getAttribute( "incoming_r" ) != null )
56 {
57 incomingRadius = beamElem.getAttribute( "incoming_r" ).getDoubleValue();
58 }
59 else
60 {
61 throw new JDOMException( "ForwardDetector - Missing required incoming_r attribute." );
62 }
63 }
64
65
66
67
68 public void appendHepRep( HepRepFactory factory, HepRep heprep )
69 {
70 super.appendHepRep( factory, heprep );
71 }
72
73 public double getCrossingAngle()
74 {
75 return crossingAngle;
76 }
77
78 public double getOutgoingRadius()
79 {
80 return outgoingRadius;
81 }
82
83 public double getIncomingRadius()
84 {
85 return incomingRadius;
86 }
87 }