Print

Print


Commit in java/branches/ecal-recon_HPSJAVA-93/src/main/java/org/hps/recon/ecal on MAIN
EcalRawConverter.java+18-16596 -> 597
EcalRawConverter uses the new conditions, tested, but results are slightly different

java/branches/ecal-recon_HPSJAVA-93/src/main/java/org/hps/recon/ecal
EcalRawConverter.java 596 -> 597
--- java/branches/ecal-recon_HPSJAVA-93/src/main/java/org/hps/recon/ecal/EcalRawConverter.java	2014-05-18 16:51:29 UTC (rev 596)
+++ java/branches/ecal-recon_HPSJAVA-93/src/main/java/org/hps/recon/ecal/EcalRawConverter.java	2014-05-19 13:51:22 UTC (rev 597)
@@ -29,27 +29,13 @@
     private boolean constantGain = false;
     private double gain;
     private boolean use2014Gain = true;
+    Detector detector = null;
     
     static EcalConditions ecalConditions = null;
     static IIdentifierHelper helper = null;
     static EcalChannelCollection channels = null; 
 
-    public EcalRawConverter() {
-    	
-    	Detector detector = DatabaseConditionsManager.getInstance().getDetectorObject();
-    	
-        // ECAL combined conditions object.
-        ecalConditions = ConditionsManager.defaultInstance()
-                .getCachedConditions(EcalConditions.class, TableConstants.ECAL_CONDITIONS).getCachedData();
-        
-        // List of channels.
-        channels = ecalConditions.getChannelCollection();
-        
-        // ID helper.
-        helper = detector.getSubdetector("Ecal").getDetectorElement().getIdentifierHelper();
-        
-        System.out.println("You are now using the database conditions for EcalRawConverter.");
-    	
+    public EcalRawConverter() {	
     }
 
     public void setGain(double gain) {
@@ -159,6 +145,22 @@
      }
      */
     
+    void setDetector(Detector detector) {
+        this.detector = detector;
+        
+        // ECAL combined conditions object.
+        ecalConditions = ConditionsManager.defaultInstance()
+                .getCachedConditions(EcalConditions.class, TableConstants.ECAL_CONDITIONS).getCachedData();
+        
+        // List of channels.
+        channels = ecalConditions.getChannelCollection();
+        
+        // ID helper.
+        helper = detector.getSubdetector("Ecal").getDetectorElement().getIdentifierHelper();
+        
+        System.out.println("You are now using the database conditions for EcalRawConverter.");
+    }
+    
     /** 
      * Convert physical ID to gain value.
      * @param cellID (long)
SVNspam 0.1