MythenDetector

MythenDetector contains all detector specific parameters, such as the number of modules, internal detector parameters like the strip width, as well as the module parameters and methods to calculate the diffraction angle of each strip.

class MythenDetector

Mythen detector specifications and geometry (module parameters and methods to calculate diffraction angles).

Public Functions

MythenDetector(const DGParameters &dgparameters)

Constructor for MythenDetector class.

Parameters:

dgparameters – DGParameters object containing the detector group parameters

MythenDetector(const BCParameters &bcparameters)

Constructor for MythenDetector class.

Parameters:

bcparameters – BCParameters object containing the detector group parameters

~MythenDetector() = default
inline size_t num_modules() const
inline ssize_t num_strips() const
inline double average_distance_sample_pixel() const

average distance from sample to pixel [mm]

inline void average_distance_sample_pixel(const double average_distance_sample_pixel_)

set average distance from sample to pixel [mm]

Parameters:

average_distance_sample_pixel_ – average distance from sample to pixel [mm]

inline double average_solid_angle() const

average solid angle of pixels in Mythen detector [sr]

inline void average_solid_angle(const double average_solid_angle_)

set average solid angle of pixels in Mythen detector [sr]

Parameters:

average_solid_angle_ – average solid angle of pixels in Mythen detector [sr]

inline double sample_detector_offset() const

Offset between sample horizontal plane and detector [degrees].

inline void sample_detector_offset(const double sample_detector_offset_)

set offset between sample horizontal plane and detector [degrees]

Parameters:

sample_detector_offset_ – offset between sample horizontal plane and detector [degrees]

inline double offset() const

additional offset to sample detector offset (can change in experimental setup) [degrees]

inline void offset(const double offset_)

set additional offset to sample detector offset (can change in experimental setup) [degrees]

Parameters:

offset_ – additional offset to sample detector offset (can change in experimental setup) [degrees]

inline double elastic_correction_factor() const

elastic correction factor

inline void elastic_correction_factor(const double elastic_correction_factor_)

set elastic correction factor

Parameters:

elastic_correction_factor_ – elastic correction factor

inline double detector_vertical_axis_offset() const

offset of detector to vertical axis (used for elastic correction) [degrees]

inline void detector_vertical_axis_offset(const double detector_vertical_axis_offset_)

set offset of detector to vertical axis (used for elastic correction) [degrees]

Parameters:

detector_vertical_axis_offset_ – offset of detector to vertical axis (used for elastic correction) [degrees]

inline double sample_x_displacement() const

displacement of sample in x direction of horizontal sample plane [mm]

inline void sample_x_displacement(const double sample_x_displacement_)

set displacement of sample in x direction of horizontal sample plane [mm]

Parameters:

sample_x_displacement_ – displacement of sample in x direction of horizontal sample plane [mm]

inline double sample_y_displacement() const

displacement of sample in y direction of horizontal sample plane [mm]

inline void sample_y_displacement(const double sample_y_displacement_)

set displacement of sample in y direction of horizontal sample plane [mm]

Parameters:

sample_y_displacement_ – displacement of sample in y direction of horizontal sample plane [mm]

inline double dead_time() const

measured dead-time [s]

inline void dead_time(const double dead_time_)

set measured dead-time [s]

Parameters:

dead_time_ – measured dead-time [s]

inline aare::NDView<bool, 1> disconnected_modules()

get the disconnected modules

const DGParameters &get_DGparameters() const

get the historic DG parameters

DGParameters &get_DGparameters()
void set_DGparameters(const DGParameters &dgparameters)

set the histoic DG parameters

const BCParameters &get_BCparameters() const

get the current BC parameters

BCParameters &get_BCparameters()
void set_BCparameters(const BCParameters &bcparameters)

set the current BC parameters

double diffraction_angle_from_DG_parameters(const size_t module_index, const double detector_angle, size_t strip_index, const double distance_to_strip = 0) const

calculates diffraction angle from DG module parameters (used in Beer’s Law)

Parameters:
  • module_index – index of module

  • detector_angle – detector position [degrees]

  • strip_index – local strip index of module e.g. 0-1279

  • distance_to_strip – distance to strip [given in strips]

Returns:

diffraction angle [degrees]

double diffraction_angle_from_BC_parameters(const size_t module_index, const double detector_angle, size_t strip_index, const double distance_to_strip = 0) const

calculates diffraction angle from BC (best computing) module parameters (used in Beer’s Law)

Parameters:
  • module_index – index of module

  • detector_angle – detector position [degrees]

  • strip_index – local strip index of module e.g. 0-1279

  • distance_to_strip – distance to strip [given in strips]

Returns:

diffraction angle [degrees]

