Skip to content

psana.detector.detector_impl

DetectorImpl is the base class of all detector interface classes (det.raw, det.fex, ...). It stores the detector name, DRP class name, configuration and calibration constants, gives access to the event's data segments (_segments(evt)) and configuration (config(evt)), and can create one accessor method per data field (_add_fields()). MissingDet is the placeholder returned by run.Detector(name, accept_missing=True) for a detector that is not in the data.

_reset() (called by the constructor) stores, among others, _det_name, _drp_class_name, _calibconst and _uniqueid. _uniqueid is the detector type followed by the id of each segment, joined with _ (built in psana/psana/dgrammanager.py); det.raw._uniqueid is the name to pass to calib_constants() (except for exp="xpptut15", for which Run._setup_run_calibconst in psana/psana/psexp/run.py uses the fixed name cspad_detnum1234; see Calibration constants). These attributes have no docstrings, so they are not listed below.

See Detector interface.

psana.detector.detector_impl

Base detector interface DetectorImpl, plus MissingDet, Container and the hiddenmethod decorator.

Container

Container()

Bases: object

Empty container class; its __init__ body is pass.

MissingDet

MissingDet()

Stand-in for a missing detector.

Any attribute access returns a new MissingDet, iterating yields nothing, and calling it with one argument returns None.

DetectorImpl

DetectorImpl(det_name, drp_class_name, configinfo, calibconst, env_store=None, var_name=None, **kwargs)

Base class of the detector interfaces for one (detector name, data type) pair.

Instances are shared: creating the class again with the same detector name and data type returns the existing instance, reset with the new arguments (detectors named "scan" or "epics" get a new instance each time). It stores the detector's configs, calibration constants, sorted segment ids, unique id, detector type, env store and variable name; _segments(evt) returns the detector's segments in an event, or None unless all expected segments are present.

config

config(evt) -> dict

Return a dict that merges the per-segment config entries of this detector from all its Configure dgrams; evt is not used.

hiddenmethod

hiddenmethod(obj)

Adds an '_hidden' attribute to an object so it won't be picked up by detinfo