java/branches/ecal-recon_HPSJAVA-93/src/main/java/org/hps/recon/ecal
--- 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)