1
2
3
4
5
6 package org.lcsim.geometry.subdetector;
7
8 import hep.graphics.heprep.HepRep;
9 import hep.graphics.heprep.HepRepFactory;
10
11 import org.jdom.Element;
12 import org.jdom.JDOMException;
13 import org.lcsim.detector.converter.heprep.DetectorElementToHepRepConverter;
14
15
16
17
18
19 public class PolyhedraEndcapCalorimeter extends AbstractPolyhedraCalorimeter
20 {
21 private double zmin;
22 private double zmax;
23
24 public PolyhedraEndcapCalorimeter( Element node ) throws JDOMException
25 {
26 super( node );
27 build( node );
28 }
29
30 private void build( Element node ) throws JDOMException
31 {
32 Element dimensions = node.getChild( "dimensions" );
33
34 innerZ = dimensions.getAttribute( "zmin" ).getDoubleValue();
35 outerZ = innerZ + getLayering().getThickness();
36 zlength = outerZ - innerZ;
37
38 innerRadius = dimensions.getAttribute( "rmin" ).getDoubleValue();
39 outerRadius = dimensions.getAttribute( "rmax" ).getDoubleValue();
40
41
42 getLayering().setOffset( innerZ );
43 }
44
45 public void appendHepRep( HepRepFactory factory, HepRep heprep )
46 {
47 DetectorElementToHepRepConverter.convert( getDetectorElement(), factory, heprep, 2, true, getVisAttributes().getColor() );
48 }
49
50 public boolean isEndcap()
51 {
52 return true;
53 }
54 }