/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
TaggingExample::CoincTag::CoincTag Class Reference
Inheritance diagram for TaggingExample::CoincTag::CoincTag:
Inheritance graph
[legend]
Collaboration diagram for TaggingExample::CoincTag::CoincTag:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def initTagList
def check

Public Attributes

 dTCut
 lastTimeStamp
 inputHeaders

Detailed Description

Coincidence Events

Definition at line 12 of file CoincTag.py.


Member Function Documentation

def TaggingExample::CoincTag::CoincTag::initTagList (   self)

Definition at line 16 of file CoincTag.py.

00017                          :
00018         
00019         self.addTag('Coinc' , '/Event/UserTag/Coinc/All')
00020         self.addTag('Prompt' , '/Event/UserTag/Coinc/Prompt')
00021         self.addTag('Delayed', '/Event/UserTag/Coinc/Delayed')
00022         
00023         self.dTCut = dTCut
00024         self.info("dT set to %.3f microsecond" % (self.dTCut/units.microsecond,))
00025         
00026         self.lastTimeStamp = 0
00027         # initialize a list of input headers to hold the rec headers of multiplets
00028         self.inputHeaders = []
        
def TaggingExample::CoincTag::CoincTag::check (   self,
  evt 
)

Definition at line 30 of file CoincTag.py.

00031                         :
00032         recHdr = evt["/Event/Rec/AdSimple"]
00033         if not recHdr:
00034             self.warning('cannot find recHdr')
00035             return FAILURE
00036 
00037         timeStamp = recHdr.timeStamp().GetSeconds() * units.second
00038         # self.info("executing #%d, TS=%.6f msec" % (self.execNumber, timeStamp))
00039         
00040         if (timeStamp - self.lastTimeStamp) > self.dTCut:
00041             if len(self.inputHeaders) == 0:
00042                 self.inputHeaders += [ recHdr ]
00043             elif len(self.inputHeaders) == 1:
00044                 self.inputHeaders = [ recHdr ]
00045             else:
00046                 # write a tag header object
00047                 
00048                 # write all events
00049                 self.info( '#%d: found %d coinc events' % 
00050                     (self.execNumber, len(self.inputHeaders)) )
00051                 self.getTag('Coinc').setInputHeaders(self.inputHeaders)
00052                 
00053                 # write prompt & delayed events
00054                 promptHeader  = self.getTag('Prompt').header
00055                 delayedHeader = self.getTag('Delayed').header
00056                 
00057                 for i, hdrI in enumerate(self.inputHeaders[:-1]):
00058                     for j, hdrJ in enumerate(self.inputHeaders[i+1:]):
00059                         promptHeader.addInputHeader(hdrI)
00060                         delayedHeader.addInputHeader(hdrJ)
00061                      
00062                 # clear out the inputHeaders
00063                 self.inputHeaders = [ recHdr ]
00064                 self.lastTimeStamp = timeStamp
00065                 
00066                 self.tagIt('Coinc')
00067                 self.tagIt('Prompt')
00068                 self.tagIt('Delayed')
00069                 return
00070         else:
00071             self.inputHeaders += [ recHdr ]
00072             
00073         self.lastTimeStamp = timeStamp
        

Member Data Documentation

Definition at line 16 of file CoincTag.py.

Definition at line 16 of file CoincTag.py.

Definition at line 16 of file CoincTag.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 09:54:29 for TaggingExample by doxygen 1.7.4