|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
Abstract base of the DRP detector classes: transition hooks (most default to doing nothing and returning 0), event handlers, cube binning hooks and a buffer for building transition XTC. More...
#include <Detector.hh>
Inherited by Drp::BEBDetector, Drp::Digitizer, Drp::Gpu::Detector, and Drp::XpmDetector.
Public Member Functions | |
| 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 | ~Detector () |
| Does nothing; empty body. | |
| virtual Gpu::Detector * | gpuDetector () |
| Return nullptr; Gpu::Detector overrides it to return itself. | |
| virtual nlohmann::json | connectionInfo (const nlohmann::json &msg) |
| Return an empty JSON object unless overridden; msg is not used. | |
| virtual void | connectionShutdown () |
| Does nothing unless overridden. | |
| virtual void | connect (const nlohmann::json &, const std::string &collectionId) |
| Does nothing unless overridden. | |
| virtual unsigned | configure (const std::string &config_alias, XtcData::Xtc &xtc, const void *bufEnd)=0 |
| Pure virtual: add the Configure data for config_alias to xtc; implementations return 0 on success. | |
| virtual unsigned | beginrun (XtcData::Xtc &xtc, const void *bufEnd, const nlohmann::json &runInfo) |
| Return 0 without doing anything unless overridden. | |
| virtual unsigned | beginstep (XtcData::Xtc &xtc, const void *bufEnd, const nlohmann::json &stepInfo) |
| Return 0 without doing anything unless overridden. | |
| virtual unsigned | enable (XtcData::Xtc &xtc, const void *bufEnd, const nlohmann::json &info) |
| Return 0 without doing anything unless overridden. | |
| virtual unsigned | disable (XtcData::Xtc &xtc, const void *bufEnd, const nlohmann::json &info) |
| Return 0 without doing anything unless overridden. | |
| 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 void | shutdown () |
| Does nothing unless overridden. | |
| 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 Pds::TimingHeader * | getTimingHeader (uint32_t index) const |
| Return the start of DMA buffer index as a TimingHeader pointer. | |
| 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. | |
Public Attributes | |
| unsigned | nodeId |
| Node ID used as the XTC source; -1u until set. | |
| unsigned | virtChan |
| Virtual channel number; 0 unless a subclass sets it. | |
Protected Attributes | |
| Parameters * | m_para |
| MemPool * | m_pool |
| XtcData::NamesLookup | m_namesLookup |
| std::vector< char > | m_xtcbuf |
Abstract base of the DRP detector classes: transition hooks (most default to doing nothing and returning 0), event handlers, cube binning hooks and a buffer for building transition XTC.
|
inline |
Set nodeId to -1u and virtChan to 0, keep para and pool, and allocate a transition buffer of para->maxTrSize bytes.
|
inlinevirtual |
Does nothing; empty body.
Reimplemented in Drp::Gpu::Detector.
|
virtual |
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).
subIndex is not used. Returns the size of one bin entry in bytes.
Reimplemented in Drp::AreaDetector, and Drp::TimingSystem.
|
inlinevirtual |
Return 0 without doing anything unless overridden.
Reimplemented in Drp::Gpu::EpixUHRsim, Drp::AreaDetector, Drp::EpixHRemu, Drp::Jungfrau, Drp::JungfrauEmulator, Drp::Gpu::Detector, and Drp::Gpu::EpixUHRemu.
|
inlinevirtual |
Return 0 without doing anything unless overridden.
Reimplemented in Drp::TimingSystem, and Drp::Gpu::Detector.
|
pure virtual |
Pure virtual: add the Configure data for config_alias to xtc; implementations return 0 on success.
Implemented in Drp::PvDetector, Drp::Gpu::AreaDetector, Drp::Gpu::EpixUHRemu, Drp::Gpu::EpixUHRsim, Drp::AreaDetector, Drp::BEBDetector, Drp::Digitizer, Drp::EpixHRemu, Drp::JungfrauEmulator, Drp::TimingSystem, Drp::UdpEncoder, Drp::XpmDetector, Drp::Gpu::Detector, and Drp::EaDetector.
|
inlinevirtual |
Return 1 (failure) unless overridden, per the code comment.
Reimplemented in Drp::TimingSystem, Drp::Jungfrau, Drp::BEBDetector, and Drp::Digitizer.
|
inlinevirtual |
Does nothing unless overridden.
Reimplemented in Drp::TimingBEB, Drp::BEBDetector, Drp::Digitizer, Drp::XpmDetector, Drp::Gpu::SimDetector, Drp::Gpu::Detector, and Drp::TimingSystem.
|
inlinevirtual |
Return an empty JSON object unless overridden; msg is not used.
Reimplemented in Drp::BEBDetector, Drp::Digitizer, Drp::EpixUHR3x2, Drp::XpmDetector, Drp::Gpu::Detector, and Drp::Gpu::SimDetector.
|
inlinevirtual |
Does nothing unless overridden.
Reimplemented in Drp::BEBDetector, Drp::XpmDetector, Drp::Gpu::Detector, and Drp::Gpu::SimDetector.
|
inlinevirtual |
Return ten times the pebble buffer size unless overridden.
Reimplemented in Drp::AreaDetector.
|
inlinevirtual |
Return 0 unless overridden.
Reimplemented in Drp::AreaDetector, and Drp::TimingSystem.
|
inlinevirtual |
Return 0 without doing anything unless overridden.
Reimplemented in Drp::PvDetector, Drp::Epix100, Drp::EpixHR2x2, Drp::EpixM320, Drp::EpixQuad, Drp::EpixUHR, Drp::EpixUHR3x2, Drp::Jungfrau, and Drp::Gpu::Detector.
|
inlinevirtual |
Return 0 without doing anything unless overridden.
Reimplemented in Drp::PvDetector, Drp::Epix100, Drp::EpixHR2x2, Drp::EpixM320, Drp::EpixQuad, Drp::EpixUHR, Drp::EpixUHR3x2, Drp::Jungfrau, and Drp::Gpu::Detector.
|
inlinevirtual |
Does nothing unless overridden; called with the trigger result for an event.
Reimplemented in Drp::AreaDetector, Drp::TimingSystem, and Drp::PvDetector.
|
pure virtual |
Pure virtual: add the L1Accept data of event (the DMA buffers of its lanes) to dgram.
Implemented in Drp::Gpu::AreaDetector, Drp::Gpu::EpixUHRemu, Drp::Gpu::EpixUHRsim, Drp::AreaDetector, Drp::AreaDetector, Drp::BEBDetector, Drp::Digitizer, Drp::EpixHRemu, Drp::JungfrauEmulator, Drp::TimingSystem, Drp::UdpEncoder, Drp::EaDetector, and Drp::PvDetector.
|
inlinevirtual |
Return the start of DMA buffer index as a TimingHeader pointer.
Reimplemented in Drp::BEBDetector, Drp::EpixHR2x2, Drp::EpixM320, Drp::EpixUHR, Drp::EpixUHR3x2, and Drp::Gpu::Detector.
|
inlinevirtual |
Return nullptr; Gpu::Detector overrides it to return itself.
Reimplemented in Drp::Gpu::Detector.
|
inlinevirtual |
Return the pebble buffer size, times 10 when Parameters::nCubeWorkers is non-zero.
Reimplemented in Drp::TimingSystem.
|
inline |
Return the names lookup table of this detector.
|
virtual |
Log an error and abort; detectors used for cube binning must override it.
Reimplemented in Drp::AreaDetector, and Drp::TimingSystem.
|
inlinevirtual |
Return 0 unless overridden.
Reimplemented in Drp::AreaDetector, and Drp::TimingSystem.
|
inlinevirtual |
Return false unless overridden.
Reimplemented in Drp::Epix100, Drp::EpixHR2x2, Drp::EpixM320, Drp::EpixQuad, Drp::EpixUHR, Drp::EpixUHR3x2, Drp::TimingBEB, and Drp::TimingSystem.
|
virtual |
Return the shape in rawData of entry valueIndex of raw definition rawDefIndex (from rawDef()).
Reimplemented in Drp::TimingSystem.
|
inlinevirtual |
Does nothing unless overridden.
Reimplemented in Drp::BEBDetector, Drp::Digitizer, Drp::Epix100, Drp::EpixHR2x2, Drp::EpixM320, Drp::EpixQuad, Drp::EpixUHR, Drp::EpixUHR3x2, Drp::Opal, Drp::Piranha4, Drp::TimingBEB, Drp::XpmDetector, Drp::Gpu::Detector, and Drp::Gpu::SimDetector.
|
inlinevirtual |
Reset xtc to an empty Parent Xtc whose source is nodeId.
Reimplemented in Drp::Epix100, Drp::EpixHR2x2, Drp::EpixM320, Drp::EpixQuad, Drp::EpixUHR, Drp::EpixUHR3x2, Drp::Opal, Drp::Piranha4, and Drp::EaDetector.
|
inlinevirtual |
Return 1 (failure) unless overridden.
Reimplemented in Drp::BEBDetector, Drp::Digitizer, Drp::Jungfrau, and Drp::TimingSystem.
|
inlinevirtual |
Return 0 unless overridden.
Reimplemented in Drp::AreaDetector.
|
inline |
Return the start of the transition buffer as an Xtc reference.
|
inline |
Return the end of the transition buffer.
|
protected |
|
protected |
|
protected |
|
protected |
| unsigned Drp::Detector::nodeId |
Node ID used as the XTC source; -1u until set.
| unsigned Drp::Detector::virtChan |
Virtual channel number; 0 unless a subclass sets it.