Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

ldfContribution.py

00001 #!/usr/local/bin/python
00002 #
00003 #                               Copyright 2006
00004 #                                     by
00005 #                        The Board of Trustees of the
00006 #                     Leland Stanford Junior University.
00007 #                            All rights reserved.
00008 #
00009 
00010 __facility__ = "Online"
00011 __abstract__ = "LDF event contribution class"
00012 __author__   = "R. Claus <Claus@SLAC.Stanford.edu> SLAC - GLAST LAT I&T/Online"
00013 __date__     = "3/30/2006"
00014 __updated__  = ("$Date: 2006/07/14 22:27:33 $").split(' ')[1]
00015 __version__  = "$Revision: 1.1 $"
00016 __release__  = "$Name: R04-12-00 $"
00017 __credits__  = "SLAC"
00018 
00019 #import copyright_SLAC
00020 
00021 import struct
00022 import LDF
00023 
00024 import LATTE.merger.geb as geb
00025 
00026 
00027 class LdfContribution(geb.GebContribution):
00028   def __init__(self, contributor, contribution):
00029     geb.GebContribution.__init__(self, contributor)
00030     #self.__contribution = LDF.EBFevent.create(contribution, len(contribution)) # Swaps
00031     self.__contribution = contribution
00032 
00033   def identity(self):
00034     #return self.__contribution.identity().value()
00035     return struct.unpack('>L', self.__contribution[0*4:1*4])[0]
00036 
00037   def length(self):
00038     #return self.__contribution.length()
00039     return struct.unpack('>L', self.__contribution[1*4:2*4])[0]
00040 
00041   def sequence(self):
00042     summary = struct.unpack('>L', self.__contribution[3*4:4*4])[0]
00043     #evtNo = LDF.EventSummary.eventNumber(summary)
00044     #tag   = LDF.EventSummary.tag        (summary)
00045     evtNo  = (summary <<  1) & 0x1fffc  # 0x7fff << 2
00046     tag    = (summary >> 28) & 0x0003
00047     return self.contributor().sequence(evtNo | tag)
00048 
00049   def buffer(self):
00050     #return self.__contribution.string() # Swaps
00051     return self.__contribution

Generated on Fri Jul 21 13:26:30 2006 for LATTE R04-12-00 by doxygen 1.4.3