Versions Compared

Key

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

...

Panel

myana.cc - example code to make that makes a simple averaging histogram
main.cc - defines the functions used by myana.cc

myana_morefeatures.cc - example code that does a little more than myana.cc
examples/myana_cspad.cc - example code to read out data from the CsPad XPP detector.

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

myana.hh, and myana.cc:

Panel

This is the "user analysis module". This is where you fill in your own code to extract the information that you want from your experiment's xtc file. This module contain only the following functions:

beginjob()     called at the beginning of an analysis job. You can for instance 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, process and store information about each event (shot).
endcalib()
endrun()
endjob()
In the example, a profile histogram is booked in beginjob() and voltage vs. time is filled in each event. The profile histogram displays the average value of all events.

main.hh, and main.cc:

Panel

This is the main control of the analysis, but you should avoid editing this file. After the all utility functions (in main) and user functions (in myana) have been read, main() is executed and controls the flow of the analysis. For each xtc file it calls

anafile(xtcname, maxevt, skip, iDebugLevel);

which iterates through the xtc file, keeps track of all the datagrams in it, and makes sure to execute your beginjob() and event() functions.

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 examples

...

myana_morefeatures.hh,cc:

...