This script lives in /sdf/group/lcls/ds/ana/tutorials/psana1_examples/evr.py.  EVR data is often used to determine what happened on an event by looking at "event codes".  Experiments often use these event codes to indicate whether a pump laser was on/off for a particular shot, or whether beam was present on that shot ("dropped shots").  Experiments sometimes set up complex "event sequences" to create different behavior on different shots (via different event-codes generated by the LCLS timing system).

from psana import *
ds = DataSource('exp=xpptut15:run=54:smd')
evr = Detector('evr0')
for nevent,evt in enumerate(ds.events()):
    if nevent==3: break
    ec = evr.eventCodes(evt)
    if ec is None:
        continue
    print(ec)

References

  • EvrDetector - documentation of methods to access EVR data.