GeomConverter/src/org/lcsim/geometry
diff -u -r1.13 -r1.14
--- Calorimeter.java 22 May 2007 20:02:06 -0000 1.13
+++ Calorimeter.java 9 Dec 2009 01:23:44 -0000 1.14
@@ -6,5 +6,36 @@
*/
public interface Calorimeter extends Subdetector
{
- //public CalorimeterType getCalorimeterType();
+ enum CalorimeterType
+ {
+ UNKNOWN,
+ HAD_BARREL,
+ HAD_ENDCAP,
+ EM_BARREL,
+ EM_ENDCAP,
+ MUON_BARREL,
+ MUON_ENDCAP,
+ LUMI,
+ BEAM;
+ public static CalorimeterType fromString(final String s)
+ {
+ if (s.equals("HAD_BARREL")) return HAD_BARREL;
+ if (s.equals("HAD_ENDCAP")) return HAD_ENDCAP;
+ else if (s.equals("EM_BARREL")) return EM_BARREL;
+ else if (s.equals("EM_ENDCAP")) return EM_ENDCAP;
+ else if (s.equals("MUON_BARREL")) return MUON_BARREL;
+ else if (s.equals("MUON_ENDCAP")) return MUON_ENDCAP;
+ else if (s.equals("LUMI")) return LUMI;
+ else if (s.equals("BEAM")) return BEAM;
+ else return UNKNOWN;
+ }
+ }
+
+ public CalorimeterType getCalorimeterType();
+
+ // TODO: Implement these.
+ // public double getInnerRadius();
+ // public double getOuterRadius();
+ // public double getOuterZ();
+ // public double getInnerZ();
}
\ No newline at end of file
GeomConverter/src/org/lcsim/geometry/subdetector
diff -u -r1.7 -r1.8
--- AbstractCalorimeter.java 22 May 2007 20:02:07 -0000 1.7
+++ AbstractCalorimeter.java 9 Dec 2009 01:23:44 -0000 1.8
@@ -17,9 +17,22 @@
abstract class AbstractCalorimeter
extends AbstractLayeredSubdetector implements Calorimeter
{
+ Calorimeter.CalorimeterType calorimeterType = CalorimeterType.UNKNOWN;
+
public AbstractCalorimeter(Element node) throws JDOMException
{
super(node);
+ if (node.getAttribute("calorimeterType") != null)
+ {
+ calorimeterType =
+ CalorimeterType.fromString(
+ node.getAttributeValue("calorimeterType"));
+ }
+ }
+
+ public CalorimeterType getCalorimeterType()
+ {
+ return calorimeterType;
}
public boolean isCalorimeter()