psana_examples/src/dump_epixsampler.py

Go to the documentation of this file.
00001 #--------------------------------------------------------------------------
00002 # File and Version Information:
00003 #  $Id: dump_epixsampler.py 7280 2013-12-03 08:00:15Z salnikov@SLAC.STANFORD.EDU $
00004 #
00005 # Description:
00006 #  Psana user analysis module dump_epixsampler...
00007 #
00008 #------------------------------------------------------------------------
00009 
00010 """Example psana module to dump epixsampler data
00011 
00012 This software was developed for the LCLS project.  If you use all or 
00013 part of it, please give an appropriate acknowledgment.
00014 
00015 @version $Id: dump_epixsampler.py 7280 2013-12-03 08:00:15Z salnikov@SLAC.STANFORD.EDU $
00016 
00017 @author Andy Salnikov
00018 """
00019 
00020 #------------------------------
00021 #  Module's version from SVN --
00022 #------------------------------
00023 __version__ = "$Revision: 7280 $"
00024 # $Source$
00025 
00026 #--------------------------------
00027 #  Imports of standard modules --
00028 #--------------------------------
00029 import sys
00030 import logging
00031 
00032 #-----------------------------
00033 # Imports for other modules --
00034 #-----------------------------
00035 from psana import *
00036 
00037 #----------------------------------
00038 # Local non-exported definitions --
00039 #----------------------------------
00040 
00041 #---------------------
00042 #  Class definition --
00043 #---------------------
00044 class dump_epixsampler (object) :
00045     '''Class whose instance will be used as a user analysis module.'''
00046 
00047     #----------------
00048     #  Constructor --
00049     #----------------
00050     def __init__(self):
00051         self.m_src = self.configSrc('source', ':EpixSampler')
00052 
00053     #-------------------
00054     #  Public methods --
00055     #-------------------
00056 
00057     def beginRun( self, evt, env ) :
00058         config = env.configStore().get(EpixSampler.Config, self.m_src)
00059         if config:
00060             print "dump_epixsampler: %s: %s" % (config.__class__.__name__, self.m_src)
00061             print "  version =", config.version()
00062             print "  runTrigDelay =", config.runTrigDelay()
00063             print "  daqTrigDelay =", config.daqTrigDelay()
00064             print "  daqSetting =", config.daqSetting()
00065             print "  adcClkHalfT =", config.adcClkHalfT()
00066             print "  adcPipelineDelay =", config.adcPipelineDelay()
00067             print "  digitalCardId0 =", config.digitalCardId0()
00068             print "  digitalCardId1 =", config.digitalCardId1()
00069             print "  analogCardId0 =", config.analogCardId0()
00070             print "  analogCardId1 =", config.analogCardId1()
00071             print "  numberOfChannels =", config.numberOfChannels()
00072             print "  samplesPerChannel =", config.samplesPerChannel()
00073             print "  baseClockFrequency =", config.baseClockFrequency()
00074             print "  testPatternEnable =", config.testPatternEnable()
00075 
00076     def event( self, evt, env ) :
00077 
00078         data = evt.get(EpixSampler.Element, self.m_src)
00079         if not data:
00080             return
00081 
00082         print "dump_epixsampler: %s: %s" % (data.__class__.__name__, self.m_src)
00083         print "  vc =", data.vc()
00084         print "  lane =", data.lane()
00085         print "  acqCount =", data.acqCount()
00086         print "  frameNumber =", data.frameNumber()
00087         print "  ticks =", data.ticks()
00088         print "  fiducials =", data.fiducials()
00089         print "  temperatures =", data.temperatures()
00090         print "  frame =", data.frame()

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7