Page History
Introduction
LCLS Data Analysis frameworks are under development, and . The currently three supported approaches are being used and/or developedfor analysis of LCLS data are:
- myana ... simple — A C++ code program to read analyze an xtc file. Provided (and used) by the DAQ group. Will likely be expanded in support of new hardware etc., and more examples might be provided, but otherwise no big changes anticipated.
- pyana ... python-based analysis framework. Anticipate more tools and examples to appear for this one.
- How to set up your own myana executable is explained in the DAQ section "A Simple Online Analysis Example" .
- pyana — A python-based analysis framework. Pyana User Manual
- PSAna — A PSAna ... C++-based analysis framework, still in the design phase.
...
- Not usable yet.
This document attempts to explain some of the names and functions found in the myana code as well as the structure of the data file (xtc) and how to extract useful information from itand 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.
In several of these examples, we fill root (histograms or NTuples. For more information on root, see http://root.cern.ch) histograms or NTuples.
Disclaimer: There is no more complete or up-to-date documentation than the code itself, so regard this document as an introduction and a user guide, not a complete documentation.
How to set up your own myana executable is explained in the DAQ section "A Simple Online Analysis Example".
myana makes use of the pdsdata library to read the datagrams from the xtc file.
Panel |
---|
pdsdata (pds = photon data system) ipimb - Intensity position, intensity monitor board The header files are in the top level directories of each package, and the |
xtc
The data from all the LCLS experiments are stored in xtc (extended container) files. These files contain "datagrams" which are an object of some type (TypeId) with associated status (Damage), source (Src) and extent (size). It is not an indexed file and does not provide random access, and can only be read seqencially. Thus, the example way to read the file shown here makes use of 'myana', a C++ executable that reads through the whole file and picks out the requested information. You can make your own version of 'myana' to extract other information.
You can explore the contents of an xtc file by using the xtcreader
utility:
Code Block |
---|
pslogin ~ > xtcreader -f myxtcfile.xtc | less
|
Reading through the output, you may see sections describing the various transitions in datataking. Look for these "headings" in the text output:
...
Tha data file format: xtc
The data recorded from the LCLS experiments are stored in xtc (extended container) files. These files contain "datagrams" which are an object of some type (TypeId) with associated status (Damage), source (Src) and extent (size). It is not an indexed file and does not provide random access, and can only be read seqencially, one event (shot) at a time.
You can explore the contents of an xtc file by using the xtcreader
utility:
Code Block |
---|
pslogin ~ > xtcreader -f myxtcfile.xtc | less
|
Reading through the output, you may see sections describing the various transitions in datataking. Look for these "headings" in the text output:
- Configure transition
- BeginRun transition
- BeginCalibCycle transition
- Enable transition
- L1Accept transition — This is the event data. Each event starts with "L1Accept transition:". From the text that follows, you can get an idea of what detector data is in the xtc file.
You also have the option of converting your experiments' xtc files into hdf5 files. More about data formats: Analysis Workbook. Data Formats
The pdsdata
library
The pdsdata (pds = photon data system) library contains all classes needed to read the xtc datagrams. In your analysis directory you'll find it in release/pdsdata/
.
Panel |
---|
ipimb - Intensity position, intensity monitor board The header files are in the top level directories of each package, and the |
...
. |
MyAna .... C++ program to extract information from xtc file
This example fetches data for each event and writes it to a root histogram and stores the histogram in a root file. You may want to store your data differently, e.g. one histogram for each event, or everything in a root ntuple for further processing. Or you can write some other format that you'd like to work with (ascii file, ... ).
...
Panel |
---|
examples/myana_cspad.cc, examples/CspadTemp.cc, examples/CspadTemp.hh |
...
Configuration and L1Accept Data retrieval functions:
The following contains a few lines of explanation for some of the functions defined in main.
But first some general remarks:
- Most of the functions return 0 if it was a successful function call, any other number means it failed.
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.
Panel | ||||||
---|---|---|---|---|---|---|
Acquiris digitizer | ||||||
Fetches the configuration information for any of the Acquiris devices. Returns 1 if the requested detector does not exist, and 2 if it was not in use. Tells you the number of channels used for this device, the number of samples collected and the sample interval. This is typically done in the
Fetches waveform data from any of the Acquiris devices. Fills your arrays with the waveform time and voltage, and optionally gives you the trigger time. In the myana.cc example, we fetch data from the AmoITof device (AMO Ion Time-of-flight).
|
Panel | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Image data | ||||||||||||
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:
|
...