Fixed dead time calculation formula
This commit is contained in:
parent
c57d1e26ef
commit
48170cd353
@ -28,7 +28,6 @@ import java.util.Map;
|
|||||||
import static java.lang.Math.*;
|
import static java.lang.Math.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @author Darksnake
|
* @author Darksnake
|
||||||
*/
|
*/
|
||||||
public class TritiumUtils {
|
public class TritiumUtils {
|
||||||
@ -113,8 +112,10 @@ public class TritiumUtils {
|
|||||||
double res;
|
double res;
|
||||||
if (deadTime > 0) {
|
if (deadTime > 0) {
|
||||||
double total = p.getEventsCount();
|
double total = p.getEventsCount();
|
||||||
double time = p.getLength();
|
// double time = p.getLength();
|
||||||
res = wind / (1 - total * deadTime / time);
|
// res = wind / (1 - total * deadTime / time);
|
||||||
|
double timeRatio = deadTime / p.getLength();
|
||||||
|
res = wind / total * (1d - Math.sqrt(1d - 4d * total * timeRatio)) / 2d / timeRatio;
|
||||||
} else {
|
} else {
|
||||||
res = wind;
|
res = wind;
|
||||||
}
|
}
|
||||||
@ -122,7 +123,7 @@ public class TritiumUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static double countRateWithDeadTimeErr(NMPoint p, int from, int to, double deadTime) {
|
public static double countRateWithDeadTimeErr(NMPoint p, int from, int to, double deadTime) {
|
||||||
return Math.sqrt(countRateWithDeadTime(p,from, to, deadTime) / p.getLength());
|
return Math.sqrt(countRateWithDeadTime(p, from, to, deadTime) / p.getLength());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -132,7 +133,7 @@ public class TritiumUtils {
|
|||||||
* @param expression
|
* @param expression
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static double evaluateExpression(NMPoint point, String expression) {
|
public static double evaluateExpression(NMPoint point, String expression) {
|
||||||
Map<String, Object> exprParams = new HashMap<>();
|
Map<String, Object> exprParams = new HashMap<>();
|
||||||
exprParams.put("T", point.getLength());
|
exprParams.put("T", point.getLength());
|
||||||
exprParams.put("U", point.getUread());
|
exprParams.put("U", point.getUread());
|
||||||
|
Loading…
Reference in New Issue
Block a user