View Javadoc

1   /*
2    * PolyhedraBarrelCalorimeter.java
3    * 
4    * Created on August 24, 2005, 9:37 PM
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   * @author Jeremy McCormick <jeremym@slac.stanford.edu>
17   * @version $Id: PolyhedraBarrelCalorimeter2.java,v 1.5 2012/01/30 13:43:47 jeremy Exp $
18   */
19  public class PolyhedraBarrelCalorimeter2 extends AbstractPolyhedraCalorimeter
20  {
21      public PolyhedraBarrelCalorimeter2( Element node ) throws JDOMException
22      {
23          super( node );
24  
25          // Setup parameters from XML.
26          zlength = node.getChild( "dimensions" ).getAttribute( "z" ).getDoubleValue();
27          outerZ = zlength / 2;
28          innerZ = -outerZ;
29          innerRadius = node.getChild( "dimensions" ).getAttribute( "rmin" ).getDoubleValue();
30          outerRadius = computeBarrelOuterRadius();
31      }
32  
33      public boolean isBarrel()
34      {
35          return true;
36      }
37  
38      public void appendHepRep( HepRepFactory factory, HepRep heprep )
39      {
40          DetectorElementToHepRepConverter.convert( getDetectorElement(), factory, heprep, 2, false, getVisAttributes().getColor() );
41      }
42  }