DiffractionExperiment: Adjust storage cell delay as a parameter

This commit is contained in:
2023-07-04 20:58:48 +02:00
parent 3067604e2a
commit 4ce2fcf98f
13 changed files with 205 additions and 118 deletions

View File

@@ -709,7 +709,7 @@ TEST_CASE("DiffractionExperiment_DetectorInput_PedestalG2","[DiffractionExperime
TEST_CASE("DiffractionExperiment_DetectorInput_StorageCell","[DiffractionExperiment]") {
DiffractionExperiment x(DetectorGeometry(8, 2, 8, 36));
x.FrameTime(1200us).Summation(1).NumTriggers(4560).StorageCells(8);
x.FrameTime(1200us).Summation(1).NumTriggers(4560).StorageCells(8).StorageCellDelay(7000ns);
JFJochProtoBuf::DetectorInput ret = x;
REQUIRE(ret.modules_num() == 8);
REQUIRE(ret.period_us() == 8 * (x.GetFrameTime().count() + 10));
@@ -717,7 +717,7 @@ TEST_CASE("DiffractionExperiment_DetectorInput_StorageCell","[DiffractionExperim
REQUIRE(ret.num_triggers() == 4560 + 1);
REQUIRE(ret.num_frames() == 1);
REQUIRE(ret.storage_cell_number() == 8);
REQUIRE(ret.storage_cell_delay() == 7.5);
REQUIRE(ret.storage_cell_delay_ns() == 7000);
REQUIRE(ret.storage_cell_start() == x.GetStorageCellStart());
}
@@ -808,7 +808,7 @@ TEST_CASE("DiffractionExperiment_LoadDatasetSettings_Invalid", "[DiffractionExpe
TEST_CASE("DiffractionExperiment_LoadDetectorSettings", "[DiffractionExperiment]") {
DiffractionExperiment x;
x.PedestalG0Frames(456).PedestalG1Frames(1234).PedestalG2Frames(123);
x.PedestalG0Frames(456).PedestalG1Frames(1234).PedestalG2Frames(123).StorageCellDelay(2500ns);
JFJochProtoBuf::DetectorSettings settings;
settings.set_frame_time_us(600);
@@ -829,6 +829,22 @@ TEST_CASE("DiffractionExperiment_LoadDetectorSettings", "[DiffractionExperiment]
REQUIRE(x.GetPedestalG0Frames() == 5000);
REQUIRE(x.GetPedestalG1Frames() == 100);
REQUIRE(x.GetPedestalG2Frames() == 150);
REQUIRE(x.GetStorageCellDelay().count() == 2500);
}
TEST_CASE("DiffractionExperiment_LoadDetectorSettings_StorageCellDelay", "[DiffractionExperiment]") {
DiffractionExperiment x;
x.PedestalG0Frames(456).PedestalG1Frames(1234).PedestalG2Frames(123).StorageCellDelay(5000ns);
JFJochProtoBuf::DetectorSettings settings;
settings.set_frame_time_us(600);
settings.set_count_time_us(400);
settings.set_storage_cell_count(8);
settings.set_use_internal_packet_generator(true);
settings.set_collect_raw_data(true);
settings.set_storage_cell_delay_ns(7000);
REQUIRE_NOTHROW(x.LoadDetectorSettings(settings));
REQUIRE(x.GetStorageCellDelay().count() == 7000);
}
TEST_CASE("DiffractionExperiment_LoadDetectorSettings_invalid", "[DiffractionExperiment]") {