psana_examples/src/dump_epix.py

Go to the documentation of this file.
00001 #--------------------------------------------------------------------------
00002 # File and Version Information:
00003 #  $Id: dump_epix.py 7439 2013-12-20 00:24:44Z salnikov@SLAC.STANFORD.EDU $
00004 #
00005 # Description:
00006 #  Psana user analysis module dump_epix...
00007 #
00008 #------------------------------------------------------------------------
00009 
00010 """Example psana module to dump epix 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_epix.py 7439 2013-12-20 00:24:44Z salnikov@SLAC.STANFORD.EDU $
00016 
00017 @author Andy Salnikov
00018 """
00019 
00020 #------------------------------
00021 #  Module's version from SVN --
00022 #------------------------------
00023 __version__ = "$Revision: 7439 $"
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_epix (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', ':Epix')
00052 
00053     #-------------------
00054     #  Public methods --
00055     #-------------------
00056 
00057     def beginRun( self, evt, env ) :
00058         config = env.configStore().get(Epix.Config, self.m_src)
00059         if config:
00060             print "dump_epix: %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 "  dacSetting =", config.dacSetting()
00065             print "  asicGR =", config.asicGR()
00066             print "  asicAcq =", config.asicAcq()
00067             print "  asicR0 =", config.asicR0()
00068             print "  asicPpmat =", config.asicPpmat()
00069             print "  asicPpbe =", config.asicPpbe()
00070             print "  asicRoClk =", config.asicRoClk()
00071             print "  asicGRControl =", config.asicGRControl()
00072             print "  asicAcqControl =", config.asicAcqControl()
00073             print "  asicR0Control =", config.asicR0Control()
00074             print "  asicPpmatControl =", config.asicPpmatControl()
00075             print "  asicPpbeControl =", config.asicPpbeControl()
00076             print "  asicR0ClkControl =", config.asicR0ClkControl()
00077             print "  prepulseR0En =", config.prepulseR0En()
00078             print "  adcStreamMode =", config.adcStreamMode()
00079             print "  testPatternEnable =", config.testPatternEnable()
00080             print "  acqToAsicR0Delay =", config.acqToAsicR0Delay()
00081             print "  asicR0ToAsicAcq =", config.asicR0ToAsicAcq()
00082             print "  asicAcqWidth =", config.asicAcqWidth()
00083             print "  asicAcqLToPPmatL =", config.asicAcqLToPPmatL()
00084             print "  asicRoClkHalfT =", config.asicRoClkHalfT()
00085             print "  adcReadsPerPixel =", config.adcReadsPerPixel()
00086             print "  adcClkHalfT =", config.adcClkHalfT()
00087             print "  asicR0Width =", config.asicR0Width()
00088             print "  adcPipelineDelay =", config.adcPipelineDelay()
00089             print "  prepulseR0Width =", config.prepulseR0Width()
00090             print "  prepulseR0Delay =", config.prepulseR0Delay()
00091             print "  digitalCardId0 =", config.digitalCardId0()
00092             print "  digitalCardId1 =", config.digitalCardId1()
00093             print "  analogCardId0 =", config.analogCardId0()
00094             print "  analogCardId1 =", config.analogCardId1()
00095             print "  lastRowExclusions =", config.lastRowExclusions()
00096             print "  numberOfAsicsPerRow =", config.numberOfAsicsPerRow()
00097             print "  numberOfAsicsPerColumn =", config.numberOfAsicsPerColumn()
00098             print "  numberOfRowsPerAsic =", config.numberOfRowsPerAsic()
00099             print "  numberOfPixelsPerAsicRow =", config.numberOfPixelsPerAsicRow()
00100             print "  baseClockFrequency =", config.baseClockFrequency()
00101             print "  asicMask =", config.asicMask()
00102             print "  asicPixelTestArray =", config.asicPixelTestArray()
00103             print "  asicPixelMaskArray =", config.asicPixelMaskArray()
00104             print "  numberOfRows =", config.numberOfRows()
00105             print "  numberOfColumns =", config.numberOfColumns()
00106             print "  numberOfAsics =", config.numberOfAsics()
00107             
00108             for i in range(config.numberOfAsics()):
00109                 aconfig = config.asics(i)
00110                 print "    Epix.AsicConfigV1 #%d" % i
00111                 print "      monostPulser =", aconfig.monostPulser()
00112                 print "      dummyTest =", aconfig.dummyTest()
00113                 print "      dummyMask =", aconfig.dummyMask()
00114                 print "      pulser =", aconfig.pulser()
00115                 print "      pbit =", aconfig.pbit()
00116                 print "      atest =", aconfig.atest()
00117                 print "      test =", aconfig.test()
00118                 print "      sabTest =", aconfig.sabTest()
00119                 print "      hrTest =", aconfig.hrTest()
00120                 print "      digMon1 =", aconfig.digMon1()
00121                 print "      digMon2 =", aconfig.digMon2()
00122                 print "      pulserDac =", aconfig.pulserDac()
00123                 print "      Dm1En =", aconfig.Dm1En()
00124                 print "      Dm2En =", aconfig.Dm2En()
00125                 print "      slvdSBit =", aconfig.slvdSBit()
00126                 print "      VRefDac =", aconfig.VRefDac()
00127                 print "      TpsTComp =", aconfig.TpsTComp()
00128                 print "      TpsMux =", aconfig.TpsMux()
00129                 print "      RoMonost =", aconfig.RoMonost()
00130                 print "      TpsGr =", aconfig.TpsGr()
00131                 print "      S2dGr =", aconfig.S2dGr()
00132                 print "      PpOcbS2d =", aconfig.PpOcbS2d()
00133                 print "      Ocb =", aconfig.Ocb()
00134                 print "      Monost =", aconfig.Monost()
00135                 print "      FastppEnable =", aconfig.FastppEnable()
00136                 print "      Preamp =", aconfig.Preamp()
00137                 print "      PixelCb =", aconfig.PixelCb()
00138                 print "      S2dTComp =", aconfig.S2dTComp()
00139                 print "      FilterDac =", aconfig.FilterDac()
00140                 print "      TC =", aconfig.TC()
00141                 print "      S2d =", aconfig.S2d()
00142                 print "      S2dDacBias =", aconfig.S2dDacBias()
00143                 print "      TpsTcDac =", aconfig.TpsTcDac()
00144                 print "      TpsDac =", aconfig.TpsDac()
00145                 print "      S2dTcDac =", aconfig.S2dTcDac()
00146                 print "      S2dDac =", aconfig.S2dDac()
00147                 print "      TestBe =", aconfig.TestBe()
00148                 print "      IsEn =", aconfig.IsEn()
00149                 print "      DelExec =", aconfig.DelExec()
00150                 print "      DelCckReg =", aconfig.DelCckReg()
00151                 print "      RowStartAddr =", aconfig.RowStartAddr()
00152                 print "      RowStopAddr =", aconfig.RowStopAddr()
00153                 print "      ColStartAddr =", aconfig.ColStartAddr()
00154                 print "      ColStopAddr =", aconfig.ColStopAddr()
00155                 print "      chipID =", aconfig.chipID()
00156 
00157     def event( self, evt, env ) :
00158 
00159         data = evt.get(Epix.Element, self.m_src)
00160         if not data:
00161             return
00162 
00163         print "dump_epix: %s: %s" % (data.__class__.__name__, self.m_src)
00164         print "  vc =", data.vc()
00165         print "  lane =", data.lane()
00166         print "  acqCount =", data.acqCount()
00167         print "  frameNumber =", data.frameNumber()
00168         print "  ticks =", data.ticks()
00169         print "  fiducials =", data.fiducials()
00170         print "  frame =", data.frame()
00171         print "  excludedRows =", data.excludedRows()
00172         print "  temperatures =", data.temperatures()
00173         print "  lastWord =", data.lastWord()

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7