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

This class services detectors whose event data is formatted from the AxiStreamBatcherEventBuilder firmware module This class depends upon the existence of a python module "psdaq.configdb.<detType>_config.py", which contains the following functions: <detType>_init (str) - returns a handle (PyObject) for interacting with the device configuration <detType>_connect (handle) - returns a dictionary with "paddr" element for Xpm link ID. More...

Namespaces

namespace  EpicsConfig
 
namespace  EpicsXtcSettings
 
namespace  Gpu
 Namespace of the GPU DRP code (psdaq/drpGpu); only Gpu::Detector is forward-declared here.
 
namespace  JungfrauData
 Frame constants and packed UDP packet layout for Jungfrau data.
 
namespace  Piranha
 Timetool helper classes for Piranha4 (TT, TTSim, TTSimL1, TTSimL2), defined in Piranha4.cc and only forward-declared here.
 

Classes

class  AreaDetector
 XpmDetector that records the payloads of the active PGP lanes as a raw UINT16 image (with a UINT32 value), adds a fixed 3x3 FEX array, and can bin the raw image into a cube with placeholder pedestals and gains. More...
 
struct  Batch
 A run of consecutive events (by event counter) handed to one worker. More...
 
class  BEBDetector
 Detector base for devices whose event data is formatted by the AxiStreamBatcherEventBuilder firmware (per the header comment). More...
 
class  Bld
 Receives a BLD multicast stream on a UDP socket and steps through the events packed in each packet (a header, then entries carrying timestamp and pulse ID offsets); can also simulate packets. More...
 
class  BldApp
 CollectionApp of the BLD DRP process: owns the MemPoolCpu, a BLD detector and the BldDrp. More...
 
class  BldDescriptor
 PVA channel whose structure describes the payload of a BLD source; used by BldPVA. More...
 
class  BldDrp
 DrpBase of the BLD process; runs the BLD Pgp worker thread. More...
 
class  BldFactory
 Creates the Bld receiver and the XTC names of one BLD source, either from a built-in table or from EPICS PVs (BldPVA). More...
 
class  BldPVA
 Looks up the multicast address, port and payload description of a BLD source through EPICS PVs: ID:BLD1_MULT_ADDR and ID:BLD1_MULT_PORT (ca) and ID:BLD_PAYLOAD (pva). More...
 
class  BufferedFileWriter
 Single-threaded file writer that collects events in one memory buffer and writes the buffer when the next event does not fit or the batch is more than 2 s old (by timestamp seconds). More...
 
class  BufferedFileWriterMT
 File writer with a pool of page-aligned buffers and a writer thread: writeEvent() fills buffers and queues full ones, and the thread writes them to the file. More...
 
class  BufferedMultiFileWriterMT
 Writes events round-robin to several BufferedFileWriterMT files. More...
 
struct  ChunkInfo
 Name and ID of the next data file chunk, filled by DrpBase::enable(). More...
 
class  ChunkInfoDef
 VarDef of the chunkinfo record written by DrpBase::chunkInfoData(): file name and chunk ID. More...
 
class  CubeData
 Accumulates the detector raw data (Detector::rawDef()) into nbins bins. More...
 
class  CubeResult
 Decodes the binning fields of a ResultDgram, reading it as a CubeResultDgram when the result type is Cube and as a WindowResultDgram otherwise. More...
 
class  CubeTebReceiver
 TebReceiver that accumulates the detector raw data (Detector::rawDef()) into bins chosen by the Cube trigger results, using nCubeWorkers worker threads; the full cube is recorded at EndRun and single bins are recorded or monitored as the results request (per the file comment). More...
 
class  Detector
 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...
 
class  Digitizer
 Detector for the high-speed digitizer (detType hsd per drp.cc), configured through the Python module psdaq.configdb.hsd_config with the EPICS prefix from the hsd_epics_prefix kwarg. More...
 
struct  DmaBuffer
 Size and driver index of one DMA buffer of an event. More...
 
class  DrpBase
 Common machinery of a DRP process: TEB and MEB contributors, the TEB result receiver, the trigger primitive, Prometheus metrics, and the handling of the connect, configure, run and chunking transitions. More...
 
class  EaDetector
 
class  EaDrp
 
struct  encoder_channel_t
 
struct  encoder_frame_t
 
struct  encoder_header_t
 
class  EpicsArchApp
 
class  EpicsArchDef
 
class  EpicsArchMonitor
 
class  EpicsMonitorPv
 
class  Epix100
 BEBDetector for the epix100. More...
 
