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

BEBDetector for the ePixM320. More...

#include <EpixM320.hh>

Inherits Drp::BEBDetector.

Public Member Functions

 EpixM320 (Parameters *para, MemPool *pool)
 Set virtual channel 0, initialize the BEBDetector with the detector name, enable descrambling and install a one-shot handler for SIGINT, SIGABRT, SIGKILL and SIGSEGV that calls monStreamEnable() and then re-raises the signal.
 
 ~EpixM320 ()
 Does nothing; empty body.
 
unsigned enable (XtcData::Xtc &xtc, const void *bufEnd, const nlohmann::json &info) override
 Call monStreamDisable() and return 0.
 
unsigned disable (XtcData::Xtc &xtc, const void *bufEnd, const nlohmann::json &info) override
 Call monStreamEnable() and return 0.
 
void slowupdate (XtcData::Xtc &, const void *bufEnd) override
 Call Detector::slowupdate().
 
bool scanEnabled () override
 Return false.
 
void shutdown () override
 Does nothing; empty body.
 
void write_image (XtcData::Xtc &, const void *bufEnd, std::vector< XtcData::Array< uint8_t > > &, XtcData::NamesId &)
 Declared here; no definition was found in psdaq/drp.
 
Pds::TimingHeader * getTimingHeader (uint32_t index) const override
 Return the timing header of DMA buffer index, found after the first event-batcher header.
 
void monStreamEnable ()
 Call the Python function {detType}_disable of the configuration module with the device root object.
 
void monStreamDisable ()
 Call the Python function {detType}_enable of the configuration module with the device root object.
 
- Public Member Functions inherited from Drp::BEBDetector
 BEBDetector (Parameters *para, MemPool *pool)
 Construct the Detector base with virtual channel 1 and no Python module yet; subclasses must call _init() (or their own variant).
 
virtual ~BEBDetector ()
 Delete the config scanner and release the Python module.
 
nlohmann::json connectionInfo (const nlohmann::json &msg) override
 Call {detType}_connectionInfo in Python with the device handle and msg, store its paddr entry (aborting if it is 0, 0xffffffff or has a low byte above 15), pass the result to _connectionInfo() and return xpmInfo(paddr).
 
void connectionShutdown () override
 Call {detType}_connectionShutdown in Python if the module defines it.
 
void connect (const nlohmann::json &, const std::string &collectionId) override
 Keep the connect message and the readout group of this DRP (det_info.readout of entry collectionId).
 
unsigned configure (const std::string &config_alias, XtcData::Xtc &xtc, const void *bufEnd) override
 Call {detType}_config in Python (with segment and serial numbers in multi-segment mode), translate the returned JSON, or list of JSON per segment, into configuration XTC, let the subclass _configure() add its names, append the configuration to xtc and return the _configure() result.
 
void event (XtcData::Dgram &dgram, const void *bufEnd, PGPEvent *event, uint64_t l1count) override
 Split the DMA buffer of each lane in event->mask into batcher subframes (one more batcher level is unwrapped when m_debatch is set), keep all subframes of the first lane that has more than 2 and subframe 2 of each later one, and pass them to _event().
 
unsigned configureScan (const nlohmann::json &stepInfo, XtcData::Xtc &xtc, const void *bufEnd) override
 Pass stepInfo to PythonConfigScanner::configure() with the update names ID and return its result.
 
unsigned stepScan (const nlohmann::json &stepInfo, XtcData::Xtc &xtc, const void *bufEnd) override
 Pass stepInfo to PythonConfigScanner::step() with the update names ID and return its result.
 
- 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 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 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.
 
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 { 4 }
 Number of ASICs (4); first dimension of the event arrays.
 
static const unsigned NumBanks { 24 }
 Number of banks (24) interleaved in the raw ASIC data; used by the descrambler.
 
static const unsigned BankRows { 4 }
 Bank rows (4) of a descrambled ASIC frame.
 
static const unsigned BankCols { 6 }
 Bank columns (6) of a descrambled ASIC frame.
 
static const unsigned ElemRows { 192 }
 Rows per ASIC frame (192).
 
static const unsigned ElemRowSize { 384 }
 Pixels per row of an ASIC frame (384).
 

Protected Member Functions

void _connectionInfo (PyObject *) override
 
unsigned _configure (XtcData::Xtc &, const void *bufEnd, XtcData::ConfigIter &) override
 
void _event (XtcData::Xtc &, const void *bufEnd, uint64_t l1count, std::vector< XtcData::Array< uint8_t > > &) override
 
- Protected Member Functions inherited from Drp::BEBDetector
void _init (const char *)
 
void _init_feb ()
 
std::vector< XtcData::Array< uint8_t > > _subframes (void *buffer, unsigned length)
 
std::vector< XtcData::Array< uint8_t > > _subframes (void *buffer, unsigned length, size_t nsubhint)
 

Protected Attributes

Pds::Semaphore m_env_sem
 
bool m_env_empty
 
XtcData::NamesId m_evtNamesId [2]
 
unsigned m_asics
 
bool m_descramble
 
bool m_logOnce
 
- Protected Attributes inherited from Drp::BEBDetector
std::string m_connect_json
 
unsigned m_readoutGroup
 
PyObject * m_module
 
PyObject * m_root
 
unsigned m_paddr
 
PythonConfigScanner * m_configScanner
 
bool m_debatch
 
bool m_multiSegment = false
 
std::string m_segNoStr {""}
 
- Protected Attributes inherited from Drp::Detector
Parameters * m_para
 
