/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Public Attributes
DybEventMgr::Framer::FramingAlg Class Reference
Inheritance diagram for DybEventMgr::Framer::FramingAlg:
Inheritance graph
[legend]
Collaboration diagram for DybEventMgr::Framer::FramingAlg:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def setFramer
def initialize
def newFrame
def getChunk
def add
def execute

Public Attributes

 framer
 chunk_location
 frame_collection_location

Detailed Description

An algorithm that will collect readouts until a gap is found.

Definition at line 45 of file Framer.py.


Constructor & Destructor Documentation

def DybEventMgr::Framer::FramingAlg::__init__ (   self,
  framer = None,
  chunk_location = '/Event/EventBuilder/Chunk',
  frame_collection_location = '/Event/EventBuilder/Frames' 
)

Definition at line 51 of file Framer.py.

00054                                                                           :
00055         DybPythonAlg.__init__(self,'FramingAlg')
00056         self.framer = framer
00057         self.chunk_location = chunk_location
00058         self.frame_collection_location = frame_collection_location
00059         return


Member Function Documentation

def DybEventMgr::Framer::FramingAlg::setFramer (   self,
  framer 
)

Definition at line 60 of file Framer.py.

00061                               :
00062         self.framer = framer
00063         return

def DybEventMgr::Framer::FramingAlg::initialize (   self)

Definition at line 64 of file Framer.py.

00065                         :
00066         sc = DybPythonAlg.initialize(self)
00067         if sc.isFailure(): return sc
00068 
00069         if not self.framer:
00070             error('Not given a framer')
00071             return FAILURE
00072 
00073         return SUCCESS
    
def DybEventMgr::Framer::FramingAlg::newFrame (   self)

Definition at line 74 of file Framer.py.

00075                       :
00076         'Return a tuple of HO to be (event,frame) tags'
00077         frame = gbl.DayaBay.HeaderObject()
00078         self.initializeHeader(frame);
00079         #print 'Made a new Frame, it has %d references, adding one' % frame.refCount()
00080         #frame.addRef()
00081         return frame

def DybEventMgr::Framer::FramingAlg::getChunk (   self)
Return a pythonic chunk of readouts ordered by trigger time

Definition at line 82 of file Framer.py.

00083                       :
00084         '''
00085         Return a pythonic chunk of readouts ordered by trigger time
00086         '''
00087         tes = self.evtSvc()
00088         chunkObj = tes[self.chunk_location]
00089         if not chunkObj: 
00090             self.debug('No chunk found at "%s"' % self.chunk_location)
00091             return []
00092 
00093         chunk = inputHeaders2list(chunkObj)
00094         chunk.sort(header_object_order)
00095         self.debug('Got chunk with %d (%d) ReadoutHeaders at "%s"' % (len(chunk),chunkObj.inputHeaders().size(),self.chunk_location))
00096         return chunk

def DybEventMgr::Framer::FramingAlg::add (   self,
  roh_list 
)
Add the list of ReadoutHeaders to a frame tag and return it

Definition at line 97 of file Framer.py.

00098                           :
00099         '''
00100         Add the list of ReadoutHeaders to a frame tag and return it
00101         '''
00102         self.debug('Adding frame with %d readouts' % len(roh_list))
00103         #for roh in roh_list:
00104         #    self.debug('\t%s' % hostr(roh))
00105 
00106         frameTag = self.newFrame()
00107         fillInputHeaders(frameTag,roh_list)
00108         #self.debug('Made frame: "%s"' % hostr(frameTag))
00109         return frameTag
00110 

def DybEventMgr::Framer::FramingAlg::execute (   self)

Definition at line 111 of file Framer.py.

00112                      :
00113         chunk = self.getChunk()
00114         if not chunk: return SUCCESS
00115 
00116         frames = []
00117         while chunk:
00118             roh_list = self.framer(chunk)
00119             if not roh_list: break
00120             frame = self.add(roh_list)
00121             frames.append(frame)
00122             continue
00123 
00124         frame_collection = gbl.DayaBay.HeaderObject()
00125         self.initializeHeader(frame_collection);
00126         fillInputHeaders(frame_collection,frames)
00127 
00128         tes = self.evtSvc()
00129         tes[self.frame_collection_location] = frame_collection
00130 
00131         #self.debug('Saved frames: "%s" to "%s"' % (hostr(frame_collection), self.frame_collection_location))
00132 
00133         return SUCCESS


Member Data Documentation

Definition at line 51 of file Framer.py.

Definition at line 51 of file Framer.py.

Definition at line 51 of file Framer.py.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 10:09:08 for DybEventMgr by doxygen 1.7.4