View Javadoc

1   package org.lcsim.geometry.subdetector;
2   
3   import org.jdom.Element;
4   import org.jdom.JDOMException;
5   import org.lcsim.geometry.Calorimeter;
6   import org.lcsim.geometry.compact.Segmentation;
7   
8   /**
9    * The common base class for Calorimeter subdetectors.     
10   *
11   * @see org.lcsim.geometry.Calorimeter;
12   *                                      
13   * @author Jeremy McCormick
14   * @version $Id: AbstractCalorimeter.java,v 1.12 2011/01/04 21:58:51 jeremy Exp $
15   */
16  abstract class AbstractCalorimeter extends AbstractLayeredSubdetector implements Calorimeter
17  {
18      // Type of Calorimeter from CalorimeterType enum.
19      CalorimeterType calorimeterType = CalorimeterType.UNKNOWN;
20      
21      // Parameters for methods defined in Calorimeter interface.
22      protected double innerRadius;
23      protected double outerRadius;
24      protected double innerZ;
25      protected double outerZ;
26      protected double zlength;
27      protected double sectionPhi;
28      protected int nsides;
29  
30      public AbstractCalorimeter( Element node ) throws JDOMException
31      {
32          super( node );
33  
34          // Set the calorimeterType from compact description calorimeterType field.
35          if ( node.getAttribute( "calorimeterType" ) != null )
36          {
37              calorimeterType = CalorimeterType.fromString( node.getAttributeValue( "calorimeterType" ) );
38          }
39      }
40  
41      /**
42       * Get the CalorimeterType of this Calorimeter.
43       * @return The CalorimeterType.
44       */
45      public CalorimeterType getCalorimeterType()
46      {
47          return calorimeterType;
48      }
49  
50      /**
51       * Implementation of Subdetector method.
52       * @return True.
53       */
54      public boolean isCalorimeter()
55      {
56          return true;
57      }
58      
59      public double getTotalThickness()
60      {
61          return layering.getThickness();
62      }
63      
64      /**
65       * Get the cell U dimension from the segmentation.
66       * @return The cell U dimension.
67       */
68      public double getCellSizeU()
69      {
70          return ( ( Segmentation ) this.getIDDecoder() ).getCellSizeU();
71      }
72  
73      /**
74       * Get cell V dimension from the segmentation.
75       * @return The cell V dimension.
76       */
77      public double getCellSizeV()
78      {
79          return ( ( Segmentation ) this.getIDDecoder() ).getCellSizeV();
80      }
81  }