class  EpixHR2x2
 BEBDetector for the ePixHR 2x2. More...
 
class  EpixHRemu
 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...
 
class  EpixM320
 BEBDetector for the ePixM320. More...
 
class  EpixQuad
 BEBDetector for the ePix quad. More...
 
class  EpixUHR
 BEBDetector for the ePixUHR. More...
 
class  EpixUHR3x2
 BEBDetector for the 3x2-ASIC ePixUHR. More...
 
class  EventInfo
 Timing information of one event, decoded from the timing data (the code comment calls it the l2si-core EventTimingMessage auxiliary data): pulse ID, fixed-rate and AC-rate bits, beam present and destination, and the sequencer words. More...
 
class  EventSelect
 Event filter on event codes and beam destinations: an event is selected if it matches an include condition and no exclude condition; a value of 0 is never matched. More...
 
class  EvtBatcherHeader
 Packed header at the start of an AxiStream batcher event: two 4-bit fields (version, width code) and an 8-bit sequence count. More...
 
class  EvtBatcherIterator
 Iterates backwards over the subframe tails of a batcher event, from the end of the buffer to the first line after the header. More...
 
class  EvtBatcherSubFrameTail
 Packed tail that follows each subframe: payload size, tdest, first and last tuser bytes and a width code. More...
 
class  Factory
 Creates objects derived from T by detector type name (Parameters::detType). More...
 
class  FileParameters
 Values needed to build data file names for a run: output directory, instrument, run number, experiment name, host name, node ID and chunk ID. More...
 
class  FileWriterBase
 Abstract file writer interface (open, close, writeEvent) with a writing counter that the implementations in FileWriter.cc raise while a write() call is in progress. More...
 
class  HREncoder
 BEBDetector for the high-rate encoder (detType hrencoder in PGPDetectorApp). More...
 
class  Interpolator
 Least-squares polynomial fit (Eigen QR) over the last n (time, value) points, used to estimate encoder values at event times. More...
 
class  Jungfrau
 BEBDetector for one or more Jungfrau modules (one per PGP lane), controlled through sls::Detector and assembled from per-packet UDP data. More...
 
class  JungfrauEmulator
 XpmDetector that emulates Jungfrau panels, one per active PGP lane (detType jungfrauemu in PGPDetectorApp), optionally replaying image data from a file. More...
 
class  JungfrauId
 64-bit Jungfrau ID: a board value in the upper bits and a 16-bit module number in the low 16 bits. More...
 
class  JungfrauIdLookup
 Finds the MAC address of a host: first in /proc/net/arp, then by logging in to the device with telnet and reading the eth0 HWaddr from its ifconfig output. More...
 
class  MemPool
 Abstract set of buffer pools for one DRP: the DMA buffers (allocated by the driver; only counted here), the pebble buffers and the transition buffers. More...
 
class  MemPoolCpu
 MemPool for a PGP card accessed from the CPU: opens the device and maps its DMA buffers. More...
 
class  Opal
 BEBDetector for the Opal camera: records an m_rows x m_columns UINT16 image, with optional timetool processing (OpalTT) and simulation from XTC files. More...
 
class  OpalTTFex
 Timetool feature extraction for Opal camera images: projects the signal (and optional reference and sideband) regions of interest, divides the averaged signal by a rolling reference, filters it and fits the edge. More...
 
struct  Parameters
 Settings of a DRP process, filled mostly from command-line options (drp.cc and the other DRP executables) and from the connect information. More...
 
class  Pebble
 One page-aligned allocation holding the L1Accept buffers followed by the transition buffers; each buffer ends with a sentinel word used to detect overruns. More...
 
class  Pgp
 PgpReader for the PGP-card DRP that forwards broken-event and event-counter-reset notifications to its PGPDrp. More...
 
class  PGPDetectorApp
 CollectionApp of the PGP-card DRP: creates the detector chosen by detType and the PGPDrp, optionally starts the Python DRP worker processes, and handles the collection transitions. More...
 
class  PGPDrp
 DrpBase for PGP-card detectors: reader() groups DMA events into batches that are processed by nworkers worker threads (optionally through a Python DRP over message queues and shared memory), and collector() frees the DMA buffers and passes each event to the TEB contributor. More...
 
struct  PGPEvent
 One event being assembled from up to PGP_MAX_LANES lanes: a DmaBuffer per lane, the mask of lanes received and the pebble buffer index assigned when the event is complete. More...
 
