4878318c27
Build Packages / Unit tests (push) Successful in 1h17m4s
Build Packages / Generate python client (push) Successful in 1m24s
Build Packages / build:rpm (rocky8_nocuda) (push) Successful in 12m34s
Build Packages / build:rpm (rocky9_nocuda) (push) Successful in 12m37s
Build Packages / build:rpm (ubuntu2404_nocuda) (push) Successful in 11m11s
Build Packages / build:rpm (ubuntu2204_nocuda) (push) Successful in 12m4s
Build Packages / build:rpm (rocky8_sls9) (push) Successful in 11m59s
Build Packages / build:rpm (rocky9_sls9) (push) Successful in 13m4s
Build Packages / build:rpm (rocky8) (push) Successful in 13m12s
Build Packages / XDS test (durin plugin) (push) Successful in 9m57s
Build Packages / build:rpm (ubuntu2404) (push) Successful in 11m52s
Build Packages / build:rpm (ubuntu2204) (push) Successful in 12m30s
Build Packages / build:rpm (rocky9) (push) Successful in 13m59s
Build Packages / Build documentation (push) Successful in 1m7s
Build Packages / XDS test (neggia plugin) (push) Successful in 9m24s
Build Packages / Create release (push) Has been skipped
Build Packages / XDS test (JFJoch plugin) (push) Successful in 9m54s
Build Packages / DIALS test (push) Successful in 13m14s
This is an UNSTABLE release. The release has significant modifications and bug fixes, if things go wrong, it is better to revert to 1.0.0-rc.132. * jfjoch_broker: Further reduce startup time for DECTRIS detectors by selectively modifying SIMPLON parameters on `/start` * jfjoch_broker: Further reduce startup time for DECTRIS detectors by not setting beam center and detector distance via SIMPLON API on '/start' * jfjoch_broker: Add an extra message to ZeroMQ puller ready to monitor Lite worklow preparation time * jfjoch_broker: Image buffer configuration is postponed for Lite receiver flow till start message is received * jfjoch_broker: Use nanoseconds internally for frame/image/readout time * jfjoch_broker: Extra messages added for receiver operation (to be removed after debugging finished) * jfojch_broker: Improve profiling of different data analysis steps * jfjoch_broker: Record integration reflection count * jfjoch_broker: Fix bug where ZeroMQ preview frequency was confusing time units (micro vs. milliseconds) * jfjoch_broker: Fix bug where '/wait_till_done' got deadlocked * jfjoch_writer: Fix confusion between NaN and zero in floating-point datasets **Breaking changes**: detector definition is now using nanoseconds to define minimum frame time, minimum count time and readout time. Reviewed-on: #49
154 lines
7.1 KiB
C++
154 lines
7.1 KiB
C++
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#ifndef JUNGFRAUJOCH_DETECTORSETUP_H
|
|
#define JUNGFRAUJOCH_DETECTORSETUP_H
|
|
|
|
#include <memory>
|
|
#include <chrono>
|
|
#include <optional>
|
|
|
|
#include "DetectorGeometry.h"
|
|
#include "../jungfrau/JFModuleGainCalibration.h"
|
|
#include "DetectorGeometryFixed.h"
|
|
#include "DetectorGeometryModular.h"
|
|
#include "DetectorSettings.h"
|
|
|
|
constexpr uint16_t SimplonStream2Port = 31001;
|
|
|
|
enum class DetectorType {EIGER, JUNGFRAU, DECTRIS};
|
|
|
|
class DetectorSetup {
|
|
std::string description;
|
|
std::string serial_number;
|
|
std::shared_ptr<DetectorGeometry> geometry;
|
|
std::vector<std::string> det_modules_hostname;
|
|
std::vector<std::string> gain_file_names;
|
|
std::vector<std::string> trim_file_names;
|
|
std::string trim_file_directory;
|
|
std::vector<JFModuleGainCalibration> gain_calibration;
|
|
int64_t udp_interface_count = 2;
|
|
float pixel_size_um = 75.0f;
|
|
std::string sensor_material = "Si";
|
|
float sensor_thickness_um = 320.0f;
|
|
std::vector<int64_t> tx_delay;
|
|
DetectorType detector_type;
|
|
int32_t high_voltage = 120.0;
|
|
uint32_t ipv4_base_addr = 0x010a0a0a;
|
|
bool module_sync = true;
|
|
std::chrono::nanoseconds read_out_time;
|
|
std::chrono::nanoseconds min_count_time;
|
|
std::chrono::nanoseconds min_frame_time;
|
|
float min_energy_threshold_keV = 2.7f;
|
|
int32_t temperature_thresold_degC = 55;
|
|
|
|
std::string dectris_roi;
|
|
|
|
std::optional<int64_t> bit_depth_image;
|
|
std::optional<int64_t> bit_depth_readout;
|
|
std::optional<int64_t> saturation_limit;
|
|
std::optional<DetectorSettings> settings;
|
|
|
|
DetectorSetup(std::shared_ptr<DetectorGeometry> geom,
|
|
DetectorType detector_type,
|
|
const std::string &description = "Detector",
|
|
const std::vector<std::string> &det_modules_hostname = {});
|
|
public:
|
|
DetectorSetup(const DetectorGeometryFixed& geom,
|
|
DetectorType detector_type,
|
|
const std::string &description = "Detector",
|
|
const std::vector<std::string> &det_modules_hostname = {});
|
|
DetectorSetup(const DetectorGeometryModular& geom,
|
|
DetectorType detector_type,
|
|
const std::string &description = "Detector",
|
|
const std::vector<std::string> &det_modules_hostname = {});
|
|
void LoadGain(const std::vector<std::string> &filenames);
|
|
void SetTrimFiles(const std::vector<std::string> &filenames);
|
|
|
|
DetectorSetup& TxDelay(const std::vector<int64_t> &v);
|
|
DetectorSetup& UDPInterfaceCount(int64_t input);
|
|
DetectorSetup& SensorMaterial(const std::string &input);
|
|
DetectorSetup& SensorThickness_um(float input);
|
|
DetectorSetup& PixelSize_um(float input);
|
|
DetectorSetup& HighVoltage(int32_t input);
|
|
DetectorSetup& SerialNumber(const std::string &input);
|
|
DetectorSetup& BaseIPv4Addr(const std::string &input);
|
|
DetectorSetup& ModuleSync(bool input);
|
|
DetectorSetup& ReadOutTime(std::chrono::nanoseconds input);
|
|
DetectorSetup& Geometry(const DetectorGeometryFixed& input);
|
|
DetectorSetup& BitDepthReadout(int64_t input);
|
|
DetectorSetup& BitDepthImage(int64_t input);
|
|
DetectorSetup& MinFrameTime(std::chrono::nanoseconds input);
|
|
DetectorSetup& MinCountTime(std::chrono::nanoseconds input);
|
|
DetectorSetup& MinThreshold_keV(float input);
|
|
DetectorSetup& SaturationLimit(std::optional<int64_t> input);
|
|
DetectorSetup& Description(const std::string &input);
|
|
DetectorSetup& DECTRISROI(const std::string &input);
|
|
DetectorSetup& DefaultSettings(const std::optional<DetectorSettings> &input);
|
|
DetectorSetup& TempThreshold_degC(int64_t input);
|
|
|
|
[[nodiscard]] DetectorType GetDetectorType() const;
|
|
[[nodiscard]] const DetectorGeometry& GetGeometry() const;
|
|
[[nodiscard]] const std::vector<std::string>& GetDetectorModuleHostname() const;
|
|
[[nodiscard]] uint64_t GetModulesNum() const;
|
|
[[nodiscard]] std::string GetDescription() const;
|
|
[[nodiscard]] float GetPixelSize_mm() const;
|
|
[[nodiscard]] float GetSensorThickness_um() const;
|
|
[[nodiscard]] std::string GetSensorMaterial() const;
|
|
[[nodiscard]] const std::vector<JFModuleGainCalibration> &GetGainCalibration() const;
|
|
[[nodiscard]] int64_t GetUDPInterfaceCount() const;
|
|
[[nodiscard]] const std::vector<int64_t> &GetTxDelay() const; // can be empty for default
|
|
[[nodiscard]] const std::vector<std::string> &GetGainFileNames() const;
|
|
[[nodiscard]] const std::vector<std::string> &GetTrimFileNames() const;
|
|
[[nodiscard]] std::string GetTrimFileDirectory() const;
|
|
[[nodiscard]] int32_t GetHighVoltage() const;
|
|
[[nodiscard]] std::string GetSerialNumber() const;
|
|
[[nodiscard]] uint32_t GetSrcIPv4Addr(uint32_t half_module) const;
|
|
[[nodiscard]] std::string GetBaseIPv4Addr() const;
|
|
[[nodiscard]] bool IsModuleSync() const;
|
|
[[nodiscard]] std::chrono::nanoseconds GetReadOutTime() const;
|
|
[[nodiscard]] std::chrono::nanoseconds GetMinFrameTime() const;
|
|
[[nodiscard]] std::chrono::nanoseconds GetMinCountTime() const;
|
|
[[nodiscard]] std::optional<int64_t> GetBitDepthReadout() const;
|
|
[[nodiscard]] std::optional<int64_t> GetBitDepthImage() const;
|
|
[[nodiscard]] std::string GetDECTRISStream2Addr() const;
|
|
[[nodiscard]] float GetMinThreshold_keV() const;
|
|
[[nodiscard]] std::optional<int64_t> GetSaturationLimit() const;
|
|
[[nodiscard]] std::string GetDECTRISROI() const;
|
|
[[nodiscard]] std::optional<DetectorSettings> GetDefaultSettings() const;
|
|
[[nodiscard]] int32_t GetTempThreshold_degC() const;
|
|
};
|
|
|
|
DetectorSetup DetJF4M(const std::string &description = "Detector",
|
|
const std::vector<std::string> &det_modules_hostname = {});
|
|
DetectorSetup DetJF9M(const std::string &description = "Detector",
|
|
const std::vector<std::string> &det_modules_hostname = {});
|
|
|
|
DetectorSetup DetJF(int32_t nmodules,
|
|
int32_t horizontal_stacking = 1,
|
|
int32_t gap_x = 0,
|
|
int32_t gap_y = 0,
|
|
bool mirror_y = true,
|
|
const std::string &description = "Detector",
|
|
const std::vector<std::string> &det_modules_hostname = {});
|
|
DetectorSetup DetJF(const DetectorGeometryModular &geom,
|
|
const std::string &description = "Detector",
|
|
const std::vector<std::string> &det_modules_hostname = {});
|
|
|
|
DetectorSetup DetEIGER(int32_t nmodules,
|
|
int32_t horizontal_stacking = 1,
|
|
int32_t gap_x = 0,
|
|
int32_t gap_y = 0,
|
|
bool mirror_y = true,
|
|
const std::string &description = "Detector",
|
|
const std::vector<std::string> &det_modules_hostname = {});
|
|
DetectorSetup DetEIGER(const DetectorGeometryModular &geom,
|
|
const std::string &description = "Detector",
|
|
const std::vector<std::string> &det_modules_hostname = {});
|
|
|
|
DetectorSetup DetDECTRIS(int64_t width, int64_t height,
|
|
const std::string &description,
|
|
const std::string &addr);
|
|
|
|
#endif //JUNGFRAUJOCH_DETECTORSETUP_H
|