hps-java/src/main/java/org/lcsim/hps/recon/ecal
diff -u -r1.8 -r1.9
--- HPSEcalRawConverter.java 22 Jun 2012 22:39:36 -0000 1.8
+++ HPSEcalRawConverter.java 25 Jul 2012 15:57:06 -0000 1.9
@@ -79,4 +79,22 @@
//+0.0000001 is a horrible hack to ensure rawEnergy!=BaseCalorimeterHit.UNSET_CORRECTED_ENERGY
return h;
}
-}
+
+ public CalorimeterHit HitDtoA(BaseRawCalorimeterHit hit, int window,double g) {
+ if (hit.getTimeStamp()%64 !=0) {
+ System.out.println("unexpected timestamp "+hit.getTimeStamp());
+ }
+ double time = hit.getTimeStamp()/16.0;
+ long id = hit.getCellID();
+ double rawEnergy = g*(hit.getAmplitude() - window * getPedestal(hit));
+// Hep3Vector pvec = hit.getDetectorElement().getGeometry().getPosition();
+// double [] pos = new double[3];
+// pos[0] = pvec.x();
+// pos[1] = pvec.y();
+// pos[2] = pvec.z();
+ CalorimeterHit h = new HPSRawCalorimeterHit(rawEnergy + 0.0000001, hit.getPosition(), time, id, 0);
+ //+0.0000001 is a horrible hack to ensure rawEnergy!=BaseCalorimeterHit.UNSET_CORRECTED_ENERGY
+ return h;
+ }
+
+ }