|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
Base of the GPU DRP detectors (Drp::Gpu::Detector). More...
#include <Detector.hh>
Inherits Drp::Detector.
Inherited by Drp::Gpu::AreaDetector, Drp::Gpu::EpixUHRemu, Drp::Gpu::EpixUHRsim, and Drp::Gpu::SimDetector.
Public Member Functions | |
| Detector (Parameters *para, MemPoolGpu *pool) | |
| Pass para and pool to Drp::Detector; no wrapped detector until _initialize() is called. | |
| virtual | ~Detector () |
| Delete the wrapped detector, if any. | |
| Gpu::Detector * | gpuDetector () override |
| Return this object. | |
| nlohmann::json | connectionInfo (const nlohmann::json &msg) override |
| Return the wrapped detector's connectionInfo(msg), or a default-constructed (null) JSON value if there is no wrapped detector. | |
| void | connectionShutdown () override |
| Call connectionShutdown() on the wrapped detector, if any. | |
| void | connect (const nlohmann::json &connect_json, const std::string &collectionId) override |
| If there is a wrapped detector, copy nodeId to it and call its connect(connect_json, collectionId). | |
| unsigned | configure (const std::string &config_alias, XtcData::Xtc &xtc, const void *bufEnd) override |
| Call configure() on the wrapped detector, logging an error if it returns non-zero. | |
| unsigned | beginrun (XtcData::Xtc &xtc, const void *bufEnd, const nlohmann::json &runInfo) override |
| Call beginrun() on the wrapped detector, logging an error if it returns non-zero. | |
| unsigned | beginstep (XtcData::Xtc &xtc, const void *bufEnd, const nlohmann::json &stepInfo) override |
| Call beginstep() on the wrapped detector, logging an error if it returns non-zero. | |
| unsigned | enable (XtcData::Xtc &xtc, const void *bufEnd, const nlohmann::json &info) override |
| Call enable() on the wrapped detector, logging an error if it returns non-zero. | |
| unsigned | disable (XtcData::Xtc &xtc, const void *bufEnd, const nlohmann::json &info) override |
| Call disable() on the wrapped detector, logging an error if it returns non-zero. | |
| void | shutdown () override |
| Call shutdown() on the wrapped detector, if any. | |
| Pds::TimingHeader * | getTimingHeader (uint32_t index) const override |
| Return the address just past the DmaDsc at the start of host write buffer index of the MemPoolGpu (hostWrtBufs()), as a TimingHeader pointer. | |
| virtual unsigned | rangeOffset () const =0 |
| Pure virtual: return the bit position of the gain range field in a raw 16-bit value. | |
| virtual unsigned | rangeBits () const =0 |
| Pure virtual: return the width in bits of the gain range field. | |
| virtual float const * | pedestals_d () const =0 |
| Pure virtual: return the device array of pedestals, one set per gain range of one value per pixel. | |
| virtual float const * | gains_d () const =0 |
| Pure virtual: return the device array of gains, laid out like pedestals_d(). | |
| virtual void | issuePhase2 (XtcData::TransitionId::Value) |
| Start phase 2 of a transition; PGPDetectorApp calls it after phase 1 only in simulator mode (device /dev/null). | |
| virtual float const * | referenceBuffers () const |
| Return device buffers of reference calibrated data for checking (used in simulator mode only, per the code comment); null here. | |
| virtual unsigned | referenceBufCnt () const |
| Return the number of reference buffers; 0 here. | |
Public Member Functions inherited from Drp::Detector | |
| Detector (Parameters *para, MemPool *pool) | |
| Set nodeId to -1u and virtChan to 0, keep para and pool, and allocate a transition buffer of para->maxTrSize bytes. | |
| virtual void | slowupdate (XtcData::Xtc &xtc, const void *bufEnd) |
| Reset xtc to an empty Parent Xtc whose source is nodeId. | |
| virtual void | event (XtcData::Dgram &dgram, const void *bufEnd, PGPEvent *event, uint64_t count)=0 |
| Pure virtual: add the L1Accept data of event (the DMA buffers of its lanes) to dgram. | |
| virtual void | event (XtcData::Dgram &dgram, const void *bufEnd, const Pds::Eb::ResultDgram &result) |
| Does nothing unless overridden; called with the trigger result for an event. | |
| virtual XtcData::Shape | shapeCube (unsigned rawDefIndex, unsigned valueIndex, XtcData::DescData &rawData) |
| Return the shape in rawData of entry valueIndex of raw definition rawDefIndex (from rawDef()). | |
| virtual unsigned | addToCube (unsigned rawDefIndex, unsigned valueIndex, unsigned subIndex, double *dst, unsigned bin, XtcData::DescData &rawData) |
| Generic cube accumulation without calibration: add the value or array entry valueIndex of rawData, converted to double, into bin bin of dst (entries of any XTC numeric type). | |
| virtual unsigned | subIndices () |
| Return 0 unless overridden. | |
| virtual unsigned | rawNamesIndex () |
| Return 0 unless overridden. | |
| virtual unsigned | cubeNamesIndex () |
| Return 0 unless overridden. | |
| virtual unsigned | cubeBinBytes () |
| Return ten times the pebble buffer size unless overridden. | |
| virtual std::vector< XtcData::VarDef > & | rawDef () |
| Log an error and abort; detectors used for cube binning must override it. | |
| virtual unsigned | maxMonBufSize () |
| Return the pebble buffer size, times 10 when Parameters::nCubeWorkers is non-zero. | |
| virtual unsigned | configureScan (const nlohmann::json &stepInfo, XtcData::Xtc &xtc, const void *bufEnd) |
| Return 1 (failure) unless overridden, per the code comment. | |
| virtual unsigned | stepScan (const nlohmann::json &stepInfo, XtcData::Xtc &xtc, const void *bufEnd) |
| Return 1 (failure) unless overridden. | |
| virtual bool | scanEnabled () |
| Return false unless overridden. | |
| XtcData::Xtc & | transitionXtc () |
| Return the start of the transition buffer as an Xtc reference. | |
| const void * | trXtcBufEnd () |
| Return the end of the transition buffer. | |
| XtcData::NamesLookup & | namesLookup () |
| Return the names lookup table of this detector. | |
Protected Member Functions | |
| template<typename T > | |
| void | _initialize (Parameters ¶, MemPoolGpu &pool) |
Protected Attributes | |
| Drp::Detector * | m_det |
Protected Attributes inherited from Drp::Detector | |
| Parameters * | m_para |
| MemPool * | m_pool |
| XtcData::NamesLookup | m_namesLookup |
| std::vector< char > | m_xtcbuf |
Additional Inherited Members | |
Public Attributes inherited from Drp::Detector | |
| unsigned | nodeId |
| Node ID used as the XTC source; -1u until set. | |
| unsigned | virtChan |
| Virtual channel number; 0 unless a subclass sets it. | |
Base of the GPU DRP detectors (Drp::Gpu::Detector).
The transition methods forward to a wrapped Drp::Detector for the PGP device when one was created with _initialize(); the pure virtual methods give the Reader calibration kernel its constants.
|
inline |
Pass para and pool to Drp::Detector; no wrapped detector until _initialize() is called.
|
inlinevirtual |
Delete the wrapped detector, if any.
Reimplemented from Drp::Detector.
|
inlineprotected |
|
overridevirtual |
Call beginrun() on the wrapped detector, logging an error if it returns non-zero.
Returns its result, or 0 if there is no wrapped detector.
Reimplemented from Drp::Detector.
Reimplemented in Drp::Gpu::EpixUHRsim, and Drp::Gpu::EpixUHRemu.
|
overridevirtual |
Call beginstep() on the wrapped detector, logging an error if it returns non-zero.
Returns its result, or 0 if there is no wrapped detector.
Reimplemented from Drp::Detector.
|
overridevirtual |
Call configure() on the wrapped detector, logging an error if it returns non-zero.
Returns its result, or 0 if there is no wrapped detector.
Implements Drp::Detector.
Reimplemented in Drp::Gpu::EpixUHRemu, and Drp::Gpu::EpixUHRsim.
|
overridevirtual |
If there is a wrapped detector, copy nodeId to it and call its connect(connect_json, collectionId).
Reimplemented from Drp::Detector.
Reimplemented in Drp::Gpu::SimDetector.
|
overridevirtual |
Return the wrapped detector's connectionInfo(msg), or a default-constructed (null) JSON value if there is no wrapped detector.
Reimplemented from Drp::Detector.
Reimplemented in Drp::Gpu::SimDetector.
|
overridevirtual |
Call connectionShutdown() on the wrapped detector, if any.
Reimplemented from Drp::Detector.
Reimplemented in Drp::Gpu::SimDetector.
|
overridevirtual |
Call disable() on the wrapped detector, logging an error if it returns non-zero.
Returns its result, or 0 if there is no wrapped detector.
Reimplemented from Drp::Detector.
|
overridevirtual |
Call enable() on the wrapped detector, logging an error if it returns non-zero.
Returns its result, or 0 if there is no wrapped detector.
Reimplemented from Drp::Detector.
|
pure virtual |
Pure virtual: return the device array of gains, laid out like pedestals_d().
Implemented in Drp::Gpu::AreaDetector, Drp::Gpu::EpixUHRemu, and Drp::Gpu::EpixUHRsim.
|
inlineoverridevirtual |
Return the address just past the DmaDsc at the start of host write buffer index of the MemPoolGpu (hostWrtBufs()), as a TimingHeader pointer.
Reimplemented from Drp::Detector.
|
inlineoverridevirtual |
Return this object.
Reimplemented from Drp::Detector.
|
inlinevirtual |
Start phase 2 of a transition; PGPDetectorApp calls it after phase 1 only in simulator mode (device /dev/null).
Does nothing here.
Reimplemented in Drp::Gpu::EpixUHRsim, and Drp::Gpu::SimDetector.
|
pure virtual |
Pure virtual: return the device array of pedestals, one set per gain range of one value per pixel.
The Reader kernel computes (data - pedestal) * gain.
Implemented in Drp::Gpu::AreaDetector, Drp::Gpu::EpixUHRemu, and Drp::Gpu::EpixUHRsim.
|
pure virtual |
Pure virtual: return the width in bits of the gain range field.
Implemented in Drp::Gpu::AreaDetector, Drp::Gpu::EpixUHRemu, and Drp::Gpu::EpixUHRsim.
|
pure virtual |
Pure virtual: return the bit position of the gain range field in a raw 16-bit value.
The Reader calibration kernel uses the bits below it as the data value.
Implemented in Drp::Gpu::AreaDetector, Drp::Gpu::EpixUHRemu, and Drp::Gpu::EpixUHRsim.
|
inlinevirtual |
Return the number of reference buffers; 0 here.
Reimplemented in Drp::Gpu::EpixUHRsim.
|
inlinevirtual |
Return device buffers of reference calibrated data for checking (used in simulator mode only, per the code comment); null here.
Reimplemented in Drp::Gpu::EpixUHRsim.
|
overridevirtual |
Call shutdown() on the wrapped detector, if any.
Reimplemented from Drp::Detector.
Reimplemented in Drp::Gpu::SimDetector.
|
protected |