MythenDetectorSpecifications

MythenDetectorSpecifications contains all detector specific parameters, such as the number of modules, internal detector parameters like the strip width.

Note

The method read_bad_channels_from_file expects a text file using the format below. Each line denotes the index of a bad channel. Consecutive bad channels can be stored on one line e.g. channels with 20-42 are bad channels.

1
2
20-42
100
1002-1004

If youre file format deviates from the above format read youre file into a boolean aare::NDArray and pass to set_bad_channels directly. Alternatively implement your custom Filereader inheriting from SimpleFileInterface (SimpleFileInterface) and pass it to the constructor.

class MythenDetectorSpecifications

Public Functions

inline MythenDetectorSpecifications(std::optional<std::shared_ptr<SimpleFileInterface>> custom_file_ptr = std::nullopt)

constructor for MythenDetectorSpecifications

Parameters:

custom_file_ptr – (optional) pass Filereader to read bad channels file default If none is provided bad channel file is expected to be a text file where each line stores the channel index of a bad channel. Consecutive bad channels can be stored in one line by seperating the first and last channel index of the bad channel block e.g. bad_channel_index0-bad_channel_index1.)

inline MythenDetectorSpecifications(const size_t max_modules, const double exposure_time, const double num_counters = 1, double bloffset = 1.532, std::optional<std::shared_ptr<SimpleFileInterface>> custom_file_ptr = std::nullopt)

constructor for MythenDetectorSpecifications

Parameters:
  • max_modules – Number of modules in detector (default 48).

  • exposure_time – Exposure time [s].

  • num_counters – Number of counters active.

  • bloffset

  • custom_file_ptr – (optional) pass Filereader to read bad channels file default If none is provided bad channel file is expected to be a text file where each line stores the channel index of a bad channel. Consecutive bad channels can be stored in one line by seperating the first and last channel index of the bad channel block e.g. bad_channel_index0-bad_channel_index1.)

inline void read_bad_channels_from_file(const std::string &filename)

read bad channels from file

Warning

only works if member custom_file_ptr supports reading the format

inline void set_unconnected_modules(const std::vector<ssize_t> &unconnected_modules)
inline NDView<bool, 1> get_bad_channels() const
inline void set_bad_channels(const NDArray<bool, 1> &bad_channels_)

set bad channels

Parameters:

bad_channels_ – boolean NDArray of size of total number of strips/channels in detector, stores ‘TRUE’ if strip is a bad channel otherwise ‘FALSE’

inline NDArray<ssize_t, 1> get_unconnected_modules() const
inline size_t max_modules() const

number of modules in detector (default ‘48’)

inline size_t num_counters() const
inline double exposure_time() const
inline double bloffset() const
inline double dtt0() const
inline ssize_t num_strips() const

total number of strips/channels in detector

Public Static Functions

static inline double pitch()
static inline size_t strips_per_module()
static inline double min_angle()
static inline double max_angle()

Private Members

size_t max_modules_ = 48

number of modules in detector

size_t num_counters_ = 1

num counters active in detector

double exposure_time_ = 5.0

exposure time [s]

double bloffset_ = 1.532
NDArray<bool, 1> bad_channels = {}

Array of size strips/channels in detector, stores ‘TRUE’ if strip is a bad channel otherwise ‘FALSE’

NDArray<ssize_t, 1> m_unconnected_modules = {}
std::shared_ptr<SimpleFileInterface> m_custom_file_ptr = std::make_shared<CustomBadChannelsFile>()

file interface to read bad channels file

Private Static Attributes

static size_t strips_per_module_ = 1280

number of strips/channels per module

static double pitch_ = 0.05

Strip/channel width of Mythen detector [mm]

static double min_angle_ = -180.0

Minimum potential detector angle (measured as displacement of first strip) [degree]

static double max_angle_ = 180.0

Maximum potential detector angle (measured as displacement of first strip) [degree]

static double dtt0_ = 0.0