Commit in GeomConverter/src/org/lcsim/geometry/compact/converter/pandora on MAIN
Main.java+13-1051.19 -> 1.20
add printout of calorimeter info

GeomConverter/src/org/lcsim/geometry/compact/converter/pandora
Main.java 1.19 -> 1.20
diff -u -r1.19 -r1.20
--- Main.java	30 Jun 2010 17:56:52 -0000	1.19
+++ Main.java	16 Aug 2010 19:33:18 -0000	1.20
@@ -55,7 +55,7 @@
  * geometry input format.
  * 
  * @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: Main.java,v 1.19 2010/06/30 17:56:52 jeremy Exp $
+ * @version $Id: Main.java,v 1.20 2010/08/16 19:33:18 jeremy Exp $
  */
 public class Main implements Converter
 {
@@ -149,107 +149,6 @@
         }
     }
 
-    /*
-    private static class QCalCalibration
-    {
-
-        private static final String resourceName = "Qcal-v2r3p10";
-        Map<String, SamplingLayers> calLayers = new HashMap<String, SamplingLayers>();
-
-        protected QCalCalibration(Detector detector)
-        {
-            ConditionsManager mgr = ConditionsManager.defaultInstance();
-
-            ConditionsSet hadronCalibration = mgr.getConditions("hadronCalibration/nh" + resourceName);
-            ConditionsSet photonCalibration = mgr.getConditions("photonCalibration/photon" + resourceName);
-
-            int nFrontLayersEcal = hadronCalibration.getInt("nFrontLayersEcal");
-
-            // Get sampling fraction conditions.
-            double photonSf[] = photonCalibration.getDoubleArray("SFs");
-            double hadronSf[] = hadronCalibration.getDoubleArray("SFs");
-
-            // EM Barrel.
-            Calorimeter emBarr = detector.getCalorimeterByType(Calorimeter.CalorimeterType.EM_BARREL);
-            if (emBarr != null)
-            {
-                int emBarrMaxLayer = emBarr.getLayering().getLayerCount() - 1;
-                SamplingLayerRange ecalBarrFrontRange = new SamplingLayerRange(0, nFrontLayersEcal - 1, photonSf[0], hadronSf[0]);
-                SamplingLayerRange ecalBarrBackRange = new SamplingLayerRange(nFrontLayersEcal, emBarrMaxLayer, photonSf[1], hadronSf[1]);
-                calLayers.put("EM_BARREL", new SamplingLayers());
-                calLayers.get("EM_BARREL").add(ecalBarrFrontRange);
-                calLayers.get("EM_BARREL").add(ecalBarrBackRange);
-            }
-
-            // EM Endcap.
-            Calorimeter emEc = detector.getCalorimeterByType(Calorimeter.CalorimeterType.EM_ENDCAP);
-            if (emEc != null)
-            {
-                int emEcMaxLayer = emEc.getLayering().getLayerCount() - 1;
-                SamplingLayerRange ecalEcFrontRange = new SamplingLayerRange(0, nFrontLayersEcal - 1, photonSf[2], hadronSf[2]);
-                SamplingLayerRange ecalEcBackRange = new SamplingLayerRange(nFrontLayersEcal, emEcMaxLayer, photonSf[3], hadronSf[3]);
-                calLayers.put("EM_ENDCAP", new SamplingLayers());
-                calLayers.get("EM_ENDCAP").add(ecalEcFrontRange);
-                calLayers.get("EM_ENDCAP").add(ecalEcBackRange);
-            }
-
-            // HAD Barrel.           
-            Calorimeter hadBarr = detector.getCalorimeterByType(Calorimeter.CalorimeterType.HAD_BARREL);
-            if (hadBarr != null)
-            {
-                int hadBarrMaxLayer = hadBarr.getLayering().getLayerCount() - 1;
-                ConditionsSet hcalBarrSampling = mgr.getConditions("SamplingFractions/" + hadBarr.getName());
-                double hcalBarrSF = hcalBarrSampling.getDouble("samplingFraction");
-                SamplingLayerRange hcalBarrRange = new SamplingLayerRange(0, hadBarrMaxLayer, hcalBarrSF, hadronSf[4]);
-                calLayers.put("HAD_BARREL", new SamplingLayers(hcalBarrRange));
-            }
-
-            // HAD Endcap.
-            Calorimeter hadEc = detector.getCalorimeterByType(Calorimeter.CalorimeterType.HAD_ENDCAP);
-            if (hadEc != null)
-            {
-                int hadEcMaxLayer = hadEc.getLayering().getLayerCount() - 1;
-                ConditionsSet hcalEcSampling = mgr.getConditions("SamplingFractions/" + hadEc.getName());
-                double hcalEcSF = hcalEcSampling.getDouble("samplingFraction");
-                SamplingLayerRange hcalEcRange = new SamplingLayerRange(0, hadEcMaxLayer, hcalEcSF, hadronSf[5]);
-                calLayers.put("HAD_ENDCAP", new SamplingLayers(hcalEcRange));
-            }
-
-            // MUON Barrel.
-            Calorimeter muonBarr = detector.getCalorimeterByType(Calorimeter.CalorimeterType.MUON_BARREL);
-            if (muonBarr != null)
-            {
-                int muonBarrMaxLayer = muonBarr.getLayering().getLayerCount() - 1;
-                ConditionsSet muonBarrSampling = mgr.getConditions("SamplingFractions/" + muonBarr.getName());
-                double muonBarrSF = muonBarrSampling.getDouble("samplingFraction");
-                SamplingLayerRange muonBarrRange = new SamplingLayerRange(0, muonBarrMaxLayer, muonBarrSF, muonBarrSF);
-                calLayers.put("MUON_BARREL", new SamplingLayers(muonBarrRange));
-            }
-
-            // MUON Endcap.
-            Calorimeter muonEc = detector.getCalorimeterByType(Calorimeter.CalorimeterType.MUON_ENDCAP);
-            if (muonEc != null)
-            {
-                int muonEcMaxLayer = muonEc.getLayering().getLayerCount() - 1;
-                ConditionsSet muonEcSampling = mgr.getConditions("SamplingFractions/" + muonEc.getName());
-                double muonEcSF = muonEcSampling.getDouble("samplingFraction");
-                SamplingLayerRange muonEcRange = new SamplingLayerRange(0, muonEcMaxLayer, muonEcSF, muonEcSF);
-                calLayers.put("MUON_ENDCAP", new SamplingLayers(muonEcRange));
-            }
-        }
-
-        public double getHadronSamplingFraction(Calorimeter calorimeter, int layern)
-        {
-            return calLayers.get(calorimeter.getCalorimeterType().toString()).getSamplingLayerRange(layern).getHADSampling();
-        }
-
-        double getPhotonSamplingFraction(Calorimeter calorimeter, int layern)
-        {
-            return calLayers.get(calorimeter.getCalorimeterType().toString()).getSamplingLayerRange(layern).getEMSampling();
-        }
-    }
-    */
-
     /**
      * Represents CalorimeterConditions for a single subdetector.
      * 
@@ -293,6 +192,7 @@
          */
         protected CalorimeterConditions(Calorimeter calorimeter, ConditionsSet conditions)
         {
+            System.out.println("conditions: " + calorimeter.getName());
             this.name = calorimeter.getName();
 
             // Figure out which layering conditions to use based on the CalorimeterType.
@@ -369,6 +269,8 @@
                 samplingIndex += (new StringTokenizer(conditions.getString("HCalLayering"), ",").countTokens());
             }
 