class  PgpReader
 Reads DMA buffers from the PGP driver in bulk and assembles them into PGPEvents (one buffer per lane). More...
 
class  Piranha4
 BEBDetector for the Piranha4 camera: records a one-dimensional UINT16 image of m_pixels values, with optional timetool processing (Piranha::TT) and simulation from XTC files. More...
 
class  Piranha4TTFex
 Timetool feature extraction for Piranha4 line data: extracts the signal region of interest, divides the averaged signal by a rolling reference, filters it and fits the edge. More...
 
class  PvApp
 CollectionApp of the PV DRP process: owns the MemPoolCpu, the PvDetector and the PvDrp. More...
 
class  PvConfigFile
 
class  PvDetector
 XpmDetector that records one or more EPICS PVs (Parameters pvSpecs) through PvMonitor objects, with optional configuration from the Python module psdaq.configdb.pvadetector_config. More...
 
class  PvDrp
 DrpBase of the PV DRP: a reader thread hands L1Accepts to the PV monitors and a collector thread sends the results to the TEB. More...
 
class  PvMonitor
 Monitors one EPICS PV and copies its value into the L1Accept whose timestamp equals the timestamp of the PV update. More...
 
class  PythonConfigScanner
 Scan support for Python-configured detectors: calls the functions {detType}_scan_keys and {detType}_update of the given module (per the header comment) and translates their JSON into XTC. More...
 
class  Roi
 Rectangular region of interest with inclusive corners; OpalTTFex.cc reads it from the configuration entries name.x0, name.y0, name.x1 and name.y1 and uses it for projections. More...
 
struct  RunInfo
 Experiment name and run number of the current run, filled by DrpBase::beginrun(). More...
 
class  RunInfoDef
 VarDef of the runinfo record written by DrpBase::runInfoData(): experiment name and run number. More...
 
class  Si570
 Si570 device accessed as an array of 256 Pds::Mmhw::Reg registers. More...
 
class  SmdDef
 VarDef of the small-data offset record: two UINT64 fields, intOffset and intDgramSize. More...
 
class  SmdWriter
 Small-data writer that forwards open, close and writeEvent to an internal BufferedFileWriter. More...
 
class  SmdWriterBase
 FileWriterBase for small-data files, with a scratch buffer of transition size and a NamesLookup. More...
 
class  TebReceiver
 TebReceiverBase that writes recorded events with a BufferedFileWriterMT and a small-data SmdWriter, and sends events to the MEBs through the MEB contributor. More...
 
class  TebReceiverBase
 Base of the DRP trigger result receivers. More...
 
class  TimeTool
 BEBDetector for timetool data (detType tt in PGPDetectorApp). More...
 
class  TimingBEB
 BEBDetector whose L1Accept data is TimingDef data written by TimingDef::createDataETM() from the first subframe (header) and the last subframe (ETM record) of each event. More...
 
class  TimingData
 Packed (1-byte aligned) 153-byte timing record whose fields follow the order of the TimingDef name list. More...
 
class  TimingDef
 XtcData::VarDef with the names and types of the 16 timing fields, in the order of the index enum, plus static helpers that write timing data into an Xtc. More...
 
class  TimingSystem
 XpmDetector for timing-system data. More...
 
class  TprApp
 CollectionApp (role tpr) that, after connect, programs the TPR channel and outputs given in its parameters to trigger on the partition readout group, and keeps a worker thread until disconnect. More...
 
class  UdpApp
 CollectionApp of the UDP encoder DRP process: owns the MemPoolCpu, the UdpEncoder and the UdpDrp and handles the collection transitions. More...
 
class  UdpDrp
 DrpBase for the UDP encoder: a worker thread matches PGP timing events with encoder frames (optionally interpolating) and sends the results to the TEB. More...
 
class  UdpEncoder
 XpmDetector for a UDP encoder: owns the UdpReceiver and records each frame as raw and, when interpolating, interpolated encoder data. More...
 
class  UdpReceiver
 Receives encoder frames on a UDP socket in its own thread, stores each one as a Dgram in a queue, and reports missing and out-of-order frames to the collection server. More...
 
class  Wave8
 BEBDetector for the Wave8 (detType wave8 in PGPDetectorApp), recording raw and FEX data and supporting cube binning. More...
 
class  XpmDetector
 Detector base for devices read through the PGP card with XPM timing. More...
 

Typedefs

typedef std::map< std::string, std::string > ArpCache
 Map from IP address string to MAC address string, filled by JungfrauIdLookup from /proc/net/arp or from the device.
 