double diffraction_angle_from_EE_parameters(const double module_center_distance, const double normal_distance, const double angle, const double detector_angle, size_t strip_index, const double distance_to_strip = 0) const

calculates diffraction angle from EE module parameters (used in Beer’s Law)

Parameters:
  • module_center_distance – distance between start of module and orthogonal projection of sample onto detector (D)

  • normal_distance – normal distance between sample and detector (R)

  • angle – angle between undiffracted beam and orthogonal sample projection on detector (phi) [degrees]

  • detector_angle – detector position [degrees]

  • strip_index – local strip index of module

  • distance_to_strip – distance to strip [given in strips]

Returns:

diffraction angle [degrees]

double angular_strip_width_from_DG_parameters(const size_t module_index, size_t local_strip_index) const

calculated the strip width expressed as angle from DG module parameters

Parameters:
  • module_index – index of module

  • local_strip_index – local strip index of module e.g. 0-1279

Returns:

strip width in angles [degrees]

double angular_strip_width_from_BC_parameters(const size_t module_index, const size_t local_strip_index) const

calculated the strip width expressed as angle from BC module parameters

Parameters:
  • module_index – index of module

  • local_strip_index – local strip index of module e.g. 0-1279

Returns:

strip width in angles [degrees]

double angular_strip_width_from_EE_parameters(const double module_center_distance, const double normal_distance, const double angle, const size_t local_strip_index) const

calculated the strip width expressed as angle from EE module parameters

Parameters:
  • module_center_distance – distance between start of module and orthogonal projection of sample onto detector (D)

  • normal_distance – normal distance between sample and detector (R)

  • angle – angle between undiffracted beam and orthogonal sample projection on detector (phi) [degrees]

  • local_strip_index – local strip index of module e.g. 0-1279

Returns:

strip width in angles [degrees]

double elastic_correction(const double detector_angle) const

calculates the elastic correction factor for given detector angle based on torsional compliance correction model

Parameters:

detector_angle – detector axis motor position [degrees]

double transverse_width(const size_t module_index, size_t strip_index, bool from_BC_parameters = true) const

calculates the transverse width of the strip projected onto a plane

Parameters:
  • module_index – index of module

  • strip_index – local strip index of module e.g. 0-1279

  • from_BC_parameters – whether to use BC parameters (true) or DG parameters (false)

Returns:

transverse width of strip projected onto a plane [mm] // TODO: is it mm

double solid_angle(const size_t module_index, size_t strip_index) const

calculates the solid angle of a strip

Parameters:
  • module_index – index of module

  • strip_index – local strip index of module e.g. 0-1279

Returns:

solid angle of strip [sr]

Public Static Functions

static inline constexpr ssize_t strips_per_module()
static inline constexpr double pitch()
static inline constexpr double strip_transverse_width()

Private Functions

double sample_displacement_correction(const double diffraction_angle) const

calculates the correction of the diffraction angle due to sample displacement in the x and y direction of the horizontal sample plane

Parameters:

diffraction_angle – diffraction angle calculated at center of strip without sample displacement correction [degrees]

Returns:

correction of diffraction angle due to sample displacement [degrees]

Private Members

const size_t m_num_modules = {}

number of modules in detector

double m_average_distance_sample_pixel = 2500.0 / M_PI

average euclidean distance between sample and pixel [mm]

double m_average_solid_angle = 6.31654681669718951605407423992073673e-7

average solid angle of pixels in Mythen detector [sr]

double m_sample_detector_offset = 1.4715

Offset between sample horizontal plane and detector [degrees].

double m_offset = 0.0

additional offset to sample detector offset (can change in experimental setup) [degrees]

double m_elastic_correction_factor = 0.0

elastic correction factor

double m_detector_vertical_axis_offset = 0.0

offste of detector to vertical axis (used for elastic correction) [degrees]

double m_sample_x_displacement = 0.0

displacement of sample in x direction of horizontal sample plane [mm]

double m_sample_y_displacement = 0.0

displacement of sample in y direction of horizontal sample plane [mm]

double m_dead_time = 76.08e-9

measured dead-time [s]

aare::NDArray<bool, 1> m_disconnected_modules = {}

boolean mask of disconnected modules (true if module is disconnected)

DGParameters DGparameters

mythen detector DG parameters (detector group) for current detector geometry

BCParameters BCparameters

mythen detector BC parameters (best computing) for current detector geometry

Private Static Attributes

static constexpr size_t m_strips_per_module = 1280

number of strips/channels per module

static constexpr double m_pitch = 0.05

Strip/channel width of Mythen detector [mm].

static constexpr double m_strip_transverse_width = 8.0

Strip/channel height of Mythen detector [mm].