+            System.out.println("    samplingIndex: " + samplingIndex);
+
             // Create the SamplingLayerRange list.
             samplingLayers = new SamplingLayers();
             for (int i = 0; i < layers.size(); i++)
@@ -389,6 +291,7 @@
                         upperLayer,
                         emSamplingFraction,
                         hadSamplingFraction);
+                System.out.println("    " + lowerLayer + " - " + upperLayer + " : " + emSamplingFraction + ", " + hadSamplingFraction);
 
                 samplingLayers.add(samplingLayerRange);
 
@@ -422,6 +325,11 @@
             mipSigma = conditions.getDouble(mipSigmaCondition);
             mipCut = conditions.getDouble(mipCutCondition);
             timeCut = conditions.getDouble("timeCut");
+
+            System.out.println("    mipEnergy: " + mipEnergy);
+            System.out.println("    mipSigma: " + mipSigma);
+            System.out.println("    mipCut: " + mipCut);
+            System.out.println("    timeCut: " + timeCut);
         }
 
         public SamplingLayerRange getSamplingLayerRange(int layer)
@@ -491,9 +399,9 @@
         try
         {
             calorimeterCalibration = conditionsManager.getConditions("CalorimeterCalibration");
-        } catch (Exception x)
-        {
-        }
+        } 
+        catch (Exception x)
+        {}
         boolean haveCalCalib = (calorimeterCalibration == null) ? false : true;
 
         // Setup QCalCalibration.
CVSspam 0.2.8