3 modified files
lcsim/src/org/lcsim/digisim
diff -u -r1.1 -r1.2
--- ExponentialNoise.java 27 Jun 2005 21:34:31 -0000 1.1
+++ ExponentialNoise.java 28 Jun 2005 21:55:39 -0000 1.2
@@ -13,7 +13,7 @@
* exponential distribution.
*
* @author Guilherme Lima
- * @version $Id: ExponentialNoise.java,v 1.1 2005/06/27 21:34:31 lima Exp $
+ * @version $Id: ExponentialNoise.java,v 1.2 2005/06/28 21:55:39 lima Exp $
*/
class ExponentialNoise extends RandomNoise {
@@ -32,15 +32,16 @@
_beta = params.get(5);
// create distribution
- System.out.println("ExpoNoise.init(): beta="+_beta);
_expo = DistributionFactory.newInstance().createExponentialDistribution(_beta);
}
/** Probability to get noise above the threshold */
public double getProbabilityAboveThreshold() {
_probAboveThreshold = Math.exp( - _threshold / _beta );
- System.out.println("ExponentialNoise: probAboveThreshold = "
- +_probAboveThreshold);
+ if(_debug>0) {
+ System.out.println("ExponentialNoise: prob above threshold = "
+ +_probAboveThreshold);
+ }
return _probAboveThreshold;
}
lcsim/src/org/lcsim/digisim
diff -u -r1.1 -r1.2
--- GaussianNoise.java 27 Jun 2005 21:34:31 -0000 1.1
+++ GaussianNoise.java 28 Jun 2005 21:55:39 -0000 1.2
@@ -13,7 +13,7 @@
* Hence the next two parameters are the gaussian mean and width.
*
* @author Guilherme Lima
- * @version $Id: GaussianNoise.java,v 1.1 2005/06/27 21:34:31 lima Exp $
+ * @version $Id: GaussianNoise.java,v 1.2 2005/06/28 21:55:39 lima Exp $
*/
class GaussianNoise extends RandomNoise {
@@ -47,10 +47,12 @@
double z = (_threshold - _mean) / ( Math.sqrt(2.0)*_sigma );
// analytically correct, but gives large roundoff errors. GL050627
// _probAboveThreshold = 0.5 * ( 1 - Erf.erf(z) );
-
_probAboveThreshold = 0.5 * tail( z );
- System.out.println("GaussianNoise: probAboveThreshold = "
- +_probAboveThreshold);
+
+ if(_debug>0) {
+ System.out.println("GaussianNoise: prob above threshold = "
+ +_probAboveThreshold);
+ }
if(_keepNegative) return 2*_probAboveThreshold;
return _probAboveThreshold;
lcsim/src/org/lcsim/digisim
diff -u -r1.3 -r1.4
--- RandomNoise.java 27 Jun 2005 21:35:55 -0000 1.3
+++ RandomNoise.java 28 Jun 2005 21:55:39 -0000 1.4
@@ -11,7 +11,7 @@
* class.
*
* @author Guilherme Lima
- * @version $Id: RandomNoise.java,v 1.3 2005/06/27 21:35:55 lima Exp $
+ * @version $Id: RandomNoise.java,v 1.4 2005/06/28 21:55:39 lima Exp $
*/
abstract class RandomNoise extends AbstractCalHitModifier {
@@ -48,8 +48,10 @@
int ncells = _selector.getCellCount();
double probAbove = getProbabilityAboveThreshold();
double meanNoisyCount = (probAbove * ncells);
- System.out.println("probAboveThreshold() = "+probAbove
- +", meanNoisyCount="+meanNoisyCount);
+ if(_debug>0) {
+ System.out.println("probAboveThreshold() = "+probAbove
+ +", meanNoisyCount="+meanNoisyCount);
+ }
// poisson distribution generator
DistributionFactory df = DistributionFactory.newInstance();
CVSspam 0.2.8