|
lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
|
XpmDetector that emulates an ePixHR: the constructor loads one raw frame per active lane from the XTC file given by the xtcfile kwarg, and each event records those frames as a UINT16 raw array. More...
#include <EpixHRemu.hh>
Inherits Drp::XpmDetector.
Public Member Functions | |
| EpixHRemu (Parameters *para, MemPool *pool) | |
| Set a synthetic serial number from detSegment and, if the xtcfile kwarg is set, read from that file one undamaged L1Accept raw frame per active lane, skipping (lanes x detSegment) plus the l1aOffset kwarg L1Accepts first. | |
| unsigned | configure (const std::string &config_alias, XtcData::Xtc &xtc, const void *bufEnd) override |
| Call XpmDetector::configure() (returning 1 if it fails) and declare the raw names (raw, UINT16 rank 2); returns 0. | |
| unsigned | beginrun (XtcData::Xtc &xtc, const void *bufEnd, const nlohmann::json &runInfo) override |
| Log a message and return 0. | |
| void | event (XtcData::Dgram &dgram, const void *bufEnd, PGPEvent *event, uint64_t l1count) override |
| Build the raw array from the stored frames: for each of the elemRows rows and each active lane, copy elemRowSize pixels from that lane's frame numAsics times (each copy from the same source offset); shape is elemRows by (lanes * numAsics * elemRowSize). | |
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 | ~Detector () |
| Does nothing; empty body. | |
| virtual Gpu::Detector * | gpuDetector () |
| Return nullptr; Gpu::Detector overrides it to return itself. | |
| 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, 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 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 | |
| const unsigned | numAsics = 4 |
| Number of ASICs per lane in the emulated frame (4). | |
| const unsigned | elemRows = 144 |
| Rows per ASIC (144). | |
| const unsigned | elemRowSize = 192 |
| Pixels per ASIC row (192). | |
| const unsigned | numElems = numAsics * elemRows * elemRowSize |
| Pixels per stored frame: numAsics * elemRows * elemRowSize. | |
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. | |
Additional Inherited Members | |
Protected Member Functions inherited from Drp::XpmDetector | |
| XpmDetector (Parameters *para, MemPool *pool, unsigned len=100) | |
| nlohmann::json | connectionInfo (const nlohmann::json &msg) override |
| Return an empty JSON object unless overridden; msg is not used. | |
| void | connect (const nlohmann::json &, const std::string &collectionId) override |
| Does nothing unless overridden. | |
| unsigned | configure (const std::string &config_alias, XtcData::Xtc &xtc, const void *bufEnd) override |
| Pure virtual: add the Configure data for config_alias to xtc; implementations return 0 on success. | |
| void | shutdown () override |
| Does nothing unless overridden. | |
| void | connectionShutdown () override |
| Does nothing unless overridden. | |
Protected Attributes inherited from Drp::XpmDetector | |
| unsigned | m_length |
Protected Attributes inherited from Drp::Detector | |
| Parameters * | m_para |
| MemPool * | m_pool |
| XtcData::NamesLookup | m_namesLookup |
| std::vector< char > | m_xtcbuf |
XpmDetector that emulates an ePixHR: the constructor loads one raw frame per active lane from the XTC file given by the xtcfile kwarg, and each event records those frames as a UINT16 raw array.
| Drp::EpixHRemu::EpixHRemu | ( | Parameters * | para, |
| MemPool * | pool | ||
| ) |
Set a synthetic serial number from detSegment and, if the xtcfile kwarg is set, read from that file one undamaged L1Accept raw frame per active lane, skipping (lanes x detSegment) plus the l1aOffset kwarg L1Accepts first.
Aborts if the file cannot be opened.
|
overridevirtual |
Log a message and return 0.
Reimplemented from Drp::Detector.
|
overridevirtual |
Call XpmDetector::configure() (returning 1 if it fails) and declare the raw names (raw, UINT16 rank 2); returns 0.
Implements Drp::Detector.
|
overridevirtual |
Build the raw array from the stored frames: for each of the elemRows rows and each active lane, copy elemRowSize pixels from that lane's frame numAsics times (each copy from the same source offset); shape is elemRows by (lanes * numAsics * elemRowSize).
l1count is not used.
Implements Drp::Detector.
| const unsigned Drp::EpixHRemu::elemRows = 144 |
Rows per ASIC (144).
| const unsigned Drp::EpixHRemu::elemRowSize = 192 |
Pixels per ASIC row (192).
| const unsigned Drp::EpixHRemu::numAsics = 4 |
Number of ASICs per lane in the emulated frame (4).
| const unsigned Drp::EpixHRemu::numElems = numAsics * elemRows * elemRowSize |
Pixels per stored frame: numAsics * elemRows * elemRowSize.