Commit in GeomConverter/src/org/lcsim/geometry/compact/converter/pandora on MAIN
Main.java+12-131.23 -> 1.24
add detector name to pandora geometry data description

GeomConverter/src/org/lcsim/geometry/compact/converter/pandora
Main.java 1.23 -> 1.24
diff -u -r1.23 -r1.24
--- Main.java	25 Oct 2010 21:46:56 -0000	1.23
+++ Main.java	8 Nov 2010 18:13:48 -0000	1.24
@@ -53,13 +53,13 @@
  * geometry input format.
  * 
  * @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: Main.java,v 1.23 2010/10/25 21:46:56 jeremy Exp $
+ * @version $Id: Main.java,v 1.24 2010/11/08 18:13:48 jeremy Exp $
  */
 public class Main implements Converter
 {
     // ConditionsManager instance.
-
     private ConditionsManager conditionsManager = ConditionsManager.defaultInstance();
+    
     // Numerical formatting.
     static final DecimalFormat xlen = new DecimalFormat("#.########");
     static final DecimalFormat xfrac = new DecimalFormat("#.########");
@@ -72,7 +72,6 @@
      */
     static class SamplingLayerRange
     {
-
         int lowerLayer;
         int upperLayer;
         double em;
@@ -121,7 +120,6 @@
      */
     static class SamplingLayers extends ArrayList<SamplingLayerRange>
     {
-
         public SamplingLayers()
         {
         }
@@ -154,7 +152,6 @@
      */
     private static class CalorimeterConditions
     {
-
         SamplingLayers samplingLayers;
         String name;
         double mipEnergy;
@@ -260,8 +257,7 @@
             }
 
             // FIXME Hack to get the correct starting index for the sampling
-            // fractions. Ideally, the sampling fractions
-            // should be separated by subdetector name.
+            // fractions. Ideally, the sampling fractions should be separated by subdetector name.
             int samplingIndex = 0;
             if (calorimeter.getCalorimeterType() == HAD_BARREL || calorimeter.getCalorimeterType() == HAD_ENDCAP)
             {
@@ -398,6 +394,11 @@
         outputDoc.setRootElement(root);
         Element calorimeters = new Element("calorimeters");
         root.addContent(calorimeters);
+        
+        // Add basic detector data element.
+        Element detectorTag = new Element("detector");
+        detectorTag.setAttribute("name", detector.getDetectorName());
+        root.addContent(detectorTag);
 
         // Setup CalorimeterCalibration conditions.
         ConditionsSet calorimeterCalibration = null;
@@ -410,9 +411,6 @@
         }
         boolean haveCalCalib = (calorimeterCalibration == null) ? false : true;
 
-        // Setup QCalCalibration.
-        // QCalCalibration qcalib = new QCalCalibration(detector);
-
         // Process the subdetectors.
         for (Subdetector subdetector : detector.getSubdetectors().values())
         {
@@ -493,8 +491,9 @@
                         calorimeter.setAttribute("mipSigma", xfrac.format(subdetectorCalorimeterConditions.getMipSigma()));
                         calorimeter.setAttribute("mipCut", xfrac.format(subdetectorCalorimeterConditions.getMipCut()));
                         calorimeter.setAttribute("timeCut", xfrac.format(subdetectorCalorimeterConditions.getTimeCut()));
-                    } // Set MIP energy from Bethe-Bloche calculation.
-                      // TODO Check accuracy of this algorithm.
+                    } 
+                    // Set MIP energy from Bethe-Bloche calculation.
+                    // TODO Check accuracy of this algorithm.
                     else
                     {
                         List<LayerSlice> sensors = subdetector.getLayering().getLayerStack().getLayer(0).getSensors();
@@ -674,7 +673,7 @@
 
         public boolean accept(java.io.File file)
         {
-            return file.isDirectory() || file.getName().endsWith(".xml");
+            return file.getName().endsWith(".xml");
         }
 
         public String getDescription()
CVSspam 0.2.8