00001 #!/usr/local/bin/python 00002 # 00003 # Copyright 2004 00004 # by 00005 # The Board of Trustees of the 00006 # Leland Stanford Junior University. 00007 # All rights reserved. 00008 # 00009 00010 00011 __facility__ = "Trigger" 00012 __abstract__ = "Helper function for trigger display" 00013 __author__ = "Martin Kocian, SLAC" 00014 __date__ = ("$Date: 2005/05/16 18:30:35 $").split(' ')[1] 00015 __version__ = "$Revision: 2.1 $" 00016 __release__ = "$Name: R04-12-00 $" 00017 __credits__ = "SLAC" 00018 00019 def listmean(list,element,numsamples): 00020 list.append(element) 00021 while len(list)>numsamples: 00022 list.pop(0) 00023 mean=0. 00024 if len(list)>0: 00025 for el in list: 00026 mean+=el 00027 mean/=len(list) 00028 return mean 00029 00030