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

BEBDetector for the ePix quad. More...

#include <EpixQuad.hh>

Inherits Drp::BEBDetector.

Public Member Functions

 EpixQuad (Parameters *para, MemPool *pool)
 Set virtual channel 0, construct the BEBDetector base and initialize it with the detector name.
 
 ~EpixQuad ()
 Does nothing; empty body.
 
unsigned enable (XtcData::Xtc &xtc, const void *bufEnd, const nlohmann::json &info) override
 Switch the monitoring stream off (calls {detType}_enable in Python) and return 0.
 
unsigned disable (XtcData::Xtc &xtc, const void *bufEnd, const nlohmann::json &info) override
 Switch the monitoring stream on (calls {detType}_disable in Python) and return 0.
 
void slowupdate (XtcData::Xtc &, const void *bufEnd) override
 Call Detector::slowupdate() (a variant that copies cached environment data is compiled only with SLOW_UPDATE_ENV).
 
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.
 
- 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.
 
Pds::TimingHeader * getTimingHeader (uint32_t index) const override
 Return the timing header of DMA buffer index: the data after the first batcher header, or after the second one when m_debatch is set.
 
- 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.
 

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 [8]
 
- 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 ePix quad.

L1Accept data comes from the image in subframe 2 of 4 expected subframes; the monitoring stream is switched with the Python functions {detType}_enable and {detType}_disable.

Constructor & Destructor Documentation

◆ EpixQuad()

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

Set virtual channel 0, construct the BEBDetector base and initialize it with the detector name.

◆ ~EpixQuad()

Drp::EpixQuad::~EpixQuad ( )

Does nothing; empty body.

Member Function Documentation

◆ _configure()

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

Implements Drp::BEBDetector.

◆ _connectionInfo()

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

Reimplemented from Drp::BEBDetector.

◆ _event()

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

Reimplemented from Drp::BEBDetector.

◆ disable()

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

Switch the monitoring stream on (calls {detType}_disable in Python) and return 0.

Reimplemented from Drp::Detector.

◆ enable()

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

Switch the monitoring stream off (calls {detType}_enable in Python) and return 0.

Reimplemented from Drp::Detector.

◆ scanEnabled()

bool Drp::EpixQuad::scanEnabled ( )
overridevirtual

Return false.

Reimplemented from Drp::Detector.

◆ shutdown()

void Drp::EpixQuad::shutdown ( )
overridevirtual

Does nothing; empty body.

Reimplemented from Drp::BEBDetector.

◆ slowupdate()

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

Call Detector::slowupdate() (a variant that copies cached environment data is compiled only with SLOW_UPDATE_ENV).

Reimplemented from Drp::Detector.

◆ write_image()

void Drp::EpixQuad::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

◆ m_env_empty

bool Drp::EpixQuad::m_env_empty
protected

◆ m_env_sem

Pds::Semaphore Drp::EpixQuad::m_env_sem
protected

◆ m_evtNamesId

XtcData::NamesId Drp::EpixQuad::m_evtNamesId[8]
protected

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