Skip to content

Calibration

#include <xalgospp/detector/calibration.hh>
template<typename Policy = RuntimeCalibPolicy, typename MemTag = ncarray::HostTag>
class Calibration

Defined 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.

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
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.
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() = default

Defined in src/lib/xalgospp/detector/calibration.hh:288

Defaulted constructor.


inline

inline Calibration(const Params & params)

Defined in src/lib/xalgospp/detector/calibration.hh:289


inline

inline void configure_impl(const Params & params)

Defined in src/lib/xalgospp/detector/calibration.hh:293


inline

inline void stage_impl()

Defined in src/lib/xalgospp/detector/calibration.hh:298

For staging, the Calibration algorithm fetchs constants.


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.

Parameter Type Description
input const InputArg & The uncalibrated raw data.
output OutputArg & The array to hold the output calibrated data.

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.

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.

const inline

inline const char * name_impl() const

Defined in src/lib/xalgospp/detector/calibration.hh:455


const inline

inline const Params & params_impl() const

Defined in src/lib/xalgospp/detector/calibration.hh:457


const inline

inline const std::uint8_t * get_staged_data_impl() const

Defined in src/lib/xalgospp/detector/calibration.hh:470

Retrieve a pointer to the calibration constants.

A pointer to the constants buffer.


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.

Parameter Type Description
buf std::uint8_t * A buffer containing calibration constants.
nbytes std::size_t The size of the buffer in bytes.

const inline

inline std::size_t staged_data_size_impl() const

Defined in src/lib/xalgospp/detector/calibration.hh:528

The total size in bytes of the calibration constants and any serialized params.

The total size in bytes of the calibration constants.

Return Name Description
constexpr AlgTypeConstraint TypeConstraint static constexpr

static constexpr

constexpr AlgTypeConstraint TypeConstraint { }

Defined in src/lib/xalgospp/detector/calibration.hh:246

Name Description
Input
Output

using Input = type_list< ncarray::NCViewFor< MemTag >, ncarray::SOViewFor< MemTag > >

Defined in src/lib/xalgospp/detector/calibration.hh:240


using Output = type_list< ncarray::NCViewFor< MemTag >, ncarray::SOViewFor< MemTag > >

Defined in src/lib/xalgospp/detector/calibration.hh:243

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.

Params m_params

Defined in src/lib/xalgospp/detector/calibration.hh:749


std::span< PixelCalibStruct > m_constants

Defined 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.


std::vector< std::uint8_t > m_serialized_data

Defined 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.

Return Name Description
void get_lcls2_calibdb_constants inline Fetch calibration constants from the LCLS2 CalibDB.
void build_stencil const inline

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.


const inline

inline void build_stencil(const ncarray::SOViewFor< MemTag > & input) const

Defined in src/lib/xalgospp/detector/calibration.hh:690