Modifications necessary for the EIGER test

This commit is contained in:
2024-04-18 15:36:52 +02:00
parent e1f5dc1ef5
commit 9630c06b02
14 changed files with 421 additions and 139 deletions
+38 -3
View File
@@ -17,9 +17,22 @@ DetectorSetup::DetectorSetup(const DetectorGeometry &in_geometry,
description(in_description),
det_modules_hostname(in_det_modules_hostname),
detector_type(in_detector_type) {
if (!det_modules_hostname.empty() && (geometry.GetModulesNum() != det_modules_hostname.size()))
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Mismatch between number of modules in detector geometry and hostname");
switch (detector_type) {
case DetectorType::EIGER:
high_voltage = 150;
if (!det_modules_hostname.empty() && (2 * geometry.GetModulesNum() != det_modules_hostname.size()))
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Mismatch between number of modules in detector geometry and hostname (For EIGER - one module = 2 hostnames)");
break;
case DetectorType::JUNGFRAU:
high_voltage = 120;
if (!det_modules_hostname.empty() && (geometry.GetModulesNum() != det_modules_hostname.size()))
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Mismatch between number of modules in detector geometry and hostname");
break;
default:
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid, "Detector not supported");
}
}
const DetectorGeometry &DetectorSetup::GetGeometry() const {
@@ -72,6 +85,8 @@ const std::vector<JFModuleGainCalibration> &DetectorSetup::GetGainCalibration()
}
int64_t DetectorSetup::GetUDPInterfaceCount() const {
if (detector_type == DetectorType::EIGER)
return 2;
return udp_interface_count;
}
@@ -113,3 +128,23 @@ const std::vector<std::string> &DetectorSetup::GetGainFileNames() const {
DetectorType DetectorSetup::GetDetectorType() const {
return detector_type;
}
DetectorSetup &DetectorSetup::HighVoltage(int32_t input) {
high_voltage = input;
return *this;
}
int32_t DetectorSetup::GetHighVoltage() const {
return high_voltage;
}
void DetectorSetup::SetTrimFiles(const std::vector<std::string> &filenames) {
if (filenames.size() != 2 * GetModulesNum())
throw JFJochException(JFJochExceptionCategory::InputParameterInvalid,
"Mismatch in number of trim bit calibration files");
trim_file_names = filenames;
}
const std::vector<std::string> &DetectorSetup::GetTrimFileNames() const {
return trim_file_names;
}