View Javadoc

1   package org.lcsim.geometry.subdetector;
2   
3   import hep.graphics.heprep.HepRep;
4   import hep.graphics.heprep.HepRepFactory;
5   
6   import org.jdom.Element;
7   import org.jdom.JDOMException;
8   import org.lcsim.detector.converter.heprep.DetectorElementToHepRepConverter;
9   
10  /**
11   * @author Jeremy McCormick <jeremym@slac.stanford.edu>
12   * @version $Id: PolyhedraBarrelCalorimeter.java,v 1.15 2012/01/30 13:43:47 jeremy Exp $
13   */
14  public class PolyhedraBarrelCalorimeter extends AbstractPolyhedraCalorimeter
15  {
16      public PolyhedraBarrelCalorimeter( Element node ) throws JDOMException
17      {
18          super( node );
19  
20          // Setup parameters from XML.
21          zlength = node.getChild( "dimensions" ).getAttribute( "z" ).getDoubleValue();
22          outerZ = zlength / 2;
23          innerZ = -outerZ;
24          innerRadius = node.getChild( "dimensions" ).getAttribute( "rmin" ).getDoubleValue();
25          outerRadius = computeBarrelOuterRadius();
26      }
27  
28      public boolean isBarrel()
29      {
30          return true;
31      }
32  
33      public void appendHepRep( HepRepFactory factory, HepRep heprep )
34      {
35          DetectorElementToHepRepConverter.convert( getDetectorElement(), factory, heprep, 2, false, getVisAttributes().getColor() );
36      }
37  }