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

Compare with Current View Page History

« Previous Version 12 Next »

This is a test version, under construction. Feel free to edit / make corrections (or send me feedback).

Documentation of LCLS Data Analysis Software

LCLS Data Analysis is under development, and currently three approaches are
being used and/or developed:
  - myana ... simple C++ code to read xtc file. Provided (and used) by the DAQ group.
  - pyana ... analysis framework using python.
  - PSAna ... analysis framework using C++. This is still in the design phase.

Currently only myana and pyana are usable for analysis.

Disclaimer: There is no more complete or up-to-date documentation than
the code itself, so regard this documentat as an introduction and user guide,
not a complete documentation. This document attempts to explain the meaning
of the cryptic names of classes and variables in the code as they exist today
(Sept 2010). Much of the code will change over time, so keep an eye out for
new functionalities in the code itself.  We also aim to explain the structure
of the data file (xtc) and how to extract useful information from it.

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.

How to set up your own myana executable is explained in the DAQ section "A Simple Online Analysis Example".

----------------------------------------------------------------------------------

MyAna   ....     C++ program to extract information from xtc file

myana.cc - example code to make a simple averaging histogram

myana_morefeatures.cc - example code that does a little more.

main.cc - defines the functions used by myana.cc

Uses the pdsdata library which is needed to read the xtc files. Will include some documentation for that too.

Here's a brief description of the functions of myana.cc and main.cc

myana.hh,cc:

        This is the "user analysis module". It reads through the xtc sequencially, and records
        the information according to user chocie. You can't access a given event (shot) randomly,
        not until you've made a first pass through all the events and stored the information in
        your format of choice. This module contain only the following functions:

         beginjob    ...    called at the beginning of an analysis job. E.g. book histograms here.
         beginrun    ...    called at the beginning of a run (the analysis job might analyze several runs)
         begincalib  ...    called for each calibration cycle

         event       ...    This is where you fetch information about each event (shot).

         endcalib    ...
         endrun      ...
         endjob      ...

         The example here fetches data from devices for each event and writes it to a root histogram.
         You may want to store the information in e.g. a root ntuple for further processing. Or to some
         other format that you'd like to work with (ascii file, ... ).

main.hh,cc:

         The functionality needed to get data from the xtc file is all here, and in the files it includes
         (all in the package pdsdata (PDS == photon data system)). Here is a few lines of explanation for
         the functions defined in main:

         Enums:
         These define number mapping for each detector.  E.g. AcqDetector::AmoIms is equivalent to
         the constant 0. You are encouraged to use the names instead of the numbers, in case the
         underlying order changes in a new versio of the program.

         Configuration and L1Accept Data retrieval functions:

         getAcqConfig - fetches the configuration information for any of the Acquiris devices.
                        Checks that the detector has been used / has data, and tells you the number
                        of channels used, number of samples collected and the sample interval.
                        This is typically done in the myana::beginjob() or myana::beginrun() functions.
                        Specify with enum which device you want information from, and supply a
                        pointer to two integers and a double: numChannels, numSamples, sampleInterval.
         getAcqValue  - fetches data from any of the Acquiris devices.
                        Specify with enum which device you want the information from, and an integer
                        to store channel information, as well as pointers two arrays of doubles. These will
                        be pointed to time information and voltage information. Optional: you can also
                        supply a pointer to another double, which will be pointed to trigger time.

                        In the myana.cc example, we fetch data from the AmoITof device (AMO Ion Time-of-flight).
                        Other Acquiris devices (see main.hh for an up-to-date list):

                        AMO:
                            AmoIms         - ion momentum spectrometer
                            AmoGasdet    - gas detector (in the Front End Enclusure)
                            AmoETof       - electron time-of-flight
                            AmoMbes      - magnetic bottle electron spectrometer
                            AmoVmiAcq   - (Vmi = Velocity mapping imaging)
                            AmoBpsAcq   - (Bps = Beam position screen)
                            Camp            - for the CAMP experimental setup
                        SXR:
                            SxrBeamlineAcq1
                            SxrBeamlineAcq2
                            SxrEndstationAcq1
                            SxrEndstationAcq2

  • No labels