1 package org.lcsim.geometry.subdetector;
2
3 import hep.graphics.heprep.HepRep;
4 import hep.graphics.heprep.HepRepFactory;
5 import hep.graphics.heprep.HepRepInstance;
6 import hep.graphics.heprep.HepRepInstanceTree;
7 import hep.graphics.heprep.HepRepType;
8 import hep.graphics.heprep.HepRepTypeTree;
9
10 import org.jdom.Element;
11 import org.jdom.JDOMException;
12 import org.lcsim.detector.converter.heprep.DetectorElementToHepRepConverter;
13
14
15
16
17
18 public class CylindricalBarrelCalorimeter extends CylindricalCalorimeter
19 {
20 public CylindricalBarrelCalorimeter( Element node ) throws JDOMException
21 {
22 super( node );
23 build( node );
24 }
25
26 public boolean isBarrel()
27 {
28 return true;
29 }
30
31 private void build( Element node ) throws JDOMException
32 {
33 Element dimensions = node.getChild( "dimensions" );
34
35 outerR = innerR + getLayering().getThickness();
36 maxZ = dimensions.getAttribute( "outer_z" ).getDoubleValue();
37 minZ = -maxZ;
38 zlength = maxZ * 2;
39
40 getLayering().setOffset( innerR );
41 }
42
43 public void appendHepRep( HepRepFactory factory, HepRep heprep )
44 {
45 DetectorElementToHepRepConverter.convert( getDetectorElement(), factory, heprep, 1, false, getVisAttributes().getColor() );
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67 }
68
69 public double getZLength()
70 {
71 return this.maxZ * 2;
72 }
73 }