Page History
This is a test version, under construction. Send feedback and/or feel free to edit / make corrections!
...
Currently only myana and pyana are usable for analysis.
----------------------------------------------------------------------------------
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:
AMO:
AmoIms - ion momentum spectrometer
AmoGasdet -
AmoETof - electron time-of-flight
AmoMbes - magnetic bottle electron spectrometer
AmoVmiAcq -
AmoBpsAcq -
Camp -
SXR:
SxrBeamlineAcq1
SxrBeamlineAcq2
SxrEndstationAcq1
SxrEndstationAcq2
getFrameConfig - Checks that the xtc file has got data from this device.
getFrameValue - fetches an image from the FrameDetector of your choice.
Specify the detector (using an appropriate enum), give pointers to
int frame width, frame height and short imgage of the Camera::FrameV1.
Other frame detectors:
AMO:
AmoVmi
AmoBps1
AmoBps2
SXR:
SxrBeamlineOpal1
SxrBeamlineOpal2
SxrEndstationOpal1
SxrEndstationOpal2
SxrFccd
XPP:
XppSb1PimCvd
XppMonPimCvd
XppSb3PimCvd
XppSb4PimCvd
You need another function to access data from the Opal cameras:
getOpal1kValue(Opal1kDetector det, int& frameWidth, int& frameHeight, unsigned short*& image )
- This function gets an Camera::FrameV1& frame. (But what does it do with it?)
Possible Opal1kDetectors:
AmoVmi
AmoBps1
AmoBps2