projects/lcsim/trunk/recon-drivers
--- projects/lcsim/trunk/recon-drivers/pom.xml 2013-12-10 21:28:50 UTC (rev 2839)
+++ projects/lcsim/trunk/recon-drivers/pom.xml 2013-12-10 22:16:39 UTC (rev 2840)
@@ -28,5 +28,10 @@
<artifactId>lcsim-tracking</artifactId>
<version>${org.lcsim.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-math</artifactId>
+ <version>2.2</version>
+ </dependency>
</dependencies>
</project>
projects/lcsim/trunk/recon-drivers/src/main/java/org/lcsim/util
--- projects/lcsim/trunk/recon-drivers/src/main/java/org/lcsim/util/OverlayDriver.java 2013-12-10 21:28:50 UTC (rev 2839)
+++ projects/lcsim/trunk/recon-drivers/src/main/java/org/lcsim/util/OverlayDriver.java 2013-12-10 22:16:39 UTC (rev 2840)
@@ -16,8 +16,9 @@
import java.util.Map;
import org.apache.commons.math.MathException;
-import org.apache.commons.math.distribution.DistributionFactory;
+//import org.apache.commons.math.distribution.DistributionFactory;
import org.apache.commons.math.distribution.PoissonDistribution;
+import org.apache.commons.math.distribution.PoissonDistributionImpl;
import org.freehep.record.source.NoSuchRecordException;
import org.lcsim.detector.IDetectorElement;
import org.lcsim.event.EventHeader;
@@ -51,7 +52,7 @@
static protected double c = 299.792458; // speed of light in mm/ns
static protected SpacePoint interactionPoint = new SpacePoint(); // assuming 0 0 0 as IP
- protected DistributionFactory df;
+ //protected DistributionFactory df;
protected double tofCaloOffset = -0.25; // tolerance for keeping calo hits: tof is calculated to center of cell, but interaction can happen earlier
protected int bunchCrossings;
protected double bunchSpacing;
@@ -79,7 +80,7 @@
* Default constructor
*/
public OverlayDriver() {
- df = DistributionFactory.newInstance();
+ //df = DistributionFactory.newInstance();
bunchCrossings = 1;
bunchSpacing = 1.;
randomSignal = true;
@@ -254,7 +255,9 @@
@Override
protected void startOfData() {
if (overlayWeight != 0.) {
- backgroundDistribution = df.createPoissonDistribution(overlayWeight);
+ // backgroundDistribution = df.createPoissonDistribution(overlayWeight);
+ // Changed for compatibility with commons-math 2.2 instead of 1.2. Needs verification!
+ backgroundDistribution = new PoissonDistributionImpl(overlayWeight);
}
}