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

One simulated event: an ArrayIO<float> that loads a float array from a text file; nda() returns it. More...

#include <DataSourceSimulator.hh>

Inherits psalg::ArrayIO< float >.

Public Member Functions

 EventSimulator (const std::string &fname="")
 Load fname with ArrayIO<float>; if the file cannot be opened the status is UNREADABLE and the array stays empty.
 
virtual ~EventSimulator ()
 Destructor; does nothing.
 
NDArray< float > & nda ()
 Return the loaded array (ArrayIO::ndarray()).
 
- Public Member Functions inherited from psalg::ArrayIO< float >
 ArrayIO (const std::string &fname, void *buf=0)
 Read fname right away.
 
 ~ArrayIO ()
 Destructor; only logs a trace message.
 
const STATUS status () const
 Return the load status.
 
const std::string str_status () const
 Return the status name ("LOADED", "DEFAULT", "UNREADABLE" or "UNDEFINED").
 
const std::string & dtype_name () const
 Return the DATATYPE value read from the file (empty if there was none).
 
NDArray< float > & ndarray ()
 Return the loaded array.
 

Additional Inherited Members

- Public Types inherited from psalg::ArrayIO< float >
enum  STATUS
 Load status reported by status(). More...
 
typedef psalg::types::shape_t shape_t
 Alias for psalg::types::shape_t (uint32_t).
 
typedef psalg::types::size_t size_t
 Alias for psalg::types::size_t (uint32_t).
 
- Public Attributes inherited from psalg::ArrayIO< float >
std::string STRAUS [4]
 Names of the STATUS values, used by str_status().
 

Detailed Description

One simulated event: an ArrayIO<float> that loads a float array from a text file; nda() returns it.

Constructor & Destructor Documentation

◆ EventSimulator()

detector::EventSimulator::EventSimulator ( const std::string &  fname = "")
inline

Load fname with ArrayIO<float>; if the file cannot be opened the status is UNREADABLE and the array stays empty.

◆ ~EventSimulator()

virtual detector::EventSimulator::~EventSimulator ( )
inlinevirtual

Destructor; does nothing.

Member Function Documentation

◆ nda()

NDArray< float > & detector::EventSimulator::nda ( )
inline

Return the loaded array (ArrayIO::ndarray()).


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