psana_examples/src/dump_partition.py

Go to the documentation of this file.
00001 #--------------------------------------------------------------------------
00002 # File and Version Information:
00003 #       $Id:
00004 #
00005 # Description:
00006 #       Class DumpPartition...
00007 #
00008 # Author List:
00009 #
00010 #------------------------------------------------------------------------
00011 
00012 #--------------------------------
00013 #  Imports of standard modules --
00014 #--------------------------------
00015 import sys
00016 import logging
00017 
00018 #-----------------------------
00019 # Imports for other modules --
00020 #-----------------------------
00021 from psana import *
00022 
00023 #----------------------------------
00024 # Local non-exported definitions --
00025 #----------------------------------
00026 
00027 def _printPartition(config):
00028     print "Partition::ConfigV1:"
00029     print "  bldMask: 0x%16.16x" % config.bldMask()
00030     print "  numSources: %d" % config.numSources()
00031     sources = config.sources()
00032     for source in sources:
00033         src = source.src()
00034         group = source.group()
00035         print "    src= %s group= %s" % (src,group)
00036     
00037 #---------------------
00038 #  Class definition --
00039 #---------------------
00040 class dump_partition (object) :
00041     '''Class whose instance will be used as a user analysis module.'''
00042 
00043     #----------------
00044     #  Constructor --
00045     #----------------
00046     def __init__(self):
00047         '''Class constructor. Does not need any parameters'''
00048         pass
00049 
00050     #-------------------
00051     #  Public methods --
00052     #-------------------
00053 
00054     def beginJob( self, evt, env ) :
00055         """This optional method is called if present at the beginning 
00056         of the new run.
00057 
00058         @param evt    event data object
00059         @param env    environment object
00060         """
00061 
00062         config = env.configStore().get(Partition.ConfigV1, Source("ProcInfo()"))
00063         if config:
00064             print "dump_partition in beginJob()"
00065             _printPartition(config)
00066 
00067 
00068     def event( self, evt, env ) :
00069         """This method is called for every L1Accept transition.
00070 
00071         @param evt    event data object
00072         @param env    environment object
00073         """
00074         pass

Generated on 19 Dec 2016 for PSANAmodules by  doxygen 1.4.7