lcsim/src/org/lcsim/contrib/SiStripSim
diff -u -r1.10 -r1.11
--- CDFSiSensorSim.java 9 Apr 2008 14:04:06 -0000 1.10
+++ CDFSiSensorSim.java 9 Jul 2008 21:28:52 -0000 1.11
@@ -54,7 +54,7 @@
// Static parameters - not intended to be user modifiable
private static double _DEPOSITION_GRANULARITY = 0.10; // 10% of pitch or depleted thickness
-
+ private static final double DISTANCE_ERROR_THRESHOLD = 0.001; //This is the maximum distance outside of the sensor allowed before an error is thrown.
/**
* Creates a new instance of CDFSiSensorSim
@@ -442,8 +442,13 @@
// System.out.println("Distance from side: "+distance);
- if (distance < -GeomOp3D.DISTANCE_TOLERANCE) distance = 0;
- if (distance > thickness+GeomOp3D.DISTANCE_TOLERANCE) distance = thickness;
+
+ if (distance < -DISTANCE_ERROR_THRESHOLD || distance > thickness + DISTANCE_ERROR_THRESHOLD){
+ throw new RuntimeException("Distance is outside of sensor by more than "+DISTANCE_ERROR_THRESHOLD+". Distance = "+distance+
+ ". If this is an isolated event, then perhaps DISTANCE_ERROR_THRESHOLD must be increased in CDFSiSensorSim");
+ }
+ else if (distance < 0) distance = 0.;
+ else if (distance > thickness) distance = thickness;
// {
// throw new RuntimeException("Attempting to drift charge from outside of sensor!");
// }