public class ArraySmearer extends Object
v11 cov = v12 v22 v13 v23 v33 x1 = x1 + a1*rn1 x2 = x2 + a2*rn1 + b2*rn2 x3 = x3 + a3*rn1 + b3*rn2 + c3*rn3
where rn1, rn2 and rn3 are independently generated normal random numbers
a1 = sqrt(v11) if a1 = 0, then a2 = a3 = 0 otherwise a2 = v12/a1, a3 = v13/a1 b2 = sqrt(v22 - a2*a2) if b2 = 0, then b3 = 0 otherwise b3 = (v23 - a2*a3)/b2 c3 = sqrt(v33 - a3*a3 - b3*b3)
Modifier and Type | Field and Description |
---|---|
private double[][] |
_cov |
private int |
_ndim |
private Random |
_r |
private double[][] |
_smear |
Constructor and Description |
---|
ArraySmearer(double[][] cov)
constructor from the covariance matrix
|
private double[][] _smear
private double[][] _cov
private int _ndim
private Random _r
public ArraySmearer(double[][] cov)
cov
- The covariance matrix aspublic void smear(double[] vec)
vec
- The array to be smeared.public void generate(double[] vec)
vec
- Array to be filledCopyright © 2016 Linear Collider Detector (LCD). All rights reserved.