diff --git a/numass-main/src/main/kotlin/inr/numass/actions/TimeAnalyzerAction.kt b/numass-main/src/main/kotlin/inr/numass/actions/TimeAnalyzerAction.kt index abe2adb2..62aa9454 100644 --- a/numass-main/src/main/kotlin/inr/numass/actions/TimeAnalyzerAction.kt +++ b/numass-main/src/main/kotlin/inr/numass/actions/TimeAnalyzerAction.kt @@ -94,17 +94,34 @@ object TimeAnalyzerAction : OneToOneAction() { "showLine" to true "thickness" to 4 "title" to "${name}_${input.voltage}" - }.apply { - configure(inputMeta.getMetaOrEmpty("plot")) + update(inputMeta.getMetaOrEmpty("plot")) } - context.plot(statPlot, stage = this.name, name = "stat-method") { + val errorPlot = DataPlot(name).configure{ + "showLine" to true + "showErrors" to false + "showSymbol" to false + "thickness" to 4 + "title" to "${name}_${input.voltage}" + } + + context.plot(statPlot, stage = this.name, name = "count rate") { "xAxis" to { "title" to "delay" "units" to "us" } "yAxis" to { - "title" to "Relative count rate" + "title" to "Reconstructed count rate" + } + } + + context.plot(errorPlot, stage = this.name, name = "error"){ + "xAxis" to { + "title" to "delay" + "units" to "us" + } + "yAxis" to { + "title" to "Statistical error" } } @@ -131,6 +148,10 @@ object TimeAnalyzerAction : OneToOneAction() { result.getDouble(NumassAnalyzer.COUNT_RATE_ERROR_KEY) / norm ) ) + + errorPlot.append( + Adapters.buildXYDataPoint(t/1000.0, result.getDouble(NumassAnalyzer.COUNT_RATE_ERROR_KEY) / norm) + ) } diff --git a/numass-main/src/main/kotlin/inr/numass/scripts/timeanalysis/TestBunch.kt b/numass-main/src/main/kotlin/inr/numass/scripts/timeanalysis/TestBunch.kt index 4cf1fd4f..5c08ba25 100644 --- a/numass-main/src/main/kotlin/inr/numass/scripts/timeanalysis/TestBunch.kt +++ b/numass-main/src/main/kotlin/inr/numass/scripts/timeanalysis/TestBunch.kt @@ -49,7 +49,7 @@ fun main(args: Array) { .generateEvents(cr) val bunches = NumassGenerator - .generateBunches(6.0, 0.001, 5.0) + .generateBunches(10.0, 0.001, 5.0) val discharges = NumassGenerator .generateBunches(50.0,0.001,0.1)