|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
Factory for DB type selection. More...
Classes | |
| class | CalibPars |
| Calibration constants and geometry for one detector. More... | |
| class | CalibParsDB |
| Base class for calibration-constant backends (see getCalibParsDB()). More... | |
| class | CalibParsDBWeb |
| CalibParsDB backend that fetches constants with the MDBWebUtils functions. More... | |
| class | CalibParsEpix100a |
| CalibPars subclass for Epix100a. More... | |
| class | Query |
| Calibration-database query: a map from QUERY_PAR keys to string values plus a stored query string. More... | |
Typedefs | |
| typedef float | pedestals_t |
| float; element type of CalibPars::pedestals(). | |
| typedef float | pixel_rms_t |
| float; element type of CalibPars::rms(). | |
| typedef uint16_t | pixel_status_t |
| uint16_t; element type of CalibPars::status(). | |
| typedef float | pixel_gain_t |
| float; element type of CalibPars::gain(). | |
| typedef float | pixel_offset_t |
| float; element type of CalibPars::offset(). | |
| typedef uint16_t | pixel_mask_t |
| uint16_t; element type of the CalibPars mask arrays (mask_calib(), mask(), mask_geo(), ...). | |
| typedef float | pixel_bkgd_t |
| float; element type of CalibPars::background(). | |
| typedef uint32_t | pixel_idx_t |
| uint32_t; element type of CalibPars::indexes(). | |
| typedef double | pixel_coord_t |
| double; element type of CalibPars::coords(). | |
| typedef double | pixel_size_t |
| double; element type of CalibPars::pixel_size(), image_xaxis() and image_yaxis(). | |
| typedef double | pixel_area_t |
| double; element type of CalibPars::pixel_area(). | |
| typedef double | tilt_angle_t |
| double; argument type of AreaDetector::tilt_geo(). | |
| typedef double | common_mode_t |
| double; element type of CalibPars::common_mode(). | |
| typedef std::string | geometry_t |
| std::string holding text from a file (per the trailing comment); returned by CalibPars::geometry_str(). | |
| typedef float | query_t |
| float; the trailing comment marks it as a temporary substitution for an object. | |
Enumerations | |
| enum | DBTYPE { DBDEF , DBWEB , DBMONGO , DBCALIB , DBHDF5 } |
| Calibration database backend types, used by getCalibParsDB() and name_of_dbtype(). More... | |
| enum | CALIB_TYPE { PEDESTALS =0 , PIXEL_RMS , PIXEL_STATUS , PIXEL_GAIN , PIXEL_OFFSET , PIXEL_MASK , PIXEL_BKGD , PIXEL_IDX , PIXEL_COORD , PIXEL_SIZE , PIXEL_AREA , TILT_ANGLE , COMMON_MODE , GEOMETRY } |
| Calibration constant types. More... | |
Functions | |
| CalibParsDB * | getCalibParsDB (const DBTYPE dbtype=calib::DBWEB) |
| Return a new backend for dbtype: CalibParsDB for DBDEF, CalibParsDBWeb for DBWEB; for other types log a WARNING and return NULL. | |
| const char * | name_of_dbtype (const DBTYPE) |
| Return "DBDEF", "DBWEB", "DBCALIB" or "DBHDF5"; throws a const char* for any other value, including DBMONGO. | |
| CalibPars * | getCalibPars (const char *detname="undefined", const DBTYPE &dbtype=DBWEB) |
| Return a new CalibPars for detname: CalibParsEpix100a if find_area_dettype(detname) is EPIX100A, the base CalibPars for UNDEFINED or PNCCD. | |
| const char * | name_of_calibtype (const CALIB_TYPE &ctype) |
| Return the lower-case name of ctype (e.g. | |
Factory for DB type selection.
Usage.
Usage::
#include "psalg/calib/CalibParsDBStore.hh"
Query q("some-string defining DB, derector, collection, constants type, run or timestamp is here");
CalibParsDB* o = new getCalibParsDB(calib::DBVEB); std::cout << "In test_CalibParsDB dbtypename: " << o->dbtypename() << '
';
const NDArray<float>& nda_float = o->get_ndarray_float(q); const NDArray<double>& nda_double = o->get_ndarray_double(q); const NDArray<uint16_t>& nda_uint16 = o->get_ndarray_uint16(q); const NDArray<uint32_t>& nda_uint32 = o->get_ndarray_uint32(q); std::string& s = o->get_string(q);
#include "psalg/calib/CalibParsDBTypes.hh"
#include "psalg/calib/CalibParsStore.hh" query_t query = 123; CalibPars* cp = getCalibPars("Epix100a"); NDArray<pedestals_t>& peds = cp->pedestals(query); NDArray<common_mode_t>& cmode = cp->common_mode(query); geometry_t& strgeo = cp->geometry();
#include "psalg/calib/CalibParsTypes.hh"
| typedef double calib::common_mode_t |
double; element type of CalibPars::common_mode().
| typedef std::string calib::geometry_t |
std::string holding text from a file (per the trailing comment); returned by CalibPars::geometry_str().
| typedef float calib::pedestals_t |
float; element type of CalibPars::pedestals().
| typedef double calib::pixel_area_t |
double; element type of CalibPars::pixel_area().
| typedef float calib::pixel_bkgd_t |
float; element type of CalibPars::background().
| typedef double calib::pixel_coord_t |
double; element type of CalibPars::coords().
| typedef float calib::pixel_gain_t |
float; element type of CalibPars::gain().
| typedef uint32_t calib::pixel_idx_t |
uint32_t; element type of CalibPars::indexes().
| typedef uint16_t calib::pixel_mask_t |
uint16_t; element type of the CalibPars mask arrays (mask_calib(), mask(), mask_geo(), ...).
| typedef float calib::pixel_offset_t |
float; element type of CalibPars::offset().
| typedef float calib::pixel_rms_t |
float; element type of CalibPars::rms().
| typedef double calib::pixel_size_t |
double; element type of CalibPars::pixel_size(), image_xaxis() and image_yaxis().
| typedef uint16_t calib::pixel_status_t |
uint16_t; element type of CalibPars::status().
| typedef float calib::query_t |
float; the trailing comment marks it as a temporary substitution for an object.
| typedef double calib::tilt_angle_t |
double; argument type of AreaDetector::tilt_geo().
| enum calib::CALIB_TYPE |
Calibration constant types.
name_of_calibtype() maps them to names, which Query::set_calibtype() stores as the CALIBTYPE parameter.
| Enumerator | |
|---|---|
| PEDESTALS | Value 0; name "pedestals". |
| PIXEL_RMS | Value 1; name "pixel_rms". |
| PIXEL_STATUS | Value 2; name "pixel_status". |
| PIXEL_GAIN | Value 3; name "pixel_gain". |
| PIXEL_OFFSET | Value 4; name "pixel_offset". |
| PIXEL_MASK | Value 5; name "pixel_mask". |
| PIXEL_BKGD | Value 6; name "pixel_bkgd". |
| PIXEL_IDX | Value 7; name "pixel_idx". |
| PIXEL_COORD | Value 8; name "pixel_coord". |
| PIXEL_SIZE | Value 9; name "pixel_size". |
| PIXEL_AREA | Value 10; name_of_calibtype() has no case for it and returns "undefined". |
| TILT_ANGLE | Value 11; name_of_calibtype() has no case for it and returns "undefined". |
| COMMON_MODE | Value 12; name "common_mode". |
| GEOMETRY | Value 13; name "geometry". |
| enum calib::DBTYPE |
Calibration database backend types, used by getCalibParsDB() and name_of_dbtype().
| Enumerator | |
|---|---|
| DBDEF | Value 0; getCalibParsDB() returns the base CalibParsDB. |
| DBWEB | Value 1; getCalibParsDB() returns a CalibParsDBWeb. |
| DBMONGO | Value 2; name_of_dbtype() has no case for it and throws, and getCalibParsDB() does not implement it. |
| DBCALIB | Value 3; getCalibParsDB() does not implement it and returns NULL. |
| DBHDF5 | Value 4; getCalibParsDB() does not implement it and returns NULL. |
| CalibPars * calib::getCalibPars | ( | const char * | detname = "undefined", |
| const DBTYPE & | dbtype = DBWEB |
||
| ) |
Return a new CalibPars for detname: CalibParsEpix100a if find_area_dettype(detname) is EPIX100A, the base CalibPars for UNDEFINED or PNCCD.
For any other type it logs a WARNING and throws a const char*. The caller owns the object.
| CalibParsDB * calib::getCalibParsDB | ( | const DBTYPE | dbtype = calib::DBWEB | ) |
Return a new backend for dbtype: CalibParsDB for DBDEF, CalibParsDBWeb for DBWEB; for other types log a WARNING and return NULL.
The caller owns the object. With DEBUG logging enabled, the debug message calls name_of_dbtype(), which throws for DBMONGO.
| const char * calib::name_of_calibtype | ( | const CALIB_TYPE & | ctype | ) |
Return the lower-case name of ctype (e.g.
"pedestals", "pixel_rms", "geometry"), or "undefined" for PIXEL_AREA, TILT_ANGLE and any value without a case.
| const char * calib::name_of_dbtype | ( | const DBTYPE | ) |
Return "DBDEF", "DBWEB", "DBCALIB" or "DBHDF5"; throws a const char* for any other value, including DBMONGO.