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

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...

#include <PGPDetectorApp.hh>

Inherits CollectionApp.

Public Member Functions

 PGPDetectorApp (Parameters &para)
 Register with the collection as a drp, open the PGP pool, initialize Python and release the GIL.
 
virtual ~PGPDetectorApp ()
 Call handleReset(), clean up the Python DRP message queues and shared memory if used, free the ID arrays and the detector, and finalize Python.
 
void initialize ()
 Create the detector registered for detType (fakecam, cspad, hsd, epixquad, epixquad1kfps, epixhr2x2, epixhremu, epixm320, epixUHR, epix100, jungfrau, jungfrauemu, opal, tt, tb, ts, wave8, hrencoder, piranha4, epixuhr3x2) and the PGPDrp, and set up the Python DRP when the drp kwarg is python.
 
nlohmann::json connectionInfo (const nlohmann::json &msg) override
 Return JSON connect_info with the NIC IP address (from the ep_domain kwarg, or the forceEnet kwarg), merged with the detector connection info and DrpBase::connectionInfo().
 
void connectionShutdown () override
 Call the detector connectionShutdown() and DrpBase::shutdown().
 
void handleReset (const nlohmann::json &msg) override
 Unsubscribe from the partition, unconfigure, disconnect and shut down the connection; with the Python DRP, also drain its message queues and (unless msg is empty, as on exit) reset it.
 
- Public Member Functions inherited from CollectionApp
 CollectionApp (const std::string &managerHostname, int platform, const std::string &level, const std::string &alias, const std::string &device=std::string())
 Check the resource limits (throwing a C string if they are inadequate), connect the PUSH and SUB sockets to managerHostname for platform, bind inproc://drp, and register handlers for rollcall, alloc, dealloc, connect, disconnect, reset and the phase-1 transitions (configure, unconfigure, beginrun, endrun, beginstep, endstep, enable, disable).
 
virtual ~CollectionApp ()
 Does nothing; empty body.
 
void run ()
 Message loop: dispatch collection messages from the SUB socket to their handlers by header key, and forward pulseId, fileReport, error and chunkRequest messages from inproc://drp to the manager.
 

Additional Inherited Members

- Public Types inherited from CollectionApp
enum  { zmq_base_port = 29980 }
 Base TCP port of the collection sockets. More...
 
- Protected Member Functions inherited from CollectionApp
void handleRollcall (const nlohmann::json &msg)
 
void handleAlloc (const nlohmann::json &msg)
 
void reply (const nlohmann::json &msg)
 
size_t getId () const
 
const std::string & getLevel () const
 
const std::string & getAlias () const
 
ZmqContext & context ()
 
void subscribePartition ()
 
void unsubscribePartition ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ PGPDetectorApp()

Drp::PGPDetectorApp::PGPDetectorApp ( Parameters &  para)

Register with the collection as a drp, open the PGP pool, initialize Python and release the GIL.

◆ ~PGPDetectorApp()

virtual Drp::PGPDetectorApp::~PGPDetectorApp ( )
virtual

Call handleReset(), clean up the Python DRP message queues and shared memory if used, free the ID arrays and the detector, and finalize Python.

Member Function Documentation

◆ connectionInfo()

nlohmann::json Drp::PGPDetectorApp::connectionInfo ( const nlohmann::json &  msg)
overridevirtual

Return JSON connect_info with the NIC IP address (from the ep_domain kwarg, or the forceEnet kwarg), merged with the detector connection info and DrpBase::connectionInfo().

Implements CollectionApp.

◆ connectionShutdown()

void Drp::PGPDetectorApp::connectionShutdown ( )
overridevirtual

Call the detector connectionShutdown() and DrpBase::shutdown().

Reimplemented from CollectionApp.

◆ handleReset()

void Drp::PGPDetectorApp::handleReset ( const nlohmann::json &  msg)
overridevirtual

Unsubscribe from the partition, unconfigure, disconnect and shut down the connection; with the Python DRP, also drain its message queues and (unless msg is empty, as on exit) reset it.

Implements CollectionApp.

◆ initialize()

void Drp::PGPDetectorApp::initialize ( )

Create the detector registered for detType (fakecam, cspad, hsd, epixquad, epixquad1kfps, epixhr2x2, epixhremu, epixm320, epixUHR, epix100, jungfrau, jungfrauemu, opal, tt, tb, ts, wave8, hrencoder, piranha4, epixuhr3x2) and the PGPDrp, and set up the Python DRP when the drp kwarg is python.

Throws if the detector type is unknown or the Python DRP setup fails.


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