MemPool * m_pool
 
XtcData::NamesLookup m_namesLookup
 
std::vector< char > m_xtcbuf
 

Additional Inherited Members

- Static Public Member Functions inherited from Drp::BEBDetector
static PyObject * _check (PyObject *)
 Return obj; if it is null, print the Python error, log it and abort.
 
- 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.
 
- Static Protected Member Functions inherited from Drp::BEBDetector
static std::string _string_from_PyDict (PyObject *, const char *key)
 

Detailed Description

BEBDetector for the ePixM320.

L1Accept data holds, for each of NumAsics ASICs, a header, a descrambled ElemRows x ElemRowSize UINT16 frame and a trailer; disabled or bad ASICs are zero-filled.

Constructor & Destructor Documentation

◆ EpixM320()

Drp::EpixM320::EpixM320 ( Parameters *  para,
MemPool *  pool 
)

Set virtual channel 0, initialize the BEBDetector with the detector name, enable descrambling and install a one-shot handler for SIGINT, SIGABRT, SIGKILL and SIGSEGV that calls monStreamEnable() and then re-raises the signal.

◆ ~EpixM320()

Drp::EpixM320::~EpixM320 ( )

Does nothing; empty body.

Member Function Documentation

◆ _configure()

unsigned Drp::EpixM320::_configure ( XtcData::Xtc &  ,
const void *  bufEnd,
XtcData::ConfigIter &   
)
overrideprotectedvirtual

Implements Drp::BEBDetector.

◆ _connectionInfo()

void Drp::EpixM320::_connectionInfo ( PyObject *  )
overrideprotectedvirtual

Reimplemented from Drp::BEBDetector.

◆ _event()

void Drp::EpixM320::_event ( XtcData::Xtc &  ,
const void *  bufEnd,
uint64_t  l1count,
std::vector< XtcData::Array< uint8_t > > &   
)
overrideprotectedvirtual

Reimplemented from Drp::BEBDetector.

◆ disable()

unsigned Drp::EpixM320::disable ( XtcData::Xtc &  xtc,
const void *  bufEnd,
const nlohmann::json &  info 
)
overridevirtual

Call monStreamEnable() and return 0.

Reimplemented from Drp::Detector.

◆ enable()

unsigned Drp::EpixM320::enable ( XtcData::Xtc &  xtc,
const void *  bufEnd,
const nlohmann::json &  info 
)
overridevirtual

Call monStreamDisable() and return 0.

Reimplemented from Drp::Detector.

◆ getTimingHeader()

Pds::TimingHeader * Drp::EpixM320::getTimingHeader ( uint32_t  index) const
overridevirtual

Return the timing header of DMA buffer index, found after the first event-batcher header.

With descrambling enabled and words 2 and 3 zero, the word pairs at offsets 4, 8, 12 and 16 are first moved in place to offsets 2, 4, 6 and 8.

Reimplemented from Drp::BEBDetector.

◆ monStreamDisable()

void Drp::EpixM320::monStreamDisable ( )

Call the Python function {detType}_enable of the configuration module with the device root object.

◆ monStreamEnable()

void Drp::EpixM320::monStreamEnable ( )

Call the Python function {detType}_disable of the configuration module with the device root object.

◆ scanEnabled()

bool Drp::EpixM320::scanEnabled ( )
overridevirtual

Return false.

Reimplemented from Drp::Detector.

◆ shutdown()

void Drp::EpixM320::shutdown ( )
overridevirtual

Does nothing; empty body.

Reimplemented from Drp::BEBDetector.

◆ slowupdate()

void Drp::EpixM320::slowupdate ( XtcData::Xtc &  ,
const void *  bufEnd 
)
overridevirtual

Call Detector::slowupdate().

Reimplemented from Drp::Detector.

◆ write_image()

void Drp::EpixM320::write_image ( XtcData::Xtc &  ,
const void *  bufEnd,
std::vector< XtcData::Array< uint8_t > > &  ,
XtcData::NamesId &   
)

Declared here; no definition was found in psdaq/drp.

Member Data Documentation

◆ BankCols

const unsigned Drp::EpixM320::BankCols { 6 }
static

Bank columns (6) of a descrambled ASIC frame.

◆ BankRows

const unsigned Drp::EpixM320::BankRows { 4 }
static

Bank rows (4) of a descrambled ASIC frame.

◆ ElemRows

const unsigned Drp::EpixM320::ElemRows { 192 }
static

Rows per ASIC frame (192).

◆ ElemRowSize

const unsigned Drp::EpixM320::ElemRowSize { 384 }
static

Pixels per row of an ASIC frame (384).

◆ m_asics

unsigned Drp::EpixM320::m_asics
protected

◆ m_descramble

bool Drp::EpixM320::m_descramble
protected

◆ m_env_empty

bool Drp::EpixM320::m_env_empty
protected

◆ m_env_sem

Pds::Semaphore Drp::EpixM320::m_env_sem
protected

◆ m_evtNamesId

XtcData::NamesId Drp::EpixM320::m_evtNamesId[2]
protected

◆ m_logOnce

bool Drp::EpixM320::m_logOnce
protected

◆ NumAsics

const unsigned Drp::EpixM320::NumAsics { 4 }
static

Number of ASICs (4); first dimension of the event arrays.

◆ NumBanks

const unsigned Drp::EpixM320::NumBanks { 24 }
static

Number of banks (24) interleaved in the raw ASIC data; used by the descrambler.


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