Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This document attempts to explain the names and functions found in the myana code and give some working examples on how to set up your analysis software. And we try to explain the structure of the data file and how to extract useful information from your data.

...

You can analyze the xtc data with the offline tools, myana and pyana. You also have the option of using the hdf5 data format (hierarchical data format 5), but you will have to wait for the xtc -> hdf5 translation which may take some time. Also, there is no support for hdf5 analysis by the offline group quite yet. hdf5 will be the standard offline LCLS data format, and tools are under development for analyzing these files. More about data formats and where to find the experiment data files, see Analysis Workbook. Data Formats

Anchor
pdsdata
pdsdata

The pdsdata library

See also myana and pdsdata Reference Manual.

Myana uses the pdsdata library to access the datagrams in the xtc files, thus in this context pdsdata defines the data structure. pds = photon data system. In your analysis directory you'll find it in release/pdsdata/. The header files are in the top level directories of each package, and the implementation files are in the src directory of each package. Here's very briefly what the library contains:

Panel

package

description

ipimb

Intensity position, intensity monitor board (IPIMB)
Four diodes positioned around the beam measure scattered X-rays. Based on the output voltage from the four sensors, we can determine pulse intensity and position of the beam. Note, that the lusi package contains methods to get feature-extracted / background subtracted output from the IPIMB.

encoder

SXR SLE Info (Laser Mirror Position Encoder)

pnCCD

for the two CCD detectors used by the CAMP collaboration

acqiris

DAQ interface to the Acqiris digitizer hardware. Waveform data.

camera

General structure to read camera frames, configurations, feature extracted info

evr

EVent Receiver (event code / beam code)

opal1k

Specialized interface for Opal1000 camera. Depends on the camera package

pulnix

for Pulnix TM6740CL monochrome camera used to read out the YAG screens

control

utility for DAQ control, PV (process variable) control and monitoring

xtc

This package defines all the datagrams for the xtc file.

epics

DAQ interface to epics (process variables (PV))

bld

DAQ interface to BeamLine Data, e.g. FeeGasDetEnergy, EBeam, PhaseCavity

princeton

DAQ interface to the Princeton camera

fccd

LBNL/ANL Fast CCD monochrome camera

cspad

CXI CsPad detector

lusi

LCLS Ultrafast Science Instruments Configs for diode, ipm, pim.

app

Xtc and Epics readers

...

  • Most of the functions return 0 if it was a successful function call, any other number means it failed.unmigrated-wiki-markup
  • Values are obtained through the arguments of the function calls. E.g. declare an array in your myana.cc, and {{getXXXValue(&myarray\[0\])}} will fill the array for you.
  • Enums: Several of the functions can be used to extract data from several of the detectors. Which detector is specified by an enum (named constant integers). You are encouraged to use the names instead of the numbers, in case the underlying order changes in a new version of the program.

...

There are several getters for fetching image data from the xtc file. Depending on which camera was in use, one of these should be appropriate:

  • Opal1000 camera:
    getOpal1kValue getFrameValue (an alias getOpal1kValue is provided for getFrameValuebackward compatibility)
  • Pulnix6740CL camera:
    getTm6740Value getFrameValue (an alias getTm6740Value is provided for getFrameValuebackward compatibility)
  • FrameDetector (general):
    Code Block
    int getFrameConfig   (FrameDetector det);
    int getFrameValue(FrameDetector det, int& frameWidth, int& frameHeight, unsigned short*& image );
    
    Gives you the width and height (in pixels) of the image, and a pointer to the start of the pixel array of a Pds::Camera::FrameV1 object. Specify the detector (using an appropriate enum).
    Code Block
    Available frame detectors:
      AMO:
          AmoVmi        - velocity map imaging
          AmoBps1       - beam position screen
          AmoBps2       - beam position screen
      SXR:
          SxrBeamlineOpal1
          SxrBeamlineOpal2
          SxrEndstationOpal1
          SxrEndstationOpal2
          SxrFccd
       XPP:
          XppSb1PimCvd
          XppMonPimCvd
          XppSb3PimCvd
          XppSb4PimCvd
    

...

  • Fast CCD camera:
    Code Block
     int getFccdConfig(FrameDetector det, uint16_t& outputMode, bool& ccdEnable,
                      bool& focusMode, uint32_t& exposureTime,
                      float& dacVoltage1, float& dacVoltage2, float& dacVoltage3, float& dacVoltage4,
                      float& dacVoltage5, float& dacVoltage6, float& dacVoltage7, float& dacVoltage8,
                      float& dacVoltage9, float& dacVoltage10, float& dacVoltage11, float& dacVoltage12,
                      float& dacVoltage13, float& dacVoltage14, float& dacVoltage15, float& dacVoltage16,
                      float& dacVoltage17,
                      uint16_t& waveform0, uint16_t& waveform1, uint16_t& waveform2, uint16_t& waveform3,
                      uint16_t& waveform4, uint16_t& waveform5, uint16_t& waveform6, uint16_t& waveform7,
                      uint16_t& waveform8, uint16_t& waveform9, uint16_t& waveform10, uint16_t& waveform11,
                      uint16_t& waveform12, uint16_t& waveform13, uint16_t& waveform14);
    
    Configures the information from the Fast CCD. Fills arguments with values depending on how the image/waveform data were taken. There is no getFccdValue in main.hh, so I think you need to use getFrameValue for this(question)
    Code Block
    
     int getFrameValue(FrameDetector det, int& frameWidth, int& frameHeight, unsigned short*& image );
    
    Fetches the FCCD image data. Specify the detector (only SxrFccd is available as of 2012).
  • PnCCD camera (used by the CAMP collaboration):
    Code Block
     int getPnCcdValue (int deviceId, unsigned char*& image, int& width, int& height );
    
    This camera has 4 links, each link provides a 512 x 512 x 16 bit image. This function combines the four images to a single 1024 x 1024 x 16 bit image.
    deviceId can be PnCcd0 or PnCcd1, width and height are the number of pixels in each direction.

...

  • Front end enclosure Gas detector
    Code Block
     int getFeeGasDet  (double* shotEnergy);
     
    Wiki Markup
    Gives you the shot energy to the array {{shotEnergy\[4\]}}.
  • Electron beam monitor
    Code Block
     int getEBeam(double& charge, double& energy, double& posx, double& posy,
                  double& angx, double& angy);
     int getEBeam(double& charge, double& energy, double& posx, double& posy,
                  double& angx, double& angy, double& pkcurr);
      
    Gives electron beam values for each of these doubles. The measured charge of the beam (in nC),
    the measured energy of the beam (in MeV), the 2D position of the beam (in mm) away from the origin
    (nominal beam position), and 2D angular position (in mrad) off the assumed direction. and the
    pkcurr = current? in (Amps)

...