typedef ArpCache::const_iterator ArpCacheIter
 Const iterator over an ArpCache.
 
typedef std::vector< std::shared_ptr< EpicsMonitorPv > > TEpicsMonitorPvList
 

Enumerations

enum  { MaxSegsPerNode = 10 }
 Segment limit used to space the names indices below. More...
 
enum  { ConfigNamesIndex = NamesIndex::BASE , EventNamesIndex = unsigned(ConfigNamesIndex) + unsigned(MaxSegsPerNode) , UpdateNamesIndex = unsigned(EventNamesIndex) + unsigned(MaxSegsPerNode) }
 NamesId index bases of BEB detectors, one block of MaxSegsPerNode indices each (the code comment says index for xtc NamesId). More...
 
enum  NamesIndex {
  BASE = 0 , CHUNKINFO = 252 , STEPINFO = 253 , OFFSETINFO = 254 ,
  RUNINFO = 255
}
 Fixed NamesId index values used by the DRP. More...
 

Functions

nlohmann::json createPulseIdMsg (uint64_t pulseId)
 Return a JSON message whose key is pulseId and whose body holds pulseId.
 
static nlohmann::json xpmInfo (unsigned paddr)
 Return JSON with xpm_id set to bits 23-16 of paddr and xpm_port set to bits 7-0.
 

Variables

static const char *const RED_ON = "\033[0;31m"
 ANSI escape sequence that turns terminal text red; used in a few error messages.
 
static const char *const RED_OFF = "\033[0m"
 ANSI escape sequence that resets terminal text attributes.
 

Detailed Description

This class services detectors whose event data is formatted from the AxiStreamBatcherEventBuilder firmware module This class depends upon the existence of a python module "psdaq.configdb.<detType>_config.py", which contains the following functions: <detType>_init (str) - returns a handle (PyObject) for interacting with the device configuration <detType>_connect (handle) - returns a dictionary with "paddr" element for Xpm link ID.

Namespace of the psdaq data reduction pipeline (drp) code.

Other entries allowed. <detType>_config (handle,...) - returns a json string containing configuration information to be stored in xtc. <detType>_unconfig(handle) - return ignored

Typedef Documentation

◆ ArpCache

typedef std::map<std::string, std::string> Drp::ArpCache

Map from IP address string to MAC address string, filled by JungfrauIdLookup from /proc/net/arp or from the device.

◆ ArpCacheIter

typedef ArpCache::const_iterator Drp::ArpCacheIter

Const iterator over an ArpCache.

◆ TEpicsMonitorPvList

typedef std::vector< std::shared_ptr<EpicsMonitorPv> > Drp::TEpicsMonitorPvList

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Segment limit used to space the names indices below.

Enumerator
MaxSegsPerNode 

Maximum number of detector segments per node (10).

◆ anonymous enum

anonymous enum

NamesId index bases of BEB detectors, one block of MaxSegsPerNode indices each (the code comment says index for xtc NamesId).

Enumerator
ConfigNamesIndex 

Configuration names, starting at NamesIndex::BASE (0); BEBDetector::configure() uses ConfigNamesIndex + segment.

EventNamesIndex 

Event names, starting at 10.

UpdateNamesIndex 

Scan update names, starting at 20; used by configureScan() and stepScan().

◆ NamesIndex

Fixed NamesId index values used by the DRP.

Enumerator
BASE 

Value 0; BldDetector.cc uses it as its base names index.

CHUNKINFO 

Value 252; NamesId index of the chunk information written by DrpBase.cc.

STEPINFO 

Value 253; named for step information (no use found in psdaq/drp).

OFFSETINFO 

Value 254; NamesId index of the offset information written by TebReceiver.cc.

RUNINFO 

Value 255; NamesId index of the run information written by DrpBase.cc.

Function Documentation

◆ createPulseIdMsg()

nlohmann::json Drp::createPulseIdMsg ( uint64_t  pulseId)

Return a JSON message whose key is pulseId and whose body holds pulseId.

◆ xpmInfo()

static nlohmann::json Drp::xpmInfo ( unsigned  paddr)
inlinestatic

Return JSON with xpm_id set to bits 23-16 of paddr and xpm_port set to bits 7-0.

Variable Documentation

◆ RED_OFF

const char* const Drp::RED_OFF = "\033[0m"
static

ANSI escape sequence that resets terminal text attributes.

◆ RED_ON

const char* const Drp::RED_ON = "\033[0;31m"
static

ANSI escape sequence that turns terminal text red; used in a few error messages.