DiffractionExperiment: Detector Geometry can be modified with a setter function

This commit is contained in:
2023-04-13 10:35:22 +02:00
parent 4dab54decb
commit dbf50d33e9
2 changed files with 9 additions and 2 deletions

View File

@@ -78,12 +78,18 @@ DiffractionExperiment::DiffractionExperiment(const DetectorGeometry& geom) {
internal.set_storage_cells(1);
internal.set_storage_cell_start(15);
*internal.mutable_conv_geometry() = geom;
Geometry(geom);
Mode(DetectorMode::Conversion);
}
// setter functions
DiffractionExperiment &DiffractionExperiment::Geometry(const DetectorGeometry &input) {
check_min("Number of modules", input.GetModulesNum(), 1);
check_max("Number of modules", input.GetModulesNum(), 64); // if operating > 32M, would need to check the code anyway
*internal.mutable_conv_geometry() = input;
return *this;
}
DiffractionExperiment &DiffractionExperiment::Mode(DetectorMode input) {
switch (input) {

View File

@@ -36,6 +36,7 @@ public:
explicit DiffractionExperiment(const JFJochProtoBuf::JungfraujochSettings &settings);
// Methods below can be chained together
DiffractionExperiment& Geometry(const DetectorGeometry &input);
DiffractionExperiment& Mode(DetectorMode input);
DiffractionExperiment& DataStreams(int64_t input);