Calibration
Calibration
Section titled “Calibration”#include <xalgospp/detector/calibration.hh>template<typename Policy = RuntimeCalibPolicy, typename MemTag = ncarray::HostTag>class CalibrationDefined in src/lib/xalgospp/detector/calibration.hh:237
Inherits:
HostTag >
The Calibration algorithm will calibrate an input array image.
This Algorithm implements the optional stage step. Currently, this is only supported for LCLS2-based workflows. In that case, the stage step will fetch constants from the LCLS2 CalibDB based on the provided serial number for the detector of interest.
For actual data calibration, the Algorithm accepts either a compile-time policy, or runtime set of parameters for learning how to calibrate the image. By default, it fallsback on the runtime policy for generic use.
Template Parameters
Section titled “Template Parameters”PolicyThe compile-time calibration policy - or RuntimeCalibPolicy.
List of all members
Section titled “List of all members”| Name | Kind | Owner |
|---|---|---|
Calibration |
function |
Declared here |
Calibration |
function |
Declared here |
configure_impl |
function |
Declared here |
stage_impl |
function |
Declared here |
process_impl |
function |
Declared here |
process_many_impl |
function |
Declared here |
name_impl |
function |
Declared here |
params_impl |
function |
Declared here |
get_staged_data_impl |
function |
Declared here |
set_staged_data_impl |
function |
Declared here |
staged_data_size_impl |
function |
Declared here |
TypeConstraint |
variable |
Declared here |
Input |
typedef |
Declared here |
Output |
typedef |
Declared here |
m_params |
variable |
Declared here |
m_constants |
variable |
Declared here |
m_serialized_data |
variable |
Declared here |
get_lcls2_calibdb_constants |
function |
Declared here |
build_stencil |
function |
Declared here |
Algorithm |
function |
Inherited from Algorithm |
configure |
function |
Inherited from Algorithm |
stage |
function |
Inherited from Algorithm |
get_staged_data |
function |
Inherited from Algorithm |
set_staged_data |
function |
Inherited from Algorithm |
staged_data_size |
function |
Inherited from Algorithm |
process |
function |
Inherited from Algorithm |
process |
function |
Inherited from Algorithm |
operator() |
function |
Inherited from Algorithm |
operator() |
function |
Inherited from Algorithm |
process_many |
function |
Inherited from Algorithm |
process_many |
function |
Inherited from Algorithm |
name |
function |
Inherited from Algorithm |
print_configuration |
function |
Inherited from Algorithm |
print_configuration |
function |
Inherited from Algorithm |
params |
function |
Inherited from Algorithm |
TypeConstraint |
variable |
Inherited from Algorithm |
Input |
typedef |
Inherited from Algorithm |
Output |
typedef |
Inherited from Algorithm |
Inherited from Algorithm
Section titled “Inherited from Algorithm”| Kind | Name | Description |
|---|---|---|
function |
Algorithm |
Defaulted constructor. |
function |
configure inline |
Perform configuration of the algorithm given an input set of parameters. |
function |
stage inline |
Optional stage to perform associated actions before processing. |
function |
get_staged_data const inline |
For Algorithms which provide staging of associated data, retrieve what was staged. |
function |
set_staged_data inline |
For Algorithms which provide staging of associated data, alternatively set it. |
function |
staged_data_size const inline |
For Algorithms which provide staging, retrieve the size (in bytes) of the staged data. |
function |
process const inline requires ([]() { if constexpr (requires { Derived::TypeConstraint == AlgTypeConstraint::StrictOrdering; }) { return Derived::Input::template accepts_when_paired< InputArg, OutputArg, typename Derived::Output >; } else { return Derived::Input::template accepts<InputArg> && Derived::Output::template accepts<OutputArg>; } }()) |
|
function |
process inline requires ([]() { if constexpr (requires { Derived::TypeConstraint == AlgTypeConstraint::StrictOrdering; }) { return Derived::Input::template accepts_when_paired< InputArg, OutputArg, typename Derived::Output >; } else { return Derived::Input::template accepts<InputArg> && Derived::Output::template accepts<OutputArg>; } }()) |
|
function |
operator() inline |
|
function |
operator() const inline |
|
function |
process_many const inline requires ([]() { if constexpr (requires { Derived::TypeConstraint == AlgTypeConstraint::StrictOrdering; }) { return Derived::Input::template accepts_when_paired< InputArg, OutputArg, typename Derived::Output >; } else { return Derived::Input::template accepts<InputArg> && Derived::Output::template accepts<OutputArg>; } }()) |
|
function |
process_many inline requires ([]() { if constexpr (requires { Derived::TypeConstraint == AlgTypeConstraint::StrictOrdering; }) { return Derived::Input::template accepts_when_paired< InputArg, OutputArg, typename Derived::Output >; } else { return Derived::Input::template accepts<InputArg> && Derived::Output::template accepts<OutputArg>; } }()) |
|
function |
name const inline |
|
function |
print_configuration const inline |
Print the name and current values of the Algorithm’s Parameters. |
function |
print_configuration inline |
Print the name and current values of the Algorithm’s Parameters. |
function |
params const inline |
Retrieve the current Parameters for the Algorithm. |
variable |
TypeConstraint static constexpr |
|
typedef |
Input |
The list of supported input types. |
typedef |
Output |
The list of supported output types. |
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
Calibration |
Defaulted constructor. | |
Calibration inline |
||
void |
configure_impl inline |
|
void |
stage_impl inline |
For staging, the Calibration algorithm fetchs constants. |
void |
process_impl const inline requires (Input::template accepts_when_paired<InputArg, OutputArg, Output>) |
The processing step calibrates an input image using the provided constants. |
void |
process_many_impl inline requires (Input::template accepts_when_paired<InputArg, OutputArg, Output>) |
Run processing on multiple inputs (though these are wrapped in one array). |
const char * |
name_impl const inline |
|
const Params & |
params_impl const inline |
|
const std::uint8_t * |
get_staged_data_impl const inline |
Retrieve a pointer to the calibration constants. |
void |
set_staged_data_impl inline |
Provide access from a buffer from elsewhere containing the calibration constants. |
std::size_t |
staged_data_size_impl const inline |
The total size in bytes of the calibration constants and any serialized params. |
Calibration
Section titled “Calibration”Calibration() = defaultDefined in src/lib/xalgospp/detector/calibration.hh:288
Defaulted constructor.
Calibration
Section titled “Calibration”inline
inline Calibration(const Params & params)Defined in src/lib/xalgospp/detector/calibration.hh:289
configure_impl
Section titled “configure_impl”inline
inline void configure_impl(const Params & params)Defined in src/lib/xalgospp/detector/calibration.hh:293
stage_impl
Section titled “stage_impl”inline
inline void stage_impl()Defined in src/lib/xalgospp/detector/calibration.hh:298
For staging, the Calibration algorithm fetchs constants.
process_impl
Section titled “process_impl”const inline requires (Input::template accepts_when_paired<InputArg, OutputArg, Output>)
template<typename InputArg, typename OutputArg> inline void process_impl(const InputArg & input, OutputArg & output) const requires (Input::template accepts_when_paired<InputArg, OutputArg, Output>)Defined in src/lib/xalgospp/detector/calibration.hh:359
The processing step calibrates an input image using the provided constants.
Currently, either compile-time or run-time based dispatch mechanisms are available; however, only the host-side routines are currently exposed.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
input |
const InputArg & |
The uncalibrated raw data. |
output |
OutputArg & |
The array to hold the output calibrated data. |
process_many_impl
Section titled “process_many_impl”inline requires (Input::template accepts_when_paired<InputArg, OutputArg, Output>)
template<typename InputArg, typename OutputArg> inline void process_many_impl(std::size_t count, const InputArg & input, OutputArg & output) requires (Input::template accepts_when_paired<InputArg, OutputArg, Output>)Defined in src/lib/xalgospp/detector/calibration.hh:447
Run processing on multiple inputs (though these are wrapped in one array).
Currently, either compile-time or run-time based dispatch mechanisms are available; however, only the host-side routines are currently exposed.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
count |
std::size_t |
The number of independent inputs - the count should correspond to the FIRST axis of the input array (and output array). However, it does not need to equal the complete length of the dimension. Processing will always start from the beginning of axis 0. |
input |
const InputArg & |
The uncalibrated raw data. |
output |
OutputArg & |
The array to hold the output calibrated data. |
name_impl
Section titled “name_impl”const inline
inline const char * name_impl() constDefined in src/lib/xalgospp/detector/calibration.hh:455
params_impl
Section titled “params_impl”const inline
inline const Params & params_impl() constDefined in src/lib/xalgospp/detector/calibration.hh:457
get_staged_data_impl
Section titled “get_staged_data_impl”const inline
inline const std::uint8_t * get_staged_data_impl() constDefined in src/lib/xalgospp/detector/calibration.hh:470
Retrieve a pointer to the calibration constants.
Returns
Section titled “Returns”A pointer to the constants buffer.
set_staged_data_impl
Section titled “set_staged_data_impl”inline
inline void set_staged_data_impl(std::uint8_t * buf, std::size_t nbytes)Defined in src/lib/xalgospp/detector/calibration.hh:480
Provide access from a buffer from elsewhere containing the calibration constants.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
buf |
std::uint8_t * |
A buffer containing calibration constants. |
nbytes |
std::size_t |
The size of the buffer in bytes. |
staged_data_size_impl
Section titled “staged_data_size_impl”const inline
inline std::size_t staged_data_size_impl() constDefined in src/lib/xalgospp/detector/calibration.hh:528
The total size in bytes of the calibration constants and any serialized params.
Returns
Section titled “Returns”The total size in bytes of the calibration constants.
Public Static Attributes
Section titled “Public Static Attributes”| Return | Name | Description |
|---|---|---|
constexpr AlgTypeConstraint |
TypeConstraint static constexpr |
TypeConstraint
Section titled “TypeConstraint”static constexpr
constexpr AlgTypeConstraint TypeConstraint { }Defined in src/lib/xalgospp/detector/calibration.hh:246
Public Types
Section titled “Public Types”| Name | Description |
|---|---|
Input |
|
Output |
using Input = type_list< ncarray::NCViewFor< MemTag >, ncarray::SOViewFor< MemTag > >Defined in src/lib/xalgospp/detector/calibration.hh:240
Output
Section titled “Output”using Output = type_list< ncarray::NCViewFor< MemTag >, ncarray::SOViewFor< MemTag > >Defined in src/lib/xalgospp/detector/calibration.hh:243
Private Attributes
Section titled “Private Attributes”| Return | Name | Description |
|---|---|---|
Params |
m_params |
|
std::span< PixelCalibStruct > |
m_constants |
The calibration constants used for processing. This span may be constructed over a non-owned buffer in some cases. |
std::vector< std::uint8_t > |
m_serialized_data |
A raw bytes buffer containing the calibration constants and parameters. The parameters are also serialized into the buffer to facilitate data sharing as needed. This may be empty if this particular instance of hte Algorithm does not actually own the data. The span above (m_constants) is what is always used for processing, and it may be constructed over a non-owned buffer, in some cases. |
m_params
Section titled “m_params”Params m_paramsDefined in src/lib/xalgospp/detector/calibration.hh:749
m_constants
Section titled “m_constants”std::span< PixelCalibStruct > m_constantsDefined in src/lib/xalgospp/detector/calibration.hh:754
The calibration constants used for processing. This span may be constructed over a non-owned buffer in some cases.
m_serialized_data
Section titled “m_serialized_data”std::vector< std::uint8_t > m_serialized_dataDefined in src/lib/xalgospp/detector/calibration.hh:763
A raw bytes buffer containing the calibration constants and parameters. The parameters are also serialized into the buffer to facilitate data sharing as needed. This may be empty if this particular instance of hte Algorithm does not actually own the data. The span above (m_constants) is what is always used for processing, and it may be constructed over a non-owned buffer, in some cases.
Private Methods
Section titled “Private Methods”| Return | Name | Description |
|---|---|---|
void |
get_lcls2_calibdb_constants inline |
Fetch calibration constants from the LCLS2 CalibDB. |
void |
build_stencil const inline |
get_lcls2_calibdb_constants
Section titled “get_lcls2_calibdb_constants”inline
inline void get_lcls2_calibdb_constants()Defined in src/lib/xalgospp/detector/calibration.hh:538
Fetch calibration constants from the LCLS2 CalibDB.
This function is used during staging.
build_stencil
Section titled “build_stencil”const inline
inline void build_stencil(const ncarray::SOViewFor< MemTag > & input) constDefined in src/lib/xalgospp/detector/calibration.hh:690