You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 77 Next »

Draft, in work.

Topics

Go back to the Top of this tree.

Generating Xtc

For tutorial purposes, the following streamlined example shows XXX. For an example involving more detectors, formats and algorithms, see xtcdata/xtcdata/app/xtcwriter.cc.

A Notional DAQ Harness

Let's motivate the example. Assume we're developing a an Xtc writer class to output CSPAD data. This class will get plugged in to a (notional) DAQ framework.

# Assume some totally made-up data acquisition callback framework named DAQFramework
# Developers of the psdaq package are welcome to come in and change this toy example
# to match the real DAQ API.

CSPADXtcWriter padwriter()

DAQFramework.registerHandler("configure", padwriter.setup)
DAQFramework.registerHandler("runstart", padwriter.setup)
DAQFramework.registerHandler("readout", padwriter.writeImage)
DAQFramework.registerHandler("runend", padwriter.writeFile)

"setup" Method: Set Up The Names Structure

    Register the algorithms and "shape" of the data associated with detector elements to tell the processing pipeline how to process the data.

    1. First some plumbing...
      1. Create an XtcData:Dgram as the root container.
    2. Next code sample description.

     

    At some initialization step, for example in response to a DAQ configure signal:

    • Subclass XtcData::VarDef to build a data structure specific to the detector in question.

     

     

    "writeImage" Method: Add Readout Data

     

     

    Parsing Whole Xtc Files

    xtcreader.cc and XtcIterator.hh

     

    Use of Xtc Small Data Files

    this might be duplicate of what's on top page

    Notes for Real-World Code

    Xtc Writers in the Wild

    • (You'll likely need to sub-class from XYZ in order to ABC)

    Xtc Readers in the Wild

    • (You'll likely need to sub-class from XYZ in order to ABC)

    Full "Hello Xtc" Code Listing, CSPADXtcWriter Example

    CSPADXtcWriter::CSPADXtcWriter()
    {
    
    }
    
    void CSPADXtcWriter::setup()
    {
    
    }
    
    void CSPADXtcWriter::writeImage()
    {
    
    
    }
    
    void CSPADXtcWriter::writeFile()
    {
    
    
    }

     

     

     

    • No labels