Versions Compared

Key

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

...

  • Import the psana module:
    Code Block
    import psana
    
  • Open the data set. Note the syntax for the data set specification string:
    Code Block
    dsname = "exp=sxrtut13:run=366"
    ds = psana.DataSetDataSource(dsname)
    
  • Note that by default the framework will look for XTC files at the standard location where all experimental data are supposed to be. If you want to play with HDF5 (in case there is an HDF5 version of the run) you can change that string by appending h5 in the end:
    Code Block
    dsname = "exp=sxrtut13:run=366:h5"
    
  • The next thing which this code will do will be to iterate over all events. At each step you will get a reference to an event object evt and it will extract and print an identifier of the event:
    Code Block
    for evtnum, evt in enumerate(ds.events()):
        id = evt.get(psana.EventId)
        print "%6d:" % evtnum, id
    

...