Page History
Introduction
LCLS Data Analysis frameworks are under development, and currently three approaches are being used and/or developed:
...
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
|
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, ... ).
...
All the functionality needed to get data from the xtc file is (or should be) defined in main.cc and in the files it includes (including the pdsdata library). Get an uppdated list of all the available functions by looking at main.hh (implementations are in main.cc).
More
...
example files
Panel |
---|
This version of the "user analysis module" shows how to obtain some more information from the xtc 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.
...
Acquiris digitizer
...
Panel | ||||||
---|---|---|---|---|---|---|
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).
| ||||||
...
Image data
...
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
There are several getters for various image data:
|
...
Other functions:
...
Code Block |
---|
------------------------------------------------------------------------------------------------------ Princeton camera ------------------------------------------------------------------------------------------------------ int getPrincetonConfig(Pds::DetInfo::Detector det, int iDevId, int& width, int& height, int& orgX, int& orgY, int& binX, int&binY); --> int getPrincetonValue(Pds::DetInfo::Detector det, int iDevId, unsigned short *& image); --> int getPrincetonTemperature(Pds::DetInfo::Detector det, int iDevId, float& temperature); ------------------------------------------------------------------------------------------------------ Ipimb detector (Intensity Position, Intensity Monitor Board) ------------------------------------------------------------------------------------------------------ int getIpimbConfig(Pds::DetInfo::Detector det, int iDevId); --> int getIpimbVolts(Pds::DetInfo::Detector det, int iDevId, float &channel0, float &channel1, float &channel2, float &channel3); --> ------------------------------------------------------------------------------------------------------ Encoder detector ------------------------------------------------------------------------------------------------------ int getEncoderConfig (Pds::DetInfo::Detector det, int iDevId); --> int getEncoderCount(Pds::DetInfo::Detector det, int iDevId, unsigned int& encoderCount); --> ------------------------------------------------------------------------------------------------------ DiodeFex ------------------------------------------------------------------------------------------------------ int getDiodeFexConfig (Pds::DetInfo::Detector det, int iDevId, float* base, float* scale); --> int getDiodeFexValue (Pds::DetInfo::Detector det, int iDevId, float& value); --> ------------------------------------------------------------------------------------------------------ Imp detector Fex (feature extraction) ------------------------------------------------------------------------------------------------------ int getIpmFexConfig (Pds::DetInfo::Detector det, int iDevId, float* base0, float* scale0, float* base1, float* scale1, float* base2, float* scale2, float* base3, float* scale3, float& xscale, float& yscale); int getIpmFexValue (Pds::DetInfo::Detector det, int iDevId, float* channels, float& sum, float& xpos, float& ypos); ------------------------------------------------------------------------------------------------------ Other functions that do not require (or have) configuration ------------------------------------------------------------------------------------------------------ int getFeeGasDet (double* shotEnergy); --> Gives you the shot energy to the array shotEnergy[4]. This information is obtained from the Front End Enclosure Gas Detector. 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) int getPhaseCavity(double& fitTime1, double& fitTime2, double& charge1, double& charge2); --> Gives you the phase cavity fit time (low and high?) and charges (before and after?). int getEvrDataNumber(); int getEvrData ( int id, unsigned int& eventCode, unsigned int& fiducial, unsigned int& timeStamp ); - eventCode tells you something about the beam quality of this event. Usually the event code is 140, meaning electrons were produced upstream (beam was on). It does not tell you about the photon status. Other codes: - fiducial - timestamp ------------------------------------------------------------------------------------------------------ EPICS ------------------------------------------------------------------------------------------------------ Get integers, floats, strings from any EPICS channel (PV = process variable) int getPvInt (const char* pvName, int& value); int getPvFloat (const char* pvName, float& value); int getPvString (const char* pvName, char*& value); |