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

GPU DRP detector for detType epixuhremu (registered in PGPDetectorApp). More...

#include <EpixUHRemu.hh>

Inherits Drp::Gpu::Detector.

Public Member Functions

 EpixUHRemu (Parameters &para, MemPoolGpu &pool)
 Create the wrapped XpmDetector-based detector, the calibration buffers for NPixels pixels and device arrays of NRanges times NPixels pedestals and gains, which beginrun() fills.
 
virtual ~EpixUHRemu () override
 Free the pedestal and gain arrays and destroy the calibration buffers.
 
unsigned configure (const std::string &config_alias, XtcData::Xtc &, const void *bufEnd) override
 Call configure on the wrapped XpmDetector (logging an error if it fails), then add names for one UINT8 rank-1 array named raw under EventNamesIndex.
 
unsigned beginrun (XtcData::Xtc &xtc, const void *bufEnd, const nlohmann::json &runInfo) override
 Call beginrun on the wrapped detector (logging an error if it fails), then copy pedestals of 0 and gains of 1 for every pixel of each of the NRanges ranges to the device arrays.
 
void event (XtcData::Dgram &dgram, const void *bufEnd, PGPEvent *event, uint64_t count) override
 Increase the damage of dgram when the lane 0 DMA size is below the TimingHeader plus NPixels 16-bit values (MissingData) or equals the DMA buffer size (Truncated); no data is added.
 
unsigned rangeOffset () const override
 Return RangeOffset (14).
 
unsigned rangeBits () const override
 Return RangeBits (2).
 
float const * pedestals_d () const override
 Return the device pedestal array (NRanges sets of NPixels values); beginrun() sets every pedestal to 0.
 
float const * gains_d () const override
 Return the device gain array, laid out like pedestals_d(); beginrun() sets every gain to 1.
 
- Public Member Functions inherited from Drp::Gpu::Detector
 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 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 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, 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.
 

Static Public Attributes

static const unsigned NumAsics { 6 }
 Number of ASICs (6).
 
static const unsigned NumRows { 192 }
 Rows per ASIC (192).
 
static const unsigned NumCols { 168 }
 Columns per ASIC (168).
 
static const unsigned NPixels { NumAsics*NumRows*NumCols }
 Total number of pixels, NumAsics * NumRows * NumCols (193536).
 
static const unsigned RangeOffset { 14 }
 Bit position of the gain range field in a raw 16-bit value (14); the bits below it hold the data value.
 
static const unsigned RangeBits { 2 }
 Width of the gain range field (2 bits).
 
static const unsigned NRanges { 4 }
 Number of gain ranges with their own pedestal and gain arrays (4).
 

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.
 
- Protected Member Functions inherited from Drp::Gpu::Detector
template<typename T >
void _initialize (Parameters &para, MemPoolGpu &pool)
 
- Protected Attributes inherited from Drp::Gpu::Detector
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
 

Detailed Description

GPU DRP detector for detType epixuhremu (registered in PGPDetectorApp).

It wraps an XpmDetector-based detector, allocates the calibration buffers and per-range pedestal and gain arrays, and names the raw data (array raw) in the Configure xtc.

Constructor & Destructor Documentation

◆ EpixUHRemu()

Drp::Gpu::EpixUHRemu::EpixUHRemu ( Parameters &  para,
MemPoolGpu &  pool 
)

Create the wrapped XpmDetector-based detector, the calibration buffers for NPixels pixels and device arrays of NRanges times NPixels pedestals and gains, which beginrun() fills.

Asserts that NPixels 16-bit values fit in a DMA buffer after the TimingHeader.

◆ ~EpixUHRemu()

virtual Drp::Gpu::EpixUHRemu::~EpixUHRemu ( )
overridevirtual

Free the pedestal and gain arrays and destroy the calibration buffers.

Member Function Documentation

◆ beginrun()

unsigned Drp::Gpu::EpixUHRemu::beginrun ( XtcData::Xtc &  xtc,
const void *  bufEnd,
const nlohmann::json &  runInfo 
)
overridevirtual

Call beginrun on the wrapped detector (logging an error if it fails), then copy pedestals of 0 and gains of 1 for every pixel of each of the NRanges ranges to the device arrays.

Returns the wrapped detector's result.

Reimplemented from Drp::Gpu::Detector.

◆ configure()

unsigned Drp::Gpu::EpixUHRemu::configure ( const std::string &  config_alias,
XtcData::Xtc &  ,
const void *  bufEnd 
)
overridevirtual

Call configure on the wrapped XpmDetector (logging an error if it fails), then add names for one UINT8 rank-1 array named raw under EventNamesIndex.

Always returns 0.

Reimplemented from Drp::Gpu::Detector.

◆ event()

void Drp::Gpu::EpixUHRemu::event ( XtcData::Dgram &  dgram,
const void *  bufEnd,
PGPEvent *  event,
uint64_t  count 
)
overridevirtual

Increase the damage of dgram when the lane 0 DMA size is below the TimingHeader plus NPixels 16-bit values (MissingData) or equals the DMA buffer size (Truncated); no data is added.

Implements Drp::Detector.

◆ gains_d()

float const * Drp::Gpu::EpixUHRemu::gains_d ( ) const
inlineoverridevirtual

Return the device gain array, laid out like pedestals_d(); beginrun() sets every gain to 1.

Implements Drp::Gpu::Detector.

◆ pedestals_d()

float const * Drp::Gpu::EpixUHRemu::pedestals_d ( ) const
inlineoverridevirtual

Return the device pedestal array (NRanges sets of NPixels values); beginrun() sets every pedestal to 0.

Implements Drp::Gpu::Detector.

◆ rangeBits()

unsigned Drp::Gpu::EpixUHRemu::rangeBits ( ) const
inlineoverridevirtual

Return RangeBits (2).

Implements Drp::Gpu::Detector.

◆ rangeOffset()

unsigned Drp::Gpu::EpixUHRemu::rangeOffset ( ) const
inlineoverridevirtual

Return RangeOffset (14).

Implements Drp::Gpu::Detector.

Member Data Documentation

◆ NPixels

const unsigned Drp::Gpu::EpixUHRemu::NPixels { NumAsics*NumRows*NumCols }
static

Total number of pixels, NumAsics * NumRows * NumCols (193536).

◆ NRanges

const unsigned Drp::Gpu::EpixUHRemu::NRanges { 4 }
static

Number of gain ranges with their own pedestal and gain arrays (4).

◆ NumAsics

const unsigned Drp::Gpu::EpixUHRemu::NumAsics { 6 }
static

Number of ASICs (6).

◆ NumCols

const unsigned Drp::Gpu::EpixUHRemu::NumCols { 168 }
static

Columns per ASIC (168).

◆ NumRows

const unsigned Drp::Gpu::EpixUHRemu::NumRows { 192 }
static

Rows per ASIC (192).

◆ RangeBits

const unsigned Drp::Gpu::EpixUHRemu::RangeBits { 2 }
static

Width of the gain range field (2 bits).

◆ RangeOffset

const unsigned Drp::Gpu::EpixUHRemu::RangeOffset { 14 }
static

Bit position of the gain range field in a raw 16-bit value (14); the bits below it hold the data value.


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