lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
Drp::PythonConfigScanner Class Reference

Scan support for Python-configured detectors: calls the functions {detType}_scan_keys and {detType}_update of the given module (per the header comment) and translates their JSON into XTC. More...

#include <PythonConfigScanner.hh>

Public Member Functions

 PythonConfigScanner (const Parameters &, PyObject &module)
 Keep references to the parameters and the Python module.
 
 ~PythonConfigScanner ()
 Does nothing; empty body.
 
unsigned configure (const nlohmann::json &keys, XtcData::Xtc &xtc, const void *bufEnd, XtcData::NamesId &namesId, XtcData::NamesLookup &namesLookup, std::vector< unsigned > segNos={}, std::vector< std::string > serNos={})
 Call {detType}_scan_keys with keys, translate the returned JSON (or list of JSON, one per segment) into XTC Names with namesId + segment (segment numbers from detName:RO or from segNos, with serNos), and append them to xtc.
 
unsigned step (const nlohmann::json &dict, XtcData::Xtc &xtc, const void *bufEnd, XtcData::NamesId &namesId, XtcData::NamesLookup &namesLookup, std::vector< unsigned > segNos={}, std::vector< std::string > serNos={})
 Call {detType}_update with dict, translate the returned JSON (or list of JSON, one per segment) into XTC, and append it to xtc.
 

Detailed Description

Scan support for Python-configured detectors: calls the functions {detType}_scan_keys and {detType}_update of the given module (per the header comment) and translates their JSON into XTC.

Constructor & Destructor Documentation

◆ PythonConfigScanner()

Drp::PythonConfigScanner::PythonConfigScanner ( const Parameters &  ,
PyObject &  module 
)

Keep references to the parameters and the Python module.

◆ ~PythonConfigScanner()

Drp::PythonConfigScanner::~PythonConfigScanner ( )

Does nothing; empty body.

Member Function Documentation

◆ configure()

unsigned Drp::PythonConfigScanner::configure ( const nlohmann::json &  keys,
XtcData::Xtc &  xtc,
const void *  bufEnd,
XtcData::NamesId &  namesId,
XtcData::NamesLookup &  namesLookup,
std::vector< unsigned >  segNos = {},
std::vector< std::string >  serNos = {} 
)

Call {detType}_scan_keys with keys, translate the returned JSON (or list of JSON, one per segment) into XTC Names with namesId + segment (segment numbers from detName:RO or from segNos, with serNos), and append them to xtc.

Returns 0, or -1 (as unsigned) if translation fails; throws a C string on a Python error or an oversize result.

◆ step()

unsigned Drp::PythonConfigScanner::step ( const nlohmann::json &  dict,
XtcData::Xtc &  xtc,
const void *  bufEnd,
XtcData::NamesId &  namesId,
XtcData::NamesLookup &  namesLookup,
std::vector< unsigned >  segNos = {},
std::vector< std::string >  serNos = {} 
)

Call {detType}_update with dict, translate the returned JSON (or list of JSON, one per segment) into XTC, and append it to xtc.

Returns 0, or -1 (as unsigned) if translation fails; throws a C string on a Python error or an oversize result.


The documentation for this class was generated from the following file: